|
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 <cstring>#include "STAR_ADS126X.h"#include "adc_mappings.h"#include "esp_mac.h"#include "connector_adc_map.h"#include "sense_board_pins.h"Go to the source code of this file.
Macros | |
| #define | PINS_ACTIVE_LAYOUT sense_board_pins::PT_Board |
| #define | TEST_PIN 1 |
| #define | NUM_CONNECTORS 10 |
| #define | MAX_CHUNKS_BEFORE_SEND 9 |
Functions | |
| SPIClass | ADC_SPI (HSPI) |
| void | flush_adc_cycles (int cycles) |
| void | read_single_connector (uint8_t connector_id, int num_readings, daq::SensorDataChunkCollection &chunk) |
| void | collect_chunk () |
| void | sendSensorDataPacket () |
| float | convert_code_to_voltage (int32_t code) |
| void | setup () |
| void | loop () |
Variables | |
| byte | mac [6] |
| IPAddress | staticIP (192, 168, 2, 101) |
| IPAddress | gateway (0, 0, 0, 0) |
| IPAddress | subnet (255, 255, 255, 0) |
| IPAddress | dns (192, 168, 2, 1) |
| IPAddress | receiverIP (192, 168, 2, 20) |
| const int | receiverPort = 5006 |
| EthernetUDP | udp |
| static ADS126X | ads126x |
| std::vector< daq::SensorDataChunkCollection > | chunks |
| #define NUM_CONNECTORS 10 |
Definition at line 28 of file main.cpp.
Referenced by collect_chunk(), and sendSensorDataPacket().
| #define PINS_ACTIVE_LAYOUT sense_board_pins::PT_Board |
| SPIClass ADC_SPI | ( | HSPI | ) |
Referenced by init_adc_cb(), and setup().
| void collect_chunk | ( | ) |
Definition at line 197 of file main.cpp.
References ads126x, ADS126X_AINCOM, chunk, chunks, DATA_RATE, FILTER, flush_adc_cycles(), sense_board_pins::getAdcChannel(), millis(), NUM_CONNECTORS, read_single_connector(), READINGS_PER_MUX, settlePulses(), and TEST_PIN.
Referenced by loop().
| void flush_adc_cycles | ( | int | cycles | ) |
Definition at line 173 of file main.cpp.
References ads126x, delayMicroseconds(), digitalRead(), LOW, and sense_board_pins::Pins.
Referenced by collect_chunk().
| void loop | ( | ) |
Definition at line 164 of file main.cpp.
References chunks, collect_chunk(), MAX_CHUNKS_BEFORE_SEND, and sendSensorDataPacket().
| void read_single_connector | ( | uint8_t | connector_id, |
| int | num_readings, | ||
| daq::SensorDataChunkCollection & | chunk ) |
Definition at line 181 of file main.cpp.
References ads126x, chunk, delayMicroseconds(), digitalRead(), LOW, and sense_board_pins::Pins.
Referenced by collect_chunk().
| void sendSensorDataPacket | ( | ) |
Definition at line 210 of file main.cpp.
References chunks, daq::create_sensor_data_packet(), MAX_PACKET_SIZE, millis(), NUM_CONNECTORS, packetBuffer, receiverIP, receiverPort, Serial, and udp.
Referenced by loop(), and readCurrentSensePins().
| void setup | ( | void | ) |
Definition at line 62 of file main.cpp.
References ADC_SPI(), ads126x, ADS126X_AINCOM, ADS126X_REF_NEG_VSS, ADS126X_REF_POS_VDD, DATA_RATE, delay(), dns, Ethernet, FILTER, gateway, sense_board_pins::getAdcChannel(), HEX, INPUT, mac, pinMode(), sense_board_pins::Pins, Serial, SPI_MODE1, staticIP, subnet, TEST_PIN, and udp.
| std::vector<daq::SensorDataChunkCollection> chunks |
Definition at line 55 of file main.cpp.
Referenced by collect_chunk(), daq::create_sensor_data_packet(), fsw::config::BoardDiscovery::detect_sensors_from_packet(), emmc_log_init(), emmc_stm32_init(), log_new(), loop(), fsw::streams::SensorFramePipeline::poll(), port_start(), fsw::config::BoardDiscovery::process_sensor_data(), processIncomingPacket(), readCurrentSensePinsAndSend(), readCurrentSensePinsAndSend(), sendPositions(), sendReplyTo(), sendSensorDataPacket(), sendSensorDataPacket(), sendSensorPacket(), anonymous_namespace{test_board_clock_sync.cpp}::test_fuzz_invariants(), test_invalid_init(), test_parse_null_buffer(), test_sensor_data_buffer_too_small(), and test_sensor_data_roundtrip().
| IPAddress dns(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| IPAddress gateway(0, 0, 0, 0) | ( | 0 | , |
| 0 | , | ||
| 0 | , | ||
| 0 | ) |
| IPAddress receiverIP(192, 168, 2, 20) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 20 | ) |
| IPAddress staticIP(192, 168, 2, 101) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 101 | ) |
| IPAddress subnet(255, 255, 255, 0) | ( | 255 | , |
| 255 | , | ||
| 255 | , | ||
| 0 | ) |