Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
adxl345_spi.h File Reference

Driver for the accelerometer ADXL345 from Analog Devices using SPI. More...

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

Go to the source code of this file.

Data Structures

struct  Adxl345_Spi
 
union  Adxl345_Spi.data
 

Functions

void adxl345_spi_init (struct Adxl345_Spi *adxl, struct spi_periph *spi_p, uint8_t addr)
 
void adxl345_spi_start_configure (struct Adxl345_Spi *adxl)
 
void adxl345_spi_read (struct Adxl345_Spi *adxl)
 
void adxl345_spi_event (struct Adxl345_Spi *adxl)
 
static void adxl345_spi_periodic (struct Adxl345_Spi *adxl)
 convenience function: read or start configuration if not already initialized
 

Detailed Description

Driver for the accelerometer ADXL345 from Analog Devices using SPI.

Definition in file adxl345_spi.h.


Data Structure Documentation

◆ Adxl345_Spi

struct Adxl345_Spi

Definition at line 39 of file adxl345_spi.h.

+ Collaboration diagram for Adxl345_Spi:
Data Fields
struct Adxl345Config config
union Adxl345_Spi.data data
volatile bool data_available data ready flag
enum Adxl345ConfStatus init_status init status
bool initialized config done flag
volatile uint8_t rx_buf[7]
struct spi_periph * spi_p
struct spi_transaction spi_trans
volatile uint8_t tx_buf[7]

◆ Adxl345_Spi.data

union Adxl345_Spi.data

Definition at line 47 of file adxl345_spi.h.

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

Function Documentation

◆ adxl345_spi_event()

void adxl345_spi_event ( struct Adxl345_Spi adxl)
extern

Definition at line 131 of file adxl345_spi.c.

References adxl345_spi_send_config(), ADXL_CONF_UNINIT, foo, Int16FromBuf, SPITransDone, SPITransFailed, and SPITransSuccess.

Referenced by imu_aspirin_event().

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

◆ adxl345_spi_init()

void adxl345_spi_init ( struct Adxl345_Spi adxl,
struct spi_periph spi_p,
uint8_t  addr 
)
extern

Definition at line 35 of file adxl345_spi.c.

References adxl345_set_default_config(), ADXL_CONF_UNINIT, foo, SPICphaEdge2, SPICpolIdleHigh, SPIDiv64, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, and spi_periph::status.

Referenced by imu_aspirin_init().

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

◆ adxl345_spi_periodic()

static void adxl345_spi_periodic ( struct Adxl345_Spi adxl)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 61 of file adxl345_spi.h.

References adxl345_spi_read(), adxl345_spi_start_configure(), and foo.

Referenced by imu_aspirin_periodic().

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

◆ adxl345_spi_read()

void adxl345_spi_read ( struct Adxl345_Spi adxl)
extern

Definition at line 118 of file adxl345_spi.c.

References ADXL345_REG_DATA_X0, foo, spi_submit(), and SPITransDone.

Referenced by adxl345_spi_periodic().

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

◆ adxl345_spi_start_configure()

void adxl345_spi_start_configure ( struct Adxl345_Spi adxl)
extern

Definition at line 108 of file adxl345_spi.c.

References adxl345_spi_send_config(), ADXL_CONF_UNINIT, foo, SPITransDone, and SPITransSuccess.

Referenced by adxl345_spi_periodic().

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