Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
i2c.h File Reference

Architecture independent I2C (Inter-Integrated Circuit Bus) API. More...

#include "std.h"
#include "mcu_periph/i2c_arch.h"
#include <string.h>
+ Include dependency graph for i2c.h:

Go to the source code of this file.

Data Structures

struct  i2c_transaction
 
struct  i2c_periph
 
struct  i2c_errors
 

Macros

#define I2C_BUF_LEN   32
 
#define I2C_TRANSACTION_QUEUE_LEN   8
 
#define I2C_ZERO_EVENTS(_err)
 
#define ZEROS_ERR_COUNTER(_i2c_err)
 

Enumerations

enum  I2CTransactionType { I2CTransTx, I2CTransRx, I2CTransTxRx }
 
enum  I2CTransactionStatus {
  I2CTransPending, I2CTransRunning, I2CTransSuccess, I2CTransFailed,
  I2CTransDone
}
 
enum  I2CStatus {
  I2CIdle, I2CStartRequested, I2CAddrWrSent, I2CAddrRdSent,
  I2CSendingByte, I2CReadingByte, I2CReadingLastByte, I2CStopRequested,
  I2CRestartRequested, I2CComplete, I2CFailed
}
 

Functions

void i2c_init (struct i2c_periph *p)
 
bool_t i2c_idle (struct i2c_periph *p)
 
bool_t i2c_submit (struct i2c_periph *p, struct i2c_transaction *t)
 
void i2c_setbitrate (struct i2c_periph *p, int bitrate)
 
void i2c_event (void)
 
bool_t i2c_transmit (struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
 
bool_t i2c_receive (struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint16_t len)
 
bool_t i2c_transceive (struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
 

Detailed Description

Architecture independent I2C (Inter-Integrated Circuit Bus) API.

Also see the I2C interface page.

Definition in file i2c.h.