aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h5/src
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-01-03 17:44:26 +0000
committerGitHub <[email protected]>2025-01-03 17:44:26 +0000
commite68efc2d7cdea195aec112ecb61231e148a282c2 (patch)
tree4c640afd25b54be360db721c765b87abac1e05d1 /examples/stm32h5/src
parentb127ca9844a7e4e9079800be81d173e2725066c6 (diff)
parenteba8089601450fdf2a666f3d3316c8412cadf470 (diff)
Merge pull request #3714 from elagil/stm32h5_ucpd_example
Fix/clean up STM32H5 UCPD example
Diffstat (limited to 'examples/stm32h5/src')
-rw-r--r--examples/stm32h5/src/bin/usb_c_pd.rs7
1 files changed, 4 insertions, 3 deletions
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);