Before calling any setup functions in the I2C ROM, the
application program is responsible for doing the following:
- Enable the clock to the I2C peripheral.
- Enable the two pins required for the SCL and SDA outputs
of the I2C peripheral.
- Allocate a RAM area for dedicated use of the I2C ROM
After the I2C block is configured, the I2C ROM driver
variables have to be set up:
- Initialize pointer to the I2C API function
- Declare the PARAM and RESULT struct.
- Declare Error Code struct.
- Declare the transmit and receive buffer.
If interrupts are used, then additional driver variables
have to be set up:
- Declare the I2C_CALLBK_T type.
- Declare callback functions.
- Declare I2C ROM Driver ISR within the I2C ISR.
- Enable I2C interrupt.