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