/* The interrupt handler for the I2C0 interface. It deals only with the master mode.  */
void i2c_interface0_master_handler(void)
/* The interrupt handler for the I2C0 interface. It deals only with the master mode.  */
void i2c_interface0_master_handler(void)
{
    printf("i2cInterface = %d\n", i2c_interface);
    i2c_clear_buffer((uint8_t *) i2c_master_buffer,
                     I2C_BUFSIZE * sizeof(uint8_t));
    i2c_active_power(i2c_interface);
    i2c_pin_select(i2c_interface);
    i2c_clear_control_register(i2c_interface);
    i2c_set_baud_rate(i2c_interface, baud_rate);
    if (i2c_mode == I2CSLAVE) {
        i2c_set_slave_mode(i2c_interface, slave_addr);
    }
    if (!i2c_irq_handler_register(i2c_interface, handler)) {
        return false;
    }
    i2c_initial_master_transmitter_mode(i2c_interface);
    return (true);
}