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

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

#include "peripherals/lsm303d_spi.h"
#include "std.h"
+ Include dependency graph for lsm303d_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 lsm303d_spi_init (struct Lsm303d_Spi *lsm, struct spi_periph *spi_p, uint8_t slave_idx, enum Lsm303dTarget target)
 
static void lsm303d_spi_tx_reg (struct Lsm303d_Spi *lsm, uint8_t reg, uint8_t val)
 
static void lsm303d_spi_send_config (struct Lsm303d_Spi *lsm)
 Configuration function called once before normal use. More...
 
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)
 

Detailed Description

Driver for ST LSM303D 3D accelerometer and magnetometer.

Definition in file lsm303d_spi.c.

Macro Definition Documentation

◆ Int16FromBuf

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

Definition at line 172 of file lsm303d_spi.c.

Function Documentation

◆ lsm303d_spi_event()

◆ lsm303d_spi_init()

◆ lsm303d_spi_read()

void lsm303d_spi_read ( struct Lsm303d_Spi lsm)

◆ lsm303d_spi_send_config()

◆ 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:

◆ lsm303d_spi_tx_reg()

static void lsm303d_spi_tx_reg ( struct Lsm303d_Spi lsm,
uint8_t  reg,
uint8_t  val 
)
static

Definition at line 70 of file lsm303d_spi.c.

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

Referenced by lsm303d_spi_send_config().

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