LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
i2c_17xx_40xx.c File Reference
#include "chip.h"

Go to the source code of this file.

Data Structures

struct  i2c_interface
 
struct  i2c_slave_interface
 

Macros

#define SLAVE_ACTIVE(iic)   (((iic)->flags & 0xFF00) != 0)
 
#define I2C_GetClk(x)   Chip_Clock_GetPeripheralClockRate()
 

Functions

void Chip_I2C_EventHandler (I2C_ID_T id, I2C_EVENT_T event)
 Default event handler for interrupt base operation.
 
void Chip_I2C_EventHandlerPolling (I2C_ID_T id, I2C_EVENT_T event)
 Default event handler for polling operation.
 
void Chip_I2C_Init (I2C_ID_T id)
 Initializes the LPC_I2C peripheral with specified parameter.
 
void Chip_I2C_DeInit (I2C_ID_T id)
 De-initializes the I2C peripheral registers to their default reset values.
 
void Chip_I2C_SetClockRate (I2C_ID_T id, uint32_t clockrate)
 Set up clock rate for LPC_I2C peripheral.
 
uint32_t Chip_I2C_GetClockRate (I2C_ID_T id)
 Get current clock rate for LPC_I2C peripheral.
 
int Chip_I2C_SetMasterEventHandler (I2C_ID_T id, I2C_EVENTHANDLER_T event)
 Set function that must handle I2C events.
 
I2C_EVENTHANDLER_T Chip_I2C_GetMasterEventHandler (I2C_ID_T id)
 Get pointer to current function handling the events.
 
int Chip_I2C_MasterTransfer (I2C_ID_T id, I2C_XFER_T *xfer)
 Transmit and Receive data in master mode.
 
int Chip_I2C_MasterSend (I2C_ID_T id, uint8_t slaveAddr, const uint8_t *buff, uint8_t len)
 Transmit data to I2C slave using I2C Master mode.
 
int Chip_I2C_MasterCmdRead (I2C_ID_T id, uint8_t slaveAddr, uint8_t cmd, uint8_t *buff, int len)
 Transfer a command to slave and receive data from slave after a repeated start.
 
int Chip_I2C_MasterRead (I2C_ID_T id, uint8_t slaveAddr, uint8_t *buff, int len)
 Set function that must handle I2C events.
 
int Chip_I2C_IsMasterActive (I2C_ID_T id)
 Checks if master xfer in progress.
 
void Chip_I2C_MasterStateHandler (I2C_ID_T id)
 I2C Master transfer state change handler.
 
void Chip_I2C_SlaveSetup (I2C_ID_T id, I2C_SLAVE_ID sid, I2C_XFER_T *xfer, I2C_EVENTHANDLER_T event, uint8_t addrMask)
 Setup a slave I2C device.
 
void Chip_I2C_SlaveStateHandler (I2C_ID_T id)
 I2C Slave event handler.
 
void Chip_I2C_Disable (I2C_ID_T id)
 Disable I2C peripheral's operation.
 
int Chip_I2C_IsStateChanged (I2C_ID_T id)
 I2C peripheral state change checking.
 

Variables

static struct i2c_interface i2c [I2C_NUM_INTERFACE]
 
static struct i2c_slave_interface i2c_slave [I2C_NUM_INTERFACE][I2C_SLAVE_NUM_INTERFACE]
 

Macro Definition Documentation

#define I2C_GetClk (   x)    Chip_Clock_GetPeripheralClockRate()

Definition at line 47 of file i2c_17xx_40xx.c.

#define SLAVE_ACTIVE (   iic)    (((iic)->flags & 0xFF00) != 0)

Definition at line 37 of file i2c_17xx_40xx.c.

Variable Documentation

Definition at line 74 of file i2c_17xx_40xx.c.