i2c.h File Reference

Common I2C interface, This file is derived from the Gomspace I2C driver,. More...

Go to the source code of this file.

Data Structures

struct  i2c_frame_s
 Data structure for I2C frames. More...
 

Macros

#define E_NO_ERR   -1
 The return value of the driver is a bit strange, It should return E_NO_ERR if successfull and the value is -1. More...
 
#define I2C_MTU   256
 Maximum transfer length on I2C. More...
 
#define I2C_MASTER   0
 I2C device modes. More...
 
#define I2C_SLAVE   1
 

Typedefs

typedef struct i2c_frame_s i2c_frame_t
 Data structure for I2C frames. More...
 
typedef void(* i2c_callback_t) (i2c_frame_t *frame, void *pxTaskWoken)
 Initialise the I2C driver. More...
 

Functions

int i2c_init (int handle, int mode, uint8_t addr, uint16_t speed, int queue_len_tx, int queue_len_rx, i2c_callback_t callback)
 
int i2c_send (int handle, i2c_frame_t *frame, uint16_t timeout)
 Send I2C frame via the selected device. More...
 

Detailed Description

Common I2C interface, This file is derived from the Gomspace I2C driver,.