Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
lsm303d_spi.h File Reference

Driver for ST LSM303D 3D accelerometer and magnetometer. More...

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

Go to the source code of this file.

Data Structures

struct  Lsm303d_Spi
 
union  Lsm303d_Spi.data_accel
 
union  Lsm303d_Spi.data_mag
 

Functions

void lsm303d_spi_init (struct Lsm303d_Spi *lsm, struct spi_periph *spi_p, uint8_t slave_idx, enum Lsm303dTarget target)
 
void lsm303d_spi_start_configure (struct Lsm303d_Spi *lsm)
 
void lsm303d_spi_read (struct Lsm303d_Spi *lsm)
 
void lsm303d_spi_event (struct Lsm303d_Spi *lsm)
 
static void lsm303d_spi_periodic (struct Lsm303d_Spi *lsm)
 convenience function: read or start configuration if not already initialized More...
 

Detailed Description

Driver for ST LSM303D 3D accelerometer and magnetometer.

Definition in file lsm303d_spi.h.


Data Structure Documentation

◆ Lsm303d_Spi

struct Lsm303d_Spi

Definition at line 37 of file lsm303d_spi.h.

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

◆ Lsm303d_Spi.data_accel

union Lsm303d_Spi.data_accel

Definition at line 47 of file lsm303d_spi.h.

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

◆ Lsm303d_Spi.data_mag

union Lsm303d_Spi.data_mag

Definition at line 51 of file lsm303d_spi.h.

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

Function Documentation

◆ lsm303d_spi_event()

◆ lsm303d_spi_init()

◆ lsm303d_spi_periodic()

static void lsm303d_spi_periodic ( struct Lsm303d_Spi lsm)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 68 of file lsm303d_spi.h.

References Lsm303d_Spi::initialized, lsm303d_spi_read(), and lsm303d_spi_start_configure().

Referenced by imu_px4_periodic().

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

◆ lsm303d_spi_read()

void lsm303d_spi_read ( struct Lsm303d_Spi lsm)

◆ lsm303d_spi_start_configure()

void lsm303d_spi_start_configure ( struct Lsm303d_Spi lsm)

Definition at line 140 of file lsm303d_spi.c.

References Lsm303d_Spi::init_status, LSM303D_CONF_UNINIT, lsm303d_spi_send_config(), Lsm303d_Spi::spi_trans, SPITransDone, SPITransSuccess, and spi_transaction::status.

Referenced by lsm303d_spi_periodic().

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