I2C API I2C Master mode set-up

The I2C ROM Driver support polling and interrupts. In the master mode, 7-bit and 10-bit addressing are supported. The setup is as follows:

  1. Allocate SRAM for the I2C ROM Driver by making a call to the i2c_get_mem_size() function.
  2. Create the I2C handle by making a call to the i2c_setup() function.
  3. Set the I2C operating frequency by making a call to the i2c_set_bitrate() function.
size_in_bytes = LPC_I2CD_API->i2c_get_mem_size();-->
i2c_handle = LPC_I2CD_API->i2c_setup(LPC_I2C_BASE, (uint32_t*)&I2C_Handle[0] );-->
error_code = LPC_I2CD_API->i2c_set_bitrate((I2C_HANDLE_T*)i2c_handle,PCLK_in_Hz, bps_in_hz);-->