Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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. 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)
 

Detailed Description

Driver for ITG3200.

Todo:
DRDY/IRQ handling

Definition in file itg3200.c.

Macro Definition Documentation

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

Definition at line 123 of file itg3200.c.

Referenced by itg3200_event().

Function Documentation

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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:

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: