triple oled initialization
This commit is contained in:
+18
-12
@@ -10,7 +10,8 @@
|
||||
use alloc::boxed::Box;
|
||||
use creaturedex::card::decoder::split_nfc_hex;
|
||||
use creaturedex::card::model::Card;
|
||||
use creaturedex::display::shared_bus::{self, DualSecondaryDisplay};
|
||||
use creaturedex::display::secondary_oled::DualSecondaryDisplay;
|
||||
use creaturedex::display::shared_bus;
|
||||
use creaturedex::display::tertiary_lcd::{TertiaryI2cLcd, init_tertiary_lcd, write_wrapped};
|
||||
use creaturedex::drivers::nfc_pn532::NfcPn532Driver;
|
||||
use creaturedex::navigation::inputs::Inputs;
|
||||
@@ -66,7 +67,7 @@ async fn main(spawner: Spawner) {
|
||||
let timg0 = TimerGroup::new(peripherals.TIMG0);
|
||||
esp_rtos::start(timg0.timer0, sw_interrupt.software_interrupt0);
|
||||
|
||||
let (display, mut oled) = shared_bus::DisplayPinConfiguration {
|
||||
let (primary, mut secondaries) = shared_bus::DisplayPinConfiguration {
|
||||
spi_peripheral: peripherals.SPI2,
|
||||
sck: peripherals.GPIO36,
|
||||
mosi: peripherals.GPIO35,
|
||||
@@ -120,15 +121,20 @@ async fn main(spawner: Spawner) {
|
||||
ok: Input::new(peripherals.GPIO0, button_config),
|
||||
};
|
||||
|
||||
display_shit(&mut oled);
|
||||
display_shit(&mut secondaries[0], "foo 1");
|
||||
display_shit(&mut secondaries[1], "bar 1");
|
||||
display_shit(&mut secondaries[2], "baz 1");
|
||||
|
||||
let outputs = Outputs {
|
||||
primary_display: display,
|
||||
secondary_display_1: oled,
|
||||
// secondary_display_2: todo!(),
|
||||
// secondary_display_3: todo!(),
|
||||
tertiary_display: lcd,
|
||||
_led_a: (),
|
||||
let outputs = {
|
||||
let [sec_1, sec_2, sec_3] = secondaries;
|
||||
Outputs {
|
||||
primary_display: primary,
|
||||
secondary_display_1: sec_1,
|
||||
secondary_display_2: sec_2,
|
||||
secondary_display_3: sec_3,
|
||||
tertiary_display: lcd,
|
||||
_led_a: (),
|
||||
}
|
||||
};
|
||||
|
||||
log::info!("Setup complete, entering main loop");
|
||||
@@ -173,11 +179,11 @@ async fn nfc_driver_task(
|
||||
}
|
||||
}
|
||||
|
||||
fn display_shit(oled: &mut DualSecondaryDisplay<'static>) {
|
||||
fn display_shit(oled: &mut DualSecondaryDisplay<'static>, text: &str) {
|
||||
oled.clear().unwrap();
|
||||
|
||||
let text_style = MonoTextStyle::new(&FONT_6X10, BinaryColor::On);
|
||||
Text::new("Hello OLED", Point::new(10, 20), text_style)
|
||||
Text::new(text, Point::new(10, 20), text_style)
|
||||
.draw(oled)
|
||||
.unwrap();
|
||||
oled.flush().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user