|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include "main.h"#include <Arduino.h>#include <Ethernet.h>#include <EthernetUdp.h>#include <SPI.h>#include <daq-protocol.h>#include <esp_mac.h>#include <cstring>#include <vector>#include "STAR_ADS126X.h"#include "sense_board_pins.h"#include "connector_adc_map.h"#include "adc_mappings.h"#include "SensorHotfireCore.h"#include "SensorSelfTest.h"#include "send_policy.h"Go to the source code of this file.
Macros | |
| #define | PINS_ACTIVE_LAYOUT sense_board_pins::LC_Board |
| LC (Load Cell) Hotfire state machine — ESP32 PCB. | |
| #define | FILTER ADS126X_SINC4 |
| #define | DATA_RATE ADS126X_RATE_20 |
| #define | GAIN ADS126X_GAIN_32 |
| #define | NUM_CHANNELS 5 |
Functions | |
| ADS126X_ASSERT_FILTER_RATE (FILTER, DATA_RATE) | |
| SPIClass | ADC_SPI (HSPI) |
| static void | flush_cycles (int cycles) |
| static void | collect_chunk_impl () |
| static void | send_chunks_to_impl (IPAddress dest_ip, int dest_port, bool also_to_abort_controller, IPAddress abort_controller_ip, int abort_controller_port) |
| static void | init_adc_cb (void *) |
| static void | on_reference_voltage_cb (void *, uint8_t reference_voltage) |
| static void | collect_chunk_cb (void *) |
| static void | send_chunks_to_cb (void *, IPAddress dest_ip, int dest_port, bool also_to_abort_controller, IPAddress abort_controller_ip, int abort_controller_port) |
| static void | run_self_test_cb (void *, const SensorHotfire::StoredSensorConfig &cfg, std::vector< daq::SelfTestResult > &results_out) |
| void | setup () |
| void | loop () |
Variables | |
| static const uint8_t | LC_ADC1_CONNECTORS [] = {1, 2, 3, 6, 7} |
| static ADS126X | ads126x |
| std::vector< daq::SensorDataChunkCollection > | dataChunks |
| static SensorHotfire::CoreState | coreState |
| static SensorHotfire::Config | coreConfig |
| static unsigned long | g_last_sensor_packet_log_ms = 0 |
| bool | g_verbose = true |
| static int | last_mux_p = -1 |
| static int | last_mux_n = -1 |
| #define DATA_RATE ADS126X_RATE_20 |
| #define FILTER ADS126X_SINC4 |
| #define GAIN ADS126X_GAIN_32 |
Definition at line 50 of file main.cpp.
Referenced by init_adc_cb().
| #define PINS_ACTIVE_LAYOUT sense_board_pins::LC_Board |
LC (Load Cell) Hotfire state machine — ESP32 PCB.
Same state machine: Waiting for Server → Active → Standalone Abort (and back to Active on clear). Sends heartbeats, streams load-cell (differential) sensor data to server or to actuator controller in abort. Uses LC_Board pin layout and BoardType::LOAD_CELL. Only connectors on ADC 1 (1, 2, 3, 6, 7). Differential read between pin 1 and pin 2 per connector. Uses shared SensorHotfireCore; board-specific: ADC init, collect_chunk, send_chunks_to.
|
static |
|
static |
Definition at line 77 of file main.cpp.
References ads126x, chunk, coreState, DATA_RATE, dataChunks, delayMicroseconds(), digitalRead(), FILTER, flush_cycles(), sense_board_pins::getAdcChannel(), last_mux_n, last_mux_p, LOW, millis(), sense_board_pins::Pins, SENSOR_MAX_CHUNKS_BEFORE_SEND, and settlePulses().
Referenced by collect_chunk_cb().
|
static |
Definition at line 67 of file main.cpp.
References ads126x, delayMicroseconds(), digitalRead(), LOW, and sense_board_pins::Pins.
Referenced by collect_chunk_impl().
|
static |
Definition at line 184 of file main.cpp.
References ADC_SPI(), ads126x, ADS126X_REF_NEG_VSS, ADS126X_REF_POS_INT, DATA_RATE, FILTER, GAIN, sense_board_pins::getAdcChannel(), INPUT, pinMode(), sense_board_pins::Pins, and SPI_MODE1.
Referenced by setup().
| void loop | ( | ) |
Definition at line 267 of file main.cpp.
References coreConfig, coreState, and SensorHotfire::loop().
|
static |
Definition at line 200 of file main.cpp.
References ads126x, ADS126X_REF_NEG_VSS, ADS126X_REF_POS_INT, and ADS126X_REF_POS_VDD.
Referenced by setup().
|
static |
Definition at line 219 of file main.cpp.
References ads126x, ADS126X_REF_NEG_VSS, ADS126X_REF_POS_INT, SensorSelfTest::CONNECTED, sense_board_pins::getAdcChannel(), sense_board_pins::Pins, SensorSelfTest::read_sensor_bias(), SensorSelfTest::run_adc_self_test(), SensorSelfTest::sensor_bias_disable(), and SensorSelfTest::sensor_bias_enable().
Referenced by setup().
|
static |
Definition at line 210 of file main.cpp.
References dataChunks, and send_chunks_to_impl().
Referenced by setup().
|
static |
Definition at line 118 of file main.cpp.
References chunk, coreState, daq::create_sensor_data_packet(), dataChunks, g_last_sensor_packet_log_ms, HF_VERBOSE, HF_VERBOSELN, HF_VERBOSELN_, millis(), packetBuffer, SENSOR_HOTFIRE_MAX_PACKET_SIZE, SENSOR_MAX_BATCH_AGE_MS, SENSOR_MAX_CHUNKS_BEFORE_SEND, and sensorBatchReady().
Referenced by send_chunks_to_cb().
| void setup | ( | void | ) |
Definition at line 247 of file main.cpp.
References collect_chunk_cb(), coreConfig, coreState, init_adc_cb(), IPAddress, on_reference_voltage_cb(), sense_board_pins::Pins, run_self_test_cb(), send_chunks_to_cb(), and SensorHotfire::setup().
|
static |
|
static |
Definition at line 59 of file main.cpp.
Referenced by collect_chunk_impl(), loop(), send_chunks_to_impl(), and setup().
| std::vector<daq::SensorDataChunkCollection> dataChunks |
|
static |
Definition at line 62 of file main.cpp.
Referenced by send_chunks_to_impl().
|
static |
Definition at line 75 of file main.cpp.
Referenced by collect_chunk_impl().
|
static |
Definition at line 75 of file main.cpp.
Referenced by collect_chunk_impl().