46#ifdef MODULE_LIS2DH12_SPI
56#if defined(MODULE_LIS2DH12) || defined(DOXYGEN)
60#define LIS2DH12_ADDR_DEFAULT (0x19)
101#define LIS2DH12_CLICK_X_SINGLE (1 << 0)
102#define LIS2DH12_CLICK_X_DOUBLE (1 << 1)
103#define LIS2DH12_CLICK_Y_SINGLE (1 << 2)
104#define LIS2DH12_CLICK_Y_DOUBLE (1 << 3)
105#define LIS2DH12_CLICK_Z_SINGLE (1 << 4)
106#define LIS2DH12_CLICK_Z_DOUBLE (1 << 5)
112#if MODULE_LIS2DH12_SPI || DOXYGEN
119#if MODULE_LIS2DH12_INT || DOXYGEN
254#if MODULE_LIS2DH12_INT || DOXYGEN
268 uint32_t mg, uint32_t us,
269 uint8_t axis, uint8_t
event, uint8_t pin);
288 uint32_t us_limit, uint32_t us_latency, uint32_t us_window,
289 uint8_t click, uint8_t pin);
Low-level GPIO peripheral driver interface definitions.
lis2dh12_scale_t
Available scale values.
int lis2dh12_set_datarate(const lis2dh12_t *dev, lis2dh12_rate_t rate)
Change device sampling rate.
int lis2dh12_set_resolution(const lis2dh12_t *dev, lis2dh12_resolution_t resolution)
Change device resolution.
lis2dh12_fifo_mode_t
LIS2DH12 FIFO modes.
uint16_t lis2dh12_get_datarate(const lis2dh12_t *dev)
Get device sampling rate in Hz.
void lis2dh12_cfg_threshold_event(const lis2dh12_t *dev, uint32_t mg, uint32_t us, uint8_t axis, uint8_t event, uint8_t pin)
Configure a threshold event An Interrupt will be generated if acceleration exceeds the set threshold ...
int lis2dh12_restart_fifo(const lis2dh12_t *dev)
Restart the FIFO mode this sets the FIFO mode in BYPASS mode and then back to previous mode Note: The...
lis2dh12_resolution_t lis2dh12_get_resolution(const lis2dh12_t *dev)
Get device resolution.
lis2dh12_hp_freq_t
LIS2DH12 high pass cutoff frequency.
lis2dh12_scale_t lis2dh12_get_scale(lis2dh12_t *dev)
Get device measuring range.
int lis2dh12_set_scale(lis2dh12_t *dev, lis2dh12_scale_t scale)
Change device measuring range.
void lis2dh12_cfg_click_event(const lis2dh12_t *dev, uint32_t mg, uint32_t us_limit, uint32_t us_latency, uint32_t us_window, uint8_t click, uint8_t pin)
Configure a click event A click event is generated when the acceleration exceeds the set threshold fo...
int lis2dh12_clear_data(const lis2dh12_t *dev)
Clear the LIS2DH12 memory, clears all sampled data.
int lis2dh12_set_reference(const lis2dh12_t *dev, uint8_t reference)
Set the reference value to control the high-pass reference.
int lis2dh12_read(const lis2dh12_t *dev, lis2dh12_fifo_data_t *data)
Read acceleration data from the given device.
const saul_driver_t lis2dh12_saul_driver
Export the SAUL interface for this driver.
int lis2dh12_read_temperature(const lis2dh12_t *dev, int16_t *temp)
Read temperature data from the given device.
lis2dh12_rate_t
Available sampling rates.
int lis2dh12_set_fifo(const lis2dh12_t *dev, const lis2dh12_fifo_t *config)
Set the FIFO configuration.
lis2dh12_resolution_t
Available resolutions.
int lis2dh12_poweron(const lis2dh12_t *dev)
Power on the given device and resets resolution and sampling rate to default values in the device des...
int lis2dh12_wait_event(const lis2dh12_t *dev, uint8_t pin, bool stale_events)
Wait for an interrupt event This function will block until an interrupt is received.
uint8_t lis2dh12_read_fifo_data(const lis2dh12_t *dev, lis2dh12_fifo_data_t *fifo_data, uint8_t number)
This function will read a given number of data from FIFO reads amount of data that is available in FI...
int lis2dh12_set_highpass(const lis2dh12_t *dev, const lis2dh12_highpass_t *config)
Configures the high pass filter.
int lis2dh12_poweroff(const lis2dh12_t *dev)
Power off the given device.
lis2dh12_hp_mode_t
LIS2DH12 high pass modes.
int lis2dh12_init(lis2dh12_t *dev, const lis2dh12_params_t *params)
Initialize the given LIS2DH12 sensor device.
void lis2dh12_cfg_disable_event(const lis2dh12_t *dev, uint8_t event, uint8_t pin)
Disable interrupt generation for an event This disables an interrupt on pin if a previously configure...
@ LIS2DH12_SCALE_16G
+- 16g
@ LIS2DH12_FIFO_MODE_BYPASS
default mode, FIFO is bypassed
@ LIS2DH12_FIFO_MODE_STREAM
Stream mode, oldest values get overwritten.
@ LIS2DH12_FIFO_MODE_FIFOMODE
normal FIFO mode, stops if FIFO is full
@ LIS2DH12_FIFO_MODE_STREAMtoFIFO
Stream mode and on interrupt jumps to FIFO mode.
@ LIS2DH12_INT1
first interrupt line
@ LIS2DH12_INT2
second interrupt line
@ LIS2DH12_HP_FREQ_DIV100
cutoff freq is ODR divided by 100
@ LIS2DH12_HP_FREQ_DIV200
cutoff freq is ODR divided by 200
@ LIS2DH12_HP_FREQ_DIV50
cutoff freq is ODR divided by 50
@ LIS2DH12_HP_FREQ_DIV400
cutoff freq is ODR divided by 400
@ LIS2DH12_RATE_400HZ
sample with 400Hz @ all resolutions
@ LIS2DH12_RATE_200HZ
sample with 200Hz @ all resolutions
@ LIS2DH12_RATE_1620HZ
sample with 1620HZ @ 8-bit
@ LIS2DH12_RATE_VERYHIGH
sample with 1344Hz @ High resolution or \ 5376Hz @ 8-bit
@ LIS2DH12_RATE_50HZ
sample with 50Hz @ all resolutions
@ LIS2DH12_RATE_25HZ
sample with 25Hz @ all resolutions
@ LIS2DH12_RATE_1HZ
sample with 1Hz @ all resolutions
@ LIS2DH12_RATE_10HZ
sample with 10Hz @ all resolutions
@ LIS2DH12_RATE_100HZ
sample with 100Hz @ all resolutions
@ LIS2DH12_POWER_LOW
8-bit mode
@ LIS2DH12_POWER_DOWN
power down the device
@ LIS2DH12_POWER_NORMAL
10-bit mode
@ LIS2DH12_POWER_HIGH
12-bit mode
@ LIS2DH12_NODEV
unable to talk to device
@ LIS2DH12_NODATA
no data available
@ LIS2DH12_NOBUS
bus interface error
@ LIS2DH12_OK
everything was fine
@ LIS2DH12_NOINT
wrong interrupt line (has to be LIS2DH12_INT1 or LIS2DH12_INT2)
@ LIS2DH12_HP_MODE_NORMAL
normal mode, reset by reading REG_REFERENCE
@ LIS2DH12_HP_MODE_REFERENCE
uses the reference signal for filtering
@ LIS2DH12_HP_MODE_AUTORESET
automatically resets on interrupt generation
uint_fast8_t i2c_t
Default i2c_t type definition.
Low-level I2C peripheral driver interface definition.
LIS2DH12 register definitions.
Low-level SPI peripheral driver interface definition.
LIS2DH12 click config values.
bool enable_DOUBLE
otherwise single click for given axis are enabled
uint8_t TIME_latency
set number of ODR cycles for latency after a click
bool noINT_latency
if "0" interrupt stays high for TIME_latency setting \ if "1" interrupt stays high until CLICK_SRC is...
uint8_t TIME_window
set number of ODR cycles for window between clicks
bool enable_Y_CLICK
enable double pr single click for Y axes
bool enable_X_CLICK
enable double pr single click for X axes
uint8_t CLICK_thold
set click threshold
uint8_t TIME_limit
set number of ODR cycles for time limit over threshold value
bool enable_Z_CLICK
enable double pr single click for Z axes
LIS2DH12 FIFO config values.
bool FIFO_set_INT2
sets the FIFO interrupt to INT2, otherwise INT1
uint8_t FIFO_watermark
set the FIFO watermark level
lis2dh12_fifo_mode_t FIFO_mode
set FIFO mode
LIS2DH12 high pass config values.
bool INT2_enable
enables filter for AOI on interrupt 2
bool CLICK_enable
enables filter for click data
bool INT1_enable
enables filter for AOI on interrupt 1
lis2dh12_hp_mode_t Highpass_mode
set the High pass mode
lis2dh12_hp_freq_t Highpass_freq
set the High pass cutoff frequency \ related to device rate
bool DATA_OUT_enable
enables filter for data output
Parameter for interrupt configuration.
uint8_t int_config
values for configuration
uint8_t int_threshold
the threshold for triggering interrupt, threshold in range 0-127
uint8_t int_type
values for type of interrupts
uint8_t int_duration
time between two interrupts ODR section in CTRL_REG1, duration in range 0-127
LIS2DH12 configuration parameters.
lis2dh12_resolution_t resolution
resolution used
gpio_t cs
connected chip select pin
spi_t spi
SPI bus the device is connected to.
lis2dh12_rate_t rate
sampling rate used
gpio_t int1_pin
first interrupt pin
lis2dh12_scale_t scale
sampling sensitivity used
gpio_t int2_pin
second interrupt pin
LIS2DH12 device descriptor.
const lis2dh12_params_t * p
device configuration
Definition of the RIOT actuator/sensor interface.
Functionality for reading [S]ensor [A]ctuator [U]ber [L]ayer sensors as SenML.
LIS2DH12 FIFO data struct.
int16_t y
Y data in mili-g.
int16_t z
Z data in mili-g.
int16_t x
X data in mili-g.