| author | Tero Marttila <terom@paivola.fi> |
| Fri, 04 Apr 2014 01:04:41 +0300 | |
| changeset 56 | 3b837eaf1b6d |
| parent 52 | 237d1f5c1c32 |
| child 58 | a445e08b63e0 |
| permissions | -rw-r--r-- |
| 49 | 1 |
#define false 0 |
2 |
#define true 1 |
|
3 |
||
4 |
typedef volatile uint8_t ioport_t; |
|
5 |
||
6 |
static inline ioport_t tbi(ioport_t *port, int bit) |
|
7 |
{
|
|
8 |
return *port & (1 << bit); |
|
9 |
} |
|
10 |
||
11 |
static inline void sbi(ioport_t *port, int bit) |
|
12 |
{
|
|
13 |
*port |= (1 << bit); |
|
14 |
} |
|
15 |
||
16 |
static inline void cbi(ioport_t *port, int bit) |
|
17 |
{
|
|
18 |
*port &= ~(1 << bit); |
|
19 |
} |
|
20 |
||
21 |
static inline void xbi(ioport_t *port, int bit) |
|
22 |
{
|
|
23 |
*port ^= (1 << bit); |
|
24 |
} |