This commit is contained in:
William Clark 2024-01-01 13:34:11 +00:00
parent 804c415a13
commit eb81b5225d
2 changed files with 9 additions and 4 deletions

View File

@ -6,7 +6,8 @@ A C89 driver for the 3-axis accelerometer LIS3DH. Supports both i2c and SPI.
> - FIFO > - FIFO
> - HP filter > - HP filter
> - 2G, 4G, 8G and 16G > - 2G, 4G, 8G and 16G
> - All power modes > - Low-power mode, normal mode and high-resolution mode
> - ADC (x3) and temperature sensing
> - Interrupt generation > - Interrupt generation
> - Free-fall detection (soon) > - Free-fall detection (soon)
> - Single-click detection > - Single-click detection

View File

@ -1,15 +1,19 @@
# lis3dh/example # lis3dh/example
### simple.c ### simple.c
Basic examples of how to use this device Basic example of how to use this device
### fifo.c ### fifo.c
Instead of polling for every single [x y z] set, a FIFO with programmable capacity ("watermark") can be used like such: All FIFO readings use 10-bit resolution regardless of the mode set in `lis.cfg.mode`. The watermark level can also be adjusted to a value [0-31] inclusive by modifying the `lis.cfg.fifo.fth` property before calling configure(). Instead of polling for every single [x y z] set, a FIFO with programmable capacity ("watermark") can be used, and then dumped into memory once full.
All FIFO readings use 10-bit resolution regardless of the mode set in `lis.cfg.mode`.
The watermark level can be adjusted to a value [0-31] by modifying the `lis.cfg.fifo.fth` property before calling `lis3dh_configure()`.
The LIS3DH can optionally apply a HP filter on the sample data. It can be used to greatly reduce the "DC acceleration" present. The LIS3DH can optionally apply a HP filter on the sample data. It can be used to greatly reduce the "DC acceleration" present.
### interrupts.c ### interrupts.c
The LIS3DH supports two different interrupt "output pins," `INT1` and `INT2`. The appropriate flag must be set in either `cfg.int1` or `cfg.int2` (only one of such flags can be set at a time!) and the interrupt source must be configured to trigger into `INT1` or `INT2`. Below is example code that listens and receives an interrupt when the FIFO watermark is reached i.e. it is full. This device supports two different interrupt "output pins," `INT1` and `INT2`. The appropriate flag must be set in either `cfg.pin1` or `cfg.pin2` and the interrupt source must be configured to trigger into `INT1` or `INT2`. This file contains example code that listens and receives an interrupt when the FIFO watermark is reached i.e. it is full.
### single-click.c ### single-click.c