bosko lekovic
/
IO_board
IO plocana FRDM K64
temp/IOgpiospi.h@16:a3085300cac3, 2021-04-30 (annotated)
- Committer:
- bosko001
- Date:
- Fri Apr 30 00:08:07 2021 +0200
- Revision:
- 16:a3085300cac3
- Parent:
- 7:4aa3dac73b66
i zero crossing dodat
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bosko001 | 7:4aa3dac73b66 | 1 | #ifndef IOGPIOSPI_H |
bosko001 | 7:4aa3dac73b66 | 2 | #define IOGPIOSPI_H |
bosko001 | 7:4aa3dac73b66 | 3 | |
bosko001 | 7:4aa3dac73b66 | 4 | |
bosko001 | 7:4aa3dac73b66 | 5 | #include "mbed.h" |
bosko001 | 7:4aa3dac73b66 | 6 | |
bosko001 | 7:4aa3dac73b66 | 7 | //typedef void (*pf_pc_c)(char* tx, char rx); |
bosko001 | 7:4aa3dac73b66 | 8 | |
bosko001 | 7:4aa3dac73b66 | 9 | |
bosko001 | 7:4aa3dac73b66 | 10 | class C_gpioSpi |
bosko001 | 7:4aa3dac73b66 | 11 | { |
bosko001 | 7:4aa3dac73b66 | 12 | private: |
bosko001 | 7:4aa3dac73b66 | 13 | DigitalIn *p_MOSI; |
bosko001 | 7:4aa3dac73b66 | 14 | DigitalOut *p_MISO; |
bosko001 | 7:4aa3dac73b66 | 15 | InterruptIn *p_SpiClock; |
bosko001 | 7:4aa3dac73b66 | 16 | |
bosko001 | 7:4aa3dac73b66 | 17 | char bitCount = 0; |
bosko001 | 7:4aa3dac73b66 | 18 | char readData; |
bosko001 | 7:4aa3dac73b66 | 19 | char writeData = 0; |
bosko001 | 7:4aa3dac73b66 | 20 | // pf_pc_c transfer_fun = nullptr; |
bosko001 | 7:4aa3dac73b66 | 21 | |
bosko001 | 7:4aa3dac73b66 | 22 | void (*pfv) (void); |
bosko001 | 7:4aa3dac73b66 | 23 | void spiClockCount_fun(void); |
bosko001 | 7:4aa3dac73b66 | 24 | |
bosko001 | 7:4aa3dac73b66 | 25 | public: |
bosko001 | 7:4aa3dac73b66 | 26 | C_gpioSpi( /*PinName Mosi, PinName Miso, PinName spiClock*/ ); |
bosko001 | 7:4aa3dac73b66 | 27 | // void attach( pf_pc_c fun) { transfer_fun = fun;} |
bosko001 | 7:4aa3dac73b66 | 28 | virtual void spiByteTransfer( char * tx, char rx) = 0; |
bosko001 | 7:4aa3dac73b66 | 29 | char get_bitCount( void ) { return bitCount;} |
bosko001 | 7:4aa3dac73b66 | 30 | void clear_bitCount( void ) { bitCount = 0;} |
bosko001 | 7:4aa3dac73b66 | 31 | |
bosko001 | 7:4aa3dac73b66 | 32 | void spi_monitor( void ); |
bosko001 | 7:4aa3dac73b66 | 33 | |
bosko001 | 7:4aa3dac73b66 | 34 | }; |
bosko001 | 7:4aa3dac73b66 | 35 | |
bosko001 | 7:4aa3dac73b66 | 36 | |
bosko001 | 7:4aa3dac73b66 | 37 | |
bosko001 | 7:4aa3dac73b66 | 38 | |
bosko001 | 7:4aa3dac73b66 | 39 | #endif |