|
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::LC_Board |
| #define | FILTER ADS126X_SINC4 |
| #define | DATA_RATE ADS126X_RATE_1200 |
Functions | |
| SPIClass | ADC_SPI (HSPI) |
| float | convert_code_to_voltage (int32_t code) |
| void | flush_cycles (int n) |
| void | setup () |
| void | loop () |
Variables | |
| static ADS126X | ads126x |
| const uint8_t | ADC1_CONNECTORS [] = {1, 2, 3, 6, 7} |
| const uint8_t | NUM_LC_SENSORS |
| byte | mac [6] |
| IPAddress | staticIP (192, 168, 2, 100) |
| 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 = 5006 |
| EthernetUDP | udp |
| uint8_t | packetBuffer [MAX_PACKET_SIZE] |
| #define DATA_RATE ADS126X_RATE_1200 |
| #define FILTER ADS126X_SINC4 |
| #define PINS_ACTIVE_LAYOUT sense_board_pins::LC_Board |
| float convert_code_to_voltage | ( | int32_t | code | ) |
| void flush_cycles | ( | int | n | ) |
Definition at line 53 of file main.cpp.
References ads126x, delayMicroseconds(), digitalRead(), LOW, and sense_board_pins::Pins.
Referenced by loop().
| void loop | ( | ) |
Definition at line 123 of file main.cpp.
References ADC1_CONNECTORS, ads126x, chunk, chunks, convert_code_to_voltage(), daq::create_sensor_data_packet(), DATA_RATE, delay(), delayMicroseconds(), digitalRead(), FILTER, flush_cycles(), sense_board_pins::getAdcChannel(), LOW, millis(), NUM_LC_SENSORS, packetBuffer, sense_board_pins::Pins, receiverIP, receiverPort, Serial, settlePulses(), and udp.
| void setup | ( | void | ) |
Definition at line 61 of file main.cpp.
References ADC1_CONNECTORS, ADC_SPI(), ads126x, ADS126X_GAIN_8, DATA_RATE, delay(), dns, Ethernet, FILTER, gateway, INPUT, mac, NUM_LC_SENSORS, pinMode(), sense_board_pins::Pins, receiverIP, receiverPort, Serial, SPI_MODE1, staticIP, subnet, and udp.
| const uint8_t ADC1_CONNECTORS[] = {1, 2, 3, 6, 7} |
| 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, 100) | ( | 192 | , |
| 168 | , | ||
| 2 | , | ||
| 100 | ) |
| IPAddress subnet(255, 255, 255, 0) | ( | 255 | , |
| 255 | , | ||
| 255 | , | ||
| 0 | ) |