added some todos

This commit is contained in:
Philipp_EndevourOS 2025-07-27 02:48:27 +02:00
parent 46e207bd2a
commit 4dda9548d3
2 changed files with 19 additions and 4 deletions

View File

@ -48,9 +48,17 @@ pub async fn hardware_init(spawner: &mut Spawner) -> (Uart<'static, Async>, Stac
let i2c_device = setup_i2c(peripherals.I2C0, peripherals.GPIO22, peripherals.GPIO23);
//TODO change to get I2C device back / maybe init for each protocol
(uart_device, stack)
}
// Initialize the level shifter for the NFC reader and LED (output-enable (OE) input is low, all outputs are placed in the high-impedance (Hi-Z) state)
fn init_lvl_shifter(oe_pin: GPIO0<'static>){
let mut oe_lvl_shifter = Output::new(oe_pin, esp_hal::gpio::Level::Low, OutputConfig::default());
oe_lvl_shifter.set_high();
}
fn setup_uart(
uart1: UART1<'static>,
uart_rx: GPIO7<'static>,
@ -83,9 +91,14 @@ fn setup_i2c(
}
}
fn setup_spi_led() {
// Initialize the level shifter for the NFC reader and LED (output-enable (OE) input is low, all outputs are placed in the high-impedance (Hi-Z) state)
fn init_lvl_shifter(oe_pin: GPIO0<'static>){
let mut oe_lvl_shifter = Output::new(oe_pin, esp_hal::gpio::Level::Low, OutputConfig::default());
oe_lvl_shifter.set_high();
}
fn setup_rtc() {
//TODO
//setup rtc with i2c
//setup interrupt for SQW
//setup 24-h alarm
}

View File

@ -28,6 +28,8 @@ mod webserver;
type TallyChannel = PubSubChannel<NoopRawMutex, TallyID, 8, 2, 1>;
type TallyPublisher = Publisher<'static, NoopRawMutex, TallyID, 8, 2, 1>;
static mut UTC_TIME: u64 = 0;
#[esp_hal_embassy::main]
async fn main(mut spawner: Spawner) {
let (uart_device, stack) = init::hardware_init(&mut spawner).await;