Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

ST Microelectronics LIS2DH 3-axis accelerometer. More...

Files

file  lis2dh.h
 Header file for extended sensor API of LIS2DH sensor.
file  lis2dh.h
 Devicetree binding constants for the ST LIS2DH 3-axis accelerometer.

Enumerations

enum  lis2dh_self_test { LIS2DH_SELF_TEST_DISABLE = 0 , LIS2DH_SELF_TEST_POSITIVE = 1 , LIS2DH_SELF_TEST_NEGATIVE = 2 }
 Possible values for SENSOR_ATTR_LIS2DH_SELF_TEST custom attribute. More...
enum  sensor_attribute_lis2dh { SENSOR_ATTR_LIS2DH_SELF_TEST = SENSOR_ATTR_PRIV_START }
 Custom sensor attributes for LIS2DH. More...

GPIO interrupt configuration

Values for the int1-gpio-config and int2-gpio-config devicetree properties.

#define LIS2DH_DT_GPIO_INT_EDGE_BOTH   0
 Trigger on both signal edges.
#define LIS2DH_DT_GPIO_INT_EDGE_RISING   1
 Trigger on the rising edge.
#define LIS2DH_DT_GPIO_INT_EDGE_FALLING   2
 Trigger on the falling edge.
#define LIS2DH_DT_GPIO_INT_LEVEL_HIGH   3
 Trigger while the signal is high.
#define LIS2DH_DT_GPIO_INT_LEVEL_LOW   4
 Trigger while the signal is low.

Any-motion detection mode

Values for the anym-mode devicetree property.

#define LIS2DH_DT_ANYM_OR_COMBINATION   0
 OR combination of enabled axes.
#define LIS2DH_DT_ANYM_6D_MOVEMENT   1
 6-direction movement recognition
#define LIS2DH_DT_ANYM_AND_COMBINATION   2
 AND combination of enabled axes.
#define LIS2DH_DT_ANYM_6D_POSITION   3
 6-direction position recognition

Detailed Description

ST Microelectronics LIS2DH 3-axis accelerometer.

Macro Definition Documentation

◆ LIS2DH_DT_ANYM_6D_MOVEMENT

#define LIS2DH_DT_ANYM_6D_MOVEMENT   1

#include <zephyr/dt-bindings/sensor/lis2dh.h>

6-direction movement recognition

◆ LIS2DH_DT_ANYM_6D_POSITION

#define LIS2DH_DT_ANYM_6D_POSITION   3

#include <zephyr/dt-bindings/sensor/lis2dh.h>

6-direction position recognition

◆ LIS2DH_DT_ANYM_AND_COMBINATION

#define LIS2DH_DT_ANYM_AND_COMBINATION   2

#include <zephyr/dt-bindings/sensor/lis2dh.h>

AND combination of enabled axes.

◆ LIS2DH_DT_ANYM_OR_COMBINATION

#define LIS2DH_DT_ANYM_OR_COMBINATION   0

#include <zephyr/dt-bindings/sensor/lis2dh.h>

OR combination of enabled axes.

◆ LIS2DH_DT_GPIO_INT_EDGE_BOTH

#define LIS2DH_DT_GPIO_INT_EDGE_BOTH   0

#include <zephyr/dt-bindings/sensor/lis2dh.h>

Trigger on both signal edges.

◆ LIS2DH_DT_GPIO_INT_EDGE_FALLING

#define LIS2DH_DT_GPIO_INT_EDGE_FALLING   2

#include <zephyr/dt-bindings/sensor/lis2dh.h>

Trigger on the falling edge.

◆ LIS2DH_DT_GPIO_INT_EDGE_RISING

#define LIS2DH_DT_GPIO_INT_EDGE_RISING   1

#include <zephyr/dt-bindings/sensor/lis2dh.h>

Trigger on the rising edge.

◆ LIS2DH_DT_GPIO_INT_LEVEL_HIGH

#define LIS2DH_DT_GPIO_INT_LEVEL_HIGH   3

#include <zephyr/dt-bindings/sensor/lis2dh.h>

Trigger while the signal is high.

◆ LIS2DH_DT_GPIO_INT_LEVEL_LOW

#define LIS2DH_DT_GPIO_INT_LEVEL_LOW   4

#include <zephyr/dt-bindings/sensor/lis2dh.h>

Trigger while the signal is low.

Enumeration Type Documentation

◆ lis2dh_self_test

#include <zephyr/drivers/sensor/lis2dh.h>

Possible values for SENSOR_ATTR_LIS2DH_SELF_TEST custom attribute.

Enumerator
LIS2DH_SELF_TEST_DISABLE 

Self-test disabled.

LIS2DH_SELF_TEST_POSITIVE 

Simulates a positive-direction acceleration.

LIS2DH_SELF_TEST_NEGATIVE 

Simulates a negative-direction acceleration.

◆ sensor_attribute_lis2dh

#include <zephyr/drivers/sensor/lis2dh.h>

Custom sensor attributes for LIS2DH.

Enumerator
SENSOR_ATTR_LIS2DH_SELF_TEST 

Sets the self-test mode.

Applies an electrostatic force to the sensor to simulate acceleration without actually moving the device.

Use a value from lis2dh_self_test, passed in the sensor_value.val1 field.