MTS_SPI_Slave unfinished

Fork of MTS-Serial by MultiTech

Committer:
ScottHoppeMultitech
Date:
Thu Nov 16 16:13:57 2017 +0000
Revision:
13:010d349bc731
Child:
14:d5a86071845e
unfinished

Who changed what in which revision?

UserRevisionLine numberNew 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 13:010d349bc731 31 };
ScottHoppeMultitech 13:010d349bc731 32
ScottHoppeMultitech 13:010d349bc731 33 }
ScottHoppeMultitech 13:010d349bc731 34
ScottHoppeMultitech 13:010d349bc731 35 #endif /* MTS_SPI_Slave_H */