(low priority) demo-stm32h7-nucleo question - bsrr set_bit() #2033
-
Looking at I see the same Looking at the H7 reference manual (H755 but should be close enough)
I think this is the implementation of If so, what's the objective of the I'm just trying to understand what the "demo" is actually demoing :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Look at commit
This was added for profiling support |
Beta Was this translation helpful? Give feedback.
Those set two separate bits: "BS" vs "BR".
w
is the argument to the closure, and is a BSRR as in https://github.com/stm32-rs/stm32-rs-nightlies/blob/master/stm32f3/src/stm32f373/gpioa/bsrr.rs.In the code snippet you highlighted above, if
addr
has the low bit set, set w's bs2, otherwise, set br2. Writing a 1 to bs2 (e.g., viabs2.set_bit()
) sets pin 2, thus turning it on; similarly, writing a 1 to br2 resets the pin, thus turning it off.