Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "std.h"
#include "math/pprz_algebra_int.h"
#include "mcu_periph/i2c.h"
#include "peripherals/l3g4200_regs.h"
Go to the source code of this file.
Data Structures | |
struct | L3g4200Config |
struct | L3g4200 |
union | L3g4200.data |
Macros | |
#define | L3G4200_DEFAULT_DR L3G4200_DR_100Hz |
#define | L3G4200_DEFAULT_DLPF L3G4200_DLPF_1 |
#define | L3G4200_DEFAULT_SCALE L3G4200_SCALE_2000 |
#define | L3G4200_DEFAULT_CTRL_REG1 ((L3G4200_DEFAULT_DR<<6) | (L3G4200_DEFAULT_DLPF<<4) | 0xf); |
#define | L3G4200_DEFAULT_CTRL_REG4 (L3G4200_DEFAULT_SCALE<<4) | 0x00; |
#define | L3G4200_DEFAULT_CTRL_REG5 0x00 |
Enumerations | |
enum | L3g4200ConfStatus { L3G_CONF_UNINIT, L3G_CONF_REG1, L3G_CONF_REG4, L3G_CONF_REG5, L3G_CONF_DONE } |
config status states More... | |
Functions | |
void | l3g4200_init (struct L3g4200 *l3g, 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... | |
Driver for the gyro L3G4200 From ST.
Definition in file l3g4200.h.
struct L3g4200Config |
struct L3g4200 |
Data Fields | ||
---|---|---|
struct L3g4200Config | config | |
union L3g4200 | data | |
volatile bool | data_available | data ready flag |
struct i2c_periph * | i2c_p | |
struct i2c_transaction | i2c_trans | |
enum L3g4200ConfStatus | init_status | init status |
bool | initialized | config done flag |
union L3g4200.data |
Data Fields | ||
---|---|---|
struct Int32Rates | rates | data as angular rates in gyro coordinate system |
int32_t | value[3] | data values accessible by channel index |
#define L3G4200_DEFAULT_CTRL_REG1 ((L3G4200_DEFAULT_DR<<6) | (L3G4200_DEFAULT_DLPF<<4) | 0xf); |
#define L3G4200_DEFAULT_CTRL_REG4 (L3G4200_DEFAULT_SCALE<<4) | 0x00; |
#define L3G4200_DEFAULT_DLPF L3G4200_DLPF_1 |
#define L3G4200_DEFAULT_DR L3G4200_DR_100Hz |
#define L3G4200_DEFAULT_SCALE L3G4200_SCALE_2000 |
enum L3g4200ConfStatus |
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().
void l3g4200_init | ( | struct L3g4200 * | l3g, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr | ||
) |
Initialize L3g4200 struct and set default config options.
l3g | L3g4200 struct |
i2c_p | I2C periperal to use |
addr | I2C 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().
|
inlinestatic |
convenience function: read or start configuration if not already initialized
Definition at line 88 of file l3g4200.h.
References L3g4200::initialized, l3g4200_read(), and l3g4200_start_configure().
Referenced by imu_gl1_periodic().
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().
void l3g4200_set_default_config | ( | struct L3g4200Config * | conf | ) |
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().
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().