Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for ITG3200. More...
Go to the source code of this file.
Macros | |
#define | Int16FromBuf(_buf, _idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1])) |
Functions | |
void | itg3200_set_default_config (struct Itg3200Config *c) |
void | itg3200_init (struct Itg3200 *itg, struct i2c_periph *i2c_p, uint8_t addr) |
Initialize Itg3200 struct and set default config options. More... | |
static void | itg3200_i2c_tx_reg (struct Itg3200 *itg, uint8_t reg, uint8_t val) |
static void | itg3200_send_config (struct Itg3200 *itg) |
void | itg3200_start_configure (struct Itg3200 *itg) |
void | itg3200_read (struct Itg3200 *itg) |
void | itg3200_event (struct Itg3200 *itg) |
#define Int16FromBuf | ( | _buf, | |
_idx | |||
) | ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1])) |
Definition at line 124 of file itg3200.c.
Referenced by itg3200_event().
void itg3200_event | ( | struct Itg3200 * | itg | ) |
Definition at line 126 of file itg3200.c.
References i2c_transaction::buf, Itg3200::data, Itg3200::data_available, Itg3200::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, Itg3200::init_status, Itg3200::initialized, Int16FromBuf, itg3200_send_config(), ITG_CONF_UNINIT, and i2c_transaction::status.
Referenced by imu_aspirin_event(), imu_aspirin_i2c_event(), imu_navgo_event(), imu_ppzuav_event(), and imu_umarim_event().
Definition at line 62 of file itg3200.c.
References i2c_transaction::buf, Itg3200::i2c_p, i2c_submit(), Itg3200::i2c_trans, I2CTransTx, i2c_transaction::len_r, i2c_transaction::len_w, i2c_transaction::type, and val.
Referenced by itg3200_send_config().
void itg3200_init | ( | struct Itg3200 * | itg, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr | ||
) |
Initialize Itg3200 struct and set default config options.
itg | Itg3200 struct |
i2c_p | I2C periperal to use |
addr | I2C address of ITG3200 |
Definition at line 49 of file itg3200.c.
References Itg3200::config, Itg3200::i2c_p, Itg3200::i2c_trans, I2CTransDone, Itg3200::init_status, Itg3200::initialized, itg3200_set_default_config(), ITG_CONF_UNINIT, i2c_transaction::slave_addr, and i2c_transaction::status.
Referenced by imu_aspirin_i2c_init(), imu_aspirin_init(), imu_navgo_init(), imu_ppzuav_init(), and imu_umarim_init().
void itg3200_read | ( | struct Itg3200 * | itg | ) |
Definition at line 113 of file itg3200.c.
References i2c_transaction::buf, Itg3200::i2c_p, i2c_submit(), Itg3200::i2c_trans, I2CTransDone, I2CTransTxRx, Itg3200::initialized, ITG3200_REG_INT_STATUS, i2c_transaction::len_r, i2c_transaction::len_w, i2c_transaction::status, and i2c_transaction::type.
Referenced by itg3200_periodic().
|
static |
Definition at line 73 of file itg3200.c.
References Itg3200Config::clk_sel, Itg3200::config, Itg3200Config::dlpf_cfg, Itg3200Config::fs_sel, Itg3200::i2c_trans, I2CTransDone, Itg3200::init_status, Itg3200::initialized, Itg3200Config::int_cfg, itg3200_i2c_tx_reg(), ITG3200_REG_DLPF_FS, ITG3200_REG_INT_CFG, ITG3200_REG_PWR_MGM, ITG3200_REG_SMPLRT_DIV, ITG_CONF_DF, ITG_CONF_DONE, ITG_CONF_INT, ITG_CONF_PWR, ITG_CONF_SD, Itg3200Config::smplrt_div, and i2c_transaction::status.
Referenced by itg3200_event(), and itg3200_start_configure().
void itg3200_set_default_config | ( | struct Itg3200Config * | c | ) |
Definition at line 33 of file itg3200.c.
References Itg3200Config::clk_sel, Itg3200Config::dlpf_cfg, Itg3200Config::fs_sel, Itg3200Config::int_cfg, ITG3200_DEFAULT_CLK_SEL, ITG3200_DEFAULT_DLPF_CFG, ITG3200_DEFAULT_FS_SEL, ITG3200_DEFAULT_INT_CFG, ITG3200_DEFAULT_SMPLRT_DIV, and Itg3200Config::smplrt_div.
Referenced by itg3200_init().
void itg3200_start_configure | ( | struct Itg3200 * | itg | ) |
Definition at line 102 of file itg3200.c.
References Itg3200::i2c_trans, I2CTransDone, I2CTransSuccess, Itg3200::init_status, itg3200_send_config(), ITG_CONF_UNINIT, and i2c_transaction::status.
Referenced by itg3200_periodic().