/* param base The I2C peripheral base address. param timeout_Ms Timeout value in millisecond. param srcClock_Hz I2C functional clock frequency in Hertz.  */
void I2C_MasterSetTimeoutValue(I2C_Type *base, uint8_t timeout_Ms, uint32_t srcClock_Hz)
/* param base The I2C peripheral base address. param timeout_Ms Timeout value in millisecond. param srcClock_Hz I2C functional clock frequency in Hertz.  */
void I2C_MasterSetTimeoutValue(I2C_Type *base, uint8_t timeout_Ms, uint32_t srcClock_Hz)
{
    assert((timeout_Ms != 0U) && (srcClock_Hz != 0U));
    uint32_t timeoutValue = ((uint32_t)timeout_Ms * srcClock_Hz / 16UL / 100UL + 5UL) / 10UL;
    if (timeoutValue > 0x1000UL)
    {
        timeoutValue = 0x1000UL;
    }
    timeoutValue  = ((timeoutValue - 1UL) << 4UL) | 0xFUL;
    base->TIMEOUT = timeoutValue;
}