MTS_SPI_Slave unfinished
Fork of MTS-Serial by
Diff: MTS_SPI_Slave.h
- Revision:
- 13:010d349bc731
- Child:
- 14:d5a86071845e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MTS_SPI_Slave.h Thu Nov 16 16:13:57 2017 +0000 @@ -0,0 +1,35 @@ +#ifndef MTS_SPI_Slave_H +#define MTS_SPI_Slave_H + +#include "MTSBufferedIO.h" + +namespace mts +{ + + +class MTS_SPI_Slave : public MTSBufferedIO +{ +public: + + MTS_SPI_Slave(PinName mosi, PinName miso, PinName sclk, PinName ssel, int txBufferSize = 256, int rxBufferSize = 256); + + ~MTS_SPI_Slave(); + + void recieved_Read(); + + void frequency(int frequency); + + void format(int format_bits=8,int format_mode=0); + +protected: + SPISlave spi; + +private: + virtual int receive(); + virtual void handleRead(); + virtual void handleWrite(); +}; + +} + +#endif /* MTS_SPI_Slave_H */