RTEMS  5.0.0
Functions
i2c.h File Reference

I2C support API. More...

#include <rtems.h>
#include <bsp/lpc32xx.h>

Go to the source code of this file.

Macros

I2C Clock Control Register (I2CCLK_CTRL)
#define I2CCLK_1_EN   BSP_BIT32(0)
 
#define I2CCLK_2_EN   BSP_BIT32(1)
 
#define I2CCLK_1_HIGH_DRIVE   BSP_BIT32(2)
 
#define I2CCLK_2_HIGH_DRIVE   BSP_BIT32(3)
 
#define I2CCLK_USB_HIGH_DRIVE   BSP_BIT32(4)
 
I2C TX Data FIFO Register (I2Cn_TX)
#define I2C_TX_READ   BSP_BIT32(0)
 
#define I2C_TX_ADDR(val)   BSP_FLD32(val, 1, 7)
 
#define I2C_TX_START   BSP_BIT32(8)
 
#define I2C_TX_STOP   BSP_BIT32(9)
 
I2C Status Register (I2Cn_STAT)
#define I2C_STAT_TDI   BSP_BIT32(0)
 
#define I2C_STAT_AFI   BSP_BIT32(1)
 
#define I2C_STAT_NAI   BSP_BIT32(2)
 
#define I2C_STAT_DRMI   BSP_BIT32(3)
 
#define I2C_STAT_DRSI   BSP_BIT32(4)
 
#define I2C_STAT_ACTIVE   BSP_BIT32(5)
 
#define I2C_STAT_SCL   BSP_BIT32(6)
 
#define I2C_STAT_SDA   BSP_BIT32(7)
 
#define I2C_STAT_RFF   BSP_BIT32(8)
 
#define I2C_STAT_RFE   BSP_BIT32(9)
 
#define I2C_STAT_TFF   BSP_BIT32(10)
 
#define I2C_STAT_TFE   BSP_BIT32(11)
 
#define I2C_STAT_TFFS   BSP_BIT32(12)
 
#define I2C_STAT_TFES   BSP_BIT32(13)
 
I2C Control Register (I2Cn_CTRL)
#define I2C_CTRL_TDIE   BSP_BIT32(0)
 
#define I2C_CTRL_AFIE   BSP_BIT32(1)
 
#define I2C_CTRL_NAIE   BSP_BIT32(2)
 
#define I2C_CTRL_DRMIE   BSP_BIT32(3)
 
#define I2C_CTRL_DRSIE   BSP_BIT32(4)
 
#define I2C_CTRL_RFFIE   BSP_BIT32(5)
 
#define I2C_CTRL_RFDAIE   BSP_BIT32(6)
 
#define I2C_CTRL_TFFIO   BSP_BIT32(7)
 
#define I2C_CTRL_RESET   BSP_BIT32(8)
 
#define I2C_CTRL_SEVEN   BSP_BIT32(9)
 
#define I2C_CTRL_TFFSIE   BSP_BIT32(10)
 

Functions

rtems_status_code lpc32xx_i2c_init (volatile lpc32xx_i2c *i2c, unsigned clock_in_hz)
 Initializes the I2C module i2c. More...
 
void lpc32xx_i2c_reset (volatile lpc32xx_i2c *i2c)
 Resets the I2C module i2c.
 
rtems_status_code lpc32xx_i2c_clock (volatile lpc32xx_i2c *i2c, unsigned clock_in_hz)
 Sets the I2C module i2c clock. More...
 
rtems_status_code lpc32xx_i2c_write_start (volatile lpc32xx_i2c *i2c, unsigned addr)
 Starts a write transaction on the I2C module i2c. More...
 
rtems_status_code lpc32xx_i2c_write_with_optional_stop (volatile lpc32xx_i2c *i2c, const uint8_t *out, size_t n, bool stop)
 Writes data via the I2C module i2c with optional stop. More...
 
rtems_status_code lpc32xx_i2c_read_start (volatile lpc32xx_i2c *i2c, unsigned addr)
 Starts a read transaction on the I2C module i2c. More...
 
rtems_status_code lpc32xx_i2c_read_with_optional_stop (volatile lpc32xx_i2c *i2c, uint8_t *in, size_t n, bool stop)
 Reads data via the I2C module i2c with optional stop. More...
 
rtems_status_code lpc32xx_i2c_write_and_read (volatile lpc32xx_i2c *i2c, unsigned addr, const uint8_t *out, size_t out_size, uint8_t *in, size_t in_size)
 Writes and reads data via the I2C module i2c. More...
 

Detailed Description

I2C support API.