MTS_SPI_Slave unfinished
Fork of MTS-Serial by
MTS_SPI_Slave.h@14:d5a86071845e, 2017-11-16 (annotated)
- Committer:
- ScottHoppeMultitech
- Date:
- Thu Nov 16 17:02:41 2017 +0000
- Revision:
- 14:d5a86071845e
- Parent:
- 13:010d349bc731
added Thread member
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ScottHoppeMultitech | 13:010d349bc731 | 1 | #ifndef MTS_SPI_Slave_H |
ScottHoppeMultitech | 13:010d349bc731 | 2 | #define MTS_SPI_Slave_H |
ScottHoppeMultitech | 13:010d349bc731 | 3 | |
ScottHoppeMultitech | 13:010d349bc731 | 4 | #include "MTSBufferedIO.h" |
ScottHoppeMultitech | 13:010d349bc731 | 5 | |
ScottHoppeMultitech | 13:010d349bc731 | 6 | namespace mts |
ScottHoppeMultitech | 13:010d349bc731 | 7 | { |
ScottHoppeMultitech | 13:010d349bc731 | 8 | |
ScottHoppeMultitech | 13:010d349bc731 | 9 | |
ScottHoppeMultitech | 13:010d349bc731 | 10 | class MTS_SPI_Slave : public MTSBufferedIO |
ScottHoppeMultitech | 13:010d349bc731 | 11 | { |
ScottHoppeMultitech | 13:010d349bc731 | 12 | public: |
ScottHoppeMultitech | 13:010d349bc731 | 13 | |
ScottHoppeMultitech | 13:010d349bc731 | 14 | MTS_SPI_Slave(PinName mosi, PinName miso, PinName sclk, PinName ssel, int txBufferSize = 256, int rxBufferSize = 256); |
ScottHoppeMultitech | 13:010d349bc731 | 15 | |
ScottHoppeMultitech | 13:010d349bc731 | 16 | ~MTS_SPI_Slave(); |
ScottHoppeMultitech | 13:010d349bc731 | 17 | |
ScottHoppeMultitech | 13:010d349bc731 | 18 | void recieved_Read(); |
ScottHoppeMultitech | 13:010d349bc731 | 19 | |
ScottHoppeMultitech | 13:010d349bc731 | 20 | void frequency(int frequency); |
ScottHoppeMultitech | 13:010d349bc731 | 21 | |
ScottHoppeMultitech | 13:010d349bc731 | 22 | void format(int format_bits=8,int format_mode=0); |
ScottHoppeMultitech | 13:010d349bc731 | 23 | |
ScottHoppeMultitech | 13:010d349bc731 | 24 | protected: |
ScottHoppeMultitech | 13:010d349bc731 | 25 | SPISlave spi; |
ScottHoppeMultitech | 13:010d349bc731 | 26 | |
ScottHoppeMultitech | 13:010d349bc731 | 27 | private: |
ScottHoppeMultitech | 13:010d349bc731 | 28 | virtual int receive(); |
ScottHoppeMultitech | 13:010d349bc731 | 29 | virtual void handleRead(); |
ScottHoppeMultitech | 13:010d349bc731 | 30 | virtual void handleWrite(); |
ScottHoppeMultitech | 14:d5a86071845e | 31 | Thread* _thread; |
ScottHoppeMultitech | 13:010d349bc731 | 32 | }; |
ScottHoppeMultitech | 13:010d349bc731 | 33 | |
ScottHoppeMultitech | 13:010d349bc731 | 34 | } |
ScottHoppeMultitech | 13:010d349bc731 | 35 | |
ScottHoppeMultitech | 13:010d349bc731 | 36 | #endif /* MTS_SPI_Slave_H */ |