STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
main.cpp File Reference
#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"
Include dependency graph for main.cpp:

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

Macro Definition Documentation

◆ FIXED_CONNECTOR

#define FIXED_CONNECTOR   1

Definition at line 25 of file main.cpp.

Referenced by setup().

◆ FIXED_PIN

#define FIXED_PIN   1

Definition at line 26 of file main.cpp.

Referenced by setup().

◆ MAX_CHUNKS

#define MAX_CHUNKS   10

Definition at line 47 of file main.cpp.

Referenced by loop(), run_Active(), and run_StandaloneAbort().

◆ NUM_SENSORS

◆ PINS_ACTIVE_LAYOUT

#define PINS_ACTIVE_LAYOUT   PT_Board

stream_one_adc: Read ADC1 only, single fixed channel (no mux cycling).

Streams readings over Ethernet UDP using DAQv2-Comms packet format.

Definition at line 20 of file main.cpp.

Function Documentation

◆ ADC_SPI()

SPIClass ADC_SPI ( HSPI )

References count(), and HSPI.

◆ convert_code_to_voltage()

float convert_code_to_voltage ( int32_t code)

Definition at line 51 of file main.cpp.

◆ loop()

void loop ( )

Definition at line 110 of file main.cpp.

References dataChunks, MAX_CHUNKS, read_data(), READINGS_PER_CHUNK, and sendSensorDataPacket().

◆ read_data()

void read_data ( int count)

◆ sendSensorDataPacket()

void sendSensorDataPacket ( )

◆ setup()

Variable Documentation

◆ ads126x

ADS126X ads126x
static

Definition at line 40 of file main.cpp.

◆ dataChunks

◆ dns

IPAddress dns(192, 168, 2, 1) ( 192 ,
168 ,
2 ,
1  )

◆ gateway

IPAddress gateway(0, 0, 0, 0) ( 0 ,
0 ,
0 ,
0  )

◆ kSensorId

const uint8_t kSensorId = 1
static

Definition at line 49 of file main.cpp.

Referenced by read_data().

◆ mac

byte mac[6]

Definition at line 31 of file main.cpp.

◆ receiverIP

IPAddress receiverIP(192, 168, 2, 20) ( 192 ,
168 ,
2 ,
20  )

◆ receiverPort

const int receiverPort = 5006

Definition at line 37 of file main.cpp.

◆ staticIP

IPAddress staticIP(192, 168, 2, 101) ( 192 ,
168 ,
2 ,
101  )

◆ subnet

IPAddress subnet(255, 255, 255, 0) ( 255 ,
255 ,
255 ,
0  )

◆ udp

EthernetUDP udp

Definition at line 38 of file main.cpp.