2017-08-17 13:23:34 +00:00
|
|
|
// Software SPI
|
2017-07-12 15:54:41 +00:00
|
|
|
#ifndef SWSPI_H
|
|
|
|
#define SWSPI_H
|
|
|
|
|
2017-08-17 13:23:34 +00:00
|
|
|
//initialize gpio
|
|
|
|
extern void swspi_init(unsigned char miso, unsigned char mosi, unsigned char sck, unsigned char cfg);
|
|
|
|
//transmit and receive (full duplex mode)
|
|
|
|
extern unsigned char swspi_txrx(unsigned char tx);
|
|
|
|
//transmit (half dublex mode, miso == mosi)
|
|
|
|
extern void swspi_tx(unsigned char tx);
|
|
|
|
//receive (half dublex mode, miso == mosi)
|
|
|
|
extern unsigned char swspi_rx();
|
2017-07-12 15:54:41 +00:00
|
|
|
|
|
|
|
#endif //SWSPI_H
|