OLED driver with shared SPI bus integrated #35
Generated
+11
@@ -235,6 +235,16 @@ version = "1.0.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ch1115"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "git+https://github.com/ede1998/ch1115.git?rev=2d3a3ba38050efe012e6a210afe3e125ec280c37#2d3a3ba38050efe012e6a210afe3e125ec280c37"
|
||||||
|
dependencies = [
|
||||||
|
"display-interface",
|
||||||
|
"embedded-graphics-core",
|
||||||
|
"embedded-hal 1.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cobs"
|
name = "cobs"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
@@ -309,6 +319,7 @@ name = "creaturedex"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
|
"ch1115",
|
||||||
"critical-section",
|
"critical-section",
|
||||||
"display-interface-spi",
|
"display-interface-spi",
|
||||||
"embassy-executor",
|
"embassy-executor",
|
||||||
|
|||||||
@@ -47,6 +47,11 @@ num_enum = { version = "0.7.6", default-features = false }
|
|||||||
embassy-sync = "0.8.0"
|
embassy-sync = "0.8.0"
|
||||||
embedded-hal-async = "1.0.0"
|
embedded-hal-async = "1.0.0"
|
||||||
i2c-character-display = "0.5.1"
|
i2c-character-display = "0.5.1"
|
||||||
|
ch1115 = { version = "0.1.2", features = ["graphics"] }
|
||||||
|
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
ch1115 = { git = "https://github.com/ede1998/ch1115.git", rev = "2d3a3ba38050efe012e6a210afe3e125ec280c37" }
|
||||||
|
|
||||||
# For fine tuning these settings, please refer to https://doc.rust-lang.org/cargo/reference/profiles.html
|
# For fine tuning these settings, please refer to https://doc.rust-lang.org/cargo/reference/profiles.html
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
|
|||||||
+41
-10
@@ -10,7 +10,7 @@
|
|||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
use creaturedex::card::decoder::split_nfc_hex;
|
use creaturedex::card::decoder::split_nfc_hex;
|
||||||
use creaturedex::card::model::Card;
|
use creaturedex::card::model::Card;
|
||||||
use creaturedex::display::primary_lcd::{PrimaryLcdDisplay, init_primary_lcd};
|
use creaturedex::display::shared_bus::{DualSecondaryDisplay, init_dual_displays};
|
||||||
use creaturedex::display::tertiary_lcd::{init_tertiary_lcd, write_wrapped};
|
use creaturedex::display::tertiary_lcd::{init_tertiary_lcd, write_wrapped};
|
||||||
use creaturedex::drivers::nfc_pn532::NfcPn532Driver;
|
use creaturedex::drivers::nfc_pn532::NfcPn532Driver;
|
||||||
use creaturedex::navigation::inputs::Inputs;
|
use creaturedex::navigation::inputs::Inputs;
|
||||||
@@ -18,13 +18,19 @@ use creaturedex::navigation::navigation::{self, CARD_DATA};
|
|||||||
use creaturedex::network::wifi::setup_wifi;
|
use creaturedex::network::wifi::setup_wifi;
|
||||||
use embassy_executor::Spawner;
|
use embassy_executor::Spawner;
|
||||||
use embassy_time::Instant;
|
use embassy_time::Instant;
|
||||||
|
use embedded_graphics::pixelcolor::BinaryColor;
|
||||||
|
use embedded_graphics::{
|
||||||
|
mono_font::{MonoTextStyle, ascii::FONT_6X10},
|
||||||
|
prelude::*,
|
||||||
|
text::Text,
|
||||||
|
};
|
||||||
use embedded_hal_bus::i2c::AtomicDevice;
|
use embedded_hal_bus::i2c::AtomicDevice;
|
||||||
use embedded_hal_bus::util::AtomicCell;
|
use embedded_hal_bus::util::AtomicCell;
|
||||||
use esp_hal::Blocking;
|
use esp_hal::Blocking;
|
||||||
use esp_hal::clock::CpuClock;
|
use esp_hal::clock::CpuClock;
|
||||||
use esp_hal::gpio::{Input, InputConfig, Pull};
|
use esp_hal::gpio::{Input, InputConfig, Pull};
|
||||||
use esp_hal::timer::timg::TimerGroup;
|
|
||||||
use esp_hal::i2c::master::{Config as I2cConfig, I2c};
|
use esp_hal::i2c::master::{Config as I2cConfig, I2c};
|
||||||
|
use esp_hal::timer::timg::TimerGroup;
|
||||||
use log::error;
|
use log::error;
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
@@ -59,19 +65,22 @@ async fn main(spawner: Spawner) {
|
|||||||
let timg0 = TimerGroup::new(peripherals.TIMG0);
|
let timg0 = TimerGroup::new(peripherals.TIMG0);
|
||||||
esp_rtos::start(timg0.timer0, sw_interrupt.software_interrupt0);
|
esp_rtos::start(timg0.timer0, sw_interrupt.software_interrupt0);
|
||||||
|
|
||||||
let display: &mut PrimaryLcdDisplay = Box::leak(Box::new(init_primary_lcd(
|
let (display, oled) = Box::leak(Box::new(init_dual_displays(
|
||||||
peripherals.SPI2,
|
peripherals.SPI2,
|
||||||
peripherals.GPIO36, // sck
|
peripherals.GPIO36, // sck
|
||||||
peripherals.GPIO35, // mosi
|
peripherals.GPIO35, // mosi
|
||||||
peripherals.GPIO37, // miso
|
peripherals.GPIO37, // miso
|
||||||
peripherals.GPIO11, // primary cs
|
peripherals.GPIO11, // primary cs
|
||||||
|
peripherals.GPIO13, // oled cs
|
||||||
peripherals.GPIO10, // shared reset
|
peripherals.GPIO10, // shared reset
|
||||||
peripherals.GPIO12, // shared dc
|
peripherals.GPIO12, // shared dc
|
||||||
)));
|
)));
|
||||||
|
|
||||||
let config = I2cConfig::default().with_frequency(esp_hal::time::Rate::from_khz(400));
|
let config = I2cConfig::default().with_frequency(esp_hal::time::Rate::from_khz(400));
|
||||||
let i2c = match I2c::new(peripherals.I2C0, config) {
|
let i2c = match I2c::new(peripherals.I2C0, config) {
|
||||||
Ok(bus) => bus.with_sda(peripherals.GPIO17).with_scl(peripherals.GPIO18),
|
Ok(bus) => bus
|
||||||
|
.with_sda(peripherals.GPIO17)
|
||||||
|
.with_scl(peripherals.GPIO18),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::error!("Shared I2C bus initialization failed for GPIO17/GPIO18: {e:?}");
|
log::error!("Shared I2C bus initialization failed for GPIO17/GPIO18: {e:?}");
|
||||||
panic!("Shared I2C bus initialization failed");
|
panic!("Shared I2C bus initialization failed");
|
||||||
@@ -82,10 +91,12 @@ async fn main(spawner: Spawner) {
|
|||||||
|
|
||||||
let mut lcd = init_tertiary_lcd(AtomicDevice::new(shared_i2c));
|
let mut lcd = init_tertiary_lcd(AtomicDevice::new(shared_i2c));
|
||||||
if let Err(_) = write_wrapped(&mut lcd, "Testing more than 16 chars what happens now?") {
|
if let Err(_) = write_wrapped(&mut lcd, "Testing more than 16 chars what happens now?") {
|
||||||
log::error!("Tertiary LCD startup text write failed over shared I2C bus; check the shared bus, wiring, and device responses");
|
log::error!(
|
||||||
|
"Tertiary LCD startup text write failed over shared I2C bus; check the shared bus, wiring, and device responses"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup_wifi(peripherals.WIFI, peripherals.FLASH, &spawner).await;
|
setup_wifi(peripherals.WIFI, peripherals.FLASH, &spawner).await;
|
||||||
|
|
||||||
let mut nfc_driver = NfcPn532Driver::new(AtomicDevice::new(shared_i2c));
|
let mut nfc_driver = NfcPn532Driver::new(AtomicDevice::new(shared_i2c));
|
||||||
if nfc_driver.configure_sam().await.is_ok() {
|
if nfc_driver.configure_sam().await.is_ok() {
|
||||||
@@ -104,14 +115,17 @@ async fn main(spawner: Spawner) {
|
|||||||
ok: Input::new(peripherals.GPIO0, button_config),
|
ok: Input::new(peripherals.GPIO0, button_config),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
display_shit(oled);
|
||||||
|
|
||||||
log::info!("Setup complete, entering main loop");
|
log::info!("Setup complete, entering main loop");
|
||||||
spawner.spawn(navigation::run(inputs, display).expect("run task failed"));
|
spawner.spawn(navigation::run(inputs, display).expect("run task failed"));
|
||||||
spawner.spawn(nfc_driver_task(nfc_driver).expect("nfc driver task failed"));
|
spawner.spawn(nfc_driver_task(nfc_driver).expect("nfc driver task failed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[embassy_executor::task]
|
#[embassy_executor::task]
|
||||||
async fn nfc_driver_task(mut nfc_driver: NfcPn532Driver<AtomicDevice<'static, I2c<'static, Blocking>>>) {
|
async fn nfc_driver_task(
|
||||||
|
mut nfc_driver: NfcPn532Driver<AtomicDevice<'static, I2c<'static, Blocking>>>,
|
||||||
|
) {
|
||||||
loop {
|
loop {
|
||||||
while CARD_DATA.lock().await.is_none() {
|
while CARD_DATA.lock().await.is_none() {
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
@@ -121,9 +135,16 @@ async fn nfc_driver_task(mut nfc_driver: NfcPn532Driver<AtomicDevice<'static, I2
|
|||||||
log::error!("Failed to split NFC card data");
|
log::error!("Failed to split NFC card data");
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
CARD_DATA.lock().await.replace(Card::try_from(split_data).unwrap());
|
CARD_DATA
|
||||||
|
.lock()
|
||||||
|
.await
|
||||||
|
.replace(Card::try_from(split_data).unwrap());
|
||||||
let elapsed_ms = start.elapsed().as_millis();
|
let elapsed_ms = start.elapsed().as_millis();
|
||||||
log::info!("NFC read duration: {} ms, card data length: {}", elapsed_ms, card_data.len());
|
log::info!(
|
||||||
|
"NFC read duration: {} ms, card data length: {}",
|
||||||
|
elapsed_ms,
|
||||||
|
card_data.len()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
log::info!("No NFC card found");
|
log::info!("No NFC card found");
|
||||||
@@ -133,3 +154,13 @@ async fn nfc_driver_task(mut nfc_driver: NfcPn532Driver<AtomicDevice<'static, I2
|
|||||||
embassy_time::Timer::after(embassy_time::Duration::from_millis(1000)).await;
|
embassy_time::Timer::after(embassy_time::Duration::from_millis(1000)).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn display_shit(oled: &mut DualSecondaryDisplay<'static>) {
|
||||||
|
oled.clear().unwrap();
|
||||||
|
|
||||||
|
let text_style = MonoTextStyle::new(&FONT_6X10, BinaryColor::On);
|
||||||
|
Text::new("Hello OLED", Point::new(10, 20), text_style)
|
||||||
|
.draw(oled)
|
||||||
|
.unwrap();
|
||||||
|
oled.flush().unwrap();
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
pub mod primary_lcd;
|
pub mod primary_lcd;
|
||||||
pub mod secondary_oled;
|
pub mod secondary_oled;
|
||||||
|
pub mod shared_bus;
|
||||||
pub mod sprite;
|
pub mod sprite;
|
||||||
pub mod tertiary_lcd;
|
pub mod tertiary_lcd;
|
||||||
|
|||||||
+24
-42
@@ -2,55 +2,37 @@ use display_interface_spi::SPIInterface;
|
|||||||
use embedded_graphics::draw_target::DrawTarget;
|
use embedded_graphics::draw_target::DrawTarget;
|
||||||
use embedded_graphics::pixelcolor::Rgb565;
|
use embedded_graphics::pixelcolor::Rgb565;
|
||||||
use embedded_graphics::prelude::RgbColor;
|
use embedded_graphics::prelude::RgbColor;
|
||||||
use embedded_hal_bus::spi::ExclusiveDevice;
|
use embedded_hal::digital::OutputPin as EhOutputPin;
|
||||||
|
use embedded_hal_bus::spi::AtomicDevice;
|
||||||
|
use embedded_hal_bus::util::AtomicCell;
|
||||||
use esp_hal::delay::Delay;
|
use esp_hal::delay::Delay;
|
||||||
use esp_hal::gpio::{Level, Output, OutputConfig};
|
use esp_hal::gpio::{Level, Output, OutputConfig, OutputPin};
|
||||||
use esp_hal::peripherals::{GPIO10, GPIO11, GPIO12, GPIO35, GPIO36, GPIO37, SPI2};
|
|
||||||
use esp_hal::spi::{
|
|
||||||
Mode,
|
|
||||||
master::{Config, Spi},
|
|
||||||
};
|
|
||||||
use esp_hal::time::Rate;
|
|
||||||
use ili9341::{DisplaySize240x320, Ili9341, Orientation};
|
use ili9341::{DisplaySize240x320, Ili9341, Orientation};
|
||||||
|
|
||||||
pub type PrimaryLcdDisplay<'a> = Ili9341<
|
pub type PrimaryLcdDisplay<'a, BUS, DC, RES> =
|
||||||
SPIInterface<ExclusiveDevice<Spi<'a, esp_hal::Blocking>, Output<'a>, Delay>, Output<'a>>,
|
Ili9341<SPIInterface<AtomicDevice<'a, BUS, Output<'a>, Delay>, DC>, RES>;
|
||||||
Output<'a>,
|
|
||||||
>;
|
|
||||||
|
|
||||||
pub fn init_primary_lcd(
|
pub fn init_primary_lcd_on_bus<'a, BUS, CS, RES, DC>(
|
||||||
spi2: SPI2<'static>,
|
spi_bus: &'a AtomicCell<BUS>,
|
||||||
sck: GPIO36<'static>,
|
cs: CS,
|
||||||
mosi: GPIO35<'static>,
|
reset: RES,
|
||||||
miso: GPIO37<'static>,
|
dc: DC,
|
||||||
cs: GPIO11<'static>,
|
delay: &mut Delay,
|
||||||
reset: GPIO10<'static>,
|
) -> PrimaryLcdDisplay<'a, BUS, DC, RES>
|
||||||
dc: GPIO12<'static>,
|
where
|
||||||
) -> PrimaryLcdDisplay<'static> {
|
BUS: embedded_hal::spi::SpiBus,
|
||||||
let freq = Rate::from_khz(60_000);
|
CS: OutputPin + 'static,
|
||||||
log::info!("Display freq: {freq}");
|
RES: EhOutputPin,
|
||||||
|
DC: EhOutputPin,
|
||||||
let spi_bus = Spi::new(
|
{
|
||||||
spi2,
|
let cs_pin = Output::new(cs, Level::High, OutputConfig::default());
|
||||||
Config::default().with_frequency(freq).with_mode(Mode::_0),
|
let spi_dev = AtomicDevice::new(spi_bus, cs_pin, *delay).unwrap();
|
||||||
)
|
let iface = SPIInterface::new(spi_dev, dc);
|
||||||
.unwrap()
|
|
||||||
.with_sck(sck)
|
|
||||||
.with_mosi(mosi)
|
|
||||||
.with_miso(miso);
|
|
||||||
|
|
||||||
let mut delay = Delay::new();
|
|
||||||
|
|
||||||
let cs_main = Output::new(cs, Level::High, OutputConfig::default());
|
|
||||||
let spi_dev = ExclusiveDevice::new(spi_bus, cs_main, delay).unwrap();
|
|
||||||
let reset_main = Output::new(reset, 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(
|
let mut display = Ili9341::new(
|
||||||
iface,
|
iface,
|
||||||
reset_main,
|
reset,
|
||||||
&mut delay,
|
delay,
|
||||||
Orientation::Portrait,
|
Orientation::Portrait,
|
||||||
DisplaySize240x320,
|
DisplaySize240x320,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1 +1,34 @@
|
|||||||
// Secondary OLED module
|
use ch1115::{Ch1115, Size128x64};
|
||||||
|
use display_interface_spi::SPIInterface;
|
||||||
|
use embedded_hal::digital::OutputPin as EhOutputPin;
|
||||||
|
use embedded_hal_bus::spi::AtomicDevice;
|
||||||
|
use embedded_hal_bus::util::AtomicCell;
|
||||||
|
use esp_hal::delay::Delay;
|
||||||
|
use esp_hal::gpio::{Level, Output, OutputConfig, OutputPin};
|
||||||
|
|
||||||
|
pub type SecondaryOledDisplay<'a, BUS, RST, DC> =
|
||||||
|
Ch1115<SPIInterface<AtomicDevice<'a, BUS, Output<'a>, Delay>, DC>, RST, Size128x64>;
|
||||||
|
|
||||||
|
pub fn init_secondary_oled_on_bus<'a, BUS, CS, RES, DC>(
|
||||||
|
spi_bus: &'a AtomicCell<BUS>,
|
||||||
|
cs: CS,
|
||||||
|
res: RES,
|
||||||
|
dc: DC,
|
||||||
|
delay: &mut Delay,
|
||||||
|
) -> SecondaryOledDisplay<'a, BUS, RES, DC>
|
||||||
|
where
|
||||||
|
BUS: embedded_hal::spi::SpiBus,
|
||||||
|
CS: OutputPin + 'static,
|
||||||
|
RES: EhOutputPin,
|
||||||
|
DC: EhOutputPin,
|
||||||
|
{
|
||||||
|
let cs_pin = Output::new(cs, Level::High, OutputConfig::default());
|
||||||
|
let spi_dev = AtomicDevice::new(spi_bus, cs_pin, *delay).unwrap();
|
||||||
|
let interface = SPIInterface::new(spi_dev, dc);
|
||||||
|
|
||||||
|
let mut display = Ch1115::new(interface, res, Size128x64);
|
||||||
|
|
||||||
|
display.init(&mut Delay::new()).unwrap();
|
||||||
|
|
||||||
|
display
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
use crate::display::primary_lcd::{PrimaryLcdDisplay, init_primary_lcd_on_bus};
|
||||||
|
use alloc::boxed::Box;
|
||||||
|
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||||
|
use embedded_hal::digital::ErrorType;
|
||||||
|
use embedded_hal::digital::OutputPin as EhOutputPin;
|
||||||
|
use embedded_hal_bus::util::AtomicCell;
|
||||||
|
use esp_hal::delay::Delay;
|
||||||
|
use esp_hal::gpio::interconnect::{PeripheralInput, PeripheralOutput};
|
||||||
|
use esp_hal::gpio::{Level, Output, OutputConfig, OutputPin};
|
||||||
|
use esp_hal::spi::Mode;
|
||||||
|
use esp_hal::spi::master::{Config as SpiConfig, Spi};
|
||||||
|
use esp_hal::time::Rate;
|
||||||
|
|
||||||
|
use crate::display::secondary_oled::{SecondaryOledDisplay, init_secondary_oled_on_bus};
|
||||||
|
|
||||||
|
use core::cell::RefCell;
|
||||||
|
use embassy_sync::blocking_mutex::Mutex as BlockingMutex;
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct SharedPin<'a, P> {
|
||||||
|
mutex: &'a BlockingMutex<CriticalSectionRawMutex, RefCell<P>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a, P> SharedPin<'a, P> {
|
||||||
|
pub fn new(mutex: &'a BlockingMutex<CriticalSectionRawMutex, RefCell<P>>) -> Self {
|
||||||
|
Self { mutex }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn pre_wrap(pin: P) -> &'static BlockingMutex<CriticalSectionRawMutex, RefCell<P>> {
|
||||||
|
let mutexed = BlockingMutex::new(RefCell::new(pin));
|
||||||
|
Box::leak(Box::new(mutexed))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a, P: EhOutputPin> ErrorType for SharedPin<'a, P> {
|
||||||
|
type Error = P::Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a, P: EhOutputPin> EhOutputPin for SharedPin<'a, P> {
|
||||||
|
fn set_low(&mut self) -> Result<(), Self::Error> {
|
||||||
|
self.mutex.lock(|p| p.borrow_mut().set_low())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_high(&mut self) -> Result<(), Self::Error> {
|
||||||
|
self.mutex.lock(|p| p.borrow_mut().set_high())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type DisplaySpiBus = Spi<'static, esp_hal::Blocking>;
|
||||||
|
pub type DualPrimaryDisplay<'a> =
|
||||||
|
PrimaryLcdDisplay<'a, DisplaySpiBus, SharedPin<'a, Output<'a>>, SharedPin<'a, Output<'a>>>;
|
||||||
|
pub type DualSecondaryDisplay<'a> =
|
||||||
|
SecondaryOledDisplay<'a, DisplaySpiBus, SharedPin<'a, Output<'a>>, SharedPin<'a, Output<'a>>>;
|
||||||
|
|
||||||
|
pub fn init_dual_displays<SPI, SCK, MOSI, MISO, CS1, CS2, RES, DC>(
|
||||||
|
spi_peripheral: SPI,
|
||||||
|
sck: SCK,
|
||||||
|
mosi: MOSI,
|
||||||
|
miso: MISO,
|
||||||
|
cs_primary: CS1,
|
||||||
|
cs_secondary: CS2,
|
||||||
|
reset_pin: RES,
|
||||||
|
dc_pin: DC,
|
||||||
|
) -> (DualPrimaryDisplay<'static>, DualSecondaryDisplay<'static>)
|
||||||
|
where
|
||||||
|
SPI: esp_hal::spi::master::Instance + 'static,
|
||||||
|
SCK: PeripheralOutput<'static>,
|
||||||
|
MOSI: PeripheralOutput<'static>,
|
||||||
|
MISO: PeripheralInput<'static>,
|
||||||
|
CS1: OutputPin + 'static,
|
||||||
|
CS2: OutputPin + 'static,
|
||||||
|
RES: OutputPin + 'static,
|
||||||
|
DC: OutputPin + 'static,
|
||||||
|
{
|
||||||
|
let spi = Spi::new(
|
||||||
|
spi_peripheral,
|
||||||
|
SpiConfig::default()
|
||||||
|
.with_frequency(Rate::from_khz(20_000))
|
||||||
|
.with_mode(Mode::_0),
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
.with_sck(sck)
|
||||||
|
.with_mosi(mosi)
|
||||||
|
.with_miso(miso);
|
||||||
|
|
||||||
|
let bus_static: &'static AtomicCell<_> = Box::leak(Box::new(AtomicCell::new(spi)));
|
||||||
|
let reset_static =
|
||||||
|
SharedPin::pre_wrap(Output::new(reset_pin, Level::High, OutputConfig::default()));
|
||||||
|
let dc_static = SharedPin::pre_wrap(Output::new(dc_pin, Level::High, OutputConfig::default()));
|
||||||
|
let mut delay = Delay::new();
|
||||||
|
|
||||||
|
let primary = init_primary_lcd_on_bus(
|
||||||
|
bus_static,
|
||||||
|
cs_primary,
|
||||||
|
SharedPin::new(reset_static),
|
||||||
|
SharedPin::new(dc_static),
|
||||||
|
&mut delay,
|
||||||
|
);
|
||||||
|
|
||||||
|
let secondary = init_secondary_oled_on_bus(
|
||||||
|
bus_static,
|
||||||
|
cs_secondary,
|
||||||
|
SharedPin::new(reset_static),
|
||||||
|
SharedPin::new(dc_static),
|
||||||
|
&mut delay,
|
||||||
|
);
|
||||||
|
|
||||||
|
(primary, secondary)
|
||||||
|
}
|
||||||
@@ -13,7 +13,6 @@ where
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let mut src_width = 1usize;
|
let mut src_width = 1usize;
|
||||||
while src_width * src_width < pixel_count {
|
while src_width * src_width < pixel_count {
|
||||||
src_width += 1;
|
src_width += 1;
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ where
|
|||||||
lcd
|
lcd
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
error!("I2C tertiary LCD init failed on PCF8574T at address 0x27; check bus wiring, power, and device address");
|
error!(
|
||||||
|
"I2C tertiary LCD init failed on PCF8574T at address 0x27; check bus wiring, power, and device address"
|
||||||
|
);
|
||||||
panic!("tertiary LCD initialization failed");
|
panic!("tertiary LCD initialization failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,7 +37,10 @@ where
|
|||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
if let Err(e) = lcd.print(text) {
|
if let Err(e) = lcd.print(text) {
|
||||||
error!("I2C LCD print failed on line {line}; payload length={} and device may be busy or disconnected", text.len());
|
error!(
|
||||||
|
"I2C LCD print failed on line {line}; payload length={} and device may be busy or disconnected",
|
||||||
|
text.len()
|
||||||
|
);
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -52,7 +57,9 @@ where
|
|||||||
const DISPLAY_ROWS: usize = 2;
|
const DISPLAY_ROWS: usize = 2;
|
||||||
|
|
||||||
if let Err(e) = lcd.clear() {
|
if let Err(e) = lcd.clear() {
|
||||||
error!("I2C LCD clear failed before wrapped write; check the shared bus and display response");
|
error!(
|
||||||
|
"I2C LCD clear failed before wrapped write; check the shared bus and display response"
|
||||||
|
);
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,11 +77,16 @@ where
|
|||||||
};
|
};
|
||||||
|
|
||||||
if let Err(e) = lcd.set_cursor(0, row as u8) {
|
if let Err(e) = lcd.set_cursor(0, row as u8) {
|
||||||
error!("I2C LCD cursor move failed while writing wrapped row {row}; bus may be busy or device unresponsive");
|
error!(
|
||||||
|
"I2C LCD cursor move failed while writing wrapped row {row}; bus may be busy or device unresponsive"
|
||||||
|
);
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
if let Err(e) = lcd.print(chunk) {
|
if let Err(e) = lcd.print(chunk) {
|
||||||
error!("I2C LCD wrapped write failed on row {row}; chunk length={} and text may exceed display width", chunk.len());
|
error!(
|
||||||
|
"I2C LCD wrapped write failed on row {row}; chunk length={} and text may exceed display width",
|
||||||
|
chunk.len()
|
||||||
|
);
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
offset += chunk.len();
|
offset += chunk.len();
|
||||||
|
|||||||
+17
-15
@@ -1,11 +1,9 @@
|
|||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use core::convert::Infallible;
|
|
||||||
use embedded_hal::i2c::I2c;
|
use embedded_hal::i2c::I2c;
|
||||||
use esp_hal::time::{Duration, Instant};
|
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use pn532::i2c::I2CInterface;
|
use pn532::i2c::I2CInterface;
|
||||||
use pn532::requests::SAMMode;
|
use pn532::requests::SAMMode;
|
||||||
use pn532::{nb, Pn532, Request};
|
use pn532::{Pn532, Request};
|
||||||
|
|
||||||
pub type Pn532Device<I2C> = Pn532<I2CInterface<I2C>, (), 34>;
|
pub type Pn532Device<I2C> = Pn532<I2CInterface<I2C>, (), 34>;
|
||||||
|
|
||||||
@@ -29,10 +27,11 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn configure_sam(&mut self) -> Result<(), ()> {
|
pub async fn configure_sam(&mut self) -> Result<(), ()> {
|
||||||
if let Err(e) = self.pn532.process_async(
|
if let Err(e) = self
|
||||||
&Request::sam_configuration(SAMMode::Normal, false),
|
.pn532
|
||||||
0,
|
.process_async(&Request::sam_configuration(SAMMode::Normal, false), 0)
|
||||||
).await {
|
.await
|
||||||
|
{
|
||||||
error!("PN532 SAM configuration failed over I2C: {e:?}");
|
error!("PN532 SAM configuration failed over I2C: {e:?}");
|
||||||
Err(())
|
Err(())
|
||||||
} else {
|
} else {
|
||||||
@@ -42,7 +41,11 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn poll_target(&mut self) -> Result<(), ()> {
|
pub async fn poll_target(&mut self) -> Result<(), ()> {
|
||||||
match self.pn532.process_async(&Request::INLIST_ONE_ISO_A_TARGET, 23).await {
|
match self
|
||||||
|
.pn532
|
||||||
|
.process_async(&Request::INLIST_ONE_ISO_A_TARGET, 23)
|
||||||
|
.await
|
||||||
|
{
|
||||||
Ok(uid) => {
|
Ok(uid) => {
|
||||||
info!("PN532 detected NFC target UID: {uid:?}");
|
info!("PN532 detected NFC target UID: {uid:?}");
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -78,17 +81,17 @@ where
|
|||||||
for i in (0x0B..=230).step_by(PAGES_PER_READ) {
|
for i in (0x0B..=230).step_by(PAGES_PER_READ) {
|
||||||
let mut parse_result = Err(());
|
let mut parse_result = Err(());
|
||||||
while parse_result.is_err() {
|
while parse_result.is_err() {
|
||||||
let Ok(result) = self.pn532.process_async(&Request::ntag_read(i), PAGES_PER_READ * 4 + 1).await else {
|
let Ok(result) = self
|
||||||
|
.pn532
|
||||||
|
.process_async(&Request::ntag_read(i), PAGES_PER_READ * 4 + 1)
|
||||||
|
.await
|
||||||
|
else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
parse_result = Self::parse_nfc_page(i, result);
|
parse_result = Self::parse_nfc_page(i, result);
|
||||||
}
|
}
|
||||||
let bytes = parse_result.unwrap();
|
let bytes = parse_result.unwrap();
|
||||||
let bytes = if i == 0x0B {
|
let bytes = if i == 0x0B { &bytes[1..] } else { &bytes };
|
||||||
&bytes[1..]
|
|
||||||
} else {
|
|
||||||
&bytes
|
|
||||||
};
|
|
||||||
data.extend(bytes);
|
data.extend(bytes);
|
||||||
}
|
}
|
||||||
Ok(data)
|
Ok(data)
|
||||||
@@ -98,4 +101,3 @@ where
|
|||||||
&mut self.pn532
|
&mut self.pn532
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
use crate::card::model::Card;
|
use crate::card::model::Card;
|
||||||
|
use crate::display::shared_bus::DualPrimaryDisplay;
|
||||||
use crate::navigation::inputs::ButtonAction;
|
use crate::navigation::inputs::ButtonAction;
|
||||||
|
use crate::navigation::inputs::Inputs;
|
||||||
use crate::navigation::state::NavigationState;
|
use crate::navigation::state::NavigationState;
|
||||||
use crate::views::view::View;
|
use crate::views::view::View;
|
||||||
use crate::{display::primary_lcd::PrimaryLcdDisplay, navigation::inputs::Inputs};
|
|
||||||
|
|
||||||
use embassy_futures::select::{Either, select};
|
use embassy_futures::select::{Either, select};
|
||||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||||
use embassy_time::{Duration, Timer};
|
use embassy_time::{Duration, Timer};
|
||||||
|
use embedded_graphics::draw_target::DrawTarget;
|
||||||
|
use embedded_graphics::pixelcolor::Rgb565;
|
||||||
|
|
||||||
pub type Mutex<T> = embassy_sync::mutex::Mutex<CriticalSectionRawMutex, T>;
|
pub type Mutex<T> = embassy_sync::mutex::Mutex<CriticalSectionRawMutex, T>;
|
||||||
pub type Signal<T> = embassy_sync::signal::Signal<CriticalSectionRawMutex, T>;
|
pub type Signal<T> = embassy_sync::signal::Signal<CriticalSectionRawMutex, T>;
|
||||||
@@ -26,15 +29,15 @@ pub struct NewState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub trait Navigable {
|
pub trait Navigable {
|
||||||
fn display(
|
fn display<D>(&self, display: &mut D) -> impl core::future::Future<Output = ()> + Send
|
||||||
&self,
|
where
|
||||||
display: &mut PrimaryLcdDisplay<'static>,
|
D: DrawTarget<Color = Rgb565> + Send,
|
||||||
) -> impl core::future::Future<Output = ()> + Send;
|
D::Error: core::fmt::Debug;
|
||||||
fn handle_input(&self, input: Action) -> impl core::future::Future<Output = NewState> + Send;
|
fn handle_input(&self, input: Action) -> impl core::future::Future<Output = NewState> + Send;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[embassy_executor::task]
|
#[embassy_executor::task]
|
||||||
pub async fn run(mut inputs: Inputs, display: &'static mut PrimaryLcdDisplay<'static>) {
|
pub async fn run(mut inputs: Inputs, display: &'static mut DualPrimaryDisplay<'static>) {
|
||||||
log::info!("starting navigation");
|
log::info!("starting navigation");
|
||||||
|
|
||||||
let mut state = NavigationState::new();
|
let mut state = NavigationState::new();
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ impl NavigationState {
|
|||||||
self.screens.pop();
|
self.screens.pop();
|
||||||
return self.screens.last().unwrap();
|
return self.screens.last().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ use core::future;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
card::model::{Card, Palette},
|
card::model::{Card, Palette},
|
||||||
display::primary_lcd::PrimaryLcdDisplay,
|
|
||||||
navigation::navigation::{Action, Navigable},
|
navigation::navigation::{Action, Navigable},
|
||||||
views::view::View,
|
views::view::View,
|
||||||
};
|
};
|
||||||
@@ -25,10 +24,11 @@ pub struct CardView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Navigable for CardView {
|
impl Navigable for CardView {
|
||||||
fn display(
|
fn display<D>(&self, display: &mut D) -> impl core::future::Future<Output = ()> + Send
|
||||||
&self,
|
where
|
||||||
display: &mut PrimaryLcdDisplay<'static>,
|
D: DrawTarget<Color = Rgb565>,
|
||||||
) -> impl core::future::Future<Output = ()> + Send {
|
D::Error: core::fmt::Debug,
|
||||||
|
{
|
||||||
display.clear(Rgb565::BLACK).unwrap();
|
display.clear(Rgb565::BLACK).unwrap();
|
||||||
|
|
||||||
let background = Rectangle::new(Point::new(0, 0), Size::new(240, 320));
|
let background = Rectangle::new(Point::new(0, 0), Size::new(240, 320));
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ use embedded_graphics::prelude::RgbColor;
|
|||||||
use embedded_graphics_core::draw_target::DrawTarget;
|
use embedded_graphics_core::draw_target::DrawTarget;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
card::model::Card, display::primary_lcd::PrimaryLcdDisplay, navigation::navigation::{Action, Navigable, NewState}, views::view::View,
|
card::model::Card,
|
||||||
|
navigation::navigation::{Action, Navigable, NewState},
|
||||||
|
views::view::View,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -17,10 +19,11 @@ pub struct JournalView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Navigable for JournalView {
|
impl Navigable for JournalView {
|
||||||
fn display(
|
fn display<D>(&self, display: &mut D) -> impl core::future::Future<Output = ()> + Send
|
||||||
&self,
|
where
|
||||||
display: &mut PrimaryLcdDisplay<'static>,
|
D: DrawTarget<Color = Rgb565>,
|
||||||
) -> impl core::future::Future<Output = ()> + Send {
|
D::Error: core::fmt::Debug,
|
||||||
|
{
|
||||||
display.clear(Rgb565::BLACK).unwrap();
|
display.clear(Rgb565::BLACK).unwrap();
|
||||||
|
|
||||||
core::future::ready(())
|
core::future::ready(())
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ use alloc::vec;
|
|||||||
|
|
||||||
use crate::card::model::Card;
|
use crate::card::model::Card;
|
||||||
use crate::card::{decoder::split_nfc_hex, mock::*};
|
use crate::card::{decoder::split_nfc_hex, mock::*};
|
||||||
use crate::display::primary_lcd::PrimaryLcdDisplay;
|
|
||||||
|
|
||||||
use crate::navigation::inputs::ButtonAction;
|
use crate::navigation::inputs::ButtonAction;
|
||||||
use crate::views::card_view::CardView;
|
use crate::views::card_view::CardView;
|
||||||
@@ -22,10 +21,11 @@ pub struct MainMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Navigable for MainMenu {
|
impl Navigable for MainMenu {
|
||||||
fn display(
|
fn display<D>(&self, display: &mut D) -> impl core::future::Future<Output = ()> + Send
|
||||||
&self,
|
where
|
||||||
display: &mut PrimaryLcdDisplay<'static>,
|
D: DrawTarget<Color = Rgb565>,
|
||||||
) -> impl core::future::Future<Output = ()> + Send {
|
D::Error: core::fmt::Debug,
|
||||||
|
{
|
||||||
display.clear(Rgb565::BLACK).unwrap();
|
display.clear(Rgb565::BLACK).unwrap();
|
||||||
|
|
||||||
menu_item::show(display, "Scan card", 0, self.selected);
|
menu_item::show(display, "Scan card", 0, self.selected);
|
||||||
|
|||||||
+7
-10
@@ -1,19 +1,17 @@
|
|||||||
|
use embedded_graphics::Drawable;
|
||||||
|
use embedded_graphics::draw_target::DrawTarget;
|
||||||
use embedded_graphics::mono_font::MonoTextStyle;
|
use embedded_graphics::mono_font::MonoTextStyle;
|
||||||
use embedded_graphics::mono_font::ascii::FONT_10X20;
|
use embedded_graphics::mono_font::ascii::FONT_10X20;
|
||||||
use embedded_graphics::pixelcolor::Rgb565;
|
use embedded_graphics::pixelcolor::Rgb565;
|
||||||
use embedded_graphics::prelude::Point;
|
use embedded_graphics::prelude::Point;
|
||||||
use embedded_graphics::prelude::RgbColor;
|
use embedded_graphics::prelude::RgbColor;
|
||||||
use embedded_graphics::text::Text;
|
use embedded_graphics::text::Text;
|
||||||
use embedded_graphics::Drawable;
|
|
||||||
|
|
||||||
use crate::display::primary_lcd::PrimaryLcdDisplay;
|
pub fn show<'a, D>(display: &mut D, name: &str, position: i32, selected: i32)
|
||||||
|
where
|
||||||
pub fn show<'a>(
|
D: DrawTarget<Color = Rgb565>,
|
||||||
display: &mut PrimaryLcdDisplay<'static>,
|
D::Error: core::fmt::Debug,
|
||||||
name: &str,
|
{
|
||||||
position: i32,
|
|
||||||
selected: i32,
|
|
||||||
) {
|
|
||||||
let style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE);
|
let style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE);
|
||||||
let selected_style = MonoTextStyle::new(&FONT_10X20, Rgb565::BLUE);
|
let selected_style = MonoTextStyle::new(&FONT_10X20, Rgb565::BLUE);
|
||||||
|
|
||||||
@@ -29,4 +27,3 @@ pub fn show<'a>(
|
|||||||
.draw(display)
|
.draw(display)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::display::primary_lcd::PrimaryLcdDisplay;
|
|
||||||
use crate::navigation::inputs::ButtonAction;
|
use crate::navigation::inputs::ButtonAction;
|
||||||
use crate::navigation::navigation::CARD_DATA;
|
use crate::navigation::navigation::CARD_DATA;
|
||||||
use crate::navigation::navigation::NewState;
|
use crate::navigation::navigation::NewState;
|
||||||
@@ -6,7 +5,6 @@ use crate::navigation::navigation::NewState;
|
|||||||
use alloc::format;
|
use alloc::format;
|
||||||
use embedded_graphics::Drawable;
|
use embedded_graphics::Drawable;
|
||||||
use embedded_graphics::geometry::AngleUnit as _;
|
use embedded_graphics::geometry::AngleUnit as _;
|
||||||
use embedded_graphics::geometry::Dimensions as _;
|
|
||||||
use embedded_graphics::geometry::Size;
|
use embedded_graphics::geometry::Size;
|
||||||
use embedded_graphics::mono_font::MonoTextStyle;
|
use embedded_graphics::mono_font::MonoTextStyle;
|
||||||
use embedded_graphics::mono_font::ascii::FONT_10X20;
|
use embedded_graphics::mono_font::ascii::FONT_10X20;
|
||||||
@@ -33,10 +31,11 @@ pub struct ScanMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Navigable for ScanMenu {
|
impl Navigable for ScanMenu {
|
||||||
fn display(
|
fn display<D>(&self, display: &mut D) -> impl core::future::Future<Output = ()> + Send
|
||||||
&self,
|
where
|
||||||
display: &mut PrimaryLcdDisplay<'static>,
|
D: DrawTarget<Color = Rgb565>,
|
||||||
) -> impl core::future::Future<Output = ()> + Send {
|
D::Error: core::fmt::Debug,
|
||||||
|
{
|
||||||
let style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE);
|
let style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE);
|
||||||
display.clear(Rgb565::BLACK).unwrap();
|
display.clear(Rgb565::BLACK).unwrap();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use crate::display::primary_lcd::PrimaryLcdDisplay;
|
|
||||||
|
|
||||||
use crate::navigation::navigation::{Action, Navigable, NewState};
|
use crate::navigation::navigation::{Action, Navigable, NewState};
|
||||||
use crate::views::{menu_item, view::View};
|
use crate::views::{menu_item, view::View};
|
||||||
|
|
||||||
@@ -14,10 +12,11 @@ pub struct SettingsMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Navigable for SettingsMenu {
|
impl Navigable for SettingsMenu {
|
||||||
fn display(
|
fn display<D>(&self, display: &mut D) -> impl core::future::Future<Output = ()> + Send
|
||||||
&self,
|
where
|
||||||
display: &mut PrimaryLcdDisplay<'static>,
|
D: DrawTarget<Color = Rgb565>,
|
||||||
) -> impl core::future::Future<Output = ()> + Send {
|
D::Error: core::fmt::Debug,
|
||||||
|
{
|
||||||
display.clear(Rgb565::BLACK).unwrap();
|
display.clear(Rgb565::BLACK).unwrap();
|
||||||
menu_item::show(display, "System Inforation", 0, self.selected);
|
menu_item::show(display, "System Inforation", 0, self.selected);
|
||||||
menu_item::show(display, "Wifi Information", 1, self.selected);
|
menu_item::show(display, "Wifi Information", 1, self.selected);
|
||||||
|
|||||||
+8
-4
@@ -1,3 +1,6 @@
|
|||||||
|
use embedded_graphics::draw_target::DrawTarget;
|
||||||
|
use embedded_graphics::pixelcolor::Rgb565;
|
||||||
|
|
||||||
use crate::views::card_view::CardView;
|
use crate::views::card_view::CardView;
|
||||||
use crate::views::{
|
use crate::views::{
|
||||||
journal_view::JournalView, main_menu::MainMenu, scan_menu::ScanMenu,
|
journal_view::JournalView, main_menu::MainMenu, scan_menu::ScanMenu,
|
||||||
@@ -16,10 +19,11 @@ pub enum View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Navigable for View {
|
impl Navigable for View {
|
||||||
fn display(
|
fn display<D>(&self, display: &mut D) -> impl core::future::Future<Output = ()> + Send
|
||||||
&self,
|
where
|
||||||
display: &mut crate::display::primary_lcd::PrimaryLcdDisplay<'static>,
|
D: DrawTarget<Color = Rgb565> + Send,
|
||||||
) -> impl core::future::Future<Output = ()> + Send {
|
D::Error: core::fmt::Debug,
|
||||||
|
{
|
||||||
async move {
|
async move {
|
||||||
match self {
|
match self {
|
||||||
View::Main(main_menu) => main_menu.display(display).await,
|
View::Main(main_menu) => main_menu.display(display).await,
|
||||||
|
|||||||
Reference in New Issue
Block a user