Including SPI 3-wires class
Fork of X_NUCLEO_COMMON_SPI3W by
Diff: DevSPI/DevSPI.h
- Revision:
- 16:216930edb6b7
- Parent:
- 15:a59f32439f9d
- Parent:
- 13:9a2c9b0bbe61
- Child:
- 18:06322fe82f27
--- a/DevSPI/DevSPI.h Fri Feb 19 09:33:04 2016 +0100 +++ b/DevSPI/DevSPI.h Fri Feb 19 11:52:00 2016 +0100 @@ -56,14 +56,14 @@ */ class DevSPI : public SPI { -public: + public: /* * Create a DevSPI interface. * @param mosi pin name of the MOSI pin of the SPI device to be used for communication. * @param miso pin name of the MISO pin of the SPI device to be used for communication. * @param sclk pin name of the SCLK pin of the SPI device to be used for communication. */ - DevSPI(PinName mosi, PinName miso, PinName sclk) : SPI(mosi, miso, sclk) + DevSPI(PinName mosi, PinName miso, PinName sclk) : SPI(mosi, miso, sclk) { /* Set default configuration. */ setup(8, 3, 1E6); @@ -118,7 +118,7 @@ /* Write data. */ for (int i = 0; i < NumBytesToWrite; i++) { - write(pBuffer[i]); + write(pBuffer[i]); } /* Unselect the chip. */ @@ -179,7 +179,7 @@ /* Read and write data at the same time. */ for (int i = 0; i < NumBytes; i++) { - pBufferToRead[i] = write(pBufferToWrite[i]); + pBufferToRead[i] = write(pBufferToWrite[i]); } /* Unselect the chip. */