 |
poke_bset |
Function (Macro) |
Sets a bit at a memory address.
This macro sets bit bit at memory address addr, which can
be any which which may be cast to unsigned char *
.
It is useful if you do not want to store a whole byte at this address, but only
need to set a single bit to 1.
As usual, the rightmost bit of a value is numbered 0, and the leftmost bit is
7 in this case.
For example, let's assume the address addr contains the value 0b10010010,
and you call this macro like this:
poke_bset (addr, 3);
Then the value will be 0b10011010 afterwards.
Note: Do not use poke_bset for sending bits to I/O ports! Use pokeIO_bset
instead.