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.c File Reference

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

#include "peripherals/lsm303dlhc_spi.h"
#include "std.h"
+ Include dependency graph for lsm303dlhc_spi.c:

Go to the source code of this file.

Macros

#define Int16FromBuf(_buf, _idx)   ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx]))
 

Functions

void lsm303dlhc_spi_init (struct Lsm303dlhc_Spi *lsm, struct spi_periph *spi_p, uint8_t slave_idx, enum Lsm303dlhcTarget target)
 
static void lsm303dlhc_spi_tx_reg (struct Lsm303dlhc_Spi *lsm, uint8_t reg, uint8_t val)
 
static void lsm303dlhc_spi_send_config (struct Lsm303dlhc_Spi *lsm)
 Configuration function called once before normal use. More...
 
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)
 

Detailed Description

Driver for ST LSM303DLHC 3D accelerometer and magnetometer.

Definition in file lsm303dlhc_spi.c.

Macro Definition Documentation

#define Int16FromBuf (   _buf,
  _idx 
)    ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx]))

Definition at line 179 of file lsm303dlhc_spi.c.

Referenced by lsm303dlhc_spi_event().

Function Documentation

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:

static void lsm303dlhc_spi_tx_reg ( struct Lsm303dlhc_Spi lsm,
uint8_t  reg,
uint8_t  val 
)
static

Definition at line 71 of file lsm303dlhc_spi.c.

References spi_transaction::input_length, spi_transaction::output_length, Lsm303dlhc_Spi::spi_p, spi_submit(), Lsm303dlhc_Spi::spi_trans, Lsm303dlhc_Spi::tx_buf, and val.

Referenced by lsm303dlhc_spi_send_config().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: