aboutsummaryrefslogtreecommitdiffstats
path: root/fw/types.h
blob: ccdf0ae32835a07527081ec605ea39972125b912 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Device: PIC16F1459
 * Compiler: XC8 v3.00
 *
 * Usage:
 *
 * #include <stdint.h>
 * #include "types.h"
 */

typedef enum {
	OK,
	FAIL,
} Status;

typedef uint8_t U8;

typedef struct {
	U8 hi, lo;
} U16;

// Little-endian 32-bit unsigned integer.
typedef U8 U32[4];

// *a = *a+b
void addU16(U16 *a, U8 b);

// *a = *a<<b
void lshiftU16(U16 *a, U8 b);