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

Go to the source code of this file.

Macros

#define DEBUG_TELEMETRY   0
#define FLIGHT_LOG_ENABLE   1

Functions

static constexpr float lis3dh_lsb_mg (lis3dh_range_t range)

Variables

static constexpr float VREF = 3.3f
static constexpr float ADC_COUNTS = 4095.0f
static constexpr float PT_FULL_SCALE_PSI = 1000.0f
static constexpr float LPS28DFW_SEA_LEVEL_HPA = 1013.25f
static constexpr uint8_t LPS28DFW_I2C_ADDR = 0x5C
static constexpr unsigned ALT_BUF_N = 24
static constexpr float ALT_TREND_THRESHOLD_M = 2.0f
static constexpr unsigned ALT_TREND_CONFIRM_COUNT = 6
static constexpr lis3dh_range_t ACCEL_RANGE = LIS3DH_RANGE_16_G
static constexpr float INTERRUPT_THRESHOLD_G = 2.5f
static constexpr uint8_t INTERRUPT_DURATION_COUNTS = 10
static constexpr lis3dh_dataRate_t ACCEL_ODR = LIS3DH_DATARATE_400_HZ
static constexpr uint8_t INT1_THS_VALUE
static constexpr uint8_t INT1_DUR_VALUE
static constexpr uint8_t ISM330_ACCEL_FS = ISM_16g
static constexpr float ISM330_ACCEL_FS_G = 16.0f
static constexpr float ISM330_WAKEUP_THRESHOLD_G = 2.5f
static constexpr uint8_t ISM330_WAKEUP_DUR = 2
static constexpr bool ISM330_ROUTE_DRDY_TO_INT1 = false
static constexpr uint8_t ISM330_WKUP_THS
static constexpr uint32_t ACTIVE_DURATION_MS = 120000UL
static constexpr uint32_t FLIGHT_LOG_REGION_BYTES = 512UL * 1024UL

Macro Definition Documentation

◆ DEBUG_TELEMETRY

#define DEBUG_TELEMETRY   0

Definition at line 89 of file config.h.

◆ FLIGHT_LOG_ENABLE

#define FLIGHT_LOG_ENABLE   1

Definition at line 93 of file config.h.

Function Documentation

◆ lis3dh_lsb_mg()

constexpr float lis3dh_lsb_mg ( lis3dh_range_t range)
staticconstexpr

Definition at line 33 of file config.h.

References LIS3DH_RANGE_16_G, LIS3DH_RANGE_2_G, LIS3DH_RANGE_4_G, and LIS3DH_RANGE_8_G.

Variable Documentation

◆ ACCEL_ODR

lis3dh_dataRate_t ACCEL_ODR = LIS3DH_DATARATE_400_HZ
staticconstexpr

Definition at line 31 of file config.h.

◆ ACCEL_RANGE

lis3dh_range_t ACCEL_RANGE = LIS3DH_RANGE_16_G
staticconstexpr

Definition at line 28 of file config.h.

◆ ACTIVE_DURATION_MS

uint32_t ACTIVE_DURATION_MS = 120000UL
staticconstexpr

Definition at line 78 of file config.h.

Referenced by flightStateTick().

◆ ADC_COUNTS

float ADC_COUNTS = 4095.0f
staticconstexpr

Definition at line 11 of file config.h.

◆ ALT_BUF_N

unsigned ALT_BUF_N = 24
staticconstexpr

Definition at line 21 of file config.h.

Referenced by apogeePushAltitude().

◆ ALT_TREND_CONFIRM_COUNT

unsigned ALT_TREND_CONFIRM_COUNT = 6
staticconstexpr

Definition at line 23 of file config.h.

Referenced by apogeeShouldConfirm().

◆ ALT_TREND_THRESHOLD_M

float ALT_TREND_THRESHOLD_M = 2.0f
staticconstexpr

Definition at line 22 of file config.h.

Referenced by apogeePushAltitude().

◆ FLIGHT_LOG_REGION_BYTES

uint32_t FLIGHT_LOG_REGION_BYTES = 512UL * 1024UL
staticconstexpr

Definition at line 83 of file config.h.

Referenced by flightLogInit().

◆ INT1_DUR_VALUE

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

Definition at line 55 of file config.h.

Referenced by setup().

◆ 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 48 of file config.h.

Referenced by setup().

◆ INTERRUPT_DURATION_COUNTS

uint8_t INTERRUPT_DURATION_COUNTS = 10
staticconstexpr

Definition at line 30 of file config.h.

◆ INTERRUPT_THRESHOLD_G

float INTERRUPT_THRESHOLD_G = 2.5f
staticconstexpr

Definition at line 29 of file config.h.

◆ ISM330_ACCEL_FS

uint8_t ISM330_ACCEL_FS = ISM_16g
staticconstexpr

Definition at line 62 of file config.h.

◆ ISM330_ACCEL_FS_G

float ISM330_ACCEL_FS_G = 16.0f
staticconstexpr

Definition at line 63 of file config.h.

◆ ISM330_ROUTE_DRDY_TO_INT1

bool ISM330_ROUTE_DRDY_TO_INT1 = false
staticconstexpr

Definition at line 66 of file config.h.

◆ ISM330_WAKEUP_DUR

uint8_t ISM330_WAKEUP_DUR = 2
staticconstexpr

Definition at line 65 of file config.h.

◆ ISM330_WAKEUP_THRESHOLD_G

float ISM330_WAKEUP_THRESHOLD_G = 2.5f
staticconstexpr

Definition at line 64 of file config.h.

◆ ISM330_WKUP_THS

uint8_t ISM330_WKUP_THS
staticconstexpr
Initial value:
= []() -> uint8_t {
constexpr float mgPerLsb = (ISM330_ACCEL_FS_G * 1000.0f) / 64.0f;
float raw = (ISM330_WAKEUP_THRESHOLD_G * 1000.0f) / mgPerLsb;
uint8_t v = (raw > 63.0f) ? 63 : static_cast<uint8_t>(raw);
return (v < 1) ? 1 : v;
}()
#define ISM330_ACCEL_FS_G
Definition main.h:22
#define ISM330_WAKEUP_THRESHOLD_G
Definition main.h:25

Definition at line 68 of file config.h.

Referenced by setup().

◆ LPS28DFW_I2C_ADDR

uint8_t LPS28DFW_I2C_ADDR = 0x5C
staticconstexpr

Definition at line 18 of file config.h.

◆ LPS28DFW_SEA_LEVEL_HPA

float LPS28DFW_SEA_LEVEL_HPA = 1013.25f
staticconstexpr

Definition at line 17 of file config.h.

◆ PT_FULL_SCALE_PSI

float PT_FULL_SCALE_PSI = 1000.0f
staticconstexpr

Definition at line 12 of file config.h.

Referenced by loop().

◆ VREF

float VREF = 3.3f
staticconstexpr

Definition at line 10 of file config.h.