mirror of
				https://github.com/Djeeberjr/fw-anwesenheit.git
				synced 2025-11-04 07:34:10 +00:00 
			
		
		
		
	added some todos
This commit is contained in:
		
							parent
							
								
									46e207bd2a
								
							
						
					
					
						commit
						4dda9548d3
					
				@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user