Dual DAC library
bit.h
- Committer:
- henryeherman
- Date:
- 2013-12-15
- Revision:
- 1:277e5be610bc
- Parent:
- 0:b58572ce83b6
File content as of revision 1:277e5be610bc:
#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