STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
main.cpp File Reference
#include <Adafruit_LIS3DH.h>
#include <Adafruit_Sensor.h>
#include <Arduino.h>
#include <SPI.h>
#include <SPIMemory.h>
#include <STAR_ISM330DH.h>
#include <STAR_MCP3201.h>
#include <SparkFun_LPS28DFW_Arduino_Library.h>
#include <Wire.h>
#include <math.h>
#include "apogee.h"
#include "config.h"
#include "flight_log.h"
#include "flight_state.h"
#include "pins.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

static SPIFlash g_flash (PIN_MX25_CS)
static STAR_MCP3201 g_adc (PIN_ADC_CS, &SPI)
static Adafruit_LIS3DH g_lis (PIN_ACCEL_CS, &SPI)
void IRAM_ATTR onAccelInt ()
void IRAM_ATTR onImuInt ()
static float pressureToAltitudeM (float pressureHpa, float seaLevelHpa)
void setup ()
void loop ()

Variables

static ISM330DH_SPI g_imu
static LPS28DFW g_baro
static sfe_ism_data_t g_accel {}
static sfe_ism_data_t g_gyro {}
static volatile bool g_launchFlag = false
static volatile bool g_imuWakeFlag = false
static uint32_t s_lastLpsMs = 0
static uint32_t s_lastMcpMs = 0

Function Documentation

◆ g_adc()

STAR_MCP3201 g_adc ( PIN_ADC_CS ,
& SPI )
static

References PIN_ADC_CS.

Referenced by loop().

◆ g_flash()

SPIFlash g_flash ( PIN_MX25_CS )
static

References PIN_MX25_CS.

Referenced by setup().

◆ g_lis()

Adafruit_LIS3DH g_lis ( PIN_ACCEL_CS ,
& SPI )
static

References PIN_ACCEL_CS.

Referenced by loop(), and setup().

◆ loop()

◆ onAccelInt()

void IRAM_ATTR onAccelInt ( )

Definition at line 30 of file main.cpp.

References g_launchFlag.

Referenced by setup().

◆ onImuInt()

void IRAM_ATTR onImuInt ( )

Definition at line 34 of file main.cpp.

References g_imuWakeFlag.

Referenced by setup().

◆ pressureToAltitudeM()

float pressureToAltitudeM ( float pressureHpa,
float seaLevelHpa )
static

Definition at line 38 of file main.cpp.

Referenced by loop().

◆ setup()

Variable Documentation

◆ g_accel

sfe_ism_data_t g_accel {}
static

Definition at line 24 of file main.cpp.

Referenced by loop().

◆ g_baro

LPS28DFW g_baro
static

Definition at line 22 of file main.cpp.

Referenced by loop(), and setup().

◆ g_gyro

sfe_ism_data_t g_gyro {}
static

Definition at line 25 of file main.cpp.

Referenced by loop().

◆ g_imu

ISM330DH_SPI g_imu
static

Definition at line 21 of file main.cpp.

Referenced by loop(), and setup().

◆ g_imuWakeFlag

volatile bool g_imuWakeFlag = false
static

Definition at line 28 of file main.cpp.

Referenced by loop(), and onImuInt().

◆ g_launchFlag

volatile bool g_launchFlag = false
static

Definition at line 27 of file main.cpp.

Referenced by loop(), and onAccelInt().

◆ s_lastLpsMs

uint32_t s_lastLpsMs = 0
static

Definition at line 44 of file main.cpp.

Referenced by loop().

◆ s_lastMcpMs

uint32_t s_lastMcpMs = 0
static

Definition at line 45 of file main.cpp.

Referenced by loop().