|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
172 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx]))
#define LSM303D_REG_CTRL6
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
#define Int16FromBuf(_buf, _idx)
volatile bool data_available_acc
data ready flag accelero
struct Lsm303dConfig conf
enum SPIClockPolarity cpol
clock polarity control
#define LSM303D_INT2_DRDY_M
void lsm303d_spi_event(struct Lsm303d_Spi *lsm)
volatile uint8_t rx_buf[8]
#define LSM303D_REG_WHO_I_AM
LSM303D device identifier in LSM303D_REG_WHO_AM_I.
#define LSM303D_AODR_MASK
uint16_t output_length
number of data words to write
enum Lsm303dTarget target
union Lsm303d_Spi::@324 data_accel
#define LSM303D_REG_STATUS_M
#define LSM303D_M_ODR_MASK
volatile uint8_t tx_buf[2]
static void lsm303d_spi_tx_reg(struct Lsm303d_Spi *lsm, uint8_t reg, uint8_t val)
#define LSM303D_REG_WHO_AM_I
#define LSM303D_REG_CTRL2
@ SPISelectUnselect
slave is selected before transaction and unselected after
static void lsm303d_set_default_config(struct Lsm303dConfig *c)
enum SPIBitOrder bitorder
MSB/LSB order.
void lsm303d_spi_start_configure(struct Lsm303d_Spi *lsm)
#define LSM303D_REG_CTRL7
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
#define LSM303D_REG_CTRL5
SPI peripheral structure.
enum SPISlaveSelect select
slave selection behavior
uint8_t mag_mode
Measurement mode.
#define LSM303D_AHPM_MASK
enum SPIClockPhase cpha
clock phase control
enum Lsm303dConfStatus init_status
SPICallback after_cb
NULL or function called after the transaction.
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
uint8_t acc_scale
full scale selection (m/s²)
@ SPICpolIdleHigh
CPOL = 1.
uint8_t acc_rate
Data Output Rate (Hz)
uint8_t mag_scale
Full scale gain configuration (Gauss)
struct spi_periph * spi_p
static void lsm303d_spi_send_config(struct Lsm303d_Spi *lsm)
Configuration function called once before normal use.
union Lsm303d_Spi::@325 data_mag
uint8_t mag_rate
Data Output Rate Bits (Hz)
#define LSM303D_REG_CTRL4
bool initialized
config done flag
uint16_t input_length
number of data words to read
struct spi_transaction spi_trans
#define LSM303D_INT1_DRDY_A
enum SPIDataSizeSelect dss
data transfer word size
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
#define LSM303D_REG_CTRL1
void lsm303d_spi_init(struct Lsm303d_Spi *lsm, struct spi_periph *spi_p, uint8_t slave_idx, enum Lsm303dTarget target)
volatile uint8_t * input_buf
pointer to receive buffer for DMA
volatile bool data_available_mag
data ready flag magneto
#define LSM303D_REG_CTRL3
void lsm303d_spi_read(struct Lsm303d_Spi *lsm)
SPICallback before_cb
NULL or function called before the transaction.
enum SPITransactionStatus status
#define LSM303D_REG_STATUS_A