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

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]

Macro Definition Documentation

◆ DATA_RATE

#define DATA_RATE   ADS126X_RATE_1200

Definition at line 33 of file main.cpp.

◆ FILTER

#define FILTER   ADS126X_SINC4

Definition at line 32 of file main.cpp.

◆ PINS_ACTIVE_LAYOUT

#define PINS_ACTIVE_LAYOUT   sense_board_pins::LC_Board

Definition at line 15 of file main.cpp.

Function Documentation

◆ ADC_SPI()

SPIClass ADC_SPI ( HSPI )

References HSPI.

◆ convert_code_to_voltage()

float convert_code_to_voltage ( int32_t code)

Definition at line 48 of file main.cpp.

Referenced by loop().

◆ flush_cycles()

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().

◆ loop()

◆ setup()

Variable Documentation

◆ ADC1_CONNECTORS

const uint8_t ADC1_CONNECTORS[] = {1, 2, 3, 6, 7}

Definition at line 29 of file main.cpp.

Referenced by loop(), and setup().

◆ ads126x

ADS126X ads126x
static

Definition at line 25 of file main.cpp.

◆ dns

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

◆ gateway

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

◆ mac

byte mac[6]

Definition at line 38 of file main.cpp.

◆ NUM_LC_SENSORS

const uint8_t NUM_LC_SENSORS
Initial value:
=
sizeof(ADC1_CONNECTORS) / sizeof(ADC1_CONNECTORS[0])
const uint8_t ADC1_CONNECTORS[]
Definition main.cpp:29

Definition at line 30 of file main.cpp.

Referenced by loop(), and setup().

◆ packetBuffer

uint8_t packetBuffer[MAX_PACKET_SIZE]

Definition at line 46 of file main.cpp.

◆ receiverIP

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

◆ receiverPort

const int receiverPort = 5006

Definition at line 44 of file main.cpp.

◆ staticIP

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

◆ subnet

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

◆ udp

EthernetUDP udp

Definition at line 45 of file main.cpp.