|
ruuvi.drivers.c ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
#include "ruuvi_driver_enabled_modules.h"#include "ruuvi_driver_error.h"#include "ruuvi_driver_sensor.h"#include "ruuvi_interface_lis2dh12.h"#include "ruuvi_interface_spi_lis2dh12.h"#include "ruuvi_interface_yield.h"#include "ruuvi_interface_log.h"#include "lis2dh12_reg.h"#include <stdlib.h>#include <string.h>#include <stdio.h>Go to the source code of this file.
Macros | |
| #define | LOGD(fmt, ...) |
| #define | NUM_AXIS (3U) |
| X, Y, Z. | |
| #define | NM_BIT_DIVEDER (64U) |
| Normal mode uses 10 bits in 16 bit field, leading to 2^6 factor in results. | |
| #define | MOTION_THRESHOLD_MAX (0x7FU) |
| Highest threshold value allowed. | |
| #define | PWRON_DELAY_MS (10U) |
| Milliseconds from poweron to sensor rdy. 5ms typ. | |
| #define | VERIFY_SENSOR_SLEEPS() |
| Macro for checking that sensor is in sleep mode before configuration. | |
Implementation for LIS2DH12 basic usage. The implementation supports different resolutions, samplerates, high-passing, activity interrupt and FIFO.
Requires STM lis2dh12 driver, available on GitHub under BSD-3 license. Requires "application_config.h", will only get compiled if LIS2DH12_ACCELERATION is defined. Requires floats enabled in application.
Definition in file ruuvi_interface_lis2dh12.c.
| #define LOGD | ( | fmt, | |
| ... | |||
| ) |
Definition at line 28 of file ruuvi_interface_lis2dh12.c.
| #define MOTION_THRESHOLD_MAX (0x7FU) |
Highest threshold value allowed.
Definition at line 52 of file ruuvi_interface_lis2dh12.c.
| #define NM_BIT_DIVEDER (64U) |
Normal mode uses 10 bits in 16 bit field, leading to 2^6 factor in results.
Definition at line 51 of file ruuvi_interface_lis2dh12.c.
| #define NUM_AXIS (3U) |
X, Y, Z.
Definition at line 50 of file ruuvi_interface_lis2dh12.c.
| #define PWRON_DELAY_MS (10U) |
Milliseconds from poweron to sensor rdy. 5ms typ.
Definition at line 53 of file ruuvi_interface_lis2dh12.c.
| #define VERIFY_SENSOR_SLEEPS | ( | ) |
Macro for checking that sensor is in sleep mode before configuration.
Definition at line 56 of file ruuvi_interface_lis2dh12.c.