openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
lpc17_i2c.c File Reference

I2C driver for LPC17xx. More...

#include "port.h"
#include "string.h"
Include dependency graph for lpc17_i2c.c:

Macros

#define SLAVE_MASK   0xFF
 

Functions

void I2C0_IRQHandler (void)
 I2C0 Interrupt handler.
 
void I2C1_IRQHandler (void)
 
void I2C2_IRQHandler (void)
 
void vI2CConfig (I2C_ID_T id, uint32_t speed)
 
uint8_t xI2CSlaveReceive (I2C_ID_T id, uint8_t *rx_buff, uint8_t buff_len, uint32_t timeout)
 
void vI2CSlaveSetup (I2C_ID_T id, uint8_t slave_addr)
 
int xI2CMasterWriteRead (I2C_ID_T id, uint8_t addr, const uint8_t *tx_buff, int tx_len, uint8_t *rx_buff, int rx_len)
 

Variables

I2C_XFER_T slave_cfg
 
I2C_XFER_T slave_dummy
 
uint8_t recv_msg [i2cMAX_MSG_LENGTH]
 
uint8_t recv_msg_dummy [i2cMAX_MSG_LENGTH]
 
uint8_t recv_bytes
 

Detailed Description

I2C driver for LPC17xx.

Author
Henrique Silva henri.nosp@m.que..nosp@m.silva.nosp@m.@lnl.nosp@m.s.br, LNLS
Date
March 2016

Macro Definition Documentation

◆ SLAVE_MASK

#define SLAVE_MASK   0xFF

Function Documentation

◆ I2C0_IRQHandler()

void I2C0_IRQHandler ( void )

I2C0 Interrupt handler.

Returns
None

◆ I2C1_IRQHandler()

void I2C1_IRQHandler ( void )

◆ I2C2_IRQHandler()

void I2C2_IRQHandler ( void )

◆ vI2CConfig()

void vI2CConfig ( I2C_ID_T id,
uint32_t speed )

◆ vI2CSlaveSetup()

void vI2CSlaveSetup ( I2C_ID_T id,
uint8_t slave_addr )

◆ xI2CMasterWriteRead()

int xI2CMasterWriteRead ( I2C_ID_T id,
uint8_t addr,
const uint8_t * tx_buff,
int tx_len,
uint8_t * rx_buff,
int rx_len )

◆ xI2CSlaveReceive()

uint8_t xI2CSlaveReceive ( I2C_ID_T id,
uint8_t * rx_buff,
uint8_t buff_len,
uint32_t timeout )

Variable Documentation

◆ recv_bytes

uint8_t recv_bytes

◆ recv_msg

uint8_t recv_msg[i2cMAX_MSG_LENGTH]

◆ recv_msg_dummy

uint8_t recv_msg_dummy[i2cMAX_MSG_LENGTH]

◆ slave_cfg

I2C_XFER_T slave_cfg

◆ slave_dummy

I2C_XFER_T slave_dummy