rsiot/drivers_i2c/ssd1306/
mod.rs1use std::{sync::Arc, time::Duration};
4
5use tokio::{sync::Mutex, time::sleep};
6
7use super::RsiotI2cDriverBase;
8
9pub struct SSD1306 {}
11
12impl SSD1306 {
13 pub async fn fn_process(self, driver: Arc<Mutex<impl RsiotI2cDriverBase + 'static>>) {
15 loop {
16 let mut driver = driver.lock().await;
17
18 let res = driver
19 .read(
20 super::I2cSlaveAddress::Direct {
21 slave_address: 0x3C,
22 },
23 0,
24 Duration::from_secs(2),
25 )
26 .await;
27
28 println!("{:?}", res);
29
30 sleep(Duration::from_secs(2)).await;
31 }
32 }
33}