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

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

+ Include dependency graph for l3gd20_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 l3gd20_spi_init (struct L3gd20_Spi *l3g, struct spi_periph *spi_p, uint8_t slave_idx)
 
static void l3gd20_spi_write_to_reg (struct L3gd20_Spi *l3g, uint8_t _reg, uint8_t _val)
 
static void l3gd20_spi_send_config (struct L3gd20_Spi *l3g)
 
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)
 

Detailed Description

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

Definition in file l3gd20_spi.c.

Macro Definition Documentation

◆ Int16FromBuf

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

Definition at line 133 of file l3gd20_spi.c.

Function Documentation

◆ l3gd20_spi_event()

◆ l3gd20_spi_init()

◆ l3gd20_spi_read()

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:

◆ l3gd20_spi_send_config()

◆ l3gd20_spi_start_configure()

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:

◆ l3gd20_spi_write_to_reg()

static void l3gd20_spi_write_to_reg ( struct L3gd20_Spi l3g,
uint8_t  _reg,
uint8_t  _val 
)
static

Definition at line 64 of file l3gd20_spi.c.

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

Referenced by l3gd20_spi_send_config().

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