124 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
#define ITG3200_DEFAULT_FS_SEL
Default full scale range +- 2000°/s.
uint8_t smplrt_div
Sample rate divider.
void itg3200_init(struct Itg3200 *itg, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Itg3200 struct and set default config options.
#define ITG3200_REG_DLPF_FS
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
uint16_t len_r
Number of bytes to read/receive.
transaction successfully finished by I2C driver
uint8_t int_cfg
Interrupt config.
transmit and receive transaction
uint8_t fs_sel
Full scale range.
struct i2c_periph * i2c_p
static void itg3200_i2c_tx_reg(struct Itg3200 *itg, uint8_t reg, uint8_t val)
#define Int16FromBuf(_buf, _idx)
#define ITG3200_DEFAULT_DLPF_CFG
Default internal sampling (1kHz, 42Hz LP Bandwidth)
struct i2c_transaction i2c_trans
#define ITG3200_DEFAULT_SMPLRT_DIV
Default sample rate divider.
uint8_t len_w
Number of bytes to write/transmit.
enum Itg3200ConfStatus init_status
init status
#define ITG3200_DEFAULT_CLK_SEL
Default clock: PLL with X gyro reference.
Driver for the gyro ITG3200 from InvenSense.
transaction set to done by user level
#define ITG3200_DEFAULT_INT_CFG
Default interrupt config: RAW_RDY_EN.
uint8_t clk_sel
Clock select.
bool i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
i2c_submit() function
enum I2CTransactionStatus status
Transaction status.
#define ITG3200_REG_PWR_MGM
uint8_t slave_addr
Slave address.
I2C peripheral structure.
enum Itg3200DLPF dlpf_cfg
Digital Low Pass Filter.
#define ITG3200_REG_INT_CFG
#define ITG3200_REG_INT_STATUS
transmit only transaction
void itg3200_event(struct Itg3200 *itg)
static void itg3200_send_config(struct Itg3200 *itg)
void itg3200_read(struct Itg3200 *itg)
enum I2CTransactionType type
Transaction type.
void itg3200_start_configure(struct Itg3200 *itg)
void itg3200_set_default_config(struct Itg3200Config *c)
volatile bool data_available
data ready flag
struct Itg3200Config config
bool initialized
config done flag
#define ITG3200_REG_SMPLRT_DIV