![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the gyro ITG3200 from InvenSense. More...
#include "std.h"
#include "math/pprz_algebra_int.h"
#include "mcu_periph/i2c.h"
#include "peripherals/itg3200_regs.h"
Go to the source code of this file.
Data Structures | |
struct | Itg3200Config |
struct | Itg3200 |
union | Itg3200.data |
Macros | |
#define | ITG3200_DEFAULT_SMPLRT_DIV 0 |
Default sample rate divider. | |
#define | ITG3200_DEFAULT_FS_SEL 3 |
Default full scale range +- 2000°/s. | |
#define | ITG3200_DEFAULT_DLPF_CFG ITG3200_DLPF_42HZ |
Default internal sampling (1kHz, 42Hz LP Bandwidth) | |
#define | ITG3200_DEFAULT_INT_CFG 1 |
Default interrupt config: RAW_RDY_EN. | |
#define | ITG3200_DEFAULT_CLK_SEL 1 |
Default clock: PLL with X gyro reference. | |
Enumerations | |
enum | Itg3200ConfStatus { ITG_CONF_UNINIT , ITG_CONF_SD , ITG_CONF_DF , ITG_CONF_INT , ITG_CONF_PWR , ITG_CONF_DONE } |
config status states More... | |
Functions | |
void | itg3200_init (struct Itg3200 *itg, struct i2c_periph *i2c_p, uint8_t i2c_address) |
Initialize Itg3200 struct and set default config options. | |
void | itg3200_set_default_config (struct Itg3200Config *conf) |
void | itg3200_start_configure (struct Itg3200 *itg) |
void | itg3200_read (struct Itg3200 *itg) |
void | itg3200_event (struct Itg3200 *itg) |
static void | itg3200_periodic (struct Itg3200 *itg) |
convenience function: read or start configuration if not already initialized | |
Driver for the gyro ITG3200 from InvenSense.
Definition in file itg3200.h.
struct Itg3200Config |
struct Itg3200 |
Data Fields | ||
---|---|---|
struct Itg3200Config | config | |
union Itg3200.data | data | |
volatile bool | data_available | data ready flag |
struct i2c_periph * | i2c_p | |
struct i2c_transaction | i2c_trans | |
enum Itg3200ConfStatus | init_status | init status |
bool | initialized | config done flag |
union Itg3200.data |
Data Fields | ||
---|---|---|
struct Int32Rates | rates | data as angular rates in gyro coordinate system |
int32_t | value[3] | data values accessible by channel index |
#define ITG3200_DEFAULT_CLK_SEL 1 |
#define ITG3200_DEFAULT_DLPF_CFG ITG3200_DLPF_42HZ |
#define ITG3200_DEFAULT_FS_SEL 3 |
#define ITG3200_DEFAULT_INT_CFG 1 |
#define ITG3200_DEFAULT_SMPLRT_DIV 0 |
Definition at line 126 of file itg3200.c.
References foo, I2CTransDone, I2CTransFailed, I2CTransSuccess, Int16FromBuf, itg3200_send_config(), and ITG_CONF_UNINIT.
Referenced by imu_aspirin_event(), and imu_aspirin_i2c_event().
|
extern |
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 foo, I2CTransDone, itg3200_set_default_config(), ITG_CONF_UNINIT, and i2c_periph::status.
Referenced by imu_aspirin_i2c_init(), and imu_aspirin_init().
convenience function: read or start configuration if not already initialized
Definition at line 93 of file itg3200.h.
References foo, itg3200_read(), and itg3200_start_configure().
Referenced by imu_aspirin_i2c_periodic(), and imu_aspirin_periodic().
Definition at line 113 of file itg3200.c.
References foo, i2c_submit(), I2CTransDone, I2CTransTxRx, and ITG3200_REG_INT_STATUS.
Referenced by itg3200_periodic().
|
extern |
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().
Definition at line 102 of file itg3200.c.
References foo, I2CTransDone, I2CTransSuccess, itg3200_send_config(), and ITG_CONF_UNINIT.
Referenced by itg3200_periodic().