|
Revision 942, 1.8 kB
(checked in by chunter, 3 months ago)
|
|
adding userio
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | #ifndef USERIO_H |
|---|
| 12 | #define USERIO_H |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | #define USERIO_CHAN_INPUTS 1 |
|---|
| 16 | #define USERIO_MASK_DIPSW 0x3C000 |
|---|
| 17 | #define USERIO_MASK_PB 0x03C00 |
|---|
| 18 | #define USERIO_MASK_PBC 0x00400 |
|---|
| 19 | #define USERIO_MASK_PBR 0x00800 |
|---|
| 20 | #define USERIO_MASK_PBL 0x01000 |
|---|
| 21 | #define USERIO_MASK_PBU 0x02000 |
|---|
| 22 | #define USERIO_MASK_INPUTS (USERIO_MASK_DIPSW | USERIO_MASK_PB) |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | #define USERIO_OFFSET_DIPSW 14 |
|---|
| 26 | #define USERIO_OFFSET_PB 10 |
|---|
| 27 | |
|---|
| 28 | #define USERIO_MAP_DIPSW(x) ( (unsigned int)( (x & USERIO_MASK_DIPSW) >> USERIO_OFFSET_DIPSW) ) |
|---|
| 29 | #define USERIO_MAP_PB(x) ( (unsigned int)( (x & USERIO_MASK_PB) >> USERIO_OFFSET_PB) ) |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | #define USERIO_CHAN_OUTPUTS 2 |
|---|
| 33 | #define USERIO_MASK_DISPR 0x0003F800 |
|---|
| 34 | #define USERIO_MASK_DISPL 0x000007F0 |
|---|
| 35 | #define USERIO_MASK_LEDS 0x0000000F |
|---|
| 36 | #define USERIO_MASK_OUTPUTS (USERIO_MASK_DISPL | USERIO_MASK_DISPR | USERIO_MASK_LEDS) |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | #define USERIO_OFFSET_DISPR 11 |
|---|
| 40 | #define USERIO_OFFSET_DISPL 4 |
|---|
| 41 | #define USERIO_OFFSET_LEDS 0 |
|---|
| 42 | |
|---|
| 43 | #define USERIO_MAP_DISPR(x) ( (unsigned int)(USERIO_MASK_DISPR & ( (unsigned int)x << USERIO_OFFSET_DISPR)) ) |
|---|
| 44 | #define USERIO_MAP_DISPL(x) ( (unsigned int)(USERIO_MASK_DISPL & ( (unsigned int)x << USERIO_OFFSET_DISPL)) ) |
|---|
| 45 | #define USERIO_MAP_LEDS(x) ( (unsigned int)(USERIO_MASK_LEDS & ((unsigned int)x << USERIO_OFFSET_LEDS)) ) |
|---|
| 46 | |
|---|
| 47 | #endif //ifndef USERIO_H |
|---|