working but probably wrong. timer + bit turn on for semestralka1

This commit is contained in:
Filipriec
2025-10-28 17:27:19 +01:00
parent 90f8a1769f
commit 5a7e5c6497
5 changed files with 72 additions and 5 deletions

View File

@@ -1 +1,4 @@
// src/software_uart/mod.rs
pub mod suart;
pub use suart::*;

View File

@@ -1,2 +1,19 @@
// src/software_uart/suart.rs
use embassy_stm32::peripherals::{PA2, PA3};
use embassy_stm32::gpio::{Input, Output, Pull, Speed, Level};
use embassy_stm32::Peripherals;
use embassy_time::Timer;
pub async fn suart_test(mut tx_pin: PA2, rx_pin: PA3) {
let mut tx = Output::new(tx_pin.into(), Level::Low, Speed::Low);
let _rx = Input::new(rx_pin.into(), Pull::Up);
loop {
tx.set_high();
Timer::after_millis(500).await;
tx.set_low();
Timer::after_millis(500).await;
}
}