software_SPI.h@0:31211abbf651, 2017-09-30 (annotated)
- Committer:
- nguyenmanhthao996tn
- Date:
- Sat Sep 30 09:13:06 2017 +0000
- Revision:
- 0:31211abbf651
Worked version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nguyenmanhthao996tn | 0:31211abbf651 | 1 | #ifndef __SOFTWARE_SPI__ |
nguyenmanhthao996tn | 0:31211abbf651 | 2 | #define __SOFTWARE_SPI__ |
nguyenmanhthao996tn | 0:31211abbf651 | 3 | |
nguyenmanhthao996tn | 0:31211abbf651 | 4 | #include "mbed.h" |
nguyenmanhthao996tn | 0:31211abbf651 | 5 | |
nguyenmanhthao996tn | 0:31211abbf651 | 6 | #define SOFTWARE_SPI_SCK_LOW_TIME_US 15 |
nguyenmanhthao996tn | 0:31211abbf651 | 7 | #define SOFTWARE_SPI_SCK_HIGH_TIME_US 15 |
nguyenmanhthao996tn | 0:31211abbf651 | 8 | |
nguyenmanhthao996tn | 0:31211abbf651 | 9 | class software_SPI |
nguyenmanhthao996tn | 0:31211abbf651 | 10 | { |
nguyenmanhthao996tn | 0:31211abbf651 | 11 | private: |
nguyenmanhthao996tn | 0:31211abbf651 | 12 | DigitalOut *mosi, *sck; |
nguyenmanhthao996tn | 0:31211abbf651 | 13 | |
nguyenmanhthao996tn | 0:31211abbf651 | 14 | public: |
nguyenmanhthao996tn | 0:31211abbf651 | 15 | software_SPI(PinName mosi, PinName sck); |
nguyenmanhthao996tn | 0:31211abbf651 | 16 | void sendData(char data); |
nguyenmanhthao996tn | 0:31211abbf651 | 17 | }; |
nguyenmanhthao996tn | 0:31211abbf651 | 18 | |
nguyenmanhthao996tn | 0:31211abbf651 | 19 | #endif /* __SOFTWARE_SPI__ */ |