author | Tero Marttila <terom@paivola.fi> |
Thu, 29 Jan 2015 23:11:44 +0200 | |
changeset 107 | 05707929ff6f |
parent 58 | a445e08b63e0 |
permissions | -rw-r--r-- |
49 | 1 |
#define false 0 |
2 |
#define true 1 |
|
3 |
||
58
a445e08b63e0
hello-lkm: Control the JY-LKM1638 LED 7-segment display module
Tero Marttila <terom@paivola.fi>
parents:
52
diff
changeset
|
4 |
typedef uint8_t byte; |
a445e08b63e0
hello-lkm: Control the JY-LKM1638 LED 7-segment display module
Tero Marttila <terom@paivola.fi>
parents:
52
diff
changeset
|
5 |
|
49 | 6 |
typedef volatile uint8_t ioport_t; |
7 |
||
8 |
static inline ioport_t tbi(ioport_t *port, int bit) |
|
9 |
{ |
|
10 |
return *port & (1 << bit); |
|
11 |
} |
|
12 |
||
13 |
static inline void sbi(ioport_t *port, int bit) |
|
14 |
{ |
|
15 |
*port |= (1 << bit); |
|
16 |
} |
|
17 |
||
18 |
static inline void cbi(ioport_t *port, int bit) |
|
19 |
{ |
|
20 |
*port &= ~(1 << bit); |
|
21 |
} |
|
22 |
||
23 |
static inline void xbi(ioport_t *port, int bit) |
|
24 |
{ |
|
25 |
*port ^= (1 << bit); |
|
26 |
} |