BPLightContraption
 All Classes Namespaces Files Functions Variables Macros Pages
Macros
bits.h File Reference

Macros to make bit manipulation easier. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define bit_get(p, m)   ((p) & (0x01 << m))
 
#define bit_set(p, m)   ((p) |= (0x01 << m))
 
#define bit_clear(p, m)   ((p) &= ~(0x01 << m))
 
#define bit_flip(p, m)   ((p) ^= (0x01 << m))
 
#define BIT(x)   (0x01 << (x))
 

Detailed Description

Macros to make bit manipulation easier.

Author
Benjamin Pritchard (ben@b.nosp@m.enny.nosp@m.p.org)

Definition in file bits.h.

Macro Definition Documentation

#define BIT (   x)    (0x01 << (x))

Convert a bit position to a bit

Definition at line 23 of file bits.h.

#define bit_clear (   p,
 
)    ((p) &= ~(0x01 << m))

Clear bit m in register p

Definition at line 17 of file bits.h.

#define bit_flip (   p,
 
)    ((p) ^= (0x01 << m))

Flip or toggle bit m in register p

Definition at line 20 of file bits.h.

#define bit_get (   p,
 
)    ((p) & (0x01 << m))

Get bit m in register p

Definition at line 11 of file bits.h.

#define bit_set (   p,
 
)    ((p) |= (0x01 << m))

Set bit m in register p

Definition at line 14 of file bits.h.