Scaffold PlatformIO project with 20 board configs and C99/C++ source skeleton
Three-tier configuration hierarchy: - [env:base] — RadioLib + default LoRa parameters - [soc_esp32/esp32s3/nrf52] — platform + framework per SoC - [env:board_name] — board-specific pins + chip selection 20 boards across 4 vendors: - Heltec: 11 boards (T114, CT62, E213, E290, Mesh Solar, T190, Tracker, Tracker V2, V2, V3, V4) - LilyGo: 4 boards (T-Beam 1W, sx1262, sx1276, supreme) - Seeed: 1 board (Xiao S3 + Wio SX1262 with verified pins) - RAK: 4 boards (RAK11310, RAK3112, RAK3401, RAK3x72, RAK4631) Known/verified pins: Heltec V2/V3/V4, RAK4631, Seeed Xiao S3 FIXME pins: all others (placeholders for future research) Source skeleton: - config.h — compile-time defaults + pin validation (#error checks) - kiss.h/c — KISS protocol implementation (C99) - radio.h/cpp — RadioLib wrapper with C API (extern "C" boundary) - main.cpp — Arduino entry point All files pass pre-commit (prettier, markdownlint, YAML check).
This commit is contained in:
51
src/config.h
Normal file
51
src/config.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
/* Default LoRa parameters — override per-board in hardware/.../platformio.ini */
|
||||
#ifndef LORA_FREQ_KHZ
|
||||
# define LORA_FREQ_KHZ 869525UL /* 869.525 MHz */
|
||||
#endif
|
||||
#ifndef LORA_BW_HZ
|
||||
# define LORA_BW_HZ 125000UL /* 125 kHz */
|
||||
#endif
|
||||
#ifndef LORA_SF
|
||||
# define LORA_SF 7
|
||||
#endif
|
||||
#ifndef LORA_CR
|
||||
# define LORA_CR 5 /* denominator: coding rate = 4/CR */
|
||||
#endif
|
||||
#ifndef LORA_POWER_DBM
|
||||
# define LORA_POWER_DBM 14
|
||||
#endif
|
||||
#ifndef LORA_SYNCWORD
|
||||
# define LORA_SYNCWORD 0x34 /* LoRa public */
|
||||
#endif
|
||||
|
||||
#ifndef KISS_BAUD
|
||||
# define KISS_BAUD 115200
|
||||
#endif
|
||||
|
||||
/* Pin validation — boards must define all required pins via build_flags */
|
||||
#ifndef LORA_PIN_NSS
|
||||
# error "LORA_PIN_NSS not defined — add to hardware/<vendor>/<board>/platformio.ini"
|
||||
#endif
|
||||
#ifndef LORA_PIN_RESET
|
||||
# error "LORA_PIN_RESET not defined"
|
||||
#endif
|
||||
|
||||
#if defined(LORA_CHIP_SX1276)
|
||||
# ifndef LORA_PIN_DIO0
|
||||
# error "LORA_PIN_DIO0 not defined (required for SX1276)"
|
||||
# endif
|
||||
#else
|
||||
# ifndef LORA_PIN_DIO1
|
||||
# error "LORA_PIN_DIO1 not defined (required for SX1262/LR1110)"
|
||||
# endif
|
||||
# ifndef LORA_PIN_BUSY
|
||||
# error "LORA_PIN_BUSY not defined (required for SX1262/LR1110)"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(LORA_CHIP_SX1276) && !defined(LORA_CHIP_SX1262) && \
|
||||
!defined(LORA_CHIP_LR1110)
|
||||
# error "No LoRa chip defined — set LORA_CHIP_SX1276, LORA_CHIP_SX1262, or LORA_CHIP_LR1110"
|
||||
#endif
|
||||
Reference in New Issue
Block a user