aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Kröger <[email protected]>2024-03-12 20:40:00 +0100
committerTimo Kröger <[email protected]>2024-03-14 21:55:05 +0100
commit6e5bb8003acf98e20592dd1e86fc1a5f1928e14f (patch)
tree3dbb16227f8a709f21355d0575cda629854f7a15
parente95e95ac7a00ca014b23f6ac57ecffce7fc6ffa0 (diff)
[UCPD] Adjust TX clock divider
-rw-r--r--embassy-stm32/src/ucpd.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/embassy-stm32/src/ucpd.rs b/embassy-stm32/src/ucpd.rs
index b7af877b7..01cf42672 100644
--- a/embassy-stm32/src/ucpd.rs
+++ b/embassy-stm32/src/ucpd.rs
@@ -112,10 +112,8 @@ impl<'d, T: Instance> Ucpd<'d, T> {
112 // Prescaler to produce a target half-bit frequency of 600kHz which is required 112 // Prescaler to produce a target half-bit frequency of 600kHz which is required
113 // to produce transmit with a nominal nominal bit rate of 300Kbps+-10% using 113 // to produce transmit with a nominal nominal bit rate of 300Kbps+-10% using
114 // biphase mark coding (BMC, aka differential manchester coding). 114 // biphase mark coding (BMC, aka differential manchester coding).
115 // A divider of 13 gives the target frequency closest to spec (~615kHz, 1.625us) 115 // A divider of 13 gives the target frequency closest to spec (~615kHz, 1.625us).
116 // but we go with the (hopefully well tested) default value used by the Cube HAL 116 w.set_hbitclkdiv(13 - 1);
117 // which is 14 divides the clock down to ~571kHz, 1.75us.
118 w.set_hbitclkdiv(14 - 1);
119 117
120 // Time window for detecting non-idle (12-20us). 118 // Time window for detecting non-idle (12-20us).
121 // 1.75us * 8 = 14us. 119 // 1.75us * 8 = 14us.