Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
lsm303dlhc_i2c.h File Reference
#include "std.h"
#include "mcu_periph/i2c.h"
#include "math/pprz_algebra_int.h"
#include "peripherals/lsm303dlhc.h"
+ Include dependency graph for lsm303dlhc_i2c.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Lsm303dlhc_i2c
 
union  Lsm303dlhc_i2c.init_status
 
union  Lsm303dlhc_i2c.data_accel
 
union  Lsm303dlhc_i2c.config
 

Functions

void lsm303dlhc_i2c_init (struct Lsm303dlhc_i2c *lsm, struct i2c_periph *i2c_p, uint8_t addr)
 Initialize Lsm303dlhc struct and set default config options. More...
 
void lsm303dlhc_i2c_start_configure (struct Lsm303dlhc_i2c *lsm)
 
void lsm303dlhc_i2c_read (struct Lsm303dlhc_i2c *lsm)
 
void lsm303dlhc_i2c_event (struct Lsm303dlhc_i2c *lsm)
 
static void lsm303dlhc_i2c_periodic (struct Lsm303dlhc_i2c *lsm)
 convenience function: read or start configuration if not already initialized More...
 

Data Structure Documentation

struct Lsm303dlhc_i2c

Definition at line 41 of file lsm303dlhc_i2c.h.

+ Collaboration diagram for Lsm303dlhc_i2c:
Data Fields
union Lsm303dlhc_i2c config
union Lsm303dlhc_i2c data_accel
volatile bool data_available data ready flag
struct i2c_periph * i2c_p
struct i2c_transaction i2c_trans
union Lsm303dlhc_i2c init_status
bool initialized config done flag
union Lsm303dlhc_i2c.init_status

Definition at line 45 of file lsm303dlhc_i2c.h.

Data Fields
enum Lsm303dlhcAccConfStatus acc init status
enum Lsm303dlhcMagConfStatus mag init status
union Lsm303dlhc_i2c.data_accel

Definition at line 50 of file lsm303dlhc_i2c.h.

Data Fields
int16_t value[3] data values accessible by channel index
struct Int16Vect3 vect data vector in acc coordinate system
union Lsm303dlhc_i2c.config

Definition at line 54 of file lsm303dlhc_i2c.h.

Data Fields
struct Lsm303dlhcAccConfig acc
struct Lsm303dlhcMagConfig mag

Function Documentation

void lsm303dlhc_i2c_event ( struct Lsm303dlhc_i2c lsm)
void lsm303dlhc_i2c_init ( struct Lsm303dlhc_i2c lsm,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Initialize Lsm303dlhc struct and set default config options.

Parameters
lsmLsm303dlhc struct
i2c_pI2C peripheral to use
addrI2C address of Lsm303dlhc

Definition at line 39 of file lsm303dlhc_i2c.c.

References Lsm303dlhc_i2c::config, Lsm303dlhc_i2c::i2c_p, Lsm303dlhc_i2c::i2c_trans, I2CTransDone, Lsm303dlhc_i2c::init_status, Lsm303dlhc_i2c::initialized, LSM303DLHC_ACC_ADDR, lsm303dlhc_acc_set_default_config(), lsm303dlhc_mag_set_default_config(), i2c_transaction::slave_addr, and i2c_transaction::status.

+ Here is the call graph for this function:

static void lsm303dlhc_i2c_periodic ( struct Lsm303dlhc_i2c lsm)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 69 of file lsm303dlhc_i2c.h.

References Lsm303dlhc_i2c::initialized, lsm303dlhc_i2c_read(), and lsm303dlhc_i2c_start_configure().

+ Here is the call graph for this function:

void lsm303dlhc_i2c_read ( struct Lsm303dlhc_i2c lsm)

Referenced by lsm303dlhc_i2c_periodic().

+ Here is the caller graph for this function:

void lsm303dlhc_i2c_start_configure ( struct Lsm303dlhc_i2c lsm)

Referenced by lsm303dlhc_i2c_periodic().

+ Here is the caller graph for this function: