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.h File Reference

Driver for the gyro L3G4200 From ST. More...

#include "std.h"
#include "math/pprz_algebra_int.h"
#include "mcu_periph/i2c.h"
#include "peripherals/l3g4200_regs.h"
+ Include dependency graph for l3g4200.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  L3g4200Config
 
struct  L3g4200
 

Macros

#define L3G4200_DEFAULT_DR   L3G4200_DR_800Hz
 Default Output rate 800hz. More...
 
#define L3G4200_DEFAULT_DLPF   L3G4200_DLPF_2
 Default digital lowpass filter 35hz. More...
 
#define L3G4200_DEFAULT_CTRL_REG1   0x8f
 
#define L3G4200_DEFAULT_CTRL_REG5   0x02
 

Enumerations

enum  L3g4200ConfStatus { L3G_CONF_UNINIT, L3G_CONF_REG1, L3G_CONF_REG5, L3G_CONF_DONE }
 config status states More...
 

Functions

void l3g4200_init (struct L3g4200 *itg, struct i2c_periph *i2c_p, uint8_t i2c_address)
 Initialize L3g4200 struct and set default config options. More...
 
void l3g4200_set_default_config (struct L3g4200Config *conf)
 
void l3g4200_start_configure (struct L3g4200 *l3g)
 
void l3g4200_read (struct L3g4200 *l3g)
 
void l3g4200_event (struct L3g4200 *l3g)
 
static void l3g4200_periodic (struct L3g4200 *l3g)
 convenience function: read or start configuration if not already initialized More...
 

Detailed Description

Driver for the gyro L3G4200 From ST.

Definition in file l3g4200.h.

Macro Definition Documentation

#define L3G4200_DEFAULT_CTRL_REG1   0x8f

Definition at line 48 of file l3g4200.h.

Referenced by l3g4200_set_default_config().

#define L3G4200_DEFAULT_CTRL_REG5   0x02

Definition at line 49 of file l3g4200.h.

Referenced by l3g4200_set_default_config().

#define L3G4200_DEFAULT_DLPF   L3G4200_DLPF_2

Default digital lowpass filter 35hz.

Definition at line 44 of file l3g4200.h.

#define L3G4200_DEFAULT_DR   L3G4200_DR_800Hz

Default Output rate 800hz.

Definition at line 42 of file l3g4200.h.

Enumeration Type Documentation

config status states

Enumerator
L3G_CONF_UNINIT 
L3G_CONF_REG1 
L3G_CONF_REG5 
L3G_CONF_DONE 

Definition at line 57 of file l3g4200.h.

Function Documentation

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:

static void l3g4200_periodic ( struct L3g4200 l3g)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 85 of file l3g4200.h.

References L3g4200::initialized, l3g4200_read(), and l3g4200_start_configure().

+ 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:

void l3g4200_set_default_config ( struct L3g4200Config conf)

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: