-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sys.h
41 lines (35 loc) · 1.27 KB
/
Sys.h
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
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef _SYS_H_
#define _SYS_H_
//#include "iostm8s208r8.h"
#include "iostm8s003f3.h"
typedef unsigned char UINT8;
typedef unsigned int UINT16;
typedef unsigned long UINT32;
typedef unsigned char BOOL;
#define TRUE 1
#define FALSE 0
//SET BIT. Example: a |= SETBIT0
enum
{
SETBIT0 = 0x0001, SETBIT1 = 0x0002, SETBIT2 = 0x0004, SETBIT3 = 0x0008,
SETBIT4 = 0x0010, SETBIT5 = 0x0020, SETBIT6 = 0x0040, SETBIT7 = 0x0080,
SETBIT8 = 0x0100, SETBIT9 = 0x0200, SETBIT10 = 0x0400, SETBIT11 = 0x0800,
SETBIT12 = 0x1000, SETBIT13 = 0x2000, SETBIT14 = 0x4000, SETBIT15 = 0x8000
};
//CLR BIT. Example: a &= CLRBIT0
enum
{
CLRBIT0 = 0xFFFE, CLRBIT1 = 0xFFFD, CLRBIT2 = 0xFFFB, CLRBIT3 = 0xFFF7,
CLRBIT4 = 0xFFEF, CLRBIT5 = 0xFFDF, CLRBIT6 = 0xFFBF, CLRBIT7 = 0xFF7F,
CLRBIT8 = 0xFEFF, CLRBIT9 = 0xFDFF, CLRBIT10 = 0xFBFF, CLRBIT11 = 0xF7FF,
CLRBIT12 = 0xEFFF, CLRBIT13 = 0xDFFF, CLRBIT14 = 0xBFFF, CLRBIT15 = 0x7FFF
};
//CHOSE BIT. Example: a = b&CHSBIT0
enum
{
CHSBIT0 = 0x0001, CHSBIT1 = 0x0002, CHSBIT2 = 0x0004, CHSBIT3 = 0x0008,
CHSBIT4 = 0x0010, CHSBIT5 = 0x0020, CHSBIT6 = 0x0040, CHSBIT7 = 0x0080,
CHSBIT8 = 0x0100, CHSBIT9 = 0x0200, CHSBIT10 = 0x0400, CHSBIT11 = 0x0800,
CHSBIT12 = 0x1000, CHSBIT13 = 0x2000, CHSBIT14 = 0x4000, CHSBIT15 = 0x8000
};
#endif