146 if (bit_is_set(lis->
rx_buf[1], 3)) {
enum SPIClockPolarity cpol
clock polarity control
bool filt_data
Filtered Data Selection.
#define LIS302DL_REG_STATUS
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
uint16_t output_length
number of data words to write
struct spi_periph * spi_p
static void lis302dl_set_default_config(struct Lis302dlConfig *c)
static void lis302dl_spi_write_to_reg(struct Lis302dl_Spi *lis, uint8_t _reg, uint8_t _val)
enum Lis302dlConfStatus init_status
init status
#define LIS302DL_WHO_AM_I
LIS302DL device identifier contained in LIS302DL_REG_WHO_AM_I.
bool int_invert
Invert Interrupt FALSE: active high, TRUE: active low.
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
enum SPIBitOrder bitorder
MSB/LSB order.
void lis302dl_spi_init(struct Lis302dl_Spi *lis, struct spi_periph *spi_p, uint8_t slave_idx)
#define LIS302DL_REG_CTRL_REG2
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
struct spi_transaction spi_trans
enum SPISlaveSelect select
slave selection behavior
#define LIS302DL_REG_CTRL_REG1
void lis302dl_spi_read(struct Lis302dl_Spi *lis)
enum SPIClockPhase cpha
clock phase control
enum Lis302dlRates rate
Data Output Rate.
SPI peripheral structure.
static void lis302dl_spi_send_config(struct Lis302dl_Spi *lis)
volatile bool data_available
data ready flag
SPICallback after_cb
NULL or function called after the transaction.
enum Lis302dlRanges range
g Range
#define LIS302DL_REG_WHO_AM_I
Driver for LIS302DL 3-axis accelerometer from ST using SPI.
volatile uint8_t rx_buf[8]
uint16_t input_length
number of data words to read
struct Lis302dlConfig config
slave is selected before transaction and unselected after
void lis302dl_spi_start_configure(struct Lis302dl_Spi *lis)
union Lis302dl_Spi::@305 data
enum SPIDataSizeSelect dss
data transfer word size
bool initialized
config done flag
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
volatile uint8_t * input_buf
pointer to receive buffer for DMA
SPICallback before_cb
NULL or function called before the transaction.
#define LIS302DL_REG_CTRL_REG3
volatile uint8_t tx_buf[2]
void lis302dl_spi_event(struct Lis302dl_Spi *lis)
bool spi_3_wire
Set 3-wire SPI mode, if FALSE: 4-wire SPI mode.
enum SPITransactionStatus status