|
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 "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 PT_Board |
| stream_one_adc: Read ADC1 only, single fixed channel (no mux cycling). | |
| #define | FIXED_CONNECTOR 1 |
| #define | FIXED_PIN 1 |
| #define | NUM_SENSORS 1 |
| #define | MAX_CHUNKS 10 |
Functions | |
| SPIClass | ADC_SPI (HSPI) |
| void | read_data (int count) |
| 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 > | dataChunks |
| static const uint8_t | kSensorId = 1 |
| #define MAX_CHUNKS 10 |
Definition at line 47 of file main.cpp.
Referenced by loop(), run_Active(), and run_StandaloneAbort().
| #define NUM_SENSORS 1 |
Definition at line 46 of file main.cpp.
Referenced by initializeCurrentSensePins(), initializeCurrentSensePins(), loop(), read_data(), readCurrentSensePins(), readCurrentSensePinsAndSend(), readCurrentSensePinsAndSend(), sendDataChunks(), sendSensorDataPacket(), sendSensorDataPacket(), sendSensorPacket(), and setup().
| #define PINS_ACTIVE_LAYOUT PT_Board |
| void loop | ( | ) |
Definition at line 110 of file main.cpp.
References dataChunks, MAX_CHUNKS, read_data(), READINGS_PER_CHUNK, and sendSensorDataPacket().
| void read_data | ( | int | count | ) |
Definition at line 119 of file main.cpp.
References ads126x, chunk, count(), dataChunks, delayMicroseconds(), digitalRead(), kSensorId, LOW, millis(), NUM_SENSORS, sense_board_pins::Pins, and Serial.
Referenced by loop().
| void sendSensorDataPacket | ( | ) |
Definition at line 139 of file main.cpp.
References daq::create_sensor_data_packet(), dataChunks, MAX_PACKET_SIZE, millis(), NUM_SENSORS, packetBuffer, receiverIP, receiverPort, Serial, and udp.
Referenced by loop().
| void setup | ( | void | ) |
Definition at line 55 of file main.cpp.
References ADC_SPI(), ads126x, ADS126X_AINCOM, ADS126X_REF_NEG_VSS, ADS126X_REF_POS_VDD, DATA_RATE, delay(), dns, Ethernet, FILTER, FIXED_CONNECTOR, FIXED_PIN, gateway, sense_board_pins::getAdcChannel(), HEX, INPUT, mac, pinMode(), sense_board_pins::Pins, Serial, SPI_MODE1, staticIP, subnet, and udp.
| std::vector<daq::SensorDataChunkCollection> dataChunks |
Definition at line 48 of file main.cpp.
Referenced by collect_chunk_impl(), loop(), read_data(), read_data(), run_Active(), run_StandaloneAbort(), send_chunks_to_cb(), send_chunks_to_impl(), sendDataChunks(), sendSensorDataPacket(), and sendSensorDataPacketTo().
| IPAddress dns(192, 168, 2, 1) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 1 | ) |
| IPAddress gateway(0, 0, 0, 0) | ( | 0 | , |
| 0 | , | ||
| 0 | , | ||
| 0 | ) |
|
static |
Definition at line 49 of file main.cpp.
Referenced by read_data().
| 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 | ) |