Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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)

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 )
Value:
((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
short int16_t
Typedef defining 16 bit short type.

Definition at line 124 of file itg3200.c.

Referenced by itg3200_event().

Function Documentation

◆ itg3200_event()

void itg3200_event ( struct Itg3200 * itg)

◆ itg3200_i2c_tx_reg()

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

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

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 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(), 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 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:

◆ itg3200_send_config()

◆ itg3200_set_default_config()

◆ itg3200_start_configure()

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

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