-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PORT API I2C CHANGE, fixing Zephyr for STM32: uPortI2cControllerExcha…
…nge() replaces uPortI2cControllerSend()/uPortI2cControllerSendReceive(). (#1105) The port API for I2C had functions uPortI2cControllerSend(), where the stop bit could optionally be omitted, and uPortI2cControllerSendReceive(), for normal communications. Sending without a stop bit is required to allow the register address within a u-blox GNSS chip to be set, i.e. a write of 0xFD with no stop bit causes the register address in the GNSS chip to be set to 0xFD, and that is the register address from which the number of bytes the GNSS chip has ready for transmission can be read. However, there is driver software out there (e.g. the STM32 I2C drivers within Zephyr, and potentially Zephyr in general aside from the Nordic I2C drivers) which FORCES a stop bit at the end of each I2C transfer. In order to be maximally compatible with all platforms, uPortI2cControllerSend()/uPortI2cControllerSendReceive() is now replaced with a single uPortI2cControllerExchange() function, with the option of leaving off the stop bit between the send and the receive. The uPortI2cControllerSend() and uPortI2cControllerSendReceive() functions are deprecated but remain for now: a weakly-linked implementation of uPortI2cControllerExchange() is provided which calls through to uPortI2cControllerSend()/uPortI2cControllerSendReceive() to ensure backwards compatibility. For Zephyr, uPortI2cControllerExchange() is implemented such that I2C transactions work with STM32 MCUs as well as nRF52/nRF53. Our thanks to AarC10/Naquino14 and djfurie for highlighting this issue. P.S. the number of I2C ports supported for Zephyr is also increased from 2 to 4 to match the capabilities of the STM32 family.
- Loading branch information
Showing
7 changed files
with
269 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.