Paparazzi UAS  v5.15_devel-47-g0391b4d
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
lis302dl_spi.h File Reference

Driver for LIS302DL 3-axis accelerometer from ST using SPI. More...

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

Go to the source code of this file.

Data Structures

struct  Lis302dl_Spi
 
union  Lis302dl_Spi.data
 

Functions

void lis302dl_spi_init (struct Lis302dl_Spi *lis, struct spi_periph *spi_p, uint8_t addr)
 
void lis302dl_spi_start_configure (struct Lis302dl_Spi *lis)
 
void lis302dl_spi_read (struct Lis302dl_Spi *lis)
 
void lis302dl_spi_event (struct Lis302dl_Spi *lis)
 
static void lis302dl_spi_periodic (struct Lis302dl_Spi *lis)
 convenience function: read or start configuration if not already initialized More...
 

Detailed Description

Driver for LIS302DL 3-axis accelerometer from ST using SPI.

Definition in file lis302dl_spi.h.


Data Structure Documentation

struct Lis302dl_Spi

Definition at line 39 of file lis302dl_spi.h.

+ Collaboration diagram for Lis302dl_Spi:
Data Fields
struct Lis302dlConfig config
union Lis302dl_Spi data
volatile bool data_available data ready flag
enum Lis302dlConfStatus init_status init status
bool initialized config done flag
volatile uint8_t rx_buf[8]
struct spi_periph * spi_p
struct spi_transaction spi_trans
volatile uint8_t tx_buf[2]
union Lis302dl_Spi.data

Definition at line 47 of file lis302dl_spi.h.

Data Fields
int8_t value[3] data values accessible by channel index
struct Int8Vect3 vect data vector in accel coordinate system

Function Documentation

static void lis302dl_spi_periodic ( struct Lis302dl_Spi lis)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 61 of file lis302dl_spi.h.

References Lis302dl_Spi::initialized, lis302dl_spi_read(), and lis302dl_spi_start_configure().

+ Here is the call graph for this function:

void lis302dl_spi_read ( struct Lis302dl_Spi lis)

Definition at line 128 of file lis302dl_spi.c.

References Lis302dl_Spi::initialized, spi_transaction::input_length, LIS302DL_REG_STATUS, spi_transaction::output_length, Lis302dl_Spi::spi_p, spi_submit(), Lis302dl_Spi::spi_trans, SPITransDone, spi_transaction::status, and Lis302dl_Spi::tx_buf.

Referenced by lis302dl_spi_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lis302dl_spi_start_configure ( struct Lis302dl_Spi lis)

Definition at line 118 of file lis302dl_spi.c.

References Lis302dl_Spi::init_status, lis302dl_spi_send_config(), LIS_CONF_UNINIT, Lis302dl_Spi::spi_trans, SPITransDone, SPITransSuccess, and spi_transaction::status.

Referenced by lis302dl_spi_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: