Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for L3GD20 3-axis gyroscope from ST using SPI. More...
#include "peripherals/l3gd20_spi.h"
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) |
Driver for L3GD20 3-axis gyroscope from ST using SPI.
Definition in file l3gd20_spi.c.
#define Int16FromBuf | ( | _buf, | |
_idx | |||
) | ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx])) |
Definition at line 133 of file l3gd20_spi.c.
Referenced by l3gd20_spi_event().
void l3gd20_spi_event | ( | struct L3gd20_Spi * | l3g | ) |
Definition at line 135 of file l3gd20_spi.c.
References L3gd20_Spi::data_available, L3gd20_Spi::data_rates, L3gd20_Spi::init_status, L3gd20_Spi::initialized, Int16FromBuf, L3G_CONF_UNINIT, L3G_CONF_WHO_AM_I, L3G_CONF_WHO_AM_I_OK, l3gd20_spi_send_config(), L3GD20_WHO_AM_I, L3gd20_Spi::rx_buf, L3gd20_Spi::spi_trans, SPITransDone, SPITransFailed, SPITransSuccess, spi_transaction::status, and TRUE.
void l3gd20_spi_init | ( | struct L3gd20_Spi * | l3g, |
struct spi_periph * | spi_p, | ||
uint8_t | slave_idx | ||
) |
Definition at line 30 of file l3gd20_spi.c.
References spi_transaction::after_cb, spi_transaction::before_cb, spi_transaction::bitorder, spi_transaction::cdiv, L3gd20_Spi::config, spi_transaction::cpha, spi_transaction::cpol, L3gd20_Spi::data_available, spi_transaction::dss, FALSE, L3gd20_Spi::init_status, L3gd20_Spi::initialized, spi_transaction::input_buf, spi_transaction::input_length, L3G_CONF_UNINIT, l3gd20_set_default_config(), spi_transaction::output_buf, spi_transaction::output_length, L3gd20_Spi::rx_buf, spi_transaction::select, spi_transaction::slave_idx, L3gd20_Spi::spi_p, L3gd20_Spi::spi_trans, SPICphaEdge2, SPICpolIdleHigh, SPIDiv64, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, spi_transaction::status, and L3gd20_Spi::tx_buf.
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().
|
static |
Definition at line 74 of file l3gd20_spi.c.
References L3gd20_Spi::config, L3gd20Config::drbw, L3gd20Config::full_scale, L3gd20_Spi::init_status, L3gd20_Spi::initialized, spi_transaction::input_length, L3G_CONF_DONE, L3G_CONF_ENABLE, L3G_CONF_REG4, L3G_CONF_WHO_AM_I, L3GD20_PD, L3GD20_REG_CTRL_REG1, L3GD20_REG_CTRL_REG4, L3GD20_REG_WHO_AM_I, l3gd20_spi_write_to_reg(), L3GD20_Xen, L3GD20_Yen, L3GD20_Zen, spi_transaction::output_length, L3gd20Config::spi_3_wire, L3gd20_Spi::spi_p, spi_submit(), L3gd20_Spi::spi_trans, SPITransDone, spi_transaction::status, TRUE, and L3gd20_Spi::tx_buf.
Referenced by l3gd20_spi_event(), and 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().
|
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().