drivers: i2c: stm32f4: Add check for BTF flag before reading N-2 byte
According to STM32F4 reference manual, software should wait for BTF=1 before reading N-2 data byte. Reference: "For N >2 -byte reception, from N-2 data reception" section, page 853 of STM32F4 Reference manual. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
This commit is contained in:
parent
8b6d3ad69b
commit
1bd48edd26
1 changed files with 3 additions and 0 deletions
|
@ -461,6 +461,9 @@ s32_t stm32_i2c_msg_read(struct device *dev, struct i2c_msg *msg,
|
|||
|
||||
break;
|
||||
case 3:
|
||||
while (!LL_I2C_IsActiveFlag_BTF(i2c)) {
|
||||
;
|
||||
}
|
||||
/* Set NACK before reading N-2 byte*/
|
||||
LL_I2C_AcknowledgeNextData(i2c, LL_I2C_NACK);
|
||||
/* Fall through */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue