WIP: get Heltec V3 working
This commit is contained in:
1 parent
0ae1c84085
commit
73878b792f
9 files changed
+292
-27
No files matched your search
+15
-7
@@ -3,8 +3,8 @@ use esp_hal::gpio::{Level, Output, OutputConfig};
|
||||
use super::esp32s3;
|
||||
use super::traits::LoRaBoard;
|
||||
|
||||
#[allow(unused_imports)] // Re-exported for other modules (display, radio, usb tasks)
|
||||
pub use super::esp32s3::{DisplayI2c, DisplayParts, RadioDriver, RadioParts, UsbDriver, UsbParts};
|
||||
#[allow(unused_imports)] // Re-exported for other modules (display, radio, uart tasks)
|
||||
pub use super::esp32s3::{DisplayI2c, DisplayParts, RadioDriver, RadioParts, UartDriver, UartParts};
|
||||
|
||||
// ── Board init ───────────────────────────────────────────────────────
|
||||
|
||||
@@ -27,23 +27,31 @@ impl LoRaBoard for Board {
|
||||
}
|
||||
|
||||
impl Board {
|
||||
pub fn into_parts(self) -> (RadioParts, UsbParts, Option<DisplayParts>) {
|
||||
pub fn into_parts(self) -> (RadioParts, UartParts, Option<DisplayParts>) {
|
||||
let p = self.p;
|
||||
|
||||
esp32s3::start_timer(p.TIMG0);
|
||||
|
||||
// Vext power: GPIO21, active LOW to enable OLED
|
||||
let vext = Output::new(p.GPIO21, Level::Low, OutputConfig::default());
|
||||
// Vext power: GPIO36, active LOW to enable peripherals
|
||||
let vext = Output::new(p.GPIO36, Level::Low, OutputConfig::default());
|
||||
core::mem::forget(vext); // hold pin low permanently; drop would reset it
|
||||
|
||||
let radio = esp32s3::init_radio(
|
||||
p.SPI2, p.DMA_CH0, p.GPIO9, p.GPIO10, p.GPIO11, p.GPIO8, p.GPIO12, p.GPIO14, p.GPIO13,
|
||||
);
|
||||
let usb = esp32s3::init_usb(p.USB0, p.GPIO20, p.GPIO19);
|
||||
let uart = esp32s3::init_uart(p.UART0, p.GPIO43, p.GPIO44);
|
||||
|
||||
// SSD1306 display reset: pulse GPIO21 low->high before I2C init
|
||||
let mut display_rst = Output::new(p.GPIO21, Level::Low, OutputConfig::default());
|
||||
esp_hal::delay::Delay::new().delay_millis(10);
|
||||
display_rst.set_high();
|
||||
esp_hal::delay::Delay::new().delay_millis(10);
|
||||
core::mem::forget(display_rst); // hold reset high permanently
|
||||
|
||||
let i2c = esp32s3::init_display_i2c(p.I2C0, p.GPIO17, p.GPIO18);
|
||||
let mac = Self::mac_address();
|
||||
let display = Some(DisplayParts { i2c, mac });
|
||||
|
||||
(radio, usb, display)
|
||||
(radio, uart, display)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user