
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
419 of 487
NXP Semiconductors
UM10800
Chapter 29: LPC82x ROM API I2C driver routines
29.4.6 I2C Master Receive Interrupt
29.4.7 I2C Master Transmit Receive Interrupt
29.4.8 I2C Slave Receive Polling
Table 370. I2C Master Receive Interrupt
Routine
I2C Master Receive Interrupt
Prototype
ErrorCode_t i2c_master_receive_intr(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
Receives bytes from slave and put into receive buffer. After the task is
finished, the slave address with the R/W bit =1 is in the first byte of the receive
buffer. STOP condition is sent at end unless stop_flag =0. Program control will
be returned immediately and task will be completed on an interrupt-driven
basis. When task is completed, the callback function is called.
Table 371. I2C Master Transmit Receive Interrupt
Routine
I2C Master Transmit Receive Interrupt
Prototype
ErrorCode_t i2c_master_tx_rx_intr(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
First, transmits bytes in the send buffer to a slave and secondly, receives
bytes from slave and store it in the receive buffer. The slave address with the
R/W bit =0 is expected in the first byte of the send buffer. After the task is
finished, the slave address with the R/W bit =1 is in the first byte of the receive
buffer. STOP condition is sent at end unless stop_flag =0. Program control will
be returned immediately and task will be completed on an interrupt-driven
basis. When task is completed, the callback function is called.
Table 372. I2C Slave Receive Polling
Routine
I2C Slave Receive Polling
Prototype
ErrorCode_t i2c_slave_receive_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
Receives data from master. When the task is completed, the function returns
to the line after the call.