Most of the interface devices have various flag bits (that can also raise interrupts if that functionality is provided) used to check the status of the device/operation.
Usually they are cleared by writing a '1' to said bit.
Just some questions regarding this ...
Why are they cleared by writing a 1? I mean if the flag is already set to 1 by the device, won't it make sense to clear it by writing a 0 to it?
Lets say i have a 8 bit status register with bits distributed as (picked from datasheet of NRF24L01+)
If bit 5 (TX_DS) gets set (ie. turns to 1) and I want to clear it by writing 1 to it, what value do I write to the register.