diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32f469/src/bin/dsi_bsp.rs | 14 | ||||
| -rw-r--r-- | examples/stm32h5/src/bin/usb_c_pd.rs | 7 |
2 files changed, 11 insertions, 10 deletions
diff --git a/examples/stm32f469/src/bin/dsi_bsp.rs b/examples/stm32f469/src/bin/dsi_bsp.rs index e4e9e9c01..3a24d5dcf 100644 --- a/examples/stm32f469/src/bin/dsi_bsp.rs +++ b/examples/stm32f469/src/bin/dsi_bsp.rs | |||
| @@ -363,20 +363,20 @@ async fn main(_spawner: Spawner) { | |||
| 363 | const _PCPOLARITY: bool = false; // LTDC_PCPOLARITY_IPC == 0 | 363 | const _PCPOLARITY: bool = false; // LTDC_PCPOLARITY_IPC == 0 |
| 364 | 364 | ||
| 365 | const LTDC_DE_POLARITY: Depol = if !DE_POLARITY { | 365 | const LTDC_DE_POLARITY: Depol = if !DE_POLARITY { |
| 366 | Depol::ACTIVELOW | 366 | Depol::ACTIVE_LOW |
| 367 | } else { | 367 | } else { |
| 368 | Depol::ACTIVEHIGH | 368 | Depol::ACTIVE_HIGH |
| 369 | }; | 369 | }; |
| 370 | const LTDC_VS_POLARITY: Vspol = if !VS_POLARITY { | 370 | const LTDC_VS_POLARITY: Vspol = if !VS_POLARITY { |
| 371 | Vspol::ACTIVEHIGH | 371 | Vspol::ACTIVE_HIGH |
| 372 | } else { | 372 | } else { |
| 373 | Vspol::ACTIVELOW | 373 | Vspol::ACTIVE_LOW |
| 374 | }; | 374 | }; |
| 375 | 375 | ||
| 376 | const LTDC_HS_POLARITY: Hspol = if !HS_POLARITY { | 376 | const LTDC_HS_POLARITY: Hspol = if !HS_POLARITY { |
| 377 | Hspol::ACTIVEHIGH | 377 | Hspol::ACTIVE_HIGH |
| 378 | } else { | 378 | } else { |
| 379 | Hspol::ACTIVELOW | 379 | Hspol::ACTIVE_LOW |
| 380 | }; | 380 | }; |
| 381 | 381 | ||
| 382 | /* Timing Configuration */ | 382 | /* Timing Configuration */ |
| @@ -397,7 +397,7 @@ async fn main(_spawner: Spawner) { | |||
| 397 | w.set_hspol(LTDC_HS_POLARITY); | 397 | w.set_hspol(LTDC_HS_POLARITY); |
| 398 | w.set_vspol(LTDC_VS_POLARITY); | 398 | w.set_vspol(LTDC_VS_POLARITY); |
| 399 | w.set_depol(LTDC_DE_POLARITY); | 399 | w.set_depol(LTDC_DE_POLARITY); |
| 400 | w.set_pcpol(Pcpol::RISINGEDGE); | 400 | w.set_pcpol(Pcpol::RISING_EDGE); |
| 401 | }); | 401 | }); |
| 402 | 402 | ||
| 403 | // Set Synchronization size | 403 | // Set Synchronization size |
diff --git a/examples/stm32h5/src/bin/usb_c_pd.rs b/examples/stm32h5/src/bin/usb_c_pd.rs index 00cb3b3da..acb03e498 100644 --- a/examples/stm32h5/src/bin/usb_c_pd.rs +++ b/examples/stm32h5/src/bin/usb_c_pd.rs | |||
| @@ -57,13 +57,14 @@ async fn main(_spawner: Spawner) { | |||
| 57 | 57 | ||
| 58 | info!("Hello World!"); | 58 | info!("Hello World!"); |
| 59 | 59 | ||
| 60 | let mut ucpd = Ucpd::new(p.UCPD1, Irqs {}, p.PB13, p.PB14, Default::default()); | ||
| 61 | ucpd.cc_phy().set_pull(CcPull::Sink); | ||
| 62 | |||
| 60 | // This pin controls the dead-battery mode on the attached TCPP01-M12. | 63 | // This pin controls the dead-battery mode on the attached TCPP01-M12. |
| 61 | // If low, TCPP01-M12 disconnects CC lines and presents dead-battery resistance on CC lines, thus set high. | 64 | // If low, TCPP01-M12 disconnects CC lines and presents dead-battery resistance on CC lines, thus set high. |
| 65 | // Must only be set after the CC pull is established. | ||
| 62 | let _tcpp01_m12_ndb = Output::new(p.PA9, embassy_stm32::gpio::Level::High, embassy_stm32::gpio::Speed::Low); | 66 | let _tcpp01_m12_ndb = Output::new(p.PA9, embassy_stm32::gpio::Level::High, embassy_stm32::gpio::Speed::Low); |
| 63 | 67 | ||
| 64 | let mut ucpd = Ucpd::new(p.UCPD1, Irqs {}, p.PB13, p.PB14, Default::default()); | ||
| 65 | ucpd.cc_phy().set_pull(CcPull::Sink); | ||
| 66 | |||
| 67 | info!("Waiting for USB connection..."); | 68 | info!("Waiting for USB connection..."); |
| 68 | let cable_orientation = wait_attached(ucpd.cc_phy()).await; | 69 | let cable_orientation = wait_attached(ucpd.cc_phy()).await; |
| 69 | info!("USB cable connected, orientation: {}", cable_orientation); | 70 | info!("USB cable connected, orientation: {}", cable_orientation); |
