Dual ADC library
Diff: bit.h
- Revision:
- 0:b58572ce83b6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bit.h Wed Aug 14 00:21:42 2013 +0000 @@ -0,0 +1,15 @@ +#ifndef BIT_H +#define BIT_H + +#define BIT(x) (1 << (x)) +#define SETBITS(x,y) ((x) |= (y)) +#define CLEARBITS(x,y) ((x) &= (~(y))) +#define SETBIT(x,y) SETBITS((x), (BIT((y)))) +#define CLEARBIT(x,y) CLEARBITS((x), (BIT((y)))) +#define BITSET(x,y) ((x) & (BIT(y))) +#define BITCLEAR(x,y) !BITSET((x), (y)) +#define BITSSET(x,y) (((x) & (y)) == (y)) +#define BITSCLEAR(x,y) (((x) & (y)) == 0) +#define BITVAL(x,y) (((x)>>(y)) & 1) + +#endif //BIT_H \ No newline at end of file