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
l3gd20_spi.h File Reference

Driver for L3GD20 3-axis gyroscope from ST using SPI. More...

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

Go to the source code of this file.

Data Structures

struct  L3gd20_Spi
 
union  L3gd20_Spi.data_rates
 

Functions

void l3gd20_spi_init (struct L3gd20_Spi *l3g, struct spi_periph *spi_p, uint8_t slave_idx)
 
void l3gd20_spi_start_configure (struct L3gd20_Spi *l3g)
 
void l3gd20_spi_read (struct L3gd20_Spi *l3g)
 
void l3gd20_spi_event (struct L3gd20_Spi *l3g)
 
static void l3gd20_spi_periodic (struct L3gd20_Spi *l3g)
 convenience function: read or start configuration if not already initialized More...
 

Detailed Description

Driver for L3GD20 3-axis gyroscope from ST using SPI.

Definition in file l3gd20_spi.h.


Data Structure Documentation

struct L3gd20_Spi

Definition at line 38 of file l3gd20_spi.h.

+ Collaboration diagram for L3gd20_Spi:
Data Fields
struct L3gd20Config config
volatile bool data_available data ready flag
union L3gd20_Spi data_rates
enum L3gd20ConfStatus 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 L3gd20_Spi.data_rates

Definition at line 46 of file l3gd20_spi.h.

Data Fields
struct Int16Rates rates data vector in accel coordinate system
int16_t value[3] data values accessible by channel index

Function Documentation

static void l3gd20_spi_periodic ( struct L3gd20_Spi l3g)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 60 of file l3gd20_spi.h.

References L3gd20_Spi::initialized, l3gd20_spi_read(), and l3gd20_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 l3gd20_spi_read ( struct L3gd20_Spi l3g)

Definition at line 122 of file l3gd20_spi.c.

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

Referenced by l3gd20_spi_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void l3gd20_spi_start_configure ( struct L3gd20_Spi l3g)

Definition at line 112 of file l3gd20_spi.c.

References L3gd20_Spi::init_status, L3G_CONF_UNINIT, l3gd20_spi_send_config(), L3gd20_Spi::spi_trans, SPITransDone, SPITransSuccess, and spi_transaction::status.

Referenced by l3gd20_spi_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: