STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
main.h File Reference
#include <Adafruit_LIS3DH.h>
Include dependency graph for main.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ACCEL_RANGE   LIS3DH_RANGE_16_G
#define INTERRUPT_THRESHOLD_G   2.5f
#define INTERRUPT_DURATION_COUNTS   10
#define ACCEL_ODR   LIS3DH_DATARATE_400_HZ
#define LIS3DH_INT1_PIN   23
#define LIS3DH_CS_PIN   17
#define LIS3DH_MOSI_PIN   3
#define LIS3DH_MISO_PIN   16
#define LIS3DH_CLK_PIN   2

Functions

static constexpr float lis3dh_lsb_mg (lis3dh_range_t range)

Variables

static constexpr uint8_t INT1_THS_VALUE
static constexpr uint8_t INT1_DUR_VALUE

Macro Definition Documentation

◆ ACCEL_ODR

#define ACCEL_ODR   LIS3DH_DATARATE_400_HZ

Definition at line 21 of file main.h.

Referenced by setup().

◆ ACCEL_RANGE

#define ACCEL_RANGE   LIS3DH_RANGE_16_G

Definition at line 11 of file main.h.

Referenced by setup().

◆ INTERRUPT_DURATION_COUNTS

#define INTERRUPT_DURATION_COUNTS   10

Definition at line 18 of file main.h.

Referenced by setup().

◆ INTERRUPT_THRESHOLD_G

#define INTERRUPT_THRESHOLD_G   2.5f

Definition at line 14 of file main.h.

Referenced by setup().

◆ LIS3DH_CLK_PIN

#define LIS3DH_CLK_PIN   2

Definition at line 30 of file main.h.

Referenced by setup().

◆ LIS3DH_CS_PIN

#define LIS3DH_CS_PIN   17

Definition at line 27 of file main.h.

Referenced by lis(), and setup().

◆ LIS3DH_INT1_PIN

#define LIS3DH_INT1_PIN   23

Definition at line 24 of file main.h.

Referenced by setup().

◆ LIS3DH_MISO_PIN

#define LIS3DH_MISO_PIN   16

Definition at line 29 of file main.h.

Referenced by setup().

◆ LIS3DH_MOSI_PIN

#define LIS3DH_MOSI_PIN   3

Definition at line 28 of file main.h.

Referenced by setup().

Function Documentation

◆ lis3dh_lsb_mg()

constexpr float lis3dh_lsb_mg ( lis3dh_range_t range)
staticconstexpr

Definition at line 41 of file main.h.

References LIS3DH_RANGE_16_G, LIS3DH_RANGE_2_G, LIS3DH_RANGE_4_G, and LIS3DH_RANGE_8_G.

Variable Documentation

◆ INT1_DUR_VALUE

uint8_t INT1_DUR_VALUE
staticconstexpr
Initial value:
=
#define INTERRUPT_DURATION_COUNTS
Definition main.h:18

Definition at line 66 of file main.h.

◆ INT1_THS_VALUE

uint8_t INT1_THS_VALUE
staticconstexpr
Initial value:
= []() -> uint8_t {
float lsb = lis3dh_lsb_mg(ACCEL_RANGE);
float raw = (INTERRUPT_THRESHOLD_G * 1000.0f) / lsb;
uint8_t val = (raw > 127.0f) ? 127 : (uint8_t)raw;
return (val == 0) ? 1 : val;
}()
#define ACCEL_RANGE
Definition main.h:11
#define INTERRUPT_THRESHOLD_G
Definition main.h:14
static constexpr float lis3dh_lsb_mg(lis3dh_range_t range)
Definition config.h:33

Definition at line 58 of file main.h.