 |
EPPL
0.1 alpha
|
|
Go to the documentation of this file.
39 #ifndef EPPL_AVR8_H_INCLUDED
40 #define EPPL_AVR8_H_INCLUDED
43 #include <avr/interrupt.h>
65 #define EPPL_avr8_PORTSIZE 8L
68 #define EPPL_avr8_PORTCNT 12
71 #define NULL ((void*)0)
85 #define _PA(n) EPPL_DEFPP( 0, n)
89 #define _PB(n) EPPL_DEFPP( 1, n)
93 #define _PC(n) EPPL_DEFPP( 2, n)
97 #define _PD(n) EPPL_DEFPP( 3, n)
101 #define _PE(n) EPPL_DEFPP( 4, n)
105 #define _PF(n) EPPL_DEFPP( 5, n)
109 #define _PG(n) EPPL_DEFPP( 6, n)
113 #define _PH(n) EPPL_DEFPP( 7, n)
117 #define _PI(n) EPPL_DEFPP( 8, n)
121 #define _PJ(n) EPPL_DEFPP( 9, n)
125 #define _PK(n) EPPL_DEFPP(10, n)
129 #define _PL(n) EPPL_DEFPP(11, n)
153 #define EPPL_mode_mask (0x0f << 2)
156 #define EPPL_mode_flag (0x08 << 2)
159 #define EPPL_outSet_mask 0x03
162 #define EPPL_outSet_value 0x01
165 #define EPPL_outSet_flag 0x02
172 #define EPPL_mode_out (0x04 << 2)
183 #define EPPL_mode_outPP (EPPL_mode_flag | EPPL_mode_out | (0x00 << 2))
192 #define EPPL_mode_outOC (EPPL_mode_flag | EPPL_mode_out | (0x01 << 2))
200 #define EPPL_mode_outOE (EPPL_mode_flag | EPPL_mode_out | (0x02 << 2))
208 #define EPPL_mode_outPU (EPPL_mode_flag | EPPL_mode_out | (0x03 << 2))
216 #define EPPL_mode_inHZ (EPPL_mode_flag | EPPL_outSet_0)
223 #define EPPL_mode_inPU (EPPL_mode_flag | EPPL_outSet_1)
231 #define EPPL_outSet_0 (EPPL_outSet_flag | 0)
238 #define EPPL_outSet_1 (EPPL_outSet_flag | 1)
243 #define EPPL_configBits 6
248 #define EPPL_avr8_CONFSIZE (1U<<(EPPL_configBits))
258 #define EPPL_mode_outPP_0 (EPPL_mode_outPP | EPPL_outSet_0)
259 #define EPPL_mode_outPP_1 (EPPL_mode_outPP | EPPL_outSet_1)
261 #define EPPL_mode_outOC_0 (EPPL_mode_outOC | EPPL_outSet_0)
262 #define EPPL_mode_outOC_1 (EPPL_mode_outOC | EPPL_outSet_1)
264 #define EPPL_mode_outOE_0 (EPPL_mode_outOE | EPPL_outSet_0)
265 #define EPPL_mode_outOE_1 (EPPL_mode_outOE | EPPL_outSet_1)
267 #define EPPL_mode_outPU_0 (EPPL_mode_outPU | EPPL_outSet_0)
268 #define EPPL_mode_outPU_1 (EPPL_mode_outPU | EPPL_outSet_1)
284 #define eppl_avr8_LockableBlockBegin(lock) \
286 uint8_t lockableblock_sreg_copy=lockableblock_sreg_copy; \
288 lockableblock_sreg_copy = SREG; \
301 #define eppl_avr8_LockableBlockEnd(locked) \
304 SREG = lockableblock_sreg_copy; \