
UM10800
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2016. All rights reserved.
User manual
Rev. 1.2 — 5 October 2016
417 of 487
NXP Semiconductors
UM10800
Chapter 29: LPC82x ROM API I2C driver routines
I2C_HANDLE_T* (*i2c_setup)(uint32_t i2c_base_addr, uint32_t *start_of_ram ) ;
ErrorCode_t (*i2c_set_bitrate)(I2C_HANDLE_T* h_i2c, uint32_t P_clk_in_hz,
uint32_t bitrate_in_bps) ;
uint32_t (*i2c_get_firmware_version)() ;
I2C_MODE_T (*i2c_get_status)(I2C_HANDLE_T* h_i2c ) ;
} I2CD_API_T ;
#define ROM_DRIVER_BASE (0x1FFF1FF8UL)
#define LPC_I2CD_API ((I2CD_API_T *) ((*(ROM_API_T * *) (ROM_DRIVER_BASE))->pI2CD))
See
for how to include the ROM driver structure.
29.4.1 ISR handler
29.4.2 I2C Master Transmit Polling
29.4.3 I2C Master Receive Polling
Table 365. ISR handler
Routine
ISR handler
Prototype
void i2c_isr_handler(I2C_HANDLE_T*)
Input parameter
I2C_HANDLE_T - Handle to the allocated SRAM area.
Return
None.
Description
I2C ROM Driver interrupt service routine. This function must be called from
the I2C ISR when using I2C Rom Driver interrupt mode.
Table 366. I2C Master Transmit Polling
Routine
I2C Master Transmit Polling
Prototype
ErrorCode_t i2c_master_transmit_poll(I2C_HANDLE_T*, I2C_PARAM*,
I2C_RESULT* )
Input parameter
I2C_HANDLE_T - Handle to the allocated SRAM area.
I2C_PARAM - Pointer to the I2C PARAM struct.
I2C_RESULT - Pointer to the I2C RESULT struct.
Return
ErrorCode.
Description
Transmits bytes in the send buffer to a slave. The slave address with the R/W
bit =0 is expected in the first byte of the send buffer. STOP condition is sent at
end unless stop_flag =0. When the task is completed, the function returns to
the line after the call.
Table 367. I2C Master Receive Polling
Routine
I2C Master Receive Polling
Prototype
ErrorCode_t i2c_master_receive_poll(I2C_HANDLE_T* , I2C_PARAM* ,
I2C_RESULT*)