Half Duplex Version of SWSPI
Fork of SWSPI by
Diff: SWSPI_HD.h
- Revision:
- 3:d3be72ac889e
- Parent:
- 1:17d758fe52f8
diff -r 70039cc8ba02 -r d3be72ac889e SWSPI_HD.h --- a/SWSPI_HD.h Tue Jun 19 10:49:39 2018 +0000 +++ b/SWSPI_HD.h Tue Jun 19 11:19:34 2018 +0000 @@ -37,11 +37,10 @@ * #include "mbed.h" * #include "SWSPI_HD.h" * - * SWSPI_HD spi(D8, D7); // dio, sclk (Using Arduino form factor Board (NUCLEO-32F401RE) + * SWSPI_HD spi(D8, D7, D6); // dio, sclk (n)cs (Using Arduino form factor Board (NUCLEO-32F401RE) * * int main() * { - * DigitalOut cs(D6); * spi.format(8, 0); * spi.frequency(10000000); * cs.write(0); @@ -56,6 +55,7 @@ private: DigitalInOut* dio; DigitalOut* sclk; + DigitalOut* cs; int port; int bits; int mode; @@ -69,7 +69,7 @@ * @param dio * @param sclk_pin */ - SWSPI_HD(PinName dio_pin, PinName sclk_pin); + SWSPI_HD(PinName dio_pin, PinName sclk_pin, PinName cs_pin); /** Destructor */ ~SWSPI_HD();