refactor: drop Heltec V3, enforce standard toolchain, remove dead code
Heltec V3 (ESP32-S3) requires the espup Xtensa toolchain fork, which violates the standard-toolchain-only principle. Removed until upstream Rust supports Xtensa targets via stock rustup. Also removes all #[allow(dead_code)] band-aids — unused items are deleted rather than suppressed. DESIGN.md updated with standard toolchain principle (#10) and peripheral model (input/telemetry slots).
This commit is contained in:
10 files changed
+36
-850
No files matched your search
@@ -1,70 +0,0 @@
|
||||
use esp_hal::gpio::{GpioPin, Input, Output, PullDown, PushPull};
|
||||
use esp_hal::peripherals::SPI2;
|
||||
use esp_hal::spi::master::Spi;
|
||||
use esp_hal::spi::SpiMode;
|
||||
use esp_hal::i2c::I2c;
|
||||
use esp_hal::peripherals::I2C0;
|
||||
use esp_hal::Delay;
|
||||
|
||||
use lora_phy::iv::GenericSx126xInterfaceVariant;
|
||||
use lora_phy::sx126x::{self, Sx1262, Sx126x};
|
||||
use lora_phy::LoRa;
|
||||
|
||||
/// Board name shown on the display dashboard.
|
||||
pub const BOARD_NAME: &str = "Heltec V3";
|
||||
|
||||
// ── Concrete peripheral types ────────────────────────────────────────
|
||||
|
||||
type Iv = GenericSx126xInterfaceVariant<Output<'static, GpioPin<8>>, Input<'static, GpioPin<14>>>;
|
||||
type RadioSpi = Spi<'static, SPI2>;
|
||||
type RadioDriver = Sx126x<RadioSpi, Iv, Sx1262>;
|
||||
|
||||
/// Fully-constructed LoRa radio driver.
|
||||
pub type Radio = LoRa<RadioDriver, Delay>;
|
||||
|
||||
/// USB driver for CDC-ACM.
|
||||
// TODO: define concrete USB OTG type once esp-hal USB support is wired up
|
||||
pub type UsbDriver = ();
|
||||
|
||||
/// I2C bus for the built-in SSD1306 OLED.
|
||||
pub type DisplayI2c = I2c<'static, I2C0>;
|
||||
|
||||
// ── Peripheral bundles ───────────────────────────────────────────────
|
||||
|
||||
pub struct RadioParts {
|
||||
pub radio: Radio,
|
||||
}
|
||||
|
||||
pub struct UsbParts {
|
||||
pub driver: UsbDriver,
|
||||
}
|
||||
|
||||
pub struct DisplayParts {
|
||||
pub i2c: DisplayI2c,
|
||||
}
|
||||
|
||||
// ── Board init ───────────────────────────────────────────────────────
|
||||
|
||||
pub struct Board {
|
||||
p: esp_hal::peripherals::Peripherals,
|
||||
}
|
||||
|
||||
impl Board {
|
||||
pub fn init() -> Self {
|
||||
let p = esp_hal::init(esp_hal::Config::default());
|
||||
Self { p }
|
||||
}
|
||||
|
||||
pub fn into_parts(self) -> (RadioParts, UsbParts, Option<DisplayParts>) {
|
||||
let _p = self.p;
|
||||
|
||||
// TODO: implement Heltec V3 peripheral init
|
||||
// - SPI2 for SX1262 (SCK=9, MOSI=10, MISO=11, NSS=8)
|
||||
// - GPIO for radio control (RST=12, DIO1=14, BUSY=13)
|
||||
// - Vext pin (GPIO21) LOW to power OLED
|
||||
// - I2C0 for SSD1306 (SDA=17, SCL=18)
|
||||
// - USB OTG for CDC-ACM
|
||||
|
||||
todo!("Heltec V3 peripheral init — requires espup toolchain to develop")
|
||||
}
|
||||
}
|
||||
@@ -18,10 +18,6 @@ bind_interrupts!(struct Irqs {
|
||||
SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0 => embassy_nrf::twim::InterruptHandler<embassy_nrf::peripherals::TWISPI0>;
|
||||
});
|
||||
|
||||
/// Board name shown on the display dashboard.
|
||||
#[allow(dead_code)]
|
||||
pub const BOARD_NAME: &str = "RAK 4631";
|
||||
|
||||
// ── Concrete peripheral types ────────────────────────────────────────
|
||||
|
||||
type SpiBus = Spim<'static, embassy_nrf::peripherals::SPI3>;
|
||||
|
||||
Reference in new issue
Block a user