-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.h
142 lines (129 loc) · 4.89 KB
/
io.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#ifndef _IO_H_INCLUDED_
#define _IO_H_INCLUDED_
#define ANSELA *((volatile unsigned int *)0xBF886000)
#define TRISA *((volatile unsigned int *)0xBF886010)
#define LATA *((volatile unsigned int *)0xBF886030)
#define LATACLR *((volatile unsigned int *)0xBF886034)
#define LATASET *((volatile unsigned int *)0xBF886038)
#define LATAINV *((volatile unsigned int *)0xBF88603C)
#define ANSELB *((volatile unsigned int *)0xBF886100)
#define TRISB *((volatile unsigned int *)0xBF886110)
#define LATB *((volatile unsigned int *)0xBF886130)
#define LATBCLR *((volatile unsigned int *)0xBF886134)
#define LATBSET *((volatile unsigned int *)0xBF886138)
#define LATBINV *((volatile unsigned int *)0xBF88613C)
//PORTA
#define PIC_TRISA_RA0_SET_INPUT (1<<0)
#define PIC_TRISA_RA1_SET_INPUT (1<<1)
#define PIC_TRISA_RA2_SET_INPUT (1<<2)
#define PIC_TRISA_RA3_SET_INPUT (1<<3)
#define PIC_TRISA_RA4_SET_INPUT (1<<4)
#define PIC_TRISA_RA5_SET_INPUT (1<<5)
#define PIC_TRISA_RA6_SET_INPUT (1<<6)
#define PIC_TRISA_RA7_SET_INPUT (1<<7)
#define PIC_TRISA_RA8_SET_INPUT (1<<8)
#define PIC_TRISA_RA9_SET_INPUT (1<<9)
#define PIC_TRISA_RA10_SET_INPUT (1<<10)
#define PIC_TRISA_RA11_SET_INPUT (1<<11)
#define PIC_TRISA_RA12_SET_INPUT (1<<12)
#define PIC_TRISA_RA13_SET_INPUT (1<<13)
#define PIC_TRISA_RA14_SET_INPUT (1<<14)
#define PIC_TRISA_RA15_SET_INPUT (1<<15)
#define PIC_LATA_RA0_SET_HIGH (1<<0)
#define PIC_LATA_RA1_SET_HIGH (1<<1)
#define PIC_LATA_RA2_SET_HIGH (1<<2)
#define PIC_LATA_RA3_SET_HIGH (1<<3)
#define PIC_LATA_RA4_SET_HIGH (1<<4)
#define PIC_LATA_RA5_SET_HIGH (1<<5)
#define PIC_LATA_RA6_SET_HIGH (1<<6)
#define PIC_LATA_RA7_SET_HIGH (1<<7)
#define PIC_LATA_RA8_SET_HIGH (1<<8)
#define PIC_LATA_RA9_SET_HIGH (1<<9)
#define PIC_LATA_RA10_SET_HIGH (1<<10)
#define PIC_LATA_RA11_SET_HIGH (1<<11)
#define PIC_LATA_RA12_SET_HIGH (1<<12)
#define PIC_LATA_RA13_SET_HIGH (1<<13)
#define PIC_LATA_RA14_SET_HIGH (1<<14)
#define PIC_LATA_RA15_SET_HIGH (1<<15)
#define LATA0 PIC_LATA_RA0_SET_HIGH
#define LATA1 PIC_LATA_RA1_SET_HIGH
#define LATA2 PIC_LATA_RA2_SET_HIGH
#define LATA3 PIC_LATA_RA3_SET_HIGH
#define LATA4 PIC_LATA_RA4_SET_HIGH
#define LATA5 PIC_LATA_RA5_SET_HIGH
#define LATA6 PIC_LATA_RA6_SET_HIGH
#define LATA7 PIC_LATA_RA7_SET_HIGH
#define LATA8 PIC_LATA_RA8_SET_HIGH
#define LATA9 PIC_LATA_RA9_SET_HIGH
#define LATA10 PIC_LATA_RA10_SET_HIGH
#define LATA11 PIC_LATA_RA11_SET_HIGH
#define LATA12 PIC_LATA_RA12_SET_HIGH
#define LATA13 PIC_LATA_RA13_SET_HIGH
#define LATA14 PIC_LATA_RA14_SET_HIGH
#define LATA15 PIC_LATA_RA15_SET_HIGH
#define LATA0 PIC_LATA_RA0_SET_HIGH
#define LATA1 PIC_LATA_RA1_SET_HIGH
#define LATA2 PIC_LATA_RA2_SET_HIGH
#define LATA3 PIC_LATA_RA3_SET_HIGH
#define LATA4 PIC_LATA_RA4_SET_HIGH
#define LATA5 PIC_LATA_RA5_SET_HIGH
#define LATA6 PIC_LATA_RA6_SET_HIGH
#define LATA7 PIC_LATA_RA7_SET_HIGH
#define LATA8 PIC_LATA_RA8_SET_HIGH
#define LATA9 PIC_LATA_RA9_SET_HIGH
#define LATA10 PIC_LATA_RA10_SET_HIGH
#define LATA11 PIC_LATA_RA11_SET_HIGH
#define LATA12 PIC_LATA_RA12_SET_HIGH
#define LATA13 PIC_LATA_RA13_SET_HIGH
#define LATA14 PIC_LATA_RA14_SET_HIGH
#define LATA15 PIC_LATA_RA15_SET_HIGH
//PORTB
#define PIC_TRISB_RB0_SET_INPUT (1<<0)
#define PIC_TRISB_RB1_SET_INPUT (1<<1)
#define PIC_TRISB_RB2_SET_INPUT (1<<2)
#define PIC_TRISB_RB3_SET_INPUT (1<<3)
#define PIC_TRISB_RB4_SET_INPUT (1<<4)
#define PIC_TRISB_RB5_SET_INPUT (1<<5)
#define PIC_TRISB_RB6_SET_INPUT (1<<6)
#define PIC_TRISB_RB7_SET_INPUT (1<<7)
#define PIC_TRISB_RB8_SET_INPUT (1<<8)
#define PIC_TRISB_RB9_SET_INPUT (1<<9)
#define PIC_TRISB_RB10_SET_INPUT (1<<10)
#define PIC_TRISB_RB11_SET_INPUT (1<<11)
#define PIC_TRISB_RB12_SET_INPUT (1<<12)
#define PIC_TRISB_RB13_SET_INPUT (1<<13)
#define PIC_TRISB_RB14_SET_INPUT (1<<14)
#define PIC_TRISB_RB15_SET_INPUT (1<<15)
#define PIC_LATB_RB0_SET_HIGH (1<<0)
#define PIC_LATB_RB1_SET_HIGH (1<<1)
#define PIC_LATB_RB2_SET_HIGH (1<<2)
#define PIC_LATB_RB3_SET_HIGH (1<<3)
#define PIC_LATB_RB4_SET_HIGH (1<<4)
#define PIC_LATB_RB5_SET_HIGH (1<<5)
#define PIC_LATB_RB6_SET_HIGH (1<<6)
#define PIC_LATB_RB7_SET_HIGH (1<<7)
#define PIC_LATB_RB8_SET_HIGH (1<<8)
#define PIC_LATB_RB9_SET_HIGH (1<<9)
#define PIC_LATB_RB10_SET_HIGH (1<<10)
#define PIC_LATB_RB11_SET_HIGH (1<<11)
#define PIC_LATB_RB12_SET_HIGH (1<<12)
#define PIC_LATB_RB13_SET_HIGH (1<<13)
#define PIC_LATB_RB14_SET_HIGH (1<<14)
#define PIC_LATB_RB15_SET_HIGH (1<<15)
#define LATB0 PIC_LATB_RB0_SET_HIGH
#define LATB1 PIC_LATB_RB1_SET_HIGH
#define LATB2 PIC_LATB_RB2_SET_HIGH
#define LATB3 PIC_LATB_RB3_SET_HIGH
#define LATB4 PIC_LATB_RB4_SET_HIGH
#define LATB5 PIC_LATB_RB5_SET_HIGH
#define LATB6 PIC_LATB_RB6_SET_HIGH
#define LATB7 PIC_LATB_RB7_SET_HIGH
#define LATB8 PIC_LATB_RB8_SET_HIGH
#define LATB9 PIC_LATB_RB9_SET_HIGH
#define LATB10 PIC_LATB_RB10_SET_HIGH
#define LATB11 PIC_LATB_RB11_SET_HIGH
#define LATB12 PIC_LATB_RB12_SET_HIGH
#define LATB13 PIC_LATB_RB13_SET_HIGH
#define LATB14 PIC_LATB_RB14_SET_HIGH
#define LATB15 PIC_LATB_RB15_SET_HIGH
#endif