Dual ADC library

Dependents:   elixys

Committer:
henryeherman
Date:
Wed Aug 14 00:21:42 2013 +0000
Revision:
0:b58572ce83b6
Initial commit of a library to communicate with the MCP482X SPI based DAC from microchip.

Who changed what in which revision?

UserRevisionLine numberNew 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