- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Typedefs | Enumerations | Functions
csl_i2c.h File Reference

I2C functional layer API header file. More...

`#include "cslr.h"`
`#include "csl_error.h"`
`#include "csl_types.h"`
`#include "cslr_i2c.h"`
`#include "soc.h"`
`#include "csl_general.h"`

Go to the source code of this file.

## Data Structures
struct | CSL_I2cIsrAddr
| I2C callback pointer structure. More...
struct | CSL_I2cConfig
| I2C Config structure. More...
struct | CSL_I2cSetup
| I2C Setup structure. More...
struct | CSL_I2cObj
| I2C Object structure. More...
## Defines
#define | CSL_I2C0 (0)
| I2C Instance number.
#define | CSL_I2C_INT_EVTID (23)
#define | CSL_I2C_EVT_COUNT (7)
#define | CSL_I2C_RESET_COUNT_VAL (0x20)
#define | CSL_I2C_RESET_DELAY (500)
#define | CSL_I2C_MODULE_CLOCK_FREQ (12)
#define | CSL_I2C_CLK_MULT (1000)
#define | CSL_I2C_PSC0 (0)
#define | CSL_I2C_PSC1 (1)
#define | CSL_I2C_PSC_ADJUST_VAL (1)
#define | CSL_I2C_PSC0_DVAL (7)
#define | CSL_I2C_PSC1_DVAL (6)
#define | CSL_I2C_PSC2TOFF_DVAL (5)
#define | CSL_I2C_ERROR_BASE (CSL_EI2C_FIRST)
| I2C Driver Error codes.
#define | CSL_I2C_BUS_BUSY_ERR (CSL_I2C_ERROR_BASE - 1)
#define | CSL_I2C_ARBITRATION_LOSS_ERR (CSL_I2C_ERROR_BASE - 2)
#define | CSL_I2C_NACK_ERR (CSL_I2C_ERROR_BASE - 3)
#define | CSL_I2C_TRANSMIT_UNDERFLOW_ERR (CSL_I2C_ERROR_BASE - 4)
#define | CSL_I2C_RECEIVE_OVERFLOW_ERR (CSL_I2C_ERROR_BASE - 5)
#define | CSL_I2C_CANCEL_IO_ERROR (CSL_I2C_ERROR_BASE - 6)
#define | CSL_I2C_TIMEOUT_ERROR (CSL_I2C_ERROR_BASE - 7)
#define | CSL_I2C_READ (0x1)
| I2C Transaction flags.
#define | CSL_I2C_WRITE (0x2)
#define | CSL_I2C_ADDR_FORMAT_10_BIT (0x10)
#define | CSL_I2C_START (0x100)
#define | CSL_I2C_STOP (0x200)
#define | CSL_I2C_RESTART (0x400)
#define | CSL_I2C_START_BYTE (0x800)
#define | CSL_I2C_FREE_DATA_FORMAT (0x1000)
#define | CSL_I2C_REPEAT (0x2000)
#define | CSL_I2C_IGNORE_BUS_BUSY (0x20000)
#define | CSL_I2C_DEFAULT_STTSTP (CSL_I2C_START | CSL_I2C_STOP)
#define | CSL_I2C_MAX_TIMEOUT (0xFFFF)
#define | CSL_I2C_ICOAR_DEFVAL (0x2F)
#define | CSL_I2C_ICIMR_DEFVAL (0x0000)
#define | CSL_I2C_ICSAR_DEFVAL (0x50)
#define | CSL_I2C_ICPSC_DEFVAL (0x07)
#define | CSL_I2C_ICCLK_DEFVAL (0x026C)
#define | CSL_I2C_ICMDR_WRITE_DEFVAL (0x0E20)
#define | CSL_I2C_ICMDR_READ_DEFVAL (0x0C20)
#define | CSL_I2C_ICEMDR_DEFVAL (0x0000)
#define | CSL_I2C_ICSTR_RESET_VALUE (0xFFFF)
#define | CSL_I2C0_READREG(reg, val) (val = CSL_I2C_0_REGS->##reg)
#define | CSL_I2C0_WRITEREG(reg, val) (CSL_I2C_0_REGS->##reg = val)
#define | CSL_I2C_SETSTART() CSL_FINST(CSL_I2C_0_REGS->ICMDR, I2C_ICMDR_STT, SET);
#define | CSL_I2C_RESETSTART() CSL_FINST(CSL_I2C_0_REGS->ICMDR, I2C_ICMDR_STT, CLEAR);
#define | CSL_I2C_SETSTOP() CSL_FINST(CSL_I2C_0_REGS->ICMDR, I2C_ICMDR_STP, SET);
#define | CSL_I2C_RESETSTOP() CSL_FINST(CSL_I2C_0_REGS->ICMDR, I2C_ICMDR_STP, CLEAR);
## Typedefs
typedef void(* | CSL_I2C_EVENT_ISR )(void)
typedef enum CSL_I2cEvent | CSL_I2cEvent
| Enum for I2C events.
typedef enum CSL_I2cAddrMode | CSL_I2cAddrMode
| Enum for I2C Address mode.
typedef enum CSL_I2cBitCount | CSL_I2cBitCount
| Enum for I2C bit count value.
typedef enum CSL_I2cLoopback | CSL_I2cLoopback
| Enum for I2C loopback mode bit.
typedef enum CSL_I2cFreeMode | CSL_I2cFreeMode
| Enum for I2C free mode bit.
typedef enum CSL_I2cMasterMode | CSL_I2cMasterMode
| Enum for I2C master mode bit.
typedef enum CSL_I2cRepeatMode | CSL_I2cRepeatMode
| Enum for I2C repeat mode bit.
typedef struct CSL_I2cIsrAddr | CSL_I2cIsrAddr
| I2C callback pointer structure.
typedef struct CSL_I2cConfig | CSL_I2cConfig
| I2C Config structure.
typedef struct CSL_I2cSetup | CSL_I2cSetup
| I2C Setup structure.
typedef struct CSL_I2cObj | CSL_I2cObj
| I2C Object structure.
typedef CSL_I2cObj * | pI2cHandle
## Enumerations
enum | CSL_I2cEvent { CSL_I2C_EVENT_AL, CSL_I2C_EVENT_NACK, CSL_I2C_EVENT_ARDY, CSL_I2C_EVENT_ICRRDY, CSL_I2C_EVENT_ICXRDY, CSL_I2C_EVENT_SCD, CSL_I2C_EVENT_AAS }
| Enum for I2C events. More...
enum | CSL_I2cAddrMode { CSL_I2C_ADDR_7BIT = 0, CSL_I2C_ADDR_10BIT }
| Enum for I2C Address mode. More...
enum | CSL_I2cBitCount { CSL_I2C_BC_8BITS = 0, CSL_I2C_BC_RSVD, CSL_I2C_BC_2BITS, CSL_I2C_BC_3BITS, CSL_I2C_BC_4BITS, CSL_I2C_BC_5BITS, CSL_I2C_BC_6BITS, CSL_I2C_BC_7BITS }
| Enum for I2C bit count value. More...
enum | CSL_I2cLoopback { CSL_I2C_LOOPBACK_DISABLE = 0, CSL_I2C_LOOPBACK_ENABLE }
| Enum for I2C loopback mode bit. More...
enum | CSL_I2cFreeMode { CSL_I2C_FREEMODE_DISABLE = 0, CSL_I2C_FREEMODE_ENABLE }
| Enum for I2C free mode bit. More...
enum | CSL_I2cMasterMode { CSL_I2C_MASTERMODE_DISABLE = 0, CSL_I2C_MASTERMODE_ENABLE }
| Enum for I2C master mode bit. More...
enum | CSL_I2cRepeatMode { CSL_I2C_REPEATMODE_DISABLE = 0, CSL_I2C_REPEATMODE_ENABLE }
| Enum for I2C repeat mode bit. More...
## Functions
CSL_Status | I2C_init (Uint16 instanceNum)
CSL_Status | I2C_config (CSL_I2cConfig *i2cConfig)
CSL_Status | I2C_getConfig (CSL_I2cConfig *i2cgetConfig)
CSL_Status | I2C_setup (CSL_I2cSetup *i2cSetup)
CSL_Status | I2C_write (Uint16 *i2cWrBuf, Uint16 dataLength, Uint16 slaveAddr, Bool masterMode, Uint16 startStopFlag, Uint16 timeout)
CSL_Status | I2C_read (Uint16 *i2cRdBuf, Uint16 dataLength, Uint16 slaveAddr, Bool masterMode, Uint16 startStopFlag, Uint16 timeout, Bool checkBus)
CSL_Status | I2C_eventEnable (CSL_I2cEvent i2cEvent)
CSL_Status | I2C_eventDisable (CSL_I2cEvent i2cEvent)
CSL_Status | I2C_setCallback (CSL_I2cIsrAddr *i2cIsrAddr)
Int16 | I2C_getEventId (void)

## Detailed Description

I2C functional layer API header file.

Path: \(CSLPATH)\ inc