feat: upgrade all dependencies to latest versions
Major version bumps: - defmt 0.3 → 1.0 - esp-hal 0.22 → 1.0 (full API migration) - esp-hal-embassy 0.5 → esp-rtos 0.2 (replacement crate) - esp-backtrace 0.14 → 0.18 - esp-println 0.12 → 0.16 - embassy-nrf 0.2 → 0.10 - embassy-embedded-hal 0.2 → 0.6 - embassy-sync 0.6 → 0.8 - embassy-time 0.3 → 0.5 - embassy-usb 0.3 → 0.6 - embassy-usb-driver 0.1 → 0.2 - embedded-io-async 0.6 → 0.7 - heapless 0.8 → 0.9 - panic-probe 0.3 → 1.0 - minijinja 2.0 → 2.18 - owo-colors 4.0 → 4.3 embassy-executor stays at 0.9 (latest with Xtensa support via esp-rtos). Updated ESP toolchain from 1.82 to 1.93.
This commit is contained in:
7 files changed
+637
-573
No files matched your search
+22
-23
@@ -2,12 +2,12 @@ use super::traits::LoRaBoard;
|
||||
use embassy_embedded_hal::shared_bus::asynch::spi::SpiDevice;
|
||||
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
|
||||
use embassy_time::Delay;
|
||||
use esp_hal::dma::{Dma, DmaPriority};
|
||||
use esp_hal::gpio::{Input, Level, Output, Pull};
|
||||
use esp_hal::dma::{DmaRxBuf, DmaTxBuf};
|
||||
use esp_hal::gpio::{Input, InputConfig, Level, Output, OutputConfig, Pull};
|
||||
use esp_hal::i2c::master::{Config as I2cConfig, I2c};
|
||||
use esp_hal::prelude::*;
|
||||
use esp_hal::spi::master::{Config as SpiConfig, Spi, SpiDmaBus};
|
||||
use esp_hal::spi::SpiMode;
|
||||
use esp_hal::spi::Mode as SpiMode;
|
||||
use esp_hal::time::Rate;
|
||||
use esp_hal::timer::timg::TimerGroup;
|
||||
use static_cell::StaticCell;
|
||||
|
||||
@@ -67,32 +67,30 @@ impl Board {
|
||||
pub fn into_parts(self) -> (RadioParts, UsbParts, Option<DisplayParts>) {
|
||||
let p = self.p;
|
||||
|
||||
// ── Embassy time driver ────────────────────────────────────
|
||||
// ── esp-rtos scheduler + embassy time driver ──────────────
|
||||
let timg0 = TimerGroup::new(p.TIMG0);
|
||||
esp_hal_embassy::init(timg0.timer0);
|
||||
esp_rtos::start(timg0.timer0);
|
||||
|
||||
// ── Vext power: GPIO21, active LOW to enable OLED ──────────
|
||||
let vext = Output::new(p.GPIO21, Level::Low);
|
||||
let vext = Output::new(p.GPIO21, Level::Low, OutputConfig::default());
|
||||
core::mem::forget(vext); // hold pin low permanently; drop would reset it
|
||||
|
||||
// ── DMA for SPI ────────────────────────────────────────────
|
||||
let dma = Dma::new(p.DMA);
|
||||
let dma_ch = dma.channel0.configure(false, DmaPriority::Priority0);
|
||||
|
||||
// ── SPI + DMA for SX1262 ───────────────────────────────────
|
||||
let spi = Spi::new_with_config(p.SPI2, SpiConfig {
|
||||
frequency: 1u32.MHz(),
|
||||
mode: SpiMode::Mode0,
|
||||
..Default::default()
|
||||
})
|
||||
let spi = Spi::new(
|
||||
p.SPI2,
|
||||
SpiConfig::default()
|
||||
.with_frequency(Rate::from_mhz(1))
|
||||
.with_mode(SpiMode::_0),
|
||||
)
|
||||
.expect("SPI init")
|
||||
.with_sck(p.GPIO9)
|
||||
.with_mosi(p.GPIO10)
|
||||
.with_miso(p.GPIO11)
|
||||
.with_dma(dma_ch);
|
||||
.with_dma(p.DMA_CH0);
|
||||
|
||||
let (rx_buf, rx_desc, tx_buf, tx_desc) = esp_hal::dma_buffers!(256);
|
||||
let dma_rx = esp_hal::dma::DmaRxBuf::new(rx_desc, rx_buf).expect("DMA RX buf");
|
||||
let dma_tx = esp_hal::dma::DmaTxBuf::new(tx_desc, tx_buf).expect("DMA TX buf");
|
||||
let dma_rx = DmaRxBuf::new(rx_desc, rx_buf).expect("DMA RX buf");
|
||||
let dma_tx = DmaTxBuf::new(tx_desc, tx_buf).expect("DMA TX buf");
|
||||
|
||||
let spi = spi.with_buffers(dma_rx, dma_tx).into_async();
|
||||
|
||||
@@ -100,13 +98,13 @@ impl Board {
|
||||
StaticCell::new();
|
||||
let spi_bus = SPI_BUS.init(embassy_sync::mutex::Mutex::new(spi));
|
||||
|
||||
let nss = Output::new(p.GPIO8, Level::High);
|
||||
let nss = Output::new(p.GPIO8, Level::High, OutputConfig::default());
|
||||
let spi_device = SpiDevice::new(spi_bus, nss);
|
||||
|
||||
// ── SX1262 control pins ────────────────────────────────────
|
||||
let reset = Output::new(p.GPIO12, Level::High);
|
||||
let dio1 = Input::new(p.GPIO14, Pull::Down);
|
||||
let busy = Input::new(p.GPIO13, Pull::Down);
|
||||
let reset = Output::new(p.GPIO12, Level::High, OutputConfig::default());
|
||||
let dio1 = Input::new(p.GPIO14, InputConfig::default().with_pull(Pull::Down));
|
||||
let busy = Input::new(p.GPIO13, InputConfig::default().with_pull(Pull::Down));
|
||||
|
||||
let iv = GenericSx126xInterfaceVariant::new(reset, dio1, busy, None, None).expect("SX1262 interface init");
|
||||
|
||||
@@ -136,6 +134,7 @@ impl Board {
|
||||
|
||||
// ── Display (SSD1306 OLED on I2C, 0x3C) ───────────────────
|
||||
let i2c = I2c::new(p.I2C0, I2cConfig::default())
|
||||
.expect("I2C init")
|
||||
.with_sda(p.GPIO17)
|
||||
.with_scl(p.GPIO18)
|
||||
.into_async();
|
||||
|
||||
Reference in new issue
Block a user