112 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx]))
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
enum I2CTransactionStatus status
Transaction status.
uint8_t slave_addr
Slave address.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
transaction set to done by user level
void l3g4200_start_configure(struct L3g4200 *l3g)
void l3g4200_set_default_config(struct L3g4200Config *c)
static void l3g4200_i2c_tx_reg(struct L3g4200 *l3g, uint8_t reg, uint8_t val)
void l3g4200_read(struct L3g4200 *l3g)
void l3g4200_init(struct L3g4200 *l3g, struct i2c_periph *i2c_p, uint8_t addr)
Initialize L3g4200 struct and set default config options.
static void l3g4200_send_config(struct L3g4200 *l3g)
#define Int16FromBuf(_buf, _idx)
void l3g4200_event(struct L3g4200 *l3g)
Driver for the gyro L3G4200 From ST.
#define L3G4200_DEFAULT_CTRL_REG4
bool initialized
config done flag
volatile bool data_available
data ready flag
struct i2c_periph * i2c_p
struct i2c_transaction i2c_trans
struct L3g4200Config config
#define L3G4200_DEFAULT_CTRL_REG5
enum L3g4200ConfStatus init_status
init status
#define L3G4200_DEFAULT_CTRL_REG1
#define L3G4200_REG_CTRL_REG5
#define L3G4200_REG_STATUS_REG
#define L3G4200_REG_CTRL_REG4
#define L3G4200_REG_CTRL_REG1
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.