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

Go to the source code of this file.

Data Structures

struct  Lsm303dlhc_Spi
 
union  Lsm303dlhc_Spi.data_accel
 
union  Lsm303dlhc_Spi.data_mag
 
union  Lsm303dlhc_Spi.config
 

Functions

void lsm303dlhc_spi_init (struct Lsm303dlhc_Spi *lsm, struct spi_periph *spi_p, uint8_t slave_idx, enum Lsm303dlhcTarget target)
 
void lsm303dlhc_spi_start_configure (struct Lsm303dlhc_Spi *lsm)
 
void lsm303dlhc_spi_read (struct Lsm303dlhc_Spi *lsm)
 
void lsm303dlhc_spi_event (struct Lsm303dlhc_Spi *lsm)
 
static void lsm303dlhc_spi_periodic (struct Lsm303dlhc_Spi *lsm)
 convenience function: read or start configuration if not already initialized More...
 

Data Structure Documentation

struct Lsm303dlhc_Spi

Definition at line 37 of file lsm303dlhc_spi.h.

+ Collaboration diagram for Lsm303dlhc_Spi:
Data Fields
union Lsm303dlhc_Spi config
union Lsm303dlhc_Spi data_accel
volatile bool data_available_acc data ready flag accelero
volatile bool data_available_mag data ready flag magneto
union Lsm303dlhc_Spi data_mag
enum Lsm303dlhcConfStatus init_status
bool initialized config done flag
volatile uint8_t rx_buf[8]
struct spi_periph * spi_p
struct spi_transaction spi_trans
enum Lsm303dlhcTarget target
volatile uint8_t tx_buf[2]
union Lsm303dlhc_Spi.data_accel

Definition at line 47 of file lsm303dlhc_spi.h.

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

Definition at line 51 of file lsm303dlhc_spi.h.

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

Definition at line 55 of file lsm303dlhc_spi.h.

Data Fields
struct Lsm303dlhcAccConfig acc
struct Lsm303dlhcMagConfig mag

Function Documentation

static void lsm303dlhc_spi_periodic ( struct Lsm303dlhc_Spi lsm)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 71 of file lsm303dlhc_spi.h.

References Lsm303dlhc_Spi::initialized, lsm303dlhc_spi_read(), and lsm303dlhc_spi_start_configure().

Referenced by imu_px4_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lsm303dlhc_spi_start_configure ( struct Lsm303dlhc_Spi lsm)

Definition at line 147 of file lsm303dlhc_spi.c.

References Lsm303dlhc_Spi::init_status, lsm303dlhc_spi_send_config(), LSM_CONF_UNINIT, Lsm303dlhc_Spi::spi_trans, SPITransDone, SPITransSuccess, and spi_transaction::status.

Referenced by lsm303dlhc_spi_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: