0
|
1 |
#ifndef QMSK_ARDUINO_STDLIB_H
|
|
2 |
#define QMSK_ARDUINO_STDLIB_H
|
|
3 |
|
4
|
4 |
#include <stdint.h>
|
|
5 |
|
0
|
6 |
#define false 0
|
|
7 |
#define true 1
|
|
8 |
|
|
9 |
typedef uint8_t byte;
|
|
10 |
|
|
11 |
typedef volatile uint8_t ioport_t;
|
|
12 |
|
|
13 |
static inline ioport_t tbi(ioport_t *port, int bit)
|
|
14 |
{
|
|
15 |
return *port & (1 << bit);
|
|
16 |
}
|
|
17 |
|
|
18 |
static inline void sbi(ioport_t *port, int bit)
|
|
19 |
{
|
|
20 |
*port |= (1 << bit);
|
|
21 |
}
|
|
22 |
|
|
23 |
static inline void cbi(ioport_t *port, int bit)
|
|
24 |
{
|
|
25 |
*port &= ~(1 << bit);
|
|
26 |
}
|
|
27 |
|
|
28 |
static inline void xbi(ioport_t *port, int bit)
|
|
29 |
{
|
|
30 |
*port ^= (1 << bit);
|
|
31 |
}
|
|
32 |
|
|
33 |
#endif
|