1 |
/** |
---|
2 |
@Generated Pin Manager Header File |
---|
3 |
|
---|
4 |
@Company: |
---|
5 |
Microchip Technology Inc. |
---|
6 |
|
---|
7 |
@File Name: |
---|
8 |
pin_manager.h |
---|
9 |
|
---|
10 |
@Summary: |
---|
11 |
This is the Pin Manager file generated using PIC10 / PIC12 / PIC16 / PIC18 MCUs |
---|
12 |
|
---|
13 |
@Description |
---|
14 |
This header file provides APIs for driver for . |
---|
15 |
Generation Information : |
---|
16 |
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65.2 |
---|
17 |
Device : PIC16F1579 |
---|
18 |
Driver Version : 2.11 |
---|
19 |
The generated drivers are tested against the following: |
---|
20 |
Compiler : XC8 1.45 |
---|
21 |
MPLAB : MPLAB X 4.15 |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
/* |
---|
25 |
(c) 2018 Microchip Technology Inc. and its subsidiaries. |
---|
26 |
|
---|
27 |
Subject to your compliance with these terms, you may use Microchip software and any |
---|
28 |
derivatives exclusively with Microchip products. It is your responsibility to comply with third party |
---|
29 |
license terms applicable to your use of third party software (including open source software) that |
---|
30 |
may accompany Microchip software. |
---|
31 |
|
---|
32 |
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER |
---|
33 |
EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY |
---|
34 |
IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS |
---|
35 |
FOR A PARTICULAR PURPOSE. |
---|
36 |
|
---|
37 |
IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, |
---|
38 |
INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND |
---|
39 |
WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP |
---|
40 |
HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO |
---|
41 |
THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL |
---|
42 |
CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT |
---|
43 |
OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS |
---|
44 |
SOFTWARE. |
---|
45 |
*/ |
---|
46 |
|
---|
47 |
#ifndef PIN_MANAGER_H |
---|
48 |
#define PIN_MANAGER_H |
---|
49 |
|
---|
50 |
#define INPUT 1 |
---|
51 |
#define OUTPUT 0 |
---|
52 |
|
---|
53 |
#define HIGH 1 |
---|
54 |
#define LOW 0 |
---|
55 |
|
---|
56 |
#define ANALOG 1 |
---|
57 |
#define DIGITAL 0 |
---|
58 |
|
---|
59 |
#define PULL_UP_ENABLED 1 |
---|
60 |
#define PULL_UP_DISABLED 0 |
---|
61 |
|
---|
62 |
// get/set UNUSED1 aliases |
---|
63 |
#define UNUSED1_TRIS TRISAbits.TRISA0 |
---|
64 |
#define UNUSED1_LAT LATAbits.LATA0 |
---|
65 |
#define UNUSED1_PORT PORTAbits.RA0 |
---|
66 |
#define UNUSED1_WPU WPUAbits.WPUA0 |
---|
67 |
#define UNUSED1_OD ODCONAbits.ODA0 |
---|
68 |
#define UNUSED1_ANS ANSELAbits.ANSA0 |
---|
69 |
#define UNUSED1_SetHigh() do { LATAbits.LATA0 = 1; } while(0) |
---|
70 |
#define UNUSED1_SetLow() do { LATAbits.LATA0 = 0; } while(0) |
---|
71 |
#define UNUSED1_Toggle() do { LATAbits.LATA0 = ~LATAbits.LATA0; } while(0) |
---|
72 |
#define UNUSED1_GetValue() PORTAbits.RA0 |
---|
73 |
#define UNUSED1_SetDigitalInput() do { TRISAbits.TRISA0 = 1; } while(0) |
---|
74 |
#define UNUSED1_SetDigitalOutput() do { TRISAbits.TRISA0 = 0; } while(0) |
---|
75 |
#define UNUSED1_SetPullup() do { WPUAbits.WPUA0 = 1; } while(0) |
---|
76 |
#define UNUSED1_ResetPullup() do { WPUAbits.WPUA0 = 0; } while(0) |
---|
77 |
#define UNUSED1_SetPushPull() do { ODCONAbits.ODA0 = 0; } while(0) |
---|
78 |
#define UNUSED1_SetOpenDrain() do { ODCONAbits.ODA0 = 1; } while(0) |
---|
79 |
#define UNUSED1_SetAnalogMode() do { ANSELAbits.ANSA0 = 1; } while(0) |
---|
80 |
#define UNUSED1_SetDigitalMode() do { ANSELAbits.ANSA0 = 0; } while(0) |
---|
81 |
|
---|
82 |
// get/set UNUSED2 aliases |
---|
83 |
#define UNUSED2_TRIS TRISAbits.TRISA1 |
---|
84 |
#define UNUSED2_LAT LATAbits.LATA1 |
---|
85 |
#define UNUSED2_PORT PORTAbits.RA1 |
---|
86 |
#define UNUSED2_WPU WPUAbits.WPUA1 |
---|
87 |
#define UNUSED2_OD ODCONAbits.ODA1 |
---|
88 |
#define UNUSED2_ANS ANSELAbits.ANSA1 |
---|
89 |
#define UNUSED2_SetHigh() do { LATAbits.LATA1 = 1; } while(0) |
---|
90 |
#define UNUSED2_SetLow() do { LATAbits.LATA1 = 0; } while(0) |
---|
91 |
#define UNUSED2_Toggle() do { LATAbits.LATA1 = ~LATAbits.LATA1; } while(0) |
---|
92 |
#define UNUSED2_GetValue() PORTAbits.RA1 |
---|
93 |
#define UNUSED2_SetDigitalInput() do { TRISAbits.TRISA1 = 1; } while(0) |
---|
94 |
#define UNUSED2_SetDigitalOutput() do { TRISAbits.TRISA1 = 0; } while(0) |
---|
95 |
#define UNUSED2_SetPullup() do { WPUAbits.WPUA1 = 1; } while(0) |
---|
96 |
#define UNUSED2_ResetPullup() do { WPUAbits.WPUA1 = 0; } while(0) |
---|
97 |
#define UNUSED2_SetPushPull() do { ODCONAbits.ODA1 = 0; } while(0) |
---|
98 |
#define UNUSED2_SetOpenDrain() do { ODCONAbits.ODA1 = 1; } while(0) |
---|
99 |
#define UNUSED2_SetAnalogMode() do { ANSELAbits.ANSA1 = 1; } while(0) |
---|
100 |
#define UNUSED2_SetDigitalMode() do { ANSELAbits.ANSA1 = 0; } while(0) |
---|
101 |
|
---|
102 |
// get/set UNUSED3 aliases |
---|
103 |
#define UNUSED3_TRIS TRISAbits.TRISA2 |
---|
104 |
#define UNUSED3_LAT LATAbits.LATA2 |
---|
105 |
#define UNUSED3_PORT PORTAbits.RA2 |
---|
106 |
#define UNUSED3_WPU WPUAbits.WPUA2 |
---|
107 |
#define UNUSED3_OD ODCONAbits.ODA2 |
---|
108 |
#define UNUSED3_ANS ANSELAbits.ANSA2 |
---|
109 |
#define UNUSED3_SetHigh() do { LATAbits.LATA2 = 1; } while(0) |
---|
110 |
#define UNUSED3_SetLow() do { LATAbits.LATA2 = 0; } while(0) |
---|
111 |
#define UNUSED3_Toggle() do { LATAbits.LATA2 = ~LATAbits.LATA2; } while(0) |
---|
112 |
#define UNUSED3_GetValue() PORTAbits.RA2 |
---|
113 |
#define UNUSED3_SetDigitalInput() do { TRISAbits.TRISA2 = 1; } while(0) |
---|
114 |
#define UNUSED3_SetDigitalOutput() do { TRISAbits.TRISA2 = 0; } while(0) |
---|
115 |
#define UNUSED3_SetPullup() do { WPUAbits.WPUA2 = 1; } while(0) |
---|
116 |
#define UNUSED3_ResetPullup() do { WPUAbits.WPUA2 = 0; } while(0) |
---|
117 |
#define UNUSED3_SetPushPull() do { ODCONAbits.ODA2 = 0; } while(0) |
---|
118 |
#define UNUSED3_SetOpenDrain() do { ODCONAbits.ODA2 = 1; } while(0) |
---|
119 |
#define UNUSED3_SetAnalogMode() do { ANSELAbits.ANSA2 = 1; } while(0) |
---|
120 |
#define UNUSED3_SetDigitalMode() do { ANSELAbits.ANSA2 = 0; } while(0) |
---|
121 |
|
---|
122 |
// get/set UNUSED4 aliases |
---|
123 |
#define UNUSED4_TRIS TRISAbits.TRISA3 |
---|
124 |
#define UNUSED4_PORT PORTAbits.RA3 |
---|
125 |
#define UNUSED4_WPU WPUAbits.WPUA3 |
---|
126 |
#define UNUSED4_GetValue() PORTAbits.RA3 |
---|
127 |
#define UNUSED4_SetDigitalInput() do { TRISAbits.TRISA3 = 1; } while(0) |
---|
128 |
#define UNUSED4_SetDigitalOutput() do { TRISAbits.TRISA3 = 0; } while(0) |
---|
129 |
#define UNUSED4_SetPullup() do { WPUAbits.WPUA3 = 1; } while(0) |
---|
130 |
#define UNUSED4_ResetPullup() do { WPUAbits.WPUA3 = 0; } while(0) |
---|
131 |
|
---|
132 |
// get/set IO_LED_BLUE_N aliases |
---|
133 |
#define IO_LED_BLUE_N_TRIS TRISAbits.TRISA4 |
---|
134 |
#define IO_LED_BLUE_N_LAT LATAbits.LATA4 |
---|
135 |
#define IO_LED_BLUE_N_PORT PORTAbits.RA4 |
---|
136 |
#define IO_LED_BLUE_N_WPU WPUAbits.WPUA4 |
---|
137 |
#define IO_LED_BLUE_N_OD ODCONAbits.ODA4 |
---|
138 |
#define IO_LED_BLUE_N_ANS ANSELAbits.ANSA4 |
---|
139 |
#define IO_LED_BLUE_N_SetHigh() do { LATAbits.LATA4 = 1; } while(0) |
---|
140 |
#define IO_LED_BLUE_N_SetLow() do { LATAbits.LATA4 = 0; } while(0) |
---|
141 |
#define IO_LED_BLUE_N_Toggle() do { LATAbits.LATA4 = ~LATAbits.LATA4; } while(0) |
---|
142 |
#define IO_LED_BLUE_N_GetValue() PORTAbits.RA4 |
---|
143 |
#define IO_LED_BLUE_N_SetDigitalInput() do { TRISAbits.TRISA4 = 1; } while(0) |
---|
144 |
#define IO_LED_BLUE_N_SetDigitalOutput() do { TRISAbits.TRISA4 = 0; } while(0) |
---|
145 |
#define IO_LED_BLUE_N_SetPullup() do { WPUAbits.WPUA4 = 1; } while(0) |
---|
146 |
#define IO_LED_BLUE_N_ResetPullup() do { WPUAbits.WPUA4 = 0; } while(0) |
---|
147 |
#define IO_LED_BLUE_N_SetPushPull() do { ODCONAbits.ODA4 = 0; } while(0) |
---|
148 |
#define IO_LED_BLUE_N_SetOpenDrain() do { ODCONAbits.ODA4 = 1; } while(0) |
---|
149 |
#define IO_LED_BLUE_N_SetAnalogMode() do { ANSELAbits.ANSA4 = 1; } while(0) |
---|
150 |
#define IO_LED_BLUE_N_SetDigitalMode() do { ANSELAbits.ANSA4 = 0; } while(0) |
---|
151 |
|
---|
152 |
// get/set IO_LED_RED_N aliases |
---|
153 |
#define IO_LED_RED_N_TRIS TRISAbits.TRISA5 |
---|
154 |
#define IO_LED_RED_N_LAT LATAbits.LATA5 |
---|
155 |
#define IO_LED_RED_N_PORT PORTAbits.RA5 |
---|
156 |
#define IO_LED_RED_N_WPU WPUAbits.WPUA5 |
---|
157 |
#define IO_LED_RED_N_OD ODCONAbits.ODA5 |
---|
158 |
#define IO_LED_RED_N_SetHigh() do { LATAbits.LATA5 = 1; } while(0) |
---|
159 |
#define IO_LED_RED_N_SetLow() do { LATAbits.LATA5 = 0; } while(0) |
---|
160 |
#define IO_LED_RED_N_Toggle() do { LATAbits.LATA5 = ~LATAbits.LATA5; } while(0) |
---|
161 |
#define IO_LED_RED_N_GetValue() PORTAbits.RA5 |
---|
162 |
#define IO_LED_RED_N_SetDigitalInput() do { TRISAbits.TRISA5 = 1; } while(0) |
---|
163 |
#define IO_LED_RED_N_SetDigitalOutput() do { TRISAbits.TRISA5 = 0; } while(0) |
---|
164 |
#define IO_LED_RED_N_SetPullup() do { WPUAbits.WPUA5 = 1; } while(0) |
---|
165 |
#define IO_LED_RED_N_ResetPullup() do { WPUAbits.WPUA5 = 0; } while(0) |
---|
166 |
#define IO_LED_RED_N_SetPushPull() do { ODCONAbits.ODA5 = 0; } while(0) |
---|
167 |
#define IO_LED_RED_N_SetOpenDrain() do { ODCONAbits.ODA5 = 1; } while(0) |
---|
168 |
|
---|
169 |
// get/set IO_POW aliases |
---|
170 |
#define IO_POW_TRIS TRISBbits.TRISB4 |
---|
171 |
#define IO_POW_LAT LATBbits.LATB4 |
---|
172 |
#define IO_POW_PORT PORTBbits.RB4 |
---|
173 |
#define IO_POW_WPU WPUBbits.WPUB4 |
---|
174 |
#define IO_POW_OD ODCONBbits.ODB4 |
---|
175 |
#define IO_POW_ANS ANSELBbits.ANSB4 |
---|
176 |
#define IO_POW_SetHigh() do { LATBbits.LATB4 = 1; } while(0) |
---|
177 |
#define IO_POW_SetLow() do { LATBbits.LATB4 = 0; } while(0) |
---|
178 |
#define IO_POW_Toggle() do { LATBbits.LATB4 = ~LATBbits.LATB4; } while(0) |
---|
179 |
#define IO_POW_GetValue() PORTBbits.RB4 |
---|
180 |
#define IO_POW_SetDigitalInput() do { TRISBbits.TRISB4 = 1; } while(0) |
---|
181 |
#define IO_POW_SetDigitalOutput() do { TRISBbits.TRISB4 = 0; } while(0) |
---|
182 |
#define IO_POW_SetPullup() do { WPUBbits.WPUB4 = 1; } while(0) |
---|
183 |
#define IO_POW_ResetPullup() do { WPUBbits.WPUB4 = 0; } while(0) |
---|
184 |
#define IO_POW_SetPushPull() do { ODCONBbits.ODB4 = 0; } while(0) |
---|
185 |
#define IO_POW_SetOpenDrain() do { ODCONBbits.ODB4 = 1; } while(0) |
---|
186 |
#define IO_POW_SetAnalogMode() do { ANSELBbits.ANSB4 = 1; } while(0) |
---|
187 |
#define IO_POW_SetDigitalMode() do { ANSELBbits.ANSB4 = 0; } while(0) |
---|
188 |
|
---|
189 |
// get/set IO_PWM1 aliases |
---|
190 |
#define IO_PWM1_TRIS TRISBbits.TRISB5 |
---|
191 |
#define IO_PWM1_LAT LATBbits.LATB5 |
---|
192 |
#define IO_PWM1_PORT PORTBbits.RB5 |
---|
193 |
#define IO_PWM1_WPU WPUBbits.WPUB5 |
---|
194 |
#define IO_PWM1_OD ODCONBbits.ODB5 |
---|
195 |
#define IO_PWM1_ANS ANSELBbits.ANSB5 |
---|
196 |
#define IO_PWM1_SetHigh() do { LATBbits.LATB5 = 1; } while(0) |
---|
197 |
#define IO_PWM1_SetLow() do { LATBbits.LATB5 = 0; } while(0) |
---|
198 |
#define IO_PWM1_Toggle() do { LATBbits.LATB5 = ~LATBbits.LATB5; } while(0) |
---|
199 |
#define IO_PWM1_GetValue() PORTBbits.RB5 |
---|
200 |
#define IO_PWM1_SetDigitalInput() do { TRISBbits.TRISB5 = 1; } while(0) |
---|
201 |
#define IO_PWM1_SetDigitalOutput() do { TRISBbits.TRISB5 = 0; } while(0) |
---|
202 |
#define IO_PWM1_SetPullup() do { WPUBbits.WPUB5 = 1; } while(0) |
---|
203 |
#define IO_PWM1_ResetPullup() do { WPUBbits.WPUB5 = 0; } while(0) |
---|
204 |
#define IO_PWM1_SetPushPull() do { ODCONBbits.ODB5 = 0; } while(0) |
---|
205 |
#define IO_PWM1_SetOpenDrain() do { ODCONBbits.ODB5 = 1; } while(0) |
---|
206 |
#define IO_PWM1_SetAnalogMode() do { ANSELBbits.ANSB5 = 1; } while(0) |
---|
207 |
#define IO_PWM1_SetDigitalMode() do { ANSELBbits.ANSB5 = 0; } while(0) |
---|
208 |
|
---|
209 |
// get/set IO_PWM2 aliases |
---|
210 |
#define IO_PWM2_TRIS TRISBbits.TRISB6 |
---|
211 |
#define IO_PWM2_LAT LATBbits.LATB6 |
---|
212 |
#define IO_PWM2_PORT PORTBbits.RB6 |
---|
213 |
#define IO_PWM2_WPU WPUBbits.WPUB6 |
---|
214 |
#define IO_PWM2_OD ODCONBbits.ODB6 |
---|
215 |
#define IO_PWM2_SetHigh() do { LATBbits.LATB6 = 1; } while(0) |
---|
216 |
#define IO_PWM2_SetLow() do { LATBbits.LATB6 = 0; } while(0) |
---|
217 |
#define IO_PWM2_Toggle() do { LATBbits.LATB6 = ~LATBbits.LATB6; } while(0) |
---|
218 |
#define IO_PWM2_GetValue() PORTBbits.RB6 |
---|
219 |
#define IO_PWM2_SetDigitalInput() do { TRISBbits.TRISB6 = 1; } while(0) |
---|
220 |
#define IO_PWM2_SetDigitalOutput() do { TRISBbits.TRISB6 = 0; } while(0) |
---|
221 |
#define IO_PWM2_SetPullup() do { WPUBbits.WPUB6 = 1; } while(0) |
---|
222 |
#define IO_PWM2_ResetPullup() do { WPUBbits.WPUB6 = 0; } while(0) |
---|
223 |
#define IO_PWM2_SetPushPull() do { ODCONBbits.ODB6 = 0; } while(0) |
---|
224 |
#define IO_PWM2_SetOpenDrain() do { ODCONBbits.ODB6 = 1; } while(0) |
---|
225 |
|
---|
226 |
// get/set IO_PWM_LEDS aliases |
---|
227 |
#define IO_PWM_LEDS_TRIS TRISBbits.TRISB7 |
---|
228 |
#define IO_PWM_LEDS_LAT LATBbits.LATB7 |
---|
229 |
#define IO_PWM_LEDS_PORT PORTBbits.RB7 |
---|
230 |
#define IO_PWM_LEDS_WPU WPUBbits.WPUB7 |
---|
231 |
#define IO_PWM_LEDS_OD ODCONBbits.ODB7 |
---|
232 |
#define IO_PWM_LEDS_SetHigh() do { LATBbits.LATB7 = 1; } while(0) |
---|
233 |
#define IO_PWM_LEDS_SetLow() do { LATBbits.LATB7 = 0; } while(0) |
---|
234 |
#define IO_PWM_LEDS_Toggle() do { LATBbits.LATB7 = ~LATBbits.LATB7; } while(0) |
---|
235 |
#define IO_PWM_LEDS_GetValue() PORTBbits.RB7 |
---|
236 |
#define IO_PWM_LEDS_SetDigitalInput() do { TRISBbits.TRISB7 = 1; } while(0) |
---|
237 |
#define IO_PWM_LEDS_SetDigitalOutput() do { TRISBbits.TRISB7 = 0; } while(0) |
---|
238 |
#define IO_PWM_LEDS_SetPullup() do { WPUBbits.WPUB7 = 1; } while(0) |
---|
239 |
#define IO_PWM_LEDS_ResetPullup() do { WPUBbits.WPUB7 = 0; } while(0) |
---|
240 |
#define IO_PWM_LEDS_SetPushPull() do { ODCONBbits.ODB7 = 0; } while(0) |
---|
241 |
#define IO_PWM_LEDS_SetOpenDrain() do { ODCONBbits.ODB7 = 1; } while(0) |
---|
242 |
|
---|
243 |
// get/set IO_RC0 aliases |
---|
244 |
#define IO_RC0_TRIS TRISCbits.TRISC0 |
---|
245 |
#define IO_RC0_LAT LATCbits.LATC0 |
---|
246 |
#define IO_RC0_PORT PORTCbits.RC0 |
---|
247 |
#define IO_RC0_WPU WPUCbits.WPUC0 |
---|
248 |
#define IO_RC0_OD ODCONCbits.ODC0 |
---|
249 |
#define IO_RC0_ANS ANSELCbits.ANSC0 |
---|
250 |
#define IO_RC0_SetHigh() do { LATCbits.LATC0 = 1; } while(0) |
---|
251 |
#define IO_RC0_SetLow() do { LATCbits.LATC0 = 0; } while(0) |
---|
252 |
#define IO_RC0_Toggle() do { LATCbits.LATC0 = ~LATCbits.LATC0; } while(0) |
---|
253 |
#define IO_RC0_GetValue() PORTCbits.RC0 |
---|
254 |
#define IO_RC0_SetDigitalInput() do { TRISCbits.TRISC0 = 1; } while(0) |
---|
255 |
#define IO_RC0_SetDigitalOutput() do { TRISCbits.TRISC0 = 0; } while(0) |
---|
256 |
#define IO_RC0_SetPullup() do { WPUCbits.WPUC0 = 1; } while(0) |
---|
257 |
#define IO_RC0_ResetPullup() do { WPUCbits.WPUC0 = 0; } while(0) |
---|
258 |
#define IO_RC0_SetPushPull() do { ODCONCbits.ODC0 = 0; } while(0) |
---|
259 |
#define IO_RC0_SetOpenDrain() do { ODCONCbits.ODC0 = 1; } while(0) |
---|
260 |
#define IO_RC0_SetAnalogMode() do { ANSELCbits.ANSC0 = 1; } while(0) |
---|
261 |
#define IO_RC0_SetDigitalMode() do { ANSELCbits.ANSC0 = 0; } while(0) |
---|
262 |
|
---|
263 |
// get/set ADC_BATT aliases |
---|
264 |
#define ADC_BATT_TRIS TRISCbits.TRISC1 |
---|
265 |
#define ADC_BATT_LAT LATCbits.LATC1 |
---|
266 |
#define ADC_BATT_PORT PORTCbits.RC1 |
---|
267 |
#define ADC_BATT_WPU WPUCbits.WPUC1 |
---|
268 |
#define ADC_BATT_OD ODCONCbits.ODC1 |
---|
269 |
#define ADC_BATT_ANS ANSELCbits.ANSC1 |
---|
270 |
#define ADC_BATT_SetHigh() do { LATCbits.LATC1 = 1; } while(0) |
---|
271 |
#define ADC_BATT_SetLow() do { LATCbits.LATC1 = 0; } while(0) |
---|
272 |
#define ADC_BATT_Toggle() do { LATCbits.LATC1 = ~LATCbits.LATC1; } while(0) |
---|
273 |
#define ADC_BATT_GetValue() PORTCbits.RC1 |
---|
274 |
#define ADC_BATT_SetDigitalInput() do { TRISCbits.TRISC1 = 1; } while(0) |
---|
275 |
#define ADC_BATT_SetDigitalOutput() do { TRISCbits.TRISC1 = 0; } while(0) |
---|
276 |
#define ADC_BATT_SetPullup() do { WPUCbits.WPUC1 = 1; } while(0) |
---|
277 |
#define ADC_BATT_ResetPullup() do { WPUCbits.WPUC1 = 0; } while(0) |
---|
278 |
#define ADC_BATT_SetPushPull() do { ODCONCbits.ODC1 = 0; } while(0) |
---|
279 |
#define ADC_BATT_SetOpenDrain() do { ODCONCbits.ODC1 = 1; } while(0) |
---|
280 |
#define ADC_BATT_SetAnalogMode() do { ANSELCbits.ANSC1 = 1; } while(0) |
---|
281 |
#define ADC_BATT_SetDigitalMode() do { ANSELCbits.ANSC1 = 0; } while(0) |
---|
282 |
|
---|
283 |
// get/set RC2 procedures |
---|
284 |
#define RC2_SetHigh() do { LATCbits.LATC2 = 1; } while(0) |
---|
285 |
#define RC2_SetLow() do { LATCbits.LATC2 = 0; } while(0) |
---|
286 |
#define RC2_Toggle() do { LATCbits.LATC2 = ~LATCbits.LATC2; } while(0) |
---|
287 |
#define RC2_GetValue() PORTCbits.RC2 |
---|
288 |
#define RC2_SetDigitalInput() do { TRISCbits.TRISC2 = 1; } while(0) |
---|
289 |
#define RC2_SetDigitalOutput() do { TRISCbits.TRISC2 = 0; } while(0) |
---|
290 |
#define RC2_SetPullup() do { WPUCbits.WPUC2 = 1; } while(0) |
---|
291 |
#define RC2_ResetPullup() do { WPUCbits.WPUC2 = 0; } while(0) |
---|
292 |
#define RC2_SetAnalogMode() do { ANSELCbits.ANSC2 = 1; } while(0) |
---|
293 |
#define RC2_SetDigitalMode() do { ANSELCbits.ANSC2 = 0; } while(0) |
---|
294 |
|
---|
295 |
// get/set RC3 procedures |
---|
296 |
#define RC3_SetHigh() do { LATCbits.LATC3 = 1; } while(0) |
---|
297 |
#define RC3_SetLow() do { LATCbits.LATC3 = 0; } while(0) |
---|
298 |
#define RC3_Toggle() do { LATCbits.LATC3 = ~LATCbits.LATC3; } while(0) |
---|
299 |
#define RC3_GetValue() PORTCbits.RC3 |
---|
300 |
#define RC3_SetDigitalInput() do { TRISCbits.TRISC3 = 1; } while(0) |
---|
301 |
#define RC3_SetDigitalOutput() do { TRISCbits.TRISC3 = 0; } while(0) |
---|
302 |
#define RC3_SetPullup() do { WPUCbits.WPUC3 = 1; } while(0) |
---|
303 |
#define RC3_ResetPullup() do { WPUCbits.WPUC3 = 0; } while(0) |
---|
304 |
#define RC3_SetAnalogMode() do { ANSELCbits.ANSC3 = 1; } while(0) |
---|
305 |
#define RC3_SetDigitalMode() do { ANSELCbits.ANSC3 = 0; } while(0) |
---|
306 |
|
---|
307 |
// get/set RC4 procedures |
---|
308 |
#define RC4_SetHigh() do { LATCbits.LATC4 = 1; } while(0) |
---|
309 |
#define RC4_SetLow() do { LATCbits.LATC4 = 0; } while(0) |
---|
310 |
#define RC4_Toggle() do { LATCbits.LATC4 = ~LATCbits.LATC4; } while(0) |
---|
311 |
#define RC4_GetValue() PORTCbits.RC4 |
---|
312 |
#define RC4_SetDigitalInput() do { TRISCbits.TRISC4 = 1; } while(0) |
---|
313 |
#define RC4_SetDigitalOutput() do { TRISCbits.TRISC4 = 0; } while(0) |
---|
314 |
#define RC4_SetPullup() do { WPUCbits.WPUC4 = 1; } while(0) |
---|
315 |
#define RC4_ResetPullup() do { WPUCbits.WPUC4 = 0; } while(0) |
---|
316 |
|
---|
317 |
// get/set IO_PWRC aliases |
---|
318 |
#define IO_PWRC_TRIS TRISCbits.TRISC5 |
---|
319 |
#define IO_PWRC_LAT LATCbits.LATC5 |
---|
320 |
#define IO_PWRC_PORT PORTCbits.RC5 |
---|
321 |
#define IO_PWRC_WPU WPUCbits.WPUC5 |
---|
322 |
#define IO_PWRC_OD ODCONCbits.ODC5 |
---|
323 |
#define IO_PWRC_SetHigh() do { LATCbits.LATC5 = 1; } while(0) |
---|
324 |
#define IO_PWRC_SetLow() do { LATCbits.LATC5 = 0; } while(0) |
---|
325 |
#define IO_PWRC_Toggle() do { LATCbits.LATC5 = ~LATCbits.LATC5; } while(0) |
---|
326 |
#define IO_PWRC_GetValue() PORTCbits.RC5 |
---|
327 |
#define IO_PWRC_SetDigitalInput() do { TRISCbits.TRISC5 = 1; } while(0) |
---|
328 |
#define IO_PWRC_SetDigitalOutput() do { TRISCbits.TRISC5 = 0; } while(0) |
---|
329 |
#define IO_PWRC_SetPullup() do { WPUCbits.WPUC5 = 1; } while(0) |
---|
330 |
#define IO_PWRC_ResetPullup() do { WPUCbits.WPUC5 = 0; } while(0) |
---|
331 |
#define IO_PWRC_SetPushPull() do { ODCONCbits.ODC5 = 0; } while(0) |
---|
332 |
#define IO_PWRC_SetOpenDrain() do { ODCONCbits.ODC5 = 1; } while(0) |
---|
333 |
|
---|
334 |
// get/set IO_STA aliases |
---|
335 |
#define IO_STA_TRIS TRISCbits.TRISC6 |
---|
336 |
#define IO_STA_LAT LATCbits.LATC6 |
---|
337 |
#define IO_STA_PORT PORTCbits.RC6 |
---|
338 |
#define IO_STA_WPU WPUCbits.WPUC6 |
---|
339 |
#define IO_STA_OD ODCONCbits.ODC6 |
---|
340 |
#define IO_STA_ANS ANSELCbits.ANSC6 |
---|
341 |
#define IO_STA_SetHigh() do { LATCbits.LATC6 = 1; } while(0) |
---|
342 |
#define IO_STA_SetLow() do { LATCbits.LATC6 = 0; } while(0) |
---|
343 |
#define IO_STA_Toggle() do { LATCbits.LATC6 = ~LATCbits.LATC6; } while(0) |
---|
344 |
#define IO_STA_GetValue() PORTCbits.RC6 |
---|
345 |
#define IO_STA_SetDigitalInput() do { TRISCbits.TRISC6 = 1; } while(0) |
---|
346 |
#define IO_STA_SetDigitalOutput() do { TRISCbits.TRISC6 = 0; } while(0) |
---|
347 |
#define IO_STA_SetPullup() do { WPUCbits.WPUC6 = 1; } while(0) |
---|
348 |
#define IO_STA_ResetPullup() do { WPUCbits.WPUC6 = 0; } while(0) |
---|
349 |
#define IO_STA_SetPushPull() do { ODCONCbits.ODC6 = 0; } while(0) |
---|
350 |
#define IO_STA_SetOpenDrain() do { ODCONCbits.ODC6 = 1; } while(0) |
---|
351 |
#define IO_STA_SetAnalogMode() do { ANSELCbits.ANSC6 = 1; } while(0) |
---|
352 |
#define IO_STA_SetDigitalMode() do { ANSELCbits.ANSC6 = 0; } while(0) |
---|
353 |
|
---|
354 |
// get/set IO_SERVOS aliases |
---|
355 |
#define IO_SERVOS_TRIS TRISCbits.TRISC7 |
---|
356 |
#define IO_SERVOS_LAT LATCbits.LATC7 |
---|
357 |
#define IO_SERVOS_PORT PORTCbits.RC7 |
---|
358 |
#define IO_SERVOS_WPU WPUCbits.WPUC7 |
---|
359 |
#define IO_SERVOS_OD ODCONCbits.ODC7 |
---|
360 |
#define IO_SERVOS_ANS ANSELCbits.ANSC7 |
---|
361 |
#define IO_SERVOS_SetHigh() do { LATCbits.LATC7 = 1; } while(0) |
---|
362 |
#define IO_SERVOS_SetLow() do { LATCbits.LATC7 = 0; } while(0) |
---|
363 |
#define IO_SERVOS_Toggle() do { LATCbits.LATC7 = ~LATCbits.LATC7; } while(0) |
---|
364 |
#define IO_SERVOS_GetValue() PORTCbits.RC7 |
---|
365 |
#define IO_SERVOS_SetDigitalInput() do { TRISCbits.TRISC7 = 1; } while(0) |
---|
366 |
#define IO_SERVOS_SetDigitalOutput() do { TRISCbits.TRISC7 = 0; } while(0) |
---|
367 |
#define IO_SERVOS_SetPullup() do { WPUCbits.WPUC7 = 1; } while(0) |
---|
368 |
#define IO_SERVOS_ResetPullup() do { WPUCbits.WPUC7 = 0; } while(0) |
---|
369 |
#define IO_SERVOS_SetPushPull() do { ODCONCbits.ODC7 = 0; } while(0) |
---|
370 |
#define IO_SERVOS_SetOpenDrain() do { ODCONCbits.ODC7 = 1; } while(0) |
---|
371 |
#define IO_SERVOS_SetAnalogMode() do { ANSELCbits.ANSC7 = 1; } while(0) |
---|
372 |
#define IO_SERVOS_SetDigitalMode() do { ANSELCbits.ANSC7 = 0; } while(0) |
---|
373 |
|
---|
374 |
/** |
---|
375 |
@Param |
---|
376 |
none |
---|
377 |
@Returns |
---|
378 |
none |
---|
379 |
@Description |
---|
380 |
GPIO and peripheral I/O initialization |
---|
381 |
@Example |
---|
382 |
PIN_MANAGER_Initialize(); |
---|
383 |
*/ |
---|
384 |
void PIN_MANAGER_Initialize (void); |
---|
385 |
|
---|
386 |
/** |
---|
387 |
* @Param |
---|
388 |
none |
---|
389 |
* @Returns |
---|
390 |
none |
---|
391 |
* @Description |
---|
392 |
Interrupt on Change Handling routine |
---|
393 |
* @Example |
---|
394 |
PIN_MANAGER_IOC(); |
---|
395 |
*/ |
---|
396 |
void PIN_MANAGER_IOC(void); |
---|
397 |
|
---|
398 |
|
---|
399 |
|
---|
400 |
#endif // PIN_MANAGER_H |
---|
401 |
/** |
---|
402 |
End of File |
---|
403 |
*/ |
---|