
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
421 of 487
NXP Semiconductors
UM10800
Chapter 29: LPC82x ROM API I2C driver routines
29.4.12 I2C Set Slave Address
29.4.13 I2C Get Memory Size
29.4.14 I2C Setup
29.4.15 I2C Set Bit Rate
Table 376. I2C Set Slave Address
Routine
I2C Set Slave Address
Prototype
ErrorCode_t i2c_set_slave_addr(I2C_HANDLE_T*, slave_addr_0_3,
slave_mask_0_3)
Input parameter
I2C_HANDLE_T - Handle to the allocated SRAM area.
Slave_addr_0_3 - unint32 variable. 7-bit slave address .
Slave_mask_0_3 - unint32 variable. Slave address mask.
Return
ErrorCode.
Description
Sets the slave address and associated mask. The set_slave_addr() function
supports four 7-bit slave addresses and masks.
Table 377. I2C Get Memory Size
Routine
I2C Get Memory Size
Prototype
uint32_t i2c_get_mem_size(void)
Input parameter
None.
Return
uint32.
Description
Returns the number of bytes in SRAM needed by the I2C driver.
Table 378. I2C Setup
Routine
I2C Setup
Prototype
I2C_HANDLE_T* i2c_setup(i2c_base_addr, *start_of_ram)
Input parameter
I2C_base addr - unint32 variable. Base address for I2C peripherals.
Start_of_ram - unint32 pointer. Pointer to allocated SRAM.
Return
I2C_Handle.
Description
Returns a handle to the allocated SRAM area.
Table 379. I2C Set Bit Rate
Routine
I2C Set Bit Rate
Prototype
ErrorCode_t i2c_set_bitrate(I2C_HANDLE_T*, P_clk_in_hz, bitrate_in_bps)
Input parameter
I2C_HANDLE_T - Handle to the allocated SRAM area.
P_clk_in_hz - unint32 variable. The Peripheral Clock in Hz.
Bitrate_in_bps - unint32 variable. Requested I2C operating frequency in Hz.
Return
ErrorCode.
Description
Configures the I2C duty-cycle registers (SCLH and SCLL).