Split reset for primary and secondary displays
This commit is contained in:
+14
-2
@@ -28,7 +28,7 @@ use embedded_hal_bus::i2c::AtomicDevice;
|
||||
use embedded_hal_bus::util::AtomicCell;
|
||||
use esp_hal::Blocking;
|
||||
use esp_hal::clock::CpuClock;
|
||||
use esp_hal::gpio::{Input, InputConfig, Pull};
|
||||
use esp_hal::gpio::{Input, InputConfig, Level, Output, OutputConfig, Pull};
|
||||
use esp_hal::i2c::master::{Config as I2cConfig, I2c};
|
||||
use esp_hal::timer::timg::TimerGroup;
|
||||
use log::error;
|
||||
@@ -72,10 +72,22 @@ async fn main(spawner: Spawner) {
|
||||
peripherals.GPIO37, // miso
|
||||
peripherals.GPIO11, // primary cs
|
||||
peripherals.GPIO13, // oled cs
|
||||
peripherals.GPIO10, // shared reset
|
||||
peripherals.GPIO10, // primary reset
|
||||
peripherals.GPIO47, // secondary reset
|
||||
peripherals.GPIO12, // shared dc
|
||||
)));
|
||||
|
||||
let _secondary_oled_cs_2 = Output::new(
|
||||
peripherals.GPIO14,
|
||||
Level::High,
|
||||
OutputConfig::default(),
|
||||
);
|
||||
let _secondary_oled_cs_3 = Output::new(
|
||||
peripherals.GPIO21,
|
||||
Level::High,
|
||||
OutputConfig::default(),
|
||||
);
|
||||
|
||||
let config = I2cConfig::default().with_frequency(esp_hal::time::Rate::from_khz(400));
|
||||
let i2c = match I2c::new(peripherals.I2C0, config) {
|
||||
Ok(bus) => bus
|
||||
|
||||
Reference in New Issue
Block a user