I'm new to bit operations and trying to experiment little bit.
let's say I have a 32 bit register which is constructed as follows:
Bit 31:12 RESERVED
Bit 11 CONFIG1
Bit 10 CONFIG2
Bit 9:0 DATA
There exists already a Function to write data into the register:
#define WR_REG_32(address, value) (*((volatile u32 *)(address)) = (value))
I would like to write the value 0x0 at Bit 10 (CONFIG2). The value should be in the format like for example:
0x00005000
So, how to know what hex value to use in order to write to Bit 10 the value 0x0 without touching the other bits?
Also, what is the easiest way to read from the 32 bit register only the values from bit 0 - 9 ?