Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
l3g4200.c File Reference
#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+1]<<8) | _buf[_idx]))
 

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

◆ Int16FromBuf

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

Definition at line 112 of file l3g4200.c.

Function Documentation

◆ l3g4200_event()

void l3g4200_event ( struct L3g4200 l3g)

Definition at line 114 of file l3g4200.c.

References i2c_transaction::buf, L3g4200::data, L3g4200::data_available, L3g4200::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, L3g4200::init_status, L3g4200::initialized, Int16FromBuf, l3g4200_send_config(), L3G_CONF_UNINIT, and i2c_transaction::status.

Referenced by imu_gl1_event().

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

◆ l3g4200_i2c_tx_reg()

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

Definition at line 60 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:

◆ l3g4200_init()

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 47 of file l3g4200.c.

References L3g4200::config, 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.

Referenced by imu_gl1_init().

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

◆ l3g4200_read()

void l3g4200_read ( struct L3g4200 l3g)

Definition at line 104 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:

◆ l3g4200_send_config()

◆ l3g4200_set_default_config()

void l3g4200_set_default_config ( struct L3g4200Config c)

Definition at line 33 of file l3g4200.c.

References c(), L3G4200_DEFAULT_CTRL_REG1, L3G4200_DEFAULT_CTRL_REG4, and L3G4200_DEFAULT_CTRL_REG5.

Referenced by l3g4200_init().

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

◆ l3g4200_start_configure()

void l3g4200_start_configure ( struct L3g4200 l3g)

Definition at line 93 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: