Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
itg3200.h File Reference

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"
+ Include dependency graph for itg3200.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Itg3200Config
 
struct  Itg3200
 

Macros

#define ITG3200_DEFAULT_SMPLRT_DIV   0
 Default sample rate divider. More...
 
#define ITG3200_DEFAULT_FS_SEL   3
 Default full scale range +- 2000°/s. More...
 
#define ITG3200_DEFAULT_DLPF_CFG   ITG3200_DLPF_42HZ
 Default internal sampling (1kHz, 42Hz LP Bandwidth) More...
 
#define ITG3200_DEFAULT_INT_CFG   1
 Default interrupt config: RAW_RDY_EN. More...
 
#define ITG3200_DEFAULT_CLK_SEL   1
 Default clock: PLL with X gyro reference. More...
 

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. More...
 
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 More...
 

Detailed Description

Driver for the gyro ITG3200 from InvenSense.

Definition in file itg3200.h.

Macro Definition Documentation

#define ITG3200_DEFAULT_CLK_SEL   1

Default clock: PLL with X gyro reference.

Definition at line 49 of file itg3200.h.

Referenced by itg3200_set_default_config().

#define ITG3200_DEFAULT_DLPF_CFG   ITG3200_DLPF_42HZ

Default internal sampling (1kHz, 42Hz LP Bandwidth)

Definition at line 45 of file itg3200.h.

Referenced by itg3200_set_default_config().

#define ITG3200_DEFAULT_FS_SEL   3

Default full scale range +- 2000°/s.

Definition at line 43 of file itg3200.h.

Referenced by itg3200_set_default_config().

#define ITG3200_DEFAULT_INT_CFG   1

Default interrupt config: RAW_RDY_EN.

Definition at line 47 of file itg3200.h.

Referenced by itg3200_set_default_config().

#define ITG3200_DEFAULT_SMPLRT_DIV   0

Default sample rate divider.

Definition at line 41 of file itg3200.h.

Referenced by itg3200_set_default_config().

Enumeration Type Documentation

config status states

Enumerator
ITG_CONF_UNINIT 
ITG_CONF_SD 
ITG_CONF_DF 
ITG_CONF_INT 
ITG_CONF_PWR 
ITG_CONF_DONE 

Definition at line 61 of file itg3200.h.

Function Documentation

void itg3200_init ( struct Itg3200 itg,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Initialize Itg3200 struct and set default config options.

Parameters
itgItg3200 struct
i2c_pI2C periperal to use
addrI2C address of ITG3200

Definition at line 48 of file itg3200.c.

References Itg3200::config, FALSE, 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_impl_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void itg3200_periodic ( struct Itg3200 itg)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 93 of file itg3200.h.

References Itg3200::initialized, itg3200_read(), and itg3200_start_configure().

Referenced by imu_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void itg3200_read ( struct Itg3200 itg)

Definition at line 112 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void itg3200_start_configure ( struct Itg3200 itg)

Definition at line 101 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: