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: DevI2C/DevI2C.h
- Revision:
- 5:efc56a90dc5a
- Parent:
- 4:33ee0cf483de
- Child:
- 6:e16d452ac87b
--- a/DevI2C/DevI2C.h Fri May 22 14:33:42 2015 +0200 +++ b/DevI2C/DevI2C.h Wed May 27 11:56:24 2015 +0200 @@ -82,7 +82,7 @@ tmp[0] = RegisterAddr; memcpy(tmp+1, pBuffer, NumByteToWrite); - ret = write(DeviceAddr, (const char*)tmp, NumByteToWrite+1, 0); + ret = write(DeviceAddr, (const char*)tmp, NumByteToWrite+1, false); if(ret) return -1; return 0; @@ -105,10 +105,10 @@ int ret; /* Send device address, with no STOP condition */ - ret = write(DeviceAddr, (const char*)&RegisterAddr, 1, 1); + ret = write(DeviceAddr, (const char*)&RegisterAddr, 1, true); if(!ret) { /* Read data, with STOP condition */ - ret = read(DeviceAddr, (char*)pBuffer, NumByteToRead, 0); + ret = read(DeviceAddr, (char*)pBuffer, NumByteToRead, false); } if(ret) return -1;