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
l3g4200.c File Reference

Driver for L3G4200 from ST. More...

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

Go to the source code of this file.

Macros

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

Functions

void l3g4200_set_default_config (struct L3g4200Config *c)
 
void l3g4200_init (struct L3g4200 *l3g, struct i2c_periph *i2c_p, uint8_t addr)
 Initialize L3g4200 struct and set default config options. More...
 
static void l3g4200_i2c_tx_reg (struct L3g4200 *l3g, uint8_t reg, uint8_t val)
 
static void l3g4200_send_config (struct L3g4200 *l3g)
 
void l3g4200_start_configure (struct L3g4200 *l3g)
 
void l3g4200_read (struct L3g4200 *l3g)
 
void l3g4200_event (struct L3g4200 *l3g)
 

Detailed Description

Driver for L3G4200 from ST.

Definition in file l3g4200.c.

Macro Definition Documentation

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

Definition at line 107 of file l3g4200.c.

Referenced by l3g4200_event().

Function Documentation

static void l3g4200_i2c_tx_reg ( struct L3g4200 l3g,
uint8_t  reg,
uint8_t  val 
)
static

Definition at line 59 of file l3g4200.c.

References i2c_transaction::buf, L3g4200::i2c_p, L3g4200::i2c_trans, i2c_transmit(), i2c_transaction::slave_addr, and val.

Referenced by l3g4200_send_config().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void l3g4200_init ( struct L3g4200 l3g,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Initialize L3g4200 struct and set default config options.

Parameters
l3gL3g4200 struct
i2c_pI2C periperal to use
addrI2C address of L3G4200

Definition at line 46 of file l3g4200.c.

References L3g4200::config, FALSE, L3g4200::i2c_p, L3g4200::i2c_trans, I2CTransDone, L3g4200::init_status, L3g4200::initialized, l3g4200_set_default_config(), L3G_CONF_UNINIT, i2c_transaction::slave_addr, and i2c_transaction::status.

+ Here is the call graph for this function:

void l3g4200_read ( struct L3g4200 l3g)

Definition at line 99 of file l3g4200.c.

References i2c_transaction::buf, L3g4200::i2c_p, L3g4200::i2c_trans, i2c_transceive(), I2CTransDone, L3g4200::initialized, L3G4200_REG_STATUS_REG, i2c_transaction::slave_addr, and i2c_transaction::status.

Referenced by l3g4200_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void l3g4200_send_config ( struct L3g4200 l3g)
static
void l3g4200_set_default_config ( struct L3g4200Config c)

Definition at line 34 of file l3g4200.c.

References L3g4200Config::ctrl_reg1, L3g4200Config::ctrl_reg5, L3G4200_DEFAULT_CTRL_REG1, and L3G4200_DEFAULT_CTRL_REG5.

Referenced by l3g4200_init().

+ Here is the caller graph for this function:

void l3g4200_start_configure ( struct L3g4200 l3g)

Definition at line 88 of file l3g4200.c.

References L3g4200::i2c_trans, I2CTransDone, I2CTransSuccess, L3g4200::init_status, l3g4200_send_config(), L3G_CONF_UNINIT, and i2c_transaction::status.

Referenced by l3g4200_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: