rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
i2c.h File Reference

I2C Device driver. More...

#include <stdint.h>

Go to the source code of this file.

Enumerations

enum  rflpc_i2c_port_t {
  RFLPC_I2C_PORT0,
  RFLPC_I2C_PORT1,
  RFLPC_I2C_PORT2
}
 These constants selects which port the driver functions manipulate. More...
 
enum  rflpc_i2c_mode_t {
  RFLPC_I2C_MODE_MASTER,
  RFLPC_I2C_MODE_SLAVE
}
 Defines the operating mode of the I2C bus. More...
 
enum  rflpc_i2c_status_t {
  RFLPC_I2C_SUCCESSFUL_TRANSMISSION = 0,
  RFLPC_I2C_SIZE_EQUAL_TO_ZERO,
  RFLPC_I2C_SLAVE_IS_BUSY,
  RFLPC_I2C_SLAVE_DID_NOT_ACKNOWLEDGED_DATA,
  RFLPC_I2C_MASTER_DID_NOT_ACKNOWLEDGED_DATA,
  RFLPC_I2C_STOP_CONDITION_RECEIVED,
  RFLPC_I2C_SLAVE_TRANSMITTED_DATA,
  RFLPC_I2C_UNKNOWN_ERROR,
  RFLPC_I2C_NOT_YET_IMPLEMENTED
}
 Defines the return status of the I2C driver. More...
 

Functions

int rflpc_i2c_init (rflpc_i2c_port_t port, rflpc_i2c_mode_t mode, uint8_t addr)
 Inits a given I2C port on a given mode. More...
 
uint16_t rflpc_i2c_write (rflpc_i2c_port_t port, uint8_t addr, uint8_t *data, uint8_t nbytes, uint8_t stop)
 Send bytes on the I2C bus. More...
 
uint16_t rflpc_i2c_read (rflpc_i2c_port_t port, uint8_t addr, uint8_t *data, uint8_t nbytes, uint8_t stop)
 Reads data from the I2C bus. More...
 
void rflpc_i2c_set_slave_transmitter_config (uint8_t *data, uint8_t size)
 Set data's location and size to be transmitted as slave. More...
 

Detailed Description

I2C Device driver.

Definition in file i2c.h.