aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/i2c_shared.rs
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2025-06-11 05:09:08 +0000
committerGitHub <[email protected]>2025-06-11 05:09:08 +0000
commit56572ef0adffd6258adc10fb424e37a8b4ddc19c (patch)
tree5cacb71ceca12180e95031791c93c53e83bca307 /examples/stm32h7/src/bin/i2c_shared.rs
parent6186d111a5c150946ee5b7e9e68d987a38c1a463 (diff)
parent4efb3b4f3f0178b98ea25f3957393ab6977c89de (diff)
Merge pull request #2909 from jrmoulton/i2c-slave-new
stm32 i2c slave
Diffstat (limited to 'examples/stm32h7/src/bin/i2c_shared.rs')
-rw-r--r--examples/stm32h7/src/bin/i2c_shared.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/stm32h7/src/bin/i2c_shared.rs b/examples/stm32h7/src/bin/i2c_shared.rs
index 136b91eeb..655ff901f 100644
--- a/examples/stm32h7/src/bin/i2c_shared.rs
+++ b/examples/stm32h7/src/bin/i2c_shared.rs
@@ -25,7 +25,7 @@ const SHTC3_WAKEUP: [u8; 2] = [0x35, 0x17];
25const SHTC3_MEASURE_RH_FIRST: [u8; 2] = [0x5c, 0x24]; 25const SHTC3_MEASURE_RH_FIRST: [u8; 2] = [0x5c, 0x24];
26const SHTC3_SLEEP: [u8; 2] = [0xb0, 0x98]; 26const SHTC3_SLEEP: [u8; 2] = [0xb0, 0x98];
27 27
28static I2C_BUS: StaticCell<NoopMutex<RefCell<I2c<'static, Async>>>> = StaticCell::new(); 28static I2C_BUS: StaticCell<NoopMutex<RefCell<I2c<'static, Async, i2c::Master>>>> = StaticCell::new();
29 29
30bind_interrupts!(struct Irqs { 30bind_interrupts!(struct Irqs {
31 I2C1_EV => i2c::EventInterruptHandler<peripherals::I2C1>; 31 I2C1_EV => i2c::EventInterruptHandler<peripherals::I2C1>;
@@ -33,7 +33,7 @@ bind_interrupts!(struct Irqs {
33}); 33});
34 34
35#[embassy_executor::task] 35#[embassy_executor::task]
36async fn temperature(mut i2c: I2cDevice<'static, NoopRawMutex, I2c<'static, Async>>) { 36async fn temperature(mut i2c: I2cDevice<'static, NoopRawMutex, I2c<'static, Async, i2c::Master>>) {
37 let mut data = [0u8; 2]; 37 let mut data = [0u8; 2];
38 38
39 loop { 39 loop {
@@ -50,7 +50,7 @@ async fn temperature(mut i2c: I2cDevice<'static, NoopRawMutex, I2c<'static, Asyn
50} 50}
51 51
52#[embassy_executor::task] 52#[embassy_executor::task]
53async fn humidity(mut i2c: I2cDevice<'static, NoopRawMutex, I2c<'static, Async>>) { 53async fn humidity(mut i2c: I2cDevice<'static, NoopRawMutex, I2c<'static, Async, i2c::Master>>) {
54 let mut data = [0u8; 6]; 54 let mut data = [0u8; 6];
55 55
56 loop { 56 loop {