NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bus_i2c.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define I2C_SHORT_TIMEOUT   ((uint32_t)0x1000)
 
#define I2C_LONG_TIMEOUT   ((uint32_t)(10 * I2C_SHORT_TIMEOUT))
 
#define I2C_DEFAULT_TIMEOUT   I2C_SHORT_TIMEOUT
 

Typedefs

typedef enum I2CDevice I2CDevice
 

Enumerations

enum  I2CDevice { I2CDEV_1, I2CDEV_2, I2CDEV_MAX = I2CDEV_2 }
 

Functions

void i2cInit (I2CDevice index)
 
bool i2cWriteBuffer (uint8_t addr_, uint8_t reg_, uint8_t len_, uint8_t *data)
 
bool i2cWrite (uint8_t addr_, uint8_t reg, uint8_t data)
 
bool i2cRead (uint8_t addr_, uint8_t reg, uint8_t len, uint8_t *buf)
 
uint16_t i2cGetErrorCounter (void)
 
void i2cSetOverclock (uint8_t OverClock)
 

Macro Definition Documentation

#define I2C_DEFAULT_TIMEOUT   I2C_SHORT_TIMEOUT
#define I2C_LONG_TIMEOUT   ((uint32_t)(10 * I2C_SHORT_TIMEOUT))
#define I2C_SHORT_TIMEOUT   ((uint32_t)0x1000)

Typedef Documentation

typedef enum I2CDevice I2CDevice

Enumeration Type Documentation

enum I2CDevice
Enumerator
I2CDEV_1 
I2CDEV_2 
I2CDEV_MAX 

Function Documentation

uint16_t i2cGetErrorCounter ( void  )
void i2cInit ( I2CDevice  index)
bool i2cRead ( uint8_t  addr_,
uint8_t  reg,
uint8_t  len,
uint8_t *  buf 
)
void i2cSetOverclock ( uint8_t  OverClock)
bool i2cWrite ( uint8_t  addr_,
uint8_t  reg,
uint8_t  data 
)

Here is the call graph for this function:

bool i2cWriteBuffer ( uint8_t  addr_,
uint8_t  reg_,
uint8_t  len_,
uint8_t *  data 
)