I read that section, but I thought waiting for acknowledgement was part of the HAL Blocking I2C functions with the timeout. If the HAL_I2C_Mem_Write function wasn't getting an acknowledgement back within the timeout period wouldn't it return a HAL_ERROR of some kind...
FUNCTION NAME HAL_StatusTypeDef HAL_I2C_Mem_Write (I2C_HandleTypeDef * hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t * pData, uint16_t Size, uint32_t Timeout) FUNCTION DESCRIPTION Write an amount of data in blocking mode to a specific memory address. ...
status_t I2C_MasterReadBlocking (I2C_Type *base, uint8_t *pu8RxBuff, uint16_t rxSize, bool bSendStop) Receives a piece of data from I2C bus in master mode in blocking way. More... Slave Bus Operation Sub-Group status_t I2C_SlaveWriteBlocking (I2C_Type *base, cons...
use eh02::{blocking::i2c, blocking::serial::Write as _}; use eh02::blocking::i2c; /// MPU9250 I2C address const MPU9250_ADDRESS: u8 = 0x68; const WHO_AM_I_REG: u8 = 0x75; const WHO_AM_I_RESP: u8 = 0x71; const GPT1_DELAY_MS: u32 = board::GPT1_FREQUENCY / 1_000 *...
while(I2C_BUSY == I2C_Close()); // sit here until finished. Never return a status of I2C_FAIL, and function: void I2C_WriteNBytes(...); have no way of reporting a problem. Capture in message #6 also reveal that there are mistakes in your existing code, When NAK is returned from...
4. I2C_MasterReadBlocking is then called, reading in each byte until the rxSize counter indicates that only one byte is remaining, after which the master sends a NACK to stop the read operation. I altered the i2c_polling_b2b_transfer_master.c code to perform an initial read of the EEPROM...
basic_interrupt - this creates a Master device which is setup to periodically read/write from a Slave device using a timer interrupt. basic_echo - this creates a device which listens on Wire1 and then echos that incoming data out on Wire. It demonstrates non-blocking nested Wire calls (ca...
(__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BTF) == SET) && (hi2c->XferSize != 0U)){ /* Write data to DR */ hi2c->Instance->DR = (*hi2c->pBuffPtr++); hi2c->XferCount--; hi2c->XferSize--; } /* Wait until BTF flag is set */ if(I2C_WaitOnBTFFlagUntilTimeout(hi2c, ...
The invention discloses a method for preventing an inter-integrated circuit (I2C) read-write error. The method comprises the following steps of: 1, determining I2C speed and clock period T; 2, setting the duration of high-level and low-level clocks to be T/2; 3, generating high-level an...
I2C_Transaction structures cannot be re-used until the previous transaction has completed. Upon the completion of a transaction, the I2C_Transaction.status may be used for error handling. Returns In I2C_MODE_BLOCKING: true for a successful transfer; false for an error (for example, an I2C bus...