|
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::RTD_Board |
| #define | NUM_CONNECTORS 2 |
| #define | MAX_CHUNKS_PER_PACKET 8 |
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 | set_connector_rtd (uint8_t connector_id) |
| 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 PINS_ACTIVE_LAYOUT sense_board_pins::RTD_Board |
| void collect_chunk | ( | ) |
Definition at line 168 of file main.cpp.
References chunk, chunks, DATA_RATE, FILTER, flush_adc_cycles(), millis(), NUM_CONNECTORS, read_single_connector(), READINGS_PER_CONNECTOR, set_connector_rtd(), and settlePulses().
Referenced by loop().
| void flush_adc_cycles | ( | int | cycles | ) |
Definition at line 126 of file main.cpp.
References delayMicroseconds(), digitalRead(), LOW, and sense_board_pins::Pins.
Referenced by collect_chunk().
| void loop | ( | ) |
Definition at line 117 of file main.cpp.
References chunks, collect_chunk(), MAX_CHUNKS_PER_PACKET, and sendSensorDataPacket().
| void read_single_connector | ( | uint8_t | connector_id, |
| int | num_readings, | ||
| daq::SensorDataChunkCollection & | chunk ) |
Definition at line 149 of file main.cpp.
References ads126x, chunk, delayMicroseconds(), digitalRead(), LOW, sense_board_pins::Pins, and Serial.
Referenced by collect_chunk().
| void sendSensorDataPacket | ( | ) |
Definition at line 183 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().
| void set_connector_rtd | ( | uint8_t | connector_id | ) |
Definition at line 134 of file main.cpp.
References ads126x, ADS126X_IDAC_MAG_1000, sense_board_pins::getAdcChannel(), and sense_board_pins::getIdacChannel().
Referenced by collect_chunk().
| void setup | ( | void | ) |
Definition at line 58 of file main.cpp.
References ADC_SPI(), ads126x, ADS126X_IDAC_MAG_1000, DATA_RATE, delay(), dns, Ethernet, FILTER, gateway, sense_board_pins::getAdcChannel(), sense_board_pins::getIdacChannel(), HEX, INPUT, mac, pinMode(), sense_board_pins::Pins, Serial, SPI_MODE1, staticIP, subnet, and udp.
| std::vector<daq::SensorDataChunkCollection> chunks |
| 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 | ) |