make it compile for esp32-wroom-32

This commit is contained in:
2026-07-29 19:01:02 +02:00
parent b40e6fb9cc
commit 302abd0a2d
3 changed files with 70 additions and 24 deletions
+12 -24
View File
@@ -60,24 +60,12 @@ fn main() -> ! {
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
let peripherals = esp_hal::init(config);
// The following pins are used to bootstrap the chip. They are available
// for use, but check the datasheet of the module for more information on them.
// - GPIO0
// - GPIO3
// - GPIO45
// - GPIO46
// These GPIO pins are in use by some feature of the module and should not be used.
let _ = peripherals.GPIO27;
let _ = peripherals.GPIO28;
let _ = peripherals.GPIO29;
let _ = peripherals.GPIO30;
let _ = peripherals.GPIO31;
let _ = peripherals.GPIO32;
let _ = peripherals.GPIO33;
let _ = peripherals.GPIO34;
let _ = peripherals.GPIO35;
let _ = peripherals.GPIO36;
let _ = peripherals.GPIO37;
let sck = peripherals.GPIO18;
let mosi = peripherals.GPIO23;
let miso = peripherals.GPIO19;
let cs_main = peripherals.GPIO5;
let dc = peripherals.GPIO17;
let reset_main = peripherals.GPIO16;
esp_alloc::heap_allocator!(#[esp_hal::ram(reclaimed)] size: 73744);
@@ -96,16 +84,16 @@ fn main() -> ! {
.with_mode(Mode::_0),
)
.unwrap()
.with_sck(peripherals.GPIO36)
.with_mosi(peripherals.GPIO35)
.with_miso(peripherals.GPIO37);
.with_sck(sck)
.with_mosi(mosi)
.with_miso(miso);
let cs_main = Output::new(peripherals.GPIO11, Level::High, OutputConfig::default());
let cs_main = Output::new(cs_main, Level::High, OutputConfig::default());
let mut delay = Delay::new();
let spi_dev = ExclusiveDevice::new(spi_bus, cs_main, delay).unwrap();
let reset_main = Output::new(peripherals.GPIO10, Level::High, OutputConfig::default());
let spi_dc = Output::new(peripherals.GPIO12, Level::High, OutputConfig::default());
let reset_main = Output::new(reset_main, Level::High, OutputConfig::default());
let spi_dc = Output::new(dc, Level::High, OutputConfig::default());
let iface = SPIInterface::new(spi_dev, spi_dc);
let mut display = Ili9341::new(