This lis2dw12 driver is updated version of zephyr lis2dw12, with additional trigger functionality. It provides sensor support (I2C and SPI) as well as interrupt configuration options.
This driver was written and tested for nrf-sdk v2.2.0
To install, first modify .../ncs/nrf/west.yml and add the following sections:
- In
remotes, add the following if not already added:
- name: irnas
url-base: https://github.com/irnas- In the
projectssection add at the bottom:
- name: irnas-lis2dw12-driver
repo-path: irnas-lis2dw12-driver
path: irnas/irnas-lis2dw12-driver
remote: irnas
revision: masterThen run west update in your freshly created bash/command prompt session.
Above command will clone irnas-lis2dw12-driver repository inside of ncs/irnas/. You can now use the driver in your application projects.
To enable this driver, device tree, KConfig and peripheral driver modifications are reqired.
In your boards DTS file, modify the lis2dw12 peripheral:
compatible = "st,lis2dw12";- This must replace the default compatible value.
An example is provided here:
lis2dw12_accel: lis2dw12-accel@19 {
compatible = "irnas,lis2dw12";
label = "LIS2DW12-ACCEL";
reg = <0x19>;
irq-gpios=<&gpio1 3 GPIO_ACTIVE_LOW>;
int-pin = <1>;
range = <2>;
power-mode = <0>;
tap-mode= <0>;
tap-threshold = <3>, <0>, <1>;
tap-shock = <1>;
tap-latency = <8>;
tap-quiet = <3>;
};