The STM32 GPIO bit set/reset register (BSRR) changes selected output bits with one write, without first reading the port. This avoids the read-modify-write races that can occur when updating the Output Data Register (ODR). section 5.3.1 section 5.2.2
Set a pin through a raw register write
Writing 1 << 0 to BSRR sets PA0. The raw-pointer approach requires a valid device address and correct peripheral setup; the example uses a volatile write. section 5.3.1
gpioc.bsrr().write(|w| w.br13().set_bit());
A generated Peripheral Access Crate (PAC) can express a BSRR write through named register fields. section 5.3.3
BSRR writes can set or reset multiple pins at once. Use the register’s write operation for these updates; unlike modify, it does not read the current register value first. section 5.3.3
