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