Repository navigation
(low priority) demo-stm32h7-nucleo question - bsrr set_bit() #2033
Answered
by
dancrossnyc
SandyWalsh
asked this question in
Q&A
|
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 :) |
Answered by
dancrossnyc
Mar 19, 2025
Replies: 1 comment 4 replies
|
Look at commit This was added for profiling support |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Those set two separate bits: "BS" vs "BR".
wis 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
addrhas 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.