ESP32-S3 + SX1262 + 1.3" SH1106 OLED + CP2102 UART bridge +
1000 mAh Li-Po. Pin map verified against Meshtastic's
variants/esp32s3/ELECROW-ThinkNode-M2. DIO3 TCXO at 3.3 V (vs 1.8 V
on Heltec), VEXT_ENABLE active HIGH (opposite polarity), dedicated
LORA_POWER_EN on GPIO48 sequenced before SPI init. Reuses the
existing async SH1106 driver at I2C address 0x3C.
Refactors hal::esp32s3::{init_spi,init_i2c} and board::esp32s3::init_radio
to accept generic GPIO bounds so ESP32-S3 boards with different pin
assignments can share the helpers. init_radio now takes a
TcxoCtrlVoltage parameter instead of hardcoding Ctrl1V8.
Incidental cleanups needed to make `just check-all` green:
- Replace the core::mem::forget(output) pattern with let _foo = ...;
current esp-hal makes Output non-Drop, so forget is a no-op that
trips clippy's forget_non_drop lint.
- Switch justfile xtensa builds from `cargo +nightly` with a RUSTC
override to `cargo +esp` so the compiler and rust-src versions stay
aligned. Public nightly's rust-src had drifted two months ahead of
the esp fork and broke -Zbuild-std on core.
164 lines
4.2 KiB
TOML
164 lines
4.2 KiB
TOML
[workspace]
|
|
members = ["."]
|
|
|
|
[package]
|
|
name = "donglora"
|
|
version = "0.3.0"
|
|
edition = "2021"
|
|
build = "build.rs"
|
|
authors = ["Stephen Waits <steve@waits.net>"]
|
|
license = "MIT"
|
|
description = "Transparent LoRa radio over USB — plug in a board, talk LoRa from your host"
|
|
repository = "https://github.com/swaits/donglora"
|
|
keywords = ["lora", "radio", "embedded", "usb", "firmware"]
|
|
categories = ["embedded", "hardware-support", "no-std"]
|
|
|
|
# NOTE: esp-rtos patched from GitHub main (see [patch.crates-io] below).
|
|
# Remove patches once esp-rtos publishes with embassy-executor 0.10 support.
|
|
[dependencies]
|
|
cfg-if = "1.0"
|
|
critical-section = "1.2"
|
|
defmt = "1.0"
|
|
embedded-hal = "1.0"
|
|
embedded-hal-async = "1.0"
|
|
embassy-embedded-hal = "0.6"
|
|
embassy-executor = "0.10"
|
|
embassy-sync = "0.8"
|
|
embassy-time = "0.5"
|
|
embassy-usb = { version = "0.6", features = ["defmt"] }
|
|
embassy-usb-driver = "0.2"
|
|
ucobs = { version = "0.3", features = ["legacy-msrv"] }
|
|
heapless = "0.9"
|
|
lora-phy = "3.0"
|
|
portable-atomic = { version = "1", optional = true, default-features = false, features = ["critical-section"] }
|
|
static_cell = "2.1"
|
|
|
|
# Display rendering
|
|
display-interface = "0.5"
|
|
embedded-graphics = "0.8"
|
|
ssd1306 = { version = "0.10", features = ["async"] }
|
|
|
|
# Async IO traits and combinators
|
|
embedded-io-async = "0.7"
|
|
embassy-futures = "0.1"
|
|
|
|
# ESP32-S3 (Heltec V3) — requires esp toolchain (espup)
|
|
esp-backtrace = { version = "0.18", optional = true, features = [
|
|
"esp32s3",
|
|
"panic-handler",
|
|
"defmt",
|
|
] }
|
|
esp-hal = { version = "1.0", optional = true, features = [
|
|
"esp32s3",
|
|
"unstable",
|
|
] }
|
|
esp-println = { version = "0.16", optional = true, features = [
|
|
"esp32s3",
|
|
"defmt-espflash",
|
|
] }
|
|
esp-rtos = { version = "0.2", optional = true, features = [
|
|
"esp32s3",
|
|
"embassy",
|
|
] }
|
|
|
|
# nRF52840 (RAK 4631)
|
|
cortex-m = { version = "0.7", optional = true, features = [
|
|
"critical-section-single-core",
|
|
] }
|
|
cortex-m-rt = { version = "0.7", optional = true }
|
|
defmt-rtt = { version = "1.0", optional = true }
|
|
embassy-nrf = { version = "0.10", optional = true, features = [
|
|
"nrf52840",
|
|
"gpiote",
|
|
"time-driver-rtc1",
|
|
"defmt",
|
|
] }
|
|
panic-probe = { version = "1.0", optional = true, features = ["print-defmt"] }
|
|
|
|
# RP2040 (Waveshare RP2040-LoRa)
|
|
embassy-rp = { version = "0.10", optional = true, features = [
|
|
"rp2040",
|
|
"time-driver",
|
|
"defmt",
|
|
] }
|
|
|
|
[build-dependencies]
|
|
minijinja = "2.18"
|
|
owo-colors = "4.3"
|
|
|
|
[features]
|
|
heltec_v3 = [
|
|
"dep:esp-backtrace",
|
|
"dep:esp-hal",
|
|
"dep:esp-println",
|
|
"dep:esp-rtos",
|
|
]
|
|
heltec_v3_uart = [
|
|
"dep:esp-backtrace",
|
|
"dep:esp-hal",
|
|
"dep:esp-println",
|
|
"dep:esp-rtos",
|
|
]
|
|
heltec_v4 = [
|
|
"dep:esp-backtrace",
|
|
"dep:esp-hal",
|
|
"dep:esp-println",
|
|
"dep:esp-rtos",
|
|
]
|
|
elecrow_thinknode_m2 = [
|
|
"dep:esp-backtrace",
|
|
"dep:esp-hal",
|
|
"dep:esp-println",
|
|
"dep:esp-rtos",
|
|
]
|
|
rak_wisblock_4631 = [
|
|
"dep:cortex-m",
|
|
"dep:cortex-m-rt",
|
|
"cortex-m-rt/set-vtor",
|
|
"dep:defmt-rtt",
|
|
"dep:embassy-nrf",
|
|
"dep:panic-probe",
|
|
"embassy-executor/platform-cortex-m",
|
|
"embassy-executor/executor-thread",
|
|
]
|
|
wio_tracker_l1 = [
|
|
"dep:cortex-m",
|
|
"dep:cortex-m-rt",
|
|
"cortex-m-rt/set-vtor",
|
|
"dep:defmt-rtt",
|
|
"dep:embassy-nrf",
|
|
"dep:panic-probe",
|
|
"embassy-executor/platform-cortex-m",
|
|
"embassy-executor/executor-thread",
|
|
]
|
|
waveshare_rp2040_lora = [
|
|
"dep:cortex-m",
|
|
"dep:cortex-m-rt",
|
|
"dep:defmt-rtt",
|
|
"dep:embassy-rp",
|
|
"dep:panic-probe",
|
|
"dep:portable-atomic",
|
|
"embassy-executor/platform-cortex-m",
|
|
"embassy-executor/executor-thread",
|
|
]
|
|
|
|
# REVISIT: esp-rtos 0.2.0 on crates.io pins embassy-executor ^0.9. The
|
|
# esp-rs/esp-hal main branch already supports 0.10. Remove these patches once
|
|
# esp-rtos publishes a release with embassy-executor 0.10 support. Track:
|
|
# https://github.com/esp-rs/esp-hal/tree/main/esp-rtos
|
|
[patch.crates-io]
|
|
esp-hal = { git = "https://github.com/esp-rs/esp-hal.git", branch = "main" }
|
|
esp-rtos = { git = "https://github.com/esp-rs/esp-hal.git", branch = "main" }
|
|
esp-backtrace = { git = "https://github.com/esp-rs/esp-hal.git", branch = "main" }
|
|
esp-println = { git = "https://github.com/esp-rs/esp-hal.git", branch = "main" }
|
|
|
|
[lints.clippy]
|
|
undocumented_unsafe_blocks = "deny"
|
|
|
|
[profile.release]
|
|
codegen-units = 1
|
|
lto = "fat"
|
|
opt-level = 3 # "s"/"z" break Xtensa (l32r literal range exceeded)
|
|
panic = "abort"
|
|
strip = true
|