|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
133 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx]))
142 if (bit_is_set(l3g->
rx_buf[1], 3)) {
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
enum L3gd20FullScale full_scale
gyro full scale
union L3gd20_Spi::@321 data_rates
enum SPIClockPolarity cpol
clock polarity control
void l3gd20_spi_read(struct L3gd20_Spi *l3g)
struct spi_transaction spi_trans
void l3gd20_spi_event(struct L3gd20_Spi *l3g)
uint16_t output_length
number of data words to write
volatile bool data_available
data ready flag
@ SPISelectUnselect
slave is selected before transaction and unselected after
enum SPIBitOrder bitorder
MSB/LSB order.
static void l3gd20_spi_write_to_reg(struct L3gd20_Spi *l3g, uint8_t _reg, uint8_t _val)
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
SPI peripheral structure.
enum SPISlaveSelect select
slave selection behavior
#define Int16FromBuf(_buf, _idx)
#define L3GD20_WHO_AM_I
L3GD20 device identifier contained in L3GD20_REG_WHO_AM_I.
enum SPIClockPhase cpha
clock phase control
SPICallback after_cb
NULL or function called after the transaction.
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
enum L3gd20DRBW drbw
Data rate and bandwidth.
@ SPICpolIdleHigh
CPOL = 1.
static void l3gd20_set_default_config(struct L3gd20Config *c)
uint16_t input_length
number of data words to read
#define L3GD20_REG_CTRL_REG1
static void l3gd20_spi_send_config(struct L3gd20_Spi *l3g)
enum SPIDataSizeSelect dss
data transfer word size
void l3gd20_spi_init(struct L3gd20_Spi *l3g, struct spi_periph *spi_p, uint8_t slave_idx)
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
struct L3gd20Config config
bool initialized
config done flag
volatile uint8_t * input_buf
pointer to receive buffer for DMA
bool spi_3_wire
Set 3-wire SPI mode, if FALSE: 4-wire SPI mode.
volatile uint8_t tx_buf[2]
volatile uint8_t rx_buf[8]
void l3gd20_spi_start_configure(struct L3gd20_Spi *l3g)
SPICallback before_cb
NULL or function called before the transaction.
#define L3GD20_REG_CTRL_REG4
struct spi_periph * spi_p
enum L3gd20ConfStatus init_status
init status
enum SPITransactionStatus status
#define L3GD20_REG_WHO_AM_I
#define L3GD20_REG_STATUS_REG