Generic mbed Extensions used by STM Expansion Board Firmware Packages.
Dependents: X_NUCLEO_IKS01A1 X_NUCLEO_6180XA1 1-DoorCloser 1-DoorCloser ... more
Fork of X_NUCLEO_COMMON by
Generic mbed Extensions used by STM Expansion Board Firmware Packages
DbgMCU
Helper class DbgMCU
providing a default constructor which enables debugging on STM32 MCUs while using sleep modes.
DevI2C
Helper class DevI2C
providing functions for multi-register I2C communication common for a series of I2C devices.
DevSPI
Helper class DevSPI
providing functions for SPI communication common for a series of SPI devices.
Diff: DevSPI/DevSPI.h
- Revision:
- 18:06322fe82f27
- Parent:
- 17:99d103ca04dd
- Parent:
- 16:216930edb6b7
--- a/DevSPI/DevSPI.h Wed Jun 08 11:55:20 2016 +0200 +++ b/DevSPI/DevSPI.h Wed Jun 08 11:57:03 2016 +0200 @@ -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. */