|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#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 "adc_mappings.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 |
| PT_BOARD_Multi_Send. | |
| #define | FILTER ADS126X_SINC4 |
| #define | DATA_RATE ADS126X_RATE_7200 |
| #define | TEST_PIN 1 |
| #define | NUM_PTS 10 |
Functions | |
| SPIClass | ADC_SPI (HSPI) |
| float | convert_code_to_voltage (int32_t code) |
| void | flush_cycles (int n) |
| bool | read_one (int32_t &out_raw, float &out_volts) |
| void | setup () |
| void | loop () |
Variables | |
| static ADS126X | ads126x |
| byte | mac [6] |
| IPAddress | staticIP (192, 168, 2, 101) |
| IPAddress | gateway (192, 168, 2, 1) |
| IPAddress | subnet (255, 255, 255, 0) |
| IPAddress | dns (192, 168, 2, 1) |
| IPAddress | receiverIP (192, 168, 2, 20) |
| const int | receiverPort |
| EthernetUDP | udp |
| uint8_t | packetBuffer [MAX_PACKET_SIZE] |
| #define DATA_RATE ADS126X_RATE_7200 |
| #define FILTER ADS126X_SINC4 |
| #define NUM_PTS 10 |
Definition at line 36 of file main.cpp.
Referenced by loop(), read_data(), and sendSensorDataPacketTo().
| #define PINS_ACTIVE_LAYOUT sense_board_pins::PT_Board |
PT_BOARD_Multi_Send.
Cycles through each PT (connectors 1–10), takes one measurement per PT, and sends DAQv2-Comms SENSOR_DATA packets over Ethernet to a Python GUI.
Loosely based on mini_daq/Simple_Test_Adnan (ADC, mux cycling, settle). Uses DAQv2-Comms for packet format and Ethernet/UDP for transport.
| float convert_code_to_voltage | ( | int32_t | code | ) |
Definition at line 61 of file main.cpp.
Referenced by read_one().
| void flush_cycles | ( | int | n | ) |
Definition at line 65 of file main.cpp.
References ads126x, delayMicroseconds(), digitalRead(), LOW, and sense_board_pins::Pins.
Referenced by loop().
| void loop | ( | ) |
Definition at line 139 of file main.cpp.
References ads126x, ADS126X_AINCOM, ch(), chunk, chunks, daq::create_sensor_data_packet(), DATA_RATE, delay(), FILTER, flush_cycles(), sense_board_pins::getAdcChannel(), millis(), NUM_PTS, packetBuffer, read_one(), receiverIP, receiverPort, Serial, settlePulses(), TEST_PIN, and udp.
| bool read_one | ( | int32_t & | out_raw, |
| float & | out_volts ) |
Definition at line 74 of file main.cpp.
References ads126x, convert_code_to_voltage(), delayMicroseconds(), digitalRead(), LOW, sense_board_pins::Pins, and r.
Referenced by loop().
| void setup | ( | void | ) |
Definition at line 91 of file main.cpp.
References ADC_SPI(), ads126x, ADS126X_REF_NEG_VSS, ADS126X_REF_POS_VDD, DATA_RATE, delay(), dns, Ethernet, FILTER, gateway, INPUT, mac, pinMode(), sense_board_pins::Pins, receiverIP, receiverPort, Serial, SPI_MODE1, staticIP, subnet, and udp.
| IPAddress dns(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| IPAddress gateway(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| uint8_t packetBuffer[MAX_PACKET_SIZE] |
| 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 | ) |