The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Issue: I2C::stop isn't equipped with timeout mechanism (Closed: Fixed)

The In contrast to all other i2c functions using the busy wait i2c_wait_SI the i2c_stop function in i2c_api.c in the mbed-NXP lib isn't equipped with a timeout mechanism. If someone on the bus keeps the SCL or SDA line low the mbed master would be freezed.

void i2c_stop(i2c_t *obj) {
    // write the stop bit
    i2c_conset(obj, 0, 1, 0, 0);
    i2c_clear_SI(obj);

    // wait for STO bit to reset
    while(I2C_CONSET(obj) & (1 << 4));
}