Go to the source code of this file.
#define GPIO_ATOMIC |
( |
|
expr | ) |
|
Value:do { \
expr; \
} \
else { \
uint8_t sreg = SREG; \
__asm__ __volatile__("cli" ::: "memory"); \
expr; \
SREG = sreg; \
__asm__ __volatile__("" ::: "memory"); \
} \
} while (0)
Forces given expression to be atomic. Higher port addresses cannot be accessed with a single instruction and require disabling of interrupts to become atomic.
- Parameters
-
[in] | expr | expression to be atomic. |
Definition at line 51 of file Board.h.
#define GPIO_ATOMIC_MAX GPIO_PIN(0x40,0) |
Maximum port control register address for atomic bit instructions.
Definition at line 43 of file Board.h.
#define GPIO_MASK |
( |
|
pin | ) |
_BV((pin) & 0xf) |
Return pin mask from board pin value.
- Returns
- pin mask
Definition at line 40 of file Board.h.
#define GPIO_PIN |
( |
|
port, |
|
|
|
pin |
|
) |
| (((port) << 4) | (pin)) |
Board pin values are bit-pointers and constructed from port control register address and pin bit position.
- Parameters
-
[in] | port | control register address. |
[in] | pin | pin bit position in control register. |
Definition at line 28 of file Board.h.
#define GPIO_REG |
( |
|
pin | ) |
((pin) >> 4) |
Return port control register address from board pin value.
- Returns
- io port address
Definition at line 34 of file Board.h.