Dual ADC library
bit.h@1:4e6619093761, 2013-12-15 (annotated)
- Committer:
- henryeherman
- Date:
- Sun Dec 15 02:42:30 2013 +0000
- Revision:
- 1:4e6619093761
- Parent:
- 0:b58572ce83b6
Working Dual ADC library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
henryeherman | 0:b58572ce83b6 | 1 | #ifndef BIT_H |
henryeherman | 0:b58572ce83b6 | 2 | #define BIT_H |
henryeherman | 0:b58572ce83b6 | 3 | |
henryeherman | 0:b58572ce83b6 | 4 | #define BIT(x) (1 << (x)) |
henryeherman | 0:b58572ce83b6 | 5 | #define SETBITS(x,y) ((x) |= (y)) |
henryeherman | 0:b58572ce83b6 | 6 | #define CLEARBITS(x,y) ((x) &= (~(y))) |
henryeherman | 0:b58572ce83b6 | 7 | #define SETBIT(x,y) SETBITS((x), (BIT((y)))) |
henryeherman | 0:b58572ce83b6 | 8 | #define CLEARBIT(x,y) CLEARBITS((x), (BIT((y)))) |
henryeherman | 0:b58572ce83b6 | 9 | #define BITSET(x,y) ((x) & (BIT(y))) |
henryeherman | 0:b58572ce83b6 | 10 | #define BITCLEAR(x,y) !BITSET((x), (y)) |
henryeherman | 0:b58572ce83b6 | 11 | #define BITSSET(x,y) (((x) & (y)) == (y)) |
henryeherman | 0:b58572ce83b6 | 12 | #define BITSCLEAR(x,y) (((x) & (y)) == 0) |
henryeherman | 0:b58572ce83b6 | 13 | #define BITVAL(x,y) (((x)>>(y)) & 1) |
henryeherman | 0:b58572ce83b6 | 14 | |
henryeherman | 0:b58572ce83b6 | 15 | #endif //BIT_H |