On the GPIOs of some ARM-based microcontrollers, you are given a register BSRR which you can write to to perform atomic changes in a ports output register.
For example, to set Port A Bit 5 to a 1 you simply do GPIOA->BSRR = (1<<5)
This alleviates the problem of atomicity so you do not have to perform a read-modify-write sequence. Without the BSRR you would have to do GPIOA->ODR |= (1<<5).
How does the BSRR register work under the hood? Does it clear itself so that the next time you want to set a bit there isn't the previous bit still lying around.
If i wanted to set bit 2 and later on set bit 6 i can do first GPIOA->BSRR = (1<<2) and then later on do GPIOA->BSRR = (1<<6) but won't bit 2 still be set from my previous call?
