Added isSPI3w API to DevSPI
Fork of X_NUCLEO_COMMON by
Revision 23:5cd443e32f27, committed 2017-09-22
- Comitter:
- mapellil
- Date:
- Fri Sep 22 09:23:53 2017 +0000
- Parent:
- 22:21096473f63e
- Commit message:
- Added isSPI3w API to DevSPI
Changed in this revision
DevSPI/DevSPI.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/DevSPI/DevSPI.h Tue Aug 08 14:37:26 2017 +0000 +++ b/DevSPI/DevSPI.h Fri Sep 22 09:23:53 2017 +0000 @@ -65,6 +65,8 @@ */ DevSPI(PinName mosi, PinName miso, PinName sclk) : SPI(mosi, miso, sclk) { + if (miso == NC) is_spi3w = true; + else is_spi3w = false; /* Set default configuration. */ setup(8, 3, 1E6); } @@ -285,6 +287,10 @@ return 0; } + inline bool isSPI3w() { + return is_spi3w; + } + protected: inline uint16_t htons(uint16_t x) { #ifndef __DEV_SPI_BIG_ENDIAN