bitWrite source code

Does anyone know where can I find Arduino source code for bitWrite, bitClear and bitSet so I can use them in my c code file in Linux environment. Thanks a lot!

They’d be damned simple to write yourself, but if you really want the Arduino implementation then they’re in Arduino.h in the core.

Here they are:

#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))

They are all macros and not functions.