Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
itg3200.c File Reference

Driver for ITG3200. More...

#include "peripherals/itg3200.h"
#include "std.h"
+ Include dependency graph for itg3200.c:

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

Detailed Description

Driver for ITG3200.

Todo:
DRDY/IRQ handling

Definition in file itg3200.c.

Macro Definition Documentation

◆ Int16FromBuf

#define Int16FromBuf (   _buf,
  _idx 
)    ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))

Definition at line 124 of file itg3200.c.

Function Documentation

◆ itg3200_event()

void itg3200_event ( struct Itg3200 itg)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itg3200_i2c_tx_reg()

static void itg3200_i2c_tx_reg ( struct Itg3200 itg,
uint8_t  reg,
uint8_t  val 
)
static

Definition at line 62 of file itg3200.c.

References foo, i2c_submit(), I2CTransTx, and val.

Referenced by itg3200_send_config().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itg3200_init()

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 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itg3200_read()

void itg3200_read ( struct Itg3200 itg)

Definition at line 113 of file itg3200.c.

References foo, i2c_submit(), I2CTransDone, I2CTransTxRx, and ITG3200_REG_INT_STATUS.

Referenced by itg3200_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itg3200_send_config()

static void itg3200_send_config ( struct Itg3200 itg)
static

Definition at line 73 of file itg3200.c.

References foo, I2CTransDone, 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, and ITG_CONF_SD.

Referenced by itg3200_event(), and itg3200_start_configure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itg3200_set_default_config()

◆ itg3200_start_configure()

void itg3200_start_configure ( struct Itg3200 itg)

Definition at line 102 of file itg3200.c.

References foo, I2CTransDone, I2CTransSuccess, itg3200_send_config(), and ITG_CONF_UNINIT.

Referenced by itg3200_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: