STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
main.h
Go to the documentation of this file.
1#pragma once
2
3#include <Arduino.h>
4#include <Ethernet.h>
5#include <SPI.h>
6#include <STAR_EthernetOTA.h>
7
8// ── Board pin definitions (from shared common/) ───────────────
9// Select board type by defining PINS_ACTIVE_LAYOUT before including.
10// Default is PT_Board (set in sense_board_pins.h).
11// Override by adding e.g. -DPINS_ACTIVE_LAYOUT=LC_Board to build_flags.
12#include "sense_board_pins.h"
13
14using sense_board_pins::Pins; // Access pins as Pins.ETH_MOSI, etc.
15
16// ── Network configuration ─────────────────────────────────────
17#define OTA_STATIC_IP IPAddress(192, 168, 2, 5)
18#define OTA_GATEWAY IPAddress(192, 168, 2, 1)
19#define OTA_SUBNET IPAddress(255, 255, 255, 0)
20#define OTA_DNS IPAddress(192, 168, 2, 1)
21#define OTA_TCP_PORT 3232
22
23// ── Serial message (overridden at compile time by the uploader) ─
24// STAR_OTA_TEST_MESSAGE is the library-wide name for this and is what
25// ota_upload.py --message and the Test-GUI's OTA tab set, so prefer it; the
26// older OTA_MESSAGE spelling still works for this project.
27#ifndef OTA_MESSAGE
28#define OTA_MESSAGE "Default OTA firmware -- not yet updated"
29#endif
30
31// ── Timing ────────────────────────────────────────────────────
32#define PRINT_INTERVAL_MS 2000 // How often to print the message to serial
33#define ETHERNET_SPI_DELAY 1000 // Delay after SPI.begin()
34#define ETHERNET_INIT_DELAY 1000 // Delay after Ethernet.init()
35#define ETHERNET_BEGIN_DELAY 1000 // Delay after Ethernet.begin()
36
37// ── LED ───────────────────────────────────────────────────────
38// Uses Pins.LED from sense_board_pins.h (pin 16 for PT board)
39
40// ── OTA transfer settings ─────────────────────────────────────
41// Owned by the library now; override STAR_OTA_CHUNK_SIZE / STAR_OTA_TIMEOUT_MS
42// in build_flags if this board ever needs different values.
constexpr const Layout & Pins