swspi.h 440 B

1234567891011121314
  1. // Software SPI
  2. #ifndef SWSPI_H
  3. #define SWSPI_H
  4. //initialize gpio
  5. extern void swspi_init(unsigned char miso, unsigned char mosi, unsigned char sck, unsigned char cfg);
  6. //transmit and receive (full duplex mode)
  7. extern unsigned char swspi_txrx(unsigned char tx);
  8. //transmit (half dublex mode, miso == mosi)
  9. extern void swspi_tx(unsigned char tx);
  10. //receive (half dublex mode, miso == mosi)
  11. extern unsigned char swspi_rx();
  12. #endif //SWSPI_H