Hello !
I'm using I2C master API for FreeRTOS and would like to estimate max timeout in case if I2C transaction can't be completed.
In API I2C_RTOS_Transfer() I can see infinite waiting of semaphore:
/* Wait for transfer to finish */
xSemaphoreTake(handle->semaphore, portMAX_DELAY);
What timeout mechanisms is exists inside I2C hardware what can garantie if I2C interrupt in controller is happens in any case for unblock waiting if semaphore in reasonable time ?
Regards,
Eugene
HI Eugene:
In hardware, there is timeout parameters allows a master or slave to conclude that a defective devices is holding the clock low indefinitely or a master is intentionally trying to drive devices off the bus. The slave device must release the bus when it detects any single clock held low longer that Ttimeout .
The timeout value can be set via I2C SCL Low Timeout Register Hig.h and I2C SCL Low Timeout Register Low
Please refer to the K82P121M150SF5RM for more details
Regards
Daniel
Hi Daniel !
Thank you !
I have checked SDK examples and do not find any place where those registers are set :
__IO uint8_t SLTH; /**< I2C SCL Low Timeout Register High, offset: 0xA */
__IO uint8_t SLTL; /**< I2C SCL Low Timeout Register Low, offset: 0xB */
It means by default timeout has infinite value ?
In what units those registers should be programmed ? Period of clock 400kHz or some other ones ?
Regards,
Eugene