PIC24 Support Libraries
pic24_ports_config.h
Go to the documentation of this file.
1 /*
2  * "Copyright (c) 2017 Robert B. Reese, Bryan A. Jones, J. W. Bruce ("AUTHORS")"
3  * All rights reserved.
4  * (R. Reese, reese_AT_ece.msstate.edu, Mississippi State University)
5  * (B. A. Jones, bjones_AT_ece.msstate.edu, Mississippi State University)
6  * (J. W. Bruce, jwbruce_AT_ece.msstate.edu, Mississippi State University)
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation for any purpose, without fee, and without written agreement is
10  * hereby granted, provided that the above copyright notice, the following
11  * two paragraphs and the authors appear in all copies of this software.
12  *
13  * IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
15  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
16  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17  *
18  * THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21  * ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
23  *
24  * Please maintain this header in its entirety when copying/modifying
25  * these files.
26  *
27  *
28  */
29 
30 /// \file
31 /// \brief Define GPIO configuration macros for all pins of a device.
32 /// See pic24_ports.h for more details.
33 
34 
35 // Provide GPIO for RA0
36 // ====================
37 #if defined(_RA0) || defined(__DOXYGEN__)
38 
39 // Dummy macros for documentation only
40 # ifdef __DOXYGEN__
41 /// This macro specifies the RPy value associated with pin RA0.
42 /// Its device-specific definition is given in pic24_ports_mapping.h.
43 # define RA0_RP xx
44 
45 /// This macro specifies the ANn value associated with pin RA0.
46 /// Its device-specific definition is given in pic24_ports_mapping.h.
47 # define RA0_AN xx
48 
49 /// This macro specifies the CNm value associated with pin RA0.
50 /// Its device-specific definition is given in pic24_ports_mapping.h.
51 # define RA0_CN xx
52 
53 //@}
54 # endif // #ifdef __DOXYGEN__
55 
56 
57 // Low-level config
58 // ----------------
59 // Analog:
60 # if defined(_ANSA0) || defined(__DOXYGEN__)
61 /// Enable analog functionality on pin RA0.
62 # define ENABLE_RA0_ANALOG() (_ANSA0 = 1)
63 /// Disable analog functionality on pin RA0.
64 # define DISABLE_RA0_ANALOG() (_ANSA0 = 0)
65 # elif defined(RA0_AN)
66 # define ENABLE_RA0_ANALOG() (RXY_GPIO_PCFG(RA0_AN) = 0)
67 # define DISABLE_RA0_ANALOG() (RXY_GPIO_PCFG(RA0_AN) = 1)
68 # else
69 # define DISABLE_RA0_ANALOG() ((void) 0)
70 # endif
71 
72 // Input/output:
73 /// Configure pin RA0 as an input.
74 # define CONFIG_RA0_AS_INPUT() (_TRISA0 = 1)
75 /// Configure pin RA0 as an output.
76 # define CONFIG_RA0_AS_OUTPUT() (_TRISA0 = 0)
77 
78 // Open-drain:
79 # if defined(_ODCA0) || defined(__DOXYGEN__)
80 /// Enable the open-drain driver on pin RA0.
81 # define ENABLE_RA0_OPENDRAIN() (_ODCA0 = 1)
82 /// Disable the open-drain driver on pin RA0.
83 # define DISABLE_RA0_OPENDRAIN() (_ODCA0 = 0)
84 # elif defined(_ODA0) // The PIF24F names this bit _OD instead of _ODC.
85 # define ENABLE_RA0_OPENDRAIN() (_ODA0 = 1)
86 # define DISABLE_RA0_OPENDRAIN() (_ODA0 = 0)
87 # else
88 # define DISABLE_RA0_OPENDRAIN() ((void) 0)
89 # endif
90 
91 // Change notification, pullups and pulldowns:
92 # if defined(_CNIEA0) || defined(__DOXYGEN__)
93 /// Enable the pullup on pin RA0.
94 # define ENABLE_RA0_PULLUP() (_CNPUA0 = 1)
95 /// Disable the pullup on pin RA0.
96 # define DISABLE_RA0_PULLUP() (_CNPUA0 = 0)
97 
98 /// Enable the pulldown on pin RA0.
99 # define ENABLE_RA0_PULLDOWN() (_CNPDA0 = 1)
100 /// Disable the pulldown on pin RA0.
101 # define DISABLE_RA0_PULLDOWN() (_CNPDA0 = 0)
102 
103 /// Enable the change notification interrupt on pin RA0.
104 # define ENABLE_RA0_CN_INTERRUPT() (_CNIEA0 = 1)
105 /// Disable the change notification interrupt on pin RA0.
106 # define DISABLE_RA0_CN_INTERRUPT() (_CNIEA0 = 0)
107 
108 # elif defined(RA0_CN)
109 # define ENABLE_RA0_PULLUP() (RXY_GPIO_CNPUE(RA0_CN) = 1)
110 # define DISABLE_RA0_PULLUP() (RXY_GPIO_CNPUE(RA0_CN) = 0)
111 
112 # if RXY_HAS_CNPDE(RA0_CN)
113 # define ENABLE_RA0_PULLDOWN() (RXY_GPIO_CNPDE(RA0_CN) = 1)
114 # define DISABLE_RA0_PULLDOWN() (RXY_GPIO_CNPDE(RA0_CN) = 0)
115 # else
116 # define DISABLE_RA0_PULLDOWN() ((void) 0)
117 # endif
118 
119 # define ENABLE_RA0_CN_INTERRUPT() (RXY_GPIO_CNIE(RA0_CN) = 1)
120 # define DISABLE_RA0_CN_INTERRUPT() (RXY_GPIO_CNIE(RA0_CN) = 0)
121 
122 # else
123 # define DISABLE_RA0_PULLUP() ((void) 0)
124 # define DISABLE_RA0_PULLDOWN() ((void) 0)
125 # define DISABLE_RA0_CN_INTERRUPT() ((void) 0)
126 # endif
127 
128 // High-level config
129 // -----------------
130 /** This macro disables pullups/downs, enables analog functionality, and configures
131  * pin RA0 as an input.
132  */
133 # if defined(_ANSA0) || defined(RA0_AN) || defined(__DOXYGEN__)
134 # define CONFIG_RA0_AS_ANALOG() \
135  do { \
136  ENABLE_RA0_ANALOG(); \
137  CONFIG_RA0_AS_INPUT(); \
138  DISABLE_RA0_OPENDRAIN(); \
139  DISABLE_RA0_PULLUP(); \
140  DISABLE_RA0_PULLDOWN(); \
141  } while (0)
142 # endif
143 
144 /** This macro disables open-drain and pullups/downs,
145  * configures pin RA0 for digital (not analog) operation, and
146  * configures the pin as an input.
147  */
148 # define CONFIG_RA0_AS_DIG_INPUT() \
149  do { \
150  DISABLE_RA0_ANALOG(); \
151  CONFIG_RA0_AS_INPUT(); \
152  DISABLE_RA0_OPENDRAIN(); \
153  DISABLE_RA0_PULLUP(); \
154  DISABLE_RA0_PULLDOWN(); \
155  } while (0)
156 
157 /** This macro disables open-drain and pullups/downs,
158  * configures pin RA0 for digital (not analog) operation, and
159  * configures the pin as an output.
160  */
161 # define CONFIG_RA0_AS_DIG_OUTPUT() \
162  do { \
163  DISABLE_RA0_ANALOG(); \
164  CONFIG_RA0_AS_OUTPUT(); \
165  DISABLE_RA0_OPENDRAIN(); \
166  DISABLE_RA0_PULLUP(); \
167  DISABLE_RA0_PULLDOWN(); \
168  } while (0)
169 
170 #endif // #if defined(_RA0) || defined(__DOXYGEN__): Provide GPIO for RA0
171 
172 
173 
174 
175 
176 // Provide GPIO for RA1
177 // ====================
178 #if defined(_RA1) || defined(__DOXYGEN__)
179 
180 // Dummy macros for documentation only
181 # ifdef __DOXYGEN__
182 /// This macro specifies the RPy value associated with pin RA1.
183 /// Its device-specific definition is given in pic24_ports_mapping.h.
184 # define RA1_RP xx
185 
186 /// This macro specifies the ANn value associated with pin RA1.
187 /// Its device-specific definition is given in pic24_ports_mapping.h.
188 # define RA1_AN xx
189 
190 /// This macro specifies the CNm value associated with pin RA1.
191 /// Its device-specific definition is given in pic24_ports_mapping.h.
192 # define RA1_CN xx
193 
194 //@}
195 # endif // #ifdef __DOXYGEN__
196 
197 
198 // Low-level config
199 // ----------------
200 // Analog:
201 # if defined(_ANSA1) || defined(__DOXYGEN__)
202 /// Enable analog functionality on pin RA1.
203 # define ENABLE_RA1_ANALOG() (_ANSA1 = 1)
204 /// Disable analog functionality on pin RA1.
205 # define DISABLE_RA1_ANALOG() (_ANSA1 = 0)
206 # elif defined(RA1_AN)
207 # define ENABLE_RA1_ANALOG() (RXY_GPIO_PCFG(RA1_AN) = 0)
208 # define DISABLE_RA1_ANALOG() (RXY_GPIO_PCFG(RA1_AN) = 1)
209 # else
210 # define DISABLE_RA1_ANALOG() ((void) 0)
211 # endif
212 
213 // Input/output:
214 /// Configure pin RA1 as an input.
215 # define CONFIG_RA1_AS_INPUT() (_TRISA1 = 1)
216 /// Configure pin RA1 as an output.
217 # define CONFIG_RA1_AS_OUTPUT() (_TRISA1 = 0)
218 
219 // Open-drain:
220 # if defined(_ODCA1) || defined(__DOXYGEN__)
221 /// Enable the open-drain driver on pin RA1.
222 # define ENABLE_RA1_OPENDRAIN() (_ODCA1 = 1)
223 /// Disable the open-drain driver on pin RA1.
224 # define DISABLE_RA1_OPENDRAIN() (_ODCA1 = 0)
225 # elif defined(_ODA1) // The PIF24F names this bit _OD instead of _ODC.
226 # define ENABLE_RA1_OPENDRAIN() (_ODA1 = 1)
227 # define DISABLE_RA1_OPENDRAIN() (_ODA1 = 0)
228 # else
229 # define DISABLE_RA1_OPENDRAIN() ((void) 0)
230 # endif
231 
232 // Change notification, pullups and pulldowns:
233 # if defined(_CNIEA1) || defined(__DOXYGEN__)
234 /// Enable the pullup on pin RA1.
235 # define ENABLE_RA1_PULLUP() (_CNPUA1 = 1)
236 /// Disable the pullup on pin RA1.
237 # define DISABLE_RA1_PULLUP() (_CNPUA1 = 0)
238 
239 /// Enable the pulldown on pin RA1.
240 # define ENABLE_RA1_PULLDOWN() (_CNPDA1 = 1)
241 /// Disable the pulldown on pin RA1.
242 # define DISABLE_RA1_PULLDOWN() (_CNPDA1 = 0)
243 
244 /// Enable the change notification interrupt on pin RA1.
245 # define ENABLE_RA1_CN_INTERRUPT() (_CNIEA1 = 1)
246 /// Disable the change notification interrupt on pin RA1.
247 # define DISABLE_RA1_CN_INTERRUPT() (_CNIEA1 = 0)
248 
249 # elif defined(RA1_CN)
250 # define ENABLE_RA1_PULLUP() (RXY_GPIO_CNPUE(RA1_CN) = 1)
251 # define DISABLE_RA1_PULLUP() (RXY_GPIO_CNPUE(RA1_CN) = 0)
252 
253 # if RXY_HAS_CNPDE(RA1_CN)
254 # define ENABLE_RA1_PULLDOWN() (RXY_GPIO_CNPDE(RA1_CN) = 1)
255 # define DISABLE_RA1_PULLDOWN() (RXY_GPIO_CNPDE(RA1_CN) = 0)
256 # else
257 # define DISABLE_RA1_PULLDOWN() ((void) 0)
258 # endif
259 
260 # define ENABLE_RA1_CN_INTERRUPT() (RXY_GPIO_CNIE(RA1_CN) = 1)
261 # define DISABLE_RA1_CN_INTERRUPT() (RXY_GPIO_CNIE(RA1_CN) = 0)
262 
263 # else
264 # define DISABLE_RA1_PULLUP() ((void) 0)
265 # define DISABLE_RA1_PULLDOWN() ((void) 0)
266 # define DISABLE_RA1_CN_INTERRUPT() ((void) 0)
267 # endif
268 
269 // High-level config
270 // -----------------
271 /** This macro disables pullups/downs, enables analog functionality, and configures
272  * pin RA1 as an input.
273  */
274 # if defined(_ANSA1) || defined(RA1_AN) || defined(__DOXYGEN__)
275 # define CONFIG_RA1_AS_ANALOG() \
276  do { \
277  ENABLE_RA1_ANALOG(); \
278  CONFIG_RA1_AS_INPUT(); \
279  DISABLE_RA1_OPENDRAIN(); \
280  DISABLE_RA1_PULLUP(); \
281  DISABLE_RA1_PULLDOWN(); \
282  } while (0)
283 # endif
284 
285 /** This macro disables open-drain and pullups/downs,
286  * configures pin RA1 for digital (not analog) operation, and
287  * configures the pin as an input.
288  */
289 # define CONFIG_RA1_AS_DIG_INPUT() \
290  do { \
291  DISABLE_RA1_ANALOG(); \
292  CONFIG_RA1_AS_INPUT(); \
293  DISABLE_RA1_OPENDRAIN(); \
294  DISABLE_RA1_PULLUP(); \
295  DISABLE_RA1_PULLDOWN(); \
296  } while (0)
297 
298 /** This macro disables open-drain and pullups/downs,
299  * configures pin RA1 for digital (not analog) operation, and
300  * configures the pin as an output.
301  */
302 # define CONFIG_RA1_AS_DIG_OUTPUT() \
303  do { \
304  DISABLE_RA1_ANALOG(); \
305  CONFIG_RA1_AS_OUTPUT(); \
306  DISABLE_RA1_OPENDRAIN(); \
307  DISABLE_RA1_PULLUP(); \
308  DISABLE_RA1_PULLDOWN(); \
309  } while (0)
310 
311 #endif // #if defined(_RA1) || defined(__DOXYGEN__): Provide GPIO for RA1
312 
313 
314 
315 
316 
317 // Provide GPIO for RA2
318 // ====================
319 #if defined(_RA2) || defined(__DOXYGEN__)
320 
321 // Dummy macros for documentation only
322 # ifdef __DOXYGEN__
323 /// This macro specifies the RPy value associated with pin RA2.
324 /// Its device-specific definition is given in pic24_ports_mapping.h.
325 # define RA2_RP xx
326 
327 /// This macro specifies the ANn value associated with pin RA2.
328 /// Its device-specific definition is given in pic24_ports_mapping.h.
329 # define RA2_AN xx
330 
331 /// This macro specifies the CNm value associated with pin RA2.
332 /// Its device-specific definition is given in pic24_ports_mapping.h.
333 # define RA2_CN xx
334 
335 //@}
336 # endif // #ifdef __DOXYGEN__
337 
338 
339 // Low-level config
340 // ----------------
341 // Analog:
342 # if defined(_ANSA2) || defined(__DOXYGEN__)
343 /// Enable analog functionality on pin RA2.
344 # define ENABLE_RA2_ANALOG() (_ANSA2 = 1)
345 /// Disable analog functionality on pin RA2.
346 # define DISABLE_RA2_ANALOG() (_ANSA2 = 0)
347 # elif defined(RA2_AN)
348 # define ENABLE_RA2_ANALOG() (RXY_GPIO_PCFG(RA2_AN) = 0)
349 # define DISABLE_RA2_ANALOG() (RXY_GPIO_PCFG(RA2_AN) = 1)
350 # else
351 # define DISABLE_RA2_ANALOG() ((void) 0)
352 # endif
353 
354 // Input/output:
355 /// Configure pin RA2 as an input.
356 # define CONFIG_RA2_AS_INPUT() (_TRISA2 = 1)
357 /// Configure pin RA2 as an output.
358 # define CONFIG_RA2_AS_OUTPUT() (_TRISA2 = 0)
359 
360 // Open-drain:
361 # if defined(_ODCA2) || defined(__DOXYGEN__)
362 /// Enable the open-drain driver on pin RA2.
363 # define ENABLE_RA2_OPENDRAIN() (_ODCA2 = 1)
364 /// Disable the open-drain driver on pin RA2.
365 # define DISABLE_RA2_OPENDRAIN() (_ODCA2 = 0)
366 # elif defined(_ODA2) // The PIF24F names this bit _OD instead of _ODC.
367 # define ENABLE_RA2_OPENDRAIN() (_ODA2 = 1)
368 # define DISABLE_RA2_OPENDRAIN() (_ODA2 = 0)
369 # else
370 # define DISABLE_RA2_OPENDRAIN() ((void) 0)
371 # endif
372 
373 // Change notification, pullups and pulldowns:
374 # if defined(_CNIEA2) || defined(__DOXYGEN__)
375 /// Enable the pullup on pin RA2.
376 # define ENABLE_RA2_PULLUP() (_CNPUA2 = 1)
377 /// Disable the pullup on pin RA2.
378 # define DISABLE_RA2_PULLUP() (_CNPUA2 = 0)
379 
380 /// Enable the pulldown on pin RA2.
381 # define ENABLE_RA2_PULLDOWN() (_CNPDA2 = 1)
382 /// Disable the pulldown on pin RA2.
383 # define DISABLE_RA2_PULLDOWN() (_CNPDA2 = 0)
384 
385 /// Enable the change notification interrupt on pin RA2.
386 # define ENABLE_RA2_CN_INTERRUPT() (_CNIEA2 = 1)
387 /// Disable the change notification interrupt on pin RA2.
388 # define DISABLE_RA2_CN_INTERRUPT() (_CNIEA2 = 0)
389 
390 # elif defined(RA2_CN)
391 # define ENABLE_RA2_PULLUP() (RXY_GPIO_CNPUE(RA2_CN) = 1)
392 # define DISABLE_RA2_PULLUP() (RXY_GPIO_CNPUE(RA2_CN) = 0)
393 
394 # if RXY_HAS_CNPDE(RA2_CN)
395 # define ENABLE_RA2_PULLDOWN() (RXY_GPIO_CNPDE(RA2_CN) = 1)
396 # define DISABLE_RA2_PULLDOWN() (RXY_GPIO_CNPDE(RA2_CN) = 0)
397 # else
398 # define DISABLE_RA2_PULLDOWN() ((void) 0)
399 # endif
400 
401 # define ENABLE_RA2_CN_INTERRUPT() (RXY_GPIO_CNIE(RA2_CN) = 1)
402 # define DISABLE_RA2_CN_INTERRUPT() (RXY_GPIO_CNIE(RA2_CN) = 0)
403 
404 # else
405 # define DISABLE_RA2_PULLUP() ((void) 0)
406 # define DISABLE_RA2_PULLDOWN() ((void) 0)
407 # define DISABLE_RA2_CN_INTERRUPT() ((void) 0)
408 # endif
409 
410 // High-level config
411 // -----------------
412 /** This macro disables pullups/downs, enables analog functionality, and configures
413  * pin RA2 as an input.
414  */
415 # if defined(_ANSA2) || defined(RA2_AN) || defined(__DOXYGEN__)
416 # define CONFIG_RA2_AS_ANALOG() \
417  do { \
418  ENABLE_RA2_ANALOG(); \
419  CONFIG_RA2_AS_INPUT(); \
420  DISABLE_RA2_OPENDRAIN(); \
421  DISABLE_RA2_PULLUP(); \
422  DISABLE_RA2_PULLDOWN(); \
423  } while (0)
424 # endif
425 
426 /** This macro disables open-drain and pullups/downs,
427  * configures pin RA2 for digital (not analog) operation, and
428  * configures the pin as an input.
429  */
430 # define CONFIG_RA2_AS_DIG_INPUT() \
431  do { \
432  DISABLE_RA2_ANALOG(); \
433  CONFIG_RA2_AS_INPUT(); \
434  DISABLE_RA2_OPENDRAIN(); \
435  DISABLE_RA2_PULLUP(); \
436  DISABLE_RA2_PULLDOWN(); \
437  } while (0)
438 
439 /** This macro disables open-drain and pullups/downs,
440  * configures pin RA2 for digital (not analog) operation, and
441  * configures the pin as an output.
442  */
443 # define CONFIG_RA2_AS_DIG_OUTPUT() \
444  do { \
445  DISABLE_RA2_ANALOG(); \
446  CONFIG_RA2_AS_OUTPUT(); \
447  DISABLE_RA2_OPENDRAIN(); \
448  DISABLE_RA2_PULLUP(); \
449  DISABLE_RA2_PULLDOWN(); \
450  } while (0)
451 
452 #endif // #if defined(_RA2) || defined(__DOXYGEN__): Provide GPIO for RA2
453 
454 
455 
456 
457 
458 // Provide GPIO for RA3
459 // ====================
460 #if defined(_RA3) || defined(__DOXYGEN__)
461 
462 // Dummy macros for documentation only
463 # ifdef __DOXYGEN__
464 /// This macro specifies the RPy value associated with pin RA3.
465 /// Its device-specific definition is given in pic24_ports_mapping.h.
466 # define RA3_RP xx
467 
468 /// This macro specifies the ANn value associated with pin RA3.
469 /// Its device-specific definition is given in pic24_ports_mapping.h.
470 # define RA3_AN xx
471 
472 /// This macro specifies the CNm value associated with pin RA3.
473 /// Its device-specific definition is given in pic24_ports_mapping.h.
474 # define RA3_CN xx
475 
476 //@}
477 # endif // #ifdef __DOXYGEN__
478 
479 
480 // Low-level config
481 // ----------------
482 // Analog:
483 # if defined(_ANSA3) || defined(__DOXYGEN__)
484 /// Enable analog functionality on pin RA3.
485 # define ENABLE_RA3_ANALOG() (_ANSA3 = 1)
486 /// Disable analog functionality on pin RA3.
487 # define DISABLE_RA3_ANALOG() (_ANSA3 = 0)
488 # elif defined(RA3_AN)
489 # define ENABLE_RA3_ANALOG() (RXY_GPIO_PCFG(RA3_AN) = 0)
490 # define DISABLE_RA3_ANALOG() (RXY_GPIO_PCFG(RA3_AN) = 1)
491 # else
492 # define DISABLE_RA3_ANALOG() ((void) 0)
493 # endif
494 
495 // Input/output:
496 /// Configure pin RA3 as an input.
497 # define CONFIG_RA3_AS_INPUT() (_TRISA3 = 1)
498 /// Configure pin RA3 as an output.
499 # define CONFIG_RA3_AS_OUTPUT() (_TRISA3 = 0)
500 
501 // Open-drain:
502 # if defined(_ODCA3) || defined(__DOXYGEN__)
503 /// Enable the open-drain driver on pin RA3.
504 # define ENABLE_RA3_OPENDRAIN() (_ODCA3 = 1)
505 /// Disable the open-drain driver on pin RA3.
506 # define DISABLE_RA3_OPENDRAIN() (_ODCA3 = 0)
507 # elif defined(_ODA3) // The PIF24F names this bit _OD instead of _ODC.
508 # define ENABLE_RA3_OPENDRAIN() (_ODA3 = 1)
509 # define DISABLE_RA3_OPENDRAIN() (_ODA3 = 0)
510 # else
511 # define DISABLE_RA3_OPENDRAIN() ((void) 0)
512 # endif
513 
514 // Change notification, pullups and pulldowns:
515 # if defined(_CNIEA3) || defined(__DOXYGEN__)
516 /// Enable the pullup on pin RA3.
517 # define ENABLE_RA3_PULLUP() (_CNPUA3 = 1)
518 /// Disable the pullup on pin RA3.
519 # define DISABLE_RA3_PULLUP() (_CNPUA3 = 0)
520 
521 /// Enable the pulldown on pin RA3.
522 # define ENABLE_RA3_PULLDOWN() (_CNPDA3 = 1)
523 /// Disable the pulldown on pin RA3.
524 # define DISABLE_RA3_PULLDOWN() (_CNPDA3 = 0)
525 
526 /// Enable the change notification interrupt on pin RA3.
527 # define ENABLE_RA3_CN_INTERRUPT() (_CNIEA3 = 1)
528 /// Disable the change notification interrupt on pin RA3.
529 # define DISABLE_RA3_CN_INTERRUPT() (_CNIEA3 = 0)
530 
531 # elif defined(RA3_CN)
532 # define ENABLE_RA3_PULLUP() (RXY_GPIO_CNPUE(RA3_CN) = 1)
533 # define DISABLE_RA3_PULLUP() (RXY_GPIO_CNPUE(RA3_CN) = 0)
534 
535 # if RXY_HAS_CNPDE(RA3_CN)
536 # define ENABLE_RA3_PULLDOWN() (RXY_GPIO_CNPDE(RA3_CN) = 1)
537 # define DISABLE_RA3_PULLDOWN() (RXY_GPIO_CNPDE(RA3_CN) = 0)
538 # else
539 # define DISABLE_RA3_PULLDOWN() ((void) 0)
540 # endif
541 
542 # define ENABLE_RA3_CN_INTERRUPT() (RXY_GPIO_CNIE(RA3_CN) = 1)
543 # define DISABLE_RA3_CN_INTERRUPT() (RXY_GPIO_CNIE(RA3_CN) = 0)
544 
545 # else
546 # define DISABLE_RA3_PULLUP() ((void) 0)
547 # define DISABLE_RA3_PULLDOWN() ((void) 0)
548 # define DISABLE_RA3_CN_INTERRUPT() ((void) 0)
549 # endif
550 
551 // High-level config
552 // -----------------
553 /** This macro disables pullups/downs, enables analog functionality, and configures
554  * pin RA3 as an input.
555  */
556 # if defined(_ANSA3) || defined(RA3_AN) || defined(__DOXYGEN__)
557 # define CONFIG_RA3_AS_ANALOG() \
558  do { \
559  ENABLE_RA3_ANALOG(); \
560  CONFIG_RA3_AS_INPUT(); \
561  DISABLE_RA3_OPENDRAIN(); \
562  DISABLE_RA3_PULLUP(); \
563  DISABLE_RA3_PULLDOWN(); \
564  } while (0)
565 # endif
566 
567 /** This macro disables open-drain and pullups/downs,
568  * configures pin RA3 for digital (not analog) operation, and
569  * configures the pin as an input.
570  */
571 # define CONFIG_RA3_AS_DIG_INPUT() \
572  do { \
573  DISABLE_RA3_ANALOG(); \
574  CONFIG_RA3_AS_INPUT(); \
575  DISABLE_RA3_OPENDRAIN(); \
576  DISABLE_RA3_PULLUP(); \
577  DISABLE_RA3_PULLDOWN(); \
578  } while (0)
579 
580 /** This macro disables open-drain and pullups/downs,
581  * configures pin RA3 for digital (not analog) operation, and
582  * configures the pin as an output.
583  */
584 # define CONFIG_RA3_AS_DIG_OUTPUT() \
585  do { \
586  DISABLE_RA3_ANALOG(); \
587  CONFIG_RA3_AS_OUTPUT(); \
588  DISABLE_RA3_OPENDRAIN(); \
589  DISABLE_RA3_PULLUP(); \
590  DISABLE_RA3_PULLDOWN(); \
591  } while (0)
592 
593 #endif // #if defined(_RA3) || defined(__DOXYGEN__): Provide GPIO for RA3
594 
595 
596 
597 
598 
599 // Provide GPIO for RA4
600 // ====================
601 #if defined(_RA4) || defined(__DOXYGEN__)
602 
603 // Dummy macros for documentation only
604 # ifdef __DOXYGEN__
605 /// This macro specifies the RPy value associated with pin RA4.
606 /// Its device-specific definition is given in pic24_ports_mapping.h.
607 # define RA4_RP xx
608 
609 /// This macro specifies the ANn value associated with pin RA4.
610 /// Its device-specific definition is given in pic24_ports_mapping.h.
611 # define RA4_AN xx
612 
613 /// This macro specifies the CNm value associated with pin RA4.
614 /// Its device-specific definition is given in pic24_ports_mapping.h.
615 # define RA4_CN xx
616 
617 //@}
618 # endif // #ifdef __DOXYGEN__
619 
620 
621 // Low-level config
622 // ----------------
623 // Analog:
624 # if defined(_ANSA4) || defined(__DOXYGEN__)
625 /// Enable analog functionality on pin RA4.
626 # define ENABLE_RA4_ANALOG() (_ANSA4 = 1)
627 /// Disable analog functionality on pin RA4.
628 # define DISABLE_RA4_ANALOG() (_ANSA4 = 0)
629 # elif defined(RA4_AN)
630 # define ENABLE_RA4_ANALOG() (RXY_GPIO_PCFG(RA4_AN) = 0)
631 # define DISABLE_RA4_ANALOG() (RXY_GPIO_PCFG(RA4_AN) = 1)
632 # else
633 # define DISABLE_RA4_ANALOG() ((void) 0)
634 # endif
635 
636 // Input/output:
637 /// Configure pin RA4 as an input.
638 # define CONFIG_RA4_AS_INPUT() (_TRISA4 = 1)
639 /// Configure pin RA4 as an output.
640 # define CONFIG_RA4_AS_OUTPUT() (_TRISA4 = 0)
641 
642 // Open-drain:
643 # if defined(_ODCA4) || defined(__DOXYGEN__)
644 /// Enable the open-drain driver on pin RA4.
645 # define ENABLE_RA4_OPENDRAIN() (_ODCA4 = 1)
646 /// Disable the open-drain driver on pin RA4.
647 # define DISABLE_RA4_OPENDRAIN() (_ODCA4 = 0)
648 # elif defined(_ODA4) // The PIF24F names this bit _OD instead of _ODC.
649 # define ENABLE_RA4_OPENDRAIN() (_ODA4 = 1)
650 # define DISABLE_RA4_OPENDRAIN() (_ODA4 = 0)
651 # else
652 # define DISABLE_RA4_OPENDRAIN() ((void) 0)
653 # endif
654 
655 // Change notification, pullups and pulldowns:
656 # if defined(_CNIEA4) || defined(__DOXYGEN__)
657 /// Enable the pullup on pin RA4.
658 # define ENABLE_RA4_PULLUP() (_CNPUA4 = 1)
659 /// Disable the pullup on pin RA4.
660 # define DISABLE_RA4_PULLUP() (_CNPUA4 = 0)
661 
662 /// Enable the pulldown on pin RA4.
663 # define ENABLE_RA4_PULLDOWN() (_CNPDA4 = 1)
664 /// Disable the pulldown on pin RA4.
665 # define DISABLE_RA4_PULLDOWN() (_CNPDA4 = 0)
666 
667 /// Enable the change notification interrupt on pin RA4.
668 # define ENABLE_RA4_CN_INTERRUPT() (_CNIEA4 = 1)
669 /// Disable the change notification interrupt on pin RA4.
670 # define DISABLE_RA4_CN_INTERRUPT() (_CNIEA4 = 0)
671 
672 # elif defined(RA4_CN)
673 # define ENABLE_RA4_PULLUP() (RXY_GPIO_CNPUE(RA4_CN) = 1)
674 # define DISABLE_RA4_PULLUP() (RXY_GPIO_CNPUE(RA4_CN) = 0)
675 
676 # if RXY_HAS_CNPDE(RA4_CN)
677 # define ENABLE_RA4_PULLDOWN() (RXY_GPIO_CNPDE(RA4_CN) = 1)
678 # define DISABLE_RA4_PULLDOWN() (RXY_GPIO_CNPDE(RA4_CN) = 0)
679 # else
680 # define DISABLE_RA4_PULLDOWN() ((void) 0)
681 # endif
682 
683 # define ENABLE_RA4_CN_INTERRUPT() (RXY_GPIO_CNIE(RA4_CN) = 1)
684 # define DISABLE_RA4_CN_INTERRUPT() (RXY_GPIO_CNIE(RA4_CN) = 0)
685 
686 # else
687 # define DISABLE_RA4_PULLUP() ((void) 0)
688 # define DISABLE_RA4_PULLDOWN() ((void) 0)
689 # define DISABLE_RA4_CN_INTERRUPT() ((void) 0)
690 # endif
691 
692 // High-level config
693 // -----------------
694 /** This macro disables pullups/downs, enables analog functionality, and configures
695  * pin RA4 as an input.
696  */
697 # if defined(_ANSA4) || defined(RA4_AN) || defined(__DOXYGEN__)
698 # define CONFIG_RA4_AS_ANALOG() \
699  do { \
700  ENABLE_RA4_ANALOG(); \
701  CONFIG_RA4_AS_INPUT(); \
702  DISABLE_RA4_OPENDRAIN(); \
703  DISABLE_RA4_PULLUP(); \
704  DISABLE_RA4_PULLDOWN(); \
705  } while (0)
706 # endif
707 
708 /** This macro disables open-drain and pullups/downs,
709  * configures pin RA4 for digital (not analog) operation, and
710  * configures the pin as an input.
711  */
712 # define CONFIG_RA4_AS_DIG_INPUT() \
713  do { \
714  DISABLE_RA4_ANALOG(); \
715  CONFIG_RA4_AS_INPUT(); \
716  DISABLE_RA4_OPENDRAIN(); \
717  DISABLE_RA4_PULLUP(); \
718  DISABLE_RA4_PULLDOWN(); \
719  } while (0)
720 
721 /** This macro disables open-drain and pullups/downs,
722  * configures pin RA4 for digital (not analog) operation, and
723  * configures the pin as an output.
724  */
725 # define CONFIG_RA4_AS_DIG_OUTPUT() \
726  do { \
727  DISABLE_RA4_ANALOG(); \
728  CONFIG_RA4_AS_OUTPUT(); \
729  DISABLE_RA4_OPENDRAIN(); \
730  DISABLE_RA4_PULLUP(); \
731  DISABLE_RA4_PULLDOWN(); \
732  } while (0)
733 
734 #endif // #if defined(_RA4) || defined(__DOXYGEN__): Provide GPIO for RA4
735 
736 
737 
738 
739 
740 // Provide GPIO for RA5
741 // ====================
742 #if defined(_RA5) || defined(__DOXYGEN__)
743 
744 // Dummy macros for documentation only
745 # ifdef __DOXYGEN__
746 /// This macro specifies the RPy value associated with pin RA5.
747 /// Its device-specific definition is given in pic24_ports_mapping.h.
748 # define RA5_RP xx
749 
750 /// This macro specifies the ANn value associated with pin RA5.
751 /// Its device-specific definition is given in pic24_ports_mapping.h.
752 # define RA5_AN xx
753 
754 /// This macro specifies the CNm value associated with pin RA5.
755 /// Its device-specific definition is given in pic24_ports_mapping.h.
756 # define RA5_CN xx
757 
758 //@}
759 # endif // #ifdef __DOXYGEN__
760 
761 
762 // Low-level config
763 // ----------------
764 // Analog:
765 # if defined(_ANSA5) || defined(__DOXYGEN__)
766 /// Enable analog functionality on pin RA5.
767 # define ENABLE_RA5_ANALOG() (_ANSA5 = 1)
768 /// Disable analog functionality on pin RA5.
769 # define DISABLE_RA5_ANALOG() (_ANSA5 = 0)
770 # elif defined(RA5_AN)
771 # define ENABLE_RA5_ANALOG() (RXY_GPIO_PCFG(RA5_AN) = 0)
772 # define DISABLE_RA5_ANALOG() (RXY_GPIO_PCFG(RA5_AN) = 1)
773 # else
774 # define DISABLE_RA5_ANALOG() ((void) 0)
775 # endif
776 
777 // Input/output:
778 /// Configure pin RA5 as an input.
779 # define CONFIG_RA5_AS_INPUT() (_TRISA5 = 1)
780 /// Configure pin RA5 as an output.
781 # define CONFIG_RA5_AS_OUTPUT() (_TRISA5 = 0)
782 
783 // Open-drain:
784 # if defined(_ODCA5) || defined(__DOXYGEN__)
785 /// Enable the open-drain driver on pin RA5.
786 # define ENABLE_RA5_OPENDRAIN() (_ODCA5 = 1)
787 /// Disable the open-drain driver on pin RA5.
788 # define DISABLE_RA5_OPENDRAIN() (_ODCA5 = 0)
789 # elif defined(_ODA5) // The PIF24F names this bit _OD instead of _ODC.
790 # define ENABLE_RA5_OPENDRAIN() (_ODA5 = 1)
791 # define DISABLE_RA5_OPENDRAIN() (_ODA5 = 0)
792 # else
793 # define DISABLE_RA5_OPENDRAIN() ((void) 0)
794 # endif
795 
796 // Change notification, pullups and pulldowns:
797 # if defined(_CNIEA5) || defined(__DOXYGEN__)
798 /// Enable the pullup on pin RA5.
799 # define ENABLE_RA5_PULLUP() (_CNPUA5 = 1)
800 /// Disable the pullup on pin RA5.
801 # define DISABLE_RA5_PULLUP() (_CNPUA5 = 0)
802 
803 /// Enable the pulldown on pin RA5.
804 # define ENABLE_RA5_PULLDOWN() (_CNPDA5 = 1)
805 /// Disable the pulldown on pin RA5.
806 # define DISABLE_RA5_PULLDOWN() (_CNPDA5 = 0)
807 
808 /// Enable the change notification interrupt on pin RA5.
809 # define ENABLE_RA5_CN_INTERRUPT() (_CNIEA5 = 1)
810 /// Disable the change notification interrupt on pin RA5.
811 # define DISABLE_RA5_CN_INTERRUPT() (_CNIEA5 = 0)
812 
813 # elif defined(RA5_CN)
814 # define ENABLE_RA5_PULLUP() (RXY_GPIO_CNPUE(RA5_CN) = 1)
815 # define DISABLE_RA5_PULLUP() (RXY_GPIO_CNPUE(RA5_CN) = 0)
816 
817 # if RXY_HAS_CNPDE(RA5_CN)
818 # define ENABLE_RA5_PULLDOWN() (RXY_GPIO_CNPDE(RA5_CN) = 1)
819 # define DISABLE_RA5_PULLDOWN() (RXY_GPIO_CNPDE(RA5_CN) = 0)
820 # else
821 # define DISABLE_RA5_PULLDOWN() ((void) 0)
822 # endif
823 
824 # define ENABLE_RA5_CN_INTERRUPT() (RXY_GPIO_CNIE(RA5_CN) = 1)
825 # define DISABLE_RA5_CN_INTERRUPT() (RXY_GPIO_CNIE(RA5_CN) = 0)
826 
827 # else
828 # define DISABLE_RA5_PULLUP() ((void) 0)
829 # define DISABLE_RA5_PULLDOWN() ((void) 0)
830 # define DISABLE_RA5_CN_INTERRUPT() ((void) 0)
831 # endif
832 
833 // High-level config
834 // -----------------
835 /** This macro disables pullups/downs, enables analog functionality, and configures
836  * pin RA5 as an input.
837  */
838 # if defined(_ANSA5) || defined(RA5_AN) || defined(__DOXYGEN__)
839 # define CONFIG_RA5_AS_ANALOG() \
840  do { \
841  ENABLE_RA5_ANALOG(); \
842  CONFIG_RA5_AS_INPUT(); \
843  DISABLE_RA5_OPENDRAIN(); \
844  DISABLE_RA5_PULLUP(); \
845  DISABLE_RA5_PULLDOWN(); \
846  } while (0)
847 # endif
848 
849 /** This macro disables open-drain and pullups/downs,
850  * configures pin RA5 for digital (not analog) operation, and
851  * configures the pin as an input.
852  */
853 # define CONFIG_RA5_AS_DIG_INPUT() \
854  do { \
855  DISABLE_RA5_ANALOG(); \
856  CONFIG_RA5_AS_INPUT(); \
857  DISABLE_RA5_OPENDRAIN(); \
858  DISABLE_RA5_PULLUP(); \
859  DISABLE_RA5_PULLDOWN(); \
860  } while (0)
861 
862 /** This macro disables open-drain and pullups/downs,
863  * configures pin RA5 for digital (not analog) operation, and
864  * configures the pin as an output.
865  */
866 # define CONFIG_RA5_AS_DIG_OUTPUT() \
867  do { \
868  DISABLE_RA5_ANALOG(); \
869  CONFIG_RA5_AS_OUTPUT(); \
870  DISABLE_RA5_OPENDRAIN(); \
871  DISABLE_RA5_PULLUP(); \
872  DISABLE_RA5_PULLDOWN(); \
873  } while (0)
874 
875 #endif // #if defined(_RA5) || defined(__DOXYGEN__): Provide GPIO for RA5
876 
877 
878 
879 
880 
881 // Provide GPIO for RA6
882 // ====================
883 #if defined(_RA6) || defined(__DOXYGEN__)
884 
885 // Dummy macros for documentation only
886 # ifdef __DOXYGEN__
887 /// This macro specifies the RPy value associated with pin RA6.
888 /// Its device-specific definition is given in pic24_ports_mapping.h.
889 # define RA6_RP xx
890 
891 /// This macro specifies the ANn value associated with pin RA6.
892 /// Its device-specific definition is given in pic24_ports_mapping.h.
893 # define RA6_AN xx
894 
895 /// This macro specifies the CNm value associated with pin RA6.
896 /// Its device-specific definition is given in pic24_ports_mapping.h.
897 # define RA6_CN xx
898 
899 //@}
900 # endif // #ifdef __DOXYGEN__
901 
902 
903 // Low-level config
904 // ----------------
905 // Analog:
906 # if defined(_ANSA6) || defined(__DOXYGEN__)
907 /// Enable analog functionality on pin RA6.
908 # define ENABLE_RA6_ANALOG() (_ANSA6 = 1)
909 /// Disable analog functionality on pin RA6.
910 # define DISABLE_RA6_ANALOG() (_ANSA6 = 0)
911 # elif defined(RA6_AN)
912 # define ENABLE_RA6_ANALOG() (RXY_GPIO_PCFG(RA6_AN) = 0)
913 # define DISABLE_RA6_ANALOG() (RXY_GPIO_PCFG(RA6_AN) = 1)
914 # else
915 # define DISABLE_RA6_ANALOG() ((void) 0)
916 # endif
917 
918 // Input/output:
919 /// Configure pin RA6 as an input.
920 # define CONFIG_RA6_AS_INPUT() (_TRISA6 = 1)
921 /// Configure pin RA6 as an output.
922 # define CONFIG_RA6_AS_OUTPUT() (_TRISA6 = 0)
923 
924 // Open-drain:
925 # if defined(_ODCA6) || defined(__DOXYGEN__)
926 /// Enable the open-drain driver on pin RA6.
927 # define ENABLE_RA6_OPENDRAIN() (_ODCA6 = 1)
928 /// Disable the open-drain driver on pin RA6.
929 # define DISABLE_RA6_OPENDRAIN() (_ODCA6 = 0)
930 # elif defined(_ODA6) // The PIF24F names this bit _OD instead of _ODC.
931 # define ENABLE_RA6_OPENDRAIN() (_ODA6 = 1)
932 # define DISABLE_RA6_OPENDRAIN() (_ODA6 = 0)
933 # else
934 # define DISABLE_RA6_OPENDRAIN() ((void) 0)
935 # endif
936 
937 // Change notification, pullups and pulldowns:
938 # if defined(_CNIEA6) || defined(__DOXYGEN__)
939 /// Enable the pullup on pin RA6.
940 # define ENABLE_RA6_PULLUP() (_CNPUA6 = 1)
941 /// Disable the pullup on pin RA6.
942 # define DISABLE_RA6_PULLUP() (_CNPUA6 = 0)
943 
944 /// Enable the pulldown on pin RA6.
945 # define ENABLE_RA6_PULLDOWN() (_CNPDA6 = 1)
946 /// Disable the pulldown on pin RA6.
947 # define DISABLE_RA6_PULLDOWN() (_CNPDA6 = 0)
948 
949 /// Enable the change notification interrupt on pin RA6.
950 # define ENABLE_RA6_CN_INTERRUPT() (_CNIEA6 = 1)
951 /// Disable the change notification interrupt on pin RA6.
952 # define DISABLE_RA6_CN_INTERRUPT() (_CNIEA6 = 0)
953 
954 # elif defined(RA6_CN)
955 # define ENABLE_RA6_PULLUP() (RXY_GPIO_CNPUE(RA6_CN) = 1)
956 # define DISABLE_RA6_PULLUP() (RXY_GPIO_CNPUE(RA6_CN) = 0)
957 
958 # if RXY_HAS_CNPDE(RA6_CN)
959 # define ENABLE_RA6_PULLDOWN() (RXY_GPIO_CNPDE(RA6_CN) = 1)
960 # define DISABLE_RA6_PULLDOWN() (RXY_GPIO_CNPDE(RA6_CN) = 0)
961 # else
962 # define DISABLE_RA6_PULLDOWN() ((void) 0)
963 # endif
964 
965 # define ENABLE_RA6_CN_INTERRUPT() (RXY_GPIO_CNIE(RA6_CN) = 1)
966 # define DISABLE_RA6_CN_INTERRUPT() (RXY_GPIO_CNIE(RA6_CN) = 0)
967 
968 # else
969 # define DISABLE_RA6_PULLUP() ((void) 0)
970 # define DISABLE_RA6_PULLDOWN() ((void) 0)
971 # define DISABLE_RA6_CN_INTERRUPT() ((void) 0)
972 # endif
973 
974 // High-level config
975 // -----------------
976 /** This macro disables pullups/downs, enables analog functionality, and configures
977  * pin RA6 as an input.
978  */
979 # if defined(_ANSA6) || defined(RA6_AN) || defined(__DOXYGEN__)
980 # define CONFIG_RA6_AS_ANALOG() \
981  do { \
982  ENABLE_RA6_ANALOG(); \
983  CONFIG_RA6_AS_INPUT(); \
984  DISABLE_RA6_OPENDRAIN(); \
985  DISABLE_RA6_PULLUP(); \
986  DISABLE_RA6_PULLDOWN(); \
987  } while (0)
988 # endif
989 
990 /** This macro disables open-drain and pullups/downs,
991  * configures pin RA6 for digital (not analog) operation, and
992  * configures the pin as an input.
993  */
994 # define CONFIG_RA6_AS_DIG_INPUT() \
995  do { \
996  DISABLE_RA6_ANALOG(); \
997  CONFIG_RA6_AS_INPUT(); \
998  DISABLE_RA6_OPENDRAIN(); \
999  DISABLE_RA6_PULLUP(); \
1000  DISABLE_RA6_PULLDOWN(); \
1001  } while (0)
1002 
1003 /** This macro disables open-drain and pullups/downs,
1004  * configures pin RA6 for digital (not analog) operation, and
1005  * configures the pin as an output.
1006  */
1007 # define CONFIG_RA6_AS_DIG_OUTPUT() \
1008  do { \
1009  DISABLE_RA6_ANALOG(); \
1010  CONFIG_RA6_AS_OUTPUT(); \
1011  DISABLE_RA6_OPENDRAIN(); \
1012  DISABLE_RA6_PULLUP(); \
1013  DISABLE_RA6_PULLDOWN(); \
1014  } while (0)
1015 
1016 #endif // #if defined(_RA6) || defined(__DOXYGEN__): Provide GPIO for RA6
1017 
1018 
1019 
1020 
1021 
1022 // Provide GPIO for RA7
1023 // ====================
1024 #if defined(_RA7) || defined(__DOXYGEN__)
1025 
1026 // Dummy macros for documentation only
1027 # ifdef __DOXYGEN__
1028 /// This macro specifies the RPy value associated with pin RA7.
1029 /// Its device-specific definition is given in pic24_ports_mapping.h.
1030 # define RA7_RP xx
1031 
1032 /// This macro specifies the ANn value associated with pin RA7.
1033 /// Its device-specific definition is given in pic24_ports_mapping.h.
1034 # define RA7_AN xx
1035 
1036 /// This macro specifies the CNm value associated with pin RA7.
1037 /// Its device-specific definition is given in pic24_ports_mapping.h.
1038 # define RA7_CN xx
1039 
1040 //@}
1041 # endif // #ifdef __DOXYGEN__
1042 
1043 
1044 // Low-level config
1045 // ----------------
1046 // Analog:
1047 # if defined(_ANSA7) || defined(__DOXYGEN__)
1048 /// Enable analog functionality on pin RA7.
1049 # define ENABLE_RA7_ANALOG() (_ANSA7 = 1)
1050 /// Disable analog functionality on pin RA7.
1051 # define DISABLE_RA7_ANALOG() (_ANSA7 = 0)
1052 # elif defined(RA7_AN)
1053 # define ENABLE_RA7_ANALOG() (RXY_GPIO_PCFG(RA7_AN) = 0)
1054 # define DISABLE_RA7_ANALOG() (RXY_GPIO_PCFG(RA7_AN) = 1)
1055 # else
1056 # define DISABLE_RA7_ANALOG() ((void) 0)
1057 # endif
1058 
1059 // Input/output:
1060 /// Configure pin RA7 as an input.
1061 # define CONFIG_RA7_AS_INPUT() (_TRISA7 = 1)
1062 /// Configure pin RA7 as an output.
1063 # define CONFIG_RA7_AS_OUTPUT() (_TRISA7 = 0)
1064 
1065 // Open-drain:
1066 # if defined(_ODCA7) || defined(__DOXYGEN__)
1067 /// Enable the open-drain driver on pin RA7.
1068 # define ENABLE_RA7_OPENDRAIN() (_ODCA7 = 1)
1069 /// Disable the open-drain driver on pin RA7.
1070 # define DISABLE_RA7_OPENDRAIN() (_ODCA7 = 0)
1071 # elif defined(_ODA7) // The PIF24F names this bit _OD instead of _ODC.
1072 # define ENABLE_RA7_OPENDRAIN() (_ODA7 = 1)
1073 # define DISABLE_RA7_OPENDRAIN() (_ODA7 = 0)
1074 # else
1075 # define DISABLE_RA7_OPENDRAIN() ((void) 0)
1076 # endif
1077 
1078 // Change notification, pullups and pulldowns:
1079 # if defined(_CNIEA7) || defined(__DOXYGEN__)
1080 /// Enable the pullup on pin RA7.
1081 # define ENABLE_RA7_PULLUP() (_CNPUA7 = 1)
1082 /// Disable the pullup on pin RA7.
1083 # define DISABLE_RA7_PULLUP() (_CNPUA7 = 0)
1084 
1085 /// Enable the pulldown on pin RA7.
1086 # define ENABLE_RA7_PULLDOWN() (_CNPDA7 = 1)
1087 /// Disable the pulldown on pin RA7.
1088 # define DISABLE_RA7_PULLDOWN() (_CNPDA7 = 0)
1089 
1090 /// Enable the change notification interrupt on pin RA7.
1091 # define ENABLE_RA7_CN_INTERRUPT() (_CNIEA7 = 1)
1092 /// Disable the change notification interrupt on pin RA7.
1093 # define DISABLE_RA7_CN_INTERRUPT() (_CNIEA7 = 0)
1094 
1095 # elif defined(RA7_CN)
1096 # define ENABLE_RA7_PULLUP() (RXY_GPIO_CNPUE(RA7_CN) = 1)
1097 # define DISABLE_RA7_PULLUP() (RXY_GPIO_CNPUE(RA7_CN) = 0)
1098 
1099 # if RXY_HAS_CNPDE(RA7_CN)
1100 # define ENABLE_RA7_PULLDOWN() (RXY_GPIO_CNPDE(RA7_CN) = 1)
1101 # define DISABLE_RA7_PULLDOWN() (RXY_GPIO_CNPDE(RA7_CN) = 0)
1102 # else
1103 # define DISABLE_RA7_PULLDOWN() ((void) 0)
1104 # endif
1105 
1106 # define ENABLE_RA7_CN_INTERRUPT() (RXY_GPIO_CNIE(RA7_CN) = 1)
1107 # define DISABLE_RA7_CN_INTERRUPT() (RXY_GPIO_CNIE(RA7_CN) = 0)
1108 
1109 # else
1110 # define DISABLE_RA7_PULLUP() ((void) 0)
1111 # define DISABLE_RA7_PULLDOWN() ((void) 0)
1112 # define DISABLE_RA7_CN_INTERRUPT() ((void) 0)
1113 # endif
1114 
1115 // High-level config
1116 // -----------------
1117 /** This macro disables pullups/downs, enables analog functionality, and configures
1118  * pin RA7 as an input.
1119  */
1120 # if defined(_ANSA7) || defined(RA7_AN) || defined(__DOXYGEN__)
1121 # define CONFIG_RA7_AS_ANALOG() \
1122  do { \
1123  ENABLE_RA7_ANALOG(); \
1124  CONFIG_RA7_AS_INPUT(); \
1125  DISABLE_RA7_OPENDRAIN(); \
1126  DISABLE_RA7_PULLUP(); \
1127  DISABLE_RA7_PULLDOWN(); \
1128  } while (0)
1129 # endif
1130 
1131 /** This macro disables open-drain and pullups/downs,
1132  * configures pin RA7 for digital (not analog) operation, and
1133  * configures the pin as an input.
1134  */
1135 # define CONFIG_RA7_AS_DIG_INPUT() \
1136  do { \
1137  DISABLE_RA7_ANALOG(); \
1138  CONFIG_RA7_AS_INPUT(); \
1139  DISABLE_RA7_OPENDRAIN(); \
1140  DISABLE_RA7_PULLUP(); \
1141  DISABLE_RA7_PULLDOWN(); \
1142  } while (0)
1143 
1144 /** This macro disables open-drain and pullups/downs,
1145  * configures pin RA7 for digital (not analog) operation, and
1146  * configures the pin as an output.
1147  */
1148 # define CONFIG_RA7_AS_DIG_OUTPUT() \
1149  do { \
1150  DISABLE_RA7_ANALOG(); \
1151  CONFIG_RA7_AS_OUTPUT(); \
1152  DISABLE_RA7_OPENDRAIN(); \
1153  DISABLE_RA7_PULLUP(); \
1154  DISABLE_RA7_PULLDOWN(); \
1155  } while (0)
1156 
1157 #endif // #if defined(_RA7) || defined(__DOXYGEN__): Provide GPIO for RA7
1158 
1159 
1160 
1161 
1162 
1163 // Provide GPIO for RA8
1164 // ====================
1165 #if defined(_RA8) || defined(__DOXYGEN__)
1166 
1167 // Dummy macros for documentation only
1168 # ifdef __DOXYGEN__
1169 /// This macro specifies the RPy value associated with pin RA8.
1170 /// Its device-specific definition is given in pic24_ports_mapping.h.
1171 # define RA8_RP xx
1172 
1173 /// This macro specifies the ANn value associated with pin RA8.
1174 /// Its device-specific definition is given in pic24_ports_mapping.h.
1175 # define RA8_AN xx
1176 
1177 /// This macro specifies the CNm value associated with pin RA8.
1178 /// Its device-specific definition is given in pic24_ports_mapping.h.
1179 # define RA8_CN xx
1180 
1181 //@}
1182 # endif // #ifdef __DOXYGEN__
1183 
1184 
1185 // Low-level config
1186 // ----------------
1187 // Analog:
1188 # if defined(_ANSA8) || defined(__DOXYGEN__)
1189 /// Enable analog functionality on pin RA8.
1190 # define ENABLE_RA8_ANALOG() (_ANSA8 = 1)
1191 /// Disable analog functionality on pin RA8.
1192 # define DISABLE_RA8_ANALOG() (_ANSA8 = 0)
1193 # elif defined(RA8_AN)
1194 # define ENABLE_RA8_ANALOG() (RXY_GPIO_PCFG(RA8_AN) = 0)
1195 # define DISABLE_RA8_ANALOG() (RXY_GPIO_PCFG(RA8_AN) = 1)
1196 # else
1197 # define DISABLE_RA8_ANALOG() ((void) 0)
1198 # endif
1199 
1200 // Input/output:
1201 /// Configure pin RA8 as an input.
1202 # define CONFIG_RA8_AS_INPUT() (_TRISA8 = 1)
1203 /// Configure pin RA8 as an output.
1204 # define CONFIG_RA8_AS_OUTPUT() (_TRISA8 = 0)
1205 
1206 // Open-drain:
1207 # if defined(_ODCA8) || defined(__DOXYGEN__)
1208 /// Enable the open-drain driver on pin RA8.
1209 # define ENABLE_RA8_OPENDRAIN() (_ODCA8 = 1)
1210 /// Disable the open-drain driver on pin RA8.
1211 # define DISABLE_RA8_OPENDRAIN() (_ODCA8 = 0)
1212 # elif defined(_ODA8) // The PIF24F names this bit _OD instead of _ODC.
1213 # define ENABLE_RA8_OPENDRAIN() (_ODA8 = 1)
1214 # define DISABLE_RA8_OPENDRAIN() (_ODA8 = 0)
1215 # else
1216 # define DISABLE_RA8_OPENDRAIN() ((void) 0)
1217 # endif
1218 
1219 // Change notification, pullups and pulldowns:
1220 # if defined(_CNIEA8) || defined(__DOXYGEN__)
1221 /// Enable the pullup on pin RA8.
1222 # define ENABLE_RA8_PULLUP() (_CNPUA8 = 1)
1223 /// Disable the pullup on pin RA8.
1224 # define DISABLE_RA8_PULLUP() (_CNPUA8 = 0)
1225 
1226 /// Enable the pulldown on pin RA8.
1227 # define ENABLE_RA8_PULLDOWN() (_CNPDA8 = 1)
1228 /// Disable the pulldown on pin RA8.
1229 # define DISABLE_RA8_PULLDOWN() (_CNPDA8 = 0)
1230 
1231 /// Enable the change notification interrupt on pin RA8.
1232 # define ENABLE_RA8_CN_INTERRUPT() (_CNIEA8 = 1)
1233 /// Disable the change notification interrupt on pin RA8.
1234 # define DISABLE_RA8_CN_INTERRUPT() (_CNIEA8 = 0)
1235 
1236 # elif defined(RA8_CN)
1237 # define ENABLE_RA8_PULLUP() (RXY_GPIO_CNPUE(RA8_CN) = 1)
1238 # define DISABLE_RA8_PULLUP() (RXY_GPIO_CNPUE(RA8_CN) = 0)
1239 
1240 # if RXY_HAS_CNPDE(RA8_CN)
1241 # define ENABLE_RA8_PULLDOWN() (RXY_GPIO_CNPDE(RA8_CN) = 1)
1242 # define DISABLE_RA8_PULLDOWN() (RXY_GPIO_CNPDE(RA8_CN) = 0)
1243 # else
1244 # define DISABLE_RA8_PULLDOWN() ((void) 0)
1245 # endif
1246 
1247 # define ENABLE_RA8_CN_INTERRUPT() (RXY_GPIO_CNIE(RA8_CN) = 1)
1248 # define DISABLE_RA8_CN_INTERRUPT() (RXY_GPIO_CNIE(RA8_CN) = 0)
1249 
1250 # else
1251 # define DISABLE_RA8_PULLUP() ((void) 0)
1252 # define DISABLE_RA8_PULLDOWN() ((void) 0)
1253 # define DISABLE_RA8_CN_INTERRUPT() ((void) 0)
1254 # endif
1255 
1256 // High-level config
1257 // -----------------
1258 /** This macro disables pullups/downs, enables analog functionality, and configures
1259  * pin RA8 as an input.
1260  */
1261 # if defined(_ANSA8) || defined(RA8_AN) || defined(__DOXYGEN__)
1262 # define CONFIG_RA8_AS_ANALOG() \
1263  do { \
1264  ENABLE_RA8_ANALOG(); \
1265  CONFIG_RA8_AS_INPUT(); \
1266  DISABLE_RA8_OPENDRAIN(); \
1267  DISABLE_RA8_PULLUP(); \
1268  DISABLE_RA8_PULLDOWN(); \
1269  } while (0)
1270 # endif
1271 
1272 /** This macro disables open-drain and pullups/downs,
1273  * configures pin RA8 for digital (not analog) operation, and
1274  * configures the pin as an input.
1275  */
1276 # define CONFIG_RA8_AS_DIG_INPUT() \
1277  do { \
1278  DISABLE_RA8_ANALOG(); \
1279  CONFIG_RA8_AS_INPUT(); \
1280  DISABLE_RA8_OPENDRAIN(); \
1281  DISABLE_RA8_PULLUP(); \
1282  DISABLE_RA8_PULLDOWN(); \
1283  } while (0)
1284 
1285 /** This macro disables open-drain and pullups/downs,
1286  * configures pin RA8 for digital (not analog) operation, and
1287  * configures the pin as an output.
1288  */
1289 # define CONFIG_RA8_AS_DIG_OUTPUT() \
1290  do { \
1291  DISABLE_RA8_ANALOG(); \
1292  CONFIG_RA8_AS_OUTPUT(); \
1293  DISABLE_RA8_OPENDRAIN(); \
1294  DISABLE_RA8_PULLUP(); \
1295  DISABLE_RA8_PULLDOWN(); \
1296  } while (0)
1297 
1298 #endif // #if defined(_RA8) || defined(__DOXYGEN__): Provide GPIO for RA8
1299 
1300 
1301 
1302 
1303 
1304 // Provide GPIO for RA9
1305 // ====================
1306 #if defined(_RA9) || defined(__DOXYGEN__)
1307 
1308 // Dummy macros for documentation only
1309 # ifdef __DOXYGEN__
1310 /// This macro specifies the RPy value associated with pin RA9.
1311 /// Its device-specific definition is given in pic24_ports_mapping.h.
1312 # define RA9_RP xx
1313 
1314 /// This macro specifies the ANn value associated with pin RA9.
1315 /// Its device-specific definition is given in pic24_ports_mapping.h.
1316 # define RA9_AN xx
1317 
1318 /// This macro specifies the CNm value associated with pin RA9.
1319 /// Its device-specific definition is given in pic24_ports_mapping.h.
1320 # define RA9_CN xx
1321 
1322 //@}
1323 # endif // #ifdef __DOXYGEN__
1324 
1325 
1326 // Low-level config
1327 // ----------------
1328 // Analog:
1329 # if defined(_ANSA9) || defined(__DOXYGEN__)
1330 /// Enable analog functionality on pin RA9.
1331 # define ENABLE_RA9_ANALOG() (_ANSA9 = 1)
1332 /// Disable analog functionality on pin RA9.
1333 # define DISABLE_RA9_ANALOG() (_ANSA9 = 0)
1334 # elif defined(RA9_AN)
1335 # define ENABLE_RA9_ANALOG() (RXY_GPIO_PCFG(RA9_AN) = 0)
1336 # define DISABLE_RA9_ANALOG() (RXY_GPIO_PCFG(RA9_AN) = 1)
1337 # else
1338 # define DISABLE_RA9_ANALOG() ((void) 0)
1339 # endif
1340 
1341 // Input/output:
1342 /// Configure pin RA9 as an input.
1343 # define CONFIG_RA9_AS_INPUT() (_TRISA9 = 1)
1344 /// Configure pin RA9 as an output.
1345 # define CONFIG_RA9_AS_OUTPUT() (_TRISA9 = 0)
1346 
1347 // Open-drain:
1348 # if defined(_ODCA9) || defined(__DOXYGEN__)
1349 /// Enable the open-drain driver on pin RA9.
1350 # define ENABLE_RA9_OPENDRAIN() (_ODCA9 = 1)
1351 /// Disable the open-drain driver on pin RA9.
1352 # define DISABLE_RA9_OPENDRAIN() (_ODCA9 = 0)
1353 # elif defined(_ODA9) // The PIF24F names this bit _OD instead of _ODC.
1354 # define ENABLE_RA9_OPENDRAIN() (_ODA9 = 1)
1355 # define DISABLE_RA9_OPENDRAIN() (_ODA9 = 0)
1356 # else
1357 # define DISABLE_RA9_OPENDRAIN() ((void) 0)
1358 # endif
1359 
1360 // Change notification, pullups and pulldowns:
1361 # if defined(_CNIEA9) || defined(__DOXYGEN__)
1362 /// Enable the pullup on pin RA9.
1363 # define ENABLE_RA9_PULLUP() (_CNPUA9 = 1)
1364 /// Disable the pullup on pin RA9.
1365 # define DISABLE_RA9_PULLUP() (_CNPUA9 = 0)
1366 
1367 /// Enable the pulldown on pin RA9.
1368 # define ENABLE_RA9_PULLDOWN() (_CNPDA9 = 1)
1369 /// Disable the pulldown on pin RA9.
1370 # define DISABLE_RA9_PULLDOWN() (_CNPDA9 = 0)
1371 
1372 /// Enable the change notification interrupt on pin RA9.
1373 # define ENABLE_RA9_CN_INTERRUPT() (_CNIEA9 = 1)
1374 /// Disable the change notification interrupt on pin RA9.
1375 # define DISABLE_RA9_CN_INTERRUPT() (_CNIEA9 = 0)
1376 
1377 # elif defined(RA9_CN)
1378 # define ENABLE_RA9_PULLUP() (RXY_GPIO_CNPUE(RA9_CN) = 1)
1379 # define DISABLE_RA9_PULLUP() (RXY_GPIO_CNPUE(RA9_CN) = 0)
1380 
1381 # if RXY_HAS_CNPDE(RA9_CN)
1382 # define ENABLE_RA9_PULLDOWN() (RXY_GPIO_CNPDE(RA9_CN) = 1)
1383 # define DISABLE_RA9_PULLDOWN() (RXY_GPIO_CNPDE(RA9_CN) = 0)
1384 # else
1385 # define DISABLE_RA9_PULLDOWN() ((void) 0)
1386 # endif
1387 
1388 # define ENABLE_RA9_CN_INTERRUPT() (RXY_GPIO_CNIE(RA9_CN) = 1)
1389 # define DISABLE_RA9_CN_INTERRUPT() (RXY_GPIO_CNIE(RA9_CN) = 0)
1390 
1391 # else
1392 # define DISABLE_RA9_PULLUP() ((void) 0)
1393 # define DISABLE_RA9_PULLDOWN() ((void) 0)
1394 # define DISABLE_RA9_CN_INTERRUPT() ((void) 0)
1395 # endif
1396 
1397 // High-level config
1398 // -----------------
1399 /** This macro disables pullups/downs, enables analog functionality, and configures
1400  * pin RA9 as an input.
1401  */
1402 # if defined(_ANSA9) || defined(RA9_AN) || defined(__DOXYGEN__)
1403 # define CONFIG_RA9_AS_ANALOG() \
1404  do { \
1405  ENABLE_RA9_ANALOG(); \
1406  CONFIG_RA9_AS_INPUT(); \
1407  DISABLE_RA9_OPENDRAIN(); \
1408  DISABLE_RA9_PULLUP(); \
1409  DISABLE_RA9_PULLDOWN(); \
1410  } while (0)
1411 # endif
1412 
1413 /** This macro disables open-drain and pullups/downs,
1414  * configures pin RA9 for digital (not analog) operation, and
1415  * configures the pin as an input.
1416  */
1417 # define CONFIG_RA9_AS_DIG_INPUT() \
1418  do { \
1419  DISABLE_RA9_ANALOG(); \
1420  CONFIG_RA9_AS_INPUT(); \
1421  DISABLE_RA9_OPENDRAIN(); \
1422  DISABLE_RA9_PULLUP(); \
1423  DISABLE_RA9_PULLDOWN(); \
1424  } while (0)
1425 
1426 /** This macro disables open-drain and pullups/downs,
1427  * configures pin RA9 for digital (not analog) operation, and
1428  * configures the pin as an output.
1429  */
1430 # define CONFIG_RA9_AS_DIG_OUTPUT() \
1431  do { \
1432  DISABLE_RA9_ANALOG(); \
1433  CONFIG_RA9_AS_OUTPUT(); \
1434  DISABLE_RA9_OPENDRAIN(); \
1435  DISABLE_RA9_PULLUP(); \
1436  DISABLE_RA9_PULLDOWN(); \
1437  } while (0)
1438 
1439 #endif // #if defined(_RA9) || defined(__DOXYGEN__): Provide GPIO for RA9
1440 
1441 
1442 
1443 
1444 
1445 // Provide GPIO for RA10
1446 // ====================
1447 #if defined(_RA10) || defined(__DOXYGEN__)
1448 
1449 // Dummy macros for documentation only
1450 # ifdef __DOXYGEN__
1451 /// This macro specifies the RPy value associated with pin RA10.
1452 /// Its device-specific definition is given in pic24_ports_mapping.h.
1453 # define RA10_RP xx
1454 
1455 /// This macro specifies the ANn value associated with pin RA10.
1456 /// Its device-specific definition is given in pic24_ports_mapping.h.
1457 # define RA10_AN xx
1458 
1459 /// This macro specifies the CNm value associated with pin RA10.
1460 /// Its device-specific definition is given in pic24_ports_mapping.h.
1461 # define RA10_CN xx
1462 
1463 //@}
1464 # endif // #ifdef __DOXYGEN__
1465 
1466 
1467 // Low-level config
1468 // ----------------
1469 // Analog:
1470 # if defined(_ANSA10) || defined(__DOXYGEN__)
1471 /// Enable analog functionality on pin RA10.
1472 # define ENABLE_RA10_ANALOG() (_ANSA10 = 1)
1473 /// Disable analog functionality on pin RA10.
1474 # define DISABLE_RA10_ANALOG() (_ANSA10 = 0)
1475 # elif defined(RA10_AN)
1476 # define ENABLE_RA10_ANALOG() (RXY_GPIO_PCFG(RA10_AN) = 0)
1477 # define DISABLE_RA10_ANALOG() (RXY_GPIO_PCFG(RA10_AN) = 1)
1478 # else
1479 # define DISABLE_RA10_ANALOG() ((void) 0)
1480 # endif
1481 
1482 // Input/output:
1483 /// Configure pin RA10 as an input.
1484 # define CONFIG_RA10_AS_INPUT() (_TRISA10 = 1)
1485 /// Configure pin RA10 as an output.
1486 # define CONFIG_RA10_AS_OUTPUT() (_TRISA10 = 0)
1487 
1488 // Open-drain:
1489 # if defined(_ODCA10) || defined(__DOXYGEN__)
1490 /// Enable the open-drain driver on pin RA10.
1491 # define ENABLE_RA10_OPENDRAIN() (_ODCA10 = 1)
1492 /// Disable the open-drain driver on pin RA10.
1493 # define DISABLE_RA10_OPENDRAIN() (_ODCA10 = 0)
1494 # elif defined(_ODA10) // The PIF24F names this bit _OD instead of _ODC.
1495 # define ENABLE_RA10_OPENDRAIN() (_ODA10 = 1)
1496 # define DISABLE_RA10_OPENDRAIN() (_ODA10 = 0)
1497 # else
1498 # define DISABLE_RA10_OPENDRAIN() ((void) 0)
1499 # endif
1500 
1501 // Change notification, pullups and pulldowns:
1502 # if defined(_CNIEA10) || defined(__DOXYGEN__)
1503 /// Enable the pullup on pin RA10.
1504 # define ENABLE_RA10_PULLUP() (_CNPUA10 = 1)
1505 /// Disable the pullup on pin RA10.
1506 # define DISABLE_RA10_PULLUP() (_CNPUA10 = 0)
1507 
1508 /// Enable the pulldown on pin RA10.
1509 # define ENABLE_RA10_PULLDOWN() (_CNPDA10 = 1)
1510 /// Disable the pulldown on pin RA10.
1511 # define DISABLE_RA10_PULLDOWN() (_CNPDA10 = 0)
1512 
1513 /// Enable the change notification interrupt on pin RA10.
1514 # define ENABLE_RA10_CN_INTERRUPT() (_CNIEA10 = 1)
1515 /// Disable the change notification interrupt on pin RA10.
1516 # define DISABLE_RA10_CN_INTERRUPT() (_CNIEA10 = 0)
1517 
1518 # elif defined(RA10_CN)
1519 # define ENABLE_RA10_PULLUP() (RXY_GPIO_CNPUE(RA10_CN) = 1)
1520 # define DISABLE_RA10_PULLUP() (RXY_GPIO_CNPUE(RA10_CN) = 0)
1521 
1522 # if RXY_HAS_CNPDE(RA10_CN)
1523 # define ENABLE_RA10_PULLDOWN() (RXY_GPIO_CNPDE(RA10_CN) = 1)
1524 # define DISABLE_RA10_PULLDOWN() (RXY_GPIO_CNPDE(RA10_CN) = 0)
1525 # else
1526 # define DISABLE_RA10_PULLDOWN() ((void) 0)
1527 # endif
1528 
1529 # define ENABLE_RA10_CN_INTERRUPT() (RXY_GPIO_CNIE(RA10_CN) = 1)
1530 # define DISABLE_RA10_CN_INTERRUPT() (RXY_GPIO_CNIE(RA10_CN) = 0)
1531 
1532 # else
1533 # define DISABLE_RA10_PULLUP() ((void) 0)
1534 # define DISABLE_RA10_PULLDOWN() ((void) 0)
1535 # define DISABLE_RA10_CN_INTERRUPT() ((void) 0)
1536 # endif
1537 
1538 // High-level config
1539 // -----------------
1540 /** This macro disables pullups/downs, enables analog functionality, and configures
1541  * pin RA10 as an input.
1542  */
1543 # if defined(_ANSA10) || defined(RA10_AN) || defined(__DOXYGEN__)
1544 # define CONFIG_RA10_AS_ANALOG() \
1545  do { \
1546  ENABLE_RA10_ANALOG(); \
1547  CONFIG_RA10_AS_INPUT(); \
1548  DISABLE_RA10_OPENDRAIN(); \
1549  DISABLE_RA10_PULLUP(); \
1550  DISABLE_RA10_PULLDOWN(); \
1551  } while (0)
1552 # endif
1553 
1554 /** This macro disables open-drain and pullups/downs,
1555  * configures pin RA10 for digital (not analog) operation, and
1556  * configures the pin as an input.
1557  */
1558 # define CONFIG_RA10_AS_DIG_INPUT() \
1559  do { \
1560  DISABLE_RA10_ANALOG(); \
1561  CONFIG_RA10_AS_INPUT(); \
1562  DISABLE_RA10_OPENDRAIN(); \
1563  DISABLE_RA10_PULLUP(); \
1564  DISABLE_RA10_PULLDOWN(); \
1565  } while (0)
1566 
1567 /** This macro disables open-drain and pullups/downs,
1568  * configures pin RA10 for digital (not analog) operation, and
1569  * configures the pin as an output.
1570  */
1571 # define CONFIG_RA10_AS_DIG_OUTPUT() \
1572  do { \
1573  DISABLE_RA10_ANALOG(); \
1574  CONFIG_RA10_AS_OUTPUT(); \
1575  DISABLE_RA10_OPENDRAIN(); \
1576  DISABLE_RA10_PULLUP(); \
1577  DISABLE_RA10_PULLDOWN(); \
1578  } while (0)
1579 
1580 #endif // #if defined(_RA10) || defined(__DOXYGEN__): Provide GPIO for RA10
1581 
1582 
1583 
1584 
1585 
1586 // Provide GPIO for RA11
1587 // ====================
1588 #if defined(_RA11) || defined(__DOXYGEN__)
1589 
1590 // Dummy macros for documentation only
1591 # ifdef __DOXYGEN__
1592 /// This macro specifies the RPy value associated with pin RA11.
1593 /// Its device-specific definition is given in pic24_ports_mapping.h.
1594 # define RA11_RP xx
1595 
1596 /// This macro specifies the ANn value associated with pin RA11.
1597 /// Its device-specific definition is given in pic24_ports_mapping.h.
1598 # define RA11_AN xx
1599 
1600 /// This macro specifies the CNm value associated with pin RA11.
1601 /// Its device-specific definition is given in pic24_ports_mapping.h.
1602 # define RA11_CN xx
1603 
1604 //@}
1605 # endif // #ifdef __DOXYGEN__
1606 
1607 
1608 // Low-level config
1609 // ----------------
1610 // Analog:
1611 # if defined(_ANSA11) || defined(__DOXYGEN__)
1612 /// Enable analog functionality on pin RA11.
1613 # define ENABLE_RA11_ANALOG() (_ANSA11 = 1)
1614 /// Disable analog functionality on pin RA11.
1615 # define DISABLE_RA11_ANALOG() (_ANSA11 = 0)
1616 # elif defined(RA11_AN)
1617 # define ENABLE_RA11_ANALOG() (RXY_GPIO_PCFG(RA11_AN) = 0)
1618 # define DISABLE_RA11_ANALOG() (RXY_GPIO_PCFG(RA11_AN) = 1)
1619 # else
1620 # define DISABLE_RA11_ANALOG() ((void) 0)
1621 # endif
1622 
1623 // Input/output:
1624 /// Configure pin RA11 as an input.
1625 # define CONFIG_RA11_AS_INPUT() (_TRISA11 = 1)
1626 /// Configure pin RA11 as an output.
1627 # define CONFIG_RA11_AS_OUTPUT() (_TRISA11 = 0)
1628 
1629 // Open-drain:
1630 # if defined(_ODCA11) || defined(__DOXYGEN__)
1631 /// Enable the open-drain driver on pin RA11.
1632 # define ENABLE_RA11_OPENDRAIN() (_ODCA11 = 1)
1633 /// Disable the open-drain driver on pin RA11.
1634 # define DISABLE_RA11_OPENDRAIN() (_ODCA11 = 0)
1635 # elif defined(_ODA11) // The PIF24F names this bit _OD instead of _ODC.
1636 # define ENABLE_RA11_OPENDRAIN() (_ODA11 = 1)
1637 # define DISABLE_RA11_OPENDRAIN() (_ODA11 = 0)
1638 # else
1639 # define DISABLE_RA11_OPENDRAIN() ((void) 0)
1640 # endif
1641 
1642 // Change notification, pullups and pulldowns:
1643 # if defined(_CNIEA11) || defined(__DOXYGEN__)
1644 /// Enable the pullup on pin RA11.
1645 # define ENABLE_RA11_PULLUP() (_CNPUA11 = 1)
1646 /// Disable the pullup on pin RA11.
1647 # define DISABLE_RA11_PULLUP() (_CNPUA11 = 0)
1648 
1649 /// Enable the pulldown on pin RA11.
1650 # define ENABLE_RA11_PULLDOWN() (_CNPDA11 = 1)
1651 /// Disable the pulldown on pin RA11.
1652 # define DISABLE_RA11_PULLDOWN() (_CNPDA11 = 0)
1653 
1654 /// Enable the change notification interrupt on pin RA11.
1655 # define ENABLE_RA11_CN_INTERRUPT() (_CNIEA11 = 1)
1656 /// Disable the change notification interrupt on pin RA11.
1657 # define DISABLE_RA11_CN_INTERRUPT() (_CNIEA11 = 0)
1658 
1659 # elif defined(RA11_CN)
1660 # define ENABLE_RA11_PULLUP() (RXY_GPIO_CNPUE(RA11_CN) = 1)
1661 # define DISABLE_RA11_PULLUP() (RXY_GPIO_CNPUE(RA11_CN) = 0)
1662 
1663 # if RXY_HAS_CNPDE(RA11_CN)
1664 # define ENABLE_RA11_PULLDOWN() (RXY_GPIO_CNPDE(RA11_CN) = 1)
1665 # define DISABLE_RA11_PULLDOWN() (RXY_GPIO_CNPDE(RA11_CN) = 0)
1666 # else
1667 # define DISABLE_RA11_PULLDOWN() ((void) 0)
1668 # endif
1669 
1670 # define ENABLE_RA11_CN_INTERRUPT() (RXY_GPIO_CNIE(RA11_CN) = 1)
1671 # define DISABLE_RA11_CN_INTERRUPT() (RXY_GPIO_CNIE(RA11_CN) = 0)
1672 
1673 # else
1674 # define DISABLE_RA11_PULLUP() ((void) 0)
1675 # define DISABLE_RA11_PULLDOWN() ((void) 0)
1676 # define DISABLE_RA11_CN_INTERRUPT() ((void) 0)
1677 # endif
1678 
1679 // High-level config
1680 // -----------------
1681 /** This macro disables pullups/downs, enables analog functionality, and configures
1682  * pin RA11 as an input.
1683  */
1684 # if defined(_ANSA11) || defined(RA11_AN) || defined(__DOXYGEN__)
1685 # define CONFIG_RA11_AS_ANALOG() \
1686  do { \
1687  ENABLE_RA11_ANALOG(); \
1688  CONFIG_RA11_AS_INPUT(); \
1689  DISABLE_RA11_OPENDRAIN(); \
1690  DISABLE_RA11_PULLUP(); \
1691  DISABLE_RA11_PULLDOWN(); \
1692  } while (0)
1693 # endif
1694 
1695 /** This macro disables open-drain and pullups/downs,
1696  * configures pin RA11 for digital (not analog) operation, and
1697  * configures the pin as an input.
1698  */
1699 # define CONFIG_RA11_AS_DIG_INPUT() \
1700  do { \
1701  DISABLE_RA11_ANALOG(); \
1702  CONFIG_RA11_AS_INPUT(); \
1703  DISABLE_RA11_OPENDRAIN(); \
1704  DISABLE_RA11_PULLUP(); \
1705  DISABLE_RA11_PULLDOWN(); \
1706  } while (0)
1707 
1708 /** This macro disables open-drain and pullups/downs,
1709  * configures pin RA11 for digital (not analog) operation, and
1710  * configures the pin as an output.
1711  */
1712 # define CONFIG_RA11_AS_DIG_OUTPUT() \
1713  do { \
1714  DISABLE_RA11_ANALOG(); \
1715  CONFIG_RA11_AS_OUTPUT(); \
1716  DISABLE_RA11_OPENDRAIN(); \
1717  DISABLE_RA11_PULLUP(); \
1718  DISABLE_RA11_PULLDOWN(); \
1719  } while (0)
1720 
1721 #endif // #if defined(_RA11) || defined(__DOXYGEN__): Provide GPIO for RA11
1722 
1723 
1724 
1725 
1726 
1727 // Provide GPIO for RA12
1728 // ====================
1729 #if defined(_RA12) || defined(__DOXYGEN__)
1730 
1731 // Dummy macros for documentation only
1732 # ifdef __DOXYGEN__
1733 /// This macro specifies the RPy value associated with pin RA12.
1734 /// Its device-specific definition is given in pic24_ports_mapping.h.
1735 # define RA12_RP xx
1736 
1737 /// This macro specifies the ANn value associated with pin RA12.
1738 /// Its device-specific definition is given in pic24_ports_mapping.h.
1739 # define RA12_AN xx
1740 
1741 /// This macro specifies the CNm value associated with pin RA12.
1742 /// Its device-specific definition is given in pic24_ports_mapping.h.
1743 # define RA12_CN xx
1744 
1745 //@}
1746 # endif // #ifdef __DOXYGEN__
1747 
1748 
1749 // Low-level config
1750 // ----------------
1751 // Analog:
1752 # if defined(_ANSA12) || defined(__DOXYGEN__)
1753 /// Enable analog functionality on pin RA12.
1754 # define ENABLE_RA12_ANALOG() (_ANSA12 = 1)
1755 /// Disable analog functionality on pin RA12.
1756 # define DISABLE_RA12_ANALOG() (_ANSA12 = 0)
1757 # elif defined(RA12_AN)
1758 # define ENABLE_RA12_ANALOG() (RXY_GPIO_PCFG(RA12_AN) = 0)
1759 # define DISABLE_RA12_ANALOG() (RXY_GPIO_PCFG(RA12_AN) = 1)
1760 # else
1761 # define DISABLE_RA12_ANALOG() ((void) 0)
1762 # endif
1763 
1764 // Input/output:
1765 /// Configure pin RA12 as an input.
1766 # define CONFIG_RA12_AS_INPUT() (_TRISA12 = 1)
1767 /// Configure pin RA12 as an output.
1768 # define CONFIG_RA12_AS_OUTPUT() (_TRISA12 = 0)
1769 
1770 // Open-drain:
1771 # if defined(_ODCA12) || defined(__DOXYGEN__)
1772 /// Enable the open-drain driver on pin RA12.
1773 # define ENABLE_RA12_OPENDRAIN() (_ODCA12 = 1)
1774 /// Disable the open-drain driver on pin RA12.
1775 # define DISABLE_RA12_OPENDRAIN() (_ODCA12 = 0)
1776 # elif defined(_ODA12) // The PIF24F names this bit _OD instead of _ODC.
1777 # define ENABLE_RA12_OPENDRAIN() (_ODA12 = 1)
1778 # define DISABLE_RA12_OPENDRAIN() (_ODA12 = 0)
1779 # else
1780 # define DISABLE_RA12_OPENDRAIN() ((void) 0)
1781 # endif
1782 
1783 // Change notification, pullups and pulldowns:
1784 # if defined(_CNIEA12) || defined(__DOXYGEN__)
1785 /// Enable the pullup on pin RA12.
1786 # define ENABLE_RA12_PULLUP() (_CNPUA12 = 1)
1787 /// Disable the pullup on pin RA12.
1788 # define DISABLE_RA12_PULLUP() (_CNPUA12 = 0)
1789 
1790 /// Enable the pulldown on pin RA12.
1791 # define ENABLE_RA12_PULLDOWN() (_CNPDA12 = 1)
1792 /// Disable the pulldown on pin RA12.
1793 # define DISABLE_RA12_PULLDOWN() (_CNPDA12 = 0)
1794 
1795 /// Enable the change notification interrupt on pin RA12.
1796 # define ENABLE_RA12_CN_INTERRUPT() (_CNIEA12 = 1)
1797 /// Disable the change notification interrupt on pin RA12.
1798 # define DISABLE_RA12_CN_INTERRUPT() (_CNIEA12 = 0)
1799 
1800 # elif defined(RA12_CN)
1801 # define ENABLE_RA12_PULLUP() (RXY_GPIO_CNPUE(RA12_CN) = 1)
1802 # define DISABLE_RA12_PULLUP() (RXY_GPIO_CNPUE(RA12_CN) = 0)
1803 
1804 # if RXY_HAS_CNPDE(RA12_CN)
1805 # define ENABLE_RA12_PULLDOWN() (RXY_GPIO_CNPDE(RA12_CN) = 1)
1806 # define DISABLE_RA12_PULLDOWN() (RXY_GPIO_CNPDE(RA12_CN) = 0)
1807 # else
1808 # define DISABLE_RA12_PULLDOWN() ((void) 0)
1809 # endif
1810 
1811 # define ENABLE_RA12_CN_INTERRUPT() (RXY_GPIO_CNIE(RA12_CN) = 1)
1812 # define DISABLE_RA12_CN_INTERRUPT() (RXY_GPIO_CNIE(RA12_CN) = 0)
1813 
1814 # else
1815 # define DISABLE_RA12_PULLUP() ((void) 0)
1816 # define DISABLE_RA12_PULLDOWN() ((void) 0)
1817 # define DISABLE_RA12_CN_INTERRUPT() ((void) 0)
1818 # endif
1819 
1820 // High-level config
1821 // -----------------
1822 /** This macro disables pullups/downs, enables analog functionality, and configures
1823  * pin RA12 as an input.
1824  */
1825 # if defined(_ANSA12) || defined(RA12_AN) || defined(__DOXYGEN__)
1826 # define CONFIG_RA12_AS_ANALOG() \
1827  do { \
1828  ENABLE_RA12_ANALOG(); \
1829  CONFIG_RA12_AS_INPUT(); \
1830  DISABLE_RA12_OPENDRAIN(); \
1831  DISABLE_RA12_PULLUP(); \
1832  DISABLE_RA12_PULLDOWN(); \
1833  } while (0)
1834 # endif
1835 
1836 /** This macro disables open-drain and pullups/downs,
1837  * configures pin RA12 for digital (not analog) operation, and
1838  * configures the pin as an input.
1839  */
1840 # define CONFIG_RA12_AS_DIG_INPUT() \
1841  do { \
1842  DISABLE_RA12_ANALOG(); \
1843  CONFIG_RA12_AS_INPUT(); \
1844  DISABLE_RA12_OPENDRAIN(); \
1845  DISABLE_RA12_PULLUP(); \
1846  DISABLE_RA12_PULLDOWN(); \
1847  } while (0)
1848 
1849 /** This macro disables open-drain and pullups/downs,
1850  * configures pin RA12 for digital (not analog) operation, and
1851  * configures the pin as an output.
1852  */
1853 # define CONFIG_RA12_AS_DIG_OUTPUT() \
1854  do { \
1855  DISABLE_RA12_ANALOG(); \
1856  CONFIG_RA12_AS_OUTPUT(); \
1857  DISABLE_RA12_OPENDRAIN(); \
1858  DISABLE_RA12_PULLUP(); \
1859  DISABLE_RA12_PULLDOWN(); \
1860  } while (0)
1861 
1862 #endif // #if defined(_RA12) || defined(__DOXYGEN__): Provide GPIO for RA12
1863 
1864 
1865 
1866 
1867 
1868 // Provide GPIO for RA13
1869 // ====================
1870 #if defined(_RA13) || defined(__DOXYGEN__)
1871 
1872 // Dummy macros for documentation only
1873 # ifdef __DOXYGEN__
1874 /// This macro specifies the RPy value associated with pin RA13.
1875 /// Its device-specific definition is given in pic24_ports_mapping.h.
1876 # define RA13_RP xx
1877 
1878 /// This macro specifies the ANn value associated with pin RA13.
1879 /// Its device-specific definition is given in pic24_ports_mapping.h.
1880 # define RA13_AN xx
1881 
1882 /// This macro specifies the CNm value associated with pin RA13.
1883 /// Its device-specific definition is given in pic24_ports_mapping.h.
1884 # define RA13_CN xx
1885 
1886 //@}
1887 # endif // #ifdef __DOXYGEN__
1888 
1889 
1890 // Low-level config
1891 // ----------------
1892 // Analog:
1893 # if defined(_ANSA13) || defined(__DOXYGEN__)
1894 /// Enable analog functionality on pin RA13.
1895 # define ENABLE_RA13_ANALOG() (_ANSA13 = 1)
1896 /// Disable analog functionality on pin RA13.
1897 # define DISABLE_RA13_ANALOG() (_ANSA13 = 0)
1898 # elif defined(RA13_AN)
1899 # define ENABLE_RA13_ANALOG() (RXY_GPIO_PCFG(RA13_AN) = 0)
1900 # define DISABLE_RA13_ANALOG() (RXY_GPIO_PCFG(RA13_AN) = 1)
1901 # else
1902 # define DISABLE_RA13_ANALOG() ((void) 0)
1903 # endif
1904 
1905 // Input/output:
1906 /// Configure pin RA13 as an input.
1907 # define CONFIG_RA13_AS_INPUT() (_TRISA13 = 1)
1908 /// Configure pin RA13 as an output.
1909 # define CONFIG_RA13_AS_OUTPUT() (_TRISA13 = 0)
1910 
1911 // Open-drain:
1912 # if defined(_ODCA13) || defined(__DOXYGEN__)
1913 /// Enable the open-drain driver on pin RA13.
1914 # define ENABLE_RA13_OPENDRAIN() (_ODCA13 = 1)
1915 /// Disable the open-drain driver on pin RA13.
1916 # define DISABLE_RA13_OPENDRAIN() (_ODCA13 = 0)
1917 # elif defined(_ODA13) // The PIF24F names this bit _OD instead of _ODC.
1918 # define ENABLE_RA13_OPENDRAIN() (_ODA13 = 1)
1919 # define DISABLE_RA13_OPENDRAIN() (_ODA13 = 0)
1920 # else
1921 # define DISABLE_RA13_OPENDRAIN() ((void) 0)
1922 # endif
1923 
1924 // Change notification, pullups and pulldowns:
1925 # if defined(_CNIEA13) || defined(__DOXYGEN__)
1926 /// Enable the pullup on pin RA13.
1927 # define ENABLE_RA13_PULLUP() (_CNPUA13 = 1)
1928 /// Disable the pullup on pin RA13.
1929 # define DISABLE_RA13_PULLUP() (_CNPUA13 = 0)
1930 
1931 /// Enable the pulldown on pin RA13.
1932 # define ENABLE_RA13_PULLDOWN() (_CNPDA13 = 1)
1933 /// Disable the pulldown on pin RA13.
1934 # define DISABLE_RA13_PULLDOWN() (_CNPDA13 = 0)
1935 
1936 /// Enable the change notification interrupt on pin RA13.
1937 # define ENABLE_RA13_CN_INTERRUPT() (_CNIEA13 = 1)
1938 /// Disable the change notification interrupt on pin RA13.
1939 # define DISABLE_RA13_CN_INTERRUPT() (_CNIEA13 = 0)
1940 
1941 # elif defined(RA13_CN)
1942 # define ENABLE_RA13_PULLUP() (RXY_GPIO_CNPUE(RA13_CN) = 1)
1943 # define DISABLE_RA13_PULLUP() (RXY_GPIO_CNPUE(RA13_CN) = 0)
1944 
1945 # if RXY_HAS_CNPDE(RA13_CN)
1946 # define ENABLE_RA13_PULLDOWN() (RXY_GPIO_CNPDE(RA13_CN) = 1)
1947 # define DISABLE_RA13_PULLDOWN() (RXY_GPIO_CNPDE(RA13_CN) = 0)
1948 # else
1949 # define DISABLE_RA13_PULLDOWN() ((void) 0)
1950 # endif
1951 
1952 # define ENABLE_RA13_CN_INTERRUPT() (RXY_GPIO_CNIE(RA13_CN) = 1)
1953 # define DISABLE_RA13_CN_INTERRUPT() (RXY_GPIO_CNIE(RA13_CN) = 0)
1954 
1955 # else
1956 # define DISABLE_RA13_PULLUP() ((void) 0)
1957 # define DISABLE_RA13_PULLDOWN() ((void) 0)
1958 # define DISABLE_RA13_CN_INTERRUPT() ((void) 0)
1959 # endif
1960 
1961 // High-level config
1962 // -----------------
1963 /** This macro disables pullups/downs, enables analog functionality, and configures
1964  * pin RA13 as an input.
1965  */
1966 # if defined(_ANSA13) || defined(RA13_AN) || defined(__DOXYGEN__)
1967 # define CONFIG_RA13_AS_ANALOG() \
1968  do { \
1969  ENABLE_RA13_ANALOG(); \
1970  CONFIG_RA13_AS_INPUT(); \
1971  DISABLE_RA13_OPENDRAIN(); \
1972  DISABLE_RA13_PULLUP(); \
1973  DISABLE_RA13_PULLDOWN(); \
1974  } while (0)
1975 # endif
1976 
1977 /** This macro disables open-drain and pullups/downs,
1978  * configures pin RA13 for digital (not analog) operation, and
1979  * configures the pin as an input.
1980  */
1981 # define CONFIG_RA13_AS_DIG_INPUT() \
1982  do { \
1983  DISABLE_RA13_ANALOG(); \
1984  CONFIG_RA13_AS_INPUT(); \
1985  DISABLE_RA13_OPENDRAIN(); \
1986  DISABLE_RA13_PULLUP(); \
1987  DISABLE_RA13_PULLDOWN(); \
1988  } while (0)
1989 
1990 /** This macro disables open-drain and pullups/downs,
1991  * configures pin RA13 for digital (not analog) operation, and
1992  * configures the pin as an output.
1993  */
1994 # define CONFIG_RA13_AS_DIG_OUTPUT() \
1995  do { \
1996  DISABLE_RA13_ANALOG(); \
1997  CONFIG_RA13_AS_OUTPUT(); \
1998  DISABLE_RA13_OPENDRAIN(); \
1999  DISABLE_RA13_PULLUP(); \
2000  DISABLE_RA13_PULLDOWN(); \
2001  } while (0)
2002 
2003 #endif // #if defined(_RA13) || defined(__DOXYGEN__): Provide GPIO for RA13
2004 
2005 
2006 
2007 
2008 
2009 // Provide GPIO for RA14
2010 // ====================
2011 #if defined(_RA14) || defined(__DOXYGEN__)
2012 
2013 // Dummy macros for documentation only
2014 # ifdef __DOXYGEN__
2015 /// This macro specifies the RPy value associated with pin RA14.
2016 /// Its device-specific definition is given in pic24_ports_mapping.h.
2017 # define RA14_RP xx
2018 
2019 /// This macro specifies the ANn value associated with pin RA14.
2020 /// Its device-specific definition is given in pic24_ports_mapping.h.
2021 # define RA14_AN xx
2022 
2023 /// This macro specifies the CNm value associated with pin RA14.
2024 /// Its device-specific definition is given in pic24_ports_mapping.h.
2025 # define RA14_CN xx
2026 
2027 //@}
2028 # endif // #ifdef __DOXYGEN__
2029 
2030 
2031 // Low-level config
2032 // ----------------
2033 // Analog:
2034 # if defined(_ANSA14) || defined(__DOXYGEN__)
2035 /// Enable analog functionality on pin RA14.
2036 # define ENABLE_RA14_ANALOG() (_ANSA14 = 1)
2037 /// Disable analog functionality on pin RA14.
2038 # define DISABLE_RA14_ANALOG() (_ANSA14 = 0)
2039 # elif defined(RA14_AN)
2040 # define ENABLE_RA14_ANALOG() (RXY_GPIO_PCFG(RA14_AN) = 0)
2041 # define DISABLE_RA14_ANALOG() (RXY_GPIO_PCFG(RA14_AN) = 1)
2042 # else
2043 # define DISABLE_RA14_ANALOG() ((void) 0)
2044 # endif
2045 
2046 // Input/output:
2047 /// Configure pin RA14 as an input.
2048 # define CONFIG_RA14_AS_INPUT() (_TRISA14 = 1)
2049 /// Configure pin RA14 as an output.
2050 # define CONFIG_RA14_AS_OUTPUT() (_TRISA14 = 0)
2051 
2052 // Open-drain:
2053 # if defined(_ODCA14) || defined(__DOXYGEN__)
2054 /// Enable the open-drain driver on pin RA14.
2055 # define ENABLE_RA14_OPENDRAIN() (_ODCA14 = 1)
2056 /// Disable the open-drain driver on pin RA14.
2057 # define DISABLE_RA14_OPENDRAIN() (_ODCA14 = 0)
2058 # elif defined(_ODA14) // The PIF24F names this bit _OD instead of _ODC.
2059 # define ENABLE_RA14_OPENDRAIN() (_ODA14 = 1)
2060 # define DISABLE_RA14_OPENDRAIN() (_ODA14 = 0)
2061 # else
2062 # define DISABLE_RA14_OPENDRAIN() ((void) 0)
2063 # endif
2064 
2065 // Change notification, pullups and pulldowns:
2066 # if defined(_CNIEA14) || defined(__DOXYGEN__)
2067 /// Enable the pullup on pin RA14.
2068 # define ENABLE_RA14_PULLUP() (_CNPUA14 = 1)
2069 /// Disable the pullup on pin RA14.
2070 # define DISABLE_RA14_PULLUP() (_CNPUA14 = 0)
2071 
2072 /// Enable the pulldown on pin RA14.
2073 # define ENABLE_RA14_PULLDOWN() (_CNPDA14 = 1)
2074 /// Disable the pulldown on pin RA14.
2075 # define DISABLE_RA14_PULLDOWN() (_CNPDA14 = 0)
2076 
2077 /// Enable the change notification interrupt on pin RA14.
2078 # define ENABLE_RA14_CN_INTERRUPT() (_CNIEA14 = 1)
2079 /// Disable the change notification interrupt on pin RA14.
2080 # define DISABLE_RA14_CN_INTERRUPT() (_CNIEA14 = 0)
2081 
2082 # elif defined(RA14_CN)
2083 # define ENABLE_RA14_PULLUP() (RXY_GPIO_CNPUE(RA14_CN) = 1)
2084 # define DISABLE_RA14_PULLUP() (RXY_GPIO_CNPUE(RA14_CN) = 0)
2085 
2086 # if RXY_HAS_CNPDE(RA14_CN)
2087 # define ENABLE_RA14_PULLDOWN() (RXY_GPIO_CNPDE(RA14_CN) = 1)
2088 # define DISABLE_RA14_PULLDOWN() (RXY_GPIO_CNPDE(RA14_CN) = 0)
2089 # else
2090 # define DISABLE_RA14_PULLDOWN() ((void) 0)
2091 # endif
2092 
2093 # define ENABLE_RA14_CN_INTERRUPT() (RXY_GPIO_CNIE(RA14_CN) = 1)
2094 # define DISABLE_RA14_CN_INTERRUPT() (RXY_GPIO_CNIE(RA14_CN) = 0)
2095 
2096 # else
2097 # define DISABLE_RA14_PULLUP() ((void) 0)
2098 # define DISABLE_RA14_PULLDOWN() ((void) 0)
2099 # define DISABLE_RA14_CN_INTERRUPT() ((void) 0)
2100 # endif
2101 
2102 // High-level config
2103 // -----------------
2104 /** This macro disables pullups/downs, enables analog functionality, and configures
2105  * pin RA14 as an input.
2106  */
2107 # if defined(_ANSA14) || defined(RA14_AN) || defined(__DOXYGEN__)
2108 # define CONFIG_RA14_AS_ANALOG() \
2109  do { \
2110  ENABLE_RA14_ANALOG(); \
2111  CONFIG_RA14_AS_INPUT(); \
2112  DISABLE_RA14_OPENDRAIN(); \
2113  DISABLE_RA14_PULLUP(); \
2114  DISABLE_RA14_PULLDOWN(); \
2115  } while (0)
2116 # endif
2117 
2118 /** This macro disables open-drain and pullups/downs,
2119  * configures pin RA14 for digital (not analog) operation, and
2120  * configures the pin as an input.
2121  */
2122 # define CONFIG_RA14_AS_DIG_INPUT() \
2123  do { \
2124  DISABLE_RA14_ANALOG(); \
2125  CONFIG_RA14_AS_INPUT(); \
2126  DISABLE_RA14_OPENDRAIN(); \
2127  DISABLE_RA14_PULLUP(); \
2128  DISABLE_RA14_PULLDOWN(); \
2129  } while (0)
2130 
2131 /** This macro disables open-drain and pullups/downs,
2132  * configures pin RA14 for digital (not analog) operation, and
2133  * configures the pin as an output.
2134  */
2135 # define CONFIG_RA14_AS_DIG_OUTPUT() \
2136  do { \
2137  DISABLE_RA14_ANALOG(); \
2138  CONFIG_RA14_AS_OUTPUT(); \
2139  DISABLE_RA14_OPENDRAIN(); \
2140  DISABLE_RA14_PULLUP(); \
2141  DISABLE_RA14_PULLDOWN(); \
2142  } while (0)
2143 
2144 #endif // #if defined(_RA14) || defined(__DOXYGEN__): Provide GPIO for RA14
2145 
2146 
2147 
2148 
2149 
2150 // Provide GPIO for RA15
2151 // ====================
2152 #if defined(_RA15) || defined(__DOXYGEN__)
2153 
2154 // Dummy macros for documentation only
2155 # ifdef __DOXYGEN__
2156 /// This macro specifies the RPy value associated with pin RA15.
2157 /// Its device-specific definition is given in pic24_ports_mapping.h.
2158 # define RA15_RP xx
2159 
2160 /// This macro specifies the ANn value associated with pin RA15.
2161 /// Its device-specific definition is given in pic24_ports_mapping.h.
2162 # define RA15_AN xx
2163 
2164 /// This macro specifies the CNm value associated with pin RA15.
2165 /// Its device-specific definition is given in pic24_ports_mapping.h.
2166 # define RA15_CN xx
2167 
2168 //@}
2169 # endif // #ifdef __DOXYGEN__
2170 
2171 
2172 // Low-level config
2173 // ----------------
2174 // Analog:
2175 # if defined(_ANSA15) || defined(__DOXYGEN__)
2176 /// Enable analog functionality on pin RA15.
2177 # define ENABLE_RA15_ANALOG() (_ANSA15 = 1)
2178 /// Disable analog functionality on pin RA15.
2179 # define DISABLE_RA15_ANALOG() (_ANSA15 = 0)
2180 # elif defined(RA15_AN)
2181 # define ENABLE_RA15_ANALOG() (RXY_GPIO_PCFG(RA15_AN) = 0)
2182 # define DISABLE_RA15_ANALOG() (RXY_GPIO_PCFG(RA15_AN) = 1)
2183 # else
2184 # define DISABLE_RA15_ANALOG() ((void) 0)
2185 # endif
2186 
2187 // Input/output:
2188 /// Configure pin RA15 as an input.
2189 # define CONFIG_RA15_AS_INPUT() (_TRISA15 = 1)
2190 /// Configure pin RA15 as an output.
2191 # define CONFIG_RA15_AS_OUTPUT() (_TRISA15 = 0)
2192 
2193 // Open-drain:
2194 # if defined(_ODCA15) || defined(__DOXYGEN__)
2195 /// Enable the open-drain driver on pin RA15.
2196 # define ENABLE_RA15_OPENDRAIN() (_ODCA15 = 1)
2197 /// Disable the open-drain driver on pin RA15.
2198 # define DISABLE_RA15_OPENDRAIN() (_ODCA15 = 0)
2199 # elif defined(_ODA15) // The PIF24F names this bit _OD instead of _ODC.
2200 # define ENABLE_RA15_OPENDRAIN() (_ODA15 = 1)
2201 # define DISABLE_RA15_OPENDRAIN() (_ODA15 = 0)
2202 # else
2203 # define DISABLE_RA15_OPENDRAIN() ((void) 0)
2204 # endif
2205 
2206 // Change notification, pullups and pulldowns:
2207 # if defined(_CNIEA15) || defined(__DOXYGEN__)
2208 /// Enable the pullup on pin RA15.
2209 # define ENABLE_RA15_PULLUP() (_CNPUA15 = 1)
2210 /// Disable the pullup on pin RA15.
2211 # define DISABLE_RA15_PULLUP() (_CNPUA15 = 0)
2212 
2213 /// Enable the pulldown on pin RA15.
2214 # define ENABLE_RA15_PULLDOWN() (_CNPDA15 = 1)
2215 /// Disable the pulldown on pin RA15.
2216 # define DISABLE_RA15_PULLDOWN() (_CNPDA15 = 0)
2217 
2218 /// Enable the change notification interrupt on pin RA15.
2219 # define ENABLE_RA15_CN_INTERRUPT() (_CNIEA15 = 1)
2220 /// Disable the change notification interrupt on pin RA15.
2221 # define DISABLE_RA15_CN_INTERRUPT() (_CNIEA15 = 0)
2222 
2223 # elif defined(RA15_CN)
2224 # define ENABLE_RA15_PULLUP() (RXY_GPIO_CNPUE(RA15_CN) = 1)
2225 # define DISABLE_RA15_PULLUP() (RXY_GPIO_CNPUE(RA15_CN) = 0)
2226 
2227 # if RXY_HAS_CNPDE(RA15_CN)
2228 # define ENABLE_RA15_PULLDOWN() (RXY_GPIO_CNPDE(RA15_CN) = 1)
2229 # define DISABLE_RA15_PULLDOWN() (RXY_GPIO_CNPDE(RA15_CN) = 0)
2230 # else
2231 # define DISABLE_RA15_PULLDOWN() ((void) 0)
2232 # endif
2233 
2234 # define ENABLE_RA15_CN_INTERRUPT() (RXY_GPIO_CNIE(RA15_CN) = 1)
2235 # define DISABLE_RA15_CN_INTERRUPT() (RXY_GPIO_CNIE(RA15_CN) = 0)
2236 
2237 # else
2238 # define DISABLE_RA15_PULLUP() ((void) 0)
2239 # define DISABLE_RA15_PULLDOWN() ((void) 0)
2240 # define DISABLE_RA15_CN_INTERRUPT() ((void) 0)
2241 # endif
2242 
2243 // High-level config
2244 // -----------------
2245 /** This macro disables pullups/downs, enables analog functionality, and configures
2246  * pin RA15 as an input.
2247  */
2248 # if defined(_ANSA15) || defined(RA15_AN) || defined(__DOXYGEN__)
2249 # define CONFIG_RA15_AS_ANALOG() \
2250  do { \
2251  ENABLE_RA15_ANALOG(); \
2252  CONFIG_RA15_AS_INPUT(); \
2253  DISABLE_RA15_OPENDRAIN(); \
2254  DISABLE_RA15_PULLUP(); \
2255  DISABLE_RA15_PULLDOWN(); \
2256  } while (0)
2257 # endif
2258 
2259 /** This macro disables open-drain and pullups/downs,
2260  * configures pin RA15 for digital (not analog) operation, and
2261  * configures the pin as an input.
2262  */
2263 # define CONFIG_RA15_AS_DIG_INPUT() \
2264  do { \
2265  DISABLE_RA15_ANALOG(); \
2266  CONFIG_RA15_AS_INPUT(); \
2267  DISABLE_RA15_OPENDRAIN(); \
2268  DISABLE_RA15_PULLUP(); \
2269  DISABLE_RA15_PULLDOWN(); \
2270  } while (0)
2271 
2272 /** This macro disables open-drain and pullups/downs,
2273  * configures pin RA15 for digital (not analog) operation, and
2274  * configures the pin as an output.
2275  */
2276 # define CONFIG_RA15_AS_DIG_OUTPUT() \
2277  do { \
2278  DISABLE_RA15_ANALOG(); \
2279  CONFIG_RA15_AS_OUTPUT(); \
2280  DISABLE_RA15_OPENDRAIN(); \
2281  DISABLE_RA15_PULLUP(); \
2282  DISABLE_RA15_PULLDOWN(); \
2283  } while (0)
2284 
2285 #endif // #if defined(_RA15) || defined(__DOXYGEN__): Provide GPIO for RA15
2286 
2287 
2288 
2289 
2290 
2291 // Provide GPIO for RB0
2292 // ====================
2293 #if defined(_RB0) || defined(__DOXYGEN__)
2294 
2295 // Dummy macros for documentation only
2296 # ifdef __DOXYGEN__
2297 /// This macro specifies the RPy value associated with pin RB0.
2298 /// Its device-specific definition is given in pic24_ports_mapping.h.
2299 # define RB0_RP xx
2300 
2301 /// This macro specifies the ANn value associated with pin RB0.
2302 /// Its device-specific definition is given in pic24_ports_mapping.h.
2303 # define RB0_AN xx
2304 
2305 /// This macro specifies the CNm value associated with pin RB0.
2306 /// Its device-specific definition is given in pic24_ports_mapping.h.
2307 # define RB0_CN xx
2308 
2309 //@}
2310 # endif // #ifdef __DOXYGEN__
2311 
2312 
2313 // Low-level config
2314 // ----------------
2315 // Analog:
2316 # if defined(_ANSB0) || defined(__DOXYGEN__)
2317 /// Enable analog functionality on pin RB0.
2318 # define ENABLE_RB0_ANALOG() (_ANSB0 = 1)
2319 /// Disable analog functionality on pin RB0.
2320 # define DISABLE_RB0_ANALOG() (_ANSB0 = 0)
2321 # elif defined(RB0_AN)
2322 # define ENABLE_RB0_ANALOG() (RXY_GPIO_PCFG(RB0_AN) = 0)
2323 # define DISABLE_RB0_ANALOG() (RXY_GPIO_PCFG(RB0_AN) = 1)
2324 # else
2325 # define DISABLE_RB0_ANALOG() ((void) 0)
2326 # endif
2327 
2328 // Input/output:
2329 /// Configure pin RB0 as an input.
2330 # define CONFIG_RB0_AS_INPUT() (_TRISB0 = 1)
2331 /// Configure pin RB0 as an output.
2332 # define CONFIG_RB0_AS_OUTPUT() (_TRISB0 = 0)
2333 
2334 // Open-drain:
2335 # if defined(_ODCB0) || defined(__DOXYGEN__)
2336 /// Enable the open-drain driver on pin RB0.
2337 # define ENABLE_RB0_OPENDRAIN() (_ODCB0 = 1)
2338 /// Disable the open-drain driver on pin RB0.
2339 # define DISABLE_RB0_OPENDRAIN() (_ODCB0 = 0)
2340 # elif defined(_ODB0) // The PIF24F names this bit _OD instead of _ODC.
2341 # define ENABLE_RB0_OPENDRAIN() (_ODB0 = 1)
2342 # define DISABLE_RB0_OPENDRAIN() (_ODB0 = 0)
2343 # else
2344 # define DISABLE_RB0_OPENDRAIN() ((void) 0)
2345 # endif
2346 
2347 // Change notification, pullups and pulldowns:
2348 # if defined(_CNIEB0) || defined(__DOXYGEN__)
2349 /// Enable the pullup on pin RB0.
2350 # define ENABLE_RB0_PULLUP() (_CNPUB0 = 1)
2351 /// Disable the pullup on pin RB0.
2352 # define DISABLE_RB0_PULLUP() (_CNPUB0 = 0)
2353 
2354 /// Enable the pulldown on pin RB0.
2355 # define ENABLE_RB0_PULLDOWN() (_CNPDB0 = 1)
2356 /// Disable the pulldown on pin RB0.
2357 # define DISABLE_RB0_PULLDOWN() (_CNPDB0 = 0)
2358 
2359 /// Enable the change notification interrupt on pin RB0.
2360 # define ENABLE_RB0_CN_INTERRUPT() (_CNIEB0 = 1)
2361 /// Disable the change notification interrupt on pin RB0.
2362 # define DISABLE_RB0_CN_INTERRUPT() (_CNIEB0 = 0)
2363 
2364 # elif defined(RB0_CN)
2365 # define ENABLE_RB0_PULLUP() (RXY_GPIO_CNPUE(RB0_CN) = 1)
2366 # define DISABLE_RB0_PULLUP() (RXY_GPIO_CNPUE(RB0_CN) = 0)
2367 
2368 # if RXY_HAS_CNPDE(RB0_CN)
2369 # define ENABLE_RB0_PULLDOWN() (RXY_GPIO_CNPDE(RB0_CN) = 1)
2370 # define DISABLE_RB0_PULLDOWN() (RXY_GPIO_CNPDE(RB0_CN) = 0)
2371 # else
2372 # define DISABLE_RB0_PULLDOWN() ((void) 0)
2373 # endif
2374 
2375 # define ENABLE_RB0_CN_INTERRUPT() (RXY_GPIO_CNIE(RB0_CN) = 1)
2376 # define DISABLE_RB0_CN_INTERRUPT() (RXY_GPIO_CNIE(RB0_CN) = 0)
2377 
2378 # else
2379 # define DISABLE_RB0_PULLUP() ((void) 0)
2380 # define DISABLE_RB0_PULLDOWN() ((void) 0)
2381 # define DISABLE_RB0_CN_INTERRUPT() ((void) 0)
2382 # endif
2383 
2384 // High-level config
2385 // -----------------
2386 /** This macro disables pullups/downs, enables analog functionality, and configures
2387  * pin RB0 as an input.
2388  */
2389 # if defined(_ANSB0) || defined(RB0_AN) || defined(__DOXYGEN__)
2390 # define CONFIG_RB0_AS_ANALOG() \
2391  do { \
2392  ENABLE_RB0_ANALOG(); \
2393  CONFIG_RB0_AS_INPUT(); \
2394  DISABLE_RB0_OPENDRAIN(); \
2395  DISABLE_RB0_PULLUP(); \
2396  DISABLE_RB0_PULLDOWN(); \
2397  } while (0)
2398 # endif
2399 
2400 /** This macro disables open-drain and pullups/downs,
2401  * configures pin RB0 for digital (not analog) operation, and
2402  * configures the pin as an input.
2403  */
2404 # define CONFIG_RB0_AS_DIG_INPUT() \
2405  do { \
2406  DISABLE_RB0_ANALOG(); \
2407  CONFIG_RB0_AS_INPUT(); \
2408  DISABLE_RB0_OPENDRAIN(); \
2409  DISABLE_RB0_PULLUP(); \
2410  DISABLE_RB0_PULLDOWN(); \
2411  } while (0)
2412 
2413 /** This macro disables open-drain and pullups/downs,
2414  * configures pin RB0 for digital (not analog) operation, and
2415  * configures the pin as an output.
2416  */
2417 # define CONFIG_RB0_AS_DIG_OUTPUT() \
2418  do { \
2419  DISABLE_RB0_ANALOG(); \
2420  CONFIG_RB0_AS_OUTPUT(); \
2421  DISABLE_RB0_OPENDRAIN(); \
2422  DISABLE_RB0_PULLUP(); \
2423  DISABLE_RB0_PULLDOWN(); \
2424  } while (0)
2425 
2426 #endif // #if defined(_RB0) || defined(__DOXYGEN__): Provide GPIO for RB0
2427 
2428 
2429 
2430 
2431 
2432 // Provide GPIO for RB1
2433 // ====================
2434 #if defined(_RB1) || defined(__DOXYGEN__)
2435 
2436 // Dummy macros for documentation only
2437 # ifdef __DOXYGEN__
2438 /// This macro specifies the RPy value associated with pin RB1.
2439 /// Its device-specific definition is given in pic24_ports_mapping.h.
2440 # define RB1_RP xx
2441 
2442 /// This macro specifies the ANn value associated with pin RB1.
2443 /// Its device-specific definition is given in pic24_ports_mapping.h.
2444 # define RB1_AN xx
2445 
2446 /// This macro specifies the CNm value associated with pin RB1.
2447 /// Its device-specific definition is given in pic24_ports_mapping.h.
2448 # define RB1_CN xx
2449 
2450 //@}
2451 # endif // #ifdef __DOXYGEN__
2452 
2453 
2454 // Low-level config
2455 // ----------------
2456 // Analog:
2457 # if defined(_ANSB1) || defined(__DOXYGEN__)
2458 /// Enable analog functionality on pin RB1.
2459 # define ENABLE_RB1_ANALOG() (_ANSB1 = 1)
2460 /// Disable analog functionality on pin RB1.
2461 # define DISABLE_RB1_ANALOG() (_ANSB1 = 0)
2462 # elif defined(RB1_AN)
2463 # define ENABLE_RB1_ANALOG() (RXY_GPIO_PCFG(RB1_AN) = 0)
2464 # define DISABLE_RB1_ANALOG() (RXY_GPIO_PCFG(RB1_AN) = 1)
2465 # else
2466 # define DISABLE_RB1_ANALOG() ((void) 0)
2467 # endif
2468 
2469 // Input/output:
2470 /// Configure pin RB1 as an input.
2471 # define CONFIG_RB1_AS_INPUT() (_TRISB1 = 1)
2472 /// Configure pin RB1 as an output.
2473 # define CONFIG_RB1_AS_OUTPUT() (_TRISB1 = 0)
2474 
2475 // Open-drain:
2476 # if defined(_ODCB1) || defined(__DOXYGEN__)
2477 /// Enable the open-drain driver on pin RB1.
2478 # define ENABLE_RB1_OPENDRAIN() (_ODCB1 = 1)
2479 /// Disable the open-drain driver on pin RB1.
2480 # define DISABLE_RB1_OPENDRAIN() (_ODCB1 = 0)
2481 # elif defined(_ODB1) // The PIF24F names this bit _OD instead of _ODC.
2482 # define ENABLE_RB1_OPENDRAIN() (_ODB1 = 1)
2483 # define DISABLE_RB1_OPENDRAIN() (_ODB1 = 0)
2484 # else
2485 # define DISABLE_RB1_OPENDRAIN() ((void) 0)
2486 # endif
2487 
2488 // Change notification, pullups and pulldowns:
2489 # if defined(_CNIEB1) || defined(__DOXYGEN__)
2490 /// Enable the pullup on pin RB1.
2491 # define ENABLE_RB1_PULLUP() (_CNPUB1 = 1)
2492 /// Disable the pullup on pin RB1.
2493 # define DISABLE_RB1_PULLUP() (_CNPUB1 = 0)
2494 
2495 /// Enable the pulldown on pin RB1.
2496 # define ENABLE_RB1_PULLDOWN() (_CNPDB1 = 1)
2497 /// Disable the pulldown on pin RB1.
2498 # define DISABLE_RB1_PULLDOWN() (_CNPDB1 = 0)
2499 
2500 /// Enable the change notification interrupt on pin RB1.
2501 # define ENABLE_RB1_CN_INTERRUPT() (_CNIEB1 = 1)
2502 /// Disable the change notification interrupt on pin RB1.
2503 # define DISABLE_RB1_CN_INTERRUPT() (_CNIEB1 = 0)
2504 
2505 # elif defined(RB1_CN)
2506 # define ENABLE_RB1_PULLUP() (RXY_GPIO_CNPUE(RB1_CN) = 1)
2507 # define DISABLE_RB1_PULLUP() (RXY_GPIO_CNPUE(RB1_CN) = 0)
2508 
2509 # if RXY_HAS_CNPDE(RB1_CN)
2510 # define ENABLE_RB1_PULLDOWN() (RXY_GPIO_CNPDE(RB1_CN) = 1)
2511 # define DISABLE_RB1_PULLDOWN() (RXY_GPIO_CNPDE(RB1_CN) = 0)
2512 # else
2513 # define DISABLE_RB1_PULLDOWN() ((void) 0)
2514 # endif
2515 
2516 # define ENABLE_RB1_CN_INTERRUPT() (RXY_GPIO_CNIE(RB1_CN) = 1)
2517 # define DISABLE_RB1_CN_INTERRUPT() (RXY_GPIO_CNIE(RB1_CN) = 0)
2518 
2519 # else
2520 # define DISABLE_RB1_PULLUP() ((void) 0)
2521 # define DISABLE_RB1_PULLDOWN() ((void) 0)
2522 # define DISABLE_RB1_CN_INTERRUPT() ((void) 0)
2523 # endif
2524 
2525 // High-level config
2526 // -----------------
2527 /** This macro disables pullups/downs, enables analog functionality, and configures
2528  * pin RB1 as an input.
2529  */
2530 # if defined(_ANSB1) || defined(RB1_AN) || defined(__DOXYGEN__)
2531 # define CONFIG_RB1_AS_ANALOG() \
2532  do { \
2533  ENABLE_RB1_ANALOG(); \
2534  CONFIG_RB1_AS_INPUT(); \
2535  DISABLE_RB1_OPENDRAIN(); \
2536  DISABLE_RB1_PULLUP(); \
2537  DISABLE_RB1_PULLDOWN(); \
2538  } while (0)
2539 # endif
2540 
2541 /** This macro disables open-drain and pullups/downs,
2542  * configures pin RB1 for digital (not analog) operation, and
2543  * configures the pin as an input.
2544  */
2545 # define CONFIG_RB1_AS_DIG_INPUT() \
2546  do { \
2547  DISABLE_RB1_ANALOG(); \
2548  CONFIG_RB1_AS_INPUT(); \
2549  DISABLE_RB1_OPENDRAIN(); \
2550  DISABLE_RB1_PULLUP(); \
2551  DISABLE_RB1_PULLDOWN(); \
2552  } while (0)
2553 
2554 /** This macro disables open-drain and pullups/downs,
2555  * configures pin RB1 for digital (not analog) operation, and
2556  * configures the pin as an output.
2557  */
2558 # define CONFIG_RB1_AS_DIG_OUTPUT() \
2559  do { \
2560  DISABLE_RB1_ANALOG(); \
2561  CONFIG_RB1_AS_OUTPUT(); \
2562  DISABLE_RB1_OPENDRAIN(); \
2563  DISABLE_RB1_PULLUP(); \
2564  DISABLE_RB1_PULLDOWN(); \
2565  } while (0)
2566 
2567 #endif // #if defined(_RB1) || defined(__DOXYGEN__): Provide GPIO for RB1
2568 
2569 
2570 
2571 
2572 
2573 // Provide GPIO for RB2
2574 // ====================
2575 #if defined(_RB2) || defined(__DOXYGEN__)
2576 
2577 // Dummy macros for documentation only
2578 # ifdef __DOXYGEN__
2579 /// This macro specifies the RPy value associated with pin RB2.
2580 /// Its device-specific definition is given in pic24_ports_mapping.h.
2581 # define RB2_RP xx
2582 
2583 /// This macro specifies the ANn value associated with pin RB2.
2584 /// Its device-specific definition is given in pic24_ports_mapping.h.
2585 # define RB2_AN xx
2586 
2587 /// This macro specifies the CNm value associated with pin RB2.
2588 /// Its device-specific definition is given in pic24_ports_mapping.h.
2589 # define RB2_CN xx
2590 
2591 //@}
2592 # endif // #ifdef __DOXYGEN__
2593 
2594 
2595 // Low-level config
2596 // ----------------
2597 // Analog:
2598 # if defined(_ANSB2) || defined(__DOXYGEN__)
2599 /// Enable analog functionality on pin RB2.
2600 # define ENABLE_RB2_ANALOG() (_ANSB2 = 1)
2601 /// Disable analog functionality on pin RB2.
2602 # define DISABLE_RB2_ANALOG() (_ANSB2 = 0)
2603 # elif defined(RB2_AN)
2604 # define ENABLE_RB2_ANALOG() (RXY_GPIO_PCFG(RB2_AN) = 0)
2605 # define DISABLE_RB2_ANALOG() (RXY_GPIO_PCFG(RB2_AN) = 1)
2606 # else
2607 # define DISABLE_RB2_ANALOG() ((void) 0)
2608 # endif
2609 
2610 // Input/output:
2611 /// Configure pin RB2 as an input.
2612 # define CONFIG_RB2_AS_INPUT() (_TRISB2 = 1)
2613 /// Configure pin RB2 as an output.
2614 # define CONFIG_RB2_AS_OUTPUT() (_TRISB2 = 0)
2615 
2616 // Open-drain:
2617 # if defined(_ODCB2) || defined(__DOXYGEN__)
2618 /// Enable the open-drain driver on pin RB2.
2619 # define ENABLE_RB2_OPENDRAIN() (_ODCB2 = 1)
2620 /// Disable the open-drain driver on pin RB2.
2621 # define DISABLE_RB2_OPENDRAIN() (_ODCB2 = 0)
2622 # elif defined(_ODB2) // The PIF24F names this bit _OD instead of _ODC.
2623 # define ENABLE_RB2_OPENDRAIN() (_ODB2 = 1)
2624 # define DISABLE_RB2_OPENDRAIN() (_ODB2 = 0)
2625 # else
2626 # define DISABLE_RB2_OPENDRAIN() ((void) 0)
2627 # endif
2628 
2629 // Change notification, pullups and pulldowns:
2630 # if defined(_CNIEB2) || defined(__DOXYGEN__)
2631 /// Enable the pullup on pin RB2.
2632 # define ENABLE_RB2_PULLUP() (_CNPUB2 = 1)
2633 /// Disable the pullup on pin RB2.
2634 # define DISABLE_RB2_PULLUP() (_CNPUB2 = 0)
2635 
2636 /// Enable the pulldown on pin RB2.
2637 # define ENABLE_RB2_PULLDOWN() (_CNPDB2 = 1)
2638 /// Disable the pulldown on pin RB2.
2639 # define DISABLE_RB2_PULLDOWN() (_CNPDB2 = 0)
2640 
2641 /// Enable the change notification interrupt on pin RB2.
2642 # define ENABLE_RB2_CN_INTERRUPT() (_CNIEB2 = 1)
2643 /// Disable the change notification interrupt on pin RB2.
2644 # define DISABLE_RB2_CN_INTERRUPT() (_CNIEB2 = 0)
2645 
2646 # elif defined(RB2_CN)
2647 # define ENABLE_RB2_PULLUP() (RXY_GPIO_CNPUE(RB2_CN) = 1)
2648 # define DISABLE_RB2_PULLUP() (RXY_GPIO_CNPUE(RB2_CN) = 0)
2649 
2650 # if RXY_HAS_CNPDE(RB2_CN)
2651 # define ENABLE_RB2_PULLDOWN() (RXY_GPIO_CNPDE(RB2_CN) = 1)
2652 # define DISABLE_RB2_PULLDOWN() (RXY_GPIO_CNPDE(RB2_CN) = 0)
2653 # else
2654 # define DISABLE_RB2_PULLDOWN() ((void) 0)
2655 # endif
2656 
2657 # define ENABLE_RB2_CN_INTERRUPT() (RXY_GPIO_CNIE(RB2_CN) = 1)
2658 # define DISABLE_RB2_CN_INTERRUPT() (RXY_GPIO_CNIE(RB2_CN) = 0)
2659 
2660 # else
2661 # define DISABLE_RB2_PULLUP() ((void) 0)
2662 # define DISABLE_RB2_PULLDOWN() ((void) 0)
2663 # define DISABLE_RB2_CN_INTERRUPT() ((void) 0)
2664 # endif
2665 
2666 // High-level config
2667 // -----------------
2668 /** This macro disables pullups/downs, enables analog functionality, and configures
2669  * pin RB2 as an input.
2670  */
2671 # if defined(_ANSB2) || defined(RB2_AN) || defined(__DOXYGEN__)
2672 # define CONFIG_RB2_AS_ANALOG() \
2673  do { \
2674  ENABLE_RB2_ANALOG(); \
2675  CONFIG_RB2_AS_INPUT(); \
2676  DISABLE_RB2_OPENDRAIN(); \
2677  DISABLE_RB2_PULLUP(); \
2678  DISABLE_RB2_PULLDOWN(); \
2679  } while (0)
2680 # endif
2681 
2682 /** This macro disables open-drain and pullups/downs,
2683  * configures pin RB2 for digital (not analog) operation, and
2684  * configures the pin as an input.
2685  */
2686 # define CONFIG_RB2_AS_DIG_INPUT() \
2687  do { \
2688  DISABLE_RB2_ANALOG(); \
2689  CONFIG_RB2_AS_INPUT(); \
2690  DISABLE_RB2_OPENDRAIN(); \
2691  DISABLE_RB2_PULLUP(); \
2692  DISABLE_RB2_PULLDOWN(); \
2693  } while (0)
2694 
2695 /** This macro disables open-drain and pullups/downs,
2696  * configures pin RB2 for digital (not analog) operation, and
2697  * configures the pin as an output.
2698  */
2699 # define CONFIG_RB2_AS_DIG_OUTPUT() \
2700  do { \
2701  DISABLE_RB2_ANALOG(); \
2702  CONFIG_RB2_AS_OUTPUT(); \
2703  DISABLE_RB2_OPENDRAIN(); \
2704  DISABLE_RB2_PULLUP(); \
2705  DISABLE_RB2_PULLDOWN(); \
2706  } while (0)
2707 
2708 #endif // #if defined(_RB2) || defined(__DOXYGEN__): Provide GPIO for RB2
2709 
2710 
2711 
2712 
2713 
2714 // Provide GPIO for RB3
2715 // ====================
2716 #if defined(_RB3) || defined(__DOXYGEN__)
2717 
2718 // Dummy macros for documentation only
2719 # ifdef __DOXYGEN__
2720 /// This macro specifies the RPy value associated with pin RB3.
2721 /// Its device-specific definition is given in pic24_ports_mapping.h.
2722 # define RB3_RP xx
2723 
2724 /// This macro specifies the ANn value associated with pin RB3.
2725 /// Its device-specific definition is given in pic24_ports_mapping.h.
2726 # define RB3_AN xx
2727 
2728 /// This macro specifies the CNm value associated with pin RB3.
2729 /// Its device-specific definition is given in pic24_ports_mapping.h.
2730 # define RB3_CN xx
2731 
2732 //@}
2733 # endif // #ifdef __DOXYGEN__
2734 
2735 
2736 // Low-level config
2737 // ----------------
2738 // Analog:
2739 # if defined(_ANSB3) || defined(__DOXYGEN__)
2740 /// Enable analog functionality on pin RB3.
2741 # define ENABLE_RB3_ANALOG() (_ANSB3 = 1)
2742 /// Disable analog functionality on pin RB3.
2743 # define DISABLE_RB3_ANALOG() (_ANSB3 = 0)
2744 # elif defined(RB3_AN)
2745 # define ENABLE_RB3_ANALOG() (RXY_GPIO_PCFG(RB3_AN) = 0)
2746 # define DISABLE_RB3_ANALOG() (RXY_GPIO_PCFG(RB3_AN) = 1)
2747 # else
2748 # define DISABLE_RB3_ANALOG() ((void) 0)
2749 # endif
2750 
2751 // Input/output:
2752 /// Configure pin RB3 as an input.
2753 # define CONFIG_RB3_AS_INPUT() (_TRISB3 = 1)
2754 /// Configure pin RB3 as an output.
2755 # define CONFIG_RB3_AS_OUTPUT() (_TRISB3 = 0)
2756 
2757 // Open-drain:
2758 # if defined(_ODCB3) || defined(__DOXYGEN__)
2759 /// Enable the open-drain driver on pin RB3.
2760 # define ENABLE_RB3_OPENDRAIN() (_ODCB3 = 1)
2761 /// Disable the open-drain driver on pin RB3.
2762 # define DISABLE_RB3_OPENDRAIN() (_ODCB3 = 0)
2763 # elif defined(_ODB3) // The PIF24F names this bit _OD instead of _ODC.
2764 # define ENABLE_RB3_OPENDRAIN() (_ODB3 = 1)
2765 # define DISABLE_RB3_OPENDRAIN() (_ODB3 = 0)
2766 # else
2767 # define DISABLE_RB3_OPENDRAIN() ((void) 0)
2768 # endif
2769 
2770 // Change notification, pullups and pulldowns:
2771 # if defined(_CNIEB3) || defined(__DOXYGEN__)
2772 /// Enable the pullup on pin RB3.
2773 # define ENABLE_RB3_PULLUP() (_CNPUB3 = 1)
2774 /// Disable the pullup on pin RB3.
2775 # define DISABLE_RB3_PULLUP() (_CNPUB3 = 0)
2776 
2777 /// Enable the pulldown on pin RB3.
2778 # define ENABLE_RB3_PULLDOWN() (_CNPDB3 = 1)
2779 /// Disable the pulldown on pin RB3.
2780 # define DISABLE_RB3_PULLDOWN() (_CNPDB3 = 0)
2781 
2782 /// Enable the change notification interrupt on pin RB3.
2783 # define ENABLE_RB3_CN_INTERRUPT() (_CNIEB3 = 1)
2784 /// Disable the change notification interrupt on pin RB3.
2785 # define DISABLE_RB3_CN_INTERRUPT() (_CNIEB3 = 0)
2786 
2787 # elif defined(RB3_CN)
2788 # define ENABLE_RB3_PULLUP() (RXY_GPIO_CNPUE(RB3_CN) = 1)
2789 # define DISABLE_RB3_PULLUP() (RXY_GPIO_CNPUE(RB3_CN) = 0)
2790 
2791 # if RXY_HAS_CNPDE(RB3_CN)
2792 # define ENABLE_RB3_PULLDOWN() (RXY_GPIO_CNPDE(RB3_CN) = 1)
2793 # define DISABLE_RB3_PULLDOWN() (RXY_GPIO_CNPDE(RB3_CN) = 0)
2794 # else
2795 # define DISABLE_RB3_PULLDOWN() ((void) 0)
2796 # endif
2797 
2798 # define ENABLE_RB3_CN_INTERRUPT() (RXY_GPIO_CNIE(RB3_CN) = 1)
2799 # define DISABLE_RB3_CN_INTERRUPT() (RXY_GPIO_CNIE(RB3_CN) = 0)
2800 
2801 # else
2802 # define DISABLE_RB3_PULLUP() ((void) 0)
2803 # define DISABLE_RB3_PULLDOWN() ((void) 0)
2804 # define DISABLE_RB3_CN_INTERRUPT() ((void) 0)
2805 # endif
2806 
2807 // High-level config
2808 // -----------------
2809 /** This macro disables pullups/downs, enables analog functionality, and configures
2810  * pin RB3 as an input.
2811  */
2812 # if defined(_ANSB3) || defined(RB3_AN) || defined(__DOXYGEN__)
2813 # define CONFIG_RB3_AS_ANALOG() \
2814  do { \
2815  ENABLE_RB3_ANALOG(); \
2816  CONFIG_RB3_AS_INPUT(); \
2817  DISABLE_RB3_OPENDRAIN(); \
2818  DISABLE_RB3_PULLUP(); \
2819  DISABLE_RB3_PULLDOWN(); \
2820  } while (0)
2821 # endif
2822 
2823 /** This macro disables open-drain and pullups/downs,
2824  * configures pin RB3 for digital (not analog) operation, and
2825  * configures the pin as an input.
2826  */
2827 # define CONFIG_RB3_AS_DIG_INPUT() \
2828  do { \
2829  DISABLE_RB3_ANALOG(); \
2830  CONFIG_RB3_AS_INPUT(); \
2831  DISABLE_RB3_OPENDRAIN(); \
2832  DISABLE_RB3_PULLUP(); \
2833  DISABLE_RB3_PULLDOWN(); \
2834  } while (0)
2835 
2836 /** This macro disables open-drain and pullups/downs,
2837  * configures pin RB3 for digital (not analog) operation, and
2838  * configures the pin as an output.
2839  */
2840 # define CONFIG_RB3_AS_DIG_OUTPUT() \
2841  do { \
2842  DISABLE_RB3_ANALOG(); \
2843  CONFIG_RB3_AS_OUTPUT(); \
2844  DISABLE_RB3_OPENDRAIN(); \
2845  DISABLE_RB3_PULLUP(); \
2846  DISABLE_RB3_PULLDOWN(); \
2847  } while (0)
2848 
2849 #endif // #if defined(_RB3) || defined(__DOXYGEN__): Provide GPIO for RB3
2850 
2851 
2852 
2853 
2854 
2855 // Provide GPIO for RB4
2856 // ====================
2857 #if defined(_RB4) || defined(__DOXYGEN__)
2858 
2859 // Dummy macros for documentation only
2860 # ifdef __DOXYGEN__
2861 /// This macro specifies the RPy value associated with pin RB4.
2862 /// Its device-specific definition is given in pic24_ports_mapping.h.
2863 # define RB4_RP xx
2864 
2865 /// This macro specifies the ANn value associated with pin RB4.
2866 /// Its device-specific definition is given in pic24_ports_mapping.h.
2867 # define RB4_AN xx
2868 
2869 /// This macro specifies the CNm value associated with pin RB4.
2870 /// Its device-specific definition is given in pic24_ports_mapping.h.
2871 # define RB4_CN xx
2872 
2873 //@}
2874 # endif // #ifdef __DOXYGEN__
2875 
2876 
2877 // Low-level config
2878 // ----------------
2879 // Analog:
2880 # if defined(_ANSB4) || defined(__DOXYGEN__)
2881 /// Enable analog functionality on pin RB4.
2882 # define ENABLE_RB4_ANALOG() (_ANSB4 = 1)
2883 /// Disable analog functionality on pin RB4.
2884 # define DISABLE_RB4_ANALOG() (_ANSB4 = 0)
2885 # elif defined(RB4_AN)
2886 # define ENABLE_RB4_ANALOG() (RXY_GPIO_PCFG(RB4_AN) = 0)
2887 # define DISABLE_RB4_ANALOG() (RXY_GPIO_PCFG(RB4_AN) = 1)
2888 # else
2889 # define DISABLE_RB4_ANALOG() ((void) 0)
2890 # endif
2891 
2892 // Input/output:
2893 /// Configure pin RB4 as an input.
2894 # define CONFIG_RB4_AS_INPUT() (_TRISB4 = 1)
2895 /// Configure pin RB4 as an output.
2896 # define CONFIG_RB4_AS_OUTPUT() (_TRISB4 = 0)
2897 
2898 // Open-drain:
2899 # if defined(_ODCB4) || defined(__DOXYGEN__)
2900 /// Enable the open-drain driver on pin RB4.
2901 # define ENABLE_RB4_OPENDRAIN() (_ODCB4 = 1)
2902 /// Disable the open-drain driver on pin RB4.
2903 # define DISABLE_RB4_OPENDRAIN() (_ODCB4 = 0)
2904 # elif defined(_ODB4) // The PIF24F names this bit _OD instead of _ODC.
2905 # define ENABLE_RB4_OPENDRAIN() (_ODB4 = 1)
2906 # define DISABLE_RB4_OPENDRAIN() (_ODB4 = 0)
2907 # else
2908 # define DISABLE_RB4_OPENDRAIN() ((void) 0)
2909 # endif
2910 
2911 // Change notification, pullups and pulldowns:
2912 # if defined(_CNIEB4) || defined(__DOXYGEN__)
2913 /// Enable the pullup on pin RB4.
2914 # define ENABLE_RB4_PULLUP() (_CNPUB4 = 1)
2915 /// Disable the pullup on pin RB4.
2916 # define DISABLE_RB4_PULLUP() (_CNPUB4 = 0)
2917 
2918 /// Enable the pulldown on pin RB4.
2919 # define ENABLE_RB4_PULLDOWN() (_CNPDB4 = 1)
2920 /// Disable the pulldown on pin RB4.
2921 # define DISABLE_RB4_PULLDOWN() (_CNPDB4 = 0)
2922 
2923 /// Enable the change notification interrupt on pin RB4.
2924 # define ENABLE_RB4_CN_INTERRUPT() (_CNIEB4 = 1)
2925 /// Disable the change notification interrupt on pin RB4.
2926 # define DISABLE_RB4_CN_INTERRUPT() (_CNIEB4 = 0)
2927 
2928 # elif defined(RB4_CN)
2929 # define ENABLE_RB4_PULLUP() (RXY_GPIO_CNPUE(RB4_CN) = 1)
2930 # define DISABLE_RB4_PULLUP() (RXY_GPIO_CNPUE(RB4_CN) = 0)
2931 
2932 # if RXY_HAS_CNPDE(RB4_CN)
2933 # define ENABLE_RB4_PULLDOWN() (RXY_GPIO_CNPDE(RB4_CN) = 1)
2934 # define DISABLE_RB4_PULLDOWN() (RXY_GPIO_CNPDE(RB4_CN) = 0)
2935 # else
2936 # define DISABLE_RB4_PULLDOWN() ((void) 0)
2937 # endif
2938 
2939 # define ENABLE_RB4_CN_INTERRUPT() (RXY_GPIO_CNIE(RB4_CN) = 1)
2940 # define DISABLE_RB4_CN_INTERRUPT() (RXY_GPIO_CNIE(RB4_CN) = 0)
2941 
2942 # else
2943 # define DISABLE_RB4_PULLUP() ((void) 0)
2944 # define DISABLE_RB4_PULLDOWN() ((void) 0)
2945 # define DISABLE_RB4_CN_INTERRUPT() ((void) 0)
2946 # endif
2947 
2948 // High-level config
2949 // -----------------
2950 /** This macro disables pullups/downs, enables analog functionality, and configures
2951  * pin RB4 as an input.
2952  */
2953 # if defined(_ANSB4) || defined(RB4_AN) || defined(__DOXYGEN__)
2954 # define CONFIG_RB4_AS_ANALOG() \
2955  do { \
2956  ENABLE_RB4_ANALOG(); \
2957  CONFIG_RB4_AS_INPUT(); \
2958  DISABLE_RB4_OPENDRAIN(); \
2959  DISABLE_RB4_PULLUP(); \
2960  DISABLE_RB4_PULLDOWN(); \
2961  } while (0)
2962 # endif
2963 
2964 /** This macro disables open-drain and pullups/downs,
2965  * configures pin RB4 for digital (not analog) operation, and
2966  * configures the pin as an input.
2967  */
2968 # define CONFIG_RB4_AS_DIG_INPUT() \
2969  do { \
2970  DISABLE_RB4_ANALOG(); \
2971  CONFIG_RB4_AS_INPUT(); \
2972  DISABLE_RB4_OPENDRAIN(); \
2973  DISABLE_RB4_PULLUP(); \
2974  DISABLE_RB4_PULLDOWN(); \
2975  } while (0)
2976 
2977 /** This macro disables open-drain and pullups/downs,
2978  * configures pin RB4 for digital (not analog) operation, and
2979  * configures the pin as an output.
2980  */
2981 # define CONFIG_RB4_AS_DIG_OUTPUT() \
2982  do { \
2983  DISABLE_RB4_ANALOG(); \
2984  CONFIG_RB4_AS_OUTPUT(); \
2985  DISABLE_RB4_OPENDRAIN(); \
2986  DISABLE_RB4_PULLUP(); \
2987  DISABLE_RB4_PULLDOWN(); \
2988  } while (0)
2989 
2990 #endif // #if defined(_RB4) || defined(__DOXYGEN__): Provide GPIO for RB4
2991 
2992 
2993 
2994 
2995 
2996 // Provide GPIO for RB5
2997 // ====================
2998 #if defined(_RB5) || defined(__DOXYGEN__)
2999 
3000 // Dummy macros for documentation only
3001 # ifdef __DOXYGEN__
3002 /// This macro specifies the RPy value associated with pin RB5.
3003 /// Its device-specific definition is given in pic24_ports_mapping.h.
3004 # define RB5_RP xx
3005 
3006 /// This macro specifies the ANn value associated with pin RB5.
3007 /// Its device-specific definition is given in pic24_ports_mapping.h.
3008 # define RB5_AN xx
3009 
3010 /// This macro specifies the CNm value associated with pin RB5.
3011 /// Its device-specific definition is given in pic24_ports_mapping.h.
3012 # define RB5_CN xx
3013 
3014 //@}
3015 # endif // #ifdef __DOXYGEN__
3016 
3017 
3018 // Low-level config
3019 // ----------------
3020 // Analog:
3021 # if defined(_ANSB5) || defined(__DOXYGEN__)
3022 /// Enable analog functionality on pin RB5.
3023 # define ENABLE_RB5_ANALOG() (_ANSB5 = 1)
3024 /// Disable analog functionality on pin RB5.
3025 # define DISABLE_RB5_ANALOG() (_ANSB5 = 0)
3026 # elif defined(RB5_AN)
3027 # define ENABLE_RB5_ANALOG() (RXY_GPIO_PCFG(RB5_AN) = 0)
3028 # define DISABLE_RB5_ANALOG() (RXY_GPIO_PCFG(RB5_AN) = 1)
3029 # else
3030 # define DISABLE_RB5_ANALOG() ((void) 0)
3031 # endif
3032 
3033 // Input/output:
3034 /// Configure pin RB5 as an input.
3035 # define CONFIG_RB5_AS_INPUT() (_TRISB5 = 1)
3036 /// Configure pin RB5 as an output.
3037 # define CONFIG_RB5_AS_OUTPUT() (_TRISB5 = 0)
3038 
3039 // Open-drain:
3040 # if defined(_ODCB5) || defined(__DOXYGEN__)
3041 /// Enable the open-drain driver on pin RB5.
3042 # define ENABLE_RB5_OPENDRAIN() (_ODCB5 = 1)
3043 /// Disable the open-drain driver on pin RB5.
3044 # define DISABLE_RB5_OPENDRAIN() (_ODCB5 = 0)
3045 # elif defined(_ODB5) // The PIF24F names this bit _OD instead of _ODC.
3046 # define ENABLE_RB5_OPENDRAIN() (_ODB5 = 1)
3047 # define DISABLE_RB5_OPENDRAIN() (_ODB5 = 0)
3048 # else
3049 # define DISABLE_RB5_OPENDRAIN() ((void) 0)
3050 # endif
3051 
3052 // Change notification, pullups and pulldowns:
3053 # if defined(_CNIEB5) || defined(__DOXYGEN__)
3054 /// Enable the pullup on pin RB5.
3055 # define ENABLE_RB5_PULLUP() (_CNPUB5 = 1)
3056 /// Disable the pullup on pin RB5.
3057 # define DISABLE_RB5_PULLUP() (_CNPUB5 = 0)
3058 
3059 /// Enable the pulldown on pin RB5.
3060 # define ENABLE_RB5_PULLDOWN() (_CNPDB5 = 1)
3061 /// Disable the pulldown on pin RB5.
3062 # define DISABLE_RB5_PULLDOWN() (_CNPDB5 = 0)
3063 
3064 /// Enable the change notification interrupt on pin RB5.
3065 # define ENABLE_RB5_CN_INTERRUPT() (_CNIEB5 = 1)
3066 /// Disable the change notification interrupt on pin RB5.
3067 # define DISABLE_RB5_CN_INTERRUPT() (_CNIEB5 = 0)
3068 
3069 # elif defined(RB5_CN)
3070 # define ENABLE_RB5_PULLUP() (RXY_GPIO_CNPUE(RB5_CN) = 1)
3071 # define DISABLE_RB5_PULLUP() (RXY_GPIO_CNPUE(RB5_CN) = 0)
3072 
3073 # if RXY_HAS_CNPDE(RB5_CN)
3074 # define ENABLE_RB5_PULLDOWN() (RXY_GPIO_CNPDE(RB5_CN) = 1)
3075 # define DISABLE_RB5_PULLDOWN() (RXY_GPIO_CNPDE(RB5_CN) = 0)
3076 # else
3077 # define DISABLE_RB5_PULLDOWN() ((void) 0)
3078 # endif
3079 
3080 # define ENABLE_RB5_CN_INTERRUPT() (RXY_GPIO_CNIE(RB5_CN) = 1)
3081 # define DISABLE_RB5_CN_INTERRUPT() (RXY_GPIO_CNIE(RB5_CN) = 0)
3082 
3083 # else
3084 # define DISABLE_RB5_PULLUP() ((void) 0)
3085 # define DISABLE_RB5_PULLDOWN() ((void) 0)
3086 # define DISABLE_RB5_CN_INTERRUPT() ((void) 0)
3087 # endif
3088 
3089 // High-level config
3090 // -----------------
3091 /** This macro disables pullups/downs, enables analog functionality, and configures
3092  * pin RB5 as an input.
3093  */
3094 # if defined(_ANSB5) || defined(RB5_AN) || defined(__DOXYGEN__)
3095 # define CONFIG_RB5_AS_ANALOG() \
3096  do { \
3097  ENABLE_RB5_ANALOG(); \
3098  CONFIG_RB5_AS_INPUT(); \
3099  DISABLE_RB5_OPENDRAIN(); \
3100  DISABLE_RB5_PULLUP(); \
3101  DISABLE_RB5_PULLDOWN(); \
3102  } while (0)
3103 # endif
3104 
3105 /** This macro disables open-drain and pullups/downs,
3106  * configures pin RB5 for digital (not analog) operation, and
3107  * configures the pin as an input.
3108  */
3109 # define CONFIG_RB5_AS_DIG_INPUT() \
3110  do { \
3111  DISABLE_RB5_ANALOG(); \
3112  CONFIG_RB5_AS_INPUT(); \
3113  DISABLE_RB5_OPENDRAIN(); \
3114  DISABLE_RB5_PULLUP(); \
3115  DISABLE_RB5_PULLDOWN(); \
3116  } while (0)
3117 
3118 /** This macro disables open-drain and pullups/downs,
3119  * configures pin RB5 for digital (not analog) operation, and
3120  * configures the pin as an output.
3121  */
3122 # define CONFIG_RB5_AS_DIG_OUTPUT() \
3123  do { \
3124  DISABLE_RB5_ANALOG(); \
3125  CONFIG_RB5_AS_OUTPUT(); \
3126  DISABLE_RB5_OPENDRAIN(); \
3127  DISABLE_RB5_PULLUP(); \
3128  DISABLE_RB5_PULLDOWN(); \
3129  } while (0)
3130 
3131 #endif // #if defined(_RB5) || defined(__DOXYGEN__): Provide GPIO for RB5
3132 
3133 
3134 
3135 
3136 
3137 // Provide GPIO for RB6
3138 // ====================
3139 #if defined(_RB6) || defined(__DOXYGEN__)
3140 
3141 // Dummy macros for documentation only
3142 # ifdef __DOXYGEN__
3143 /// This macro specifies the RPy value associated with pin RB6.
3144 /// Its device-specific definition is given in pic24_ports_mapping.h.
3145 # define RB6_RP xx
3146 
3147 /// This macro specifies the ANn value associated with pin RB6.
3148 /// Its device-specific definition is given in pic24_ports_mapping.h.
3149 # define RB6_AN xx
3150 
3151 /// This macro specifies the CNm value associated with pin RB6.
3152 /// Its device-specific definition is given in pic24_ports_mapping.h.
3153 # define RB6_CN xx
3154 
3155 //@}
3156 # endif // #ifdef __DOXYGEN__
3157 
3158 
3159 // Low-level config
3160 // ----------------
3161 // Analog:
3162 # if defined(_ANSB6) || defined(__DOXYGEN__)
3163 /// Enable analog functionality on pin RB6.
3164 # define ENABLE_RB6_ANALOG() (_ANSB6 = 1)
3165 /// Disable analog functionality on pin RB6.
3166 # define DISABLE_RB6_ANALOG() (_ANSB6 = 0)
3167 # elif defined(RB6_AN)
3168 # define ENABLE_RB6_ANALOG() (RXY_GPIO_PCFG(RB6_AN) = 0)
3169 # define DISABLE_RB6_ANALOG() (RXY_GPIO_PCFG(RB6_AN) = 1)
3170 # else
3171 # define DISABLE_RB6_ANALOG() ((void) 0)
3172 # endif
3173 
3174 // Input/output:
3175 /// Configure pin RB6 as an input.
3176 # define CONFIG_RB6_AS_INPUT() (_TRISB6 = 1)
3177 /// Configure pin RB6 as an output.
3178 # define CONFIG_RB6_AS_OUTPUT() (_TRISB6 = 0)
3179 
3180 // Open-drain:
3181 # if defined(_ODCB6) || defined(__DOXYGEN__)
3182 /// Enable the open-drain driver on pin RB6.
3183 # define ENABLE_RB6_OPENDRAIN() (_ODCB6 = 1)
3184 /// Disable the open-drain driver on pin RB6.
3185 # define DISABLE_RB6_OPENDRAIN() (_ODCB6 = 0)
3186 # elif defined(_ODB6) // The PIF24F names this bit _OD instead of _ODC.
3187 # define ENABLE_RB6_OPENDRAIN() (_ODB6 = 1)
3188 # define DISABLE_RB6_OPENDRAIN() (_ODB6 = 0)
3189 # else
3190 # define DISABLE_RB6_OPENDRAIN() ((void) 0)
3191 # endif
3192 
3193 // Change notification, pullups and pulldowns:
3194 # if defined(_CNIEB6) || defined(__DOXYGEN__)
3195 /// Enable the pullup on pin RB6.
3196 # define ENABLE_RB6_PULLUP() (_CNPUB6 = 1)
3197 /// Disable the pullup on pin RB6.
3198 # define DISABLE_RB6_PULLUP() (_CNPUB6 = 0)
3199 
3200 /// Enable the pulldown on pin RB6.
3201 # define ENABLE_RB6_PULLDOWN() (_CNPDB6 = 1)
3202 /// Disable the pulldown on pin RB6.
3203 # define DISABLE_RB6_PULLDOWN() (_CNPDB6 = 0)
3204 
3205 /// Enable the change notification interrupt on pin RB6.
3206 # define ENABLE_RB6_CN_INTERRUPT() (_CNIEB6 = 1)
3207 /// Disable the change notification interrupt on pin RB6.
3208 # define DISABLE_RB6_CN_INTERRUPT() (_CNIEB6 = 0)
3209 
3210 # elif defined(RB6_CN)
3211 # define ENABLE_RB6_PULLUP() (RXY_GPIO_CNPUE(RB6_CN) = 1)
3212 # define DISABLE_RB6_PULLUP() (RXY_GPIO_CNPUE(RB6_CN) = 0)
3213 
3214 # if RXY_HAS_CNPDE(RB6_CN)
3215 # define ENABLE_RB6_PULLDOWN() (RXY_GPIO_CNPDE(RB6_CN) = 1)
3216 # define DISABLE_RB6_PULLDOWN() (RXY_GPIO_CNPDE(RB6_CN) = 0)
3217 # else
3218 # define DISABLE_RB6_PULLDOWN() ((void) 0)
3219 # endif
3220 
3221 # define ENABLE_RB6_CN_INTERRUPT() (RXY_GPIO_CNIE(RB6_CN) = 1)
3222 # define DISABLE_RB6_CN_INTERRUPT() (RXY_GPIO_CNIE(RB6_CN) = 0)
3223 
3224 # else
3225 # define DISABLE_RB6_PULLUP() ((void) 0)
3226 # define DISABLE_RB6_PULLDOWN() ((void) 0)
3227 # define DISABLE_RB6_CN_INTERRUPT() ((void) 0)
3228 # endif
3229 
3230 // High-level config
3231 // -----------------
3232 /** This macro disables pullups/downs, enables analog functionality, and configures
3233  * pin RB6 as an input.
3234  */
3235 # if defined(_ANSB6) || defined(RB6_AN) || defined(__DOXYGEN__)
3236 # define CONFIG_RB6_AS_ANALOG() \
3237  do { \
3238  ENABLE_RB6_ANALOG(); \
3239  CONFIG_RB6_AS_INPUT(); \
3240  DISABLE_RB6_OPENDRAIN(); \
3241  DISABLE_RB6_PULLUP(); \
3242  DISABLE_RB6_PULLDOWN(); \
3243  } while (0)
3244 # endif
3245 
3246 /** This macro disables open-drain and pullups/downs,
3247  * configures pin RB6 for digital (not analog) operation, and
3248  * configures the pin as an input.
3249  */
3250 # define CONFIG_RB6_AS_DIG_INPUT() \
3251  do { \
3252  DISABLE_RB6_ANALOG(); \
3253  CONFIG_RB6_AS_INPUT(); \
3254  DISABLE_RB6_OPENDRAIN(); \
3255  DISABLE_RB6_PULLUP(); \
3256  DISABLE_RB6_PULLDOWN(); \
3257  } while (0)
3258 
3259 /** This macro disables open-drain and pullups/downs,
3260  * configures pin RB6 for digital (not analog) operation, and
3261  * configures the pin as an output.
3262  */
3263 # define CONFIG_RB6_AS_DIG_OUTPUT() \
3264  do { \
3265  DISABLE_RB6_ANALOG(); \
3266  CONFIG_RB6_AS_OUTPUT(); \
3267  DISABLE_RB6_OPENDRAIN(); \
3268  DISABLE_RB6_PULLUP(); \
3269  DISABLE_RB6_PULLDOWN(); \
3270  } while (0)
3271 
3272 #endif // #if defined(_RB6) || defined(__DOXYGEN__): Provide GPIO for RB6
3273 
3274 
3275 
3276 
3277 
3278 // Provide GPIO for RB7
3279 // ====================
3280 #if defined(_RB7) || defined(__DOXYGEN__)
3281 
3282 // Dummy macros for documentation only
3283 # ifdef __DOXYGEN__
3284 /// This macro specifies the RPy value associated with pin RB7.
3285 /// Its device-specific definition is given in pic24_ports_mapping.h.
3286 # define RB7_RP xx
3287 
3288 /// This macro specifies the ANn value associated with pin RB7.
3289 /// Its device-specific definition is given in pic24_ports_mapping.h.
3290 # define RB7_AN xx
3291 
3292 /// This macro specifies the CNm value associated with pin RB7.
3293 /// Its device-specific definition is given in pic24_ports_mapping.h.
3294 # define RB7_CN xx
3295 
3296 //@}
3297 # endif // #ifdef __DOXYGEN__
3298 
3299 
3300 // Low-level config
3301 // ----------------
3302 // Analog:
3303 # if defined(_ANSB7) || defined(__DOXYGEN__)
3304 /// Enable analog functionality on pin RB7.
3305 # define ENABLE_RB7_ANALOG() (_ANSB7 = 1)
3306 /// Disable analog functionality on pin RB7.
3307 # define DISABLE_RB7_ANALOG() (_ANSB7 = 0)
3308 # elif defined(RB7_AN)
3309 # define ENABLE_RB7_ANALOG() (RXY_GPIO_PCFG(RB7_AN) = 0)
3310 # define DISABLE_RB7_ANALOG() (RXY_GPIO_PCFG(RB7_AN) = 1)
3311 # else
3312 # define DISABLE_RB7_ANALOG() ((void) 0)
3313 # endif
3314 
3315 // Input/output:
3316 /// Configure pin RB7 as an input.
3317 # define CONFIG_RB7_AS_INPUT() (_TRISB7 = 1)
3318 /// Configure pin RB7 as an output.
3319 # define CONFIG_RB7_AS_OUTPUT() (_TRISB7 = 0)
3320 
3321 // Open-drain:
3322 # if defined(_ODCB7) || defined(__DOXYGEN__)
3323 /// Enable the open-drain driver on pin RB7.
3324 # define ENABLE_RB7_OPENDRAIN() (_ODCB7 = 1)
3325 /// Disable the open-drain driver on pin RB7.
3326 # define DISABLE_RB7_OPENDRAIN() (_ODCB7 = 0)
3327 # elif defined(_ODB7) // The PIF24F names this bit _OD instead of _ODC.
3328 # define ENABLE_RB7_OPENDRAIN() (_ODB7 = 1)
3329 # define DISABLE_RB7_OPENDRAIN() (_ODB7 = 0)
3330 # else
3331 # define DISABLE_RB7_OPENDRAIN() ((void) 0)
3332 # endif
3333 
3334 // Change notification, pullups and pulldowns:
3335 # if defined(_CNIEB7) || defined(__DOXYGEN__)
3336 /// Enable the pullup on pin RB7.
3337 # define ENABLE_RB7_PULLUP() (_CNPUB7 = 1)
3338 /// Disable the pullup on pin RB7.
3339 # define DISABLE_RB7_PULLUP() (_CNPUB7 = 0)
3340 
3341 /// Enable the pulldown on pin RB7.
3342 # define ENABLE_RB7_PULLDOWN() (_CNPDB7 = 1)
3343 /// Disable the pulldown on pin RB7.
3344 # define DISABLE_RB7_PULLDOWN() (_CNPDB7 = 0)
3345 
3346 /// Enable the change notification interrupt on pin RB7.
3347 # define ENABLE_RB7_CN_INTERRUPT() (_CNIEB7 = 1)
3348 /// Disable the change notification interrupt on pin RB7.
3349 # define DISABLE_RB7_CN_INTERRUPT() (_CNIEB7 = 0)
3350 
3351 # elif defined(RB7_CN)
3352 # define ENABLE_RB7_PULLUP() (RXY_GPIO_CNPUE(RB7_CN) = 1)
3353 # define DISABLE_RB7_PULLUP() (RXY_GPIO_CNPUE(RB7_CN) = 0)
3354 
3355 # if RXY_HAS_CNPDE(RB7_CN)
3356 # define ENABLE_RB7_PULLDOWN() (RXY_GPIO_CNPDE(RB7_CN) = 1)
3357 # define DISABLE_RB7_PULLDOWN() (RXY_GPIO_CNPDE(RB7_CN) = 0)
3358 # else
3359 # define DISABLE_RB7_PULLDOWN() ((void) 0)
3360 # endif
3361 
3362 # define ENABLE_RB7_CN_INTERRUPT() (RXY_GPIO_CNIE(RB7_CN) = 1)
3363 # define DISABLE_RB7_CN_INTERRUPT() (RXY_GPIO_CNIE(RB7_CN) = 0)
3364 
3365 # else
3366 # define DISABLE_RB7_PULLUP() ((void) 0)
3367 # define DISABLE_RB7_PULLDOWN() ((void) 0)
3368 # define DISABLE_RB7_CN_INTERRUPT() ((void) 0)
3369 # endif
3370 
3371 // High-level config
3372 // -----------------
3373 /** This macro disables pullups/downs, enables analog functionality, and configures
3374  * pin RB7 as an input.
3375  */
3376 # if defined(_ANSB7) || defined(RB7_AN) || defined(__DOXYGEN__)
3377 # define CONFIG_RB7_AS_ANALOG() \
3378  do { \
3379  ENABLE_RB7_ANALOG(); \
3380  CONFIG_RB7_AS_INPUT(); \
3381  DISABLE_RB7_OPENDRAIN(); \
3382  DISABLE_RB7_PULLUP(); \
3383  DISABLE_RB7_PULLDOWN(); \
3384  } while (0)
3385 # endif
3386 
3387 /** This macro disables open-drain and pullups/downs,
3388  * configures pin RB7 for digital (not analog) operation, and
3389  * configures the pin as an input.
3390  */
3391 # define CONFIG_RB7_AS_DIG_INPUT() \
3392  do { \
3393  DISABLE_RB7_ANALOG(); \
3394  CONFIG_RB7_AS_INPUT(); \
3395  DISABLE_RB7_OPENDRAIN(); \
3396  DISABLE_RB7_PULLUP(); \
3397  DISABLE_RB7_PULLDOWN(); \
3398  } while (0)
3399 
3400 /** This macro disables open-drain and pullups/downs,
3401  * configures pin RB7 for digital (not analog) operation, and
3402  * configures the pin as an output.
3403  */
3404 # define CONFIG_RB7_AS_DIG_OUTPUT() \
3405  do { \
3406  DISABLE_RB7_ANALOG(); \
3407  CONFIG_RB7_AS_OUTPUT(); \
3408  DISABLE_RB7_OPENDRAIN(); \
3409  DISABLE_RB7_PULLUP(); \
3410  DISABLE_RB7_PULLDOWN(); \
3411  } while (0)
3412 
3413 #endif // #if defined(_RB7) || defined(__DOXYGEN__): Provide GPIO for RB7
3414 
3415 
3416 
3417 
3418 
3419 // Provide GPIO for RB8
3420 // ====================
3421 #if defined(_RB8) || defined(__DOXYGEN__)
3422 
3423 // Dummy macros for documentation only
3424 # ifdef __DOXYGEN__
3425 /// This macro specifies the RPy value associated with pin RB8.
3426 /// Its device-specific definition is given in pic24_ports_mapping.h.
3427 # define RB8_RP xx
3428 
3429 /// This macro specifies the ANn value associated with pin RB8.
3430 /// Its device-specific definition is given in pic24_ports_mapping.h.
3431 # define RB8_AN xx
3432 
3433 /// This macro specifies the CNm value associated with pin RB8.
3434 /// Its device-specific definition is given in pic24_ports_mapping.h.
3435 # define RB8_CN xx
3436 
3437 //@}
3438 # endif // #ifdef __DOXYGEN__
3439 
3440 
3441 // Low-level config
3442 // ----------------
3443 // Analog:
3444 # if defined(_ANSB8) || defined(__DOXYGEN__)
3445 /// Enable analog functionality on pin RB8.
3446 # define ENABLE_RB8_ANALOG() (_ANSB8 = 1)
3447 /// Disable analog functionality on pin RB8.
3448 # define DISABLE_RB8_ANALOG() (_ANSB8 = 0)
3449 # elif defined(RB8_AN)
3450 # define ENABLE_RB8_ANALOG() (RXY_GPIO_PCFG(RB8_AN) = 0)
3451 # define DISABLE_RB8_ANALOG() (RXY_GPIO_PCFG(RB8_AN) = 1)
3452 # else
3453 # define DISABLE_RB8_ANALOG() ((void) 0)
3454 # endif
3455 
3456 // Input/output:
3457 /// Configure pin RB8 as an input.
3458 # define CONFIG_RB8_AS_INPUT() (_TRISB8 = 1)
3459 /// Configure pin RB8 as an output.
3460 # define CONFIG_RB8_AS_OUTPUT() (_TRISB8 = 0)
3461 
3462 // Open-drain:
3463 # if defined(_ODCB8) || defined(__DOXYGEN__)
3464 /// Enable the open-drain driver on pin RB8.
3465 # define ENABLE_RB8_OPENDRAIN() (_ODCB8 = 1)
3466 /// Disable the open-drain driver on pin RB8.
3467 # define DISABLE_RB8_OPENDRAIN() (_ODCB8 = 0)
3468 # elif defined(_ODB8) // The PIF24F names this bit _OD instead of _ODC.
3469 # define ENABLE_RB8_OPENDRAIN() (_ODB8 = 1)
3470 # define DISABLE_RB8_OPENDRAIN() (_ODB8 = 0)
3471 # else
3472 # define DISABLE_RB8_OPENDRAIN() ((void) 0)
3473 # endif
3474 
3475 // Change notification, pullups and pulldowns:
3476 # if defined(_CNIEB8) || defined(__DOXYGEN__)
3477 /// Enable the pullup on pin RB8.
3478 # define ENABLE_RB8_PULLUP() (_CNPUB8 = 1)
3479 /// Disable the pullup on pin RB8.
3480 # define DISABLE_RB8_PULLUP() (_CNPUB8 = 0)
3481 
3482 /// Enable the pulldown on pin RB8.
3483 # define ENABLE_RB8_PULLDOWN() (_CNPDB8 = 1)
3484 /// Disable the pulldown on pin RB8.
3485 # define DISABLE_RB8_PULLDOWN() (_CNPDB8 = 0)
3486 
3487 /// Enable the change notification interrupt on pin RB8.
3488 # define ENABLE_RB8_CN_INTERRUPT() (_CNIEB8 = 1)
3489 /// Disable the change notification interrupt on pin RB8.
3490 # define DISABLE_RB8_CN_INTERRUPT() (_CNIEB8 = 0)
3491 
3492 # elif defined(RB8_CN)
3493 # define ENABLE_RB8_PULLUP() (RXY_GPIO_CNPUE(RB8_CN) = 1)
3494 # define DISABLE_RB8_PULLUP() (RXY_GPIO_CNPUE(RB8_CN) = 0)
3495 
3496 # if RXY_HAS_CNPDE(RB8_CN)
3497 # define ENABLE_RB8_PULLDOWN() (RXY_GPIO_CNPDE(RB8_CN) = 1)
3498 # define DISABLE_RB8_PULLDOWN() (RXY_GPIO_CNPDE(RB8_CN) = 0)
3499 # else
3500 # define DISABLE_RB8_PULLDOWN() ((void) 0)
3501 # endif
3502 
3503 # define ENABLE_RB8_CN_INTERRUPT() (RXY_GPIO_CNIE(RB8_CN) = 1)
3504 # define DISABLE_RB8_CN_INTERRUPT() (RXY_GPIO_CNIE(RB8_CN) = 0)
3505 
3506 # else
3507 # define DISABLE_RB8_PULLUP() ((void) 0)
3508 # define DISABLE_RB8_PULLDOWN() ((void) 0)
3509 # define DISABLE_RB8_CN_INTERRUPT() ((void) 0)
3510 # endif
3511 
3512 // High-level config
3513 // -----------------
3514 /** This macro disables pullups/downs, enables analog functionality, and configures
3515  * pin RB8 as an input.
3516  */
3517 # if defined(_ANSB8) || defined(RB8_AN) || defined(__DOXYGEN__)
3518 # define CONFIG_RB8_AS_ANALOG() \
3519  do { \
3520  ENABLE_RB8_ANALOG(); \
3521  CONFIG_RB8_AS_INPUT(); \
3522  DISABLE_RB8_OPENDRAIN(); \
3523  DISABLE_RB8_PULLUP(); \
3524  DISABLE_RB8_PULLDOWN(); \
3525  } while (0)
3526 # endif
3527 
3528 /** This macro disables open-drain and pullups/downs,
3529  * configures pin RB8 for digital (not analog) operation, and
3530  * configures the pin as an input.
3531  */
3532 # define CONFIG_RB8_AS_DIG_INPUT() \
3533  do { \
3534  DISABLE_RB8_ANALOG(); \
3535  CONFIG_RB8_AS_INPUT(); \
3536  DISABLE_RB8_OPENDRAIN(); \
3537  DISABLE_RB8_PULLUP(); \
3538  DISABLE_RB8_PULLDOWN(); \
3539  } while (0)
3540 
3541 /** This macro disables open-drain and pullups/downs,
3542  * configures pin RB8 for digital (not analog) operation, and
3543  * configures the pin as an output.
3544  */
3545 # define CONFIG_RB8_AS_DIG_OUTPUT() \
3546  do { \
3547  DISABLE_RB8_ANALOG(); \
3548  CONFIG_RB8_AS_OUTPUT(); \
3549  DISABLE_RB8_OPENDRAIN(); \
3550  DISABLE_RB8_PULLUP(); \
3551  DISABLE_RB8_PULLDOWN(); \
3552  } while (0)
3553 
3554 #endif // #if defined(_RB8) || defined(__DOXYGEN__): Provide GPIO for RB8
3555 
3556 
3557 
3558 
3559 
3560 // Provide GPIO for RB9
3561 // ====================
3562 #if defined(_RB9) || defined(__DOXYGEN__)
3563 
3564 // Dummy macros for documentation only
3565 # ifdef __DOXYGEN__
3566 /// This macro specifies the RPy value associated with pin RB9.
3567 /// Its device-specific definition is given in pic24_ports_mapping.h.
3568 # define RB9_RP xx
3569 
3570 /// This macro specifies the ANn value associated with pin RB9.
3571 /// Its device-specific definition is given in pic24_ports_mapping.h.
3572 # define RB9_AN xx
3573 
3574 /// This macro specifies the CNm value associated with pin RB9.
3575 /// Its device-specific definition is given in pic24_ports_mapping.h.
3576 # define RB9_CN xx
3577 
3578 //@}
3579 # endif // #ifdef __DOXYGEN__
3580 
3581 
3582 // Low-level config
3583 // ----------------
3584 // Analog:
3585 # if defined(_ANSB9) || defined(__DOXYGEN__)
3586 /// Enable analog functionality on pin RB9.
3587 # define ENABLE_RB9_ANALOG() (_ANSB9 = 1)
3588 /// Disable analog functionality on pin RB9.
3589 # define DISABLE_RB9_ANALOG() (_ANSB9 = 0)
3590 # elif defined(RB9_AN)
3591 # define ENABLE_RB9_ANALOG() (RXY_GPIO_PCFG(RB9_AN) = 0)
3592 # define DISABLE_RB9_ANALOG() (RXY_GPIO_PCFG(RB9_AN) = 1)
3593 # else
3594 # define DISABLE_RB9_ANALOG() ((void) 0)
3595 # endif
3596 
3597 // Input/output:
3598 /// Configure pin RB9 as an input.
3599 # define CONFIG_RB9_AS_INPUT() (_TRISB9 = 1)
3600 /// Configure pin RB9 as an output.
3601 # define CONFIG_RB9_AS_OUTPUT() (_TRISB9 = 0)
3602 
3603 // Open-drain:
3604 # if defined(_ODCB9) || defined(__DOXYGEN__)
3605 /// Enable the open-drain driver on pin RB9.
3606 # define ENABLE_RB9_OPENDRAIN() (_ODCB9 = 1)
3607 /// Disable the open-drain driver on pin RB9.
3608 # define DISABLE_RB9_OPENDRAIN() (_ODCB9 = 0)
3609 # elif defined(_ODB9) // The PIF24F names this bit _OD instead of _ODC.
3610 # define ENABLE_RB9_OPENDRAIN() (_ODB9 = 1)
3611 # define DISABLE_RB9_OPENDRAIN() (_ODB9 = 0)
3612 # else
3613 # define DISABLE_RB9_OPENDRAIN() ((void) 0)
3614 # endif
3615 
3616 // Change notification, pullups and pulldowns:
3617 # if defined(_CNIEB9) || defined(__DOXYGEN__)
3618 /// Enable the pullup on pin RB9.
3619 # define ENABLE_RB9_PULLUP() (_CNPUB9 = 1)
3620 /// Disable the pullup on pin RB9.
3621 # define DISABLE_RB9_PULLUP() (_CNPUB9 = 0)
3622 
3623 /// Enable the pulldown on pin RB9.
3624 # define ENABLE_RB9_PULLDOWN() (_CNPDB9 = 1)
3625 /// Disable the pulldown on pin RB9.
3626 # define DISABLE_RB9_PULLDOWN() (_CNPDB9 = 0)
3627 
3628 /// Enable the change notification interrupt on pin RB9.
3629 # define ENABLE_RB9_CN_INTERRUPT() (_CNIEB9 = 1)
3630 /// Disable the change notification interrupt on pin RB9.
3631 # define DISABLE_RB9_CN_INTERRUPT() (_CNIEB9 = 0)
3632 
3633 # elif defined(RB9_CN)
3634 # define ENABLE_RB9_PULLUP() (RXY_GPIO_CNPUE(RB9_CN) = 1)
3635 # define DISABLE_RB9_PULLUP() (RXY_GPIO_CNPUE(RB9_CN) = 0)
3636 
3637 # if RXY_HAS_CNPDE(RB9_CN)
3638 # define ENABLE_RB9_PULLDOWN() (RXY_GPIO_CNPDE(RB9_CN) = 1)
3639 # define DISABLE_RB9_PULLDOWN() (RXY_GPIO_CNPDE(RB9_CN) = 0)
3640 # else
3641 # define DISABLE_RB9_PULLDOWN() ((void) 0)
3642 # endif
3643 
3644 # define ENABLE_RB9_CN_INTERRUPT() (RXY_GPIO_CNIE(RB9_CN) = 1)
3645 # define DISABLE_RB9_CN_INTERRUPT() (RXY_GPIO_CNIE(RB9_CN) = 0)
3646 
3647 # else
3648 # define DISABLE_RB9_PULLUP() ((void) 0)
3649 # define DISABLE_RB9_PULLDOWN() ((void) 0)
3650 # define DISABLE_RB9_CN_INTERRUPT() ((void) 0)
3651 # endif
3652 
3653 // High-level config
3654 // -----------------
3655 /** This macro disables pullups/downs, enables analog functionality, and configures
3656  * pin RB9 as an input.
3657  */
3658 # if defined(_ANSB9) || defined(RB9_AN) || defined(__DOXYGEN__)
3659 # define CONFIG_RB9_AS_ANALOG() \
3660  do { \
3661  ENABLE_RB9_ANALOG(); \
3662  CONFIG_RB9_AS_INPUT(); \
3663  DISABLE_RB9_OPENDRAIN(); \
3664  DISABLE_RB9_PULLUP(); \
3665  DISABLE_RB9_PULLDOWN(); \
3666  } while (0)
3667 # endif
3668 
3669 /** This macro disables open-drain and pullups/downs,
3670  * configures pin RB9 for digital (not analog) operation, and
3671  * configures the pin as an input.
3672  */
3673 # define CONFIG_RB9_AS_DIG_INPUT() \
3674  do { \
3675  DISABLE_RB9_ANALOG(); \
3676  CONFIG_RB9_AS_INPUT(); \
3677  DISABLE_RB9_OPENDRAIN(); \
3678  DISABLE_RB9_PULLUP(); \
3679  DISABLE_RB9_PULLDOWN(); \
3680  } while (0)
3681 
3682 /** This macro disables open-drain and pullups/downs,
3683  * configures pin RB9 for digital (not analog) operation, and
3684  * configures the pin as an output.
3685  */
3686 # define CONFIG_RB9_AS_DIG_OUTPUT() \
3687  do { \
3688  DISABLE_RB9_ANALOG(); \
3689  CONFIG_RB9_AS_OUTPUT(); \
3690  DISABLE_RB9_OPENDRAIN(); \
3691  DISABLE_RB9_PULLUP(); \
3692  DISABLE_RB9_PULLDOWN(); \
3693  } while (0)
3694 
3695 #endif // #if defined(_RB9) || defined(__DOXYGEN__): Provide GPIO for RB9
3696 
3697 
3698 
3699 
3700 
3701 // Provide GPIO for RB10
3702 // ====================
3703 #if defined(_RB10) || defined(__DOXYGEN__)
3704 
3705 // Dummy macros for documentation only
3706 # ifdef __DOXYGEN__
3707 /// This macro specifies the RPy value associated with pin RB10.
3708 /// Its device-specific definition is given in pic24_ports_mapping.h.
3709 # define RB10_RP xx
3710 
3711 /// This macro specifies the ANn value associated with pin RB10.
3712 /// Its device-specific definition is given in pic24_ports_mapping.h.
3713 # define RB10_AN xx
3714 
3715 /// This macro specifies the CNm value associated with pin RB10.
3716 /// Its device-specific definition is given in pic24_ports_mapping.h.
3717 # define RB10_CN xx
3718 
3719 //@}
3720 # endif // #ifdef __DOXYGEN__
3721 
3722 
3723 // Low-level config
3724 // ----------------
3725 // Analog:
3726 # if defined(_ANSB10) || defined(__DOXYGEN__)
3727 /// Enable analog functionality on pin RB10.
3728 # define ENABLE_RB10_ANALOG() (_ANSB10 = 1)
3729 /// Disable analog functionality on pin RB10.
3730 # define DISABLE_RB10_ANALOG() (_ANSB10 = 0)
3731 # elif defined(RB10_AN)
3732 # define ENABLE_RB10_ANALOG() (RXY_GPIO_PCFG(RB10_AN) = 0)
3733 # define DISABLE_RB10_ANALOG() (RXY_GPIO_PCFG(RB10_AN) = 1)
3734 # else
3735 # define DISABLE_RB10_ANALOG() ((void) 0)
3736 # endif
3737 
3738 // Input/output:
3739 /// Configure pin RB10 as an input.
3740 # define CONFIG_RB10_AS_INPUT() (_TRISB10 = 1)
3741 /// Configure pin RB10 as an output.
3742 # define CONFIG_RB10_AS_OUTPUT() (_TRISB10 = 0)
3743 
3744 // Open-drain:
3745 # if defined(_ODCB10) || defined(__DOXYGEN__)
3746 /// Enable the open-drain driver on pin RB10.
3747 # define ENABLE_RB10_OPENDRAIN() (_ODCB10 = 1)
3748 /// Disable the open-drain driver on pin RB10.
3749 # define DISABLE_RB10_OPENDRAIN() (_ODCB10 = 0)
3750 # elif defined(_ODB10) // The PIF24F names this bit _OD instead of _ODC.
3751 # define ENABLE_RB10_OPENDRAIN() (_ODB10 = 1)
3752 # define DISABLE_RB10_OPENDRAIN() (_ODB10 = 0)
3753 # else
3754 # define DISABLE_RB10_OPENDRAIN() ((void) 0)
3755 # endif
3756 
3757 // Change notification, pullups and pulldowns:
3758 # if defined(_CNIEB10) || defined(__DOXYGEN__)
3759 /// Enable the pullup on pin RB10.
3760 # define ENABLE_RB10_PULLUP() (_CNPUB10 = 1)
3761 /// Disable the pullup on pin RB10.
3762 # define DISABLE_RB10_PULLUP() (_CNPUB10 = 0)
3763 
3764 /// Enable the pulldown on pin RB10.
3765 # define ENABLE_RB10_PULLDOWN() (_CNPDB10 = 1)
3766 /// Disable the pulldown on pin RB10.
3767 # define DISABLE_RB10_PULLDOWN() (_CNPDB10 = 0)
3768 
3769 /// Enable the change notification interrupt on pin RB10.
3770 # define ENABLE_RB10_CN_INTERRUPT() (_CNIEB10 = 1)
3771 /// Disable the change notification interrupt on pin RB10.
3772 # define DISABLE_RB10_CN_INTERRUPT() (_CNIEB10 = 0)
3773 
3774 # elif defined(RB10_CN)
3775 # define ENABLE_RB10_PULLUP() (RXY_GPIO_CNPUE(RB10_CN) = 1)
3776 # define DISABLE_RB10_PULLUP() (RXY_GPIO_CNPUE(RB10_CN) = 0)
3777 
3778 # if RXY_HAS_CNPDE(RB10_CN)
3779 # define ENABLE_RB10_PULLDOWN() (RXY_GPIO_CNPDE(RB10_CN) = 1)
3780 # define DISABLE_RB10_PULLDOWN() (RXY_GPIO_CNPDE(RB10_CN) = 0)
3781 # else
3782 # define DISABLE_RB10_PULLDOWN() ((void) 0)
3783 # endif
3784 
3785 # define ENABLE_RB10_CN_INTERRUPT() (RXY_GPIO_CNIE(RB10_CN) = 1)
3786 # define DISABLE_RB10_CN_INTERRUPT() (RXY_GPIO_CNIE(RB10_CN) = 0)
3787 
3788 # else
3789 # define DISABLE_RB10_PULLUP() ((void) 0)
3790 # define DISABLE_RB10_PULLDOWN() ((void) 0)
3791 # define DISABLE_RB10_CN_INTERRUPT() ((void) 0)
3792 # endif
3793 
3794 // High-level config
3795 // -----------------
3796 /** This macro disables pullups/downs, enables analog functionality, and configures
3797  * pin RB10 as an input.
3798  */
3799 # if defined(_ANSB10) || defined(RB10_AN) || defined(__DOXYGEN__)
3800 # define CONFIG_RB10_AS_ANALOG() \
3801  do { \
3802  ENABLE_RB10_ANALOG(); \
3803  CONFIG_RB10_AS_INPUT(); \
3804  DISABLE_RB10_OPENDRAIN(); \
3805  DISABLE_RB10_PULLUP(); \
3806  DISABLE_RB10_PULLDOWN(); \
3807  } while (0)
3808 # endif
3809 
3810 /** This macro disables open-drain and pullups/downs,
3811  * configures pin RB10 for digital (not analog) operation, and
3812  * configures the pin as an input.
3813  */
3814 # define CONFIG_RB10_AS_DIG_INPUT() \
3815  do { \
3816  DISABLE_RB10_ANALOG(); \
3817  CONFIG_RB10_AS_INPUT(); \
3818  DISABLE_RB10_OPENDRAIN(); \
3819  DISABLE_RB10_PULLUP(); \
3820  DISABLE_RB10_PULLDOWN(); \
3821  } while (0)
3822 
3823 /** This macro disables open-drain and pullups/downs,
3824  * configures pin RB10 for digital (not analog) operation, and
3825  * configures the pin as an output.
3826  */
3827 # define CONFIG_RB10_AS_DIG_OUTPUT() \
3828  do { \
3829  DISABLE_RB10_ANALOG(); \
3830  CONFIG_RB10_AS_OUTPUT(); \
3831  DISABLE_RB10_OPENDRAIN(); \
3832  DISABLE_RB10_PULLUP(); \
3833  DISABLE_RB10_PULLDOWN(); \
3834  } while (0)
3835 
3836 #endif // #if defined(_RB10) || defined(__DOXYGEN__): Provide GPIO for RB10
3837 
3838 
3839 
3840 
3841 
3842 // Provide GPIO for RB11
3843 // ====================
3844 #if defined(_RB11) || defined(__DOXYGEN__)
3845 
3846 // Dummy macros for documentation only
3847 # ifdef __DOXYGEN__
3848 /// This macro specifies the RPy value associated with pin RB11.
3849 /// Its device-specific definition is given in pic24_ports_mapping.h.
3850 # define RB11_RP xx
3851 
3852 /// This macro specifies the ANn value associated with pin RB11.
3853 /// Its device-specific definition is given in pic24_ports_mapping.h.
3854 # define RB11_AN xx
3855 
3856 /// This macro specifies the CNm value associated with pin RB11.
3857 /// Its device-specific definition is given in pic24_ports_mapping.h.
3858 # define RB11_CN xx
3859 
3860 //@}
3861 # endif // #ifdef __DOXYGEN__
3862 
3863 
3864 // Low-level config
3865 // ----------------
3866 // Analog:
3867 # if defined(_ANSB11) || defined(__DOXYGEN__)
3868 /// Enable analog functionality on pin RB11.
3869 # define ENABLE_RB11_ANALOG() (_ANSB11 = 1)
3870 /// Disable analog functionality on pin RB11.
3871 # define DISABLE_RB11_ANALOG() (_ANSB11 = 0)
3872 # elif defined(RB11_AN)
3873 # define ENABLE_RB11_ANALOG() (RXY_GPIO_PCFG(RB11_AN) = 0)
3874 # define DISABLE_RB11_ANALOG() (RXY_GPIO_PCFG(RB11_AN) = 1)
3875 # else
3876 # define DISABLE_RB11_ANALOG() ((void) 0)
3877 # endif
3878 
3879 // Input/output:
3880 /// Configure pin RB11 as an input.
3881 # define CONFIG_RB11_AS_INPUT() (_TRISB11 = 1)
3882 /// Configure pin RB11 as an output.
3883 # define CONFIG_RB11_AS_OUTPUT() (_TRISB11 = 0)
3884 
3885 // Open-drain:
3886 # if defined(_ODCB11) || defined(__DOXYGEN__)
3887 /// Enable the open-drain driver on pin RB11.
3888 # define ENABLE_RB11_OPENDRAIN() (_ODCB11 = 1)
3889 /// Disable the open-drain driver on pin RB11.
3890 # define DISABLE_RB11_OPENDRAIN() (_ODCB11 = 0)
3891 # elif defined(_ODB11) // The PIF24F names this bit _OD instead of _ODC.
3892 # define ENABLE_RB11_OPENDRAIN() (_ODB11 = 1)
3893 # define DISABLE_RB11_OPENDRAIN() (_ODB11 = 0)
3894 # else
3895 # define DISABLE_RB11_OPENDRAIN() ((void) 0)
3896 # endif
3897 
3898 // Change notification, pullups and pulldowns:
3899 # if defined(_CNIEB11) || defined(__DOXYGEN__)
3900 /// Enable the pullup on pin RB11.
3901 # define ENABLE_RB11_PULLUP() (_CNPUB11 = 1)
3902 /// Disable the pullup on pin RB11.
3903 # define DISABLE_RB11_PULLUP() (_CNPUB11 = 0)
3904 
3905 /// Enable the pulldown on pin RB11.
3906 # define ENABLE_RB11_PULLDOWN() (_CNPDB11 = 1)
3907 /// Disable the pulldown on pin RB11.
3908 # define DISABLE_RB11_PULLDOWN() (_CNPDB11 = 0)
3909 
3910 /// Enable the change notification interrupt on pin RB11.
3911 # define ENABLE_RB11_CN_INTERRUPT() (_CNIEB11 = 1)
3912 /// Disable the change notification interrupt on pin RB11.
3913 # define DISABLE_RB11_CN_INTERRUPT() (_CNIEB11 = 0)
3914 
3915 # elif defined(RB11_CN)
3916 # define ENABLE_RB11_PULLUP() (RXY_GPIO_CNPUE(RB11_CN) = 1)
3917 # define DISABLE_RB11_PULLUP() (RXY_GPIO_CNPUE(RB11_CN) = 0)
3918 
3919 # if RXY_HAS_CNPDE(RB11_CN)
3920 # define ENABLE_RB11_PULLDOWN() (RXY_GPIO_CNPDE(RB11_CN) = 1)
3921 # define DISABLE_RB11_PULLDOWN() (RXY_GPIO_CNPDE(RB11_CN) = 0)
3922 # else
3923 # define DISABLE_RB11_PULLDOWN() ((void) 0)
3924 # endif
3925 
3926 # define ENABLE_RB11_CN_INTERRUPT() (RXY_GPIO_CNIE(RB11_CN) = 1)
3927 # define DISABLE_RB11_CN_INTERRUPT() (RXY_GPIO_CNIE(RB11_CN) = 0)
3928 
3929 # else
3930 # define DISABLE_RB11_PULLUP() ((void) 0)
3931 # define DISABLE_RB11_PULLDOWN() ((void) 0)
3932 # define DISABLE_RB11_CN_INTERRUPT() ((void) 0)
3933 # endif
3934 
3935 // High-level config
3936 // -----------------
3937 /** This macro disables pullups/downs, enables analog functionality, and configures
3938  * pin RB11 as an input.
3939  */
3940 # if defined(_ANSB11) || defined(RB11_AN) || defined(__DOXYGEN__)
3941 # define CONFIG_RB11_AS_ANALOG() \
3942  do { \
3943  ENABLE_RB11_ANALOG(); \
3944  CONFIG_RB11_AS_INPUT(); \
3945  DISABLE_RB11_OPENDRAIN(); \
3946  DISABLE_RB11_PULLUP(); \
3947  DISABLE_RB11_PULLDOWN(); \
3948  } while (0)
3949 # endif
3950 
3951 /** This macro disables open-drain and pullups/downs,
3952  * configures pin RB11 for digital (not analog) operation, and
3953  * configures the pin as an input.
3954  */
3955 # define CONFIG_RB11_AS_DIG_INPUT() \
3956  do { \
3957  DISABLE_RB11_ANALOG(); \
3958  CONFIG_RB11_AS_INPUT(); \
3959  DISABLE_RB11_OPENDRAIN(); \
3960  DISABLE_RB11_PULLUP(); \
3961  DISABLE_RB11_PULLDOWN(); \
3962  } while (0)
3963 
3964 /** This macro disables open-drain and pullups/downs,
3965  * configures pin RB11 for digital (not analog) operation, and
3966  * configures the pin as an output.
3967  */
3968 # define CONFIG_RB11_AS_DIG_OUTPUT() \
3969  do { \
3970  DISABLE_RB11_ANALOG(); \
3971  CONFIG_RB11_AS_OUTPUT(); \
3972  DISABLE_RB11_OPENDRAIN(); \
3973  DISABLE_RB11_PULLUP(); \
3974  DISABLE_RB11_PULLDOWN(); \
3975  } while (0)
3976 
3977 #endif // #if defined(_RB11) || defined(__DOXYGEN__): Provide GPIO for RB11
3978 
3979 
3980 
3981 
3982 
3983 // Provide GPIO for RB12
3984 // ====================
3985 #if defined(_RB12) || defined(__DOXYGEN__)
3986 
3987 // Dummy macros for documentation only
3988 # ifdef __DOXYGEN__
3989 /// This macro specifies the RPy value associated with pin RB12.
3990 /// Its device-specific definition is given in pic24_ports_mapping.h.
3991 # define RB12_RP xx
3992 
3993 /// This macro specifies the ANn value associated with pin RB12.
3994 /// Its device-specific definition is given in pic24_ports_mapping.h.
3995 # define RB12_AN xx
3996 
3997 /// This macro specifies the CNm value associated with pin RB12.
3998 /// Its device-specific definition is given in pic24_ports_mapping.h.
3999 # define RB12_CN xx
4000 
4001 //@}
4002 # endif // #ifdef __DOXYGEN__
4003 
4004 
4005 // Low-level config
4006 // ----------------
4007 // Analog:
4008 # if defined(_ANSB12) || defined(__DOXYGEN__)
4009 /// Enable analog functionality on pin RB12.
4010 # define ENABLE_RB12_ANALOG() (_ANSB12 = 1)
4011 /// Disable analog functionality on pin RB12.
4012 # define DISABLE_RB12_ANALOG() (_ANSB12 = 0)
4013 # elif defined(RB12_AN)
4014 # define ENABLE_RB12_ANALOG() (RXY_GPIO_PCFG(RB12_AN) = 0)
4015 # define DISABLE_RB12_ANALOG() (RXY_GPIO_PCFG(RB12_AN) = 1)
4016 # else
4017 # define DISABLE_RB12_ANALOG() ((void) 0)
4018 # endif
4019 
4020 // Input/output:
4021 /// Configure pin RB12 as an input.
4022 # define CONFIG_RB12_AS_INPUT() (_TRISB12 = 1)
4023 /// Configure pin RB12 as an output.
4024 # define CONFIG_RB12_AS_OUTPUT() (_TRISB12 = 0)
4025 
4026 // Open-drain:
4027 # if defined(_ODCB12) || defined(__DOXYGEN__)
4028 /// Enable the open-drain driver on pin RB12.
4029 # define ENABLE_RB12_OPENDRAIN() (_ODCB12 = 1)
4030 /// Disable the open-drain driver on pin RB12.
4031 # define DISABLE_RB12_OPENDRAIN() (_ODCB12 = 0)
4032 # elif defined(_ODB12) // The PIF24F names this bit _OD instead of _ODC.
4033 # define ENABLE_RB12_OPENDRAIN() (_ODB12 = 1)
4034 # define DISABLE_RB12_OPENDRAIN() (_ODB12 = 0)
4035 # else
4036 # define DISABLE_RB12_OPENDRAIN() ((void) 0)
4037 # endif
4038 
4039 // Change notification, pullups and pulldowns:
4040 # if defined(_CNIEB12) || defined(__DOXYGEN__)
4041 /// Enable the pullup on pin RB12.
4042 # define ENABLE_RB12_PULLUP() (_CNPUB12 = 1)
4043 /// Disable the pullup on pin RB12.
4044 # define DISABLE_RB12_PULLUP() (_CNPUB12 = 0)
4045 
4046 /// Enable the pulldown on pin RB12.
4047 # define ENABLE_RB12_PULLDOWN() (_CNPDB12 = 1)
4048 /// Disable the pulldown on pin RB12.
4049 # define DISABLE_RB12_PULLDOWN() (_CNPDB12 = 0)
4050 
4051 /// Enable the change notification interrupt on pin RB12.
4052 # define ENABLE_RB12_CN_INTERRUPT() (_CNIEB12 = 1)
4053 /// Disable the change notification interrupt on pin RB12.
4054 # define DISABLE_RB12_CN_INTERRUPT() (_CNIEB12 = 0)
4055 
4056 # elif defined(RB12_CN)
4057 # define ENABLE_RB12_PULLUP() (RXY_GPIO_CNPUE(RB12_CN) = 1)
4058 # define DISABLE_RB12_PULLUP() (RXY_GPIO_CNPUE(RB12_CN) = 0)
4059 
4060 # if RXY_HAS_CNPDE(RB12_CN)
4061 # define ENABLE_RB12_PULLDOWN() (RXY_GPIO_CNPDE(RB12_CN) = 1)
4062 # define DISABLE_RB12_PULLDOWN() (RXY_GPIO_CNPDE(RB12_CN) = 0)
4063 # else
4064 # define DISABLE_RB12_PULLDOWN() ((void) 0)
4065 # endif
4066 
4067 # define ENABLE_RB12_CN_INTERRUPT() (RXY_GPIO_CNIE(RB12_CN) = 1)
4068 # define DISABLE_RB12_CN_INTERRUPT() (RXY_GPIO_CNIE(RB12_CN) = 0)
4069 
4070 # else
4071 # define DISABLE_RB12_PULLUP() ((void) 0)
4072 # define DISABLE_RB12_PULLDOWN() ((void) 0)
4073 # define DISABLE_RB12_CN_INTERRUPT() ((void) 0)
4074 # endif
4075 
4076 // High-level config
4077 // -----------------
4078 /** This macro disables pullups/downs, enables analog functionality, and configures
4079  * pin RB12 as an input.
4080  */
4081 # if defined(_ANSB12) || defined(RB12_AN) || defined(__DOXYGEN__)
4082 # define CONFIG_RB12_AS_ANALOG() \
4083  do { \
4084  ENABLE_RB12_ANALOG(); \
4085  CONFIG_RB12_AS_INPUT(); \
4086  DISABLE_RB12_OPENDRAIN(); \
4087  DISABLE_RB12_PULLUP(); \
4088  DISABLE_RB12_PULLDOWN(); \
4089  } while (0)
4090 # endif
4091 
4092 /** This macro disables open-drain and pullups/downs,
4093  * configures pin RB12 for digital (not analog) operation, and
4094  * configures the pin as an input.
4095  */
4096 # define CONFIG_RB12_AS_DIG_INPUT() \
4097  do { \
4098  DISABLE_RB12_ANALOG(); \
4099  CONFIG_RB12_AS_INPUT(); \
4100  DISABLE_RB12_OPENDRAIN(); \
4101  DISABLE_RB12_PULLUP(); \
4102  DISABLE_RB12_PULLDOWN(); \
4103  } while (0)
4104 
4105 /** This macro disables open-drain and pullups/downs,
4106  * configures pin RB12 for digital (not analog) operation, and
4107  * configures the pin as an output.
4108  */
4109 # define CONFIG_RB12_AS_DIG_OUTPUT() \
4110  do { \
4111  DISABLE_RB12_ANALOG(); \
4112  CONFIG_RB12_AS_OUTPUT(); \
4113  DISABLE_RB12_OPENDRAIN(); \
4114  DISABLE_RB12_PULLUP(); \
4115  DISABLE_RB12_PULLDOWN(); \
4116  } while (0)
4117 
4118 #endif // #if defined(_RB12) || defined(__DOXYGEN__): Provide GPIO for RB12
4119 
4120 
4121 
4122 
4123 
4124 // Provide GPIO for RB13
4125 // ====================
4126 #if defined(_RB13) || defined(__DOXYGEN__)
4127 
4128 // Dummy macros for documentation only
4129 # ifdef __DOXYGEN__
4130 /// This macro specifies the RPy value associated with pin RB13.
4131 /// Its device-specific definition is given in pic24_ports_mapping.h.
4132 # define RB13_RP xx
4133 
4134 /// This macro specifies the ANn value associated with pin RB13.
4135 /// Its device-specific definition is given in pic24_ports_mapping.h.
4136 # define RB13_AN xx
4137 
4138 /// This macro specifies the CNm value associated with pin RB13.
4139 /// Its device-specific definition is given in pic24_ports_mapping.h.
4140 # define RB13_CN xx
4141 
4142 //@}
4143 # endif // #ifdef __DOXYGEN__
4144 
4145 
4146 // Low-level config
4147 // ----------------
4148 // Analog:
4149 # if defined(_ANSB13) || defined(__DOXYGEN__)
4150 /// Enable analog functionality on pin RB13.
4151 # define ENABLE_RB13_ANALOG() (_ANSB13 = 1)
4152 /// Disable analog functionality on pin RB13.
4153 # define DISABLE_RB13_ANALOG() (_ANSB13 = 0)
4154 # elif defined(RB13_AN)
4155 # define ENABLE_RB13_ANALOG() (RXY_GPIO_PCFG(RB13_AN) = 0)
4156 # define DISABLE_RB13_ANALOG() (RXY_GPIO_PCFG(RB13_AN) = 1)
4157 # else
4158 # define DISABLE_RB13_ANALOG() ((void) 0)
4159 # endif
4160 
4161 // Input/output:
4162 /// Configure pin RB13 as an input.
4163 # define CONFIG_RB13_AS_INPUT() (_TRISB13 = 1)
4164 /// Configure pin RB13 as an output.
4165 # define CONFIG_RB13_AS_OUTPUT() (_TRISB13 = 0)
4166 
4167 // Open-drain:
4168 # if defined(_ODCB13) || defined(__DOXYGEN__)
4169 /// Enable the open-drain driver on pin RB13.
4170 # define ENABLE_RB13_OPENDRAIN() (_ODCB13 = 1)
4171 /// Disable the open-drain driver on pin RB13.
4172 # define DISABLE_RB13_OPENDRAIN() (_ODCB13 = 0)
4173 # elif defined(_ODB13) // The PIF24F names this bit _OD instead of _ODC.
4174 # define ENABLE_RB13_OPENDRAIN() (_ODB13 = 1)
4175 # define DISABLE_RB13_OPENDRAIN() (_ODB13 = 0)
4176 # else
4177 # define DISABLE_RB13_OPENDRAIN() ((void) 0)
4178 # endif
4179 
4180 // Change notification, pullups and pulldowns:
4181 # if defined(_CNIEB13) || defined(__DOXYGEN__)
4182 /// Enable the pullup on pin RB13.
4183 # define ENABLE_RB13_PULLUP() (_CNPUB13 = 1)
4184 /// Disable the pullup on pin RB13.
4185 # define DISABLE_RB13_PULLUP() (_CNPUB13 = 0)
4186 
4187 /// Enable the pulldown on pin RB13.
4188 # define ENABLE_RB13_PULLDOWN() (_CNPDB13 = 1)
4189 /// Disable the pulldown on pin RB13.
4190 # define DISABLE_RB13_PULLDOWN() (_CNPDB13 = 0)
4191 
4192 /// Enable the change notification interrupt on pin RB13.
4193 # define ENABLE_RB13_CN_INTERRUPT() (_CNIEB13 = 1)
4194 /// Disable the change notification interrupt on pin RB13.
4195 # define DISABLE_RB13_CN_INTERRUPT() (_CNIEB13 = 0)
4196 
4197 # elif defined(RB13_CN)
4198 # define ENABLE_RB13_PULLUP() (RXY_GPIO_CNPUE(RB13_CN) = 1)
4199 # define DISABLE_RB13_PULLUP() (RXY_GPIO_CNPUE(RB13_CN) = 0)
4200 
4201 # if RXY_HAS_CNPDE(RB13_CN)
4202 # define ENABLE_RB13_PULLDOWN() (RXY_GPIO_CNPDE(RB13_CN) = 1)
4203 # define DISABLE_RB13_PULLDOWN() (RXY_GPIO_CNPDE(RB13_CN) = 0)
4204 # else
4205 # define DISABLE_RB13_PULLDOWN() ((void) 0)
4206 # endif
4207 
4208 # define ENABLE_RB13_CN_INTERRUPT() (RXY_GPIO_CNIE(RB13_CN) = 1)
4209 # define DISABLE_RB13_CN_INTERRUPT() (RXY_GPIO_CNIE(RB13_CN) = 0)
4210 
4211 # else
4212 # define DISABLE_RB13_PULLUP() ((void) 0)
4213 # define DISABLE_RB13_PULLDOWN() ((void) 0)
4214 # define DISABLE_RB13_CN_INTERRUPT() ((void) 0)
4215 # endif
4216 
4217 // High-level config
4218 // -----------------
4219 /** This macro disables pullups/downs, enables analog functionality, and configures
4220  * pin RB13 as an input.
4221  */
4222 # if defined(_ANSB13) || defined(RB13_AN) || defined(__DOXYGEN__)
4223 # define CONFIG_RB13_AS_ANALOG() \
4224  do { \
4225  ENABLE_RB13_ANALOG(); \
4226  CONFIG_RB13_AS_INPUT(); \
4227  DISABLE_RB13_OPENDRAIN(); \
4228  DISABLE_RB13_PULLUP(); \
4229  DISABLE_RB13_PULLDOWN(); \
4230  } while (0)
4231 # endif
4232 
4233 /** This macro disables open-drain and pullups/downs,
4234  * configures pin RB13 for digital (not analog) operation, and
4235  * configures the pin as an input.
4236  */
4237 # define CONFIG_RB13_AS_DIG_INPUT() \
4238  do { \
4239  DISABLE_RB13_ANALOG(); \
4240  CONFIG_RB13_AS_INPUT(); \
4241  DISABLE_RB13_OPENDRAIN(); \
4242  DISABLE_RB13_PULLUP(); \
4243  DISABLE_RB13_PULLDOWN(); \
4244  } while (0)
4245 
4246 /** This macro disables open-drain and pullups/downs,
4247  * configures pin RB13 for digital (not analog) operation, and
4248  * configures the pin as an output.
4249  */
4250 # define CONFIG_RB13_AS_DIG_OUTPUT() \
4251  do { \
4252  DISABLE_RB13_ANALOG(); \
4253  CONFIG_RB13_AS_OUTPUT(); \
4254  DISABLE_RB13_OPENDRAIN(); \
4255  DISABLE_RB13_PULLUP(); \
4256  DISABLE_RB13_PULLDOWN(); \
4257  } while (0)
4258 
4259 #endif // #if defined(_RB13) || defined(__DOXYGEN__): Provide GPIO for RB13
4260 
4261 
4262 
4263 
4264 
4265 // Provide GPIO for RB14
4266 // ====================
4267 #if defined(_RB14) || defined(__DOXYGEN__)
4268 
4269 // Dummy macros for documentation only
4270 # ifdef __DOXYGEN__
4271 /// This macro specifies the RPy value associated with pin RB14.
4272 /// Its device-specific definition is given in pic24_ports_mapping.h.
4273 # define RB14_RP xx
4274 
4275 /// This macro specifies the ANn value associated with pin RB14.
4276 /// Its device-specific definition is given in pic24_ports_mapping.h.
4277 # define RB14_AN xx
4278 
4279 /// This macro specifies the CNm value associated with pin RB14.
4280 /// Its device-specific definition is given in pic24_ports_mapping.h.
4281 # define RB14_CN xx
4282 
4283 //@}
4284 # endif // #ifdef __DOXYGEN__
4285 
4286 
4287 // Low-level config
4288 // ----------------
4289 // Analog:
4290 # if defined(_ANSB14) || defined(__DOXYGEN__)
4291 /// Enable analog functionality on pin RB14.
4292 # define ENABLE_RB14_ANALOG() (_ANSB14 = 1)
4293 /// Disable analog functionality on pin RB14.
4294 # define DISABLE_RB14_ANALOG() (_ANSB14 = 0)
4295 # elif defined(RB14_AN)
4296 # define ENABLE_RB14_ANALOG() (RXY_GPIO_PCFG(RB14_AN) = 0)
4297 # define DISABLE_RB14_ANALOG() (RXY_GPIO_PCFG(RB14_AN) = 1)
4298 # else
4299 # define DISABLE_RB14_ANALOG() ((void) 0)
4300 # endif
4301 
4302 // Input/output:
4303 /// Configure pin RB14 as an input.
4304 # define CONFIG_RB14_AS_INPUT() (_TRISB14 = 1)
4305 /// Configure pin RB14 as an output.
4306 # define CONFIG_RB14_AS_OUTPUT() (_TRISB14 = 0)
4307 
4308 // Open-drain:
4309 # if defined(_ODCB14) || defined(__DOXYGEN__)
4310 /// Enable the open-drain driver on pin RB14.
4311 # define ENABLE_RB14_OPENDRAIN() (_ODCB14 = 1)
4312 /// Disable the open-drain driver on pin RB14.
4313 # define DISABLE_RB14_OPENDRAIN() (_ODCB14 = 0)
4314 # elif defined(_ODB14) // The PIF24F names this bit _OD instead of _ODC.
4315 # define ENABLE_RB14_OPENDRAIN() (_ODB14 = 1)
4316 # define DISABLE_RB14_OPENDRAIN() (_ODB14 = 0)
4317 # else
4318 # define DISABLE_RB14_OPENDRAIN() ((void) 0)
4319 # endif
4320 
4321 // Change notification, pullups and pulldowns:
4322 # if defined(_CNIEB14) || defined(__DOXYGEN__)
4323 /// Enable the pullup on pin RB14.
4324 # define ENABLE_RB14_PULLUP() (_CNPUB14 = 1)
4325 /// Disable the pullup on pin RB14.
4326 # define DISABLE_RB14_PULLUP() (_CNPUB14 = 0)
4327 
4328 /// Enable the pulldown on pin RB14.
4329 # define ENABLE_RB14_PULLDOWN() (_CNPDB14 = 1)
4330 /// Disable the pulldown on pin RB14.
4331 # define DISABLE_RB14_PULLDOWN() (_CNPDB14 = 0)
4332 
4333 /// Enable the change notification interrupt on pin RB14.
4334 # define ENABLE_RB14_CN_INTERRUPT() (_CNIEB14 = 1)
4335 /// Disable the change notification interrupt on pin RB14.
4336 # define DISABLE_RB14_CN_INTERRUPT() (_CNIEB14 = 0)
4337 
4338 # elif defined(RB14_CN)
4339 # define ENABLE_RB14_PULLUP() (RXY_GPIO_CNPUE(RB14_CN) = 1)
4340 # define DISABLE_RB14_PULLUP() (RXY_GPIO_CNPUE(RB14_CN) = 0)
4341 
4342 # if RXY_HAS_CNPDE(RB14_CN)
4343 # define ENABLE_RB14_PULLDOWN() (RXY_GPIO_CNPDE(RB14_CN) = 1)
4344 # define DISABLE_RB14_PULLDOWN() (RXY_GPIO_CNPDE(RB14_CN) = 0)
4345 # else
4346 # define DISABLE_RB14_PULLDOWN() ((void) 0)
4347 # endif
4348 
4349 # define ENABLE_RB14_CN_INTERRUPT() (RXY_GPIO_CNIE(RB14_CN) = 1)
4350 # define DISABLE_RB14_CN_INTERRUPT() (RXY_GPIO_CNIE(RB14_CN) = 0)
4351 
4352 # else
4353 # define DISABLE_RB14_PULLUP() ((void) 0)
4354 # define DISABLE_RB14_PULLDOWN() ((void) 0)
4355 # define DISABLE_RB14_CN_INTERRUPT() ((void) 0)
4356 # endif
4357 
4358 // High-level config
4359 // -----------------
4360 /** This macro disables pullups/downs, enables analog functionality, and configures
4361  * pin RB14 as an input.
4362  */
4363 # if defined(_ANSB14) || defined(RB14_AN) || defined(__DOXYGEN__)
4364 # define CONFIG_RB14_AS_ANALOG() \
4365  do { \
4366  ENABLE_RB14_ANALOG(); \
4367  CONFIG_RB14_AS_INPUT(); \
4368  DISABLE_RB14_OPENDRAIN(); \
4369  DISABLE_RB14_PULLUP(); \
4370  DISABLE_RB14_PULLDOWN(); \
4371  } while (0)
4372 # endif
4373 
4374 /** This macro disables open-drain and pullups/downs,
4375  * configures pin RB14 for digital (not analog) operation, and
4376  * configures the pin as an input.
4377  */
4378 # define CONFIG_RB14_AS_DIG_INPUT() \
4379  do { \
4380  DISABLE_RB14_ANALOG(); \
4381  CONFIG_RB14_AS_INPUT(); \
4382  DISABLE_RB14_OPENDRAIN(); \
4383  DISABLE_RB14_PULLUP(); \
4384  DISABLE_RB14_PULLDOWN(); \
4385  } while (0)
4386 
4387 /** This macro disables open-drain and pullups/downs,
4388  * configures pin RB14 for digital (not analog) operation, and
4389  * configures the pin as an output.
4390  */
4391 # define CONFIG_RB14_AS_DIG_OUTPUT() \
4392  do { \
4393  DISABLE_RB14_ANALOG(); \
4394  CONFIG_RB14_AS_OUTPUT(); \
4395  DISABLE_RB14_OPENDRAIN(); \
4396  DISABLE_RB14_PULLUP(); \
4397  DISABLE_RB14_PULLDOWN(); \
4398  } while (0)
4399 
4400 #endif // #if defined(_RB14) || defined(__DOXYGEN__): Provide GPIO for RB14
4401 
4402 
4403 
4404 
4405 
4406 // Provide GPIO for RB15
4407 // ====================
4408 #if defined(_RB15) || defined(__DOXYGEN__)
4409 
4410 // Dummy macros for documentation only
4411 # ifdef __DOXYGEN__
4412 /// This macro specifies the RPy value associated with pin RB15.
4413 /// Its device-specific definition is given in pic24_ports_mapping.h.
4414 # define RB15_RP xx
4415 
4416 /// This macro specifies the ANn value associated with pin RB15.
4417 /// Its device-specific definition is given in pic24_ports_mapping.h.
4418 # define RB15_AN xx
4419 
4420 /// This macro specifies the CNm value associated with pin RB15.
4421 /// Its device-specific definition is given in pic24_ports_mapping.h.
4422 # define RB15_CN xx
4423 
4424 //@}
4425 # endif // #ifdef __DOXYGEN__
4426 
4427 
4428 // Low-level config
4429 // ----------------
4430 // Analog:
4431 # if defined(_ANSB15) || defined(__DOXYGEN__)
4432 /// Enable analog functionality on pin RB15.
4433 # define ENABLE_RB15_ANALOG() (_ANSB15 = 1)
4434 /// Disable analog functionality on pin RB15.
4435 # define DISABLE_RB15_ANALOG() (_ANSB15 = 0)
4436 # elif defined(RB15_AN)
4437 # define ENABLE_RB15_ANALOG() (RXY_GPIO_PCFG(RB15_AN) = 0)
4438 # define DISABLE_RB15_ANALOG() (RXY_GPIO_PCFG(RB15_AN) = 1)
4439 # else
4440 # define DISABLE_RB15_ANALOG() ((void) 0)
4441 # endif
4442 
4443 // Input/output:
4444 /// Configure pin RB15 as an input.
4445 # define CONFIG_RB15_AS_INPUT() (_TRISB15 = 1)
4446 /// Configure pin RB15 as an output.
4447 # define CONFIG_RB15_AS_OUTPUT() (_TRISB15 = 0)
4448 
4449 // Open-drain:
4450 # if defined(_ODCB15) || defined(__DOXYGEN__)
4451 /// Enable the open-drain driver on pin RB15.
4452 # define ENABLE_RB15_OPENDRAIN() (_ODCB15 = 1)
4453 /// Disable the open-drain driver on pin RB15.
4454 # define DISABLE_RB15_OPENDRAIN() (_ODCB15 = 0)
4455 # elif defined(_ODB15) // The PIF24F names this bit _OD instead of _ODC.
4456 # define ENABLE_RB15_OPENDRAIN() (_ODB15 = 1)
4457 # define DISABLE_RB15_OPENDRAIN() (_ODB15 = 0)
4458 # else
4459 # define DISABLE_RB15_OPENDRAIN() ((void) 0)
4460 # endif
4461 
4462 // Change notification, pullups and pulldowns:
4463 # if defined(_CNIEB15) || defined(__DOXYGEN__)
4464 /// Enable the pullup on pin RB15.
4465 # define ENABLE_RB15_PULLUP() (_CNPUB15 = 1)
4466 /// Disable the pullup on pin RB15.
4467 # define DISABLE_RB15_PULLUP() (_CNPUB15 = 0)
4468 
4469 /// Enable the pulldown on pin RB15.
4470 # define ENABLE_RB15_PULLDOWN() (_CNPDB15 = 1)
4471 /// Disable the pulldown on pin RB15.
4472 # define DISABLE_RB15_PULLDOWN() (_CNPDB15 = 0)
4473 
4474 /// Enable the change notification interrupt on pin RB15.
4475 # define ENABLE_RB15_CN_INTERRUPT() (_CNIEB15 = 1)
4476 /// Disable the change notification interrupt on pin RB15.
4477 # define DISABLE_RB15_CN_INTERRUPT() (_CNIEB15 = 0)
4478 
4479 # elif defined(RB15_CN)
4480 # define ENABLE_RB15_PULLUP() (RXY_GPIO_CNPUE(RB15_CN) = 1)
4481 # define DISABLE_RB15_PULLUP() (RXY_GPIO_CNPUE(RB15_CN) = 0)
4482 
4483 # if RXY_HAS_CNPDE(RB15_CN)
4484 # define ENABLE_RB15_PULLDOWN() (RXY_GPIO_CNPDE(RB15_CN) = 1)
4485 # define DISABLE_RB15_PULLDOWN() (RXY_GPIO_CNPDE(RB15_CN) = 0)
4486 # else
4487 # define DISABLE_RB15_PULLDOWN() ((void) 0)
4488 # endif
4489 
4490 # define ENABLE_RB15_CN_INTERRUPT() (RXY_GPIO_CNIE(RB15_CN) = 1)
4491 # define DISABLE_RB15_CN_INTERRUPT() (RXY_GPIO_CNIE(RB15_CN) = 0)
4492 
4493 # else
4494 # define DISABLE_RB15_PULLUP() ((void) 0)
4495 # define DISABLE_RB15_PULLDOWN() ((void) 0)
4496 # define DISABLE_RB15_CN_INTERRUPT() ((void) 0)
4497 # endif
4498 
4499 // High-level config
4500 // -----------------
4501 /** This macro disables pullups/downs, enables analog functionality, and configures
4502  * pin RB15 as an input.
4503  */
4504 # if defined(_ANSB15) || defined(RB15_AN) || defined(__DOXYGEN__)
4505 # define CONFIG_RB15_AS_ANALOG() \
4506  do { \
4507  ENABLE_RB15_ANALOG(); \
4508  CONFIG_RB15_AS_INPUT(); \
4509  DISABLE_RB15_OPENDRAIN(); \
4510  DISABLE_RB15_PULLUP(); \
4511  DISABLE_RB15_PULLDOWN(); \
4512  } while (0)
4513 # endif
4514 
4515 /** This macro disables open-drain and pullups/downs,
4516  * configures pin RB15 for digital (not analog) operation, and
4517  * configures the pin as an input.
4518  */
4519 # define CONFIG_RB15_AS_DIG_INPUT() \
4520  do { \
4521  DISABLE_RB15_ANALOG(); \
4522  CONFIG_RB15_AS_INPUT(); \
4523  DISABLE_RB15_OPENDRAIN(); \
4524  DISABLE_RB15_PULLUP(); \
4525  DISABLE_RB15_PULLDOWN(); \
4526  } while (0)
4527 
4528 /** This macro disables open-drain and pullups/downs,
4529  * configures pin RB15 for digital (not analog) operation, and
4530  * configures the pin as an output.
4531  */
4532 # define CONFIG_RB15_AS_DIG_OUTPUT() \
4533  do { \
4534  DISABLE_RB15_ANALOG(); \
4535  CONFIG_RB15_AS_OUTPUT(); \
4536  DISABLE_RB15_OPENDRAIN(); \
4537  DISABLE_RB15_PULLUP(); \
4538  DISABLE_RB15_PULLDOWN(); \
4539  } while (0)
4540 
4541 #endif // #if defined(_RB15) || defined(__DOXYGEN__): Provide GPIO for RB15
4542 
4543 
4544 
4545 
4546 
4547 // Provide GPIO for RC0
4548 // ====================
4549 #if defined(_RC0) || defined(__DOXYGEN__)
4550 
4551 // Dummy macros for documentation only
4552 # ifdef __DOXYGEN__
4553 /// This macro specifies the RPy value associated with pin RC0.
4554 /// Its device-specific definition is given in pic24_ports_mapping.h.
4555 # define RC0_RP xx
4556 
4557 /// This macro specifies the ANn value associated with pin RC0.
4558 /// Its device-specific definition is given in pic24_ports_mapping.h.
4559 # define RC0_AN xx
4560 
4561 /// This macro specifies the CNm value associated with pin RC0.
4562 /// Its device-specific definition is given in pic24_ports_mapping.h.
4563 # define RC0_CN xx
4564 
4565 //@}
4566 # endif // #ifdef __DOXYGEN__
4567 
4568 
4569 // Low-level config
4570 // ----------------
4571 // Analog:
4572 # if defined(_ANSC0) || defined(__DOXYGEN__)
4573 /// Enable analog functionality on pin RC0.
4574 # define ENABLE_RC0_ANALOG() (_ANSC0 = 1)
4575 /// Disable analog functionality on pin RC0.
4576 # define DISABLE_RC0_ANALOG() (_ANSC0 = 0)
4577 # elif defined(RC0_AN)
4578 # define ENABLE_RC0_ANALOG() (RXY_GPIO_PCFG(RC0_AN) = 0)
4579 # define DISABLE_RC0_ANALOG() (RXY_GPIO_PCFG(RC0_AN) = 1)
4580 # else
4581 # define DISABLE_RC0_ANALOG() ((void) 0)
4582 # endif
4583 
4584 // Input/output:
4585 /// Configure pin RC0 as an input.
4586 # define CONFIG_RC0_AS_INPUT() (_TRISC0 = 1)
4587 /// Configure pin RC0 as an output.
4588 # define CONFIG_RC0_AS_OUTPUT() (_TRISC0 = 0)
4589 
4590 // Open-drain:
4591 # if defined(_ODCC0) || defined(__DOXYGEN__)
4592 /// Enable the open-drain driver on pin RC0.
4593 # define ENABLE_RC0_OPENDRAIN() (_ODCC0 = 1)
4594 /// Disable the open-drain driver on pin RC0.
4595 # define DISABLE_RC0_OPENDRAIN() (_ODCC0 = 0)
4596 # elif defined(_ODC0) // The PIF24F names this bit _OD instead of _ODC.
4597 # define ENABLE_RC0_OPENDRAIN() (_ODC0 = 1)
4598 # define DISABLE_RC0_OPENDRAIN() (_ODC0 = 0)
4599 # else
4600 # define DISABLE_RC0_OPENDRAIN() ((void) 0)
4601 # endif
4602 
4603 // Change notification, pullups and pulldowns:
4604 # if defined(_CNIEC0) || defined(__DOXYGEN__)
4605 /// Enable the pullup on pin RC0.
4606 # define ENABLE_RC0_PULLUP() (_CNPUC0 = 1)
4607 /// Disable the pullup on pin RC0.
4608 # define DISABLE_RC0_PULLUP() (_CNPUC0 = 0)
4609 
4610 /// Enable the pulldown on pin RC0.
4611 # define ENABLE_RC0_PULLDOWN() (_CNPDC0 = 1)
4612 /// Disable the pulldown on pin RC0.
4613 # define DISABLE_RC0_PULLDOWN() (_CNPDC0 = 0)
4614 
4615 /// Enable the change notification interrupt on pin RC0.
4616 # define ENABLE_RC0_CN_INTERRUPT() (_CNIEC0 = 1)
4617 /// Disable the change notification interrupt on pin RC0.
4618 # define DISABLE_RC0_CN_INTERRUPT() (_CNIEC0 = 0)
4619 
4620 # elif defined(RC0_CN)
4621 # define ENABLE_RC0_PULLUP() (RXY_GPIO_CNPUE(RC0_CN) = 1)
4622 # define DISABLE_RC0_PULLUP() (RXY_GPIO_CNPUE(RC0_CN) = 0)
4623 
4624 # if RXY_HAS_CNPDE(RC0_CN)
4625 # define ENABLE_RC0_PULLDOWN() (RXY_GPIO_CNPDE(RC0_CN) = 1)
4626 # define DISABLE_RC0_PULLDOWN() (RXY_GPIO_CNPDE(RC0_CN) = 0)
4627 # else
4628 # define DISABLE_RC0_PULLDOWN() ((void) 0)
4629 # endif
4630 
4631 # define ENABLE_RC0_CN_INTERRUPT() (RXY_GPIO_CNIE(RC0_CN) = 1)
4632 # define DISABLE_RC0_CN_INTERRUPT() (RXY_GPIO_CNIE(RC0_CN) = 0)
4633 
4634 # else
4635 # define DISABLE_RC0_PULLUP() ((void) 0)
4636 # define DISABLE_RC0_PULLDOWN() ((void) 0)
4637 # define DISABLE_RC0_CN_INTERRUPT() ((void) 0)
4638 # endif
4639 
4640 // High-level config
4641 // -----------------
4642 /** This macro disables pullups/downs, enables analog functionality, and configures
4643  * pin RC0 as an input.
4644  */
4645 # if defined(_ANSC0) || defined(RC0_AN) || defined(__DOXYGEN__)
4646 # define CONFIG_RC0_AS_ANALOG() \
4647  do { \
4648  ENABLE_RC0_ANALOG(); \
4649  CONFIG_RC0_AS_INPUT(); \
4650  DISABLE_RC0_OPENDRAIN(); \
4651  DISABLE_RC0_PULLUP(); \
4652  DISABLE_RC0_PULLDOWN(); \
4653  } while (0)
4654 # endif
4655 
4656 /** This macro disables open-drain and pullups/downs,
4657  * configures pin RC0 for digital (not analog) operation, and
4658  * configures the pin as an input.
4659  */
4660 # define CONFIG_RC0_AS_DIG_INPUT() \
4661  do { \
4662  DISABLE_RC0_ANALOG(); \
4663  CONFIG_RC0_AS_INPUT(); \
4664  DISABLE_RC0_OPENDRAIN(); \
4665  DISABLE_RC0_PULLUP(); \
4666  DISABLE_RC0_PULLDOWN(); \
4667  } while (0)
4668 
4669 /** This macro disables open-drain and pullups/downs,
4670  * configures pin RC0 for digital (not analog) operation, and
4671  * configures the pin as an output.
4672  */
4673 # define CONFIG_RC0_AS_DIG_OUTPUT() \
4674  do { \
4675  DISABLE_RC0_ANALOG(); \
4676  CONFIG_RC0_AS_OUTPUT(); \
4677  DISABLE_RC0_OPENDRAIN(); \
4678  DISABLE_RC0_PULLUP(); \
4679  DISABLE_RC0_PULLDOWN(); \
4680  } while (0)
4681 
4682 #endif // #if defined(_RC0) || defined(__DOXYGEN__): Provide GPIO for RC0
4683 
4684 
4685 
4686 
4687 
4688 // Provide GPIO for RC1
4689 // ====================
4690 #if defined(_RC1) || defined(__DOXYGEN__)
4691 
4692 // Dummy macros for documentation only
4693 # ifdef __DOXYGEN__
4694 /// This macro specifies the RPy value associated with pin RC1.
4695 /// Its device-specific definition is given in pic24_ports_mapping.h.
4696 # define RC1_RP xx
4697 
4698 /// This macro specifies the ANn value associated with pin RC1.
4699 /// Its device-specific definition is given in pic24_ports_mapping.h.
4700 # define RC1_AN xx
4701 
4702 /// This macro specifies the CNm value associated with pin RC1.
4703 /// Its device-specific definition is given in pic24_ports_mapping.h.
4704 # define RC1_CN xx
4705 
4706 //@}
4707 # endif // #ifdef __DOXYGEN__
4708 
4709 
4710 // Low-level config
4711 // ----------------
4712 // Analog:
4713 # if defined(_ANSC1) || defined(__DOXYGEN__)
4714 /// Enable analog functionality on pin RC1.
4715 # define ENABLE_RC1_ANALOG() (_ANSC1 = 1)
4716 /// Disable analog functionality on pin RC1.
4717 # define DISABLE_RC1_ANALOG() (_ANSC1 = 0)
4718 # elif defined(RC1_AN)
4719 # define ENABLE_RC1_ANALOG() (RXY_GPIO_PCFG(RC1_AN) = 0)
4720 # define DISABLE_RC1_ANALOG() (RXY_GPIO_PCFG(RC1_AN) = 1)
4721 # else
4722 # define DISABLE_RC1_ANALOG() ((void) 0)
4723 # endif
4724 
4725 // Input/output:
4726 /// Configure pin RC1 as an input.
4727 # define CONFIG_RC1_AS_INPUT() (_TRISC1 = 1)
4728 /// Configure pin RC1 as an output.
4729 # define CONFIG_RC1_AS_OUTPUT() (_TRISC1 = 0)
4730 
4731 // Open-drain:
4732 # if defined(_ODCC1) || defined(__DOXYGEN__)
4733 /// Enable the open-drain driver on pin RC1.
4734 # define ENABLE_RC1_OPENDRAIN() (_ODCC1 = 1)
4735 /// Disable the open-drain driver on pin RC1.
4736 # define DISABLE_RC1_OPENDRAIN() (_ODCC1 = 0)
4737 # elif defined(_ODC1) // The PIF24F names this bit _OD instead of _ODC.
4738 # define ENABLE_RC1_OPENDRAIN() (_ODC1 = 1)
4739 # define DISABLE_RC1_OPENDRAIN() (_ODC1 = 0)
4740 # else
4741 # define DISABLE_RC1_OPENDRAIN() ((void) 0)
4742 # endif
4743 
4744 // Change notification, pullups and pulldowns:
4745 # if defined(_CNIEC1) || defined(__DOXYGEN__)
4746 /// Enable the pullup on pin RC1.
4747 # define ENABLE_RC1_PULLUP() (_CNPUC1 = 1)
4748 /// Disable the pullup on pin RC1.
4749 # define DISABLE_RC1_PULLUP() (_CNPUC1 = 0)
4750 
4751 /// Enable the pulldown on pin RC1.
4752 # define ENABLE_RC1_PULLDOWN() (_CNPDC1 = 1)
4753 /// Disable the pulldown on pin RC1.
4754 # define DISABLE_RC1_PULLDOWN() (_CNPDC1 = 0)
4755 
4756 /// Enable the change notification interrupt on pin RC1.
4757 # define ENABLE_RC1_CN_INTERRUPT() (_CNIEC1 = 1)
4758 /// Disable the change notification interrupt on pin RC1.
4759 # define DISABLE_RC1_CN_INTERRUPT() (_CNIEC1 = 0)
4760 
4761 # elif defined(RC1_CN)
4762 # define ENABLE_RC1_PULLUP() (RXY_GPIO_CNPUE(RC1_CN) = 1)
4763 # define DISABLE_RC1_PULLUP() (RXY_GPIO_CNPUE(RC1_CN) = 0)
4764 
4765 # if RXY_HAS_CNPDE(RC1_CN)
4766 # define ENABLE_RC1_PULLDOWN() (RXY_GPIO_CNPDE(RC1_CN) = 1)
4767 # define DISABLE_RC1_PULLDOWN() (RXY_GPIO_CNPDE(RC1_CN) = 0)
4768 # else
4769 # define DISABLE_RC1_PULLDOWN() ((void) 0)
4770 # endif
4771 
4772 # define ENABLE_RC1_CN_INTERRUPT() (RXY_GPIO_CNIE(RC1_CN) = 1)
4773 # define DISABLE_RC1_CN_INTERRUPT() (RXY_GPIO_CNIE(RC1_CN) = 0)
4774 
4775 # else
4776 # define DISABLE_RC1_PULLUP() ((void) 0)
4777 # define DISABLE_RC1_PULLDOWN() ((void) 0)
4778 # define DISABLE_RC1_CN_INTERRUPT() ((void) 0)
4779 # endif
4780 
4781 // High-level config
4782 // -----------------
4783 /** This macro disables pullups/downs, enables analog functionality, and configures
4784  * pin RC1 as an input.
4785  */
4786 # if defined(_ANSC1) || defined(RC1_AN) || defined(__DOXYGEN__)
4787 # define CONFIG_RC1_AS_ANALOG() \
4788  do { \
4789  ENABLE_RC1_ANALOG(); \
4790  CONFIG_RC1_AS_INPUT(); \
4791  DISABLE_RC1_OPENDRAIN(); \
4792  DISABLE_RC1_PULLUP(); \
4793  DISABLE_RC1_PULLDOWN(); \
4794  } while (0)
4795 # endif
4796 
4797 /** This macro disables open-drain and pullups/downs,
4798  * configures pin RC1 for digital (not analog) operation, and
4799  * configures the pin as an input.
4800  */
4801 # define CONFIG_RC1_AS_DIG_INPUT() \
4802  do { \
4803  DISABLE_RC1_ANALOG(); \
4804  CONFIG_RC1_AS_INPUT(); \
4805  DISABLE_RC1_OPENDRAIN(); \
4806  DISABLE_RC1_PULLUP(); \
4807  DISABLE_RC1_PULLDOWN(); \
4808  } while (0)
4809 
4810 /** This macro disables open-drain and pullups/downs,
4811  * configures pin RC1 for digital (not analog) operation, and
4812  * configures the pin as an output.
4813  */
4814 # define CONFIG_RC1_AS_DIG_OUTPUT() \
4815  do { \
4816  DISABLE_RC1_ANALOG(); \
4817  CONFIG_RC1_AS_OUTPUT(); \
4818  DISABLE_RC1_OPENDRAIN(); \
4819  DISABLE_RC1_PULLUP(); \
4820  DISABLE_RC1_PULLDOWN(); \
4821  } while (0)
4822 
4823 #endif // #if defined(_RC1) || defined(__DOXYGEN__): Provide GPIO for RC1
4824 
4825 
4826 
4827 
4828 
4829 // Provide GPIO for RC2
4830 // ====================
4831 #if defined(_RC2) || defined(__DOXYGEN__)
4832 
4833 // Dummy macros for documentation only
4834 # ifdef __DOXYGEN__
4835 /// This macro specifies the RPy value associated with pin RC2.
4836 /// Its device-specific definition is given in pic24_ports_mapping.h.
4837 # define RC2_RP xx
4838 
4839 /// This macro specifies the ANn value associated with pin RC2.
4840 /// Its device-specific definition is given in pic24_ports_mapping.h.
4841 # define RC2_AN xx
4842 
4843 /// This macro specifies the CNm value associated with pin RC2.
4844 /// Its device-specific definition is given in pic24_ports_mapping.h.
4845 # define RC2_CN xx
4846 
4847 //@}
4848 # endif // #ifdef __DOXYGEN__
4849 
4850 
4851 // Low-level config
4852 // ----------------
4853 // Analog:
4854 # if defined(_ANSC2) || defined(__DOXYGEN__)
4855 /// Enable analog functionality on pin RC2.
4856 # define ENABLE_RC2_ANALOG() (_ANSC2 = 1)
4857 /// Disable analog functionality on pin RC2.
4858 # define DISABLE_RC2_ANALOG() (_ANSC2 = 0)
4859 # elif defined(RC2_AN)
4860 # define ENABLE_RC2_ANALOG() (RXY_GPIO_PCFG(RC2_AN) = 0)
4861 # define DISABLE_RC2_ANALOG() (RXY_GPIO_PCFG(RC2_AN) = 1)
4862 # else
4863 # define DISABLE_RC2_ANALOG() ((void) 0)
4864 # endif
4865 
4866 // Input/output:
4867 /// Configure pin RC2 as an input.
4868 # define CONFIG_RC2_AS_INPUT() (_TRISC2 = 1)
4869 /// Configure pin RC2 as an output.
4870 # define CONFIG_RC2_AS_OUTPUT() (_TRISC2 = 0)
4871 
4872 // Open-drain:
4873 # if defined(_ODCC2) || defined(__DOXYGEN__)
4874 /// Enable the open-drain driver on pin RC2.
4875 # define ENABLE_RC2_OPENDRAIN() (_ODCC2 = 1)
4876 /// Disable the open-drain driver on pin RC2.
4877 # define DISABLE_RC2_OPENDRAIN() (_ODCC2 = 0)
4878 # elif defined(_ODC2) // The PIF24F names this bit _OD instead of _ODC.
4879 # define ENABLE_RC2_OPENDRAIN() (_ODC2 = 1)
4880 # define DISABLE_RC2_OPENDRAIN() (_ODC2 = 0)
4881 # else
4882 # define DISABLE_RC2_OPENDRAIN() ((void) 0)
4883 # endif
4884 
4885 // Change notification, pullups and pulldowns:
4886 # if defined(_CNIEC2) || defined(__DOXYGEN__)
4887 /// Enable the pullup on pin RC2.
4888 # define ENABLE_RC2_PULLUP() (_CNPUC2 = 1)
4889 /// Disable the pullup on pin RC2.
4890 # define DISABLE_RC2_PULLUP() (_CNPUC2 = 0)
4891 
4892 /// Enable the pulldown on pin RC2.
4893 # define ENABLE_RC2_PULLDOWN() (_CNPDC2 = 1)
4894 /// Disable the pulldown on pin RC2.
4895 # define DISABLE_RC2_PULLDOWN() (_CNPDC2 = 0)
4896 
4897 /// Enable the change notification interrupt on pin RC2.
4898 # define ENABLE_RC2_CN_INTERRUPT() (_CNIEC2 = 1)
4899 /// Disable the change notification interrupt on pin RC2.
4900 # define DISABLE_RC2_CN_INTERRUPT() (_CNIEC2 = 0)
4901 
4902 # elif defined(RC2_CN)
4903 # define ENABLE_RC2_PULLUP() (RXY_GPIO_CNPUE(RC2_CN) = 1)
4904 # define DISABLE_RC2_PULLUP() (RXY_GPIO_CNPUE(RC2_CN) = 0)
4905 
4906 # if RXY_HAS_CNPDE(RC2_CN)
4907 # define ENABLE_RC2_PULLDOWN() (RXY_GPIO_CNPDE(RC2_CN) = 1)
4908 # define DISABLE_RC2_PULLDOWN() (RXY_GPIO_CNPDE(RC2_CN) = 0)
4909 # else
4910 # define DISABLE_RC2_PULLDOWN() ((void) 0)
4911 # endif
4912 
4913 # define ENABLE_RC2_CN_INTERRUPT() (RXY_GPIO_CNIE(RC2_CN) = 1)
4914 # define DISABLE_RC2_CN_INTERRUPT() (RXY_GPIO_CNIE(RC2_CN) = 0)
4915 
4916 # else
4917 # define DISABLE_RC2_PULLUP() ((void) 0)
4918 # define DISABLE_RC2_PULLDOWN() ((void) 0)
4919 # define DISABLE_RC2_CN_INTERRUPT() ((void) 0)
4920 # endif
4921 
4922 // High-level config
4923 // -----------------
4924 /** This macro disables pullups/downs, enables analog functionality, and configures
4925  * pin RC2 as an input.
4926  */
4927 # if defined(_ANSC2) || defined(RC2_AN) || defined(__DOXYGEN__)
4928 # define CONFIG_RC2_AS_ANALOG() \
4929  do { \
4930  ENABLE_RC2_ANALOG(); \
4931  CONFIG_RC2_AS_INPUT(); \
4932  DISABLE_RC2_OPENDRAIN(); \
4933  DISABLE_RC2_PULLUP(); \
4934  DISABLE_RC2_PULLDOWN(); \
4935  } while (0)
4936 # endif
4937 
4938 /** This macro disables open-drain and pullups/downs,
4939  * configures pin RC2 for digital (not analog) operation, and
4940  * configures the pin as an input.
4941  */
4942 # define CONFIG_RC2_AS_DIG_INPUT() \
4943  do { \
4944  DISABLE_RC2_ANALOG(); \
4945  CONFIG_RC2_AS_INPUT(); \
4946  DISABLE_RC2_OPENDRAIN(); \
4947  DISABLE_RC2_PULLUP(); \
4948  DISABLE_RC2_PULLDOWN(); \
4949  } while (0)
4950 
4951 /** This macro disables open-drain and pullups/downs,
4952  * configures pin RC2 for digital (not analog) operation, and
4953  * configures the pin as an output.
4954  */
4955 # define CONFIG_RC2_AS_DIG_OUTPUT() \
4956  do { \
4957  DISABLE_RC2_ANALOG(); \
4958  CONFIG_RC2_AS_OUTPUT(); \
4959  DISABLE_RC2_OPENDRAIN(); \
4960  DISABLE_RC2_PULLUP(); \
4961  DISABLE_RC2_PULLDOWN(); \
4962  } while (0)
4963 
4964 #endif // #if defined(_RC2) || defined(__DOXYGEN__): Provide GPIO for RC2
4965 
4966 
4967 
4968 
4969 
4970 // Provide GPIO for RC3
4971 // ====================
4972 #if defined(_RC3) || defined(__DOXYGEN__)
4973 
4974 // Dummy macros for documentation only
4975 # ifdef __DOXYGEN__
4976 /// This macro specifies the RPy value associated with pin RC3.
4977 /// Its device-specific definition is given in pic24_ports_mapping.h.
4978 # define RC3_RP xx
4979 
4980 /// This macro specifies the ANn value associated with pin RC3.
4981 /// Its device-specific definition is given in pic24_ports_mapping.h.
4982 # define RC3_AN xx
4983 
4984 /// This macro specifies the CNm value associated with pin RC3.
4985 /// Its device-specific definition is given in pic24_ports_mapping.h.
4986 # define RC3_CN xx
4987 
4988 //@}
4989 # endif // #ifdef __DOXYGEN__
4990 
4991 
4992 // Low-level config
4993 // ----------------
4994 // Analog:
4995 # if defined(_ANSC3) || defined(__DOXYGEN__)
4996 /// Enable analog functionality on pin RC3.
4997 # define ENABLE_RC3_ANALOG() (_ANSC3 = 1)
4998 /// Disable analog functionality on pin RC3.
4999 # define DISABLE_RC3_ANALOG() (_ANSC3 = 0)
5000 # elif defined(RC3_AN)
5001 # define ENABLE_RC3_ANALOG() (RXY_GPIO_PCFG(RC3_AN) = 0)
5002 # define DISABLE_RC3_ANALOG() (RXY_GPIO_PCFG(RC3_AN) = 1)
5003 # else
5004 # define DISABLE_RC3_ANALOG() ((void) 0)
5005 # endif
5006 
5007 // Input/output:
5008 /// Configure pin RC3 as an input.
5009 # define CONFIG_RC3_AS_INPUT() (_TRISC3 = 1)
5010 /// Configure pin RC3 as an output.
5011 # define CONFIG_RC3_AS_OUTPUT() (_TRISC3 = 0)
5012 
5013 // Open-drain:
5014 # if defined(_ODCC3) || defined(__DOXYGEN__)
5015 /// Enable the open-drain driver on pin RC3.
5016 # define ENABLE_RC3_OPENDRAIN() (_ODCC3 = 1)
5017 /// Disable the open-drain driver on pin RC3.
5018 # define DISABLE_RC3_OPENDRAIN() (_ODCC3 = 0)
5019 # elif defined(_ODC3) // The PIF24F names this bit _OD instead of _ODC.
5020 # define ENABLE_RC3_OPENDRAIN() (_ODC3 = 1)
5021 # define DISABLE_RC3_OPENDRAIN() (_ODC3 = 0)
5022 # else
5023 # define DISABLE_RC3_OPENDRAIN() ((void) 0)
5024 # endif
5025 
5026 // Change notification, pullups and pulldowns:
5027 # if defined(_CNIEC3) || defined(__DOXYGEN__)
5028 /// Enable the pullup on pin RC3.
5029 # define ENABLE_RC3_PULLUP() (_CNPUC3 = 1)
5030 /// Disable the pullup on pin RC3.
5031 # define DISABLE_RC3_PULLUP() (_CNPUC3 = 0)
5032 
5033 /// Enable the pulldown on pin RC3.
5034 # define ENABLE_RC3_PULLDOWN() (_CNPDC3 = 1)
5035 /// Disable the pulldown on pin RC3.
5036 # define DISABLE_RC3_PULLDOWN() (_CNPDC3 = 0)
5037 
5038 /// Enable the change notification interrupt on pin RC3.
5039 # define ENABLE_RC3_CN_INTERRUPT() (_CNIEC3 = 1)
5040 /// Disable the change notification interrupt on pin RC3.
5041 # define DISABLE_RC3_CN_INTERRUPT() (_CNIEC3 = 0)
5042 
5043 # elif defined(RC3_CN)
5044 # define ENABLE_RC3_PULLUP() (RXY_GPIO_CNPUE(RC3_CN) = 1)
5045 # define DISABLE_RC3_PULLUP() (RXY_GPIO_CNPUE(RC3_CN) = 0)
5046 
5047 # if RXY_HAS_CNPDE(RC3_CN)
5048 # define ENABLE_RC3_PULLDOWN() (RXY_GPIO_CNPDE(RC3_CN) = 1)
5049 # define DISABLE_RC3_PULLDOWN() (RXY_GPIO_CNPDE(RC3_CN) = 0)
5050 # else
5051 # define DISABLE_RC3_PULLDOWN() ((void) 0)
5052 # endif
5053 
5054 # define ENABLE_RC3_CN_INTERRUPT() (RXY_GPIO_CNIE(RC3_CN) = 1)
5055 # define DISABLE_RC3_CN_INTERRUPT() (RXY_GPIO_CNIE(RC3_CN) = 0)
5056 
5057 # else
5058 # define DISABLE_RC3_PULLUP() ((void) 0)
5059 # define DISABLE_RC3_PULLDOWN() ((void) 0)
5060 # define DISABLE_RC3_CN_INTERRUPT() ((void) 0)
5061 # endif
5062 
5063 // High-level config
5064 // -----------------
5065 /** This macro disables pullups/downs, enables analog functionality, and configures
5066  * pin RC3 as an input.
5067  */
5068 # if defined(_ANSC3) || defined(RC3_AN) || defined(__DOXYGEN__)
5069 # define CONFIG_RC3_AS_ANALOG() \
5070  do { \
5071  ENABLE_RC3_ANALOG(); \
5072  CONFIG_RC3_AS_INPUT(); \
5073  DISABLE_RC3_OPENDRAIN(); \
5074  DISABLE_RC3_PULLUP(); \
5075  DISABLE_RC3_PULLDOWN(); \
5076  } while (0)
5077 # endif
5078 
5079 /** This macro disables open-drain and pullups/downs,
5080  * configures pin RC3 for digital (not analog) operation, and
5081  * configures the pin as an input.
5082  */
5083 # define CONFIG_RC3_AS_DIG_INPUT() \
5084  do { \
5085  DISABLE_RC3_ANALOG(); \
5086  CONFIG_RC3_AS_INPUT(); \
5087  DISABLE_RC3_OPENDRAIN(); \
5088  DISABLE_RC3_PULLUP(); \
5089  DISABLE_RC3_PULLDOWN(); \
5090  } while (0)
5091 
5092 /** This macro disables open-drain and pullups/downs,
5093  * configures pin RC3 for digital (not analog) operation, and
5094  * configures the pin as an output.
5095  */
5096 # define CONFIG_RC3_AS_DIG_OUTPUT() \
5097  do { \
5098  DISABLE_RC3_ANALOG(); \
5099  CONFIG_RC3_AS_OUTPUT(); \
5100  DISABLE_RC3_OPENDRAIN(); \
5101  DISABLE_RC3_PULLUP(); \
5102  DISABLE_RC3_PULLDOWN(); \
5103  } while (0)
5104 
5105 #endif // #if defined(_RC3) || defined(__DOXYGEN__): Provide GPIO for RC3
5106 
5107 
5108 
5109 
5110 
5111 // Provide GPIO for RC4
5112 // ====================
5113 #if defined(_RC4) || defined(__DOXYGEN__)
5114 
5115 // Dummy macros for documentation only
5116 # ifdef __DOXYGEN__
5117 /// This macro specifies the RPy value associated with pin RC4.
5118 /// Its device-specific definition is given in pic24_ports_mapping.h.
5119 # define RC4_RP xx
5120 
5121 /// This macro specifies the ANn value associated with pin RC4.
5122 /// Its device-specific definition is given in pic24_ports_mapping.h.
5123 # define RC4_AN xx
5124 
5125 /// This macro specifies the CNm value associated with pin RC4.
5126 /// Its device-specific definition is given in pic24_ports_mapping.h.
5127 # define RC4_CN xx
5128 
5129 //@}
5130 # endif // #ifdef __DOXYGEN__
5131 
5132 
5133 // Low-level config
5134 // ----------------
5135 // Analog:
5136 # if defined(_ANSC4) || defined(__DOXYGEN__)
5137 /// Enable analog functionality on pin RC4.
5138 # define ENABLE_RC4_ANALOG() (_ANSC4 = 1)
5139 /// Disable analog functionality on pin RC4.
5140 # define DISABLE_RC4_ANALOG() (_ANSC4 = 0)
5141 # elif defined(RC4_AN)
5142 # define ENABLE_RC4_ANALOG() (RXY_GPIO_PCFG(RC4_AN) = 0)
5143 # define DISABLE_RC4_ANALOG() (RXY_GPIO_PCFG(RC4_AN) = 1)
5144 # else
5145 # define DISABLE_RC4_ANALOG() ((void) 0)
5146 # endif
5147 
5148 // Input/output:
5149 /// Configure pin RC4 as an input.
5150 # define CONFIG_RC4_AS_INPUT() (_TRISC4 = 1)
5151 /// Configure pin RC4 as an output.
5152 # define CONFIG_RC4_AS_OUTPUT() (_TRISC4 = 0)
5153 
5154 // Open-drain:
5155 # if defined(_ODCC4) || defined(__DOXYGEN__)
5156 /// Enable the open-drain driver on pin RC4.
5157 # define ENABLE_RC4_OPENDRAIN() (_ODCC4 = 1)
5158 /// Disable the open-drain driver on pin RC4.
5159 # define DISABLE_RC4_OPENDRAIN() (_ODCC4 = 0)
5160 # elif defined(_ODC4) // The PIF24F names this bit _OD instead of _ODC.
5161 # define ENABLE_RC4_OPENDRAIN() (_ODC4 = 1)
5162 # define DISABLE_RC4_OPENDRAIN() (_ODC4 = 0)
5163 # else
5164 # define DISABLE_RC4_OPENDRAIN() ((void) 0)
5165 # endif
5166 
5167 // Change notification, pullups and pulldowns:
5168 # if defined(_CNIEC4) || defined(__DOXYGEN__)
5169 /// Enable the pullup on pin RC4.
5170 # define ENABLE_RC4_PULLUP() (_CNPUC4 = 1)
5171 /// Disable the pullup on pin RC4.
5172 # define DISABLE_RC4_PULLUP() (_CNPUC4 = 0)
5173 
5174 /// Enable the pulldown on pin RC4.
5175 # define ENABLE_RC4_PULLDOWN() (_CNPDC4 = 1)
5176 /// Disable the pulldown on pin RC4.
5177 # define DISABLE_RC4_PULLDOWN() (_CNPDC4 = 0)
5178 
5179 /// Enable the change notification interrupt on pin RC4.
5180 # define ENABLE_RC4_CN_INTERRUPT() (_CNIEC4 = 1)
5181 /// Disable the change notification interrupt on pin RC4.
5182 # define DISABLE_RC4_CN_INTERRUPT() (_CNIEC4 = 0)
5183 
5184 # elif defined(RC4_CN)
5185 # define ENABLE_RC4_PULLUP() (RXY_GPIO_CNPUE(RC4_CN) = 1)
5186 # define DISABLE_RC4_PULLUP() (RXY_GPIO_CNPUE(RC4_CN) = 0)
5187 
5188 # if RXY_HAS_CNPDE(RC4_CN)
5189 # define ENABLE_RC4_PULLDOWN() (RXY_GPIO_CNPDE(RC4_CN) = 1)
5190 # define DISABLE_RC4_PULLDOWN() (RXY_GPIO_CNPDE(RC4_CN) = 0)
5191 # else
5192 # define DISABLE_RC4_PULLDOWN() ((void) 0)
5193 # endif
5194 
5195 # define ENABLE_RC4_CN_INTERRUPT() (RXY_GPIO_CNIE(RC4_CN) = 1)
5196 # define DISABLE_RC4_CN_INTERRUPT() (RXY_GPIO_CNIE(RC4_CN) = 0)
5197 
5198 # else
5199 # define DISABLE_RC4_PULLUP() ((void) 0)
5200 # define DISABLE_RC4_PULLDOWN() ((void) 0)
5201 # define DISABLE_RC4_CN_INTERRUPT() ((void) 0)
5202 # endif
5203 
5204 // High-level config
5205 // -----------------
5206 /** This macro disables pullups/downs, enables analog functionality, and configures
5207  * pin RC4 as an input.
5208  */
5209 # if defined(_ANSC4) || defined(RC4_AN) || defined(__DOXYGEN__)
5210 # define CONFIG_RC4_AS_ANALOG() \
5211  do { \
5212  ENABLE_RC4_ANALOG(); \
5213  CONFIG_RC4_AS_INPUT(); \
5214  DISABLE_RC4_OPENDRAIN(); \
5215  DISABLE_RC4_PULLUP(); \
5216  DISABLE_RC4_PULLDOWN(); \
5217  } while (0)
5218 # endif
5219 
5220 /** This macro disables open-drain and pullups/downs,
5221  * configures pin RC4 for digital (not analog) operation, and
5222  * configures the pin as an input.
5223  */
5224 # define CONFIG_RC4_AS_DIG_INPUT() \
5225  do { \
5226  DISABLE_RC4_ANALOG(); \
5227  CONFIG_RC4_AS_INPUT(); \
5228  DISABLE_RC4_OPENDRAIN(); \
5229  DISABLE_RC4_PULLUP(); \
5230  DISABLE_RC4_PULLDOWN(); \
5231  } while (0)
5232 
5233 /** This macro disables open-drain and pullups/downs,
5234  * configures pin RC4 for digital (not analog) operation, and
5235  * configures the pin as an output.
5236  */
5237 # define CONFIG_RC4_AS_DIG_OUTPUT() \
5238  do { \
5239  DISABLE_RC4_ANALOG(); \
5240  CONFIG_RC4_AS_OUTPUT(); \
5241  DISABLE_RC4_OPENDRAIN(); \
5242  DISABLE_RC4_PULLUP(); \
5243  DISABLE_RC4_PULLDOWN(); \
5244  } while (0)
5245 
5246 #endif // #if defined(_RC4) || defined(__DOXYGEN__): Provide GPIO for RC4
5247 
5248 
5249 
5250 
5251 
5252 // Provide GPIO for RC5
5253 // ====================
5254 #if defined(_RC5) || defined(__DOXYGEN__)
5255 
5256 // Dummy macros for documentation only
5257 # ifdef __DOXYGEN__
5258 /// This macro specifies the RPy value associated with pin RC5.
5259 /// Its device-specific definition is given in pic24_ports_mapping.h.
5260 # define RC5_RP xx
5261 
5262 /// This macro specifies the ANn value associated with pin RC5.
5263 /// Its device-specific definition is given in pic24_ports_mapping.h.
5264 # define RC5_AN xx
5265 
5266 /// This macro specifies the CNm value associated with pin RC5.
5267 /// Its device-specific definition is given in pic24_ports_mapping.h.
5268 # define RC5_CN xx
5269 
5270 //@}
5271 # endif // #ifdef __DOXYGEN__
5272 
5273 
5274 // Low-level config
5275 // ----------------
5276 // Analog:
5277 # if defined(_ANSC5) || defined(__DOXYGEN__)
5278 /// Enable analog functionality on pin RC5.
5279 # define ENABLE_RC5_ANALOG() (_ANSC5 = 1)
5280 /// Disable analog functionality on pin RC5.
5281 # define DISABLE_RC5_ANALOG() (_ANSC5 = 0)
5282 # elif defined(RC5_AN)
5283 # define ENABLE_RC5_ANALOG() (RXY_GPIO_PCFG(RC5_AN) = 0)
5284 # define DISABLE_RC5_ANALOG() (RXY_GPIO_PCFG(RC5_AN) = 1)
5285 # else
5286 # define DISABLE_RC5_ANALOG() ((void) 0)
5287 # endif
5288 
5289 // Input/output:
5290 /// Configure pin RC5 as an input.
5291 # define CONFIG_RC5_AS_INPUT() (_TRISC5 = 1)
5292 /// Configure pin RC5 as an output.
5293 # define CONFIG_RC5_AS_OUTPUT() (_TRISC5 = 0)
5294 
5295 // Open-drain:
5296 # if defined(_ODCC5) || defined(__DOXYGEN__)
5297 /// Enable the open-drain driver on pin RC5.
5298 # define ENABLE_RC5_OPENDRAIN() (_ODCC5 = 1)
5299 /// Disable the open-drain driver on pin RC5.
5300 # define DISABLE_RC5_OPENDRAIN() (_ODCC5 = 0)
5301 # elif defined(_ODC5) // The PIF24F names this bit _OD instead of _ODC.
5302 # define ENABLE_RC5_OPENDRAIN() (_ODC5 = 1)
5303 # define DISABLE_RC5_OPENDRAIN() (_ODC5 = 0)
5304 # else
5305 # define DISABLE_RC5_OPENDRAIN() ((void) 0)
5306 # endif
5307 
5308 // Change notification, pullups and pulldowns:
5309 # if defined(_CNIEC5) || defined(__DOXYGEN__)
5310 /// Enable the pullup on pin RC5.
5311 # define ENABLE_RC5_PULLUP() (_CNPUC5 = 1)
5312 /// Disable the pullup on pin RC5.
5313 # define DISABLE_RC5_PULLUP() (_CNPUC5 = 0)
5314 
5315 /// Enable the pulldown on pin RC5.
5316 # define ENABLE_RC5_PULLDOWN() (_CNPDC5 = 1)
5317 /// Disable the pulldown on pin RC5.
5318 # define DISABLE_RC5_PULLDOWN() (_CNPDC5 = 0)
5319 
5320 /// Enable the change notification interrupt on pin RC5.
5321 # define ENABLE_RC5_CN_INTERRUPT() (_CNIEC5 = 1)
5322 /// Disable the change notification interrupt on pin RC5.
5323 # define DISABLE_RC5_CN_INTERRUPT() (_CNIEC5 = 0)
5324 
5325 # elif defined(RC5_CN)
5326 # define ENABLE_RC5_PULLUP() (RXY_GPIO_CNPUE(RC5_CN) = 1)
5327 # define DISABLE_RC5_PULLUP() (RXY_GPIO_CNPUE(RC5_CN) = 0)
5328 
5329 # if RXY_HAS_CNPDE(RC5_CN)
5330 # define ENABLE_RC5_PULLDOWN() (RXY_GPIO_CNPDE(RC5_CN) = 1)
5331 # define DISABLE_RC5_PULLDOWN() (RXY_GPIO_CNPDE(RC5_CN) = 0)
5332 # else
5333 # define DISABLE_RC5_PULLDOWN() ((void) 0)
5334 # endif
5335 
5336 # define ENABLE_RC5_CN_INTERRUPT() (RXY_GPIO_CNIE(RC5_CN) = 1)
5337 # define DISABLE_RC5_CN_INTERRUPT() (RXY_GPIO_CNIE(RC5_CN) = 0)
5338 
5339 # else
5340 # define DISABLE_RC5_PULLUP() ((void) 0)
5341 # define DISABLE_RC5_PULLDOWN() ((void) 0)
5342 # define DISABLE_RC5_CN_INTERRUPT() ((void) 0)
5343 # endif
5344 
5345 // High-level config
5346 // -----------------
5347 /** This macro disables pullups/downs, enables analog functionality, and configures
5348  * pin RC5 as an input.
5349  */
5350 # if defined(_ANSC5) || defined(RC5_AN) || defined(__DOXYGEN__)
5351 # define CONFIG_RC5_AS_ANALOG() \
5352  do { \
5353  ENABLE_RC5_ANALOG(); \
5354  CONFIG_RC5_AS_INPUT(); \
5355  DISABLE_RC5_OPENDRAIN(); \
5356  DISABLE_RC5_PULLUP(); \
5357  DISABLE_RC5_PULLDOWN(); \
5358  } while (0)
5359 # endif
5360 
5361 /** This macro disables open-drain and pullups/downs,
5362  * configures pin RC5 for digital (not analog) operation, and
5363  * configures the pin as an input.
5364  */
5365 # define CONFIG_RC5_AS_DIG_INPUT() \
5366  do { \
5367  DISABLE_RC5_ANALOG(); \
5368  CONFIG_RC5_AS_INPUT(); \
5369  DISABLE_RC5_OPENDRAIN(); \
5370  DISABLE_RC5_PULLUP(); \
5371  DISABLE_RC5_PULLDOWN(); \
5372  } while (0)
5373 
5374 /** This macro disables open-drain and pullups/downs,
5375  * configures pin RC5 for digital (not analog) operation, and
5376  * configures the pin as an output.
5377  */
5378 # define CONFIG_RC5_AS_DIG_OUTPUT() \
5379  do { \
5380  DISABLE_RC5_ANALOG(); \
5381  CONFIG_RC5_AS_OUTPUT(); \
5382  DISABLE_RC5_OPENDRAIN(); \
5383  DISABLE_RC5_PULLUP(); \
5384  DISABLE_RC5_PULLDOWN(); \
5385  } while (0)
5386 
5387 #endif // #if defined(_RC5) || defined(__DOXYGEN__): Provide GPIO for RC5
5388 
5389 
5390 
5391 
5392 
5393 // Provide GPIO for RC6
5394 // ====================
5395 #if defined(_RC6) || defined(__DOXYGEN__)
5396 
5397 // Dummy macros for documentation only
5398 # ifdef __DOXYGEN__
5399 /// This macro specifies the RPy value associated with pin RC6.
5400 /// Its device-specific definition is given in pic24_ports_mapping.h.
5401 # define RC6_RP xx
5402 
5403 /// This macro specifies the ANn value associated with pin RC6.
5404 /// Its device-specific definition is given in pic24_ports_mapping.h.
5405 # define RC6_AN xx
5406 
5407 /// This macro specifies the CNm value associated with pin RC6.
5408 /// Its device-specific definition is given in pic24_ports_mapping.h.
5409 # define RC6_CN xx
5410 
5411 //@}
5412 # endif // #ifdef __DOXYGEN__
5413 
5414 
5415 // Low-level config
5416 // ----------------
5417 // Analog:
5418 # if defined(_ANSC6) || defined(__DOXYGEN__)
5419 /// Enable analog functionality on pin RC6.
5420 # define ENABLE_RC6_ANALOG() (_ANSC6 = 1)
5421 /// Disable analog functionality on pin RC6.
5422 # define DISABLE_RC6_ANALOG() (_ANSC6 = 0)
5423 # elif defined(RC6_AN)
5424 # define ENABLE_RC6_ANALOG() (RXY_GPIO_PCFG(RC6_AN) = 0)
5425 # define DISABLE_RC6_ANALOG() (RXY_GPIO_PCFG(RC6_AN) = 1)
5426 # else
5427 # define DISABLE_RC6_ANALOG() ((void) 0)
5428 # endif
5429 
5430 // Input/output:
5431 /// Configure pin RC6 as an input.
5432 # define CONFIG_RC6_AS_INPUT() (_TRISC6 = 1)
5433 /// Configure pin RC6 as an output.
5434 # define CONFIG_RC6_AS_OUTPUT() (_TRISC6 = 0)
5435 
5436 // Open-drain:
5437 # if defined(_ODCC6) || defined(__DOXYGEN__)
5438 /// Enable the open-drain driver on pin RC6.
5439 # define ENABLE_RC6_OPENDRAIN() (_ODCC6 = 1)
5440 /// Disable the open-drain driver on pin RC6.
5441 # define DISABLE_RC6_OPENDRAIN() (_ODCC6 = 0)
5442 # elif defined(_ODC6) // The PIF24F names this bit _OD instead of _ODC.
5443 # define ENABLE_RC6_OPENDRAIN() (_ODC6 = 1)
5444 # define DISABLE_RC6_OPENDRAIN() (_ODC6 = 0)
5445 # else
5446 # define DISABLE_RC6_OPENDRAIN() ((void) 0)
5447 # endif
5448 
5449 // Change notification, pullups and pulldowns:
5450 # if defined(_CNIEC6) || defined(__DOXYGEN__)
5451 /// Enable the pullup on pin RC6.
5452 # define ENABLE_RC6_PULLUP() (_CNPUC6 = 1)
5453 /// Disable the pullup on pin RC6.
5454 # define DISABLE_RC6_PULLUP() (_CNPUC6 = 0)
5455 
5456 /// Enable the pulldown on pin RC6.
5457 # define ENABLE_RC6_PULLDOWN() (_CNPDC6 = 1)
5458 /// Disable the pulldown on pin RC6.
5459 # define DISABLE_RC6_PULLDOWN() (_CNPDC6 = 0)
5460 
5461 /// Enable the change notification interrupt on pin RC6.
5462 # define ENABLE_RC6_CN_INTERRUPT() (_CNIEC6 = 1)
5463 /// Disable the change notification interrupt on pin RC6.
5464 # define DISABLE_RC6_CN_INTERRUPT() (_CNIEC6 = 0)
5465 
5466 # elif defined(RC6_CN)
5467 # define ENABLE_RC6_PULLUP() (RXY_GPIO_CNPUE(RC6_CN) = 1)
5468 # define DISABLE_RC6_PULLUP() (RXY_GPIO_CNPUE(RC6_CN) = 0)
5469 
5470 # if RXY_HAS_CNPDE(RC6_CN)
5471 # define ENABLE_RC6_PULLDOWN() (RXY_GPIO_CNPDE(RC6_CN) = 1)
5472 # define DISABLE_RC6_PULLDOWN() (RXY_GPIO_CNPDE(RC6_CN) = 0)
5473 # else
5474 # define DISABLE_RC6_PULLDOWN() ((void) 0)
5475 # endif
5476 
5477 # define ENABLE_RC6_CN_INTERRUPT() (RXY_GPIO_CNIE(RC6_CN) = 1)
5478 # define DISABLE_RC6_CN_INTERRUPT() (RXY_GPIO_CNIE(RC6_CN) = 0)
5479 
5480 # else
5481 # define DISABLE_RC6_PULLUP() ((void) 0)
5482 # define DISABLE_RC6_PULLDOWN() ((void) 0)
5483 # define DISABLE_RC6_CN_INTERRUPT() ((void) 0)
5484 # endif
5485 
5486 // High-level config
5487 // -----------------
5488 /** This macro disables pullups/downs, enables analog functionality, and configures
5489  * pin RC6 as an input.
5490  */
5491 # if defined(_ANSC6) || defined(RC6_AN) || defined(__DOXYGEN__)
5492 # define CONFIG_RC6_AS_ANALOG() \
5493  do { \
5494  ENABLE_RC6_ANALOG(); \
5495  CONFIG_RC6_AS_INPUT(); \
5496  DISABLE_RC6_OPENDRAIN(); \
5497  DISABLE_RC6_PULLUP(); \
5498  DISABLE_RC6_PULLDOWN(); \
5499  } while (0)
5500 # endif
5501 
5502 /** This macro disables open-drain and pullups/downs,
5503  * configures pin RC6 for digital (not analog) operation, and
5504  * configures the pin as an input.
5505  */
5506 # define CONFIG_RC6_AS_DIG_INPUT() \
5507  do { \
5508  DISABLE_RC6_ANALOG(); \
5509  CONFIG_RC6_AS_INPUT(); \
5510  DISABLE_RC6_OPENDRAIN(); \
5511  DISABLE_RC6_PULLUP(); \
5512  DISABLE_RC6_PULLDOWN(); \
5513  } while (0)
5514 
5515 /** This macro disables open-drain and pullups/downs,
5516  * configures pin RC6 for digital (not analog) operation, and
5517  * configures the pin as an output.
5518  */
5519 # define CONFIG_RC6_AS_DIG_OUTPUT() \
5520  do { \
5521  DISABLE_RC6_ANALOG(); \
5522  CONFIG_RC6_AS_OUTPUT(); \
5523  DISABLE_RC6_OPENDRAIN(); \
5524  DISABLE_RC6_PULLUP(); \
5525  DISABLE_RC6_PULLDOWN(); \
5526  } while (0)
5527 
5528 #endif // #if defined(_RC6) || defined(__DOXYGEN__): Provide GPIO for RC6
5529 
5530 
5531 
5532 
5533 
5534 // Provide GPIO for RC7
5535 // ====================
5536 #if defined(_RC7) || defined(__DOXYGEN__)
5537 
5538 // Dummy macros for documentation only
5539 # ifdef __DOXYGEN__
5540 /// This macro specifies the RPy value associated with pin RC7.
5541 /// Its device-specific definition is given in pic24_ports_mapping.h.
5542 # define RC7_RP xx
5543 
5544 /// This macro specifies the ANn value associated with pin RC7.
5545 /// Its device-specific definition is given in pic24_ports_mapping.h.
5546 # define RC7_AN xx
5547 
5548 /// This macro specifies the CNm value associated with pin RC7.
5549 /// Its device-specific definition is given in pic24_ports_mapping.h.
5550 # define RC7_CN xx
5551 
5552 //@}
5553 # endif // #ifdef __DOXYGEN__
5554 
5555 
5556 // Low-level config
5557 // ----------------
5558 // Analog:
5559 # if defined(_ANSC7) || defined(__DOXYGEN__)
5560 /// Enable analog functionality on pin RC7.
5561 # define ENABLE_RC7_ANALOG() (_ANSC7 = 1)
5562 /// Disable analog functionality on pin RC7.
5563 # define DISABLE_RC7_ANALOG() (_ANSC7 = 0)
5564 # elif defined(RC7_AN)
5565 # define ENABLE_RC7_ANALOG() (RXY_GPIO_PCFG(RC7_AN) = 0)
5566 # define DISABLE_RC7_ANALOG() (RXY_GPIO_PCFG(RC7_AN) = 1)
5567 # else
5568 # define DISABLE_RC7_ANALOG() ((void) 0)
5569 # endif
5570 
5571 // Input/output:
5572 /// Configure pin RC7 as an input.
5573 # define CONFIG_RC7_AS_INPUT() (_TRISC7 = 1)
5574 /// Configure pin RC7 as an output.
5575 # define CONFIG_RC7_AS_OUTPUT() (_TRISC7 = 0)
5576 
5577 // Open-drain:
5578 # if defined(_ODCC7) || defined(__DOXYGEN__)
5579 /// Enable the open-drain driver on pin RC7.
5580 # define ENABLE_RC7_OPENDRAIN() (_ODCC7 = 1)
5581 /// Disable the open-drain driver on pin RC7.
5582 # define DISABLE_RC7_OPENDRAIN() (_ODCC7 = 0)
5583 # elif defined(_ODC7) // The PIF24F names this bit _OD instead of _ODC.
5584 # define ENABLE_RC7_OPENDRAIN() (_ODC7 = 1)
5585 # define DISABLE_RC7_OPENDRAIN() (_ODC7 = 0)
5586 # else
5587 # define DISABLE_RC7_OPENDRAIN() ((void) 0)
5588 # endif
5589 
5590 // Change notification, pullups and pulldowns:
5591 # if defined(_CNIEC7) || defined(__DOXYGEN__)
5592 /// Enable the pullup on pin RC7.
5593 # define ENABLE_RC7_PULLUP() (_CNPUC7 = 1)
5594 /// Disable the pullup on pin RC7.
5595 # define DISABLE_RC7_PULLUP() (_CNPUC7 = 0)
5596 
5597 /// Enable the pulldown on pin RC7.
5598 # define ENABLE_RC7_PULLDOWN() (_CNPDC7 = 1)
5599 /// Disable the pulldown on pin RC7.
5600 # define DISABLE_RC7_PULLDOWN() (_CNPDC7 = 0)
5601 
5602 /// Enable the change notification interrupt on pin RC7.
5603 # define ENABLE_RC7_CN_INTERRUPT() (_CNIEC7 = 1)
5604 /// Disable the change notification interrupt on pin RC7.
5605 # define DISABLE_RC7_CN_INTERRUPT() (_CNIEC7 = 0)
5606 
5607 # elif defined(RC7_CN)
5608 # define ENABLE_RC7_PULLUP() (RXY_GPIO_CNPUE(RC7_CN) = 1)
5609 # define DISABLE_RC7_PULLUP() (RXY_GPIO_CNPUE(RC7_CN) = 0)
5610 
5611 # if RXY_HAS_CNPDE(RC7_CN)
5612 # define ENABLE_RC7_PULLDOWN() (RXY_GPIO_CNPDE(RC7_CN) = 1)
5613 # define DISABLE_RC7_PULLDOWN() (RXY_GPIO_CNPDE(RC7_CN) = 0)
5614 # else
5615 # define DISABLE_RC7_PULLDOWN() ((void) 0)
5616 # endif
5617 
5618 # define ENABLE_RC7_CN_INTERRUPT() (RXY_GPIO_CNIE(RC7_CN) = 1)
5619 # define DISABLE_RC7_CN_INTERRUPT() (RXY_GPIO_CNIE(RC7_CN) = 0)
5620 
5621 # else
5622 # define DISABLE_RC7_PULLUP() ((void) 0)
5623 # define DISABLE_RC7_PULLDOWN() ((void) 0)
5624 # define DISABLE_RC7_CN_INTERRUPT() ((void) 0)
5625 # endif
5626 
5627 // High-level config
5628 // -----------------
5629 /** This macro disables pullups/downs, enables analog functionality, and configures
5630  * pin RC7 as an input.
5631  */
5632 # if defined(_ANSC7) || defined(RC7_AN) || defined(__DOXYGEN__)
5633 # define CONFIG_RC7_AS_ANALOG() \
5634  do { \
5635  ENABLE_RC7_ANALOG(); \
5636  CONFIG_RC7_AS_INPUT(); \
5637  DISABLE_RC7_OPENDRAIN(); \
5638  DISABLE_RC7_PULLUP(); \
5639  DISABLE_RC7_PULLDOWN(); \
5640  } while (0)
5641 # endif
5642 
5643 /** This macro disables open-drain and pullups/downs,
5644  * configures pin RC7 for digital (not analog) operation, and
5645  * configures the pin as an input.
5646  */
5647 # define CONFIG_RC7_AS_DIG_INPUT() \
5648  do { \
5649  DISABLE_RC7_ANALOG(); \
5650  CONFIG_RC7_AS_INPUT(); \
5651  DISABLE_RC7_OPENDRAIN(); \
5652  DISABLE_RC7_PULLUP(); \
5653  DISABLE_RC7_PULLDOWN(); \
5654  } while (0)
5655 
5656 /** This macro disables open-drain and pullups/downs,
5657  * configures pin RC7 for digital (not analog) operation, and
5658  * configures the pin as an output.
5659  */
5660 # define CONFIG_RC7_AS_DIG_OUTPUT() \
5661  do { \
5662  DISABLE_RC7_ANALOG(); \
5663  CONFIG_RC7_AS_OUTPUT(); \
5664  DISABLE_RC7_OPENDRAIN(); \
5665  DISABLE_RC7_PULLUP(); \
5666  DISABLE_RC7_PULLDOWN(); \
5667  } while (0)
5668 
5669 #endif // #if defined(_RC7) || defined(__DOXYGEN__): Provide GPIO for RC7
5670 
5671 
5672 
5673 
5674 
5675 // Provide GPIO for RC8
5676 // ====================
5677 #if defined(_RC8) || defined(__DOXYGEN__)
5678 
5679 // Dummy macros for documentation only
5680 # ifdef __DOXYGEN__
5681 /// This macro specifies the RPy value associated with pin RC8.
5682 /// Its device-specific definition is given in pic24_ports_mapping.h.
5683 # define RC8_RP xx
5684 
5685 /// This macro specifies the ANn value associated with pin RC8.
5686 /// Its device-specific definition is given in pic24_ports_mapping.h.
5687 # define RC8_AN xx
5688 
5689 /// This macro specifies the CNm value associated with pin RC8.
5690 /// Its device-specific definition is given in pic24_ports_mapping.h.
5691 # define RC8_CN xx
5692 
5693 //@}
5694 # endif // #ifdef __DOXYGEN__
5695 
5696 
5697 // Low-level config
5698 // ----------------
5699 // Analog:
5700 # if defined(_ANSC8) || defined(__DOXYGEN__)
5701 /// Enable analog functionality on pin RC8.
5702 # define ENABLE_RC8_ANALOG() (_ANSC8 = 1)
5703 /// Disable analog functionality on pin RC8.
5704 # define DISABLE_RC8_ANALOG() (_ANSC8 = 0)
5705 # elif defined(RC8_AN)
5706 # define ENABLE_RC8_ANALOG() (RXY_GPIO_PCFG(RC8_AN) = 0)
5707 # define DISABLE_RC8_ANALOG() (RXY_GPIO_PCFG(RC8_AN) = 1)
5708 # else
5709 # define DISABLE_RC8_ANALOG() ((void) 0)
5710 # endif
5711 
5712 // Input/output:
5713 /// Configure pin RC8 as an input.
5714 # define CONFIG_RC8_AS_INPUT() (_TRISC8 = 1)
5715 /// Configure pin RC8 as an output.
5716 # define CONFIG_RC8_AS_OUTPUT() (_TRISC8 = 0)
5717 
5718 // Open-drain:
5719 # if defined(_ODCC8) || defined(__DOXYGEN__)
5720 /// Enable the open-drain driver on pin RC8.
5721 # define ENABLE_RC8_OPENDRAIN() (_ODCC8 = 1)
5722 /// Disable the open-drain driver on pin RC8.
5723 # define DISABLE_RC8_OPENDRAIN() (_ODCC8 = 0)
5724 # elif defined(_ODC8) // The PIF24F names this bit _OD instead of _ODC.
5725 # define ENABLE_RC8_OPENDRAIN() (_ODC8 = 1)
5726 # define DISABLE_RC8_OPENDRAIN() (_ODC8 = 0)
5727 # else
5728 # define DISABLE_RC8_OPENDRAIN() ((void) 0)
5729 # endif
5730 
5731 // Change notification, pullups and pulldowns:
5732 # if defined(_CNIEC8) || defined(__DOXYGEN__)
5733 /// Enable the pullup on pin RC8.
5734 # define ENABLE_RC8_PULLUP() (_CNPUC8 = 1)
5735 /// Disable the pullup on pin RC8.
5736 # define DISABLE_RC8_PULLUP() (_CNPUC8 = 0)
5737 
5738 /// Enable the pulldown on pin RC8.
5739 # define ENABLE_RC8_PULLDOWN() (_CNPDC8 = 1)
5740 /// Disable the pulldown on pin RC8.
5741 # define DISABLE_RC8_PULLDOWN() (_CNPDC8 = 0)
5742 
5743 /// Enable the change notification interrupt on pin RC8.
5744 # define ENABLE_RC8_CN_INTERRUPT() (_CNIEC8 = 1)
5745 /// Disable the change notification interrupt on pin RC8.
5746 # define DISABLE_RC8_CN_INTERRUPT() (_CNIEC8 = 0)
5747 
5748 # elif defined(RC8_CN)
5749 # define ENABLE_RC8_PULLUP() (RXY_GPIO_CNPUE(RC8_CN) = 1)
5750 # define DISABLE_RC8_PULLUP() (RXY_GPIO_CNPUE(RC8_CN) = 0)
5751 
5752 # if RXY_HAS_CNPDE(RC8_CN)
5753 # define ENABLE_RC8_PULLDOWN() (RXY_GPIO_CNPDE(RC8_CN) = 1)
5754 # define DISABLE_RC8_PULLDOWN() (RXY_GPIO_CNPDE(RC8_CN) = 0)
5755 # else
5756 # define DISABLE_RC8_PULLDOWN() ((void) 0)
5757 # endif
5758 
5759 # define ENABLE_RC8_CN_INTERRUPT() (RXY_GPIO_CNIE(RC8_CN) = 1)
5760 # define DISABLE_RC8_CN_INTERRUPT() (RXY_GPIO_CNIE(RC8_CN) = 0)
5761 
5762 # else
5763 # define DISABLE_RC8_PULLUP() ((void) 0)
5764 # define DISABLE_RC8_PULLDOWN() ((void) 0)
5765 # define DISABLE_RC8_CN_INTERRUPT() ((void) 0)
5766 # endif
5767 
5768 // High-level config
5769 // -----------------
5770 /** This macro disables pullups/downs, enables analog functionality, and configures
5771  * pin RC8 as an input.
5772  */
5773 # if defined(_ANSC8) || defined(RC8_AN) || defined(__DOXYGEN__)
5774 # define CONFIG_RC8_AS_ANALOG() \
5775  do { \
5776  ENABLE_RC8_ANALOG(); \
5777  CONFIG_RC8_AS_INPUT(); \
5778  DISABLE_RC8_OPENDRAIN(); \
5779  DISABLE_RC8_PULLUP(); \
5780  DISABLE_RC8_PULLDOWN(); \
5781  } while (0)
5782 # endif
5783 
5784 /** This macro disables open-drain and pullups/downs,
5785  * configures pin RC8 for digital (not analog) operation, and
5786  * configures the pin as an input.
5787  */
5788 # define CONFIG_RC8_AS_DIG_INPUT() \
5789  do { \
5790  DISABLE_RC8_ANALOG(); \
5791  CONFIG_RC8_AS_INPUT(); \
5792  DISABLE_RC8_OPENDRAIN(); \
5793  DISABLE_RC8_PULLUP(); \
5794  DISABLE_RC8_PULLDOWN(); \
5795  } while (0)
5796 
5797 /** This macro disables open-drain and pullups/downs,
5798  * configures pin RC8 for digital (not analog) operation, and
5799  * configures the pin as an output.
5800  */
5801 # define CONFIG_RC8_AS_DIG_OUTPUT() \
5802  do { \
5803  DISABLE_RC8_ANALOG(); \
5804  CONFIG_RC8_AS_OUTPUT(); \
5805  DISABLE_RC8_OPENDRAIN(); \
5806  DISABLE_RC8_PULLUP(); \
5807  DISABLE_RC8_PULLDOWN(); \
5808  } while (0)
5809 
5810 #endif // #if defined(_RC8) || defined(__DOXYGEN__): Provide GPIO for RC8
5811 
5812 
5813 
5814 
5815 
5816 // Provide GPIO for RC9
5817 // ====================
5818 #if defined(_RC9) || defined(__DOXYGEN__)
5819 
5820 // Dummy macros for documentation only
5821 # ifdef __DOXYGEN__
5822 /// This macro specifies the RPy value associated with pin RC9.
5823 /// Its device-specific definition is given in pic24_ports_mapping.h.
5824 # define RC9_RP xx
5825 
5826 /// This macro specifies the ANn value associated with pin RC9.
5827 /// Its device-specific definition is given in pic24_ports_mapping.h.
5828 # define RC9_AN xx
5829 
5830 /// This macro specifies the CNm value associated with pin RC9.
5831 /// Its device-specific definition is given in pic24_ports_mapping.h.
5832 # define RC9_CN xx
5833 
5834 //@}
5835 # endif // #ifdef __DOXYGEN__
5836 
5837 
5838 // Low-level config
5839 // ----------------
5840 // Analog:
5841 # if defined(_ANSC9) || defined(__DOXYGEN__)
5842 /// Enable analog functionality on pin RC9.
5843 # define ENABLE_RC9_ANALOG() (_ANSC9 = 1)
5844 /// Disable analog functionality on pin RC9.
5845 # define DISABLE_RC9_ANALOG() (_ANSC9 = 0)
5846 # elif defined(RC9_AN)
5847 # define ENABLE_RC9_ANALOG() (RXY_GPIO_PCFG(RC9_AN) = 0)
5848 # define DISABLE_RC9_ANALOG() (RXY_GPIO_PCFG(RC9_AN) = 1)
5849 # else
5850 # define DISABLE_RC9_ANALOG() ((void) 0)
5851 # endif
5852 
5853 // Input/output:
5854 /// Configure pin RC9 as an input.
5855 # define CONFIG_RC9_AS_INPUT() (_TRISC9 = 1)
5856 /// Configure pin RC9 as an output.
5857 # define CONFIG_RC9_AS_OUTPUT() (_TRISC9 = 0)
5858 
5859 // Open-drain:
5860 # if defined(_ODCC9) || defined(__DOXYGEN__)
5861 /// Enable the open-drain driver on pin RC9.
5862 # define ENABLE_RC9_OPENDRAIN() (_ODCC9 = 1)
5863 /// Disable the open-drain driver on pin RC9.
5864 # define DISABLE_RC9_OPENDRAIN() (_ODCC9 = 0)
5865 # elif defined(_ODC9) // The PIF24F names this bit _OD instead of _ODC.
5866 # define ENABLE_RC9_OPENDRAIN() (_ODC9 = 1)
5867 # define DISABLE_RC9_OPENDRAIN() (_ODC9 = 0)
5868 # else
5869 # define DISABLE_RC9_OPENDRAIN() ((void) 0)
5870 # endif
5871 
5872 // Change notification, pullups and pulldowns:
5873 # if defined(_CNIEC9) || defined(__DOXYGEN__)
5874 /// Enable the pullup on pin RC9.
5875 # define ENABLE_RC9_PULLUP() (_CNPUC9 = 1)
5876 /// Disable the pullup on pin RC9.
5877 # define DISABLE_RC9_PULLUP() (_CNPUC9 = 0)
5878 
5879 /// Enable the pulldown on pin RC9.
5880 # define ENABLE_RC9_PULLDOWN() (_CNPDC9 = 1)
5881 /// Disable the pulldown on pin RC9.
5882 # define DISABLE_RC9_PULLDOWN() (_CNPDC9 = 0)
5883 
5884 /// Enable the change notification interrupt on pin RC9.
5885 # define ENABLE_RC9_CN_INTERRUPT() (_CNIEC9 = 1)
5886 /// Disable the change notification interrupt on pin RC9.
5887 # define DISABLE_RC9_CN_INTERRUPT() (_CNIEC9 = 0)
5888 
5889 # elif defined(RC9_CN)
5890 # define ENABLE_RC9_PULLUP() (RXY_GPIO_CNPUE(RC9_CN) = 1)
5891 # define DISABLE_RC9_PULLUP() (RXY_GPIO_CNPUE(RC9_CN) = 0)
5892 
5893 # if RXY_HAS_CNPDE(RC9_CN)
5894 # define ENABLE_RC9_PULLDOWN() (RXY_GPIO_CNPDE(RC9_CN) = 1)
5895 # define DISABLE_RC9_PULLDOWN() (RXY_GPIO_CNPDE(RC9_CN) = 0)
5896 # else
5897 # define DISABLE_RC9_PULLDOWN() ((void) 0)
5898 # endif
5899 
5900 # define ENABLE_RC9_CN_INTERRUPT() (RXY_GPIO_CNIE(RC9_CN) = 1)
5901 # define DISABLE_RC9_CN_INTERRUPT() (RXY_GPIO_CNIE(RC9_CN) = 0)
5902 
5903 # else
5904 # define DISABLE_RC9_PULLUP() ((void) 0)
5905 # define DISABLE_RC9_PULLDOWN() ((void) 0)
5906 # define DISABLE_RC9_CN_INTERRUPT() ((void) 0)
5907 # endif
5908 
5909 // High-level config
5910 // -----------------
5911 /** This macro disables pullups/downs, enables analog functionality, and configures
5912  * pin RC9 as an input.
5913  */
5914 # if defined(_ANSC9) || defined(RC9_AN) || defined(__DOXYGEN__)
5915 # define CONFIG_RC9_AS_ANALOG() \
5916  do { \
5917  ENABLE_RC9_ANALOG(); \
5918  CONFIG_RC9_AS_INPUT(); \
5919  DISABLE_RC9_OPENDRAIN(); \
5920  DISABLE_RC9_PULLUP(); \
5921  DISABLE_RC9_PULLDOWN(); \
5922  } while (0)
5923 # endif
5924 
5925 /** This macro disables open-drain and pullups/downs,
5926  * configures pin RC9 for digital (not analog) operation, and
5927  * configures the pin as an input.
5928  */
5929 # define CONFIG_RC9_AS_DIG_INPUT() \
5930  do { \
5931  DISABLE_RC9_ANALOG(); \
5932  CONFIG_RC9_AS_INPUT(); \
5933  DISABLE_RC9_OPENDRAIN(); \
5934  DISABLE_RC9_PULLUP(); \
5935  DISABLE_RC9_PULLDOWN(); \
5936  } while (0)
5937 
5938 /** This macro disables open-drain and pullups/downs,
5939  * configures pin RC9 for digital (not analog) operation, and
5940  * configures the pin as an output.
5941  */
5942 # define CONFIG_RC9_AS_DIG_OUTPUT() \
5943  do { \
5944  DISABLE_RC9_ANALOG(); \
5945  CONFIG_RC9_AS_OUTPUT(); \
5946  DISABLE_RC9_OPENDRAIN(); \
5947  DISABLE_RC9_PULLUP(); \
5948  DISABLE_RC9_PULLDOWN(); \
5949  } while (0)
5950 
5951 #endif // #if defined(_RC9) || defined(__DOXYGEN__): Provide GPIO for RC9
5952 
5953 
5954 
5955 
5956 
5957 // Provide GPIO for RC10
5958 // ====================
5959 #if defined(_RC10) || defined(__DOXYGEN__)
5960 
5961 // Dummy macros for documentation only
5962 # ifdef __DOXYGEN__
5963 /// This macro specifies the RPy value associated with pin RC10.
5964 /// Its device-specific definition is given in pic24_ports_mapping.h.
5965 # define RC10_RP xx
5966 
5967 /// This macro specifies the ANn value associated with pin RC10.
5968 /// Its device-specific definition is given in pic24_ports_mapping.h.
5969 # define RC10_AN xx
5970 
5971 /// This macro specifies the CNm value associated with pin RC10.
5972 /// Its device-specific definition is given in pic24_ports_mapping.h.
5973 # define RC10_CN xx
5974 
5975 //@}
5976 # endif // #ifdef __DOXYGEN__
5977 
5978 
5979 // Low-level config
5980 // ----------------
5981 // Analog:
5982 # if defined(_ANSC10) || defined(__DOXYGEN__)
5983 /// Enable analog functionality on pin RC10.
5984 # define ENABLE_RC10_ANALOG() (_ANSC10 = 1)
5985 /// Disable analog functionality on pin RC10.
5986 # define DISABLE_RC10_ANALOG() (_ANSC10 = 0)
5987 # elif defined(RC10_AN)
5988 # define ENABLE_RC10_ANALOG() (RXY_GPIO_PCFG(RC10_AN) = 0)
5989 # define DISABLE_RC10_ANALOG() (RXY_GPIO_PCFG(RC10_AN) = 1)
5990 # else
5991 # define DISABLE_RC10_ANALOG() ((void) 0)
5992 # endif
5993 
5994 // Input/output:
5995 /// Configure pin RC10 as an input.
5996 # define CONFIG_RC10_AS_INPUT() (_TRISC10 = 1)
5997 /// Configure pin RC10 as an output.
5998 # define CONFIG_RC10_AS_OUTPUT() (_TRISC10 = 0)
5999 
6000 // Open-drain:
6001 # if defined(_ODCC10) || defined(__DOXYGEN__)
6002 /// Enable the open-drain driver on pin RC10.
6003 # define ENABLE_RC10_OPENDRAIN() (_ODCC10 = 1)
6004 /// Disable the open-drain driver on pin RC10.
6005 # define DISABLE_RC10_OPENDRAIN() (_ODCC10 = 0)
6006 # elif defined(_ODC10) // The PIF24F names this bit _OD instead of _ODC.
6007 # define ENABLE_RC10_OPENDRAIN() (_ODC10 = 1)
6008 # define DISABLE_RC10_OPENDRAIN() (_ODC10 = 0)
6009 # else
6010 # define DISABLE_RC10_OPENDRAIN() ((void) 0)
6011 # endif
6012 
6013 // Change notification, pullups and pulldowns:
6014 # if defined(_CNIEC10) || defined(__DOXYGEN__)
6015 /// Enable the pullup on pin RC10.
6016 # define ENABLE_RC10_PULLUP() (_CNPUC10 = 1)
6017 /// Disable the pullup on pin RC10.
6018 # define DISABLE_RC10_PULLUP() (_CNPUC10 = 0)
6019 
6020 /// Enable the pulldown on pin RC10.
6021 # define ENABLE_RC10_PULLDOWN() (_CNPDC10 = 1)
6022 /// Disable the pulldown on pin RC10.
6023 # define DISABLE_RC10_PULLDOWN() (_CNPDC10 = 0)
6024 
6025 /// Enable the change notification interrupt on pin RC10.
6026 # define ENABLE_RC10_CN_INTERRUPT() (_CNIEC10 = 1)
6027 /// Disable the change notification interrupt on pin RC10.
6028 # define DISABLE_RC10_CN_INTERRUPT() (_CNIEC10 = 0)
6029 
6030 # elif defined(RC10_CN)
6031 # define ENABLE_RC10_PULLUP() (RXY_GPIO_CNPUE(RC10_CN) = 1)
6032 # define DISABLE_RC10_PULLUP() (RXY_GPIO_CNPUE(RC10_CN) = 0)
6033 
6034 # if RXY_HAS_CNPDE(RC10_CN)
6035 # define ENABLE_RC10_PULLDOWN() (RXY_GPIO_CNPDE(RC10_CN) = 1)
6036 # define DISABLE_RC10_PULLDOWN() (RXY_GPIO_CNPDE(RC10_CN) = 0)
6037 # else
6038 # define DISABLE_RC10_PULLDOWN() ((void) 0)
6039 # endif
6040 
6041 # define ENABLE_RC10_CN_INTERRUPT() (RXY_GPIO_CNIE(RC10_CN) = 1)
6042 # define DISABLE_RC10_CN_INTERRUPT() (RXY_GPIO_CNIE(RC10_CN) = 0)
6043 
6044 # else
6045 # define DISABLE_RC10_PULLUP() ((void) 0)
6046 # define DISABLE_RC10_PULLDOWN() ((void) 0)
6047 # define DISABLE_RC10_CN_INTERRUPT() ((void) 0)
6048 # endif
6049 
6050 // High-level config
6051 // -----------------
6052 /** This macro disables pullups/downs, enables analog functionality, and configures
6053  * pin RC10 as an input.
6054  */
6055 # if defined(_ANSC10) || defined(RC10_AN) || defined(__DOXYGEN__)
6056 # define CONFIG_RC10_AS_ANALOG() \
6057  do { \
6058  ENABLE_RC10_ANALOG(); \
6059  CONFIG_RC10_AS_INPUT(); \
6060  DISABLE_RC10_OPENDRAIN(); \
6061  DISABLE_RC10_PULLUP(); \
6062  DISABLE_RC10_PULLDOWN(); \
6063  } while (0)
6064 # endif
6065 
6066 /** This macro disables open-drain and pullups/downs,
6067  * configures pin RC10 for digital (not analog) operation, and
6068  * configures the pin as an input.
6069  */
6070 # define CONFIG_RC10_AS_DIG_INPUT() \
6071  do { \
6072  DISABLE_RC10_ANALOG(); \
6073  CONFIG_RC10_AS_INPUT(); \
6074  DISABLE_RC10_OPENDRAIN(); \
6075  DISABLE_RC10_PULLUP(); \
6076  DISABLE_RC10_PULLDOWN(); \
6077  } while (0)
6078 
6079 /** This macro disables open-drain and pullups/downs,
6080  * configures pin RC10 for digital (not analog) operation, and
6081  * configures the pin as an output.
6082  */
6083 # define CONFIG_RC10_AS_DIG_OUTPUT() \
6084  do { \
6085  DISABLE_RC10_ANALOG(); \
6086  CONFIG_RC10_AS_OUTPUT(); \
6087  DISABLE_RC10_OPENDRAIN(); \
6088  DISABLE_RC10_PULLUP(); \
6089  DISABLE_RC10_PULLDOWN(); \
6090  } while (0)
6091 
6092 #endif // #if defined(_RC10) || defined(__DOXYGEN__): Provide GPIO for RC10
6093 
6094 
6095 
6096 
6097 
6098 // Provide GPIO for RC11
6099 // ====================
6100 #if defined(_RC11) || defined(__DOXYGEN__)
6101 
6102 // Dummy macros for documentation only
6103 # ifdef __DOXYGEN__
6104 /// This macro specifies the RPy value associated with pin RC11.
6105 /// Its device-specific definition is given in pic24_ports_mapping.h.
6106 # define RC11_RP xx
6107 
6108 /// This macro specifies the ANn value associated with pin RC11.
6109 /// Its device-specific definition is given in pic24_ports_mapping.h.
6110 # define RC11_AN xx
6111 
6112 /// This macro specifies the CNm value associated with pin RC11.
6113 /// Its device-specific definition is given in pic24_ports_mapping.h.
6114 # define RC11_CN xx
6115 
6116 //@}
6117 # endif // #ifdef __DOXYGEN__
6118 
6119 
6120 // Low-level config
6121 // ----------------
6122 // Analog:
6123 # if defined(_ANSC11) || defined(__DOXYGEN__)
6124 /// Enable analog functionality on pin RC11.
6125 # define ENABLE_RC11_ANALOG() (_ANSC11 = 1)
6126 /// Disable analog functionality on pin RC11.
6127 # define DISABLE_RC11_ANALOG() (_ANSC11 = 0)
6128 # elif defined(RC11_AN)
6129 # define ENABLE_RC11_ANALOG() (RXY_GPIO_PCFG(RC11_AN) = 0)
6130 # define DISABLE_RC11_ANALOG() (RXY_GPIO_PCFG(RC11_AN) = 1)
6131 # else
6132 # define DISABLE_RC11_ANALOG() ((void) 0)
6133 # endif
6134 
6135 // Input/output:
6136 /// Configure pin RC11 as an input.
6137 # define CONFIG_RC11_AS_INPUT() (_TRISC11 = 1)
6138 /// Configure pin RC11 as an output.
6139 # define CONFIG_RC11_AS_OUTPUT() (_TRISC11 = 0)
6140 
6141 // Open-drain:
6142 # if defined(_ODCC11) || defined(__DOXYGEN__)
6143 /// Enable the open-drain driver on pin RC11.
6144 # define ENABLE_RC11_OPENDRAIN() (_ODCC11 = 1)
6145 /// Disable the open-drain driver on pin RC11.
6146 # define DISABLE_RC11_OPENDRAIN() (_ODCC11 = 0)
6147 # elif defined(_ODC11) // The PIF24F names this bit _OD instead of _ODC.
6148 # define ENABLE_RC11_OPENDRAIN() (_ODC11 = 1)
6149 # define DISABLE_RC11_OPENDRAIN() (_ODC11 = 0)
6150 # else
6151 # define DISABLE_RC11_OPENDRAIN() ((void) 0)
6152 # endif
6153 
6154 // Change notification, pullups and pulldowns:
6155 # if defined(_CNIEC11) || defined(__DOXYGEN__)
6156 /// Enable the pullup on pin RC11.
6157 # define ENABLE_RC11_PULLUP() (_CNPUC11 = 1)
6158 /// Disable the pullup on pin RC11.
6159 # define DISABLE_RC11_PULLUP() (_CNPUC11 = 0)
6160 
6161 /// Enable the pulldown on pin RC11.
6162 # define ENABLE_RC11_PULLDOWN() (_CNPDC11 = 1)
6163 /// Disable the pulldown on pin RC11.
6164 # define DISABLE_RC11_PULLDOWN() (_CNPDC11 = 0)
6165 
6166 /// Enable the change notification interrupt on pin RC11.
6167 # define ENABLE_RC11_CN_INTERRUPT() (_CNIEC11 = 1)
6168 /// Disable the change notification interrupt on pin RC11.
6169 # define DISABLE_RC11_CN_INTERRUPT() (_CNIEC11 = 0)
6170 
6171 # elif defined(RC11_CN)
6172 # define ENABLE_RC11_PULLUP() (RXY_GPIO_CNPUE(RC11_CN) = 1)
6173 # define DISABLE_RC11_PULLUP() (RXY_GPIO_CNPUE(RC11_CN) = 0)
6174 
6175 # if RXY_HAS_CNPDE(RC11_CN)
6176 # define ENABLE_RC11_PULLDOWN() (RXY_GPIO_CNPDE(RC11_CN) = 1)
6177 # define DISABLE_RC11_PULLDOWN() (RXY_GPIO_CNPDE(RC11_CN) = 0)
6178 # else
6179 # define DISABLE_RC11_PULLDOWN() ((void) 0)
6180 # endif
6181 
6182 # define ENABLE_RC11_CN_INTERRUPT() (RXY_GPIO_CNIE(RC11_CN) = 1)
6183 # define DISABLE_RC11_CN_INTERRUPT() (RXY_GPIO_CNIE(RC11_CN) = 0)
6184 
6185 # else
6186 # define DISABLE_RC11_PULLUP() ((void) 0)
6187 # define DISABLE_RC11_PULLDOWN() ((void) 0)
6188 # define DISABLE_RC11_CN_INTERRUPT() ((void) 0)
6189 # endif
6190 
6191 // High-level config
6192 // -----------------
6193 /** This macro disables pullups/downs, enables analog functionality, and configures
6194  * pin RC11 as an input.
6195  */
6196 # if defined(_ANSC11) || defined(RC11_AN) || defined(__DOXYGEN__)
6197 # define CONFIG_RC11_AS_ANALOG() \
6198  do { \
6199  ENABLE_RC11_ANALOG(); \
6200  CONFIG_RC11_AS_INPUT(); \
6201  DISABLE_RC11_OPENDRAIN(); \
6202  DISABLE_RC11_PULLUP(); \
6203  DISABLE_RC11_PULLDOWN(); \
6204  } while (0)
6205 # endif
6206 
6207 /** This macro disables open-drain and pullups/downs,
6208  * configures pin RC11 for digital (not analog) operation, and
6209  * configures the pin as an input.
6210  */
6211 # define CONFIG_RC11_AS_DIG_INPUT() \
6212  do { \
6213  DISABLE_RC11_ANALOG(); \
6214  CONFIG_RC11_AS_INPUT(); \
6215  DISABLE_RC11_OPENDRAIN(); \
6216  DISABLE_RC11_PULLUP(); \
6217  DISABLE_RC11_PULLDOWN(); \
6218  } while (0)
6219 
6220 /** This macro disables open-drain and pullups/downs,
6221  * configures pin RC11 for digital (not analog) operation, and
6222  * configures the pin as an output.
6223  */
6224 # define CONFIG_RC11_AS_DIG_OUTPUT() \
6225  do { \
6226  DISABLE_RC11_ANALOG(); \
6227  CONFIG_RC11_AS_OUTPUT(); \
6228  DISABLE_RC11_OPENDRAIN(); \
6229  DISABLE_RC11_PULLUP(); \
6230  DISABLE_RC11_PULLDOWN(); \
6231  } while (0)
6232 
6233 #endif // #if defined(_RC11) || defined(__DOXYGEN__): Provide GPIO for RC11
6234 
6235 
6236 
6237 
6238 
6239 // Provide GPIO for RC12
6240 // ====================
6241 #if defined(_RC12) || defined(__DOXYGEN__)
6242 
6243 // Dummy macros for documentation only
6244 # ifdef __DOXYGEN__
6245 /// This macro specifies the RPy value associated with pin RC12.
6246 /// Its device-specific definition is given in pic24_ports_mapping.h.
6247 # define RC12_RP xx
6248 
6249 /// This macro specifies the ANn value associated with pin RC12.
6250 /// Its device-specific definition is given in pic24_ports_mapping.h.
6251 # define RC12_AN xx
6252 
6253 /// This macro specifies the CNm value associated with pin RC12.
6254 /// Its device-specific definition is given in pic24_ports_mapping.h.
6255 # define RC12_CN xx
6256 
6257 //@}
6258 # endif // #ifdef __DOXYGEN__
6259 
6260 
6261 // Low-level config
6262 // ----------------
6263 // Analog:
6264 # if defined(_ANSC12) || defined(__DOXYGEN__)
6265 /// Enable analog functionality on pin RC12.
6266 # define ENABLE_RC12_ANALOG() (_ANSC12 = 1)
6267 /// Disable analog functionality on pin RC12.
6268 # define DISABLE_RC12_ANALOG() (_ANSC12 = 0)
6269 # elif defined(RC12_AN)
6270 # define ENABLE_RC12_ANALOG() (RXY_GPIO_PCFG(RC12_AN) = 0)
6271 # define DISABLE_RC12_ANALOG() (RXY_GPIO_PCFG(RC12_AN) = 1)
6272 # else
6273 # define DISABLE_RC12_ANALOG() ((void) 0)
6274 # endif
6275 
6276 // Input/output:
6277 /// Configure pin RC12 as an input.
6278 # define CONFIG_RC12_AS_INPUT() (_TRISC12 = 1)
6279 /// Configure pin RC12 as an output.
6280 # define CONFIG_RC12_AS_OUTPUT() (_TRISC12 = 0)
6281 
6282 // Open-drain:
6283 # if defined(_ODCC12) || defined(__DOXYGEN__)
6284 /// Enable the open-drain driver on pin RC12.
6285 # define ENABLE_RC12_OPENDRAIN() (_ODCC12 = 1)
6286 /// Disable the open-drain driver on pin RC12.
6287 # define DISABLE_RC12_OPENDRAIN() (_ODCC12 = 0)
6288 # elif defined(_ODC12) // The PIF24F names this bit _OD instead of _ODC.
6289 # define ENABLE_RC12_OPENDRAIN() (_ODC12 = 1)
6290 # define DISABLE_RC12_OPENDRAIN() (_ODC12 = 0)
6291 # else
6292 # define DISABLE_RC12_OPENDRAIN() ((void) 0)
6293 # endif
6294 
6295 // Change notification, pullups and pulldowns:
6296 # if defined(_CNIEC12) || defined(__DOXYGEN__)
6297 /// Enable the pullup on pin RC12.
6298 # define ENABLE_RC12_PULLUP() (_CNPUC12 = 1)
6299 /// Disable the pullup on pin RC12.
6300 # define DISABLE_RC12_PULLUP() (_CNPUC12 = 0)
6301 
6302 /// Enable the pulldown on pin RC12.
6303 # define ENABLE_RC12_PULLDOWN() (_CNPDC12 = 1)
6304 /// Disable the pulldown on pin RC12.
6305 # define DISABLE_RC12_PULLDOWN() (_CNPDC12 = 0)
6306 
6307 /// Enable the change notification interrupt on pin RC12.
6308 # define ENABLE_RC12_CN_INTERRUPT() (_CNIEC12 = 1)
6309 /// Disable the change notification interrupt on pin RC12.
6310 # define DISABLE_RC12_CN_INTERRUPT() (_CNIEC12 = 0)
6311 
6312 # elif defined(RC12_CN)
6313 # define ENABLE_RC12_PULLUP() (RXY_GPIO_CNPUE(RC12_CN) = 1)
6314 # define DISABLE_RC12_PULLUP() (RXY_GPIO_CNPUE(RC12_CN) = 0)
6315 
6316 # if RXY_HAS_CNPDE(RC12_CN)
6317 # define ENABLE_RC12_PULLDOWN() (RXY_GPIO_CNPDE(RC12_CN) = 1)
6318 # define DISABLE_RC12_PULLDOWN() (RXY_GPIO_CNPDE(RC12_CN) = 0)
6319 # else
6320 # define DISABLE_RC12_PULLDOWN() ((void) 0)
6321 # endif
6322 
6323 # define ENABLE_RC12_CN_INTERRUPT() (RXY_GPIO_CNIE(RC12_CN) = 1)
6324 # define DISABLE_RC12_CN_INTERRUPT() (RXY_GPIO_CNIE(RC12_CN) = 0)
6325 
6326 # else
6327 # define DISABLE_RC12_PULLUP() ((void) 0)
6328 # define DISABLE_RC12_PULLDOWN() ((void) 0)
6329 # define DISABLE_RC12_CN_INTERRUPT() ((void) 0)
6330 # endif
6331 
6332 // High-level config
6333 // -----------------
6334 /** This macro disables pullups/downs, enables analog functionality, and configures
6335  * pin RC12 as an input.
6336  */
6337 # if defined(_ANSC12) || defined(RC12_AN) || defined(__DOXYGEN__)
6338 # define CONFIG_RC12_AS_ANALOG() \
6339  do { \
6340  ENABLE_RC12_ANALOG(); \
6341  CONFIG_RC12_AS_INPUT(); \
6342  DISABLE_RC12_OPENDRAIN(); \
6343  DISABLE_RC12_PULLUP(); \
6344  DISABLE_RC12_PULLDOWN(); \
6345  } while (0)
6346 # endif
6347 
6348 /** This macro disables open-drain and pullups/downs,
6349  * configures pin RC12 for digital (not analog) operation, and
6350  * configures the pin as an input.
6351  */
6352 # define CONFIG_RC12_AS_DIG_INPUT() \
6353  do { \
6354  DISABLE_RC12_ANALOG(); \
6355  CONFIG_RC12_AS_INPUT(); \
6356  DISABLE_RC12_OPENDRAIN(); \
6357  DISABLE_RC12_PULLUP(); \
6358  DISABLE_RC12_PULLDOWN(); \
6359  } while (0)
6360 
6361 /** This macro disables open-drain and pullups/downs,
6362  * configures pin RC12 for digital (not analog) operation, and
6363  * configures the pin as an output.
6364  */
6365 # define CONFIG_RC12_AS_DIG_OUTPUT() \
6366  do { \
6367  DISABLE_RC12_ANALOG(); \
6368  CONFIG_RC12_AS_OUTPUT(); \
6369  DISABLE_RC12_OPENDRAIN(); \
6370  DISABLE_RC12_PULLUP(); \
6371  DISABLE_RC12_PULLDOWN(); \
6372  } while (0)
6373 
6374 #endif // #if defined(_RC12) || defined(__DOXYGEN__): Provide GPIO for RC12
6375 
6376 
6377 
6378 
6379 
6380 // Provide GPIO for RC13
6381 // ====================
6382 #if defined(_RC13) || defined(__DOXYGEN__)
6383 
6384 // Dummy macros for documentation only
6385 # ifdef __DOXYGEN__
6386 /// This macro specifies the RPy value associated with pin RC13.
6387 /// Its device-specific definition is given in pic24_ports_mapping.h.
6388 # define RC13_RP xx
6389 
6390 /// This macro specifies the ANn value associated with pin RC13.
6391 /// Its device-specific definition is given in pic24_ports_mapping.h.
6392 # define RC13_AN xx
6393 
6394 /// This macro specifies the CNm value associated with pin RC13.
6395 /// Its device-specific definition is given in pic24_ports_mapping.h.
6396 # define RC13_CN xx
6397 
6398 //@}
6399 # endif // #ifdef __DOXYGEN__
6400 
6401 
6402 // Low-level config
6403 // ----------------
6404 // Analog:
6405 # if defined(_ANSC13) || defined(__DOXYGEN__)
6406 /// Enable analog functionality on pin RC13.
6407 # define ENABLE_RC13_ANALOG() (_ANSC13 = 1)
6408 /// Disable analog functionality on pin RC13.
6409 # define DISABLE_RC13_ANALOG() (_ANSC13 = 0)
6410 # elif defined(RC13_AN)
6411 # define ENABLE_RC13_ANALOG() (RXY_GPIO_PCFG(RC13_AN) = 0)
6412 # define DISABLE_RC13_ANALOG() (RXY_GPIO_PCFG(RC13_AN) = 1)
6413 # else
6414 # define DISABLE_RC13_ANALOG() ((void) 0)
6415 # endif
6416 
6417 // Input/output:
6418 /// Configure pin RC13 as an input.
6419 # define CONFIG_RC13_AS_INPUT() (_TRISC13 = 1)
6420 /// Configure pin RC13 as an output.
6421 # define CONFIG_RC13_AS_OUTPUT() (_TRISC13 = 0)
6422 
6423 // Open-drain:
6424 # if defined(_ODCC13) || defined(__DOXYGEN__)
6425 /// Enable the open-drain driver on pin RC13.
6426 # define ENABLE_RC13_OPENDRAIN() (_ODCC13 = 1)
6427 /// Disable the open-drain driver on pin RC13.
6428 # define DISABLE_RC13_OPENDRAIN() (_ODCC13 = 0)
6429 # elif defined(_ODC13) // The PIF24F names this bit _OD instead of _ODC.
6430 # define ENABLE_RC13_OPENDRAIN() (_ODC13 = 1)
6431 # define DISABLE_RC13_OPENDRAIN() (_ODC13 = 0)
6432 # else
6433 # define DISABLE_RC13_OPENDRAIN() ((void) 0)
6434 # endif
6435 
6436 // Change notification, pullups and pulldowns:
6437 # if defined(_CNIEC13) || defined(__DOXYGEN__)
6438 /// Enable the pullup on pin RC13.
6439 # define ENABLE_RC13_PULLUP() (_CNPUC13 = 1)
6440 /// Disable the pullup on pin RC13.
6441 # define DISABLE_RC13_PULLUP() (_CNPUC13 = 0)
6442 
6443 /// Enable the pulldown on pin RC13.
6444 # define ENABLE_RC13_PULLDOWN() (_CNPDC13 = 1)
6445 /// Disable the pulldown on pin RC13.
6446 # define DISABLE_RC13_PULLDOWN() (_CNPDC13 = 0)
6447 
6448 /// Enable the change notification interrupt on pin RC13.
6449 # define ENABLE_RC13_CN_INTERRUPT() (_CNIEC13 = 1)
6450 /// Disable the change notification interrupt on pin RC13.
6451 # define DISABLE_RC13_CN_INTERRUPT() (_CNIEC13 = 0)
6452 
6453 # elif defined(RC13_CN)
6454 # define ENABLE_RC13_PULLUP() (RXY_GPIO_CNPUE(RC13_CN) = 1)
6455 # define DISABLE_RC13_PULLUP() (RXY_GPIO_CNPUE(RC13_CN) = 0)
6456 
6457 # if RXY_HAS_CNPDE(RC13_CN)
6458 # define ENABLE_RC13_PULLDOWN() (RXY_GPIO_CNPDE(RC13_CN) = 1)
6459 # define DISABLE_RC13_PULLDOWN() (RXY_GPIO_CNPDE(RC13_CN) = 0)
6460 # else
6461 # define DISABLE_RC13_PULLDOWN() ((void) 0)
6462 # endif
6463 
6464 # define ENABLE_RC13_CN_INTERRUPT() (RXY_GPIO_CNIE(RC13_CN) = 1)
6465 # define DISABLE_RC13_CN_INTERRUPT() (RXY_GPIO_CNIE(RC13_CN) = 0)
6466 
6467 # else
6468 # define DISABLE_RC13_PULLUP() ((void) 0)
6469 # define DISABLE_RC13_PULLDOWN() ((void) 0)
6470 # define DISABLE_RC13_CN_INTERRUPT() ((void) 0)
6471 # endif
6472 
6473 // High-level config
6474 // -----------------
6475 /** This macro disables pullups/downs, enables analog functionality, and configures
6476  * pin RC13 as an input.
6477  */
6478 # if defined(_ANSC13) || defined(RC13_AN) || defined(__DOXYGEN__)
6479 # define CONFIG_RC13_AS_ANALOG() \
6480  do { \
6481  ENABLE_RC13_ANALOG(); \
6482  CONFIG_RC13_AS_INPUT(); \
6483  DISABLE_RC13_OPENDRAIN(); \
6484  DISABLE_RC13_PULLUP(); \
6485  DISABLE_RC13_PULLDOWN(); \
6486  } while (0)
6487 # endif
6488 
6489 /** This macro disables open-drain and pullups/downs,
6490  * configures pin RC13 for digital (not analog) operation, and
6491  * configures the pin as an input.
6492  */
6493 # define CONFIG_RC13_AS_DIG_INPUT() \
6494  do { \
6495  DISABLE_RC13_ANALOG(); \
6496  CONFIG_RC13_AS_INPUT(); \
6497  DISABLE_RC13_OPENDRAIN(); \
6498  DISABLE_RC13_PULLUP(); \
6499  DISABLE_RC13_PULLDOWN(); \
6500  } while (0)
6501 
6502 /** This macro disables open-drain and pullups/downs,
6503  * configures pin RC13 for digital (not analog) operation, and
6504  * configures the pin as an output.
6505  */
6506 # define CONFIG_RC13_AS_DIG_OUTPUT() \
6507  do { \
6508  DISABLE_RC13_ANALOG(); \
6509  CONFIG_RC13_AS_OUTPUT(); \
6510  DISABLE_RC13_OPENDRAIN(); \
6511  DISABLE_RC13_PULLUP(); \
6512  DISABLE_RC13_PULLDOWN(); \
6513  } while (0)
6514 
6515 #endif // #if defined(_RC13) || defined(__DOXYGEN__): Provide GPIO for RC13
6516 
6517 
6518 
6519 
6520 
6521 // Provide GPIO for RC14
6522 // ====================
6523 #if defined(_RC14) || defined(__DOXYGEN__)
6524 
6525 // Dummy macros for documentation only
6526 # ifdef __DOXYGEN__
6527 /// This macro specifies the RPy value associated with pin RC14.
6528 /// Its device-specific definition is given in pic24_ports_mapping.h.
6529 # define RC14_RP xx
6530 
6531 /// This macro specifies the ANn value associated with pin RC14.
6532 /// Its device-specific definition is given in pic24_ports_mapping.h.
6533 # define RC14_AN xx
6534 
6535 /// This macro specifies the CNm value associated with pin RC14.
6536 /// Its device-specific definition is given in pic24_ports_mapping.h.
6537 # define RC14_CN xx
6538 
6539 //@}
6540 # endif // #ifdef __DOXYGEN__
6541 
6542 
6543 // Low-level config
6544 // ----------------
6545 // Analog:
6546 # if defined(_ANSC14) || defined(__DOXYGEN__)
6547 /// Enable analog functionality on pin RC14.
6548 # define ENABLE_RC14_ANALOG() (_ANSC14 = 1)
6549 /// Disable analog functionality on pin RC14.
6550 # define DISABLE_RC14_ANALOG() (_ANSC14 = 0)
6551 # elif defined(RC14_AN)
6552 # define ENABLE_RC14_ANALOG() (RXY_GPIO_PCFG(RC14_AN) = 0)
6553 # define DISABLE_RC14_ANALOG() (RXY_GPIO_PCFG(RC14_AN) = 1)
6554 # else
6555 # define DISABLE_RC14_ANALOG() ((void) 0)
6556 # endif
6557 
6558 // Input/output:
6559 /// Configure pin RC14 as an input.
6560 # define CONFIG_RC14_AS_INPUT() (_TRISC14 = 1)
6561 /// Configure pin RC14 as an output.
6562 # define CONFIG_RC14_AS_OUTPUT() (_TRISC14 = 0)
6563 
6564 // Open-drain:
6565 # if defined(_ODCC14) || defined(__DOXYGEN__)
6566 /// Enable the open-drain driver on pin RC14.
6567 # define ENABLE_RC14_OPENDRAIN() (_ODCC14 = 1)
6568 /// Disable the open-drain driver on pin RC14.
6569 # define DISABLE_RC14_OPENDRAIN() (_ODCC14 = 0)
6570 # elif defined(_ODC14) // The PIF24F names this bit _OD instead of _ODC.
6571 # define ENABLE_RC14_OPENDRAIN() (_ODC14 = 1)
6572 # define DISABLE_RC14_OPENDRAIN() (_ODC14 = 0)
6573 # else
6574 # define DISABLE_RC14_OPENDRAIN() ((void) 0)
6575 # endif
6576 
6577 // Change notification, pullups and pulldowns:
6578 # if defined(_CNIEC14) || defined(__DOXYGEN__)
6579 /// Enable the pullup on pin RC14.
6580 # define ENABLE_RC14_PULLUP() (_CNPUC14 = 1)
6581 /// Disable the pullup on pin RC14.
6582 # define DISABLE_RC14_PULLUP() (_CNPUC14 = 0)
6583 
6584 /// Enable the pulldown on pin RC14.
6585 # define ENABLE_RC14_PULLDOWN() (_CNPDC14 = 1)
6586 /// Disable the pulldown on pin RC14.
6587 # define DISABLE_RC14_PULLDOWN() (_CNPDC14 = 0)
6588 
6589 /// Enable the change notification interrupt on pin RC14.
6590 # define ENABLE_RC14_CN_INTERRUPT() (_CNIEC14 = 1)
6591 /// Disable the change notification interrupt on pin RC14.
6592 # define DISABLE_RC14_CN_INTERRUPT() (_CNIEC14 = 0)
6593 
6594 # elif defined(RC14_CN)
6595 # define ENABLE_RC14_PULLUP() (RXY_GPIO_CNPUE(RC14_CN) = 1)
6596 # define DISABLE_RC14_PULLUP() (RXY_GPIO_CNPUE(RC14_CN) = 0)
6597 
6598 # if RXY_HAS_CNPDE(RC14_CN)
6599 # define ENABLE_RC14_PULLDOWN() (RXY_GPIO_CNPDE(RC14_CN) = 1)
6600 # define DISABLE_RC14_PULLDOWN() (RXY_GPIO_CNPDE(RC14_CN) = 0)
6601 # else
6602 # define DISABLE_RC14_PULLDOWN() ((void) 0)
6603 # endif
6604 
6605 # define ENABLE_RC14_CN_INTERRUPT() (RXY_GPIO_CNIE(RC14_CN) = 1)
6606 # define DISABLE_RC14_CN_INTERRUPT() (RXY_GPIO_CNIE(RC14_CN) = 0)
6607 
6608 # else
6609 # define DISABLE_RC14_PULLUP() ((void) 0)
6610 # define DISABLE_RC14_PULLDOWN() ((void) 0)
6611 # define DISABLE_RC14_CN_INTERRUPT() ((void) 0)
6612 # endif
6613 
6614 // High-level config
6615 // -----------------
6616 /** This macro disables pullups/downs, enables analog functionality, and configures
6617  * pin RC14 as an input.
6618  */
6619 # if defined(_ANSC14) || defined(RC14_AN) || defined(__DOXYGEN__)
6620 # define CONFIG_RC14_AS_ANALOG() \
6621  do { \
6622  ENABLE_RC14_ANALOG(); \
6623  CONFIG_RC14_AS_INPUT(); \
6624  DISABLE_RC14_OPENDRAIN(); \
6625  DISABLE_RC14_PULLUP(); \
6626  DISABLE_RC14_PULLDOWN(); \
6627  } while (0)
6628 # endif
6629 
6630 /** This macro disables open-drain and pullups/downs,
6631  * configures pin RC14 for digital (not analog) operation, and
6632  * configures the pin as an input.
6633  */
6634 # define CONFIG_RC14_AS_DIG_INPUT() \
6635  do { \
6636  DISABLE_RC14_ANALOG(); \
6637  CONFIG_RC14_AS_INPUT(); \
6638  DISABLE_RC14_OPENDRAIN(); \
6639  DISABLE_RC14_PULLUP(); \
6640  DISABLE_RC14_PULLDOWN(); \
6641  } while (0)
6642 
6643 /** This macro disables open-drain and pullups/downs,
6644  * configures pin RC14 for digital (not analog) operation, and
6645  * configures the pin as an output.
6646  */
6647 # define CONFIG_RC14_AS_DIG_OUTPUT() \
6648  do { \
6649  DISABLE_RC14_ANALOG(); \
6650  CONFIG_RC14_AS_OUTPUT(); \
6651  DISABLE_RC14_OPENDRAIN(); \
6652  DISABLE_RC14_PULLUP(); \
6653  DISABLE_RC14_PULLDOWN(); \
6654  } while (0)
6655 
6656 #endif // #if defined(_RC14) || defined(__DOXYGEN__): Provide GPIO for RC14
6657 
6658 
6659 
6660 
6661 
6662 // Provide GPIO for RC15
6663 // ====================
6664 #if defined(_RC15) || defined(__DOXYGEN__)
6665 
6666 // Dummy macros for documentation only
6667 # ifdef __DOXYGEN__
6668 /// This macro specifies the RPy value associated with pin RC15.
6669 /// Its device-specific definition is given in pic24_ports_mapping.h.
6670 # define RC15_RP xx
6671 
6672 /// This macro specifies the ANn value associated with pin RC15.
6673 /// Its device-specific definition is given in pic24_ports_mapping.h.
6674 # define RC15_AN xx
6675 
6676 /// This macro specifies the CNm value associated with pin RC15.
6677 /// Its device-specific definition is given in pic24_ports_mapping.h.
6678 # define RC15_CN xx
6679 
6680 //@}
6681 # endif // #ifdef __DOXYGEN__
6682 
6683 
6684 // Low-level config
6685 // ----------------
6686 // Analog:
6687 # if defined(_ANSC15) || defined(__DOXYGEN__)
6688 /// Enable analog functionality on pin RC15.
6689 # define ENABLE_RC15_ANALOG() (_ANSC15 = 1)
6690 /// Disable analog functionality on pin RC15.
6691 # define DISABLE_RC15_ANALOG() (_ANSC15 = 0)
6692 # elif defined(RC15_AN)
6693 # define ENABLE_RC15_ANALOG() (RXY_GPIO_PCFG(RC15_AN) = 0)
6694 # define DISABLE_RC15_ANALOG() (RXY_GPIO_PCFG(RC15_AN) = 1)
6695 # else
6696 # define DISABLE_RC15_ANALOG() ((void) 0)
6697 # endif
6698 
6699 // Input/output:
6700 /// Configure pin RC15 as an input.
6701 # define CONFIG_RC15_AS_INPUT() (_TRISC15 = 1)
6702 /// Configure pin RC15 as an output.
6703 # define CONFIG_RC15_AS_OUTPUT() (_TRISC15 = 0)
6704 
6705 // Open-drain:
6706 # if defined(_ODCC15) || defined(__DOXYGEN__)
6707 /// Enable the open-drain driver on pin RC15.
6708 # define ENABLE_RC15_OPENDRAIN() (_ODCC15 = 1)
6709 /// Disable the open-drain driver on pin RC15.
6710 # define DISABLE_RC15_OPENDRAIN() (_ODCC15 = 0)
6711 # elif defined(_ODC15) // The PIF24F names this bit _OD instead of _ODC.
6712 # define ENABLE_RC15_OPENDRAIN() (_ODC15 = 1)
6713 # define DISABLE_RC15_OPENDRAIN() (_ODC15 = 0)
6714 # else
6715 # define DISABLE_RC15_OPENDRAIN() ((void) 0)
6716 # endif
6717 
6718 // Change notification, pullups and pulldowns:
6719 # if defined(_CNIEC15) || defined(__DOXYGEN__)
6720 /// Enable the pullup on pin RC15.
6721 # define ENABLE_RC15_PULLUP() (_CNPUC15 = 1)
6722 /// Disable the pullup on pin RC15.
6723 # define DISABLE_RC15_PULLUP() (_CNPUC15 = 0)
6724 
6725 /// Enable the pulldown on pin RC15.
6726 # define ENABLE_RC15_PULLDOWN() (_CNPDC15 = 1)
6727 /// Disable the pulldown on pin RC15.
6728 # define DISABLE_RC15_PULLDOWN() (_CNPDC15 = 0)
6729 
6730 /// Enable the change notification interrupt on pin RC15.
6731 # define ENABLE_RC15_CN_INTERRUPT() (_CNIEC15 = 1)
6732 /// Disable the change notification interrupt on pin RC15.
6733 # define DISABLE_RC15_CN_INTERRUPT() (_CNIEC15 = 0)
6734 
6735 # elif defined(RC15_CN)
6736 # define ENABLE_RC15_PULLUP() (RXY_GPIO_CNPUE(RC15_CN) = 1)
6737 # define DISABLE_RC15_PULLUP() (RXY_GPIO_CNPUE(RC15_CN) = 0)
6738 
6739 # if RXY_HAS_CNPDE(RC15_CN)
6740 # define ENABLE_RC15_PULLDOWN() (RXY_GPIO_CNPDE(RC15_CN) = 1)
6741 # define DISABLE_RC15_PULLDOWN() (RXY_GPIO_CNPDE(RC15_CN) = 0)
6742 # else
6743 # define DISABLE_RC15_PULLDOWN() ((void) 0)
6744 # endif
6745 
6746 # define ENABLE_RC15_CN_INTERRUPT() (RXY_GPIO_CNIE(RC15_CN) = 1)
6747 # define DISABLE_RC15_CN_INTERRUPT() (RXY_GPIO_CNIE(RC15_CN) = 0)
6748 
6749 # else
6750 # define DISABLE_RC15_PULLUP() ((void) 0)
6751 # define DISABLE_RC15_PULLDOWN() ((void) 0)
6752 # define DISABLE_RC15_CN_INTERRUPT() ((void) 0)
6753 # endif
6754 
6755 // High-level config
6756 // -----------------
6757 /** This macro disables pullups/downs, enables analog functionality, and configures
6758  * pin RC15 as an input.
6759  */
6760 # if defined(_ANSC15) || defined(RC15_AN) || defined(__DOXYGEN__)
6761 # define CONFIG_RC15_AS_ANALOG() \
6762  do { \
6763  ENABLE_RC15_ANALOG(); \
6764  CONFIG_RC15_AS_INPUT(); \
6765  DISABLE_RC15_OPENDRAIN(); \
6766  DISABLE_RC15_PULLUP(); \
6767  DISABLE_RC15_PULLDOWN(); \
6768  } while (0)
6769 # endif
6770 
6771 /** This macro disables open-drain and pullups/downs,
6772  * configures pin RC15 for digital (not analog) operation, and
6773  * configures the pin as an input.
6774  */
6775 # define CONFIG_RC15_AS_DIG_INPUT() \
6776  do { \
6777  DISABLE_RC15_ANALOG(); \
6778  CONFIG_RC15_AS_INPUT(); \
6779  DISABLE_RC15_OPENDRAIN(); \
6780  DISABLE_RC15_PULLUP(); \
6781  DISABLE_RC15_PULLDOWN(); \
6782  } while (0)
6783 
6784 /** This macro disables open-drain and pullups/downs,
6785  * configures pin RC15 for digital (not analog) operation, and
6786  * configures the pin as an output.
6787  */
6788 # define CONFIG_RC15_AS_DIG_OUTPUT() \
6789  do { \
6790  DISABLE_RC15_ANALOG(); \
6791  CONFIG_RC15_AS_OUTPUT(); \
6792  DISABLE_RC15_OPENDRAIN(); \
6793  DISABLE_RC15_PULLUP(); \
6794  DISABLE_RC15_PULLDOWN(); \
6795  } while (0)
6796 
6797 #endif // #if defined(_RC15) || defined(__DOXYGEN__): Provide GPIO for RC15
6798 
6799 
6800 
6801 
6802 
6803 // Provide GPIO for RD0
6804 // ====================
6805 #if defined(_RD0) || defined(__DOXYGEN__)
6806 
6807 // Dummy macros for documentation only
6808 # ifdef __DOXYGEN__
6809 /// This macro specifies the RPy value associated with pin RD0.
6810 /// Its device-specific definition is given in pic24_ports_mapping.h.
6811 # define RD0_RP xx
6812 
6813 /// This macro specifies the ANn value associated with pin RD0.
6814 /// Its device-specific definition is given in pic24_ports_mapping.h.
6815 # define RD0_AN xx
6816 
6817 /// This macro specifies the CNm value associated with pin RD0.
6818 /// Its device-specific definition is given in pic24_ports_mapping.h.
6819 # define RD0_CN xx
6820 
6821 //@}
6822 # endif // #ifdef __DOXYGEN__
6823 
6824 
6825 // Low-level config
6826 // ----------------
6827 // Analog:
6828 # if defined(_ANSD0) || defined(__DOXYGEN__)
6829 /// Enable analog functionality on pin RD0.
6830 # define ENABLE_RD0_ANALOG() (_ANSD0 = 1)
6831 /// Disable analog functionality on pin RD0.
6832 # define DISABLE_RD0_ANALOG() (_ANSD0 = 0)
6833 # elif defined(RD0_AN)
6834 # define ENABLE_RD0_ANALOG() (RXY_GPIO_PCFG(RD0_AN) = 0)
6835 # define DISABLE_RD0_ANALOG() (RXY_GPIO_PCFG(RD0_AN) = 1)
6836 # else
6837 # define DISABLE_RD0_ANALOG() ((void) 0)
6838 # endif
6839 
6840 // Input/output:
6841 /// Configure pin RD0 as an input.
6842 # define CONFIG_RD0_AS_INPUT() (_TRISD0 = 1)
6843 /// Configure pin RD0 as an output.
6844 # define CONFIG_RD0_AS_OUTPUT() (_TRISD0 = 0)
6845 
6846 // Open-drain:
6847 # if defined(_ODCD0) || defined(__DOXYGEN__)
6848 /// Enable the open-drain driver on pin RD0.
6849 # define ENABLE_RD0_OPENDRAIN() (_ODCD0 = 1)
6850 /// Disable the open-drain driver on pin RD0.
6851 # define DISABLE_RD0_OPENDRAIN() (_ODCD0 = 0)
6852 # elif defined(_ODD0) // The PIF24F names this bit _OD instead of _ODC.
6853 # define ENABLE_RD0_OPENDRAIN() (_ODD0 = 1)
6854 # define DISABLE_RD0_OPENDRAIN() (_ODD0 = 0)
6855 # else
6856 # define DISABLE_RD0_OPENDRAIN() ((void) 0)
6857 # endif
6858 
6859 // Change notification, pullups and pulldowns:
6860 # if defined(_CNIED0) || defined(__DOXYGEN__)
6861 /// Enable the pullup on pin RD0.
6862 # define ENABLE_RD0_PULLUP() (_CNPUD0 = 1)
6863 /// Disable the pullup on pin RD0.
6864 # define DISABLE_RD0_PULLUP() (_CNPUD0 = 0)
6865 
6866 /// Enable the pulldown on pin RD0.
6867 # define ENABLE_RD0_PULLDOWN() (_CNPDD0 = 1)
6868 /// Disable the pulldown on pin RD0.
6869 # define DISABLE_RD0_PULLDOWN() (_CNPDD0 = 0)
6870 
6871 /// Enable the change notification interrupt on pin RD0.
6872 # define ENABLE_RD0_CN_INTERRUPT() (_CNIED0 = 1)
6873 /// Disable the change notification interrupt on pin RD0.
6874 # define DISABLE_RD0_CN_INTERRUPT() (_CNIED0 = 0)
6875 
6876 # elif defined(RD0_CN)
6877 # define ENABLE_RD0_PULLUP() (RXY_GPIO_CNPUE(RD0_CN) = 1)
6878 # define DISABLE_RD0_PULLUP() (RXY_GPIO_CNPUE(RD0_CN) = 0)
6879 
6880 # if RXY_HAS_CNPDE(RD0_CN)
6881 # define ENABLE_RD0_PULLDOWN() (RXY_GPIO_CNPDE(RD0_CN) = 1)
6882 # define DISABLE_RD0_PULLDOWN() (RXY_GPIO_CNPDE(RD0_CN) = 0)
6883 # else
6884 # define DISABLE_RD0_PULLDOWN() ((void) 0)
6885 # endif
6886 
6887 # define ENABLE_RD0_CN_INTERRUPT() (RXY_GPIO_CNIE(RD0_CN) = 1)
6888 # define DISABLE_RD0_CN_INTERRUPT() (RXY_GPIO_CNIE(RD0_CN) = 0)
6889 
6890 # else
6891 # define DISABLE_RD0_PULLUP() ((void) 0)
6892 # define DISABLE_RD0_PULLDOWN() ((void) 0)
6893 # define DISABLE_RD0_CN_INTERRUPT() ((void) 0)
6894 # endif
6895 
6896 // High-level config
6897 // -----------------
6898 /** This macro disables pullups/downs, enables analog functionality, and configures
6899  * pin RD0 as an input.
6900  */
6901 # if defined(_ANSD0) || defined(RD0_AN) || defined(__DOXYGEN__)
6902 # define CONFIG_RD0_AS_ANALOG() \
6903  do { \
6904  ENABLE_RD0_ANALOG(); \
6905  CONFIG_RD0_AS_INPUT(); \
6906  DISABLE_RD0_OPENDRAIN(); \
6907  DISABLE_RD0_PULLUP(); \
6908  DISABLE_RD0_PULLDOWN(); \
6909  } while (0)
6910 # endif
6911 
6912 /** This macro disables open-drain and pullups/downs,
6913  * configures pin RD0 for digital (not analog) operation, and
6914  * configures the pin as an input.
6915  */
6916 # define CONFIG_RD0_AS_DIG_INPUT() \
6917  do { \
6918  DISABLE_RD0_ANALOG(); \
6919  CONFIG_RD0_AS_INPUT(); \
6920  DISABLE_RD0_OPENDRAIN(); \
6921  DISABLE_RD0_PULLUP(); \
6922  DISABLE_RD0_PULLDOWN(); \
6923  } while (0)
6924 
6925 /** This macro disables open-drain and pullups/downs,
6926  * configures pin RD0 for digital (not analog) operation, and
6927  * configures the pin as an output.
6928  */
6929 # define CONFIG_RD0_AS_DIG_OUTPUT() \
6930  do { \
6931  DISABLE_RD0_ANALOG(); \
6932  CONFIG_RD0_AS_OUTPUT(); \
6933  DISABLE_RD0_OPENDRAIN(); \
6934  DISABLE_RD0_PULLUP(); \
6935  DISABLE_RD0_PULLDOWN(); \
6936  } while (0)
6937 
6938 #endif // #if defined(_RD0) || defined(__DOXYGEN__): Provide GPIO for RD0
6939 
6940 
6941 
6942 
6943 
6944 // Provide GPIO for RD1
6945 // ====================
6946 #if defined(_RD1) || defined(__DOXYGEN__)
6947 
6948 // Dummy macros for documentation only
6949 # ifdef __DOXYGEN__
6950 /// This macro specifies the RPy value associated with pin RD1.
6951 /// Its device-specific definition is given in pic24_ports_mapping.h.
6952 # define RD1_RP xx
6953 
6954 /// This macro specifies the ANn value associated with pin RD1.
6955 /// Its device-specific definition is given in pic24_ports_mapping.h.
6956 # define RD1_AN xx
6957 
6958 /// This macro specifies the CNm value associated with pin RD1.
6959 /// Its device-specific definition is given in pic24_ports_mapping.h.
6960 # define RD1_CN xx
6961 
6962 //@}
6963 # endif // #ifdef __DOXYGEN__
6964 
6965 
6966 // Low-level config
6967 // ----------------
6968 // Analog:
6969 # if defined(_ANSD1) || defined(__DOXYGEN__)
6970 /// Enable analog functionality on pin RD1.
6971 # define ENABLE_RD1_ANALOG() (_ANSD1 = 1)
6972 /// Disable analog functionality on pin RD1.
6973 # define DISABLE_RD1_ANALOG() (_ANSD1 = 0)
6974 # elif defined(RD1_AN)
6975 # define ENABLE_RD1_ANALOG() (RXY_GPIO_PCFG(RD1_AN) = 0)
6976 # define DISABLE_RD1_ANALOG() (RXY_GPIO_PCFG(RD1_AN) = 1)
6977 # else
6978 # define DISABLE_RD1_ANALOG() ((void) 0)
6979 # endif
6980 
6981 // Input/output:
6982 /// Configure pin RD1 as an input.
6983 # define CONFIG_RD1_AS_INPUT() (_TRISD1 = 1)
6984 /// Configure pin RD1 as an output.
6985 # define CONFIG_RD1_AS_OUTPUT() (_TRISD1 = 0)
6986 
6987 // Open-drain:
6988 # if defined(_ODCD1) || defined(__DOXYGEN__)
6989 /// Enable the open-drain driver on pin RD1.
6990 # define ENABLE_RD1_OPENDRAIN() (_ODCD1 = 1)
6991 /// Disable the open-drain driver on pin RD1.
6992 # define DISABLE_RD1_OPENDRAIN() (_ODCD1 = 0)
6993 # elif defined(_ODD1) // The PIF24F names this bit _OD instead of _ODC.
6994 # define ENABLE_RD1_OPENDRAIN() (_ODD1 = 1)
6995 # define DISABLE_RD1_OPENDRAIN() (_ODD1 = 0)
6996 # else
6997 # define DISABLE_RD1_OPENDRAIN() ((void) 0)
6998 # endif
6999 
7000 // Change notification, pullups and pulldowns:
7001 # if defined(_CNIED1) || defined(__DOXYGEN__)
7002 /// Enable the pullup on pin RD1.
7003 # define ENABLE_RD1_PULLUP() (_CNPUD1 = 1)
7004 /// Disable the pullup on pin RD1.
7005 # define DISABLE_RD1_PULLUP() (_CNPUD1 = 0)
7006 
7007 /// Enable the pulldown on pin RD1.
7008 # define ENABLE_RD1_PULLDOWN() (_CNPDD1 = 1)
7009 /// Disable the pulldown on pin RD1.
7010 # define DISABLE_RD1_PULLDOWN() (_CNPDD1 = 0)
7011 
7012 /// Enable the change notification interrupt on pin RD1.
7013 # define ENABLE_RD1_CN_INTERRUPT() (_CNIED1 = 1)
7014 /// Disable the change notification interrupt on pin RD1.
7015 # define DISABLE_RD1_CN_INTERRUPT() (_CNIED1 = 0)
7016 
7017 # elif defined(RD1_CN)
7018 # define ENABLE_RD1_PULLUP() (RXY_GPIO_CNPUE(RD1_CN) = 1)
7019 # define DISABLE_RD1_PULLUP() (RXY_GPIO_CNPUE(RD1_CN) = 0)
7020 
7021 # if RXY_HAS_CNPDE(RD1_CN)
7022 # define ENABLE_RD1_PULLDOWN() (RXY_GPIO_CNPDE(RD1_CN) = 1)
7023 # define DISABLE_RD1_PULLDOWN() (RXY_GPIO_CNPDE(RD1_CN) = 0)
7024 # else
7025 # define DISABLE_RD1_PULLDOWN() ((void) 0)
7026 # endif
7027 
7028 # define ENABLE_RD1_CN_INTERRUPT() (RXY_GPIO_CNIE(RD1_CN) = 1)
7029 # define DISABLE_RD1_CN_INTERRUPT() (RXY_GPIO_CNIE(RD1_CN) = 0)
7030 
7031 # else
7032 # define DISABLE_RD1_PULLUP() ((void) 0)
7033 # define DISABLE_RD1_PULLDOWN() ((void) 0)
7034 # define DISABLE_RD1_CN_INTERRUPT() ((void) 0)
7035 # endif
7036 
7037 // High-level config
7038 // -----------------
7039 /** This macro disables pullups/downs, enables analog functionality, and configures
7040  * pin RD1 as an input.
7041  */
7042 # if defined(_ANSD1) || defined(RD1_AN) || defined(__DOXYGEN__)
7043 # define CONFIG_RD1_AS_ANALOG() \
7044  do { \
7045  ENABLE_RD1_ANALOG(); \
7046  CONFIG_RD1_AS_INPUT(); \
7047  DISABLE_RD1_OPENDRAIN(); \
7048  DISABLE_RD1_PULLUP(); \
7049  DISABLE_RD1_PULLDOWN(); \
7050  } while (0)
7051 # endif
7052 
7053 /** This macro disables open-drain and pullups/downs,
7054  * configures pin RD1 for digital (not analog) operation, and
7055  * configures the pin as an input.
7056  */
7057 # define CONFIG_RD1_AS_DIG_INPUT() \
7058  do { \
7059  DISABLE_RD1_ANALOG(); \
7060  CONFIG_RD1_AS_INPUT(); \
7061  DISABLE_RD1_OPENDRAIN(); \
7062  DISABLE_RD1_PULLUP(); \
7063  DISABLE_RD1_PULLDOWN(); \
7064  } while (0)
7065 
7066 /** This macro disables open-drain and pullups/downs,
7067  * configures pin RD1 for digital (not analog) operation, and
7068  * configures the pin as an output.
7069  */
7070 # define CONFIG_RD1_AS_DIG_OUTPUT() \
7071  do { \
7072  DISABLE_RD1_ANALOG(); \
7073  CONFIG_RD1_AS_OUTPUT(); \
7074  DISABLE_RD1_OPENDRAIN(); \
7075  DISABLE_RD1_PULLUP(); \
7076  DISABLE_RD1_PULLDOWN(); \
7077  } while (0)
7078 
7079 #endif // #if defined(_RD1) || defined(__DOXYGEN__): Provide GPIO for RD1
7080 
7081 
7082 
7083 
7084 
7085 // Provide GPIO for RD2
7086 // ====================
7087 #if defined(_RD2) || defined(__DOXYGEN__)
7088 
7089 // Dummy macros for documentation only
7090 # ifdef __DOXYGEN__
7091 /// This macro specifies the RPy value associated with pin RD2.
7092 /// Its device-specific definition is given in pic24_ports_mapping.h.
7093 # define RD2_RP xx
7094 
7095 /// This macro specifies the ANn value associated with pin RD2.
7096 /// Its device-specific definition is given in pic24_ports_mapping.h.
7097 # define RD2_AN xx
7098 
7099 /// This macro specifies the CNm value associated with pin RD2.
7100 /// Its device-specific definition is given in pic24_ports_mapping.h.
7101 # define RD2_CN xx
7102 
7103 //@}
7104 # endif // #ifdef __DOXYGEN__
7105 
7106 
7107 // Low-level config
7108 // ----------------
7109 // Analog:
7110 # if defined(_ANSD2) || defined(__DOXYGEN__)
7111 /// Enable analog functionality on pin RD2.
7112 # define ENABLE_RD2_ANALOG() (_ANSD2 = 1)
7113 /// Disable analog functionality on pin RD2.
7114 # define DISABLE_RD2_ANALOG() (_ANSD2 = 0)
7115 # elif defined(RD2_AN)
7116 # define ENABLE_RD2_ANALOG() (RXY_GPIO_PCFG(RD2_AN) = 0)
7117 # define DISABLE_RD2_ANALOG() (RXY_GPIO_PCFG(RD2_AN) = 1)
7118 # else
7119 # define DISABLE_RD2_ANALOG() ((void) 0)
7120 # endif
7121 
7122 // Input/output:
7123 /// Configure pin RD2 as an input.
7124 # define CONFIG_RD2_AS_INPUT() (_TRISD2 = 1)
7125 /// Configure pin RD2 as an output.
7126 # define CONFIG_RD2_AS_OUTPUT() (_TRISD2 = 0)
7127 
7128 // Open-drain:
7129 # if defined(_ODCD2) || defined(__DOXYGEN__)
7130 /// Enable the open-drain driver on pin RD2.
7131 # define ENABLE_RD2_OPENDRAIN() (_ODCD2 = 1)
7132 /// Disable the open-drain driver on pin RD2.
7133 # define DISABLE_RD2_OPENDRAIN() (_ODCD2 = 0)
7134 # elif defined(_ODD2) // The PIF24F names this bit _OD instead of _ODC.
7135 # define ENABLE_RD2_OPENDRAIN() (_ODD2 = 1)
7136 # define DISABLE_RD2_OPENDRAIN() (_ODD2 = 0)
7137 # else
7138 # define DISABLE_RD2_OPENDRAIN() ((void) 0)
7139 # endif
7140 
7141 // Change notification, pullups and pulldowns:
7142 # if defined(_CNIED2) || defined(__DOXYGEN__)
7143 /// Enable the pullup on pin RD2.
7144 # define ENABLE_RD2_PULLUP() (_CNPUD2 = 1)
7145 /// Disable the pullup on pin RD2.
7146 # define DISABLE_RD2_PULLUP() (_CNPUD2 = 0)
7147 
7148 /// Enable the pulldown on pin RD2.
7149 # define ENABLE_RD2_PULLDOWN() (_CNPDD2 = 1)
7150 /// Disable the pulldown on pin RD2.
7151 # define DISABLE_RD2_PULLDOWN() (_CNPDD2 = 0)
7152 
7153 /// Enable the change notification interrupt on pin RD2.
7154 # define ENABLE_RD2_CN_INTERRUPT() (_CNIED2 = 1)
7155 /// Disable the change notification interrupt on pin RD2.
7156 # define DISABLE_RD2_CN_INTERRUPT() (_CNIED2 = 0)
7157 
7158 # elif defined(RD2_CN)
7159 # define ENABLE_RD2_PULLUP() (RXY_GPIO_CNPUE(RD2_CN) = 1)
7160 # define DISABLE_RD2_PULLUP() (RXY_GPIO_CNPUE(RD2_CN) = 0)
7161 
7162 # if RXY_HAS_CNPDE(RD2_CN)
7163 # define ENABLE_RD2_PULLDOWN() (RXY_GPIO_CNPDE(RD2_CN) = 1)
7164 # define DISABLE_RD2_PULLDOWN() (RXY_GPIO_CNPDE(RD2_CN) = 0)
7165 # else
7166 # define DISABLE_RD2_PULLDOWN() ((void) 0)
7167 # endif
7168 
7169 # define ENABLE_RD2_CN_INTERRUPT() (RXY_GPIO_CNIE(RD2_CN) = 1)
7170 # define DISABLE_RD2_CN_INTERRUPT() (RXY_GPIO_CNIE(RD2_CN) = 0)
7171 
7172 # else
7173 # define DISABLE_RD2_PULLUP() ((void) 0)
7174 # define DISABLE_RD2_PULLDOWN() ((void) 0)
7175 # define DISABLE_RD2_CN_INTERRUPT() ((void) 0)
7176 # endif
7177 
7178 // High-level config
7179 // -----------------
7180 /** This macro disables pullups/downs, enables analog functionality, and configures
7181  * pin RD2 as an input.
7182  */
7183 # if defined(_ANSD2) || defined(RD2_AN) || defined(__DOXYGEN__)
7184 # define CONFIG_RD2_AS_ANALOG() \
7185  do { \
7186  ENABLE_RD2_ANALOG(); \
7187  CONFIG_RD2_AS_INPUT(); \
7188  DISABLE_RD2_OPENDRAIN(); \
7189  DISABLE_RD2_PULLUP(); \
7190  DISABLE_RD2_PULLDOWN(); \
7191  } while (0)
7192 # endif
7193 
7194 /** This macro disables open-drain and pullups/downs,
7195  * configures pin RD2 for digital (not analog) operation, and
7196  * configures the pin as an input.
7197  */
7198 # define CONFIG_RD2_AS_DIG_INPUT() \
7199  do { \
7200  DISABLE_RD2_ANALOG(); \
7201  CONFIG_RD2_AS_INPUT(); \
7202  DISABLE_RD2_OPENDRAIN(); \
7203  DISABLE_RD2_PULLUP(); \
7204  DISABLE_RD2_PULLDOWN(); \
7205  } while (0)
7206 
7207 /** This macro disables open-drain and pullups/downs,
7208  * configures pin RD2 for digital (not analog) operation, and
7209  * configures the pin as an output.
7210  */
7211 # define CONFIG_RD2_AS_DIG_OUTPUT() \
7212  do { \
7213  DISABLE_RD2_ANALOG(); \
7214  CONFIG_RD2_AS_OUTPUT(); \
7215  DISABLE_RD2_OPENDRAIN(); \
7216  DISABLE_RD2_PULLUP(); \
7217  DISABLE_RD2_PULLDOWN(); \
7218  } while (0)
7219 
7220 #endif // #if defined(_RD2) || defined(__DOXYGEN__): Provide GPIO for RD2
7221 
7222 
7223 
7224 
7225 
7226 // Provide GPIO for RD3
7227 // ====================
7228 #if defined(_RD3) || defined(__DOXYGEN__)
7229 
7230 // Dummy macros for documentation only
7231 # ifdef __DOXYGEN__
7232 /// This macro specifies the RPy value associated with pin RD3.
7233 /// Its device-specific definition is given in pic24_ports_mapping.h.
7234 # define RD3_RP xx
7235 
7236 /// This macro specifies the ANn value associated with pin RD3.
7237 /// Its device-specific definition is given in pic24_ports_mapping.h.
7238 # define RD3_AN xx
7239 
7240 /// This macro specifies the CNm value associated with pin RD3.
7241 /// Its device-specific definition is given in pic24_ports_mapping.h.
7242 # define RD3_CN xx
7243 
7244 //@}
7245 # endif // #ifdef __DOXYGEN__
7246 
7247 
7248 // Low-level config
7249 // ----------------
7250 // Analog:
7251 # if defined(_ANSD3) || defined(__DOXYGEN__)
7252 /// Enable analog functionality on pin RD3.
7253 # define ENABLE_RD3_ANALOG() (_ANSD3 = 1)
7254 /// Disable analog functionality on pin RD3.
7255 # define DISABLE_RD3_ANALOG() (_ANSD3 = 0)
7256 # elif defined(RD3_AN)
7257 # define ENABLE_RD3_ANALOG() (RXY_GPIO_PCFG(RD3_AN) = 0)
7258 # define DISABLE_RD3_ANALOG() (RXY_GPIO_PCFG(RD3_AN) = 1)
7259 # else
7260 # define DISABLE_RD3_ANALOG() ((void) 0)
7261 # endif
7262 
7263 // Input/output:
7264 /// Configure pin RD3 as an input.
7265 # define CONFIG_RD3_AS_INPUT() (_TRISD3 = 1)
7266 /// Configure pin RD3 as an output.
7267 # define CONFIG_RD3_AS_OUTPUT() (_TRISD3 = 0)
7268 
7269 // Open-drain:
7270 # if defined(_ODCD3) || defined(__DOXYGEN__)
7271 /// Enable the open-drain driver on pin RD3.
7272 # define ENABLE_RD3_OPENDRAIN() (_ODCD3 = 1)
7273 /// Disable the open-drain driver on pin RD3.
7274 # define DISABLE_RD3_OPENDRAIN() (_ODCD3 = 0)
7275 # elif defined(_ODD3) // The PIF24F names this bit _OD instead of _ODC.
7276 # define ENABLE_RD3_OPENDRAIN() (_ODD3 = 1)
7277 # define DISABLE_RD3_OPENDRAIN() (_ODD3 = 0)
7278 # else
7279 # define DISABLE_RD3_OPENDRAIN() ((void) 0)
7280 # endif
7281 
7282 // Change notification, pullups and pulldowns:
7283 # if defined(_CNIED3) || defined(__DOXYGEN__)
7284 /// Enable the pullup on pin RD3.
7285 # define ENABLE_RD3_PULLUP() (_CNPUD3 = 1)
7286 /// Disable the pullup on pin RD3.
7287 # define DISABLE_RD3_PULLUP() (_CNPUD3 = 0)
7288 
7289 /// Enable the pulldown on pin RD3.
7290 # define ENABLE_RD3_PULLDOWN() (_CNPDD3 = 1)
7291 /// Disable the pulldown on pin RD3.
7292 # define DISABLE_RD3_PULLDOWN() (_CNPDD3 = 0)
7293 
7294 /// Enable the change notification interrupt on pin RD3.
7295 # define ENABLE_RD3_CN_INTERRUPT() (_CNIED3 = 1)
7296 /// Disable the change notification interrupt on pin RD3.
7297 # define DISABLE_RD3_CN_INTERRUPT() (_CNIED3 = 0)
7298 
7299 # elif defined(RD3_CN)
7300 # define ENABLE_RD3_PULLUP() (RXY_GPIO_CNPUE(RD3_CN) = 1)
7301 # define DISABLE_RD3_PULLUP() (RXY_GPIO_CNPUE(RD3_CN) = 0)
7302 
7303 # if RXY_HAS_CNPDE(RD3_CN)
7304 # define ENABLE_RD3_PULLDOWN() (RXY_GPIO_CNPDE(RD3_CN) = 1)
7305 # define DISABLE_RD3_PULLDOWN() (RXY_GPIO_CNPDE(RD3_CN) = 0)
7306 # else
7307 # define DISABLE_RD3_PULLDOWN() ((void) 0)
7308 # endif
7309 
7310 # define ENABLE_RD3_CN_INTERRUPT() (RXY_GPIO_CNIE(RD3_CN) = 1)
7311 # define DISABLE_RD3_CN_INTERRUPT() (RXY_GPIO_CNIE(RD3_CN) = 0)
7312 
7313 # else
7314 # define DISABLE_RD3_PULLUP() ((void) 0)
7315 # define DISABLE_RD3_PULLDOWN() ((void) 0)
7316 # define DISABLE_RD3_CN_INTERRUPT() ((void) 0)
7317 # endif
7318 
7319 // High-level config
7320 // -----------------
7321 /** This macro disables pullups/downs, enables analog functionality, and configures
7322  * pin RD3 as an input.
7323  */
7324 # if defined(_ANSD3) || defined(RD3_AN) || defined(__DOXYGEN__)
7325 # define CONFIG_RD3_AS_ANALOG() \
7326  do { \
7327  ENABLE_RD3_ANALOG(); \
7328  CONFIG_RD3_AS_INPUT(); \
7329  DISABLE_RD3_OPENDRAIN(); \
7330  DISABLE_RD3_PULLUP(); \
7331  DISABLE_RD3_PULLDOWN(); \
7332  } while (0)
7333 # endif
7334 
7335 /** This macro disables open-drain and pullups/downs,
7336  * configures pin RD3 for digital (not analog) operation, and
7337  * configures the pin as an input.
7338  */
7339 # define CONFIG_RD3_AS_DIG_INPUT() \
7340  do { \
7341  DISABLE_RD3_ANALOG(); \
7342  CONFIG_RD3_AS_INPUT(); \
7343  DISABLE_RD3_OPENDRAIN(); \
7344  DISABLE_RD3_PULLUP(); \
7345  DISABLE_RD3_PULLDOWN(); \
7346  } while (0)
7347 
7348 /** This macro disables open-drain and pullups/downs,
7349  * configures pin RD3 for digital (not analog) operation, and
7350  * configures the pin as an output.
7351  */
7352 # define CONFIG_RD3_AS_DIG_OUTPUT() \
7353  do { \
7354  DISABLE_RD3_ANALOG(); \
7355  CONFIG_RD3_AS_OUTPUT(); \
7356  DISABLE_RD3_OPENDRAIN(); \
7357  DISABLE_RD3_PULLUP(); \
7358  DISABLE_RD3_PULLDOWN(); \
7359  } while (0)
7360 
7361 #endif // #if defined(_RD3) || defined(__DOXYGEN__): Provide GPIO for RD3
7362 
7363 
7364 
7365 
7366 
7367 // Provide GPIO for RD4
7368 // ====================
7369 #if defined(_RD4) || defined(__DOXYGEN__)
7370 
7371 // Dummy macros for documentation only
7372 # ifdef __DOXYGEN__
7373 /// This macro specifies the RPy value associated with pin RD4.
7374 /// Its device-specific definition is given in pic24_ports_mapping.h.
7375 # define RD4_RP xx
7376 
7377 /// This macro specifies the ANn value associated with pin RD4.
7378 /// Its device-specific definition is given in pic24_ports_mapping.h.
7379 # define RD4_AN xx
7380 
7381 /// This macro specifies the CNm value associated with pin RD4.
7382 /// Its device-specific definition is given in pic24_ports_mapping.h.
7383 # define RD4_CN xx
7384 
7385 //@}
7386 # endif // #ifdef __DOXYGEN__
7387 
7388 
7389 // Low-level config
7390 // ----------------
7391 // Analog:
7392 # if defined(_ANSD4) || defined(__DOXYGEN__)
7393 /// Enable analog functionality on pin RD4.
7394 # define ENABLE_RD4_ANALOG() (_ANSD4 = 1)
7395 /// Disable analog functionality on pin RD4.
7396 # define DISABLE_RD4_ANALOG() (_ANSD4 = 0)
7397 # elif defined(RD4_AN)
7398 # define ENABLE_RD4_ANALOG() (RXY_GPIO_PCFG(RD4_AN) = 0)
7399 # define DISABLE_RD4_ANALOG() (RXY_GPIO_PCFG(RD4_AN) = 1)
7400 # else
7401 # define DISABLE_RD4_ANALOG() ((void) 0)
7402 # endif
7403 
7404 // Input/output:
7405 /// Configure pin RD4 as an input.
7406 # define CONFIG_RD4_AS_INPUT() (_TRISD4 = 1)
7407 /// Configure pin RD4 as an output.
7408 # define CONFIG_RD4_AS_OUTPUT() (_TRISD4 = 0)
7409 
7410 // Open-drain:
7411 # if defined(_ODCD4) || defined(__DOXYGEN__)
7412 /// Enable the open-drain driver on pin RD4.
7413 # define ENABLE_RD4_OPENDRAIN() (_ODCD4 = 1)
7414 /// Disable the open-drain driver on pin RD4.
7415 # define DISABLE_RD4_OPENDRAIN() (_ODCD4 = 0)
7416 # elif defined(_ODD4) // The PIF24F names this bit _OD instead of _ODC.
7417 # define ENABLE_RD4_OPENDRAIN() (_ODD4 = 1)
7418 # define DISABLE_RD4_OPENDRAIN() (_ODD4 = 0)
7419 # else
7420 # define DISABLE_RD4_OPENDRAIN() ((void) 0)
7421 # endif
7422 
7423 // Change notification, pullups and pulldowns:
7424 # if defined(_CNIED4) || defined(__DOXYGEN__)
7425 /// Enable the pullup on pin RD4.
7426 # define ENABLE_RD4_PULLUP() (_CNPUD4 = 1)
7427 /// Disable the pullup on pin RD4.
7428 # define DISABLE_RD4_PULLUP() (_CNPUD4 = 0)
7429 
7430 /// Enable the pulldown on pin RD4.
7431 # define ENABLE_RD4_PULLDOWN() (_CNPDD4 = 1)
7432 /// Disable the pulldown on pin RD4.
7433 # define DISABLE_RD4_PULLDOWN() (_CNPDD4 = 0)
7434 
7435 /// Enable the change notification interrupt on pin RD4.
7436 # define ENABLE_RD4_CN_INTERRUPT() (_CNIED4 = 1)
7437 /// Disable the change notification interrupt on pin RD4.
7438 # define DISABLE_RD4_CN_INTERRUPT() (_CNIED4 = 0)
7439 
7440 # elif defined(RD4_CN)
7441 # define ENABLE_RD4_PULLUP() (RXY_GPIO_CNPUE(RD4_CN) = 1)
7442 # define DISABLE_RD4_PULLUP() (RXY_GPIO_CNPUE(RD4_CN) = 0)
7443 
7444 # if RXY_HAS_CNPDE(RD4_CN)
7445 # define ENABLE_RD4_PULLDOWN() (RXY_GPIO_CNPDE(RD4_CN) = 1)
7446 # define DISABLE_RD4_PULLDOWN() (RXY_GPIO_CNPDE(RD4_CN) = 0)
7447 # else
7448 # define DISABLE_RD4_PULLDOWN() ((void) 0)
7449 # endif
7450 
7451 # define ENABLE_RD4_CN_INTERRUPT() (RXY_GPIO_CNIE(RD4_CN) = 1)
7452 # define DISABLE_RD4_CN_INTERRUPT() (RXY_GPIO_CNIE(RD4_CN) = 0)
7453 
7454 # else
7455 # define DISABLE_RD4_PULLUP() ((void) 0)
7456 # define DISABLE_RD4_PULLDOWN() ((void) 0)
7457 # define DISABLE_RD4_CN_INTERRUPT() ((void) 0)
7458 # endif
7459 
7460 // High-level config
7461 // -----------------
7462 /** This macro disables pullups/downs, enables analog functionality, and configures
7463  * pin RD4 as an input.
7464  */
7465 # if defined(_ANSD4) || defined(RD4_AN) || defined(__DOXYGEN__)
7466 # define CONFIG_RD4_AS_ANALOG() \
7467  do { \
7468  ENABLE_RD4_ANALOG(); \
7469  CONFIG_RD4_AS_INPUT(); \
7470  DISABLE_RD4_OPENDRAIN(); \
7471  DISABLE_RD4_PULLUP(); \
7472  DISABLE_RD4_PULLDOWN(); \
7473  } while (0)
7474 # endif
7475 
7476 /** This macro disables open-drain and pullups/downs,
7477  * configures pin RD4 for digital (not analog) operation, and
7478  * configures the pin as an input.
7479  */
7480 # define CONFIG_RD4_AS_DIG_INPUT() \
7481  do { \
7482  DISABLE_RD4_ANALOG(); \
7483  CONFIG_RD4_AS_INPUT(); \
7484  DISABLE_RD4_OPENDRAIN(); \
7485  DISABLE_RD4_PULLUP(); \
7486  DISABLE_RD4_PULLDOWN(); \
7487  } while (0)
7488 
7489 /** This macro disables open-drain and pullups/downs,
7490  * configures pin RD4 for digital (not analog) operation, and
7491  * configures the pin as an output.
7492  */
7493 # define CONFIG_RD4_AS_DIG_OUTPUT() \
7494  do { \
7495  DISABLE_RD4_ANALOG(); \
7496  CONFIG_RD4_AS_OUTPUT(); \
7497  DISABLE_RD4_OPENDRAIN(); \
7498  DISABLE_RD4_PULLUP(); \
7499  DISABLE_RD4_PULLDOWN(); \
7500  } while (0)
7501 
7502 #endif // #if defined(_RD4) || defined(__DOXYGEN__): Provide GPIO for RD4
7503 
7504 
7505 
7506 
7507 
7508 // Provide GPIO for RD5
7509 // ====================
7510 #if defined(_RD5) || defined(__DOXYGEN__)
7511 
7512 // Dummy macros for documentation only
7513 # ifdef __DOXYGEN__
7514 /// This macro specifies the RPy value associated with pin RD5.
7515 /// Its device-specific definition is given in pic24_ports_mapping.h.
7516 # define RD5_RP xx
7517 
7518 /// This macro specifies the ANn value associated with pin RD5.
7519 /// Its device-specific definition is given in pic24_ports_mapping.h.
7520 # define RD5_AN xx
7521 
7522 /// This macro specifies the CNm value associated with pin RD5.
7523 /// Its device-specific definition is given in pic24_ports_mapping.h.
7524 # define RD5_CN xx
7525 
7526 //@}
7527 # endif // #ifdef __DOXYGEN__
7528 
7529 
7530 // Low-level config
7531 // ----------------
7532 // Analog:
7533 # if defined(_ANSD5) || defined(__DOXYGEN__)
7534 /// Enable analog functionality on pin RD5.
7535 # define ENABLE_RD5_ANALOG() (_ANSD5 = 1)
7536 /// Disable analog functionality on pin RD5.
7537 # define DISABLE_RD5_ANALOG() (_ANSD5 = 0)
7538 # elif defined(RD5_AN)
7539 # define ENABLE_RD5_ANALOG() (RXY_GPIO_PCFG(RD5_AN) = 0)
7540 # define DISABLE_RD5_ANALOG() (RXY_GPIO_PCFG(RD5_AN) = 1)
7541 # else
7542 # define DISABLE_RD5_ANALOG() ((void) 0)
7543 # endif
7544 
7545 // Input/output:
7546 /// Configure pin RD5 as an input.
7547 # define CONFIG_RD5_AS_INPUT() (_TRISD5 = 1)
7548 /// Configure pin RD5 as an output.
7549 # define CONFIG_RD5_AS_OUTPUT() (_TRISD5 = 0)
7550 
7551 // Open-drain:
7552 # if defined(_ODCD5) || defined(__DOXYGEN__)
7553 /// Enable the open-drain driver on pin RD5.
7554 # define ENABLE_RD5_OPENDRAIN() (_ODCD5 = 1)
7555 /// Disable the open-drain driver on pin RD5.
7556 # define DISABLE_RD5_OPENDRAIN() (_ODCD5 = 0)
7557 # elif defined(_ODD5) // The PIF24F names this bit _OD instead of _ODC.
7558 # define ENABLE_RD5_OPENDRAIN() (_ODD5 = 1)
7559 # define DISABLE_RD5_OPENDRAIN() (_ODD5 = 0)
7560 # else
7561 # define DISABLE_RD5_OPENDRAIN() ((void) 0)
7562 # endif
7563 
7564 // Change notification, pullups and pulldowns:
7565 # if defined(_CNIED5) || defined(__DOXYGEN__)
7566 /// Enable the pullup on pin RD5.
7567 # define ENABLE_RD5_PULLUP() (_CNPUD5 = 1)
7568 /// Disable the pullup on pin RD5.
7569 # define DISABLE_RD5_PULLUP() (_CNPUD5 = 0)
7570 
7571 /// Enable the pulldown on pin RD5.
7572 # define ENABLE_RD5_PULLDOWN() (_CNPDD5 = 1)
7573 /// Disable the pulldown on pin RD5.
7574 # define DISABLE_RD5_PULLDOWN() (_CNPDD5 = 0)
7575 
7576 /// Enable the change notification interrupt on pin RD5.
7577 # define ENABLE_RD5_CN_INTERRUPT() (_CNIED5 = 1)
7578 /// Disable the change notification interrupt on pin RD5.
7579 # define DISABLE_RD5_CN_INTERRUPT() (_CNIED5 = 0)
7580 
7581 # elif defined(RD5_CN)
7582 # define ENABLE_RD5_PULLUP() (RXY_GPIO_CNPUE(RD5_CN) = 1)
7583 # define DISABLE_RD5_PULLUP() (RXY_GPIO_CNPUE(RD5_CN) = 0)
7584 
7585 # if RXY_HAS_CNPDE(RD5_CN)
7586 # define ENABLE_RD5_PULLDOWN() (RXY_GPIO_CNPDE(RD5_CN) = 1)
7587 # define DISABLE_RD5_PULLDOWN() (RXY_GPIO_CNPDE(RD5_CN) = 0)
7588 # else
7589 # define DISABLE_RD5_PULLDOWN() ((void) 0)
7590 # endif
7591 
7592 # define ENABLE_RD5_CN_INTERRUPT() (RXY_GPIO_CNIE(RD5_CN) = 1)
7593 # define DISABLE_RD5_CN_INTERRUPT() (RXY_GPIO_CNIE(RD5_CN) = 0)
7594 
7595 # else
7596 # define DISABLE_RD5_PULLUP() ((void) 0)
7597 # define DISABLE_RD5_PULLDOWN() ((void) 0)
7598 # define DISABLE_RD5_CN_INTERRUPT() ((void) 0)
7599 # endif
7600 
7601 // High-level config
7602 // -----------------
7603 /** This macro disables pullups/downs, enables analog functionality, and configures
7604  * pin RD5 as an input.
7605  */
7606 # if defined(_ANSD5) || defined(RD5_AN) || defined(__DOXYGEN__)
7607 # define CONFIG_RD5_AS_ANALOG() \
7608  do { \
7609  ENABLE_RD5_ANALOG(); \
7610  CONFIG_RD5_AS_INPUT(); \
7611  DISABLE_RD5_OPENDRAIN(); \
7612  DISABLE_RD5_PULLUP(); \
7613  DISABLE_RD5_PULLDOWN(); \
7614  } while (0)
7615 # endif
7616 
7617 /** This macro disables open-drain and pullups/downs,
7618  * configures pin RD5 for digital (not analog) operation, and
7619  * configures the pin as an input.
7620  */
7621 # define CONFIG_RD5_AS_DIG_INPUT() \
7622  do { \
7623  DISABLE_RD5_ANALOG(); \
7624  CONFIG_RD5_AS_INPUT(); \
7625  DISABLE_RD5_OPENDRAIN(); \
7626  DISABLE_RD5_PULLUP(); \
7627  DISABLE_RD5_PULLDOWN(); \
7628  } while (0)
7629 
7630 /** This macro disables open-drain and pullups/downs,
7631  * configures pin RD5 for digital (not analog) operation, and
7632  * configures the pin as an output.
7633  */
7634 # define CONFIG_RD5_AS_DIG_OUTPUT() \
7635  do { \
7636  DISABLE_RD5_ANALOG(); \
7637  CONFIG_RD5_AS_OUTPUT(); \
7638  DISABLE_RD5_OPENDRAIN(); \
7639  DISABLE_RD5_PULLUP(); \
7640  DISABLE_RD5_PULLDOWN(); \
7641  } while (0)
7642 
7643 #endif // #if defined(_RD5) || defined(__DOXYGEN__): Provide GPIO for RD5
7644 
7645 
7646 
7647 
7648 
7649 // Provide GPIO for RD6
7650 // ====================
7651 #if defined(_RD6) || defined(__DOXYGEN__)
7652 
7653 // Dummy macros for documentation only
7654 # ifdef __DOXYGEN__
7655 /// This macro specifies the RPy value associated with pin RD6.
7656 /// Its device-specific definition is given in pic24_ports_mapping.h.
7657 # define RD6_RP xx
7658 
7659 /// This macro specifies the ANn value associated with pin RD6.
7660 /// Its device-specific definition is given in pic24_ports_mapping.h.
7661 # define RD6_AN xx
7662 
7663 /// This macro specifies the CNm value associated with pin RD6.
7664 /// Its device-specific definition is given in pic24_ports_mapping.h.
7665 # define RD6_CN xx
7666 
7667 //@}
7668 # endif // #ifdef __DOXYGEN__
7669 
7670 
7671 // Low-level config
7672 // ----------------
7673 // Analog:
7674 # if defined(_ANSD6) || defined(__DOXYGEN__)
7675 /// Enable analog functionality on pin RD6.
7676 # define ENABLE_RD6_ANALOG() (_ANSD6 = 1)
7677 /// Disable analog functionality on pin RD6.
7678 # define DISABLE_RD6_ANALOG() (_ANSD6 = 0)
7679 # elif defined(RD6_AN)
7680 # define ENABLE_RD6_ANALOG() (RXY_GPIO_PCFG(RD6_AN) = 0)
7681 # define DISABLE_RD6_ANALOG() (RXY_GPIO_PCFG(RD6_AN) = 1)
7682 # else
7683 # define DISABLE_RD6_ANALOG() ((void) 0)
7684 # endif
7685 
7686 // Input/output:
7687 /// Configure pin RD6 as an input.
7688 # define CONFIG_RD6_AS_INPUT() (_TRISD6 = 1)
7689 /// Configure pin RD6 as an output.
7690 # define CONFIG_RD6_AS_OUTPUT() (_TRISD6 = 0)
7691 
7692 // Open-drain:
7693 # if defined(_ODCD6) || defined(__DOXYGEN__)
7694 /// Enable the open-drain driver on pin RD6.
7695 # define ENABLE_RD6_OPENDRAIN() (_ODCD6 = 1)
7696 /// Disable the open-drain driver on pin RD6.
7697 # define DISABLE_RD6_OPENDRAIN() (_ODCD6 = 0)
7698 # elif defined(_ODD6) // The PIF24F names this bit _OD instead of _ODC.
7699 # define ENABLE_RD6_OPENDRAIN() (_ODD6 = 1)
7700 # define DISABLE_RD6_OPENDRAIN() (_ODD6 = 0)
7701 # else
7702 # define DISABLE_RD6_OPENDRAIN() ((void) 0)
7703 # endif
7704 
7705 // Change notification, pullups and pulldowns:
7706 # if defined(_CNIED6) || defined(__DOXYGEN__)
7707 /// Enable the pullup on pin RD6.
7708 # define ENABLE_RD6_PULLUP() (_CNPUD6 = 1)
7709 /// Disable the pullup on pin RD6.
7710 # define DISABLE_RD6_PULLUP() (_CNPUD6 = 0)
7711 
7712 /// Enable the pulldown on pin RD6.
7713 # define ENABLE_RD6_PULLDOWN() (_CNPDD6 = 1)
7714 /// Disable the pulldown on pin RD6.
7715 # define DISABLE_RD6_PULLDOWN() (_CNPDD6 = 0)
7716 
7717 /// Enable the change notification interrupt on pin RD6.
7718 # define ENABLE_RD6_CN_INTERRUPT() (_CNIED6 = 1)
7719 /// Disable the change notification interrupt on pin RD6.
7720 # define DISABLE_RD6_CN_INTERRUPT() (_CNIED6 = 0)
7721 
7722 # elif defined(RD6_CN)
7723 # define ENABLE_RD6_PULLUP() (RXY_GPIO_CNPUE(RD6_CN) = 1)
7724 # define DISABLE_RD6_PULLUP() (RXY_GPIO_CNPUE(RD6_CN) = 0)
7725 
7726 # if RXY_HAS_CNPDE(RD6_CN)
7727 # define ENABLE_RD6_PULLDOWN() (RXY_GPIO_CNPDE(RD6_CN) = 1)
7728 # define DISABLE_RD6_PULLDOWN() (RXY_GPIO_CNPDE(RD6_CN) = 0)
7729 # else
7730 # define DISABLE_RD6_PULLDOWN() ((void) 0)
7731 # endif
7732 
7733 # define ENABLE_RD6_CN_INTERRUPT() (RXY_GPIO_CNIE(RD6_CN) = 1)
7734 # define DISABLE_RD6_CN_INTERRUPT() (RXY_GPIO_CNIE(RD6_CN) = 0)
7735 
7736 # else
7737 # define DISABLE_RD6_PULLUP() ((void) 0)
7738 # define DISABLE_RD6_PULLDOWN() ((void) 0)
7739 # define DISABLE_RD6_CN_INTERRUPT() ((void) 0)
7740 # endif
7741 
7742 // High-level config
7743 // -----------------
7744 /** This macro disables pullups/downs, enables analog functionality, and configures
7745  * pin RD6 as an input.
7746  */
7747 # if defined(_ANSD6) || defined(RD6_AN) || defined(__DOXYGEN__)
7748 # define CONFIG_RD6_AS_ANALOG() \
7749  do { \
7750  ENABLE_RD6_ANALOG(); \
7751  CONFIG_RD6_AS_INPUT(); \
7752  DISABLE_RD6_OPENDRAIN(); \
7753  DISABLE_RD6_PULLUP(); \
7754  DISABLE_RD6_PULLDOWN(); \
7755  } while (0)
7756 # endif
7757 
7758 /** This macro disables open-drain and pullups/downs,
7759  * configures pin RD6 for digital (not analog) operation, and
7760  * configures the pin as an input.
7761  */
7762 # define CONFIG_RD6_AS_DIG_INPUT() \
7763  do { \
7764  DISABLE_RD6_ANALOG(); \
7765  CONFIG_RD6_AS_INPUT(); \
7766  DISABLE_RD6_OPENDRAIN(); \
7767  DISABLE_RD6_PULLUP(); \
7768  DISABLE_RD6_PULLDOWN(); \
7769  } while (0)
7770 
7771 /** This macro disables open-drain and pullups/downs,
7772  * configures pin RD6 for digital (not analog) operation, and
7773  * configures the pin as an output.
7774  */
7775 # define CONFIG_RD6_AS_DIG_OUTPUT() \
7776  do { \
7777  DISABLE_RD6_ANALOG(); \
7778  CONFIG_RD6_AS_OUTPUT(); \
7779  DISABLE_RD6_OPENDRAIN(); \
7780  DISABLE_RD6_PULLUP(); \
7781  DISABLE_RD6_PULLDOWN(); \
7782  } while (0)
7783 
7784 #endif // #if defined(_RD6) || defined(__DOXYGEN__): Provide GPIO for RD6
7785 
7786 
7787 
7788 
7789 
7790 // Provide GPIO for RD7
7791 // ====================
7792 #if defined(_RD7) || defined(__DOXYGEN__)
7793 
7794 // Dummy macros for documentation only
7795 # ifdef __DOXYGEN__
7796 /// This macro specifies the RPy value associated with pin RD7.
7797 /// Its device-specific definition is given in pic24_ports_mapping.h.
7798 # define RD7_RP xx
7799 
7800 /// This macro specifies the ANn value associated with pin RD7.
7801 /// Its device-specific definition is given in pic24_ports_mapping.h.
7802 # define RD7_AN xx
7803 
7804 /// This macro specifies the CNm value associated with pin RD7.
7805 /// Its device-specific definition is given in pic24_ports_mapping.h.
7806 # define RD7_CN xx
7807 
7808 //@}
7809 # endif // #ifdef __DOXYGEN__
7810 
7811 
7812 // Low-level config
7813 // ----------------
7814 // Analog:
7815 # if defined(_ANSD7) || defined(__DOXYGEN__)
7816 /// Enable analog functionality on pin RD7.
7817 # define ENABLE_RD7_ANALOG() (_ANSD7 = 1)
7818 /// Disable analog functionality on pin RD7.
7819 # define DISABLE_RD7_ANALOG() (_ANSD7 = 0)
7820 # elif defined(RD7_AN)
7821 # define ENABLE_RD7_ANALOG() (RXY_GPIO_PCFG(RD7_AN) = 0)
7822 # define DISABLE_RD7_ANALOG() (RXY_GPIO_PCFG(RD7_AN) = 1)
7823 # else
7824 # define DISABLE_RD7_ANALOG() ((void) 0)
7825 # endif
7826 
7827 // Input/output:
7828 /// Configure pin RD7 as an input.
7829 # define CONFIG_RD7_AS_INPUT() (_TRISD7 = 1)
7830 /// Configure pin RD7 as an output.
7831 # define CONFIG_RD7_AS_OUTPUT() (_TRISD7 = 0)
7832 
7833 // Open-drain:
7834 # if defined(_ODCD7) || defined(__DOXYGEN__)
7835 /// Enable the open-drain driver on pin RD7.
7836 # define ENABLE_RD7_OPENDRAIN() (_ODCD7 = 1)
7837 /// Disable the open-drain driver on pin RD7.
7838 # define DISABLE_RD7_OPENDRAIN() (_ODCD7 = 0)
7839 # elif defined(_ODD7) // The PIF24F names this bit _OD instead of _ODC.
7840 # define ENABLE_RD7_OPENDRAIN() (_ODD7 = 1)
7841 # define DISABLE_RD7_OPENDRAIN() (_ODD7 = 0)
7842 # else
7843 # define DISABLE_RD7_OPENDRAIN() ((void) 0)
7844 # endif
7845 
7846 // Change notification, pullups and pulldowns:
7847 # if defined(_CNIED7) || defined(__DOXYGEN__)
7848 /// Enable the pullup on pin RD7.
7849 # define ENABLE_RD7_PULLUP() (_CNPUD7 = 1)
7850 /// Disable the pullup on pin RD7.
7851 # define DISABLE_RD7_PULLUP() (_CNPUD7 = 0)
7852 
7853 /// Enable the pulldown on pin RD7.
7854 # define ENABLE_RD7_PULLDOWN() (_CNPDD7 = 1)
7855 /// Disable the pulldown on pin RD7.
7856 # define DISABLE_RD7_PULLDOWN() (_CNPDD7 = 0)
7857 
7858 /// Enable the change notification interrupt on pin RD7.
7859 # define ENABLE_RD7_CN_INTERRUPT() (_CNIED7 = 1)
7860 /// Disable the change notification interrupt on pin RD7.
7861 # define DISABLE_RD7_CN_INTERRUPT() (_CNIED7 = 0)
7862 
7863 # elif defined(RD7_CN)
7864 # define ENABLE_RD7_PULLUP() (RXY_GPIO_CNPUE(RD7_CN) = 1)
7865 # define DISABLE_RD7_PULLUP() (RXY_GPIO_CNPUE(RD7_CN) = 0)
7866 
7867 # if RXY_HAS_CNPDE(RD7_CN)
7868 # define ENABLE_RD7_PULLDOWN() (RXY_GPIO_CNPDE(RD7_CN) = 1)
7869 # define DISABLE_RD7_PULLDOWN() (RXY_GPIO_CNPDE(RD7_CN) = 0)
7870 # else
7871 # define DISABLE_RD7_PULLDOWN() ((void) 0)
7872 # endif
7873 
7874 # define ENABLE_RD7_CN_INTERRUPT() (RXY_GPIO_CNIE(RD7_CN) = 1)
7875 # define DISABLE_RD7_CN_INTERRUPT() (RXY_GPIO_CNIE(RD7_CN) = 0)
7876 
7877 # else
7878 # define DISABLE_RD7_PULLUP() ((void) 0)
7879 # define DISABLE_RD7_PULLDOWN() ((void) 0)
7880 # define DISABLE_RD7_CN_INTERRUPT() ((void) 0)
7881 # endif
7882 
7883 // High-level config
7884 // -----------------
7885 /** This macro disables pullups/downs, enables analog functionality, and configures
7886  * pin RD7 as an input.
7887  */
7888 # if defined(_ANSD7) || defined(RD7_AN) || defined(__DOXYGEN__)
7889 # define CONFIG_RD7_AS_ANALOG() \
7890  do { \
7891  ENABLE_RD7_ANALOG(); \
7892  CONFIG_RD7_AS_INPUT(); \
7893  DISABLE_RD7_OPENDRAIN(); \
7894  DISABLE_RD7_PULLUP(); \
7895  DISABLE_RD7_PULLDOWN(); \
7896  } while (0)
7897 # endif
7898 
7899 /** This macro disables open-drain and pullups/downs,
7900  * configures pin RD7 for digital (not analog) operation, and
7901  * configures the pin as an input.
7902  */
7903 # define CONFIG_RD7_AS_DIG_INPUT() \
7904  do { \
7905  DISABLE_RD7_ANALOG(); \
7906  CONFIG_RD7_AS_INPUT(); \
7907  DISABLE_RD7_OPENDRAIN(); \
7908  DISABLE_RD7_PULLUP(); \
7909  DISABLE_RD7_PULLDOWN(); \
7910  } while (0)
7911 
7912 /** This macro disables open-drain and pullups/downs,
7913  * configures pin RD7 for digital (not analog) operation, and
7914  * configures the pin as an output.
7915  */
7916 # define CONFIG_RD7_AS_DIG_OUTPUT() \
7917  do { \
7918  DISABLE_RD7_ANALOG(); \
7919  CONFIG_RD7_AS_OUTPUT(); \
7920  DISABLE_RD7_OPENDRAIN(); \
7921  DISABLE_RD7_PULLUP(); \
7922  DISABLE_RD7_PULLDOWN(); \
7923  } while (0)
7924 
7925 #endif // #if defined(_RD7) || defined(__DOXYGEN__): Provide GPIO for RD7
7926 
7927 
7928 
7929 
7930 
7931 // Provide GPIO for RD8
7932 // ====================
7933 #if defined(_RD8) || defined(__DOXYGEN__)
7934 
7935 // Dummy macros for documentation only
7936 # ifdef __DOXYGEN__
7937 /// This macro specifies the RPy value associated with pin RD8.
7938 /// Its device-specific definition is given in pic24_ports_mapping.h.
7939 # define RD8_RP xx
7940 
7941 /// This macro specifies the ANn value associated with pin RD8.
7942 /// Its device-specific definition is given in pic24_ports_mapping.h.
7943 # define RD8_AN xx
7944 
7945 /// This macro specifies the CNm value associated with pin RD8.
7946 /// Its device-specific definition is given in pic24_ports_mapping.h.
7947 # define RD8_CN xx
7948 
7949 //@}
7950 # endif // #ifdef __DOXYGEN__
7951 
7952 
7953 // Low-level config
7954 // ----------------
7955 // Analog:
7956 # if defined(_ANSD8) || defined(__DOXYGEN__)
7957 /// Enable analog functionality on pin RD8.
7958 # define ENABLE_RD8_ANALOG() (_ANSD8 = 1)
7959 /// Disable analog functionality on pin RD8.
7960 # define DISABLE_RD8_ANALOG() (_ANSD8 = 0)
7961 # elif defined(RD8_AN)
7962 # define ENABLE_RD8_ANALOG() (RXY_GPIO_PCFG(RD8_AN) = 0)
7963 # define DISABLE_RD8_ANALOG() (RXY_GPIO_PCFG(RD8_AN) = 1)
7964 # else
7965 # define DISABLE_RD8_ANALOG() ((void) 0)
7966 # endif
7967 
7968 // Input/output:
7969 /// Configure pin RD8 as an input.
7970 # define CONFIG_RD8_AS_INPUT() (_TRISD8 = 1)
7971 /// Configure pin RD8 as an output.
7972 # define CONFIG_RD8_AS_OUTPUT() (_TRISD8 = 0)
7973 
7974 // Open-drain:
7975 # if defined(_ODCD8) || defined(__DOXYGEN__)
7976 /// Enable the open-drain driver on pin RD8.
7977 # define ENABLE_RD8_OPENDRAIN() (_ODCD8 = 1)
7978 /// Disable the open-drain driver on pin RD8.
7979 # define DISABLE_RD8_OPENDRAIN() (_ODCD8 = 0)
7980 # elif defined(_ODD8) // The PIF24F names this bit _OD instead of _ODC.
7981 # define ENABLE_RD8_OPENDRAIN() (_ODD8 = 1)
7982 # define DISABLE_RD8_OPENDRAIN() (_ODD8 = 0)
7983 # else
7984 # define DISABLE_RD8_OPENDRAIN() ((void) 0)
7985 # endif
7986 
7987 // Change notification, pullups and pulldowns:
7988 # if defined(_CNIED8) || defined(__DOXYGEN__)
7989 /// Enable the pullup on pin RD8.
7990 # define ENABLE_RD8_PULLUP() (_CNPUD8 = 1)
7991 /// Disable the pullup on pin RD8.
7992 # define DISABLE_RD8_PULLUP() (_CNPUD8 = 0)
7993 
7994 /// Enable the pulldown on pin RD8.
7995 # define ENABLE_RD8_PULLDOWN() (_CNPDD8 = 1)
7996 /// Disable the pulldown on pin RD8.
7997 # define DISABLE_RD8_PULLDOWN() (_CNPDD8 = 0)
7998 
7999 /// Enable the change notification interrupt on pin RD8.
8000 # define ENABLE_RD8_CN_INTERRUPT() (_CNIED8 = 1)
8001 /// Disable the change notification interrupt on pin RD8.
8002 # define DISABLE_RD8_CN_INTERRUPT() (_CNIED8 = 0)
8003 
8004 # elif defined(RD8_CN)
8005 # define ENABLE_RD8_PULLUP() (RXY_GPIO_CNPUE(RD8_CN) = 1)
8006 # define DISABLE_RD8_PULLUP() (RXY_GPIO_CNPUE(RD8_CN) = 0)
8007 
8008 # if RXY_HAS_CNPDE(RD8_CN)
8009 # define ENABLE_RD8_PULLDOWN() (RXY_GPIO_CNPDE(RD8_CN) = 1)
8010 # define DISABLE_RD8_PULLDOWN() (RXY_GPIO_CNPDE(RD8_CN) = 0)
8011 # else
8012 # define DISABLE_RD8_PULLDOWN() ((void) 0)
8013 # endif
8014 
8015 # define ENABLE_RD8_CN_INTERRUPT() (RXY_GPIO_CNIE(RD8_CN) = 1)
8016 # define DISABLE_RD8_CN_INTERRUPT() (RXY_GPIO_CNIE(RD8_CN) = 0)
8017 
8018 # else
8019 # define DISABLE_RD8_PULLUP() ((void) 0)
8020 # define DISABLE_RD8_PULLDOWN() ((void) 0)
8021 # define DISABLE_RD8_CN_INTERRUPT() ((void) 0)
8022 # endif
8023 
8024 // High-level config
8025 // -----------------
8026 /** This macro disables pullups/downs, enables analog functionality, and configures
8027  * pin RD8 as an input.
8028  */
8029 # if defined(_ANSD8) || defined(RD8_AN) || defined(__DOXYGEN__)
8030 # define CONFIG_RD8_AS_ANALOG() \
8031  do { \
8032  ENABLE_RD8_ANALOG(); \
8033  CONFIG_RD8_AS_INPUT(); \
8034  DISABLE_RD8_OPENDRAIN(); \
8035  DISABLE_RD8_PULLUP(); \
8036  DISABLE_RD8_PULLDOWN(); \
8037  } while (0)
8038 # endif
8039 
8040 /** This macro disables open-drain and pullups/downs,
8041  * configures pin RD8 for digital (not analog) operation, and
8042  * configures the pin as an input.
8043  */
8044 # define CONFIG_RD8_AS_DIG_INPUT() \
8045  do { \
8046  DISABLE_RD8_ANALOG(); \
8047  CONFIG_RD8_AS_INPUT(); \
8048  DISABLE_RD8_OPENDRAIN(); \
8049  DISABLE_RD8_PULLUP(); \
8050  DISABLE_RD8_PULLDOWN(); \
8051  } while (0)
8052 
8053 /** This macro disables open-drain and pullups/downs,
8054  * configures pin RD8 for digital (not analog) operation, and
8055  * configures the pin as an output.
8056  */
8057 # define CONFIG_RD8_AS_DIG_OUTPUT() \
8058  do { \
8059  DISABLE_RD8_ANALOG(); \
8060  CONFIG_RD8_AS_OUTPUT(); \
8061  DISABLE_RD8_OPENDRAIN(); \
8062  DISABLE_RD8_PULLUP(); \
8063  DISABLE_RD8_PULLDOWN(); \
8064  } while (0)
8065 
8066 #endif // #if defined(_RD8) || defined(__DOXYGEN__): Provide GPIO for RD8
8067 
8068 
8069 
8070 
8071 
8072 // Provide GPIO for RD9
8073 // ====================
8074 #if defined(_RD9) || defined(__DOXYGEN__)
8075 
8076 // Dummy macros for documentation only
8077 # ifdef __DOXYGEN__
8078 /// This macro specifies the RPy value associated with pin RD9.
8079 /// Its device-specific definition is given in pic24_ports_mapping.h.
8080 # define RD9_RP xx
8081 
8082 /// This macro specifies the ANn value associated with pin RD9.
8083 /// Its device-specific definition is given in pic24_ports_mapping.h.
8084 # define RD9_AN xx
8085 
8086 /// This macro specifies the CNm value associated with pin RD9.
8087 /// Its device-specific definition is given in pic24_ports_mapping.h.
8088 # define RD9_CN xx
8089 
8090 //@}
8091 # endif // #ifdef __DOXYGEN__
8092 
8093 
8094 // Low-level config
8095 // ----------------
8096 // Analog:
8097 # if defined(_ANSD9) || defined(__DOXYGEN__)
8098 /// Enable analog functionality on pin RD9.
8099 # define ENABLE_RD9_ANALOG() (_ANSD9 = 1)
8100 /// Disable analog functionality on pin RD9.
8101 # define DISABLE_RD9_ANALOG() (_ANSD9 = 0)
8102 # elif defined(RD9_AN)
8103 # define ENABLE_RD9_ANALOG() (RXY_GPIO_PCFG(RD9_AN) = 0)
8104 # define DISABLE_RD9_ANALOG() (RXY_GPIO_PCFG(RD9_AN) = 1)
8105 # else
8106 # define DISABLE_RD9_ANALOG() ((void) 0)
8107 # endif
8108 
8109 // Input/output:
8110 /// Configure pin RD9 as an input.
8111 # define CONFIG_RD9_AS_INPUT() (_TRISD9 = 1)
8112 /// Configure pin RD9 as an output.
8113 # define CONFIG_RD9_AS_OUTPUT() (_TRISD9 = 0)
8114 
8115 // Open-drain:
8116 # if defined(_ODCD9) || defined(__DOXYGEN__)
8117 /// Enable the open-drain driver on pin RD9.
8118 # define ENABLE_RD9_OPENDRAIN() (_ODCD9 = 1)
8119 /// Disable the open-drain driver on pin RD9.
8120 # define DISABLE_RD9_OPENDRAIN() (_ODCD9 = 0)
8121 # elif defined(_ODD9) // The PIF24F names this bit _OD instead of _ODC.
8122 # define ENABLE_RD9_OPENDRAIN() (_ODD9 = 1)
8123 # define DISABLE_RD9_OPENDRAIN() (_ODD9 = 0)
8124 # else
8125 # define DISABLE_RD9_OPENDRAIN() ((void) 0)
8126 # endif
8127 
8128 // Change notification, pullups and pulldowns:
8129 # if defined(_CNIED9) || defined(__DOXYGEN__)
8130 /// Enable the pullup on pin RD9.
8131 # define ENABLE_RD9_PULLUP() (_CNPUD9 = 1)
8132 /// Disable the pullup on pin RD9.
8133 # define DISABLE_RD9_PULLUP() (_CNPUD9 = 0)
8134 
8135 /// Enable the pulldown on pin RD9.
8136 # define ENABLE_RD9_PULLDOWN() (_CNPDD9 = 1)
8137 /// Disable the pulldown on pin RD9.
8138 # define DISABLE_RD9_PULLDOWN() (_CNPDD9 = 0)
8139 
8140 /// Enable the change notification interrupt on pin RD9.
8141 # define ENABLE_RD9_CN_INTERRUPT() (_CNIED9 = 1)
8142 /// Disable the change notification interrupt on pin RD9.
8143 # define DISABLE_RD9_CN_INTERRUPT() (_CNIED9 = 0)
8144 
8145 # elif defined(RD9_CN)
8146 # define ENABLE_RD9_PULLUP() (RXY_GPIO_CNPUE(RD9_CN) = 1)
8147 # define DISABLE_RD9_PULLUP() (RXY_GPIO_CNPUE(RD9_CN) = 0)
8148 
8149 # if RXY_HAS_CNPDE(RD9_CN)
8150 # define ENABLE_RD9_PULLDOWN() (RXY_GPIO_CNPDE(RD9_CN) = 1)
8151 # define DISABLE_RD9_PULLDOWN() (RXY_GPIO_CNPDE(RD9_CN) = 0)
8152 # else
8153 # define DISABLE_RD9_PULLDOWN() ((void) 0)
8154 # endif
8155 
8156 # define ENABLE_RD9_CN_INTERRUPT() (RXY_GPIO_CNIE(RD9_CN) = 1)
8157 # define DISABLE_RD9_CN_INTERRUPT() (RXY_GPIO_CNIE(RD9_CN) = 0)
8158 
8159 # else
8160 # define DISABLE_RD9_PULLUP() ((void) 0)
8161 # define DISABLE_RD9_PULLDOWN() ((void) 0)
8162 # define DISABLE_RD9_CN_INTERRUPT() ((void) 0)
8163 # endif
8164 
8165 // High-level config
8166 // -----------------
8167 /** This macro disables pullups/downs, enables analog functionality, and configures
8168  * pin RD9 as an input.
8169  */
8170 # if defined(_ANSD9) || defined(RD9_AN) || defined(__DOXYGEN__)
8171 # define CONFIG_RD9_AS_ANALOG() \
8172  do { \
8173  ENABLE_RD9_ANALOG(); \
8174  CONFIG_RD9_AS_INPUT(); \
8175  DISABLE_RD9_OPENDRAIN(); \
8176  DISABLE_RD9_PULLUP(); \
8177  DISABLE_RD9_PULLDOWN(); \
8178  } while (0)
8179 # endif
8180 
8181 /** This macro disables open-drain and pullups/downs,
8182  * configures pin RD9 for digital (not analog) operation, and
8183  * configures the pin as an input.
8184  */
8185 # define CONFIG_RD9_AS_DIG_INPUT() \
8186  do { \
8187  DISABLE_RD9_ANALOG(); \
8188  CONFIG_RD9_AS_INPUT(); \
8189  DISABLE_RD9_OPENDRAIN(); \
8190  DISABLE_RD9_PULLUP(); \
8191  DISABLE_RD9_PULLDOWN(); \
8192  } while (0)
8193 
8194 /** This macro disables open-drain and pullups/downs,
8195  * configures pin RD9 for digital (not analog) operation, and
8196  * configures the pin as an output.
8197  */
8198 # define CONFIG_RD9_AS_DIG_OUTPUT() \
8199  do { \
8200  DISABLE_RD9_ANALOG(); \
8201  CONFIG_RD9_AS_OUTPUT(); \
8202  DISABLE_RD9_OPENDRAIN(); \
8203  DISABLE_RD9_PULLUP(); \
8204  DISABLE_RD9_PULLDOWN(); \
8205  } while (0)
8206 
8207 #endif // #if defined(_RD9) || defined(__DOXYGEN__): Provide GPIO for RD9
8208 
8209 
8210 
8211 
8212 
8213 // Provide GPIO for RD10
8214 // ====================
8215 #if defined(_RD10) || defined(__DOXYGEN__)
8216 
8217 // Dummy macros for documentation only
8218 # ifdef __DOXYGEN__
8219 /// This macro specifies the RPy value associated with pin RD10.
8220 /// Its device-specific definition is given in pic24_ports_mapping.h.
8221 # define RD10_RP xx
8222 
8223 /// This macro specifies the ANn value associated with pin RD10.
8224 /// Its device-specific definition is given in pic24_ports_mapping.h.
8225 # define RD10_AN xx
8226 
8227 /// This macro specifies the CNm value associated with pin RD10.
8228 /// Its device-specific definition is given in pic24_ports_mapping.h.
8229 # define RD10_CN xx
8230 
8231 //@}
8232 # endif // #ifdef __DOXYGEN__
8233 
8234 
8235 // Low-level config
8236 // ----------------
8237 // Analog:
8238 # if defined(_ANSD10) || defined(__DOXYGEN__)
8239 /// Enable analog functionality on pin RD10.
8240 # define ENABLE_RD10_ANALOG() (_ANSD10 = 1)
8241 /// Disable analog functionality on pin RD10.
8242 # define DISABLE_RD10_ANALOG() (_ANSD10 = 0)
8243 # elif defined(RD10_AN)
8244 # define ENABLE_RD10_ANALOG() (RXY_GPIO_PCFG(RD10_AN) = 0)
8245 # define DISABLE_RD10_ANALOG() (RXY_GPIO_PCFG(RD10_AN) = 1)
8246 # else
8247 # define DISABLE_RD10_ANALOG() ((void) 0)
8248 # endif
8249 
8250 // Input/output:
8251 /// Configure pin RD10 as an input.
8252 # define CONFIG_RD10_AS_INPUT() (_TRISD10 = 1)
8253 /// Configure pin RD10 as an output.
8254 # define CONFIG_RD10_AS_OUTPUT() (_TRISD10 = 0)
8255 
8256 // Open-drain:
8257 # if defined(_ODCD10) || defined(__DOXYGEN__)
8258 /// Enable the open-drain driver on pin RD10.
8259 # define ENABLE_RD10_OPENDRAIN() (_ODCD10 = 1)
8260 /// Disable the open-drain driver on pin RD10.
8261 # define DISABLE_RD10_OPENDRAIN() (_ODCD10 = 0)
8262 # elif defined(_ODD10) // The PIF24F names this bit _OD instead of _ODC.
8263 # define ENABLE_RD10_OPENDRAIN() (_ODD10 = 1)
8264 # define DISABLE_RD10_OPENDRAIN() (_ODD10 = 0)
8265 # else
8266 # define DISABLE_RD10_OPENDRAIN() ((void) 0)
8267 # endif
8268 
8269 // Change notification, pullups and pulldowns:
8270 # if defined(_CNIED10) || defined(__DOXYGEN__)
8271 /// Enable the pullup on pin RD10.
8272 # define ENABLE_RD10_PULLUP() (_CNPUD10 = 1)
8273 /// Disable the pullup on pin RD10.
8274 # define DISABLE_RD10_PULLUP() (_CNPUD10 = 0)
8275 
8276 /// Enable the pulldown on pin RD10.
8277 # define ENABLE_RD10_PULLDOWN() (_CNPDD10 = 1)
8278 /// Disable the pulldown on pin RD10.
8279 # define DISABLE_RD10_PULLDOWN() (_CNPDD10 = 0)
8280 
8281 /// Enable the change notification interrupt on pin RD10.
8282 # define ENABLE_RD10_CN_INTERRUPT() (_CNIED10 = 1)
8283 /// Disable the change notification interrupt on pin RD10.
8284 # define DISABLE_RD10_CN_INTERRUPT() (_CNIED10 = 0)
8285 
8286 # elif defined(RD10_CN)
8287 # define ENABLE_RD10_PULLUP() (RXY_GPIO_CNPUE(RD10_CN) = 1)
8288 # define DISABLE_RD10_PULLUP() (RXY_GPIO_CNPUE(RD10_CN) = 0)
8289 
8290 # if RXY_HAS_CNPDE(RD10_CN)
8291 # define ENABLE_RD10_PULLDOWN() (RXY_GPIO_CNPDE(RD10_CN) = 1)
8292 # define DISABLE_RD10_PULLDOWN() (RXY_GPIO_CNPDE(RD10_CN) = 0)
8293 # else
8294 # define DISABLE_RD10_PULLDOWN() ((void) 0)
8295 # endif
8296 
8297 # define ENABLE_RD10_CN_INTERRUPT() (RXY_GPIO_CNIE(RD10_CN) = 1)
8298 # define DISABLE_RD10_CN_INTERRUPT() (RXY_GPIO_CNIE(RD10_CN) = 0)
8299 
8300 # else
8301 # define DISABLE_RD10_PULLUP() ((void) 0)
8302 # define DISABLE_RD10_PULLDOWN() ((void) 0)
8303 # define DISABLE_RD10_CN_INTERRUPT() ((void) 0)
8304 # endif
8305 
8306 // High-level config
8307 // -----------------
8308 /** This macro disables pullups/downs, enables analog functionality, and configures
8309  * pin RD10 as an input.
8310  */
8311 # if defined(_ANSD10) || defined(RD10_AN) || defined(__DOXYGEN__)
8312 # define CONFIG_RD10_AS_ANALOG() \
8313  do { \
8314  ENABLE_RD10_ANALOG(); \
8315  CONFIG_RD10_AS_INPUT(); \
8316  DISABLE_RD10_OPENDRAIN(); \
8317  DISABLE_RD10_PULLUP(); \
8318  DISABLE_RD10_PULLDOWN(); \
8319  } while (0)
8320 # endif
8321 
8322 /** This macro disables open-drain and pullups/downs,
8323  * configures pin RD10 for digital (not analog) operation, and
8324  * configures the pin as an input.
8325  */
8326 # define CONFIG_RD10_AS_DIG_INPUT() \
8327  do { \
8328  DISABLE_RD10_ANALOG(); \
8329  CONFIG_RD10_AS_INPUT(); \
8330  DISABLE_RD10_OPENDRAIN(); \
8331  DISABLE_RD10_PULLUP(); \
8332  DISABLE_RD10_PULLDOWN(); \
8333  } while (0)
8334 
8335 /** This macro disables open-drain and pullups/downs,
8336  * configures pin RD10 for digital (not analog) operation, and
8337  * configures the pin as an output.
8338  */
8339 # define CONFIG_RD10_AS_DIG_OUTPUT() \
8340  do { \
8341  DISABLE_RD10_ANALOG(); \
8342  CONFIG_RD10_AS_OUTPUT(); \
8343  DISABLE_RD10_OPENDRAIN(); \
8344  DISABLE_RD10_PULLUP(); \
8345  DISABLE_RD10_PULLDOWN(); \
8346  } while (0)
8347 
8348 #endif // #if defined(_RD10) || defined(__DOXYGEN__): Provide GPIO for RD10
8349 
8350 
8351 
8352 
8353 
8354 // Provide GPIO for RD11
8355 // ====================
8356 #if defined(_RD11) || defined(__DOXYGEN__)
8357 
8358 // Dummy macros for documentation only
8359 # ifdef __DOXYGEN__
8360 /// This macro specifies the RPy value associated with pin RD11.
8361 /// Its device-specific definition is given in pic24_ports_mapping.h.
8362 # define RD11_RP xx
8363 
8364 /// This macro specifies the ANn value associated with pin RD11.
8365 /// Its device-specific definition is given in pic24_ports_mapping.h.
8366 # define RD11_AN xx
8367 
8368 /// This macro specifies the CNm value associated with pin RD11.
8369 /// Its device-specific definition is given in pic24_ports_mapping.h.
8370 # define RD11_CN xx
8371 
8372 //@}
8373 # endif // #ifdef __DOXYGEN__
8374 
8375 
8376 // Low-level config
8377 // ----------------
8378 // Analog:
8379 # if defined(_ANSD11) || defined(__DOXYGEN__)
8380 /// Enable analog functionality on pin RD11.
8381 # define ENABLE_RD11_ANALOG() (_ANSD11 = 1)
8382 /// Disable analog functionality on pin RD11.
8383 # define DISABLE_RD11_ANALOG() (_ANSD11 = 0)
8384 # elif defined(RD11_AN)
8385 # define ENABLE_RD11_ANALOG() (RXY_GPIO_PCFG(RD11_AN) = 0)
8386 # define DISABLE_RD11_ANALOG() (RXY_GPIO_PCFG(RD11_AN) = 1)
8387 # else
8388 # define DISABLE_RD11_ANALOG() ((void) 0)
8389 # endif
8390 
8391 // Input/output:
8392 /// Configure pin RD11 as an input.
8393 # define CONFIG_RD11_AS_INPUT() (_TRISD11 = 1)
8394 /// Configure pin RD11 as an output.
8395 # define CONFIG_RD11_AS_OUTPUT() (_TRISD11 = 0)
8396 
8397 // Open-drain:
8398 # if defined(_ODCD11) || defined(__DOXYGEN__)
8399 /// Enable the open-drain driver on pin RD11.
8400 # define ENABLE_RD11_OPENDRAIN() (_ODCD11 = 1)
8401 /// Disable the open-drain driver on pin RD11.
8402 # define DISABLE_RD11_OPENDRAIN() (_ODCD11 = 0)
8403 # elif defined(_ODD11) // The PIF24F names this bit _OD instead of _ODC.
8404 # define ENABLE_RD11_OPENDRAIN() (_ODD11 = 1)
8405 # define DISABLE_RD11_OPENDRAIN() (_ODD11 = 0)
8406 # else
8407 # define DISABLE_RD11_OPENDRAIN() ((void) 0)
8408 # endif
8409 
8410 // Change notification, pullups and pulldowns:
8411 # if defined(_CNIED11) || defined(__DOXYGEN__)
8412 /// Enable the pullup on pin RD11.
8413 # define ENABLE_RD11_PULLUP() (_CNPUD11 = 1)
8414 /// Disable the pullup on pin RD11.
8415 # define DISABLE_RD11_PULLUP() (_CNPUD11 = 0)
8416 
8417 /// Enable the pulldown on pin RD11.
8418 # define ENABLE_RD11_PULLDOWN() (_CNPDD11 = 1)
8419 /// Disable the pulldown on pin RD11.
8420 # define DISABLE_RD11_PULLDOWN() (_CNPDD11 = 0)
8421 
8422 /// Enable the change notification interrupt on pin RD11.
8423 # define ENABLE_RD11_CN_INTERRUPT() (_CNIED11 = 1)
8424 /// Disable the change notification interrupt on pin RD11.
8425 # define DISABLE_RD11_CN_INTERRUPT() (_CNIED11 = 0)
8426 
8427 # elif defined(RD11_CN)
8428 # define ENABLE_RD11_PULLUP() (RXY_GPIO_CNPUE(RD11_CN) = 1)
8429 # define DISABLE_RD11_PULLUP() (RXY_GPIO_CNPUE(RD11_CN) = 0)
8430 
8431 # if RXY_HAS_CNPDE(RD11_CN)
8432 # define ENABLE_RD11_PULLDOWN() (RXY_GPIO_CNPDE(RD11_CN) = 1)
8433 # define DISABLE_RD11_PULLDOWN() (RXY_GPIO_CNPDE(RD11_CN) = 0)
8434 # else
8435 # define DISABLE_RD11_PULLDOWN() ((void) 0)
8436 # endif
8437 
8438 # define ENABLE_RD11_CN_INTERRUPT() (RXY_GPIO_CNIE(RD11_CN) = 1)
8439 # define DISABLE_RD11_CN_INTERRUPT() (RXY_GPIO_CNIE(RD11_CN) = 0)
8440 
8441 # else
8442 # define DISABLE_RD11_PULLUP() ((void) 0)
8443 # define DISABLE_RD11_PULLDOWN() ((void) 0)
8444 # define DISABLE_RD11_CN_INTERRUPT() ((void) 0)
8445 # endif
8446 
8447 // High-level config
8448 // -----------------
8449 /** This macro disables pullups/downs, enables analog functionality, and configures
8450  * pin RD11 as an input.
8451  */
8452 # if defined(_ANSD11) || defined(RD11_AN) || defined(__DOXYGEN__)
8453 # define CONFIG_RD11_AS_ANALOG() \
8454  do { \
8455  ENABLE_RD11_ANALOG(); \
8456  CONFIG_RD11_AS_INPUT(); \
8457  DISABLE_RD11_OPENDRAIN(); \
8458  DISABLE_RD11_PULLUP(); \
8459  DISABLE_RD11_PULLDOWN(); \
8460  } while (0)
8461 # endif
8462 
8463 /** This macro disables open-drain and pullups/downs,
8464  * configures pin RD11 for digital (not analog) operation, and
8465  * configures the pin as an input.
8466  */
8467 # define CONFIG_RD11_AS_DIG_INPUT() \
8468  do { \
8469  DISABLE_RD11_ANALOG(); \
8470  CONFIG_RD11_AS_INPUT(); \
8471  DISABLE_RD11_OPENDRAIN(); \
8472  DISABLE_RD11_PULLUP(); \
8473  DISABLE_RD11_PULLDOWN(); \
8474  } while (0)
8475 
8476 /** This macro disables open-drain and pullups/downs,
8477  * configures pin RD11 for digital (not analog) operation, and
8478  * configures the pin as an output.
8479  */
8480 # define CONFIG_RD11_AS_DIG_OUTPUT() \
8481  do { \
8482  DISABLE_RD11_ANALOG(); \
8483  CONFIG_RD11_AS_OUTPUT(); \
8484  DISABLE_RD11_OPENDRAIN(); \
8485  DISABLE_RD11_PULLUP(); \
8486  DISABLE_RD11_PULLDOWN(); \
8487  } while (0)
8488 
8489 #endif // #if defined(_RD11) || defined(__DOXYGEN__): Provide GPIO for RD11
8490 
8491 
8492 
8493 
8494 
8495 // Provide GPIO for RD12
8496 // ====================
8497 #if defined(_RD12) || defined(__DOXYGEN__)
8498 
8499 // Dummy macros for documentation only
8500 # ifdef __DOXYGEN__
8501 /// This macro specifies the RPy value associated with pin RD12.
8502 /// Its device-specific definition is given in pic24_ports_mapping.h.
8503 # define RD12_RP xx
8504 
8505 /// This macro specifies the ANn value associated with pin RD12.
8506 /// Its device-specific definition is given in pic24_ports_mapping.h.
8507 # define RD12_AN xx
8508 
8509 /// This macro specifies the CNm value associated with pin RD12.
8510 /// Its device-specific definition is given in pic24_ports_mapping.h.
8511 # define RD12_CN xx
8512 
8513 //@}
8514 # endif // #ifdef __DOXYGEN__
8515 
8516 
8517 // Low-level config
8518 // ----------------
8519 // Analog:
8520 # if defined(_ANSD12) || defined(__DOXYGEN__)
8521 /// Enable analog functionality on pin RD12.
8522 # define ENABLE_RD12_ANALOG() (_ANSD12 = 1)
8523 /// Disable analog functionality on pin RD12.
8524 # define DISABLE_RD12_ANALOG() (_ANSD12 = 0)
8525 # elif defined(RD12_AN)
8526 # define ENABLE_RD12_ANALOG() (RXY_GPIO_PCFG(RD12_AN) = 0)
8527 # define DISABLE_RD12_ANALOG() (RXY_GPIO_PCFG(RD12_AN) = 1)
8528 # else
8529 # define DISABLE_RD12_ANALOG() ((void) 0)
8530 # endif
8531 
8532 // Input/output:
8533 /// Configure pin RD12 as an input.
8534 # define CONFIG_RD12_AS_INPUT() (_TRISD12 = 1)
8535 /// Configure pin RD12 as an output.
8536 # define CONFIG_RD12_AS_OUTPUT() (_TRISD12 = 0)
8537 
8538 // Open-drain:
8539 # if defined(_ODCD12) || defined(__DOXYGEN__)
8540 /// Enable the open-drain driver on pin RD12.
8541 # define ENABLE_RD12_OPENDRAIN() (_ODCD12 = 1)
8542 /// Disable the open-drain driver on pin RD12.
8543 # define DISABLE_RD12_OPENDRAIN() (_ODCD12 = 0)
8544 # elif defined(_ODD12) // The PIF24F names this bit _OD instead of _ODC.
8545 # define ENABLE_RD12_OPENDRAIN() (_ODD12 = 1)
8546 # define DISABLE_RD12_OPENDRAIN() (_ODD12 = 0)
8547 # else
8548 # define DISABLE_RD12_OPENDRAIN() ((void) 0)
8549 # endif
8550 
8551 // Change notification, pullups and pulldowns:
8552 # if defined(_CNIED12) || defined(__DOXYGEN__)
8553 /// Enable the pullup on pin RD12.
8554 # define ENABLE_RD12_PULLUP() (_CNPUD12 = 1)
8555 /// Disable the pullup on pin RD12.
8556 # define DISABLE_RD12_PULLUP() (_CNPUD12 = 0)
8557 
8558 /// Enable the pulldown on pin RD12.
8559 # define ENABLE_RD12_PULLDOWN() (_CNPDD12 = 1)
8560 /// Disable the pulldown on pin RD12.
8561 # define DISABLE_RD12_PULLDOWN() (_CNPDD12 = 0)
8562 
8563 /// Enable the change notification interrupt on pin RD12.
8564 # define ENABLE_RD12_CN_INTERRUPT() (_CNIED12 = 1)
8565 /// Disable the change notification interrupt on pin RD12.
8566 # define DISABLE_RD12_CN_INTERRUPT() (_CNIED12 = 0)
8567 
8568 # elif defined(RD12_CN)
8569 # define ENABLE_RD12_PULLUP() (RXY_GPIO_CNPUE(RD12_CN) = 1)
8570 # define DISABLE_RD12_PULLUP() (RXY_GPIO_CNPUE(RD12_CN) = 0)
8571 
8572 # if RXY_HAS_CNPDE(RD12_CN)
8573 # define ENABLE_RD12_PULLDOWN() (RXY_GPIO_CNPDE(RD12_CN) = 1)
8574 # define DISABLE_RD12_PULLDOWN() (RXY_GPIO_CNPDE(RD12_CN) = 0)
8575 # else
8576 # define DISABLE_RD12_PULLDOWN() ((void) 0)
8577 # endif
8578 
8579 # define ENABLE_RD12_CN_INTERRUPT() (RXY_GPIO_CNIE(RD12_CN) = 1)
8580 # define DISABLE_RD12_CN_INTERRUPT() (RXY_GPIO_CNIE(RD12_CN) = 0)
8581 
8582 # else
8583 # define DISABLE_RD12_PULLUP() ((void) 0)
8584 # define DISABLE_RD12_PULLDOWN() ((void) 0)
8585 # define DISABLE_RD12_CN_INTERRUPT() ((void) 0)
8586 # endif
8587 
8588 // High-level config
8589 // -----------------
8590 /** This macro disables pullups/downs, enables analog functionality, and configures
8591  * pin RD12 as an input.
8592  */
8593 # if defined(_ANSD12) || defined(RD12_AN) || defined(__DOXYGEN__)
8594 # define CONFIG_RD12_AS_ANALOG() \
8595  do { \
8596  ENABLE_RD12_ANALOG(); \
8597  CONFIG_RD12_AS_INPUT(); \
8598  DISABLE_RD12_OPENDRAIN(); \
8599  DISABLE_RD12_PULLUP(); \
8600  DISABLE_RD12_PULLDOWN(); \
8601  } while (0)
8602 # endif
8603 
8604 /** This macro disables open-drain and pullups/downs,
8605  * configures pin RD12 for digital (not analog) operation, and
8606  * configures the pin as an input.
8607  */
8608 # define CONFIG_RD12_AS_DIG_INPUT() \
8609  do { \
8610  DISABLE_RD12_ANALOG(); \
8611  CONFIG_RD12_AS_INPUT(); \
8612  DISABLE_RD12_OPENDRAIN(); \
8613  DISABLE_RD12_PULLUP(); \
8614  DISABLE_RD12_PULLDOWN(); \
8615  } while (0)
8616 
8617 /** This macro disables open-drain and pullups/downs,
8618  * configures pin RD12 for digital (not analog) operation, and
8619  * configures the pin as an output.
8620  */
8621 # define CONFIG_RD12_AS_DIG_OUTPUT() \
8622  do { \
8623  DISABLE_RD12_ANALOG(); \
8624  CONFIG_RD12_AS_OUTPUT(); \
8625  DISABLE_RD12_OPENDRAIN(); \
8626  DISABLE_RD12_PULLUP(); \
8627  DISABLE_RD12_PULLDOWN(); \
8628  } while (0)
8629 
8630 #endif // #if defined(_RD12) || defined(__DOXYGEN__): Provide GPIO for RD12
8631 
8632 
8633 
8634 
8635 
8636 // Provide GPIO for RD13
8637 // ====================
8638 #if defined(_RD13) || defined(__DOXYGEN__)
8639 
8640 // Dummy macros for documentation only
8641 # ifdef __DOXYGEN__
8642 /// This macro specifies the RPy value associated with pin RD13.
8643 /// Its device-specific definition is given in pic24_ports_mapping.h.
8644 # define RD13_RP xx
8645 
8646 /// This macro specifies the ANn value associated with pin RD13.
8647 /// Its device-specific definition is given in pic24_ports_mapping.h.
8648 # define RD13_AN xx
8649 
8650 /// This macro specifies the CNm value associated with pin RD13.
8651 /// Its device-specific definition is given in pic24_ports_mapping.h.
8652 # define RD13_CN xx
8653 
8654 //@}
8655 # endif // #ifdef __DOXYGEN__
8656 
8657 
8658 // Low-level config
8659 // ----------------
8660 // Analog:
8661 # if defined(_ANSD13) || defined(__DOXYGEN__)
8662 /// Enable analog functionality on pin RD13.
8663 # define ENABLE_RD13_ANALOG() (_ANSD13 = 1)
8664 /// Disable analog functionality on pin RD13.
8665 # define DISABLE_RD13_ANALOG() (_ANSD13 = 0)
8666 # elif defined(RD13_AN)
8667 # define ENABLE_RD13_ANALOG() (RXY_GPIO_PCFG(RD13_AN) = 0)
8668 # define DISABLE_RD13_ANALOG() (RXY_GPIO_PCFG(RD13_AN) = 1)
8669 # else
8670 # define DISABLE_RD13_ANALOG() ((void) 0)
8671 # endif
8672 
8673 // Input/output:
8674 /// Configure pin RD13 as an input.
8675 # define CONFIG_RD13_AS_INPUT() (_TRISD13 = 1)
8676 /// Configure pin RD13 as an output.
8677 # define CONFIG_RD13_AS_OUTPUT() (_TRISD13 = 0)
8678 
8679 // Open-drain:
8680 # if defined(_ODCD13) || defined(__DOXYGEN__)
8681 /// Enable the open-drain driver on pin RD13.
8682 # define ENABLE_RD13_OPENDRAIN() (_ODCD13 = 1)
8683 /// Disable the open-drain driver on pin RD13.
8684 # define DISABLE_RD13_OPENDRAIN() (_ODCD13 = 0)
8685 # elif defined(_ODD13) // The PIF24F names this bit _OD instead of _ODC.
8686 # define ENABLE_RD13_OPENDRAIN() (_ODD13 = 1)
8687 # define DISABLE_RD13_OPENDRAIN() (_ODD13 = 0)
8688 # else
8689 # define DISABLE_RD13_OPENDRAIN() ((void) 0)
8690 # endif
8691 
8692 // Change notification, pullups and pulldowns:
8693 # if defined(_CNIED13) || defined(__DOXYGEN__)
8694 /// Enable the pullup on pin RD13.
8695 # define ENABLE_RD13_PULLUP() (_CNPUD13 = 1)
8696 /// Disable the pullup on pin RD13.
8697 # define DISABLE_RD13_PULLUP() (_CNPUD13 = 0)
8698 
8699 /// Enable the pulldown on pin RD13.
8700 # define ENABLE_RD13_PULLDOWN() (_CNPDD13 = 1)
8701 /// Disable the pulldown on pin RD13.
8702 # define DISABLE_RD13_PULLDOWN() (_CNPDD13 = 0)
8703 
8704 /// Enable the change notification interrupt on pin RD13.
8705 # define ENABLE_RD13_CN_INTERRUPT() (_CNIED13 = 1)
8706 /// Disable the change notification interrupt on pin RD13.
8707 # define DISABLE_RD13_CN_INTERRUPT() (_CNIED13 = 0)
8708 
8709 # elif defined(RD13_CN)
8710 # define ENABLE_RD13_PULLUP() (RXY_GPIO_CNPUE(RD13_CN) = 1)
8711 # define DISABLE_RD13_PULLUP() (RXY_GPIO_CNPUE(RD13_CN) = 0)
8712 
8713 # if RXY_HAS_CNPDE(RD13_CN)
8714 # define ENABLE_RD13_PULLDOWN() (RXY_GPIO_CNPDE(RD13_CN) = 1)
8715 # define DISABLE_RD13_PULLDOWN() (RXY_GPIO_CNPDE(RD13_CN) = 0)
8716 # else
8717 # define DISABLE_RD13_PULLDOWN() ((void) 0)
8718 # endif
8719 
8720 # define ENABLE_RD13_CN_INTERRUPT() (RXY_GPIO_CNIE(RD13_CN) = 1)
8721 # define DISABLE_RD13_CN_INTERRUPT() (RXY_GPIO_CNIE(RD13_CN) = 0)
8722 
8723 # else
8724 # define DISABLE_RD13_PULLUP() ((void) 0)
8725 # define DISABLE_RD13_PULLDOWN() ((void) 0)
8726 # define DISABLE_RD13_CN_INTERRUPT() ((void) 0)
8727 # endif
8728 
8729 // High-level config
8730 // -----------------
8731 /** This macro disables pullups/downs, enables analog functionality, and configures
8732  * pin RD13 as an input.
8733  */
8734 # if defined(_ANSD13) || defined(RD13_AN) || defined(__DOXYGEN__)
8735 # define CONFIG_RD13_AS_ANALOG() \
8736  do { \
8737  ENABLE_RD13_ANALOG(); \
8738  CONFIG_RD13_AS_INPUT(); \
8739  DISABLE_RD13_OPENDRAIN(); \
8740  DISABLE_RD13_PULLUP(); \
8741  DISABLE_RD13_PULLDOWN(); \
8742  } while (0)
8743 # endif
8744 
8745 /** This macro disables open-drain and pullups/downs,
8746  * configures pin RD13 for digital (not analog) operation, and
8747  * configures the pin as an input.
8748  */
8749 # define CONFIG_RD13_AS_DIG_INPUT() \
8750  do { \
8751  DISABLE_RD13_ANALOG(); \
8752  CONFIG_RD13_AS_INPUT(); \
8753  DISABLE_RD13_OPENDRAIN(); \
8754  DISABLE_RD13_PULLUP(); \
8755  DISABLE_RD13_PULLDOWN(); \
8756  } while (0)
8757 
8758 /** This macro disables open-drain and pullups/downs,
8759  * configures pin RD13 for digital (not analog) operation, and
8760  * configures the pin as an output.
8761  */
8762 # define CONFIG_RD13_AS_DIG_OUTPUT() \
8763  do { \
8764  DISABLE_RD13_ANALOG(); \
8765  CONFIG_RD13_AS_OUTPUT(); \
8766  DISABLE_RD13_OPENDRAIN(); \
8767  DISABLE_RD13_PULLUP(); \
8768  DISABLE_RD13_PULLDOWN(); \
8769  } while (0)
8770 
8771 #endif // #if defined(_RD13) || defined(__DOXYGEN__): Provide GPIO for RD13
8772 
8773 
8774 
8775 
8776 
8777 // Provide GPIO for RD14
8778 // ====================
8779 #if defined(_RD14) || defined(__DOXYGEN__)
8780 
8781 // Dummy macros for documentation only
8782 # ifdef __DOXYGEN__
8783 /// This macro specifies the RPy value associated with pin RD14.
8784 /// Its device-specific definition is given in pic24_ports_mapping.h.
8785 # define RD14_RP xx
8786 
8787 /// This macro specifies the ANn value associated with pin RD14.
8788 /// Its device-specific definition is given in pic24_ports_mapping.h.
8789 # define RD14_AN xx
8790 
8791 /// This macro specifies the CNm value associated with pin RD14.
8792 /// Its device-specific definition is given in pic24_ports_mapping.h.
8793 # define RD14_CN xx
8794 
8795 //@}
8796 # endif // #ifdef __DOXYGEN__
8797 
8798 
8799 // Low-level config
8800 // ----------------
8801 // Analog:
8802 # if defined(_ANSD14) || defined(__DOXYGEN__)
8803 /// Enable analog functionality on pin RD14.
8804 # define ENABLE_RD14_ANALOG() (_ANSD14 = 1)
8805 /// Disable analog functionality on pin RD14.
8806 # define DISABLE_RD14_ANALOG() (_ANSD14 = 0)
8807 # elif defined(RD14_AN)
8808 # define ENABLE_RD14_ANALOG() (RXY_GPIO_PCFG(RD14_AN) = 0)
8809 # define DISABLE_RD14_ANALOG() (RXY_GPIO_PCFG(RD14_AN) = 1)
8810 # else
8811 # define DISABLE_RD14_ANALOG() ((void) 0)
8812 # endif
8813 
8814 // Input/output:
8815 /// Configure pin RD14 as an input.
8816 # define CONFIG_RD14_AS_INPUT() (_TRISD14 = 1)
8817 /// Configure pin RD14 as an output.
8818 # define CONFIG_RD14_AS_OUTPUT() (_TRISD14 = 0)
8819 
8820 // Open-drain:
8821 # if defined(_ODCD14) || defined(__DOXYGEN__)
8822 /// Enable the open-drain driver on pin RD14.
8823 # define ENABLE_RD14_OPENDRAIN() (_ODCD14 = 1)
8824 /// Disable the open-drain driver on pin RD14.
8825 # define DISABLE_RD14_OPENDRAIN() (_ODCD14 = 0)
8826 # elif defined(_ODD14) // The PIF24F names this bit _OD instead of _ODC.
8827 # define ENABLE_RD14_OPENDRAIN() (_ODD14 = 1)
8828 # define DISABLE_RD14_OPENDRAIN() (_ODD14 = 0)
8829 # else
8830 # define DISABLE_RD14_OPENDRAIN() ((void) 0)
8831 # endif
8832 
8833 // Change notification, pullups and pulldowns:
8834 # if defined(_CNIED14) || defined(__DOXYGEN__)
8835 /// Enable the pullup on pin RD14.
8836 # define ENABLE_RD14_PULLUP() (_CNPUD14 = 1)
8837 /// Disable the pullup on pin RD14.
8838 # define DISABLE_RD14_PULLUP() (_CNPUD14 = 0)
8839 
8840 /// Enable the pulldown on pin RD14.
8841 # define ENABLE_RD14_PULLDOWN() (_CNPDD14 = 1)
8842 /// Disable the pulldown on pin RD14.
8843 # define DISABLE_RD14_PULLDOWN() (_CNPDD14 = 0)
8844 
8845 /// Enable the change notification interrupt on pin RD14.
8846 # define ENABLE_RD14_CN_INTERRUPT() (_CNIED14 = 1)
8847 /// Disable the change notification interrupt on pin RD14.
8848 # define DISABLE_RD14_CN_INTERRUPT() (_CNIED14 = 0)
8849 
8850 # elif defined(RD14_CN)
8851 # define ENABLE_RD14_PULLUP() (RXY_GPIO_CNPUE(RD14_CN) = 1)
8852 # define DISABLE_RD14_PULLUP() (RXY_GPIO_CNPUE(RD14_CN) = 0)
8853 
8854 # if RXY_HAS_CNPDE(RD14_CN)
8855 # define ENABLE_RD14_PULLDOWN() (RXY_GPIO_CNPDE(RD14_CN) = 1)
8856 # define DISABLE_RD14_PULLDOWN() (RXY_GPIO_CNPDE(RD14_CN) = 0)
8857 # else
8858 # define DISABLE_RD14_PULLDOWN() ((void) 0)
8859 # endif
8860 
8861 # define ENABLE_RD14_CN_INTERRUPT() (RXY_GPIO_CNIE(RD14_CN) = 1)
8862 # define DISABLE_RD14_CN_INTERRUPT() (RXY_GPIO_CNIE(RD14_CN) = 0)
8863 
8864 # else
8865 # define DISABLE_RD14_PULLUP() ((void) 0)
8866 # define DISABLE_RD14_PULLDOWN() ((void) 0)
8867 # define DISABLE_RD14_CN_INTERRUPT() ((void) 0)
8868 # endif
8869 
8870 // High-level config
8871 // -----------------
8872 /** This macro disables pullups/downs, enables analog functionality, and configures
8873  * pin RD14 as an input.
8874  */
8875 # if defined(_ANSD14) || defined(RD14_AN) || defined(__DOXYGEN__)
8876 # define CONFIG_RD14_AS_ANALOG() \
8877  do { \
8878  ENABLE_RD14_ANALOG(); \
8879  CONFIG_RD14_AS_INPUT(); \
8880  DISABLE_RD14_OPENDRAIN(); \
8881  DISABLE_RD14_PULLUP(); \
8882  DISABLE_RD14_PULLDOWN(); \
8883  } while (0)
8884 # endif
8885 
8886 /** This macro disables open-drain and pullups/downs,
8887  * configures pin RD14 for digital (not analog) operation, and
8888  * configures the pin as an input.
8889  */
8890 # define CONFIG_RD14_AS_DIG_INPUT() \
8891  do { \
8892  DISABLE_RD14_ANALOG(); \
8893  CONFIG_RD14_AS_INPUT(); \
8894  DISABLE_RD14_OPENDRAIN(); \
8895  DISABLE_RD14_PULLUP(); \
8896  DISABLE_RD14_PULLDOWN(); \
8897  } while (0)
8898 
8899 /** This macro disables open-drain and pullups/downs,
8900  * configures pin RD14 for digital (not analog) operation, and
8901  * configures the pin as an output.
8902  */
8903 # define CONFIG_RD14_AS_DIG_OUTPUT() \
8904  do { \
8905  DISABLE_RD14_ANALOG(); \
8906  CONFIG_RD14_AS_OUTPUT(); \
8907  DISABLE_RD14_OPENDRAIN(); \
8908  DISABLE_RD14_PULLUP(); \
8909  DISABLE_RD14_PULLDOWN(); \
8910  } while (0)
8911 
8912 #endif // #if defined(_RD14) || defined(__DOXYGEN__): Provide GPIO for RD14
8913 
8914 
8915 
8916 
8917 
8918 // Provide GPIO for RD15
8919 // ====================
8920 #if defined(_RD15) || defined(__DOXYGEN__)
8921 
8922 // Dummy macros for documentation only
8923 # ifdef __DOXYGEN__
8924 /// This macro specifies the RPy value associated with pin RD15.
8925 /// Its device-specific definition is given in pic24_ports_mapping.h.
8926 # define RD15_RP xx
8927 
8928 /// This macro specifies the ANn value associated with pin RD15.
8929 /// Its device-specific definition is given in pic24_ports_mapping.h.
8930 # define RD15_AN xx
8931 
8932 /// This macro specifies the CNm value associated with pin RD15.
8933 /// Its device-specific definition is given in pic24_ports_mapping.h.
8934 # define RD15_CN xx
8935 
8936 //@}
8937 # endif // #ifdef __DOXYGEN__
8938 
8939 
8940 // Low-level config
8941 // ----------------
8942 // Analog:
8943 # if defined(_ANSD15) || defined(__DOXYGEN__)
8944 /// Enable analog functionality on pin RD15.
8945 # define ENABLE_RD15_ANALOG() (_ANSD15 = 1)
8946 /// Disable analog functionality on pin RD15.
8947 # define DISABLE_RD15_ANALOG() (_ANSD15 = 0)
8948 # elif defined(RD15_AN)
8949 # define ENABLE_RD15_ANALOG() (RXY_GPIO_PCFG(RD15_AN) = 0)
8950 # define DISABLE_RD15_ANALOG() (RXY_GPIO_PCFG(RD15_AN) = 1)
8951 # else
8952 # define DISABLE_RD15_ANALOG() ((void) 0)
8953 # endif
8954 
8955 // Input/output:
8956 /// Configure pin RD15 as an input.
8957 # define CONFIG_RD15_AS_INPUT() (_TRISD15 = 1)
8958 /// Configure pin RD15 as an output.
8959 # define CONFIG_RD15_AS_OUTPUT() (_TRISD15 = 0)
8960 
8961 // Open-drain:
8962 # if defined(_ODCD15) || defined(__DOXYGEN__)
8963 /// Enable the open-drain driver on pin RD15.
8964 # define ENABLE_RD15_OPENDRAIN() (_ODCD15 = 1)
8965 /// Disable the open-drain driver on pin RD15.
8966 # define DISABLE_RD15_OPENDRAIN() (_ODCD15 = 0)
8967 # elif defined(_ODD15) // The PIF24F names this bit _OD instead of _ODC.
8968 # define ENABLE_RD15_OPENDRAIN() (_ODD15 = 1)
8969 # define DISABLE_RD15_OPENDRAIN() (_ODD15 = 0)
8970 # else
8971 # define DISABLE_RD15_OPENDRAIN() ((void) 0)
8972 # endif
8973 
8974 // Change notification, pullups and pulldowns:
8975 # if defined(_CNIED15) || defined(__DOXYGEN__)
8976 /// Enable the pullup on pin RD15.
8977 # define ENABLE_RD15_PULLUP() (_CNPUD15 = 1)
8978 /// Disable the pullup on pin RD15.
8979 # define DISABLE_RD15_PULLUP() (_CNPUD15 = 0)
8980 
8981 /// Enable the pulldown on pin RD15.
8982 # define ENABLE_RD15_PULLDOWN() (_CNPDD15 = 1)
8983 /// Disable the pulldown on pin RD15.
8984 # define DISABLE_RD15_PULLDOWN() (_CNPDD15 = 0)
8985 
8986 /// Enable the change notification interrupt on pin RD15.
8987 # define ENABLE_RD15_CN_INTERRUPT() (_CNIED15 = 1)
8988 /// Disable the change notification interrupt on pin RD15.
8989 # define DISABLE_RD15_CN_INTERRUPT() (_CNIED15 = 0)
8990 
8991 # elif defined(RD15_CN)
8992 # define ENABLE_RD15_PULLUP() (RXY_GPIO_CNPUE(RD15_CN) = 1)
8993 # define DISABLE_RD15_PULLUP() (RXY_GPIO_CNPUE(RD15_CN) = 0)
8994 
8995 # if RXY_HAS_CNPDE(RD15_CN)
8996 # define ENABLE_RD15_PULLDOWN() (RXY_GPIO_CNPDE(RD15_CN) = 1)
8997 # define DISABLE_RD15_PULLDOWN() (RXY_GPIO_CNPDE(RD15_CN) = 0)
8998 # else
8999 # define DISABLE_RD15_PULLDOWN() ((void) 0)
9000 # endif
9001 
9002 # define ENABLE_RD15_CN_INTERRUPT() (RXY_GPIO_CNIE(RD15_CN) = 1)
9003 # define DISABLE_RD15_CN_INTERRUPT() (RXY_GPIO_CNIE(RD15_CN) = 0)
9004 
9005 # else
9006 # define DISABLE_RD15_PULLUP() ((void) 0)
9007 # define DISABLE_RD15_PULLDOWN() ((void) 0)
9008 # define DISABLE_RD15_CN_INTERRUPT() ((void) 0)
9009 # endif
9010 
9011 // High-level config
9012 // -----------------
9013 /** This macro disables pullups/downs, enables analog functionality, and configures
9014  * pin RD15 as an input.
9015  */
9016 # if defined(_ANSD15) || defined(RD15_AN) || defined(__DOXYGEN__)
9017 # define CONFIG_RD15_AS_ANALOG() \
9018  do { \
9019  ENABLE_RD15_ANALOG(); \
9020  CONFIG_RD15_AS_INPUT(); \
9021  DISABLE_RD15_OPENDRAIN(); \
9022  DISABLE_RD15_PULLUP(); \
9023  DISABLE_RD15_PULLDOWN(); \
9024  } while (0)
9025 # endif
9026 
9027 /** This macro disables open-drain and pullups/downs,
9028  * configures pin RD15 for digital (not analog) operation, and
9029  * configures the pin as an input.
9030  */
9031 # define CONFIG_RD15_AS_DIG_INPUT() \
9032  do { \
9033  DISABLE_RD15_ANALOG(); \
9034  CONFIG_RD15_AS_INPUT(); \
9035  DISABLE_RD15_OPENDRAIN(); \
9036  DISABLE_RD15_PULLUP(); \
9037  DISABLE_RD15_PULLDOWN(); \
9038  } while (0)
9039 
9040 /** This macro disables open-drain and pullups/downs,
9041  * configures pin RD15 for digital (not analog) operation, and
9042  * configures the pin as an output.
9043  */
9044 # define CONFIG_RD15_AS_DIG_OUTPUT() \
9045  do { \
9046  DISABLE_RD15_ANALOG(); \
9047  CONFIG_RD15_AS_OUTPUT(); \
9048  DISABLE_RD15_OPENDRAIN(); \
9049  DISABLE_RD15_PULLUP(); \
9050  DISABLE_RD15_PULLDOWN(); \
9051  } while (0)
9052 
9053 #endif // #if defined(_RD15) || defined(__DOXYGEN__): Provide GPIO for RD15
9054 
9055 
9056 
9057 
9058 
9059 // Provide GPIO for RE0
9060 // ====================
9061 #if defined(_RE0) || defined(__DOXYGEN__)
9062 
9063 // Dummy macros for documentation only
9064 # ifdef __DOXYGEN__
9065 /// This macro specifies the RPy value associated with pin RE0.
9066 /// Its device-specific definition is given in pic24_ports_mapping.h.
9067 # define RE0_RP xx
9068 
9069 /// This macro specifies the ANn value associated with pin RE0.
9070 /// Its device-specific definition is given in pic24_ports_mapping.h.
9071 # define RE0_AN xx
9072 
9073 /// This macro specifies the CNm value associated with pin RE0.
9074 /// Its device-specific definition is given in pic24_ports_mapping.h.
9075 # define RE0_CN xx
9076 
9077 //@}
9078 # endif // #ifdef __DOXYGEN__
9079 
9080 
9081 // Low-level config
9082 // ----------------
9083 // Analog:
9084 # if defined(_ANSE0) || defined(__DOXYGEN__)
9085 /// Enable analog functionality on pin RE0.
9086 # define ENABLE_RE0_ANALOG() (_ANSE0 = 1)
9087 /// Disable analog functionality on pin RE0.
9088 # define DISABLE_RE0_ANALOG() (_ANSE0 = 0)
9089 # elif defined(RE0_AN)
9090 # define ENABLE_RE0_ANALOG() (RXY_GPIO_PCFG(RE0_AN) = 0)
9091 # define DISABLE_RE0_ANALOG() (RXY_GPIO_PCFG(RE0_AN) = 1)
9092 # else
9093 # define DISABLE_RE0_ANALOG() ((void) 0)
9094 # endif
9095 
9096 // Input/output:
9097 /// Configure pin RE0 as an input.
9098 # define CONFIG_RE0_AS_INPUT() (_TRISE0 = 1)
9099 /// Configure pin RE0 as an output.
9100 # define CONFIG_RE0_AS_OUTPUT() (_TRISE0 = 0)
9101 
9102 // Open-drain:
9103 # if defined(_ODCE0) || defined(__DOXYGEN__)
9104 /// Enable the open-drain driver on pin RE0.
9105 # define ENABLE_RE0_OPENDRAIN() (_ODCE0 = 1)
9106 /// Disable the open-drain driver on pin RE0.
9107 # define DISABLE_RE0_OPENDRAIN() (_ODCE0 = 0)
9108 # elif defined(_ODE0) // The PIF24F names this bit _OD instead of _ODC.
9109 # define ENABLE_RE0_OPENDRAIN() (_ODE0 = 1)
9110 # define DISABLE_RE0_OPENDRAIN() (_ODE0 = 0)
9111 # else
9112 # define DISABLE_RE0_OPENDRAIN() ((void) 0)
9113 # endif
9114 
9115 // Change notification, pullups and pulldowns:
9116 # if defined(_CNIEE0) || defined(__DOXYGEN__)
9117 /// Enable the pullup on pin RE0.
9118 # define ENABLE_RE0_PULLUP() (_CNPUE0 = 1)
9119 /// Disable the pullup on pin RE0.
9120 # define DISABLE_RE0_PULLUP() (_CNPUE0 = 0)
9121 
9122 /// Enable the pulldown on pin RE0.
9123 # define ENABLE_RE0_PULLDOWN() (_CNPDE0 = 1)
9124 /// Disable the pulldown on pin RE0.
9125 # define DISABLE_RE0_PULLDOWN() (_CNPDE0 = 0)
9126 
9127 /// Enable the change notification interrupt on pin RE0.
9128 # define ENABLE_RE0_CN_INTERRUPT() (_CNIEE0 = 1)
9129 /// Disable the change notification interrupt on pin RE0.
9130 # define DISABLE_RE0_CN_INTERRUPT() (_CNIEE0 = 0)
9131 
9132 # elif defined(RE0_CN)
9133 # define ENABLE_RE0_PULLUP() (RXY_GPIO_CNPUE(RE0_CN) = 1)
9134 # define DISABLE_RE0_PULLUP() (RXY_GPIO_CNPUE(RE0_CN) = 0)
9135 
9136 # if RXY_HAS_CNPDE(RE0_CN)
9137 # define ENABLE_RE0_PULLDOWN() (RXY_GPIO_CNPDE(RE0_CN) = 1)
9138 # define DISABLE_RE0_PULLDOWN() (RXY_GPIO_CNPDE(RE0_CN) = 0)
9139 # else
9140 # define DISABLE_RE0_PULLDOWN() ((void) 0)
9141 # endif
9142 
9143 # define ENABLE_RE0_CN_INTERRUPT() (RXY_GPIO_CNIE(RE0_CN) = 1)
9144 # define DISABLE_RE0_CN_INTERRUPT() (RXY_GPIO_CNIE(RE0_CN) = 0)
9145 
9146 # else
9147 # define DISABLE_RE0_PULLUP() ((void) 0)
9148 # define DISABLE_RE0_PULLDOWN() ((void) 0)
9149 # define DISABLE_RE0_CN_INTERRUPT() ((void) 0)
9150 # endif
9151 
9152 // High-level config
9153 // -----------------
9154 /** This macro disables pullups/downs, enables analog functionality, and configures
9155  * pin RE0 as an input.
9156  */
9157 # if defined(_ANSE0) || defined(RE0_AN) || defined(__DOXYGEN__)
9158 # define CONFIG_RE0_AS_ANALOG() \
9159  do { \
9160  ENABLE_RE0_ANALOG(); \
9161  CONFIG_RE0_AS_INPUT(); \
9162  DISABLE_RE0_OPENDRAIN(); \
9163  DISABLE_RE0_PULLUP(); \
9164  DISABLE_RE0_PULLDOWN(); \
9165  } while (0)
9166 # endif
9167 
9168 /** This macro disables open-drain and pullups/downs,
9169  * configures pin RE0 for digital (not analog) operation, and
9170  * configures the pin as an input.
9171  */
9172 # define CONFIG_RE0_AS_DIG_INPUT() \
9173  do { \
9174  DISABLE_RE0_ANALOG(); \
9175  CONFIG_RE0_AS_INPUT(); \
9176  DISABLE_RE0_OPENDRAIN(); \
9177  DISABLE_RE0_PULLUP(); \
9178  DISABLE_RE0_PULLDOWN(); \
9179  } while (0)
9180 
9181 /** This macro disables open-drain and pullups/downs,
9182  * configures pin RE0 for digital (not analog) operation, and
9183  * configures the pin as an output.
9184  */
9185 # define CONFIG_RE0_AS_DIG_OUTPUT() \
9186  do { \
9187  DISABLE_RE0_ANALOG(); \
9188  CONFIG_RE0_AS_OUTPUT(); \
9189  DISABLE_RE0_OPENDRAIN(); \
9190  DISABLE_RE0_PULLUP(); \
9191  DISABLE_RE0_PULLDOWN(); \
9192  } while (0)
9193 
9194 #endif // #if defined(_RE0) || defined(__DOXYGEN__): Provide GPIO for RE0
9195 
9196 
9197 
9198 
9199 
9200 // Provide GPIO for RE1
9201 // ====================
9202 #if defined(_RE1) || defined(__DOXYGEN__)
9203 
9204 // Dummy macros for documentation only
9205 # ifdef __DOXYGEN__
9206 /// This macro specifies the RPy value associated with pin RE1.
9207 /// Its device-specific definition is given in pic24_ports_mapping.h.
9208 # define RE1_RP xx
9209 
9210 /// This macro specifies the ANn value associated with pin RE1.
9211 /// Its device-specific definition is given in pic24_ports_mapping.h.
9212 # define RE1_AN xx
9213 
9214 /// This macro specifies the CNm value associated with pin RE1.
9215 /// Its device-specific definition is given in pic24_ports_mapping.h.
9216 # define RE1_CN xx
9217 
9218 //@}
9219 # endif // #ifdef __DOXYGEN__
9220 
9221 
9222 // Low-level config
9223 // ----------------
9224 // Analog:
9225 # if defined(_ANSE1) || defined(__DOXYGEN__)
9226 /// Enable analog functionality on pin RE1.
9227 # define ENABLE_RE1_ANALOG() (_ANSE1 = 1)
9228 /// Disable analog functionality on pin RE1.
9229 # define DISABLE_RE1_ANALOG() (_ANSE1 = 0)
9230 # elif defined(RE1_AN)
9231 # define ENABLE_RE1_ANALOG() (RXY_GPIO_PCFG(RE1_AN) = 0)
9232 # define DISABLE_RE1_ANALOG() (RXY_GPIO_PCFG(RE1_AN) = 1)
9233 # else
9234 # define DISABLE_RE1_ANALOG() ((void) 0)
9235 # endif
9236 
9237 // Input/output:
9238 /// Configure pin RE1 as an input.
9239 # define CONFIG_RE1_AS_INPUT() (_TRISE1 = 1)
9240 /// Configure pin RE1 as an output.
9241 # define CONFIG_RE1_AS_OUTPUT() (_TRISE1 = 0)
9242 
9243 // Open-drain:
9244 # if defined(_ODCE1) || defined(__DOXYGEN__)
9245 /// Enable the open-drain driver on pin RE1.
9246 # define ENABLE_RE1_OPENDRAIN() (_ODCE1 = 1)
9247 /// Disable the open-drain driver on pin RE1.
9248 # define DISABLE_RE1_OPENDRAIN() (_ODCE1 = 0)
9249 # elif defined(_ODE1) // The PIF24F names this bit _OD instead of _ODC.
9250 # define ENABLE_RE1_OPENDRAIN() (_ODE1 = 1)
9251 # define DISABLE_RE1_OPENDRAIN() (_ODE1 = 0)
9252 # else
9253 # define DISABLE_RE1_OPENDRAIN() ((void) 0)
9254 # endif
9255 
9256 // Change notification, pullups and pulldowns:
9257 # if defined(_CNIEE1) || defined(__DOXYGEN__)
9258 /// Enable the pullup on pin RE1.
9259 # define ENABLE_RE1_PULLUP() (_CNPUE1 = 1)
9260 /// Disable the pullup on pin RE1.
9261 # define DISABLE_RE1_PULLUP() (_CNPUE1 = 0)
9262 
9263 /// Enable the pulldown on pin RE1.
9264 # define ENABLE_RE1_PULLDOWN() (_CNPDE1 = 1)
9265 /// Disable the pulldown on pin RE1.
9266 # define DISABLE_RE1_PULLDOWN() (_CNPDE1 = 0)
9267 
9268 /// Enable the change notification interrupt on pin RE1.
9269 # define ENABLE_RE1_CN_INTERRUPT() (_CNIEE1 = 1)
9270 /// Disable the change notification interrupt on pin RE1.
9271 # define DISABLE_RE1_CN_INTERRUPT() (_CNIEE1 = 0)
9272 
9273 # elif defined(RE1_CN)
9274 # define ENABLE_RE1_PULLUP() (RXY_GPIO_CNPUE(RE1_CN) = 1)
9275 # define DISABLE_RE1_PULLUP() (RXY_GPIO_CNPUE(RE1_CN) = 0)
9276 
9277 # if RXY_HAS_CNPDE(RE1_CN)
9278 # define ENABLE_RE1_PULLDOWN() (RXY_GPIO_CNPDE(RE1_CN) = 1)
9279 # define DISABLE_RE1_PULLDOWN() (RXY_GPIO_CNPDE(RE1_CN) = 0)
9280 # else
9281 # define DISABLE_RE1_PULLDOWN() ((void) 0)
9282 # endif
9283 
9284 # define ENABLE_RE1_CN_INTERRUPT() (RXY_GPIO_CNIE(RE1_CN) = 1)
9285 # define DISABLE_RE1_CN_INTERRUPT() (RXY_GPIO_CNIE(RE1_CN) = 0)
9286 
9287 # else
9288 # define DISABLE_RE1_PULLUP() ((void) 0)
9289 # define DISABLE_RE1_PULLDOWN() ((void) 0)
9290 # define DISABLE_RE1_CN_INTERRUPT() ((void) 0)
9291 # endif
9292 
9293 // High-level config
9294 // -----------------
9295 /** This macro disables pullups/downs, enables analog functionality, and configures
9296  * pin RE1 as an input.
9297  */
9298 # if defined(_ANSE1) || defined(RE1_AN) || defined(__DOXYGEN__)
9299 # define CONFIG_RE1_AS_ANALOG() \
9300  do { \
9301  ENABLE_RE1_ANALOG(); \
9302  CONFIG_RE1_AS_INPUT(); \
9303  DISABLE_RE1_OPENDRAIN(); \
9304  DISABLE_RE1_PULLUP(); \
9305  DISABLE_RE1_PULLDOWN(); \
9306  } while (0)
9307 # endif
9308 
9309 /** This macro disables open-drain and pullups/downs,
9310  * configures pin RE1 for digital (not analog) operation, and
9311  * configures the pin as an input.
9312  */
9313 # define CONFIG_RE1_AS_DIG_INPUT() \
9314  do { \
9315  DISABLE_RE1_ANALOG(); \
9316  CONFIG_RE1_AS_INPUT(); \
9317  DISABLE_RE1_OPENDRAIN(); \
9318  DISABLE_RE1_PULLUP(); \
9319  DISABLE_RE1_PULLDOWN(); \
9320  } while (0)
9321 
9322 /** This macro disables open-drain and pullups/downs,
9323  * configures pin RE1 for digital (not analog) operation, and
9324  * configures the pin as an output.
9325  */
9326 # define CONFIG_RE1_AS_DIG_OUTPUT() \
9327  do { \
9328  DISABLE_RE1_ANALOG(); \
9329  CONFIG_RE1_AS_OUTPUT(); \
9330  DISABLE_RE1_OPENDRAIN(); \
9331  DISABLE_RE1_PULLUP(); \
9332  DISABLE_RE1_PULLDOWN(); \
9333  } while (0)
9334 
9335 #endif // #if defined(_RE1) || defined(__DOXYGEN__): Provide GPIO for RE1
9336 
9337 
9338 
9339 
9340 
9341 // Provide GPIO for RE2
9342 // ====================
9343 #if defined(_RE2) || defined(__DOXYGEN__)
9344 
9345 // Dummy macros for documentation only
9346 # ifdef __DOXYGEN__
9347 /// This macro specifies the RPy value associated with pin RE2.
9348 /// Its device-specific definition is given in pic24_ports_mapping.h.
9349 # define RE2_RP xx
9350 
9351 /// This macro specifies the ANn value associated with pin RE2.
9352 /// Its device-specific definition is given in pic24_ports_mapping.h.
9353 # define RE2_AN xx
9354 
9355 /// This macro specifies the CNm value associated with pin RE2.
9356 /// Its device-specific definition is given in pic24_ports_mapping.h.
9357 # define RE2_CN xx
9358 
9359 //@}
9360 # endif // #ifdef __DOXYGEN__
9361 
9362 
9363 // Low-level config
9364 // ----------------
9365 // Analog:
9366 # if defined(_ANSE2) || defined(__DOXYGEN__)
9367 /// Enable analog functionality on pin RE2.
9368 # define ENABLE_RE2_ANALOG() (_ANSE2 = 1)
9369 /// Disable analog functionality on pin RE2.
9370 # define DISABLE_RE2_ANALOG() (_ANSE2 = 0)
9371 # elif defined(RE2_AN)
9372 # define ENABLE_RE2_ANALOG() (RXY_GPIO_PCFG(RE2_AN) = 0)
9373 # define DISABLE_RE2_ANALOG() (RXY_GPIO_PCFG(RE2_AN) = 1)
9374 # else
9375 # define DISABLE_RE2_ANALOG() ((void) 0)
9376 # endif
9377 
9378 // Input/output:
9379 /// Configure pin RE2 as an input.
9380 # define CONFIG_RE2_AS_INPUT() (_TRISE2 = 1)
9381 /// Configure pin RE2 as an output.
9382 # define CONFIG_RE2_AS_OUTPUT() (_TRISE2 = 0)
9383 
9384 // Open-drain:
9385 # if defined(_ODCE2) || defined(__DOXYGEN__)
9386 /// Enable the open-drain driver on pin RE2.
9387 # define ENABLE_RE2_OPENDRAIN() (_ODCE2 = 1)
9388 /// Disable the open-drain driver on pin RE2.
9389 # define DISABLE_RE2_OPENDRAIN() (_ODCE2 = 0)
9390 # elif defined(_ODE2) // The PIF24F names this bit _OD instead of _ODC.
9391 # define ENABLE_RE2_OPENDRAIN() (_ODE2 = 1)
9392 # define DISABLE_RE2_OPENDRAIN() (_ODE2 = 0)
9393 # else
9394 # define DISABLE_RE2_OPENDRAIN() ((void) 0)
9395 # endif
9396 
9397 // Change notification, pullups and pulldowns:
9398 # if defined(_CNIEE2) || defined(__DOXYGEN__)
9399 /// Enable the pullup on pin RE2.
9400 # define ENABLE_RE2_PULLUP() (_CNPUE2 = 1)
9401 /// Disable the pullup on pin RE2.
9402 # define DISABLE_RE2_PULLUP() (_CNPUE2 = 0)
9403 
9404 /// Enable the pulldown on pin RE2.
9405 # define ENABLE_RE2_PULLDOWN() (_CNPDE2 = 1)
9406 /// Disable the pulldown on pin RE2.
9407 # define DISABLE_RE2_PULLDOWN() (_CNPDE2 = 0)
9408 
9409 /// Enable the change notification interrupt on pin RE2.
9410 # define ENABLE_RE2_CN_INTERRUPT() (_CNIEE2 = 1)
9411 /// Disable the change notification interrupt on pin RE2.
9412 # define DISABLE_RE2_CN_INTERRUPT() (_CNIEE2 = 0)
9413 
9414 # elif defined(RE2_CN)
9415 # define ENABLE_RE2_PULLUP() (RXY_GPIO_CNPUE(RE2_CN) = 1)
9416 # define DISABLE_RE2_PULLUP() (RXY_GPIO_CNPUE(RE2_CN) = 0)
9417 
9418 # if RXY_HAS_CNPDE(RE2_CN)
9419 # define ENABLE_RE2_PULLDOWN() (RXY_GPIO_CNPDE(RE2_CN) = 1)
9420 # define DISABLE_RE2_PULLDOWN() (RXY_GPIO_CNPDE(RE2_CN) = 0)
9421 # else
9422 # define DISABLE_RE2_PULLDOWN() ((void) 0)
9423 # endif
9424 
9425 # define ENABLE_RE2_CN_INTERRUPT() (RXY_GPIO_CNIE(RE2_CN) = 1)
9426 # define DISABLE_RE2_CN_INTERRUPT() (RXY_GPIO_CNIE(RE2_CN) = 0)
9427 
9428 # else
9429 # define DISABLE_RE2_PULLUP() ((void) 0)
9430 # define DISABLE_RE2_PULLDOWN() ((void) 0)
9431 # define DISABLE_RE2_CN_INTERRUPT() ((void) 0)
9432 # endif
9433 
9434 // High-level config
9435 // -----------------
9436 /** This macro disables pullups/downs, enables analog functionality, and configures
9437  * pin RE2 as an input.
9438  */
9439 # if defined(_ANSE2) || defined(RE2_AN) || defined(__DOXYGEN__)
9440 # define CONFIG_RE2_AS_ANALOG() \
9441  do { \
9442  ENABLE_RE2_ANALOG(); \
9443  CONFIG_RE2_AS_INPUT(); \
9444  DISABLE_RE2_OPENDRAIN(); \
9445  DISABLE_RE2_PULLUP(); \
9446  DISABLE_RE2_PULLDOWN(); \
9447  } while (0)
9448 # endif
9449 
9450 /** This macro disables open-drain and pullups/downs,
9451  * configures pin RE2 for digital (not analog) operation, and
9452  * configures the pin as an input.
9453  */
9454 # define CONFIG_RE2_AS_DIG_INPUT() \
9455  do { \
9456  DISABLE_RE2_ANALOG(); \
9457  CONFIG_RE2_AS_INPUT(); \
9458  DISABLE_RE2_OPENDRAIN(); \
9459  DISABLE_RE2_PULLUP(); \
9460  DISABLE_RE2_PULLDOWN(); \
9461  } while (0)
9462 
9463 /** This macro disables open-drain and pullups/downs,
9464  * configures pin RE2 for digital (not analog) operation, and
9465  * configures the pin as an output.
9466  */
9467 # define CONFIG_RE2_AS_DIG_OUTPUT() \
9468  do { \
9469  DISABLE_RE2_ANALOG(); \
9470  CONFIG_RE2_AS_OUTPUT(); \
9471  DISABLE_RE2_OPENDRAIN(); \
9472  DISABLE_RE2_PULLUP(); \
9473  DISABLE_RE2_PULLDOWN(); \
9474  } while (0)
9475 
9476 #endif // #if defined(_RE2) || defined(__DOXYGEN__): Provide GPIO for RE2
9477 
9478 
9479 
9480 
9481 
9482 // Provide GPIO for RE3
9483 // ====================
9484 #if defined(_RE3) || defined(__DOXYGEN__)
9485 
9486 // Dummy macros for documentation only
9487 # ifdef __DOXYGEN__
9488 /// This macro specifies the RPy value associated with pin RE3.
9489 /// Its device-specific definition is given in pic24_ports_mapping.h.
9490 # define RE3_RP xx
9491 
9492 /// This macro specifies the ANn value associated with pin RE3.
9493 /// Its device-specific definition is given in pic24_ports_mapping.h.
9494 # define RE3_AN xx
9495 
9496 /// This macro specifies the CNm value associated with pin RE3.
9497 /// Its device-specific definition is given in pic24_ports_mapping.h.
9498 # define RE3_CN xx
9499 
9500 //@}
9501 # endif // #ifdef __DOXYGEN__
9502 
9503 
9504 // Low-level config
9505 // ----------------
9506 // Analog:
9507 # if defined(_ANSE3) || defined(__DOXYGEN__)
9508 /// Enable analog functionality on pin RE3.
9509 # define ENABLE_RE3_ANALOG() (_ANSE3 = 1)
9510 /// Disable analog functionality on pin RE3.
9511 # define DISABLE_RE3_ANALOG() (_ANSE3 = 0)
9512 # elif defined(RE3_AN)
9513 # define ENABLE_RE3_ANALOG() (RXY_GPIO_PCFG(RE3_AN) = 0)
9514 # define DISABLE_RE3_ANALOG() (RXY_GPIO_PCFG(RE3_AN) = 1)
9515 # else
9516 # define DISABLE_RE3_ANALOG() ((void) 0)
9517 # endif
9518 
9519 // Input/output:
9520 /// Configure pin RE3 as an input.
9521 # define CONFIG_RE3_AS_INPUT() (_TRISE3 = 1)
9522 /// Configure pin RE3 as an output.
9523 # define CONFIG_RE3_AS_OUTPUT() (_TRISE3 = 0)
9524 
9525 // Open-drain:
9526 # if defined(_ODCE3) || defined(__DOXYGEN__)
9527 /// Enable the open-drain driver on pin RE3.
9528 # define ENABLE_RE3_OPENDRAIN() (_ODCE3 = 1)
9529 /// Disable the open-drain driver on pin RE3.
9530 # define DISABLE_RE3_OPENDRAIN() (_ODCE3 = 0)
9531 # elif defined(_ODE3) // The PIF24F names this bit _OD instead of _ODC.
9532 # define ENABLE_RE3_OPENDRAIN() (_ODE3 = 1)
9533 # define DISABLE_RE3_OPENDRAIN() (_ODE3 = 0)
9534 # else
9535 # define DISABLE_RE3_OPENDRAIN() ((void) 0)
9536 # endif
9537 
9538 // Change notification, pullups and pulldowns:
9539 # if defined(_CNIEE3) || defined(__DOXYGEN__)
9540 /// Enable the pullup on pin RE3.
9541 # define ENABLE_RE3_PULLUP() (_CNPUE3 = 1)
9542 /// Disable the pullup on pin RE3.
9543 # define DISABLE_RE3_PULLUP() (_CNPUE3 = 0)
9544 
9545 /// Enable the pulldown on pin RE3.
9546 # define ENABLE_RE3_PULLDOWN() (_CNPDE3 = 1)
9547 /// Disable the pulldown on pin RE3.
9548 # define DISABLE_RE3_PULLDOWN() (_CNPDE3 = 0)
9549 
9550 /// Enable the change notification interrupt on pin RE3.
9551 # define ENABLE_RE3_CN_INTERRUPT() (_CNIEE3 = 1)
9552 /// Disable the change notification interrupt on pin RE3.
9553 # define DISABLE_RE3_CN_INTERRUPT() (_CNIEE3 = 0)
9554 
9555 # elif defined(RE3_CN)
9556 # define ENABLE_RE3_PULLUP() (RXY_GPIO_CNPUE(RE3_CN) = 1)
9557 # define DISABLE_RE3_PULLUP() (RXY_GPIO_CNPUE(RE3_CN) = 0)
9558 
9559 # if RXY_HAS_CNPDE(RE3_CN)
9560 # define ENABLE_RE3_PULLDOWN() (RXY_GPIO_CNPDE(RE3_CN) = 1)
9561 # define DISABLE_RE3_PULLDOWN() (RXY_GPIO_CNPDE(RE3_CN) = 0)
9562 # else
9563 # define DISABLE_RE3_PULLDOWN() ((void) 0)
9564 # endif
9565 
9566 # define ENABLE_RE3_CN_INTERRUPT() (RXY_GPIO_CNIE(RE3_CN) = 1)
9567 # define DISABLE_RE3_CN_INTERRUPT() (RXY_GPIO_CNIE(RE3_CN) = 0)
9568 
9569 # else
9570 # define DISABLE_RE3_PULLUP() ((void) 0)
9571 # define DISABLE_RE3_PULLDOWN() ((void) 0)
9572 # define DISABLE_RE3_CN_INTERRUPT() ((void) 0)
9573 # endif
9574 
9575 // High-level config
9576 // -----------------
9577 /** This macro disables pullups/downs, enables analog functionality, and configures
9578  * pin RE3 as an input.
9579  */
9580 # if defined(_ANSE3) || defined(RE3_AN) || defined(__DOXYGEN__)
9581 # define CONFIG_RE3_AS_ANALOG() \
9582  do { \
9583  ENABLE_RE3_ANALOG(); \
9584  CONFIG_RE3_AS_INPUT(); \
9585  DISABLE_RE3_OPENDRAIN(); \
9586  DISABLE_RE3_PULLUP(); \
9587  DISABLE_RE3_PULLDOWN(); \
9588  } while (0)
9589 # endif
9590 
9591 /** This macro disables open-drain and pullups/downs,
9592  * configures pin RE3 for digital (not analog) operation, and
9593  * configures the pin as an input.
9594  */
9595 # define CONFIG_RE3_AS_DIG_INPUT() \
9596  do { \
9597  DISABLE_RE3_ANALOG(); \
9598  CONFIG_RE3_AS_INPUT(); \
9599  DISABLE_RE3_OPENDRAIN(); \
9600  DISABLE_RE3_PULLUP(); \
9601  DISABLE_RE3_PULLDOWN(); \
9602  } while (0)
9603 
9604 /** This macro disables open-drain and pullups/downs,
9605  * configures pin RE3 for digital (not analog) operation, and
9606  * configures the pin as an output.
9607  */
9608 # define CONFIG_RE3_AS_DIG_OUTPUT() \
9609  do { \
9610  DISABLE_RE3_ANALOG(); \
9611  CONFIG_RE3_AS_OUTPUT(); \
9612  DISABLE_RE3_OPENDRAIN(); \
9613  DISABLE_RE3_PULLUP(); \
9614  DISABLE_RE3_PULLDOWN(); \
9615  } while (0)
9616 
9617 #endif // #if defined(_RE3) || defined(__DOXYGEN__): Provide GPIO for RE3
9618 
9619 
9620 
9621 
9622 
9623 // Provide GPIO for RE4
9624 // ====================
9625 #if defined(_RE4) || defined(__DOXYGEN__)
9626 
9627 // Dummy macros for documentation only
9628 # ifdef __DOXYGEN__
9629 /// This macro specifies the RPy value associated with pin RE4.
9630 /// Its device-specific definition is given in pic24_ports_mapping.h.
9631 # define RE4_RP xx
9632 
9633 /// This macro specifies the ANn value associated with pin RE4.
9634 /// Its device-specific definition is given in pic24_ports_mapping.h.
9635 # define RE4_AN xx
9636 
9637 /// This macro specifies the CNm value associated with pin RE4.
9638 /// Its device-specific definition is given in pic24_ports_mapping.h.
9639 # define RE4_CN xx
9640 
9641 //@}
9642 # endif // #ifdef __DOXYGEN__
9643 
9644 
9645 // Low-level config
9646 // ----------------
9647 // Analog:
9648 # if defined(_ANSE4) || defined(__DOXYGEN__)
9649 /// Enable analog functionality on pin RE4.
9650 # define ENABLE_RE4_ANALOG() (_ANSE4 = 1)
9651 /// Disable analog functionality on pin RE4.
9652 # define DISABLE_RE4_ANALOG() (_ANSE4 = 0)
9653 # elif defined(RE4_AN)
9654 # define ENABLE_RE4_ANALOG() (RXY_GPIO_PCFG(RE4_AN) = 0)
9655 # define DISABLE_RE4_ANALOG() (RXY_GPIO_PCFG(RE4_AN) = 1)
9656 # else
9657 # define DISABLE_RE4_ANALOG() ((void) 0)
9658 # endif
9659 
9660 // Input/output:
9661 /// Configure pin RE4 as an input.
9662 # define CONFIG_RE4_AS_INPUT() (_TRISE4 = 1)
9663 /// Configure pin RE4 as an output.
9664 # define CONFIG_RE4_AS_OUTPUT() (_TRISE4 = 0)
9665 
9666 // Open-drain:
9667 # if defined(_ODCE4) || defined(__DOXYGEN__)
9668 /// Enable the open-drain driver on pin RE4.
9669 # define ENABLE_RE4_OPENDRAIN() (_ODCE4 = 1)
9670 /// Disable the open-drain driver on pin RE4.
9671 # define DISABLE_RE4_OPENDRAIN() (_ODCE4 = 0)
9672 # elif defined(_ODE4) // The PIF24F names this bit _OD instead of _ODC.
9673 # define ENABLE_RE4_OPENDRAIN() (_ODE4 = 1)
9674 # define DISABLE_RE4_OPENDRAIN() (_ODE4 = 0)
9675 # else
9676 # define DISABLE_RE4_OPENDRAIN() ((void) 0)
9677 # endif
9678 
9679 // Change notification, pullups and pulldowns:
9680 # if defined(_CNIEE4) || defined(__DOXYGEN__)
9681 /// Enable the pullup on pin RE4.
9682 # define ENABLE_RE4_PULLUP() (_CNPUE4 = 1)
9683 /// Disable the pullup on pin RE4.
9684 # define DISABLE_RE4_PULLUP() (_CNPUE4 = 0)
9685 
9686 /// Enable the pulldown on pin RE4.
9687 # define ENABLE_RE4_PULLDOWN() (_CNPDE4 = 1)
9688 /// Disable the pulldown on pin RE4.
9689 # define DISABLE_RE4_PULLDOWN() (_CNPDE4 = 0)
9690 
9691 /// Enable the change notification interrupt on pin RE4.
9692 # define ENABLE_RE4_CN_INTERRUPT() (_CNIEE4 = 1)
9693 /// Disable the change notification interrupt on pin RE4.
9694 # define DISABLE_RE4_CN_INTERRUPT() (_CNIEE4 = 0)
9695 
9696 # elif defined(RE4_CN)
9697 # define ENABLE_RE4_PULLUP() (RXY_GPIO_CNPUE(RE4_CN) = 1)
9698 # define DISABLE_RE4_PULLUP() (RXY_GPIO_CNPUE(RE4_CN) = 0)
9699 
9700 # if RXY_HAS_CNPDE(RE4_CN)
9701 # define ENABLE_RE4_PULLDOWN() (RXY_GPIO_CNPDE(RE4_CN) = 1)
9702 # define DISABLE_RE4_PULLDOWN() (RXY_GPIO_CNPDE(RE4_CN) = 0)
9703 # else
9704 # define DISABLE_RE4_PULLDOWN() ((void) 0)
9705 # endif
9706 
9707 # define ENABLE_RE4_CN_INTERRUPT() (RXY_GPIO_CNIE(RE4_CN) = 1)
9708 # define DISABLE_RE4_CN_INTERRUPT() (RXY_GPIO_CNIE(RE4_CN) = 0)
9709 
9710 # else
9711 # define DISABLE_RE4_PULLUP() ((void) 0)
9712 # define DISABLE_RE4_PULLDOWN() ((void) 0)
9713 # define DISABLE_RE4_CN_INTERRUPT() ((void) 0)
9714 # endif
9715 
9716 // High-level config
9717 // -----------------
9718 /** This macro disables pullups/downs, enables analog functionality, and configures
9719  * pin RE4 as an input.
9720  */
9721 # if defined(_ANSE4) || defined(RE4_AN) || defined(__DOXYGEN__)
9722 # define CONFIG_RE4_AS_ANALOG() \
9723  do { \
9724  ENABLE_RE4_ANALOG(); \
9725  CONFIG_RE4_AS_INPUT(); \
9726  DISABLE_RE4_OPENDRAIN(); \
9727  DISABLE_RE4_PULLUP(); \
9728  DISABLE_RE4_PULLDOWN(); \
9729  } while (0)
9730 # endif
9731 
9732 /** This macro disables open-drain and pullups/downs,
9733  * configures pin RE4 for digital (not analog) operation, and
9734  * configures the pin as an input.
9735  */
9736 # define CONFIG_RE4_AS_DIG_INPUT() \
9737  do { \
9738  DISABLE_RE4_ANALOG(); \
9739  CONFIG_RE4_AS_INPUT(); \
9740  DISABLE_RE4_OPENDRAIN(); \
9741  DISABLE_RE4_PULLUP(); \
9742  DISABLE_RE4_PULLDOWN(); \
9743  } while (0)
9744 
9745 /** This macro disables open-drain and pullups/downs,
9746  * configures pin RE4 for digital (not analog) operation, and
9747  * configures the pin as an output.
9748  */
9749 # define CONFIG_RE4_AS_DIG_OUTPUT() \
9750  do { \
9751  DISABLE_RE4_ANALOG(); \
9752  CONFIG_RE4_AS_OUTPUT(); \
9753  DISABLE_RE4_OPENDRAIN(); \
9754  DISABLE_RE4_PULLUP(); \
9755  DISABLE_RE4_PULLDOWN(); \
9756  } while (0)
9757 
9758 #endif // #if defined(_RE4) || defined(__DOXYGEN__): Provide GPIO for RE4
9759 
9760 
9761 
9762 
9763 
9764 // Provide GPIO for RE5
9765 // ====================
9766 #if defined(_RE5) || defined(__DOXYGEN__)
9767 
9768 // Dummy macros for documentation only
9769 # ifdef __DOXYGEN__
9770 /// This macro specifies the RPy value associated with pin RE5.
9771 /// Its device-specific definition is given in pic24_ports_mapping.h.
9772 # define RE5_RP xx
9773 
9774 /// This macro specifies the ANn value associated with pin RE5.
9775 /// Its device-specific definition is given in pic24_ports_mapping.h.
9776 # define RE5_AN xx
9777 
9778 /// This macro specifies the CNm value associated with pin RE5.
9779 /// Its device-specific definition is given in pic24_ports_mapping.h.
9780 # define RE5_CN xx
9781 
9782 //@}
9783 # endif // #ifdef __DOXYGEN__
9784 
9785 
9786 // Low-level config
9787 // ----------------
9788 // Analog:
9789 # if defined(_ANSE5) || defined(__DOXYGEN__)
9790 /// Enable analog functionality on pin RE5.
9791 # define ENABLE_RE5_ANALOG() (_ANSE5 = 1)
9792 /// Disable analog functionality on pin RE5.
9793 # define DISABLE_RE5_ANALOG() (_ANSE5 = 0)
9794 # elif defined(RE5_AN)
9795 # define ENABLE_RE5_ANALOG() (RXY_GPIO_PCFG(RE5_AN) = 0)
9796 # define DISABLE_RE5_ANALOG() (RXY_GPIO_PCFG(RE5_AN) = 1)
9797 # else
9798 # define DISABLE_RE5_ANALOG() ((void) 0)
9799 # endif
9800 
9801 // Input/output:
9802 /// Configure pin RE5 as an input.
9803 # define CONFIG_RE5_AS_INPUT() (_TRISE5 = 1)
9804 /// Configure pin RE5 as an output.
9805 # define CONFIG_RE5_AS_OUTPUT() (_TRISE5 = 0)
9806 
9807 // Open-drain:
9808 # if defined(_ODCE5) || defined(__DOXYGEN__)
9809 /// Enable the open-drain driver on pin RE5.
9810 # define ENABLE_RE5_OPENDRAIN() (_ODCE5 = 1)
9811 /// Disable the open-drain driver on pin RE5.
9812 # define DISABLE_RE5_OPENDRAIN() (_ODCE5 = 0)
9813 # elif defined(_ODE5) // The PIF24F names this bit _OD instead of _ODC.
9814 # define ENABLE_RE5_OPENDRAIN() (_ODE5 = 1)
9815 # define DISABLE_RE5_OPENDRAIN() (_ODE5 = 0)
9816 # else
9817 # define DISABLE_RE5_OPENDRAIN() ((void) 0)
9818 # endif
9819 
9820 // Change notification, pullups and pulldowns:
9821 # if defined(_CNIEE5) || defined(__DOXYGEN__)
9822 /// Enable the pullup on pin RE5.
9823 # define ENABLE_RE5_PULLUP() (_CNPUE5 = 1)
9824 /// Disable the pullup on pin RE5.
9825 # define DISABLE_RE5_PULLUP() (_CNPUE5 = 0)
9826 
9827 /// Enable the pulldown on pin RE5.
9828 # define ENABLE_RE5_PULLDOWN() (_CNPDE5 = 1)
9829 /// Disable the pulldown on pin RE5.
9830 # define DISABLE_RE5_PULLDOWN() (_CNPDE5 = 0)
9831 
9832 /// Enable the change notification interrupt on pin RE5.
9833 # define ENABLE_RE5_CN_INTERRUPT() (_CNIEE5 = 1)
9834 /// Disable the change notification interrupt on pin RE5.
9835 # define DISABLE_RE5_CN_INTERRUPT() (_CNIEE5 = 0)
9836 
9837 # elif defined(RE5_CN)
9838 # define ENABLE_RE5_PULLUP() (RXY_GPIO_CNPUE(RE5_CN) = 1)
9839 # define DISABLE_RE5_PULLUP() (RXY_GPIO_CNPUE(RE5_CN) = 0)
9840 
9841 # if RXY_HAS_CNPDE(RE5_CN)
9842 # define ENABLE_RE5_PULLDOWN() (RXY_GPIO_CNPDE(RE5_CN) = 1)
9843 # define DISABLE_RE5_PULLDOWN() (RXY_GPIO_CNPDE(RE5_CN) = 0)
9844 # else
9845 # define DISABLE_RE5_PULLDOWN() ((void) 0)
9846 # endif
9847 
9848 # define ENABLE_RE5_CN_INTERRUPT() (RXY_GPIO_CNIE(RE5_CN) = 1)
9849 # define DISABLE_RE5_CN_INTERRUPT() (RXY_GPIO_CNIE(RE5_CN) = 0)
9850 
9851 # else
9852 # define DISABLE_RE5_PULLUP() ((void) 0)
9853 # define DISABLE_RE5_PULLDOWN() ((void) 0)
9854 # define DISABLE_RE5_CN_INTERRUPT() ((void) 0)
9855 # endif
9856 
9857 // High-level config
9858 // -----------------
9859 /** This macro disables pullups/downs, enables analog functionality, and configures
9860  * pin RE5 as an input.
9861  */
9862 # if defined(_ANSE5) || defined(RE5_AN) || defined(__DOXYGEN__)
9863 # define CONFIG_RE5_AS_ANALOG() \
9864  do { \
9865  ENABLE_RE5_ANALOG(); \
9866  CONFIG_RE5_AS_INPUT(); \
9867  DISABLE_RE5_OPENDRAIN(); \
9868  DISABLE_RE5_PULLUP(); \
9869  DISABLE_RE5_PULLDOWN(); \
9870  } while (0)
9871 # endif
9872 
9873 /** This macro disables open-drain and pullups/downs,
9874  * configures pin RE5 for digital (not analog) operation, and
9875  * configures the pin as an input.
9876  */
9877 # define CONFIG_RE5_AS_DIG_INPUT() \
9878  do { \
9879  DISABLE_RE5_ANALOG(); \
9880  CONFIG_RE5_AS_INPUT(); \
9881  DISABLE_RE5_OPENDRAIN(); \
9882  DISABLE_RE5_PULLUP(); \
9883  DISABLE_RE5_PULLDOWN(); \
9884  } while (0)
9885 
9886 /** This macro disables open-drain and pullups/downs,
9887  * configures pin RE5 for digital (not analog) operation, and
9888  * configures the pin as an output.
9889  */
9890 # define CONFIG_RE5_AS_DIG_OUTPUT() \
9891  do { \
9892  DISABLE_RE5_ANALOG(); \
9893  CONFIG_RE5_AS_OUTPUT(); \
9894  DISABLE_RE5_OPENDRAIN(); \
9895  DISABLE_RE5_PULLUP(); \
9896  DISABLE_RE5_PULLDOWN(); \
9897  } while (0)
9898 
9899 #endif // #if defined(_RE5) || defined(__DOXYGEN__): Provide GPIO for RE5
9900 
9901 
9902 
9903 
9904 
9905 // Provide GPIO for RE6
9906 // ====================
9907 #if defined(_RE6) || defined(__DOXYGEN__)
9908 
9909 // Dummy macros for documentation only
9910 # ifdef __DOXYGEN__
9911 /// This macro specifies the RPy value associated with pin RE6.
9912 /// Its device-specific definition is given in pic24_ports_mapping.h.
9913 # define RE6_RP xx
9914 
9915 /// This macro specifies the ANn value associated with pin RE6.
9916 /// Its device-specific definition is given in pic24_ports_mapping.h.
9917 # define RE6_AN xx
9918 
9919 /// This macro specifies the CNm value associated with pin RE6.
9920 /// Its device-specific definition is given in pic24_ports_mapping.h.
9921 # define RE6_CN xx
9922 
9923 //@}
9924 # endif // #ifdef __DOXYGEN__
9925 
9926 
9927 // Low-level config
9928 // ----------------
9929 // Analog:
9930 # if defined(_ANSE6) || defined(__DOXYGEN__)
9931 /// Enable analog functionality on pin RE6.
9932 # define ENABLE_RE6_ANALOG() (_ANSE6 = 1)
9933 /// Disable analog functionality on pin RE6.
9934 # define DISABLE_RE6_ANALOG() (_ANSE6 = 0)
9935 # elif defined(RE6_AN)
9936 # define ENABLE_RE6_ANALOG() (RXY_GPIO_PCFG(RE6_AN) = 0)
9937 # define DISABLE_RE6_ANALOG() (RXY_GPIO_PCFG(RE6_AN) = 1)
9938 # else
9939 # define DISABLE_RE6_ANALOG() ((void) 0)
9940 # endif
9941 
9942 // Input/output:
9943 /// Configure pin RE6 as an input.
9944 # define CONFIG_RE6_AS_INPUT() (_TRISE6 = 1)
9945 /// Configure pin RE6 as an output.
9946 # define CONFIG_RE6_AS_OUTPUT() (_TRISE6 = 0)
9947 
9948 // Open-drain:
9949 # if defined(_ODCE6) || defined(__DOXYGEN__)
9950 /// Enable the open-drain driver on pin RE6.
9951 # define ENABLE_RE6_OPENDRAIN() (_ODCE6 = 1)
9952 /// Disable the open-drain driver on pin RE6.
9953 # define DISABLE_RE6_OPENDRAIN() (_ODCE6 = 0)
9954 # elif defined(_ODE6) // The PIF24F names this bit _OD instead of _ODC.
9955 # define ENABLE_RE6_OPENDRAIN() (_ODE6 = 1)
9956 # define DISABLE_RE6_OPENDRAIN() (_ODE6 = 0)
9957 # else
9958 # define DISABLE_RE6_OPENDRAIN() ((void) 0)
9959 # endif
9960 
9961 // Change notification, pullups and pulldowns:
9962 # if defined(_CNIEE6) || defined(__DOXYGEN__)
9963 /// Enable the pullup on pin RE6.
9964 # define ENABLE_RE6_PULLUP() (_CNPUE6 = 1)
9965 /// Disable the pullup on pin RE6.
9966 # define DISABLE_RE6_PULLUP() (_CNPUE6 = 0)
9967 
9968 /// Enable the pulldown on pin RE6.
9969 # define ENABLE_RE6_PULLDOWN() (_CNPDE6 = 1)
9970 /// Disable the pulldown on pin RE6.
9971 # define DISABLE_RE6_PULLDOWN() (_CNPDE6 = 0)
9972 
9973 /// Enable the change notification interrupt on pin RE6.
9974 # define ENABLE_RE6_CN_INTERRUPT() (_CNIEE6 = 1)
9975 /// Disable the change notification interrupt on pin RE6.
9976 # define DISABLE_RE6_CN_INTERRUPT() (_CNIEE6 = 0)
9977 
9978 # elif defined(RE6_CN)
9979 # define ENABLE_RE6_PULLUP() (RXY_GPIO_CNPUE(RE6_CN) = 1)
9980 # define DISABLE_RE6_PULLUP() (RXY_GPIO_CNPUE(RE6_CN) = 0)
9981 
9982 # if RXY_HAS_CNPDE(RE6_CN)
9983 # define ENABLE_RE6_PULLDOWN() (RXY_GPIO_CNPDE(RE6_CN) = 1)
9984 # define DISABLE_RE6_PULLDOWN() (RXY_GPIO_CNPDE(RE6_CN) = 0)
9985 # else
9986 # define DISABLE_RE6_PULLDOWN() ((void) 0)
9987 # endif
9988 
9989 # define ENABLE_RE6_CN_INTERRUPT() (RXY_GPIO_CNIE(RE6_CN) = 1)
9990 # define DISABLE_RE6_CN_INTERRUPT() (RXY_GPIO_CNIE(RE6_CN) = 0)
9991 
9992 # else
9993 # define DISABLE_RE6_PULLUP() ((void) 0)
9994 # define DISABLE_RE6_PULLDOWN() ((void) 0)
9995 # define DISABLE_RE6_CN_INTERRUPT() ((void) 0)
9996 # endif
9997 
9998 // High-level config
9999 // -----------------
10000 /** This macro disables pullups/downs, enables analog functionality, and configures
10001  * pin RE6 as an input.
10002  */
10003 # if defined(_ANSE6) || defined(RE6_AN) || defined(__DOXYGEN__)
10004 # define CONFIG_RE6_AS_ANALOG() \
10005  do { \
10006  ENABLE_RE6_ANALOG(); \
10007  CONFIG_RE6_AS_INPUT(); \
10008  DISABLE_RE6_OPENDRAIN(); \
10009  DISABLE_RE6_PULLUP(); \
10010  DISABLE_RE6_PULLDOWN(); \
10011  } while (0)
10012 # endif
10013 
10014 /** This macro disables open-drain and pullups/downs,
10015  * configures pin RE6 for digital (not analog) operation, and
10016  * configures the pin as an input.
10017  */
10018 # define CONFIG_RE6_AS_DIG_INPUT() \
10019  do { \
10020  DISABLE_RE6_ANALOG(); \
10021  CONFIG_RE6_AS_INPUT(); \
10022  DISABLE_RE6_OPENDRAIN(); \
10023  DISABLE_RE6_PULLUP(); \
10024  DISABLE_RE6_PULLDOWN(); \
10025  } while (0)
10026 
10027 /** This macro disables open-drain and pullups/downs,
10028  * configures pin RE6 for digital (not analog) operation, and
10029  * configures the pin as an output.
10030  */
10031 # define CONFIG_RE6_AS_DIG_OUTPUT() \
10032  do { \
10033  DISABLE_RE6_ANALOG(); \
10034  CONFIG_RE6_AS_OUTPUT(); \
10035  DISABLE_RE6_OPENDRAIN(); \
10036  DISABLE_RE6_PULLUP(); \
10037  DISABLE_RE6_PULLDOWN(); \
10038  } while (0)
10039 
10040 #endif // #if defined(_RE6) || defined(__DOXYGEN__): Provide GPIO for RE6
10041 
10042 
10043 
10044 
10045 
10046 // Provide GPIO for RE7
10047 // ====================
10048 #if defined(_RE7) || defined(__DOXYGEN__)
10049 
10050 // Dummy macros for documentation only
10051 # ifdef __DOXYGEN__
10052 /// This macro specifies the RPy value associated with pin RE7.
10053 /// Its device-specific definition is given in pic24_ports_mapping.h.
10054 # define RE7_RP xx
10055 
10056 /// This macro specifies the ANn value associated with pin RE7.
10057 /// Its device-specific definition is given in pic24_ports_mapping.h.
10058 # define RE7_AN xx
10059 
10060 /// This macro specifies the CNm value associated with pin RE7.
10061 /// Its device-specific definition is given in pic24_ports_mapping.h.
10062 # define RE7_CN xx
10063 
10064 //@}
10065 # endif // #ifdef __DOXYGEN__
10066 
10067 
10068 // Low-level config
10069 // ----------------
10070 // Analog:
10071 # if defined(_ANSE7) || defined(__DOXYGEN__)
10072 /// Enable analog functionality on pin RE7.
10073 # define ENABLE_RE7_ANALOG() (_ANSE7 = 1)
10074 /// Disable analog functionality on pin RE7.
10075 # define DISABLE_RE7_ANALOG() (_ANSE7 = 0)
10076 # elif defined(RE7_AN)
10077 # define ENABLE_RE7_ANALOG() (RXY_GPIO_PCFG(RE7_AN) = 0)
10078 # define DISABLE_RE7_ANALOG() (RXY_GPIO_PCFG(RE7_AN) = 1)
10079 # else
10080 # define DISABLE_RE7_ANALOG() ((void) 0)
10081 # endif
10082 
10083 // Input/output:
10084 /// Configure pin RE7 as an input.
10085 # define CONFIG_RE7_AS_INPUT() (_TRISE7 = 1)
10086 /// Configure pin RE7 as an output.
10087 # define CONFIG_RE7_AS_OUTPUT() (_TRISE7 = 0)
10088 
10089 // Open-drain:
10090 # if defined(_ODCE7) || defined(__DOXYGEN__)
10091 /// Enable the open-drain driver on pin RE7.
10092 # define ENABLE_RE7_OPENDRAIN() (_ODCE7 = 1)
10093 /// Disable the open-drain driver on pin RE7.
10094 # define DISABLE_RE7_OPENDRAIN() (_ODCE7 = 0)
10095 # elif defined(_ODE7) // The PIF24F names this bit _OD instead of _ODC.
10096 # define ENABLE_RE7_OPENDRAIN() (_ODE7 = 1)
10097 # define DISABLE_RE7_OPENDRAIN() (_ODE7 = 0)
10098 # else
10099 # define DISABLE_RE7_OPENDRAIN() ((void) 0)
10100 # endif
10101 
10102 // Change notification, pullups and pulldowns:
10103 # if defined(_CNIEE7) || defined(__DOXYGEN__)
10104 /// Enable the pullup on pin RE7.
10105 # define ENABLE_RE7_PULLUP() (_CNPUE7 = 1)
10106 /// Disable the pullup on pin RE7.
10107 # define DISABLE_RE7_PULLUP() (_CNPUE7 = 0)
10108 
10109 /// Enable the pulldown on pin RE7.
10110 # define ENABLE_RE7_PULLDOWN() (_CNPDE7 = 1)
10111 /// Disable the pulldown on pin RE7.
10112 # define DISABLE_RE7_PULLDOWN() (_CNPDE7 = 0)
10113 
10114 /// Enable the change notification interrupt on pin RE7.
10115 # define ENABLE_RE7_CN_INTERRUPT() (_CNIEE7 = 1)
10116 /// Disable the change notification interrupt on pin RE7.
10117 # define DISABLE_RE7_CN_INTERRUPT() (_CNIEE7 = 0)
10118 
10119 # elif defined(RE7_CN)
10120 # define ENABLE_RE7_PULLUP() (RXY_GPIO_CNPUE(RE7_CN) = 1)
10121 # define DISABLE_RE7_PULLUP() (RXY_GPIO_CNPUE(RE7_CN) = 0)
10122 
10123 # if RXY_HAS_CNPDE(RE7_CN)
10124 # define ENABLE_RE7_PULLDOWN() (RXY_GPIO_CNPDE(RE7_CN) = 1)
10125 # define DISABLE_RE7_PULLDOWN() (RXY_GPIO_CNPDE(RE7_CN) = 0)
10126 # else
10127 # define DISABLE_RE7_PULLDOWN() ((void) 0)
10128 # endif
10129 
10130 # define ENABLE_RE7_CN_INTERRUPT() (RXY_GPIO_CNIE(RE7_CN) = 1)
10131 # define DISABLE_RE7_CN_INTERRUPT() (RXY_GPIO_CNIE(RE7_CN) = 0)
10132 
10133 # else
10134 # define DISABLE_RE7_PULLUP() ((void) 0)
10135 # define DISABLE_RE7_PULLDOWN() ((void) 0)
10136 # define DISABLE_RE7_CN_INTERRUPT() ((void) 0)
10137 # endif
10138 
10139 // High-level config
10140 // -----------------
10141 /** This macro disables pullups/downs, enables analog functionality, and configures
10142  * pin RE7 as an input.
10143  */
10144 # if defined(_ANSE7) || defined(RE7_AN) || defined(__DOXYGEN__)
10145 # define CONFIG_RE7_AS_ANALOG() \
10146  do { \
10147  ENABLE_RE7_ANALOG(); \
10148  CONFIG_RE7_AS_INPUT(); \
10149  DISABLE_RE7_OPENDRAIN(); \
10150  DISABLE_RE7_PULLUP(); \
10151  DISABLE_RE7_PULLDOWN(); \
10152  } while (0)
10153 # endif
10154 
10155 /** This macro disables open-drain and pullups/downs,
10156  * configures pin RE7 for digital (not analog) operation, and
10157  * configures the pin as an input.
10158  */
10159 # define CONFIG_RE7_AS_DIG_INPUT() \
10160  do { \
10161  DISABLE_RE7_ANALOG(); \
10162  CONFIG_RE7_AS_INPUT(); \
10163  DISABLE_RE7_OPENDRAIN(); \
10164  DISABLE_RE7_PULLUP(); \
10165  DISABLE_RE7_PULLDOWN(); \
10166  } while (0)
10167 
10168 /** This macro disables open-drain and pullups/downs,
10169  * configures pin RE7 for digital (not analog) operation, and
10170  * configures the pin as an output.
10171  */
10172 # define CONFIG_RE7_AS_DIG_OUTPUT() \
10173  do { \
10174  DISABLE_RE7_ANALOG(); \
10175  CONFIG_RE7_AS_OUTPUT(); \
10176  DISABLE_RE7_OPENDRAIN(); \
10177  DISABLE_RE7_PULLUP(); \
10178  DISABLE_RE7_PULLDOWN(); \
10179  } while (0)
10180 
10181 #endif // #if defined(_RE7) || defined(__DOXYGEN__): Provide GPIO for RE7
10182 
10183 
10184 
10185 
10186 
10187 // Provide GPIO for RE8
10188 // ====================
10189 #if defined(_RE8) || defined(__DOXYGEN__)
10190 
10191 // Dummy macros for documentation only
10192 # ifdef __DOXYGEN__
10193 /// This macro specifies the RPy value associated with pin RE8.
10194 /// Its device-specific definition is given in pic24_ports_mapping.h.
10195 # define RE8_RP xx
10196 
10197 /// This macro specifies the ANn value associated with pin RE8.
10198 /// Its device-specific definition is given in pic24_ports_mapping.h.
10199 # define RE8_AN xx
10200 
10201 /// This macro specifies the CNm value associated with pin RE8.
10202 /// Its device-specific definition is given in pic24_ports_mapping.h.
10203 # define RE8_CN xx
10204 
10205 //@}
10206 # endif // #ifdef __DOXYGEN__
10207 
10208 
10209 // Low-level config
10210 // ----------------
10211 // Analog:
10212 # if defined(_ANSE8) || defined(__DOXYGEN__)
10213 /// Enable analog functionality on pin RE8.
10214 # define ENABLE_RE8_ANALOG() (_ANSE8 = 1)
10215 /// Disable analog functionality on pin RE8.
10216 # define DISABLE_RE8_ANALOG() (_ANSE8 = 0)
10217 # elif defined(RE8_AN)
10218 # define ENABLE_RE8_ANALOG() (RXY_GPIO_PCFG(RE8_AN) = 0)
10219 # define DISABLE_RE8_ANALOG() (RXY_GPIO_PCFG(RE8_AN) = 1)
10220 # else
10221 # define DISABLE_RE8_ANALOG() ((void) 0)
10222 # endif
10223 
10224 // Input/output:
10225 /// Configure pin RE8 as an input.
10226 # define CONFIG_RE8_AS_INPUT() (_TRISE8 = 1)
10227 /// Configure pin RE8 as an output.
10228 # define CONFIG_RE8_AS_OUTPUT() (_TRISE8 = 0)
10229 
10230 // Open-drain:
10231 # if defined(_ODCE8) || defined(__DOXYGEN__)
10232 /// Enable the open-drain driver on pin RE8.
10233 # define ENABLE_RE8_OPENDRAIN() (_ODCE8 = 1)
10234 /// Disable the open-drain driver on pin RE8.
10235 # define DISABLE_RE8_OPENDRAIN() (_ODCE8 = 0)
10236 # elif defined(_ODE8) // The PIF24F names this bit _OD instead of _ODC.
10237 # define ENABLE_RE8_OPENDRAIN() (_ODE8 = 1)
10238 # define DISABLE_RE8_OPENDRAIN() (_ODE8 = 0)
10239 # else
10240 # define DISABLE_RE8_OPENDRAIN() ((void) 0)
10241 # endif
10242 
10243 // Change notification, pullups and pulldowns:
10244 # if defined(_CNIEE8) || defined(__DOXYGEN__)
10245 /// Enable the pullup on pin RE8.
10246 # define ENABLE_RE8_PULLUP() (_CNPUE8 = 1)
10247 /// Disable the pullup on pin RE8.
10248 # define DISABLE_RE8_PULLUP() (_CNPUE8 = 0)
10249 
10250 /// Enable the pulldown on pin RE8.
10251 # define ENABLE_RE8_PULLDOWN() (_CNPDE8 = 1)
10252 /// Disable the pulldown on pin RE8.
10253 # define DISABLE_RE8_PULLDOWN() (_CNPDE8 = 0)
10254 
10255 /// Enable the change notification interrupt on pin RE8.
10256 # define ENABLE_RE8_CN_INTERRUPT() (_CNIEE8 = 1)
10257 /// Disable the change notification interrupt on pin RE8.
10258 # define DISABLE_RE8_CN_INTERRUPT() (_CNIEE8 = 0)
10259 
10260 # elif defined(RE8_CN)
10261 # define ENABLE_RE8_PULLUP() (RXY_GPIO_CNPUE(RE8_CN) = 1)
10262 # define DISABLE_RE8_PULLUP() (RXY_GPIO_CNPUE(RE8_CN) = 0)
10263 
10264 # if RXY_HAS_CNPDE(RE8_CN)
10265 # define ENABLE_RE8_PULLDOWN() (RXY_GPIO_CNPDE(RE8_CN) = 1)
10266 # define DISABLE_RE8_PULLDOWN() (RXY_GPIO_CNPDE(RE8_CN) = 0)
10267 # else
10268 # define DISABLE_RE8_PULLDOWN() ((void) 0)
10269 # endif
10270 
10271 # define ENABLE_RE8_CN_INTERRUPT() (RXY_GPIO_CNIE(RE8_CN) = 1)
10272 # define DISABLE_RE8_CN_INTERRUPT() (RXY_GPIO_CNIE(RE8_CN) = 0)
10273 
10274 # else
10275 # define DISABLE_RE8_PULLUP() ((void) 0)
10276 # define DISABLE_RE8_PULLDOWN() ((void) 0)
10277 # define DISABLE_RE8_CN_INTERRUPT() ((void) 0)
10278 # endif
10279 
10280 // High-level config
10281 // -----------------
10282 /** This macro disables pullups/downs, enables analog functionality, and configures
10283  * pin RE8 as an input.
10284  */
10285 # if defined(_ANSE8) || defined(RE8_AN) || defined(__DOXYGEN__)
10286 # define CONFIG_RE8_AS_ANALOG() \
10287  do { \
10288  ENABLE_RE8_ANALOG(); \
10289  CONFIG_RE8_AS_INPUT(); \
10290  DISABLE_RE8_OPENDRAIN(); \
10291  DISABLE_RE8_PULLUP(); \
10292  DISABLE_RE8_PULLDOWN(); \
10293  } while (0)
10294 # endif
10295 
10296 /** This macro disables open-drain and pullups/downs,
10297  * configures pin RE8 for digital (not analog) operation, and
10298  * configures the pin as an input.
10299  */
10300 # define CONFIG_RE8_AS_DIG_INPUT() \
10301  do { \
10302  DISABLE_RE8_ANALOG(); \
10303  CONFIG_RE8_AS_INPUT(); \
10304  DISABLE_RE8_OPENDRAIN(); \
10305  DISABLE_RE8_PULLUP(); \
10306  DISABLE_RE8_PULLDOWN(); \
10307  } while (0)
10308 
10309 /** This macro disables open-drain and pullups/downs,
10310  * configures pin RE8 for digital (not analog) operation, and
10311  * configures the pin as an output.
10312  */
10313 # define CONFIG_RE8_AS_DIG_OUTPUT() \
10314  do { \
10315  DISABLE_RE8_ANALOG(); \
10316  CONFIG_RE8_AS_OUTPUT(); \
10317  DISABLE_RE8_OPENDRAIN(); \
10318  DISABLE_RE8_PULLUP(); \
10319  DISABLE_RE8_PULLDOWN(); \
10320  } while (0)
10321 
10322 #endif // #if defined(_RE8) || defined(__DOXYGEN__): Provide GPIO for RE8
10323 
10324 
10325 
10326 
10327 
10328 // Provide GPIO for RE9
10329 // ====================
10330 #if defined(_RE9) || defined(__DOXYGEN__)
10331 
10332 // Dummy macros for documentation only
10333 # ifdef __DOXYGEN__
10334 /// This macro specifies the RPy value associated with pin RE9.
10335 /// Its device-specific definition is given in pic24_ports_mapping.h.
10336 # define RE9_RP xx
10337 
10338 /// This macro specifies the ANn value associated with pin RE9.
10339 /// Its device-specific definition is given in pic24_ports_mapping.h.
10340 # define RE9_AN xx
10341 
10342 /// This macro specifies the CNm value associated with pin RE9.
10343 /// Its device-specific definition is given in pic24_ports_mapping.h.
10344 # define RE9_CN xx
10345 
10346 //@}
10347 # endif // #ifdef __DOXYGEN__
10348 
10349 
10350 // Low-level config
10351 // ----------------
10352 // Analog:
10353 # if defined(_ANSE9) || defined(__DOXYGEN__)
10354 /// Enable analog functionality on pin RE9.
10355 # define ENABLE_RE9_ANALOG() (_ANSE9 = 1)
10356 /// Disable analog functionality on pin RE9.
10357 # define DISABLE_RE9_ANALOG() (_ANSE9 = 0)
10358 # elif defined(RE9_AN)
10359 # define ENABLE_RE9_ANALOG() (RXY_GPIO_PCFG(RE9_AN) = 0)
10360 # define DISABLE_RE9_ANALOG() (RXY_GPIO_PCFG(RE9_AN) = 1)
10361 # else
10362 # define DISABLE_RE9_ANALOG() ((void) 0)
10363 # endif
10364 
10365 // Input/output:
10366 /// Configure pin RE9 as an input.
10367 # define CONFIG_RE9_AS_INPUT() (_TRISE9 = 1)
10368 /// Configure pin RE9 as an output.
10369 # define CONFIG_RE9_AS_OUTPUT() (_TRISE9 = 0)
10370 
10371 // Open-drain:
10372 # if defined(_ODCE9) || defined(__DOXYGEN__)
10373 /// Enable the open-drain driver on pin RE9.
10374 # define ENABLE_RE9_OPENDRAIN() (_ODCE9 = 1)
10375 /// Disable the open-drain driver on pin RE9.
10376 # define DISABLE_RE9_OPENDRAIN() (_ODCE9 = 0)
10377 # elif defined(_ODE9) // The PIF24F names this bit _OD instead of _ODC.
10378 # define ENABLE_RE9_OPENDRAIN() (_ODE9 = 1)
10379 # define DISABLE_RE9_OPENDRAIN() (_ODE9 = 0)
10380 # else
10381 # define DISABLE_RE9_OPENDRAIN() ((void) 0)
10382 # endif
10383 
10384 // Change notification, pullups and pulldowns:
10385 # if defined(_CNIEE9) || defined(__DOXYGEN__)
10386 /// Enable the pullup on pin RE9.
10387 # define ENABLE_RE9_PULLUP() (_CNPUE9 = 1)
10388 /// Disable the pullup on pin RE9.
10389 # define DISABLE_RE9_PULLUP() (_CNPUE9 = 0)
10390 
10391 /// Enable the pulldown on pin RE9.
10392 # define ENABLE_RE9_PULLDOWN() (_CNPDE9 = 1)
10393 /// Disable the pulldown on pin RE9.
10394 # define DISABLE_RE9_PULLDOWN() (_CNPDE9 = 0)
10395 
10396 /// Enable the change notification interrupt on pin RE9.
10397 # define ENABLE_RE9_CN_INTERRUPT() (_CNIEE9 = 1)
10398 /// Disable the change notification interrupt on pin RE9.
10399 # define DISABLE_RE9_CN_INTERRUPT() (_CNIEE9 = 0)
10400 
10401 # elif defined(RE9_CN)
10402 # define ENABLE_RE9_PULLUP() (RXY_GPIO_CNPUE(RE9_CN) = 1)
10403 # define DISABLE_RE9_PULLUP() (RXY_GPIO_CNPUE(RE9_CN) = 0)
10404 
10405 # if RXY_HAS_CNPDE(RE9_CN)
10406 # define ENABLE_RE9_PULLDOWN() (RXY_GPIO_CNPDE(RE9_CN) = 1)
10407 # define DISABLE_RE9_PULLDOWN() (RXY_GPIO_CNPDE(RE9_CN) = 0)
10408 # else
10409 # define DISABLE_RE9_PULLDOWN() ((void) 0)
10410 # endif
10411 
10412 # define ENABLE_RE9_CN_INTERRUPT() (RXY_GPIO_CNIE(RE9_CN) = 1)
10413 # define DISABLE_RE9_CN_INTERRUPT() (RXY_GPIO_CNIE(RE9_CN) = 0)
10414 
10415 # else
10416 # define DISABLE_RE9_PULLUP() ((void) 0)
10417 # define DISABLE_RE9_PULLDOWN() ((void) 0)
10418 # define DISABLE_RE9_CN_INTERRUPT() ((void) 0)
10419 # endif
10420 
10421 // High-level config
10422 // -----------------
10423 /** This macro disables pullups/downs, enables analog functionality, and configures
10424  * pin RE9 as an input.
10425  */
10426 # if defined(_ANSE9) || defined(RE9_AN) || defined(__DOXYGEN__)
10427 # define CONFIG_RE9_AS_ANALOG() \
10428  do { \
10429  ENABLE_RE9_ANALOG(); \
10430  CONFIG_RE9_AS_INPUT(); \
10431  DISABLE_RE9_OPENDRAIN(); \
10432  DISABLE_RE9_PULLUP(); \
10433  DISABLE_RE9_PULLDOWN(); \
10434  } while (0)
10435 # endif
10436 
10437 /** This macro disables open-drain and pullups/downs,
10438  * configures pin RE9 for digital (not analog) operation, and
10439  * configures the pin as an input.
10440  */
10441 # define CONFIG_RE9_AS_DIG_INPUT() \
10442  do { \
10443  DISABLE_RE9_ANALOG(); \
10444  CONFIG_RE9_AS_INPUT(); \
10445  DISABLE_RE9_OPENDRAIN(); \
10446  DISABLE_RE9_PULLUP(); \
10447  DISABLE_RE9_PULLDOWN(); \
10448  } while (0)
10449 
10450 /** This macro disables open-drain and pullups/downs,
10451  * configures pin RE9 for digital (not analog) operation, and
10452  * configures the pin as an output.
10453  */
10454 # define CONFIG_RE9_AS_DIG_OUTPUT() \
10455  do { \
10456  DISABLE_RE9_ANALOG(); \
10457  CONFIG_RE9_AS_OUTPUT(); \
10458  DISABLE_RE9_OPENDRAIN(); \
10459  DISABLE_RE9_PULLUP(); \
10460  DISABLE_RE9_PULLDOWN(); \
10461  } while (0)
10462 
10463 #endif // #if defined(_RE9) || defined(__DOXYGEN__): Provide GPIO for RE9
10464 
10465 
10466 
10467 
10468 
10469 // Provide GPIO for RE10
10470 // ====================
10471 #if defined(_RE10) || defined(__DOXYGEN__)
10472 
10473 // Dummy macros for documentation only
10474 # ifdef __DOXYGEN__
10475 /// This macro specifies the RPy value associated with pin RE10.
10476 /// Its device-specific definition is given in pic24_ports_mapping.h.
10477 # define RE10_RP xx
10478 
10479 /// This macro specifies the ANn value associated with pin RE10.
10480 /// Its device-specific definition is given in pic24_ports_mapping.h.
10481 # define RE10_AN xx
10482 
10483 /// This macro specifies the CNm value associated with pin RE10.
10484 /// Its device-specific definition is given in pic24_ports_mapping.h.
10485 # define RE10_CN xx
10486 
10487 //@}
10488 # endif // #ifdef __DOXYGEN__
10489 
10490 
10491 // Low-level config
10492 // ----------------
10493 // Analog:
10494 # if defined(_ANSE10) || defined(__DOXYGEN__)
10495 /// Enable analog functionality on pin RE10.
10496 # define ENABLE_RE10_ANALOG() (_ANSE10 = 1)
10497 /// Disable analog functionality on pin RE10.
10498 # define DISABLE_RE10_ANALOG() (_ANSE10 = 0)
10499 # elif defined(RE10_AN)
10500 # define ENABLE_RE10_ANALOG() (RXY_GPIO_PCFG(RE10_AN) = 0)
10501 # define DISABLE_RE10_ANALOG() (RXY_GPIO_PCFG(RE10_AN) = 1)
10502 # else
10503 # define DISABLE_RE10_ANALOG() ((void) 0)
10504 # endif
10505 
10506 // Input/output:
10507 /// Configure pin RE10 as an input.
10508 # define CONFIG_RE10_AS_INPUT() (_TRISE10 = 1)
10509 /// Configure pin RE10 as an output.
10510 # define CONFIG_RE10_AS_OUTPUT() (_TRISE10 = 0)
10511 
10512 // Open-drain:
10513 # if defined(_ODCE10) || defined(__DOXYGEN__)
10514 /// Enable the open-drain driver on pin RE10.
10515 # define ENABLE_RE10_OPENDRAIN() (_ODCE10 = 1)
10516 /// Disable the open-drain driver on pin RE10.
10517 # define DISABLE_RE10_OPENDRAIN() (_ODCE10 = 0)
10518 # elif defined(_ODE10) // The PIF24F names this bit _OD instead of _ODC.
10519 # define ENABLE_RE10_OPENDRAIN() (_ODE10 = 1)
10520 # define DISABLE_RE10_OPENDRAIN() (_ODE10 = 0)
10521 # else
10522 # define DISABLE_RE10_OPENDRAIN() ((void) 0)
10523 # endif
10524 
10525 // Change notification, pullups and pulldowns:
10526 # if defined(_CNIEE10) || defined(__DOXYGEN__)
10527 /// Enable the pullup on pin RE10.
10528 # define ENABLE_RE10_PULLUP() (_CNPUE10 = 1)
10529 /// Disable the pullup on pin RE10.
10530 # define DISABLE_RE10_PULLUP() (_CNPUE10 = 0)
10531 
10532 /// Enable the pulldown on pin RE10.
10533 # define ENABLE_RE10_PULLDOWN() (_CNPDE10 = 1)
10534 /// Disable the pulldown on pin RE10.
10535 # define DISABLE_RE10_PULLDOWN() (_CNPDE10 = 0)
10536 
10537 /// Enable the change notification interrupt on pin RE10.
10538 # define ENABLE_RE10_CN_INTERRUPT() (_CNIEE10 = 1)
10539 /// Disable the change notification interrupt on pin RE10.
10540 # define DISABLE_RE10_CN_INTERRUPT() (_CNIEE10 = 0)
10541 
10542 # elif defined(RE10_CN)
10543 # define ENABLE_RE10_PULLUP() (RXY_GPIO_CNPUE(RE10_CN) = 1)
10544 # define DISABLE_RE10_PULLUP() (RXY_GPIO_CNPUE(RE10_CN) = 0)
10545 
10546 # if RXY_HAS_CNPDE(RE10_CN)
10547 # define ENABLE_RE10_PULLDOWN() (RXY_GPIO_CNPDE(RE10_CN) = 1)
10548 # define DISABLE_RE10_PULLDOWN() (RXY_GPIO_CNPDE(RE10_CN) = 0)
10549 # else
10550 # define DISABLE_RE10_PULLDOWN() ((void) 0)
10551 # endif
10552 
10553 # define ENABLE_RE10_CN_INTERRUPT() (RXY_GPIO_CNIE(RE10_CN) = 1)
10554 # define DISABLE_RE10_CN_INTERRUPT() (RXY_GPIO_CNIE(RE10_CN) = 0)
10555 
10556 # else
10557 # define DISABLE_RE10_PULLUP() ((void) 0)
10558 # define DISABLE_RE10_PULLDOWN() ((void) 0)
10559 # define DISABLE_RE10_CN_INTERRUPT() ((void) 0)
10560 # endif
10561 
10562 // High-level config
10563 // -----------------
10564 /** This macro disables pullups/downs, enables analog functionality, and configures
10565  * pin RE10 as an input.
10566  */
10567 # if defined(_ANSE10) || defined(RE10_AN) || defined(__DOXYGEN__)
10568 # define CONFIG_RE10_AS_ANALOG() \
10569  do { \
10570  ENABLE_RE10_ANALOG(); \
10571  CONFIG_RE10_AS_INPUT(); \
10572  DISABLE_RE10_OPENDRAIN(); \
10573  DISABLE_RE10_PULLUP(); \
10574  DISABLE_RE10_PULLDOWN(); \
10575  } while (0)
10576 # endif
10577 
10578 /** This macro disables open-drain and pullups/downs,
10579  * configures pin RE10 for digital (not analog) operation, and
10580  * configures the pin as an input.
10581  */
10582 # define CONFIG_RE10_AS_DIG_INPUT() \
10583  do { \
10584  DISABLE_RE10_ANALOG(); \
10585  CONFIG_RE10_AS_INPUT(); \
10586  DISABLE_RE10_OPENDRAIN(); \
10587  DISABLE_RE10_PULLUP(); \
10588  DISABLE_RE10_PULLDOWN(); \
10589  } while (0)
10590 
10591 /** This macro disables open-drain and pullups/downs,
10592  * configures pin RE10 for digital (not analog) operation, and
10593  * configures the pin as an output.
10594  */
10595 # define CONFIG_RE10_AS_DIG_OUTPUT() \
10596  do { \
10597  DISABLE_RE10_ANALOG(); \
10598  CONFIG_RE10_AS_OUTPUT(); \
10599  DISABLE_RE10_OPENDRAIN(); \
10600  DISABLE_RE10_PULLUP(); \
10601  DISABLE_RE10_PULLDOWN(); \
10602  } while (0)
10603 
10604 #endif // #if defined(_RE10) || defined(__DOXYGEN__): Provide GPIO for RE10
10605 
10606 
10607 
10608 
10609 
10610 // Provide GPIO for RE11
10611 // ====================
10612 #if defined(_RE11) || defined(__DOXYGEN__)
10613 
10614 // Dummy macros for documentation only
10615 # ifdef __DOXYGEN__
10616 /// This macro specifies the RPy value associated with pin RE11.
10617 /// Its device-specific definition is given in pic24_ports_mapping.h.
10618 # define RE11_RP xx
10619 
10620 /// This macro specifies the ANn value associated with pin RE11.
10621 /// Its device-specific definition is given in pic24_ports_mapping.h.
10622 # define RE11_AN xx
10623 
10624 /// This macro specifies the CNm value associated with pin RE11.
10625 /// Its device-specific definition is given in pic24_ports_mapping.h.
10626 # define RE11_CN xx
10627 
10628 //@}
10629 # endif // #ifdef __DOXYGEN__
10630 
10631 
10632 // Low-level config
10633 // ----------------
10634 // Analog:
10635 # if defined(_ANSE11) || defined(__DOXYGEN__)
10636 /// Enable analog functionality on pin RE11.
10637 # define ENABLE_RE11_ANALOG() (_ANSE11 = 1)
10638 /// Disable analog functionality on pin RE11.
10639 # define DISABLE_RE11_ANALOG() (_ANSE11 = 0)
10640 # elif defined(RE11_AN)
10641 # define ENABLE_RE11_ANALOG() (RXY_GPIO_PCFG(RE11_AN) = 0)
10642 # define DISABLE_RE11_ANALOG() (RXY_GPIO_PCFG(RE11_AN) = 1)
10643 # else
10644 # define DISABLE_RE11_ANALOG() ((void) 0)
10645 # endif
10646 
10647 // Input/output:
10648 /// Configure pin RE11 as an input.
10649 # define CONFIG_RE11_AS_INPUT() (_TRISE11 = 1)
10650 /// Configure pin RE11 as an output.
10651 # define CONFIG_RE11_AS_OUTPUT() (_TRISE11 = 0)
10652 
10653 // Open-drain:
10654 # if defined(_ODCE11) || defined(__DOXYGEN__)
10655 /// Enable the open-drain driver on pin RE11.
10656 # define ENABLE_RE11_OPENDRAIN() (_ODCE11 = 1)
10657 /// Disable the open-drain driver on pin RE11.
10658 # define DISABLE_RE11_OPENDRAIN() (_ODCE11 = 0)
10659 # elif defined(_ODE11) // The PIF24F names this bit _OD instead of _ODC.
10660 # define ENABLE_RE11_OPENDRAIN() (_ODE11 = 1)
10661 # define DISABLE_RE11_OPENDRAIN() (_ODE11 = 0)
10662 # else
10663 # define DISABLE_RE11_OPENDRAIN() ((void) 0)
10664 # endif
10665 
10666 // Change notification, pullups and pulldowns:
10667 # if defined(_CNIEE11) || defined(__DOXYGEN__)
10668 /// Enable the pullup on pin RE11.
10669 # define ENABLE_RE11_PULLUP() (_CNPUE11 = 1)
10670 /// Disable the pullup on pin RE11.
10671 # define DISABLE_RE11_PULLUP() (_CNPUE11 = 0)
10672 
10673 /// Enable the pulldown on pin RE11.
10674 # define ENABLE_RE11_PULLDOWN() (_CNPDE11 = 1)
10675 /// Disable the pulldown on pin RE11.
10676 # define DISABLE_RE11_PULLDOWN() (_CNPDE11 = 0)
10677 
10678 /// Enable the change notification interrupt on pin RE11.
10679 # define ENABLE_RE11_CN_INTERRUPT() (_CNIEE11 = 1)
10680 /// Disable the change notification interrupt on pin RE11.
10681 # define DISABLE_RE11_CN_INTERRUPT() (_CNIEE11 = 0)
10682 
10683 # elif defined(RE11_CN)
10684 # define ENABLE_RE11_PULLUP() (RXY_GPIO_CNPUE(RE11_CN) = 1)
10685 # define DISABLE_RE11_PULLUP() (RXY_GPIO_CNPUE(RE11_CN) = 0)
10686 
10687 # if RXY_HAS_CNPDE(RE11_CN)
10688 # define ENABLE_RE11_PULLDOWN() (RXY_GPIO_CNPDE(RE11_CN) = 1)
10689 # define DISABLE_RE11_PULLDOWN() (RXY_GPIO_CNPDE(RE11_CN) = 0)
10690 # else
10691 # define DISABLE_RE11_PULLDOWN() ((void) 0)
10692 # endif
10693 
10694 # define ENABLE_RE11_CN_INTERRUPT() (RXY_GPIO_CNIE(RE11_CN) = 1)
10695 # define DISABLE_RE11_CN_INTERRUPT() (RXY_GPIO_CNIE(RE11_CN) = 0)
10696 
10697 # else
10698 # define DISABLE_RE11_PULLUP() ((void) 0)
10699 # define DISABLE_RE11_PULLDOWN() ((void) 0)
10700 # define DISABLE_RE11_CN_INTERRUPT() ((void) 0)
10701 # endif
10702 
10703 // High-level config
10704 // -----------------
10705 /** This macro disables pullups/downs, enables analog functionality, and configures
10706  * pin RE11 as an input.
10707  */
10708 # if defined(_ANSE11) || defined(RE11_AN) || defined(__DOXYGEN__)
10709 # define CONFIG_RE11_AS_ANALOG() \
10710  do { \
10711  ENABLE_RE11_ANALOG(); \
10712  CONFIG_RE11_AS_INPUT(); \
10713  DISABLE_RE11_OPENDRAIN(); \
10714  DISABLE_RE11_PULLUP(); \
10715  DISABLE_RE11_PULLDOWN(); \
10716  } while (0)
10717 # endif
10718 
10719 /** This macro disables open-drain and pullups/downs,
10720  * configures pin RE11 for digital (not analog) operation, and
10721  * configures the pin as an input.
10722  */
10723 # define CONFIG_RE11_AS_DIG_INPUT() \
10724  do { \
10725  DISABLE_RE11_ANALOG(); \
10726  CONFIG_RE11_AS_INPUT(); \
10727  DISABLE_RE11_OPENDRAIN(); \
10728  DISABLE_RE11_PULLUP(); \
10729  DISABLE_RE11_PULLDOWN(); \
10730  } while (0)
10731 
10732 /** This macro disables open-drain and pullups/downs,
10733  * configures pin RE11 for digital (not analog) operation, and
10734  * configures the pin as an output.
10735  */
10736 # define CONFIG_RE11_AS_DIG_OUTPUT() \
10737  do { \
10738  DISABLE_RE11_ANALOG(); \
10739  CONFIG_RE11_AS_OUTPUT(); \
10740  DISABLE_RE11_OPENDRAIN(); \
10741  DISABLE_RE11_PULLUP(); \
10742  DISABLE_RE11_PULLDOWN(); \
10743  } while (0)
10744 
10745 #endif // #if defined(_RE11) || defined(__DOXYGEN__): Provide GPIO for RE11
10746 
10747 
10748 
10749 
10750 
10751 // Provide GPIO for RE12
10752 // ====================
10753 #if defined(_RE12) || defined(__DOXYGEN__)
10754 
10755 // Dummy macros for documentation only
10756 # ifdef __DOXYGEN__
10757 /// This macro specifies the RPy value associated with pin RE12.
10758 /// Its device-specific definition is given in pic24_ports_mapping.h.
10759 # define RE12_RP xx
10760 
10761 /// This macro specifies the ANn value associated with pin RE12.
10762 /// Its device-specific definition is given in pic24_ports_mapping.h.
10763 # define RE12_AN xx
10764 
10765 /// This macro specifies the CNm value associated with pin RE12.
10766 /// Its device-specific definition is given in pic24_ports_mapping.h.
10767 # define RE12_CN xx
10768 
10769 //@}
10770 # endif // #ifdef __DOXYGEN__
10771 
10772 
10773 // Low-level config
10774 // ----------------
10775 // Analog:
10776 # if defined(_ANSE12) || defined(__DOXYGEN__)
10777 /// Enable analog functionality on pin RE12.
10778 # define ENABLE_RE12_ANALOG() (_ANSE12 = 1)
10779 /// Disable analog functionality on pin RE12.
10780 # define DISABLE_RE12_ANALOG() (_ANSE12 = 0)
10781 # elif defined(RE12_AN)
10782 # define ENABLE_RE12_ANALOG() (RXY_GPIO_PCFG(RE12_AN) = 0)
10783 # define DISABLE_RE12_ANALOG() (RXY_GPIO_PCFG(RE12_AN) = 1)
10784 # else
10785 # define DISABLE_RE12_ANALOG() ((void) 0)
10786 # endif
10787 
10788 // Input/output:
10789 /// Configure pin RE12 as an input.
10790 # define CONFIG_RE12_AS_INPUT() (_TRISE12 = 1)
10791 /// Configure pin RE12 as an output.
10792 # define CONFIG_RE12_AS_OUTPUT() (_TRISE12 = 0)
10793 
10794 // Open-drain:
10795 # if defined(_ODCE12) || defined(__DOXYGEN__)
10796 /// Enable the open-drain driver on pin RE12.
10797 # define ENABLE_RE12_OPENDRAIN() (_ODCE12 = 1)
10798 /// Disable the open-drain driver on pin RE12.
10799 # define DISABLE_RE12_OPENDRAIN() (_ODCE12 = 0)
10800 # elif defined(_ODE12) // The PIF24F names this bit _OD instead of _ODC.
10801 # define ENABLE_RE12_OPENDRAIN() (_ODE12 = 1)
10802 # define DISABLE_RE12_OPENDRAIN() (_ODE12 = 0)
10803 # else
10804 # define DISABLE_RE12_OPENDRAIN() ((void) 0)
10805 # endif
10806 
10807 // Change notification, pullups and pulldowns:
10808 # if defined(_CNIEE12) || defined(__DOXYGEN__)
10809 /// Enable the pullup on pin RE12.
10810 # define ENABLE_RE12_PULLUP() (_CNPUE12 = 1)
10811 /// Disable the pullup on pin RE12.
10812 # define DISABLE_RE12_PULLUP() (_CNPUE12 = 0)
10813 
10814 /// Enable the pulldown on pin RE12.
10815 # define ENABLE_RE12_PULLDOWN() (_CNPDE12 = 1)
10816 /// Disable the pulldown on pin RE12.
10817 # define DISABLE_RE12_PULLDOWN() (_CNPDE12 = 0)
10818 
10819 /// Enable the change notification interrupt on pin RE12.
10820 # define ENABLE_RE12_CN_INTERRUPT() (_CNIEE12 = 1)
10821 /// Disable the change notification interrupt on pin RE12.
10822 # define DISABLE_RE12_CN_INTERRUPT() (_CNIEE12 = 0)
10823 
10824 # elif defined(RE12_CN)
10825 # define ENABLE_RE12_PULLUP() (RXY_GPIO_CNPUE(RE12_CN) = 1)
10826 # define DISABLE_RE12_PULLUP() (RXY_GPIO_CNPUE(RE12_CN) = 0)
10827 
10828 # if RXY_HAS_CNPDE(RE12_CN)
10829 # define ENABLE_RE12_PULLDOWN() (RXY_GPIO_CNPDE(RE12_CN) = 1)
10830 # define DISABLE_RE12_PULLDOWN() (RXY_GPIO_CNPDE(RE12_CN) = 0)
10831 # else
10832 # define DISABLE_RE12_PULLDOWN() ((void) 0)
10833 # endif
10834 
10835 # define ENABLE_RE12_CN_INTERRUPT() (RXY_GPIO_CNIE(RE12_CN) = 1)
10836 # define DISABLE_RE12_CN_INTERRUPT() (RXY_GPIO_CNIE(RE12_CN) = 0)
10837 
10838 # else
10839 # define DISABLE_RE12_PULLUP() ((void) 0)
10840 # define DISABLE_RE12_PULLDOWN() ((void) 0)
10841 # define DISABLE_RE12_CN_INTERRUPT() ((void) 0)
10842 # endif
10843 
10844 // High-level config
10845 // -----------------
10846 /** This macro disables pullups/downs, enables analog functionality, and configures
10847  * pin RE12 as an input.
10848  */
10849 # if defined(_ANSE12) || defined(RE12_AN) || defined(__DOXYGEN__)
10850 # define CONFIG_RE12_AS_ANALOG() \
10851  do { \
10852  ENABLE_RE12_ANALOG(); \
10853  CONFIG_RE12_AS_INPUT(); \
10854  DISABLE_RE12_OPENDRAIN(); \
10855  DISABLE_RE12_PULLUP(); \
10856  DISABLE_RE12_PULLDOWN(); \
10857  } while (0)
10858 # endif
10859 
10860 /** This macro disables open-drain and pullups/downs,
10861  * configures pin RE12 for digital (not analog) operation, and
10862  * configures the pin as an input.
10863  */
10864 # define CONFIG_RE12_AS_DIG_INPUT() \
10865  do { \
10866  DISABLE_RE12_ANALOG(); \
10867  CONFIG_RE12_AS_INPUT(); \
10868  DISABLE_RE12_OPENDRAIN(); \
10869  DISABLE_RE12_PULLUP(); \
10870  DISABLE_RE12_PULLDOWN(); \
10871  } while (0)
10872 
10873 /** This macro disables open-drain and pullups/downs,
10874  * configures pin RE12 for digital (not analog) operation, and
10875  * configures the pin as an output.
10876  */
10877 # define CONFIG_RE12_AS_DIG_OUTPUT() \
10878  do { \
10879  DISABLE_RE12_ANALOG(); \
10880  CONFIG_RE12_AS_OUTPUT(); \
10881  DISABLE_RE12_OPENDRAIN(); \
10882  DISABLE_RE12_PULLUP(); \
10883  DISABLE_RE12_PULLDOWN(); \
10884  } while (0)
10885 
10886 #endif // #if defined(_RE12) || defined(__DOXYGEN__): Provide GPIO for RE12
10887 
10888 
10889 
10890 
10891 
10892 // Provide GPIO for RE13
10893 // ====================
10894 #if defined(_RE13) || defined(__DOXYGEN__)
10895 
10896 // Dummy macros for documentation only
10897 # ifdef __DOXYGEN__
10898 /// This macro specifies the RPy value associated with pin RE13.
10899 /// Its device-specific definition is given in pic24_ports_mapping.h.
10900 # define RE13_RP xx
10901 
10902 /// This macro specifies the ANn value associated with pin RE13.
10903 /// Its device-specific definition is given in pic24_ports_mapping.h.
10904 # define RE13_AN xx
10905 
10906 /// This macro specifies the CNm value associated with pin RE13.
10907 /// Its device-specific definition is given in pic24_ports_mapping.h.
10908 # define RE13_CN xx
10909 
10910 //@}
10911 # endif // #ifdef __DOXYGEN__
10912 
10913 
10914 // Low-level config
10915 // ----------------
10916 // Analog:
10917 # if defined(_ANSE13) || defined(__DOXYGEN__)
10918 /// Enable analog functionality on pin RE13.
10919 # define ENABLE_RE13_ANALOG() (_ANSE13 = 1)
10920 /// Disable analog functionality on pin RE13.
10921 # define DISABLE_RE13_ANALOG() (_ANSE13 = 0)
10922 # elif defined(RE13_AN)
10923 # define ENABLE_RE13_ANALOG() (RXY_GPIO_PCFG(RE13_AN) = 0)
10924 # define DISABLE_RE13_ANALOG() (RXY_GPIO_PCFG(RE13_AN) = 1)
10925 # else
10926 # define DISABLE_RE13_ANALOG() ((void) 0)
10927 # endif
10928 
10929 // Input/output:
10930 /// Configure pin RE13 as an input.
10931 # define CONFIG_RE13_AS_INPUT() (_TRISE13 = 1)
10932 /// Configure pin RE13 as an output.
10933 # define CONFIG_RE13_AS_OUTPUT() (_TRISE13 = 0)
10934 
10935 // Open-drain:
10936 # if defined(_ODCE13) || defined(__DOXYGEN__)
10937 /// Enable the open-drain driver on pin RE13.
10938 # define ENABLE_RE13_OPENDRAIN() (_ODCE13 = 1)
10939 /// Disable the open-drain driver on pin RE13.
10940 # define DISABLE_RE13_OPENDRAIN() (_ODCE13 = 0)
10941 # elif defined(_ODE13) // The PIF24F names this bit _OD instead of _ODC.
10942 # define ENABLE_RE13_OPENDRAIN() (_ODE13 = 1)
10943 # define DISABLE_RE13_OPENDRAIN() (_ODE13 = 0)
10944 # else
10945 # define DISABLE_RE13_OPENDRAIN() ((void) 0)
10946 # endif
10947 
10948 // Change notification, pullups and pulldowns:
10949 # if defined(_CNIEE13) || defined(__DOXYGEN__)
10950 /// Enable the pullup on pin RE13.
10951 # define ENABLE_RE13_PULLUP() (_CNPUE13 = 1)
10952 /// Disable the pullup on pin RE13.
10953 # define DISABLE_RE13_PULLUP() (_CNPUE13 = 0)
10954 
10955 /// Enable the pulldown on pin RE13.
10956 # define ENABLE_RE13_PULLDOWN() (_CNPDE13 = 1)
10957 /// Disable the pulldown on pin RE13.
10958 # define DISABLE_RE13_PULLDOWN() (_CNPDE13 = 0)
10959 
10960 /// Enable the change notification interrupt on pin RE13.
10961 # define ENABLE_RE13_CN_INTERRUPT() (_CNIEE13 = 1)
10962 /// Disable the change notification interrupt on pin RE13.
10963 # define DISABLE_RE13_CN_INTERRUPT() (_CNIEE13 = 0)
10964 
10965 # elif defined(RE13_CN)
10966 # define ENABLE_RE13_PULLUP() (RXY_GPIO_CNPUE(RE13_CN) = 1)
10967 # define DISABLE_RE13_PULLUP() (RXY_GPIO_CNPUE(RE13_CN) = 0)
10968 
10969 # if RXY_HAS_CNPDE(RE13_CN)
10970 # define ENABLE_RE13_PULLDOWN() (RXY_GPIO_CNPDE(RE13_CN) = 1)
10971 # define DISABLE_RE13_PULLDOWN() (RXY_GPIO_CNPDE(RE13_CN) = 0)
10972 # else
10973 # define DISABLE_RE13_PULLDOWN() ((void) 0)
10974 # endif
10975 
10976 # define ENABLE_RE13_CN_INTERRUPT() (RXY_GPIO_CNIE(RE13_CN) = 1)
10977 # define DISABLE_RE13_CN_INTERRUPT() (RXY_GPIO_CNIE(RE13_CN) = 0)
10978 
10979 # else
10980 # define DISABLE_RE13_PULLUP() ((void) 0)
10981 # define DISABLE_RE13_PULLDOWN() ((void) 0)
10982 # define DISABLE_RE13_CN_INTERRUPT() ((void) 0)
10983 # endif
10984 
10985 // High-level config
10986 // -----------------
10987 /** This macro disables pullups/downs, enables analog functionality, and configures
10988  * pin RE13 as an input.
10989  */
10990 # if defined(_ANSE13) || defined(RE13_AN) || defined(__DOXYGEN__)
10991 # define CONFIG_RE13_AS_ANALOG() \
10992  do { \
10993  ENABLE_RE13_ANALOG(); \
10994  CONFIG_RE13_AS_INPUT(); \
10995  DISABLE_RE13_OPENDRAIN(); \
10996  DISABLE_RE13_PULLUP(); \
10997  DISABLE_RE13_PULLDOWN(); \
10998  } while (0)
10999 # endif
11000 
11001 /** This macro disables open-drain and pullups/downs,
11002  * configures pin RE13 for digital (not analog) operation, and
11003  * configures the pin as an input.
11004  */
11005 # define CONFIG_RE13_AS_DIG_INPUT() \
11006  do { \
11007  DISABLE_RE13_ANALOG(); \
11008  CONFIG_RE13_AS_INPUT(); \
11009  DISABLE_RE13_OPENDRAIN(); \
11010  DISABLE_RE13_PULLUP(); \
11011  DISABLE_RE13_PULLDOWN(); \
11012  } while (0)
11013 
11014 /** This macro disables open-drain and pullups/downs,
11015  * configures pin RE13 for digital (not analog) operation, and
11016  * configures the pin as an output.
11017  */
11018 # define CONFIG_RE13_AS_DIG_OUTPUT() \
11019  do { \
11020  DISABLE_RE13_ANALOG(); \
11021  CONFIG_RE13_AS_OUTPUT(); \
11022  DISABLE_RE13_OPENDRAIN(); \
11023  DISABLE_RE13_PULLUP(); \
11024  DISABLE_RE13_PULLDOWN(); \
11025  } while (0)
11026 
11027 #endif // #if defined(_RE13) || defined(__DOXYGEN__): Provide GPIO for RE13
11028 
11029 
11030 
11031 
11032 
11033 // Provide GPIO for RE14
11034 // ====================
11035 #if defined(_RE14) || defined(__DOXYGEN__)
11036 
11037 // Dummy macros for documentation only
11038 # ifdef __DOXYGEN__
11039 /// This macro specifies the RPy value associated with pin RE14.
11040 /// Its device-specific definition is given in pic24_ports_mapping.h.
11041 # define RE14_RP xx
11042 
11043 /// This macro specifies the ANn value associated with pin RE14.
11044 /// Its device-specific definition is given in pic24_ports_mapping.h.
11045 # define RE14_AN xx
11046 
11047 /// This macro specifies the CNm value associated with pin RE14.
11048 /// Its device-specific definition is given in pic24_ports_mapping.h.
11049 # define RE14_CN xx
11050 
11051 //@}
11052 # endif // #ifdef __DOXYGEN__
11053 
11054 
11055 // Low-level config
11056 // ----------------
11057 // Analog:
11058 # if defined(_ANSE14) || defined(__DOXYGEN__)
11059 /// Enable analog functionality on pin RE14.
11060 # define ENABLE_RE14_ANALOG() (_ANSE14 = 1)
11061 /// Disable analog functionality on pin RE14.
11062 # define DISABLE_RE14_ANALOG() (_ANSE14 = 0)
11063 # elif defined(RE14_AN)
11064 # define ENABLE_RE14_ANALOG() (RXY_GPIO_PCFG(RE14_AN) = 0)
11065 # define DISABLE_RE14_ANALOG() (RXY_GPIO_PCFG(RE14_AN) = 1)
11066 # else
11067 # define DISABLE_RE14_ANALOG() ((void) 0)
11068 # endif
11069 
11070 // Input/output:
11071 /// Configure pin RE14 as an input.
11072 # define CONFIG_RE14_AS_INPUT() (_TRISE14 = 1)
11073 /// Configure pin RE14 as an output.
11074 # define CONFIG_RE14_AS_OUTPUT() (_TRISE14 = 0)
11075 
11076 // Open-drain:
11077 # if defined(_ODCE14) || defined(__DOXYGEN__)
11078 /// Enable the open-drain driver on pin RE14.
11079 # define ENABLE_RE14_OPENDRAIN() (_ODCE14 = 1)
11080 /// Disable the open-drain driver on pin RE14.
11081 # define DISABLE_RE14_OPENDRAIN() (_ODCE14 = 0)
11082 # elif defined(_ODE14) // The PIF24F names this bit _OD instead of _ODC.
11083 # define ENABLE_RE14_OPENDRAIN() (_ODE14 = 1)
11084 # define DISABLE_RE14_OPENDRAIN() (_ODE14 = 0)
11085 # else
11086 # define DISABLE_RE14_OPENDRAIN() ((void) 0)
11087 # endif
11088 
11089 // Change notification, pullups and pulldowns:
11090 # if defined(_CNIEE14) || defined(__DOXYGEN__)
11091 /// Enable the pullup on pin RE14.
11092 # define ENABLE_RE14_PULLUP() (_CNPUE14 = 1)
11093 /// Disable the pullup on pin RE14.
11094 # define DISABLE_RE14_PULLUP() (_CNPUE14 = 0)
11095 
11096 /// Enable the pulldown on pin RE14.
11097 # define ENABLE_RE14_PULLDOWN() (_CNPDE14 = 1)
11098 /// Disable the pulldown on pin RE14.
11099 # define DISABLE_RE14_PULLDOWN() (_CNPDE14 = 0)
11100 
11101 /// Enable the change notification interrupt on pin RE14.
11102 # define ENABLE_RE14_CN_INTERRUPT() (_CNIEE14 = 1)
11103 /// Disable the change notification interrupt on pin RE14.
11104 # define DISABLE_RE14_CN_INTERRUPT() (_CNIEE14 = 0)
11105 
11106 # elif defined(RE14_CN)
11107 # define ENABLE_RE14_PULLUP() (RXY_GPIO_CNPUE(RE14_CN) = 1)
11108 # define DISABLE_RE14_PULLUP() (RXY_GPIO_CNPUE(RE14_CN) = 0)
11109 
11110 # if RXY_HAS_CNPDE(RE14_CN)
11111 # define ENABLE_RE14_PULLDOWN() (RXY_GPIO_CNPDE(RE14_CN) = 1)
11112 # define DISABLE_RE14_PULLDOWN() (RXY_GPIO_CNPDE(RE14_CN) = 0)
11113 # else
11114 # define DISABLE_RE14_PULLDOWN() ((void) 0)
11115 # endif
11116 
11117 # define ENABLE_RE14_CN_INTERRUPT() (RXY_GPIO_CNIE(RE14_CN) = 1)
11118 # define DISABLE_RE14_CN_INTERRUPT() (RXY_GPIO_CNIE(RE14_CN) = 0)
11119 
11120 # else
11121 # define DISABLE_RE14_PULLUP() ((void) 0)
11122 # define DISABLE_RE14_PULLDOWN() ((void) 0)
11123 # define DISABLE_RE14_CN_INTERRUPT() ((void) 0)
11124 # endif
11125 
11126 // High-level config
11127 // -----------------
11128 /** This macro disables pullups/downs, enables analog functionality, and configures
11129  * pin RE14 as an input.
11130  */
11131 # if defined(_ANSE14) || defined(RE14_AN) || defined(__DOXYGEN__)
11132 # define CONFIG_RE14_AS_ANALOG() \
11133  do { \
11134  ENABLE_RE14_ANALOG(); \
11135  CONFIG_RE14_AS_INPUT(); \
11136  DISABLE_RE14_OPENDRAIN(); \
11137  DISABLE_RE14_PULLUP(); \
11138  DISABLE_RE14_PULLDOWN(); \
11139  } while (0)
11140 # endif
11141 
11142 /** This macro disables open-drain and pullups/downs,
11143  * configures pin RE14 for digital (not analog) operation, and
11144  * configures the pin as an input.
11145  */
11146 # define CONFIG_RE14_AS_DIG_INPUT() \
11147  do { \
11148  DISABLE_RE14_ANALOG(); \
11149  CONFIG_RE14_AS_INPUT(); \
11150  DISABLE_RE14_OPENDRAIN(); \
11151  DISABLE_RE14_PULLUP(); \
11152  DISABLE_RE14_PULLDOWN(); \
11153  } while (0)
11154 
11155 /** This macro disables open-drain and pullups/downs,
11156  * configures pin RE14 for digital (not analog) operation, and
11157  * configures the pin as an output.
11158  */
11159 # define CONFIG_RE14_AS_DIG_OUTPUT() \
11160  do { \
11161  DISABLE_RE14_ANALOG(); \
11162  CONFIG_RE14_AS_OUTPUT(); \
11163  DISABLE_RE14_OPENDRAIN(); \
11164  DISABLE_RE14_PULLUP(); \
11165  DISABLE_RE14_PULLDOWN(); \
11166  } while (0)
11167 
11168 #endif // #if defined(_RE14) || defined(__DOXYGEN__): Provide GPIO for RE14
11169 
11170 
11171 
11172 
11173 
11174 // Provide GPIO for RE15
11175 // ====================
11176 #if defined(_RE15) || defined(__DOXYGEN__)
11177 
11178 // Dummy macros for documentation only
11179 # ifdef __DOXYGEN__
11180 /// This macro specifies the RPy value associated with pin RE15.
11181 /// Its device-specific definition is given in pic24_ports_mapping.h.
11182 # define RE15_RP xx
11183 
11184 /// This macro specifies the ANn value associated with pin RE15.
11185 /// Its device-specific definition is given in pic24_ports_mapping.h.
11186 # define RE15_AN xx
11187 
11188 /// This macro specifies the CNm value associated with pin RE15.
11189 /// Its device-specific definition is given in pic24_ports_mapping.h.
11190 # define RE15_CN xx
11191 
11192 //@}
11193 # endif // #ifdef __DOXYGEN__
11194 
11195 
11196 // Low-level config
11197 // ----------------
11198 // Analog:
11199 # if defined(_ANSE15) || defined(__DOXYGEN__)
11200 /// Enable analog functionality on pin RE15.
11201 # define ENABLE_RE15_ANALOG() (_ANSE15 = 1)
11202 /// Disable analog functionality on pin RE15.
11203 # define DISABLE_RE15_ANALOG() (_ANSE15 = 0)
11204 # elif defined(RE15_AN)
11205 # define ENABLE_RE15_ANALOG() (RXY_GPIO_PCFG(RE15_AN) = 0)
11206 # define DISABLE_RE15_ANALOG() (RXY_GPIO_PCFG(RE15_AN) = 1)
11207 # else
11208 # define DISABLE_RE15_ANALOG() ((void) 0)
11209 # endif
11210 
11211 // Input/output:
11212 /// Configure pin RE15 as an input.
11213 # define CONFIG_RE15_AS_INPUT() (_TRISE15 = 1)
11214 /// Configure pin RE15 as an output.
11215 # define CONFIG_RE15_AS_OUTPUT() (_TRISE15 = 0)
11216 
11217 // Open-drain:
11218 # if defined(_ODCE15) || defined(__DOXYGEN__)
11219 /// Enable the open-drain driver on pin RE15.
11220 # define ENABLE_RE15_OPENDRAIN() (_ODCE15 = 1)
11221 /// Disable the open-drain driver on pin RE15.
11222 # define DISABLE_RE15_OPENDRAIN() (_ODCE15 = 0)
11223 # elif defined(_ODE15) // The PIF24F names this bit _OD instead of _ODC.
11224 # define ENABLE_RE15_OPENDRAIN() (_ODE15 = 1)
11225 # define DISABLE_RE15_OPENDRAIN() (_ODE15 = 0)
11226 # else
11227 # define DISABLE_RE15_OPENDRAIN() ((void) 0)
11228 # endif
11229 
11230 // Change notification, pullups and pulldowns:
11231 # if defined(_CNIEE15) || defined(__DOXYGEN__)
11232 /// Enable the pullup on pin RE15.
11233 # define ENABLE_RE15_PULLUP() (_CNPUE15 = 1)
11234 /// Disable the pullup on pin RE15.
11235 # define DISABLE_RE15_PULLUP() (_CNPUE15 = 0)
11236 
11237 /// Enable the pulldown on pin RE15.
11238 # define ENABLE_RE15_PULLDOWN() (_CNPDE15 = 1)
11239 /// Disable the pulldown on pin RE15.
11240 # define DISABLE_RE15_PULLDOWN() (_CNPDE15 = 0)
11241 
11242 /// Enable the change notification interrupt on pin RE15.
11243 # define ENABLE_RE15_CN_INTERRUPT() (_CNIEE15 = 1)
11244 /// Disable the change notification interrupt on pin RE15.
11245 # define DISABLE_RE15_CN_INTERRUPT() (_CNIEE15 = 0)
11246 
11247 # elif defined(RE15_CN)
11248 # define ENABLE_RE15_PULLUP() (RXY_GPIO_CNPUE(RE15_CN) = 1)
11249 # define DISABLE_RE15_PULLUP() (RXY_GPIO_CNPUE(RE15_CN) = 0)
11250 
11251 # if RXY_HAS_CNPDE(RE15_CN)
11252 # define ENABLE_RE15_PULLDOWN() (RXY_GPIO_CNPDE(RE15_CN) = 1)
11253 # define DISABLE_RE15_PULLDOWN() (RXY_GPIO_CNPDE(RE15_CN) = 0)
11254 # else
11255 # define DISABLE_RE15_PULLDOWN() ((void) 0)
11256 # endif
11257 
11258 # define ENABLE_RE15_CN_INTERRUPT() (RXY_GPIO_CNIE(RE15_CN) = 1)
11259 # define DISABLE_RE15_CN_INTERRUPT() (RXY_GPIO_CNIE(RE15_CN) = 0)
11260 
11261 # else
11262 # define DISABLE_RE15_PULLUP() ((void) 0)
11263 # define DISABLE_RE15_PULLDOWN() ((void) 0)
11264 # define DISABLE_RE15_CN_INTERRUPT() ((void) 0)
11265 # endif
11266 
11267 // High-level config
11268 // -----------------
11269 /** This macro disables pullups/downs, enables analog functionality, and configures
11270  * pin RE15 as an input.
11271  */
11272 # if defined(_ANSE15) || defined(RE15_AN) || defined(__DOXYGEN__)
11273 # define CONFIG_RE15_AS_ANALOG() \
11274  do { \
11275  ENABLE_RE15_ANALOG(); \
11276  CONFIG_RE15_AS_INPUT(); \
11277  DISABLE_RE15_OPENDRAIN(); \
11278  DISABLE_RE15_PULLUP(); \
11279  DISABLE_RE15_PULLDOWN(); \
11280  } while (0)
11281 # endif
11282 
11283 /** This macro disables open-drain and pullups/downs,
11284  * configures pin RE15 for digital (not analog) operation, and
11285  * configures the pin as an input.
11286  */
11287 # define CONFIG_RE15_AS_DIG_INPUT() \
11288  do { \
11289  DISABLE_RE15_ANALOG(); \
11290  CONFIG_RE15_AS_INPUT(); \
11291  DISABLE_RE15_OPENDRAIN(); \
11292  DISABLE_RE15_PULLUP(); \
11293  DISABLE_RE15_PULLDOWN(); \
11294  } while (0)
11295 
11296 /** This macro disables open-drain and pullups/downs,
11297  * configures pin RE15 for digital (not analog) operation, and
11298  * configures the pin as an output.
11299  */
11300 # define CONFIG_RE15_AS_DIG_OUTPUT() \
11301  do { \
11302  DISABLE_RE15_ANALOG(); \
11303  CONFIG_RE15_AS_OUTPUT(); \
11304  DISABLE_RE15_OPENDRAIN(); \
11305  DISABLE_RE15_PULLUP(); \
11306  DISABLE_RE15_PULLDOWN(); \
11307  } while (0)
11308 
11309 #endif // #if defined(_RE15) || defined(__DOXYGEN__): Provide GPIO for RE15
11310 
11311 
11312 
11313 
11314 
11315 // Provide GPIO for RF0
11316 // ====================
11317 #if defined(_RF0) || defined(__DOXYGEN__)
11318 
11319 // Dummy macros for documentation only
11320 # ifdef __DOXYGEN__
11321 /// This macro specifies the RPy value associated with pin RF0.
11322 /// Its device-specific definition is given in pic24_ports_mapping.h.
11323 # define RF0_RP xx
11324 
11325 /// This macro specifies the ANn value associated with pin RF0.
11326 /// Its device-specific definition is given in pic24_ports_mapping.h.
11327 # define RF0_AN xx
11328 
11329 /// This macro specifies the CNm value associated with pin RF0.
11330 /// Its device-specific definition is given in pic24_ports_mapping.h.
11331 # define RF0_CN xx
11332 
11333 //@}
11334 # endif // #ifdef __DOXYGEN__
11335 
11336 
11337 // Low-level config
11338 // ----------------
11339 // Analog:
11340 # if defined(_ANSF0) || defined(__DOXYGEN__)
11341 /// Enable analog functionality on pin RF0.
11342 # define ENABLE_RF0_ANALOG() (_ANSF0 = 1)
11343 /// Disable analog functionality on pin RF0.
11344 # define DISABLE_RF0_ANALOG() (_ANSF0 = 0)
11345 # elif defined(RF0_AN)
11346 # define ENABLE_RF0_ANALOG() (RXY_GPIO_PCFG(RF0_AN) = 0)
11347 # define DISABLE_RF0_ANALOG() (RXY_GPIO_PCFG(RF0_AN) = 1)
11348 # else
11349 # define DISABLE_RF0_ANALOG() ((void) 0)
11350 # endif
11351 
11352 // Input/output:
11353 /// Configure pin RF0 as an input.
11354 # define CONFIG_RF0_AS_INPUT() (_TRISF0 = 1)
11355 /// Configure pin RF0 as an output.
11356 # define CONFIG_RF0_AS_OUTPUT() (_TRISF0 = 0)
11357 
11358 // Open-drain:
11359 # if defined(_ODCF0) || defined(__DOXYGEN__)
11360 /// Enable the open-drain driver on pin RF0.
11361 # define ENABLE_RF0_OPENDRAIN() (_ODCF0 = 1)
11362 /// Disable the open-drain driver on pin RF0.
11363 # define DISABLE_RF0_OPENDRAIN() (_ODCF0 = 0)
11364 # elif defined(_ODF0) // The PIF24F names this bit _OD instead of _ODC.
11365 # define ENABLE_RF0_OPENDRAIN() (_ODF0 = 1)
11366 # define DISABLE_RF0_OPENDRAIN() (_ODF0 = 0)
11367 # else
11368 # define DISABLE_RF0_OPENDRAIN() ((void) 0)
11369 # endif
11370 
11371 // Change notification, pullups and pulldowns:
11372 # if defined(_CNIEF0) || defined(__DOXYGEN__)
11373 /// Enable the pullup on pin RF0.
11374 # define ENABLE_RF0_PULLUP() (_CNPUF0 = 1)
11375 /// Disable the pullup on pin RF0.
11376 # define DISABLE_RF0_PULLUP() (_CNPUF0 = 0)
11377 
11378 /// Enable the pulldown on pin RF0.
11379 # define ENABLE_RF0_PULLDOWN() (_CNPDF0 = 1)
11380 /// Disable the pulldown on pin RF0.
11381 # define DISABLE_RF0_PULLDOWN() (_CNPDF0 = 0)
11382 
11383 /// Enable the change notification interrupt on pin RF0.
11384 # define ENABLE_RF0_CN_INTERRUPT() (_CNIEF0 = 1)
11385 /// Disable the change notification interrupt on pin RF0.
11386 # define DISABLE_RF0_CN_INTERRUPT() (_CNIEF0 = 0)
11387 
11388 # elif defined(RF0_CN)
11389 # define ENABLE_RF0_PULLUP() (RXY_GPIO_CNPUE(RF0_CN) = 1)
11390 # define DISABLE_RF0_PULLUP() (RXY_GPIO_CNPUE(RF0_CN) = 0)
11391 
11392 # if RXY_HAS_CNPDE(RF0_CN)
11393 # define ENABLE_RF0_PULLDOWN() (RXY_GPIO_CNPDE(RF0_CN) = 1)
11394 # define DISABLE_RF0_PULLDOWN() (RXY_GPIO_CNPDE(RF0_CN) = 0)
11395 # else
11396 # define DISABLE_RF0_PULLDOWN() ((void) 0)
11397 # endif
11398 
11399 # define ENABLE_RF0_CN_INTERRUPT() (RXY_GPIO_CNIE(RF0_CN) = 1)
11400 # define DISABLE_RF0_CN_INTERRUPT() (RXY_GPIO_CNIE(RF0_CN) = 0)
11401 
11402 # else
11403 # define DISABLE_RF0_PULLUP() ((void) 0)
11404 # define DISABLE_RF0_PULLDOWN() ((void) 0)
11405 # define DISABLE_RF0_CN_INTERRUPT() ((void) 0)
11406 # endif
11407 
11408 // High-level config
11409 // -----------------
11410 /** This macro disables pullups/downs, enables analog functionality, and configures
11411  * pin RF0 as an input.
11412  */
11413 # if defined(_ANSF0) || defined(RF0_AN) || defined(__DOXYGEN__)
11414 # define CONFIG_RF0_AS_ANALOG() \
11415  do { \
11416  ENABLE_RF0_ANALOG(); \
11417  CONFIG_RF0_AS_INPUT(); \
11418  DISABLE_RF0_OPENDRAIN(); \
11419  DISABLE_RF0_PULLUP(); \
11420  DISABLE_RF0_PULLDOWN(); \
11421  } while (0)
11422 # endif
11423 
11424 /** This macro disables open-drain and pullups/downs,
11425  * configures pin RF0 for digital (not analog) operation, and
11426  * configures the pin as an input.
11427  */
11428 # define CONFIG_RF0_AS_DIG_INPUT() \
11429  do { \
11430  DISABLE_RF0_ANALOG(); \
11431  CONFIG_RF0_AS_INPUT(); \
11432  DISABLE_RF0_OPENDRAIN(); \
11433  DISABLE_RF0_PULLUP(); \
11434  DISABLE_RF0_PULLDOWN(); \
11435  } while (0)
11436 
11437 /** This macro disables open-drain and pullups/downs,
11438  * configures pin RF0 for digital (not analog) operation, and
11439  * configures the pin as an output.
11440  */
11441 # define CONFIG_RF0_AS_DIG_OUTPUT() \
11442  do { \
11443  DISABLE_RF0_ANALOG(); \
11444  CONFIG_RF0_AS_OUTPUT(); \
11445  DISABLE_RF0_OPENDRAIN(); \
11446  DISABLE_RF0_PULLUP(); \
11447  DISABLE_RF0_PULLDOWN(); \
11448  } while (0)
11449 
11450 #endif // #if defined(_RF0) || defined(__DOXYGEN__): Provide GPIO for RF0
11451 
11452 
11453 
11454 
11455 
11456 // Provide GPIO for RF1
11457 // ====================
11458 #if defined(_RF1) || defined(__DOXYGEN__)
11459 
11460 // Dummy macros for documentation only
11461 # ifdef __DOXYGEN__
11462 /// This macro specifies the RPy value associated with pin RF1.
11463 /// Its device-specific definition is given in pic24_ports_mapping.h.
11464 # define RF1_RP xx
11465 
11466 /// This macro specifies the ANn value associated with pin RF1.
11467 /// Its device-specific definition is given in pic24_ports_mapping.h.
11468 # define RF1_AN xx
11469 
11470 /// This macro specifies the CNm value associated with pin RF1.
11471 /// Its device-specific definition is given in pic24_ports_mapping.h.
11472 # define RF1_CN xx
11473 
11474 //@}
11475 # endif // #ifdef __DOXYGEN__
11476 
11477 
11478 // Low-level config
11479 // ----------------
11480 // Analog:
11481 # if defined(_ANSF1) || defined(__DOXYGEN__)
11482 /// Enable analog functionality on pin RF1.
11483 # define ENABLE_RF1_ANALOG() (_ANSF1 = 1)
11484 /// Disable analog functionality on pin RF1.
11485 # define DISABLE_RF1_ANALOG() (_ANSF1 = 0)
11486 # elif defined(RF1_AN)
11487 # define ENABLE_RF1_ANALOG() (RXY_GPIO_PCFG(RF1_AN) = 0)
11488 # define DISABLE_RF1_ANALOG() (RXY_GPIO_PCFG(RF1_AN) = 1)
11489 # else
11490 # define DISABLE_RF1_ANALOG() ((void) 0)
11491 # endif
11492 
11493 // Input/output:
11494 /// Configure pin RF1 as an input.
11495 # define CONFIG_RF1_AS_INPUT() (_TRISF1 = 1)
11496 /// Configure pin RF1 as an output.
11497 # define CONFIG_RF1_AS_OUTPUT() (_TRISF1 = 0)
11498 
11499 // Open-drain:
11500 # if defined(_ODCF1) || defined(__DOXYGEN__)
11501 /// Enable the open-drain driver on pin RF1.
11502 # define ENABLE_RF1_OPENDRAIN() (_ODCF1 = 1)
11503 /// Disable the open-drain driver on pin RF1.
11504 # define DISABLE_RF1_OPENDRAIN() (_ODCF1 = 0)
11505 # elif defined(_ODF1) // The PIF24F names this bit _OD instead of _ODC.
11506 # define ENABLE_RF1_OPENDRAIN() (_ODF1 = 1)
11507 # define DISABLE_RF1_OPENDRAIN() (_ODF1 = 0)
11508 # else
11509 # define DISABLE_RF1_OPENDRAIN() ((void) 0)
11510 # endif
11511 
11512 // Change notification, pullups and pulldowns:
11513 # if defined(_CNIEF1) || defined(__DOXYGEN__)
11514 /// Enable the pullup on pin RF1.
11515 # define ENABLE_RF1_PULLUP() (_CNPUF1 = 1)
11516 /// Disable the pullup on pin RF1.
11517 # define DISABLE_RF1_PULLUP() (_CNPUF1 = 0)
11518 
11519 /// Enable the pulldown on pin RF1.
11520 # define ENABLE_RF1_PULLDOWN() (_CNPDF1 = 1)
11521 /// Disable the pulldown on pin RF1.
11522 # define DISABLE_RF1_PULLDOWN() (_CNPDF1 = 0)
11523 
11524 /// Enable the change notification interrupt on pin RF1.
11525 # define ENABLE_RF1_CN_INTERRUPT() (_CNIEF1 = 1)
11526 /// Disable the change notification interrupt on pin RF1.
11527 # define DISABLE_RF1_CN_INTERRUPT() (_CNIEF1 = 0)
11528 
11529 # elif defined(RF1_CN)
11530 # define ENABLE_RF1_PULLUP() (RXY_GPIO_CNPUE(RF1_CN) = 1)
11531 # define DISABLE_RF1_PULLUP() (RXY_GPIO_CNPUE(RF1_CN) = 0)
11532 
11533 # if RXY_HAS_CNPDE(RF1_CN)
11534 # define ENABLE_RF1_PULLDOWN() (RXY_GPIO_CNPDE(RF1_CN) = 1)
11535 # define DISABLE_RF1_PULLDOWN() (RXY_GPIO_CNPDE(RF1_CN) = 0)
11536 # else
11537 # define DISABLE_RF1_PULLDOWN() ((void) 0)
11538 # endif
11539 
11540 # define ENABLE_RF1_CN_INTERRUPT() (RXY_GPIO_CNIE(RF1_CN) = 1)
11541 # define DISABLE_RF1_CN_INTERRUPT() (RXY_GPIO_CNIE(RF1_CN) = 0)
11542 
11543 # else
11544 # define DISABLE_RF1_PULLUP() ((void) 0)
11545 # define DISABLE_RF1_PULLDOWN() ((void) 0)
11546 # define DISABLE_RF1_CN_INTERRUPT() ((void) 0)
11547 # endif
11548 
11549 // High-level config
11550 // -----------------
11551 /** This macro disables pullups/downs, enables analog functionality, and configures
11552  * pin RF1 as an input.
11553  */
11554 # if defined(_ANSF1) || defined(RF1_AN) || defined(__DOXYGEN__)
11555 # define CONFIG_RF1_AS_ANALOG() \
11556  do { \
11557  ENABLE_RF1_ANALOG(); \
11558  CONFIG_RF1_AS_INPUT(); \
11559  DISABLE_RF1_OPENDRAIN(); \
11560  DISABLE_RF1_PULLUP(); \
11561  DISABLE_RF1_PULLDOWN(); \
11562  } while (0)
11563 # endif
11564 
11565 /** This macro disables open-drain and pullups/downs,
11566  * configures pin RF1 for digital (not analog) operation, and
11567  * configures the pin as an input.
11568  */
11569 # define CONFIG_RF1_AS_DIG_INPUT() \
11570  do { \
11571  DISABLE_RF1_ANALOG(); \
11572  CONFIG_RF1_AS_INPUT(); \
11573  DISABLE_RF1_OPENDRAIN(); \
11574  DISABLE_RF1_PULLUP(); \
11575  DISABLE_RF1_PULLDOWN(); \
11576  } while (0)
11577 
11578 /** This macro disables open-drain and pullups/downs,
11579  * configures pin RF1 for digital (not analog) operation, and
11580  * configures the pin as an output.
11581  */
11582 # define CONFIG_RF1_AS_DIG_OUTPUT() \
11583  do { \
11584  DISABLE_RF1_ANALOG(); \
11585  CONFIG_RF1_AS_OUTPUT(); \
11586  DISABLE_RF1_OPENDRAIN(); \
11587  DISABLE_RF1_PULLUP(); \
11588  DISABLE_RF1_PULLDOWN(); \
11589  } while (0)
11590 
11591 #endif // #if defined(_RF1) || defined(__DOXYGEN__): Provide GPIO for RF1
11592 
11593 
11594 
11595 
11596 
11597 // Provide GPIO for RF2
11598 // ====================
11599 #if defined(_RF2) || defined(__DOXYGEN__)
11600 
11601 // Dummy macros for documentation only
11602 # ifdef __DOXYGEN__
11603 /// This macro specifies the RPy value associated with pin RF2.
11604 /// Its device-specific definition is given in pic24_ports_mapping.h.
11605 # define RF2_RP xx
11606 
11607 /// This macro specifies the ANn value associated with pin RF2.
11608 /// Its device-specific definition is given in pic24_ports_mapping.h.
11609 # define RF2_AN xx
11610 
11611 /// This macro specifies the CNm value associated with pin RF2.
11612 /// Its device-specific definition is given in pic24_ports_mapping.h.
11613 # define RF2_CN xx
11614 
11615 //@}
11616 # endif // #ifdef __DOXYGEN__
11617 
11618 
11619 // Low-level config
11620 // ----------------
11621 // Analog:
11622 # if defined(_ANSF2) || defined(__DOXYGEN__)
11623 /// Enable analog functionality on pin RF2.
11624 # define ENABLE_RF2_ANALOG() (_ANSF2 = 1)
11625 /// Disable analog functionality on pin RF2.
11626 # define DISABLE_RF2_ANALOG() (_ANSF2 = 0)
11627 # elif defined(RF2_AN)
11628 # define ENABLE_RF2_ANALOG() (RXY_GPIO_PCFG(RF2_AN) = 0)
11629 # define DISABLE_RF2_ANALOG() (RXY_GPIO_PCFG(RF2_AN) = 1)
11630 # else
11631 # define DISABLE_RF2_ANALOG() ((void) 0)
11632 # endif
11633 
11634 // Input/output:
11635 /// Configure pin RF2 as an input.
11636 # define CONFIG_RF2_AS_INPUT() (_TRISF2 = 1)
11637 /// Configure pin RF2 as an output.
11638 # define CONFIG_RF2_AS_OUTPUT() (_TRISF2 = 0)
11639 
11640 // Open-drain:
11641 # if defined(_ODCF2) || defined(__DOXYGEN__)
11642 /// Enable the open-drain driver on pin RF2.
11643 # define ENABLE_RF2_OPENDRAIN() (_ODCF2 = 1)
11644 /// Disable the open-drain driver on pin RF2.
11645 # define DISABLE_RF2_OPENDRAIN() (_ODCF2 = 0)
11646 # elif defined(_ODF2) // The PIF24F names this bit _OD instead of _ODC.
11647 # define ENABLE_RF2_OPENDRAIN() (_ODF2 = 1)
11648 # define DISABLE_RF2_OPENDRAIN() (_ODF2 = 0)
11649 # else
11650 # define DISABLE_RF2_OPENDRAIN() ((void) 0)
11651 # endif
11652 
11653 // Change notification, pullups and pulldowns:
11654 # if defined(_CNIEF2) || defined(__DOXYGEN__)
11655 /// Enable the pullup on pin RF2.
11656 # define ENABLE_RF2_PULLUP() (_CNPUF2 = 1)
11657 /// Disable the pullup on pin RF2.
11658 # define DISABLE_RF2_PULLUP() (_CNPUF2 = 0)
11659 
11660 /// Enable the pulldown on pin RF2.
11661 # define ENABLE_RF2_PULLDOWN() (_CNPDF2 = 1)
11662 /// Disable the pulldown on pin RF2.
11663 # define DISABLE_RF2_PULLDOWN() (_CNPDF2 = 0)
11664 
11665 /// Enable the change notification interrupt on pin RF2.
11666 # define ENABLE_RF2_CN_INTERRUPT() (_CNIEF2 = 1)
11667 /// Disable the change notification interrupt on pin RF2.
11668 # define DISABLE_RF2_CN_INTERRUPT() (_CNIEF2 = 0)
11669 
11670 # elif defined(RF2_CN)
11671 # define ENABLE_RF2_PULLUP() (RXY_GPIO_CNPUE(RF2_CN) = 1)
11672 # define DISABLE_RF2_PULLUP() (RXY_GPIO_CNPUE(RF2_CN) = 0)
11673 
11674 # if RXY_HAS_CNPDE(RF2_CN)
11675 # define ENABLE_RF2_PULLDOWN() (RXY_GPIO_CNPDE(RF2_CN) = 1)
11676 # define DISABLE_RF2_PULLDOWN() (RXY_GPIO_CNPDE(RF2_CN) = 0)
11677 # else
11678 # define DISABLE_RF2_PULLDOWN() ((void) 0)
11679 # endif
11680 
11681 # define ENABLE_RF2_CN_INTERRUPT() (RXY_GPIO_CNIE(RF2_CN) = 1)
11682 # define DISABLE_RF2_CN_INTERRUPT() (RXY_GPIO_CNIE(RF2_CN) = 0)
11683 
11684 # else
11685 # define DISABLE_RF2_PULLUP() ((void) 0)
11686 # define DISABLE_RF2_PULLDOWN() ((void) 0)
11687 # define DISABLE_RF2_CN_INTERRUPT() ((void) 0)
11688 # endif
11689 
11690 // High-level config
11691 // -----------------
11692 /** This macro disables pullups/downs, enables analog functionality, and configures
11693  * pin RF2 as an input.
11694  */
11695 # if defined(_ANSF2) || defined(RF2_AN) || defined(__DOXYGEN__)
11696 # define CONFIG_RF2_AS_ANALOG() \
11697  do { \
11698  ENABLE_RF2_ANALOG(); \
11699  CONFIG_RF2_AS_INPUT(); \
11700  DISABLE_RF2_OPENDRAIN(); \
11701  DISABLE_RF2_PULLUP(); \
11702  DISABLE_RF2_PULLDOWN(); \
11703  } while (0)
11704 # endif
11705 
11706 /** This macro disables open-drain and pullups/downs,
11707  * configures pin RF2 for digital (not analog) operation, and
11708  * configures the pin as an input.
11709  */
11710 # define CONFIG_RF2_AS_DIG_INPUT() \
11711  do { \
11712  DISABLE_RF2_ANALOG(); \
11713  CONFIG_RF2_AS_INPUT(); \
11714  DISABLE_RF2_OPENDRAIN(); \
11715  DISABLE_RF2_PULLUP(); \
11716  DISABLE_RF2_PULLDOWN(); \
11717  } while (0)
11718 
11719 /** This macro disables open-drain and pullups/downs,
11720  * configures pin RF2 for digital (not analog) operation, and
11721  * configures the pin as an output.
11722  */
11723 # define CONFIG_RF2_AS_DIG_OUTPUT() \
11724  do { \
11725  DISABLE_RF2_ANALOG(); \
11726  CONFIG_RF2_AS_OUTPUT(); \
11727  DISABLE_RF2_OPENDRAIN(); \
11728  DISABLE_RF2_PULLUP(); \
11729  DISABLE_RF2_PULLDOWN(); \
11730  } while (0)
11731 
11732 #endif // #if defined(_RF2) || defined(__DOXYGEN__): Provide GPIO for RF2
11733 
11734 
11735 
11736 
11737 
11738 // Provide GPIO for RF3
11739 // ====================
11740 #if defined(_RF3) || defined(__DOXYGEN__)
11741 
11742 // Dummy macros for documentation only
11743 # ifdef __DOXYGEN__
11744 /// This macro specifies the RPy value associated with pin RF3.
11745 /// Its device-specific definition is given in pic24_ports_mapping.h.
11746 # define RF3_RP xx
11747 
11748 /// This macro specifies the ANn value associated with pin RF3.
11749 /// Its device-specific definition is given in pic24_ports_mapping.h.
11750 # define RF3_AN xx
11751 
11752 /// This macro specifies the CNm value associated with pin RF3.
11753 /// Its device-specific definition is given in pic24_ports_mapping.h.
11754 # define RF3_CN xx
11755 
11756 //@}
11757 # endif // #ifdef __DOXYGEN__
11758 
11759 
11760 // Low-level config
11761 // ----------------
11762 // Analog:
11763 # if defined(_ANSF3) || defined(__DOXYGEN__)
11764 /// Enable analog functionality on pin RF3.
11765 # define ENABLE_RF3_ANALOG() (_ANSF3 = 1)
11766 /// Disable analog functionality on pin RF3.
11767 # define DISABLE_RF3_ANALOG() (_ANSF3 = 0)
11768 # elif defined(RF3_AN)
11769 # define ENABLE_RF3_ANALOG() (RXY_GPIO_PCFG(RF3_AN) = 0)
11770 # define DISABLE_RF3_ANALOG() (RXY_GPIO_PCFG(RF3_AN) = 1)
11771 # else
11772 # define DISABLE_RF3_ANALOG() ((void) 0)
11773 # endif
11774 
11775 // Input/output:
11776 /// Configure pin RF3 as an input.
11777 # define CONFIG_RF3_AS_INPUT() (_TRISF3 = 1)
11778 /// Configure pin RF3 as an output.
11779 # define CONFIG_RF3_AS_OUTPUT() (_TRISF3 = 0)
11780 
11781 // Open-drain:
11782 # if defined(_ODCF3) || defined(__DOXYGEN__)
11783 /// Enable the open-drain driver on pin RF3.
11784 # define ENABLE_RF3_OPENDRAIN() (_ODCF3 = 1)
11785 /// Disable the open-drain driver on pin RF3.
11786 # define DISABLE_RF3_OPENDRAIN() (_ODCF3 = 0)
11787 # elif defined(_ODF3) // The PIF24F names this bit _OD instead of _ODC.
11788 # define ENABLE_RF3_OPENDRAIN() (_ODF3 = 1)
11789 # define DISABLE_RF3_OPENDRAIN() (_ODF3 = 0)
11790 # else
11791 # define DISABLE_RF3_OPENDRAIN() ((void) 0)
11792 # endif
11793 
11794 // Change notification, pullups and pulldowns:
11795 # if defined(_CNIEF3) || defined(__DOXYGEN__)
11796 /// Enable the pullup on pin RF3.
11797 # define ENABLE_RF3_PULLUP() (_CNPUF3 = 1)
11798 /// Disable the pullup on pin RF3.
11799 # define DISABLE_RF3_PULLUP() (_CNPUF3 = 0)
11800 
11801 /// Enable the pulldown on pin RF3.
11802 # define ENABLE_RF3_PULLDOWN() (_CNPDF3 = 1)
11803 /// Disable the pulldown on pin RF3.
11804 # define DISABLE_RF3_PULLDOWN() (_CNPDF3 = 0)
11805 
11806 /// Enable the change notification interrupt on pin RF3.
11807 # define ENABLE_RF3_CN_INTERRUPT() (_CNIEF3 = 1)
11808 /// Disable the change notification interrupt on pin RF3.
11809 # define DISABLE_RF3_CN_INTERRUPT() (_CNIEF3 = 0)
11810 
11811 # elif defined(RF3_CN)
11812 # define ENABLE_RF3_PULLUP() (RXY_GPIO_CNPUE(RF3_CN) = 1)
11813 # define DISABLE_RF3_PULLUP() (RXY_GPIO_CNPUE(RF3_CN) = 0)
11814 
11815 # if RXY_HAS_CNPDE(RF3_CN)
11816 # define ENABLE_RF3_PULLDOWN() (RXY_GPIO_CNPDE(RF3_CN) = 1)
11817 # define DISABLE_RF3_PULLDOWN() (RXY_GPIO_CNPDE(RF3_CN) = 0)
11818 # else
11819 # define DISABLE_RF3_PULLDOWN() ((void) 0)
11820 # endif
11821 
11822 # define ENABLE_RF3_CN_INTERRUPT() (RXY_GPIO_CNIE(RF3_CN) = 1)
11823 # define DISABLE_RF3_CN_INTERRUPT() (RXY_GPIO_CNIE(RF3_CN) = 0)
11824 
11825 # else
11826 # define DISABLE_RF3_PULLUP() ((void) 0)
11827 # define DISABLE_RF3_PULLDOWN() ((void) 0)
11828 # define DISABLE_RF3_CN_INTERRUPT() ((void) 0)
11829 # endif
11830 
11831 // High-level config
11832 // -----------------
11833 /** This macro disables pullups/downs, enables analog functionality, and configures
11834  * pin RF3 as an input.
11835  */
11836 # if defined(_ANSF3) || defined(RF3_AN) || defined(__DOXYGEN__)
11837 # define CONFIG_RF3_AS_ANALOG() \
11838  do { \
11839  ENABLE_RF3_ANALOG(); \
11840  CONFIG_RF3_AS_INPUT(); \
11841  DISABLE_RF3_OPENDRAIN(); \
11842  DISABLE_RF3_PULLUP(); \
11843  DISABLE_RF3_PULLDOWN(); \
11844  } while (0)
11845 # endif
11846 
11847 /** This macro disables open-drain and pullups/downs,
11848  * configures pin RF3 for digital (not analog) operation, and
11849  * configures the pin as an input.
11850  */
11851 # define CONFIG_RF3_AS_DIG_INPUT() \
11852  do { \
11853  DISABLE_RF3_ANALOG(); \
11854  CONFIG_RF3_AS_INPUT(); \
11855  DISABLE_RF3_OPENDRAIN(); \
11856  DISABLE_RF3_PULLUP(); \
11857  DISABLE_RF3_PULLDOWN(); \
11858  } while (0)
11859 
11860 /** This macro disables open-drain and pullups/downs,
11861  * configures pin RF3 for digital (not analog) operation, and
11862  * configures the pin as an output.
11863  */
11864 # define CONFIG_RF3_AS_DIG_OUTPUT() \
11865  do { \
11866  DISABLE_RF3_ANALOG(); \
11867  CONFIG_RF3_AS_OUTPUT(); \
11868  DISABLE_RF3_OPENDRAIN(); \
11869  DISABLE_RF3_PULLUP(); \
11870  DISABLE_RF3_PULLDOWN(); \
11871  } while (0)
11872 
11873 #endif // #if defined(_RF3) || defined(__DOXYGEN__): Provide GPIO for RF3
11874 
11875 
11876 
11877 
11878 
11879 // Provide GPIO for RF4
11880 // ====================
11881 #if defined(_RF4) || defined(__DOXYGEN__)
11882 
11883 // Dummy macros for documentation only
11884 # ifdef __DOXYGEN__
11885 /// This macro specifies the RPy value associated with pin RF4.
11886 /// Its device-specific definition is given in pic24_ports_mapping.h.
11887 # define RF4_RP xx
11888 
11889 /// This macro specifies the ANn value associated with pin RF4.
11890 /// Its device-specific definition is given in pic24_ports_mapping.h.
11891 # define RF4_AN xx
11892 
11893 /// This macro specifies the CNm value associated with pin RF4.
11894 /// Its device-specific definition is given in pic24_ports_mapping.h.
11895 # define RF4_CN xx
11896 
11897 //@}
11898 # endif // #ifdef __DOXYGEN__
11899 
11900 
11901 // Low-level config
11902 // ----------------
11903 // Analog:
11904 # if defined(_ANSF4) || defined(__DOXYGEN__)
11905 /// Enable analog functionality on pin RF4.
11906 # define ENABLE_RF4_ANALOG() (_ANSF4 = 1)
11907 /// Disable analog functionality on pin RF4.
11908 # define DISABLE_RF4_ANALOG() (_ANSF4 = 0)
11909 # elif defined(RF4_AN)
11910 # define ENABLE_RF4_ANALOG() (RXY_GPIO_PCFG(RF4_AN) = 0)
11911 # define DISABLE_RF4_ANALOG() (RXY_GPIO_PCFG(RF4_AN) = 1)
11912 # else
11913 # define DISABLE_RF4_ANALOG() ((void) 0)
11914 # endif
11915 
11916 // Input/output:
11917 /// Configure pin RF4 as an input.
11918 # define CONFIG_RF4_AS_INPUT() (_TRISF4 = 1)
11919 /// Configure pin RF4 as an output.
11920 # define CONFIG_RF4_AS_OUTPUT() (_TRISF4 = 0)
11921 
11922 // Open-drain:
11923 # if defined(_ODCF4) || defined(__DOXYGEN__)
11924 /// Enable the open-drain driver on pin RF4.
11925 # define ENABLE_RF4_OPENDRAIN() (_ODCF4 = 1)
11926 /// Disable the open-drain driver on pin RF4.
11927 # define DISABLE_RF4_OPENDRAIN() (_ODCF4 = 0)
11928 # elif defined(_ODF4) // The PIF24F names this bit _OD instead of _ODC.
11929 # define ENABLE_RF4_OPENDRAIN() (_ODF4 = 1)
11930 # define DISABLE_RF4_OPENDRAIN() (_ODF4 = 0)
11931 # else
11932 # define DISABLE_RF4_OPENDRAIN() ((void) 0)
11933 # endif
11934 
11935 // Change notification, pullups and pulldowns:
11936 # if defined(_CNIEF4) || defined(__DOXYGEN__)
11937 /// Enable the pullup on pin RF4.
11938 # define ENABLE_RF4_PULLUP() (_CNPUF4 = 1)
11939 /// Disable the pullup on pin RF4.
11940 # define DISABLE_RF4_PULLUP() (_CNPUF4 = 0)
11941 
11942 /// Enable the pulldown on pin RF4.
11943 # define ENABLE_RF4_PULLDOWN() (_CNPDF4 = 1)
11944 /// Disable the pulldown on pin RF4.
11945 # define DISABLE_RF4_PULLDOWN() (_CNPDF4 = 0)
11946 
11947 /// Enable the change notification interrupt on pin RF4.
11948 # define ENABLE_RF4_CN_INTERRUPT() (_CNIEF4 = 1)
11949 /// Disable the change notification interrupt on pin RF4.
11950 # define DISABLE_RF4_CN_INTERRUPT() (_CNIEF4 = 0)
11951 
11952 # elif defined(RF4_CN)
11953 # define ENABLE_RF4_PULLUP() (RXY_GPIO_CNPUE(RF4_CN) = 1)
11954 # define DISABLE_RF4_PULLUP() (RXY_GPIO_CNPUE(RF4_CN) = 0)
11955 
11956 # if RXY_HAS_CNPDE(RF4_CN)
11957 # define ENABLE_RF4_PULLDOWN() (RXY_GPIO_CNPDE(RF4_CN) = 1)
11958 # define DISABLE_RF4_PULLDOWN() (RXY_GPIO_CNPDE(RF4_CN) = 0)
11959 # else
11960 # define DISABLE_RF4_PULLDOWN() ((void) 0)
11961 # endif
11962 
11963 # define ENABLE_RF4_CN_INTERRUPT() (RXY_GPIO_CNIE(RF4_CN) = 1)
11964 # define DISABLE_RF4_CN_INTERRUPT() (RXY_GPIO_CNIE(RF4_CN) = 0)
11965 
11966 # else
11967 # define DISABLE_RF4_PULLUP() ((void) 0)
11968 # define DISABLE_RF4_PULLDOWN() ((void) 0)
11969 # define DISABLE_RF4_CN_INTERRUPT() ((void) 0)
11970 # endif
11971 
11972 // High-level config
11973 // -----------------
11974 /** This macro disables pullups/downs, enables analog functionality, and configures
11975  * pin RF4 as an input.
11976  */
11977 # if defined(_ANSF4) || defined(RF4_AN) || defined(__DOXYGEN__)
11978 # define CONFIG_RF4_AS_ANALOG() \
11979  do { \
11980  ENABLE_RF4_ANALOG(); \
11981  CONFIG_RF4_AS_INPUT(); \
11982  DISABLE_RF4_OPENDRAIN(); \
11983  DISABLE_RF4_PULLUP(); \
11984  DISABLE_RF4_PULLDOWN(); \
11985  } while (0)
11986 # endif
11987 
11988 /** This macro disables open-drain and pullups/downs,
11989  * configures pin RF4 for digital (not analog) operation, and
11990  * configures the pin as an input.
11991  */
11992 # define CONFIG_RF4_AS_DIG_INPUT() \
11993  do { \
11994  DISABLE_RF4_ANALOG(); \
11995  CONFIG_RF4_AS_INPUT(); \
11996  DISABLE_RF4_OPENDRAIN(); \
11997  DISABLE_RF4_PULLUP(); \
11998  DISABLE_RF4_PULLDOWN(); \
11999  } while (0)
12000 
12001 /** This macro disables open-drain and pullups/downs,
12002  * configures pin RF4 for digital (not analog) operation, and
12003  * configures the pin as an output.
12004  */
12005 # define CONFIG_RF4_AS_DIG_OUTPUT() \
12006  do { \
12007  DISABLE_RF4_ANALOG(); \
12008  CONFIG_RF4_AS_OUTPUT(); \
12009  DISABLE_RF4_OPENDRAIN(); \
12010  DISABLE_RF4_PULLUP(); \
12011  DISABLE_RF4_PULLDOWN(); \
12012  } while (0)
12013 
12014 #endif // #if defined(_RF4) || defined(__DOXYGEN__): Provide GPIO for RF4
12015 
12016 
12017 
12018 
12019 
12020 // Provide GPIO for RF5
12021 // ====================
12022 #if defined(_RF5) || defined(__DOXYGEN__)
12023 
12024 // Dummy macros for documentation only
12025 # ifdef __DOXYGEN__
12026 /// This macro specifies the RPy value associated with pin RF5.
12027 /// Its device-specific definition is given in pic24_ports_mapping.h.
12028 # define RF5_RP xx
12029 
12030 /// This macro specifies the ANn value associated with pin RF5.
12031 /// Its device-specific definition is given in pic24_ports_mapping.h.
12032 # define RF5_AN xx
12033 
12034 /// This macro specifies the CNm value associated with pin RF5.
12035 /// Its device-specific definition is given in pic24_ports_mapping.h.
12036 # define RF5_CN xx
12037 
12038 //@}
12039 # endif // #ifdef __DOXYGEN__
12040 
12041 
12042 // Low-level config
12043 // ----------------
12044 // Analog:
12045 # if defined(_ANSF5) || defined(__DOXYGEN__)
12046 /// Enable analog functionality on pin RF5.
12047 # define ENABLE_RF5_ANALOG() (_ANSF5 = 1)
12048 /// Disable analog functionality on pin RF5.
12049 # define DISABLE_RF5_ANALOG() (_ANSF5 = 0)
12050 # elif defined(RF5_AN)
12051 # define ENABLE_RF5_ANALOG() (RXY_GPIO_PCFG(RF5_AN) = 0)
12052 # define DISABLE_RF5_ANALOG() (RXY_GPIO_PCFG(RF5_AN) = 1)
12053 # else
12054 # define DISABLE_RF5_ANALOG() ((void) 0)
12055 # endif
12056 
12057 // Input/output:
12058 /// Configure pin RF5 as an input.
12059 # define CONFIG_RF5_AS_INPUT() (_TRISF5 = 1)
12060 /// Configure pin RF5 as an output.
12061 # define CONFIG_RF5_AS_OUTPUT() (_TRISF5 = 0)
12062 
12063 // Open-drain:
12064 # if defined(_ODCF5) || defined(__DOXYGEN__)
12065 /// Enable the open-drain driver on pin RF5.
12066 # define ENABLE_RF5_OPENDRAIN() (_ODCF5 = 1)
12067 /// Disable the open-drain driver on pin RF5.
12068 # define DISABLE_RF5_OPENDRAIN() (_ODCF5 = 0)
12069 # elif defined(_ODF5) // The PIF24F names this bit _OD instead of _ODC.
12070 # define ENABLE_RF5_OPENDRAIN() (_ODF5 = 1)
12071 # define DISABLE_RF5_OPENDRAIN() (_ODF5 = 0)
12072 # else
12073 # define DISABLE_RF5_OPENDRAIN() ((void) 0)
12074 # endif
12075 
12076 // Change notification, pullups and pulldowns:
12077 # if defined(_CNIEF5) || defined(__DOXYGEN__)
12078 /// Enable the pullup on pin RF5.
12079 # define ENABLE_RF5_PULLUP() (_CNPUF5 = 1)
12080 /// Disable the pullup on pin RF5.
12081 # define DISABLE_RF5_PULLUP() (_CNPUF5 = 0)
12082 
12083 /// Enable the pulldown on pin RF5.
12084 # define ENABLE_RF5_PULLDOWN() (_CNPDF5 = 1)
12085 /// Disable the pulldown on pin RF5.
12086 # define DISABLE_RF5_PULLDOWN() (_CNPDF5 = 0)
12087 
12088 /// Enable the change notification interrupt on pin RF5.
12089 # define ENABLE_RF5_CN_INTERRUPT() (_CNIEF5 = 1)
12090 /// Disable the change notification interrupt on pin RF5.
12091 # define DISABLE_RF5_CN_INTERRUPT() (_CNIEF5 = 0)
12092 
12093 # elif defined(RF5_CN)
12094 # define ENABLE_RF5_PULLUP() (RXY_GPIO_CNPUE(RF5_CN) = 1)
12095 # define DISABLE_RF5_PULLUP() (RXY_GPIO_CNPUE(RF5_CN) = 0)
12096 
12097 # if RXY_HAS_CNPDE(RF5_CN)
12098 # define ENABLE_RF5_PULLDOWN() (RXY_GPIO_CNPDE(RF5_CN) = 1)
12099 # define DISABLE_RF5_PULLDOWN() (RXY_GPIO_CNPDE(RF5_CN) = 0)
12100 # else
12101 # define DISABLE_RF5_PULLDOWN() ((void) 0)
12102 # endif
12103 
12104 # define ENABLE_RF5_CN_INTERRUPT() (RXY_GPIO_CNIE(RF5_CN) = 1)
12105 # define DISABLE_RF5_CN_INTERRUPT() (RXY_GPIO_CNIE(RF5_CN) = 0)
12106 
12107 # else
12108 # define DISABLE_RF5_PULLUP() ((void) 0)
12109 # define DISABLE_RF5_PULLDOWN() ((void) 0)
12110 # define DISABLE_RF5_CN_INTERRUPT() ((void) 0)
12111 # endif
12112 
12113 // High-level config
12114 // -----------------
12115 /** This macro disables pullups/downs, enables analog functionality, and configures
12116  * pin RF5 as an input.
12117  */
12118 # if defined(_ANSF5) || defined(RF5_AN) || defined(__DOXYGEN__)
12119 # define CONFIG_RF5_AS_ANALOG() \
12120  do { \
12121  ENABLE_RF5_ANALOG(); \
12122  CONFIG_RF5_AS_INPUT(); \
12123  DISABLE_RF5_OPENDRAIN(); \
12124  DISABLE_RF5_PULLUP(); \
12125  DISABLE_RF5_PULLDOWN(); \
12126  } while (0)
12127 # endif
12128 
12129 /** This macro disables open-drain and pullups/downs,
12130  * configures pin RF5 for digital (not analog) operation, and
12131  * configures the pin as an input.
12132  */
12133 # define CONFIG_RF5_AS_DIG_INPUT() \
12134  do { \
12135  DISABLE_RF5_ANALOG(); \
12136  CONFIG_RF5_AS_INPUT(); \
12137  DISABLE_RF5_OPENDRAIN(); \
12138  DISABLE_RF5_PULLUP(); \
12139  DISABLE_RF5_PULLDOWN(); \
12140  } while (0)
12141 
12142 /** This macro disables open-drain and pullups/downs,
12143  * configures pin RF5 for digital (not analog) operation, and
12144  * configures the pin as an output.
12145  */
12146 # define CONFIG_RF5_AS_DIG_OUTPUT() \
12147  do { \
12148  DISABLE_RF5_ANALOG(); \
12149  CONFIG_RF5_AS_OUTPUT(); \
12150  DISABLE_RF5_OPENDRAIN(); \
12151  DISABLE_RF5_PULLUP(); \
12152  DISABLE_RF5_PULLDOWN(); \
12153  } while (0)
12154 
12155 #endif // #if defined(_RF5) || defined(__DOXYGEN__): Provide GPIO for RF5
12156 
12157 
12158 
12159 
12160 
12161 // Provide GPIO for RF6
12162 // ====================
12163 #if defined(_RF6) || defined(__DOXYGEN__)
12164 
12165 // Dummy macros for documentation only
12166 # ifdef __DOXYGEN__
12167 /// This macro specifies the RPy value associated with pin RF6.
12168 /// Its device-specific definition is given in pic24_ports_mapping.h.
12169 # define RF6_RP xx
12170 
12171 /// This macro specifies the ANn value associated with pin RF6.
12172 /// Its device-specific definition is given in pic24_ports_mapping.h.
12173 # define RF6_AN xx
12174 
12175 /// This macro specifies the CNm value associated with pin RF6.
12176 /// Its device-specific definition is given in pic24_ports_mapping.h.
12177 # define RF6_CN xx
12178 
12179 //@}
12180 # endif // #ifdef __DOXYGEN__
12181 
12182 
12183 // Low-level config
12184 // ----------------
12185 // Analog:
12186 # if defined(_ANSF6) || defined(__DOXYGEN__)
12187 /// Enable analog functionality on pin RF6.
12188 # define ENABLE_RF6_ANALOG() (_ANSF6 = 1)
12189 /// Disable analog functionality on pin RF6.
12190 # define DISABLE_RF6_ANALOG() (_ANSF6 = 0)
12191 # elif defined(RF6_AN)
12192 # define ENABLE_RF6_ANALOG() (RXY_GPIO_PCFG(RF6_AN) = 0)
12193 # define DISABLE_RF6_ANALOG() (RXY_GPIO_PCFG(RF6_AN) = 1)
12194 # else
12195 # define DISABLE_RF6_ANALOG() ((void) 0)
12196 # endif
12197 
12198 // Input/output:
12199 /// Configure pin RF6 as an input.
12200 # define CONFIG_RF6_AS_INPUT() (_TRISF6 = 1)
12201 /// Configure pin RF6 as an output.
12202 # define CONFIG_RF6_AS_OUTPUT() (_TRISF6 = 0)
12203 
12204 // Open-drain:
12205 # if defined(_ODCF6) || defined(__DOXYGEN__)
12206 /// Enable the open-drain driver on pin RF6.
12207 # define ENABLE_RF6_OPENDRAIN() (_ODCF6 = 1)
12208 /// Disable the open-drain driver on pin RF6.
12209 # define DISABLE_RF6_OPENDRAIN() (_ODCF6 = 0)
12210 # elif defined(_ODF6) // The PIF24F names this bit _OD instead of _ODC.
12211 # define ENABLE_RF6_OPENDRAIN() (_ODF6 = 1)
12212 # define DISABLE_RF6_OPENDRAIN() (_ODF6 = 0)
12213 # else
12214 # define DISABLE_RF6_OPENDRAIN() ((void) 0)
12215 # endif
12216 
12217 // Change notification, pullups and pulldowns:
12218 # if defined(_CNIEF6) || defined(__DOXYGEN__)
12219 /// Enable the pullup on pin RF6.
12220 # define ENABLE_RF6_PULLUP() (_CNPUF6 = 1)
12221 /// Disable the pullup on pin RF6.
12222 # define DISABLE_RF6_PULLUP() (_CNPUF6 = 0)
12223 
12224 /// Enable the pulldown on pin RF6.
12225 # define ENABLE_RF6_PULLDOWN() (_CNPDF6 = 1)
12226 /// Disable the pulldown on pin RF6.
12227 # define DISABLE_RF6_PULLDOWN() (_CNPDF6 = 0)
12228 
12229 /// Enable the change notification interrupt on pin RF6.
12230 # define ENABLE_RF6_CN_INTERRUPT() (_CNIEF6 = 1)
12231 /// Disable the change notification interrupt on pin RF6.
12232 # define DISABLE_RF6_CN_INTERRUPT() (_CNIEF6 = 0)
12233 
12234 # elif defined(RF6_CN)
12235 # define ENABLE_RF6_PULLUP() (RXY_GPIO_CNPUE(RF6_CN) = 1)
12236 # define DISABLE_RF6_PULLUP() (RXY_GPIO_CNPUE(RF6_CN) = 0)
12237 
12238 # if RXY_HAS_CNPDE(RF6_CN)
12239 # define ENABLE_RF6_PULLDOWN() (RXY_GPIO_CNPDE(RF6_CN) = 1)
12240 # define DISABLE_RF6_PULLDOWN() (RXY_GPIO_CNPDE(RF6_CN) = 0)
12241 # else
12242 # define DISABLE_RF6_PULLDOWN() ((void) 0)
12243 # endif
12244 
12245 # define ENABLE_RF6_CN_INTERRUPT() (RXY_GPIO_CNIE(RF6_CN) = 1)
12246 # define DISABLE_RF6_CN_INTERRUPT() (RXY_GPIO_CNIE(RF6_CN) = 0)
12247 
12248 # else
12249 # define DISABLE_RF6_PULLUP() ((void) 0)
12250 # define DISABLE_RF6_PULLDOWN() ((void) 0)
12251 # define DISABLE_RF6_CN_INTERRUPT() ((void) 0)
12252 # endif
12253 
12254 // High-level config
12255 // -----------------
12256 /** This macro disables pullups/downs, enables analog functionality, and configures
12257  * pin RF6 as an input.
12258  */
12259 # if defined(_ANSF6) || defined(RF6_AN) || defined(__DOXYGEN__)
12260 # define CONFIG_RF6_AS_ANALOG() \
12261  do { \
12262  ENABLE_RF6_ANALOG(); \
12263  CONFIG_RF6_AS_INPUT(); \
12264  DISABLE_RF6_OPENDRAIN(); \
12265  DISABLE_RF6_PULLUP(); \
12266  DISABLE_RF6_PULLDOWN(); \
12267  } while (0)
12268 # endif
12269 
12270 /** This macro disables open-drain and pullups/downs,
12271  * configures pin RF6 for digital (not analog) operation, and
12272  * configures the pin as an input.
12273  */
12274 # define CONFIG_RF6_AS_DIG_INPUT() \
12275  do { \
12276  DISABLE_RF6_ANALOG(); \
12277  CONFIG_RF6_AS_INPUT(); \
12278  DISABLE_RF6_OPENDRAIN(); \
12279  DISABLE_RF6_PULLUP(); \
12280  DISABLE_RF6_PULLDOWN(); \
12281  } while (0)
12282 
12283 /** This macro disables open-drain and pullups/downs,
12284  * configures pin RF6 for digital (not analog) operation, and
12285  * configures the pin as an output.
12286  */
12287 # define CONFIG_RF6_AS_DIG_OUTPUT() \
12288  do { \
12289  DISABLE_RF6_ANALOG(); \
12290  CONFIG_RF6_AS_OUTPUT(); \
12291  DISABLE_RF6_OPENDRAIN(); \
12292  DISABLE_RF6_PULLUP(); \
12293  DISABLE_RF6_PULLDOWN(); \
12294  } while (0)
12295 
12296 #endif // #if defined(_RF6) || defined(__DOXYGEN__): Provide GPIO for RF6
12297 
12298 
12299 
12300 
12301 
12302 // Provide GPIO for RF7
12303 // ====================
12304 #if defined(_RF7) || defined(__DOXYGEN__)
12305 
12306 // Dummy macros for documentation only
12307 # ifdef __DOXYGEN__
12308 /// This macro specifies the RPy value associated with pin RF7.
12309 /// Its device-specific definition is given in pic24_ports_mapping.h.
12310 # define RF7_RP xx
12311 
12312 /// This macro specifies the ANn value associated with pin RF7.
12313 /// Its device-specific definition is given in pic24_ports_mapping.h.
12314 # define RF7_AN xx
12315 
12316 /// This macro specifies the CNm value associated with pin RF7.
12317 /// Its device-specific definition is given in pic24_ports_mapping.h.
12318 # define RF7_CN xx
12319 
12320 //@}
12321 # endif // #ifdef __DOXYGEN__
12322 
12323 
12324 // Low-level config
12325 // ----------------
12326 // Analog:
12327 # if defined(_ANSF7) || defined(__DOXYGEN__)
12328 /// Enable analog functionality on pin RF7.
12329 # define ENABLE_RF7_ANALOG() (_ANSF7 = 1)
12330 /// Disable analog functionality on pin RF7.
12331 # define DISABLE_RF7_ANALOG() (_ANSF7 = 0)
12332 # elif defined(RF7_AN)
12333 # define ENABLE_RF7_ANALOG() (RXY_GPIO_PCFG(RF7_AN) = 0)
12334 # define DISABLE_RF7_ANALOG() (RXY_GPIO_PCFG(RF7_AN) = 1)
12335 # else
12336 # define DISABLE_RF7_ANALOG() ((void) 0)
12337 # endif
12338 
12339 // Input/output:
12340 /// Configure pin RF7 as an input.
12341 # define CONFIG_RF7_AS_INPUT() (_TRISF7 = 1)
12342 /// Configure pin RF7 as an output.
12343 # define CONFIG_RF7_AS_OUTPUT() (_TRISF7 = 0)
12344 
12345 // Open-drain:
12346 # if defined(_ODCF7) || defined(__DOXYGEN__)
12347 /// Enable the open-drain driver on pin RF7.
12348 # define ENABLE_RF7_OPENDRAIN() (_ODCF7 = 1)
12349 /// Disable the open-drain driver on pin RF7.
12350 # define DISABLE_RF7_OPENDRAIN() (_ODCF7 = 0)
12351 # elif defined(_ODF7) // The PIF24F names this bit _OD instead of _ODC.
12352 # define ENABLE_RF7_OPENDRAIN() (_ODF7 = 1)
12353 # define DISABLE_RF7_OPENDRAIN() (_ODF7 = 0)
12354 # else
12355 # define DISABLE_RF7_OPENDRAIN() ((void) 0)
12356 # endif
12357 
12358 // Change notification, pullups and pulldowns:
12359 # if defined(_CNIEF7) || defined(__DOXYGEN__)
12360 /// Enable the pullup on pin RF7.
12361 # define ENABLE_RF7_PULLUP() (_CNPUF7 = 1)
12362 /// Disable the pullup on pin RF7.
12363 # define DISABLE_RF7_PULLUP() (_CNPUF7 = 0)
12364 
12365 /// Enable the pulldown on pin RF7.
12366 # define ENABLE_RF7_PULLDOWN() (_CNPDF7 = 1)
12367 /// Disable the pulldown on pin RF7.
12368 # define DISABLE_RF7_PULLDOWN() (_CNPDF7 = 0)
12369 
12370 /// Enable the change notification interrupt on pin RF7.
12371 # define ENABLE_RF7_CN_INTERRUPT() (_CNIEF7 = 1)
12372 /// Disable the change notification interrupt on pin RF7.
12373 # define DISABLE_RF7_CN_INTERRUPT() (_CNIEF7 = 0)
12374 
12375 # elif defined(RF7_CN)
12376 # define ENABLE_RF7_PULLUP() (RXY_GPIO_CNPUE(RF7_CN) = 1)
12377 # define DISABLE_RF7_PULLUP() (RXY_GPIO_CNPUE(RF7_CN) = 0)
12378 
12379 # if RXY_HAS_CNPDE(RF7_CN)
12380 # define ENABLE_RF7_PULLDOWN() (RXY_GPIO_CNPDE(RF7_CN) = 1)
12381 # define DISABLE_RF7_PULLDOWN() (RXY_GPIO_CNPDE(RF7_CN) = 0)
12382 # else
12383 # define DISABLE_RF7_PULLDOWN() ((void) 0)
12384 # endif
12385 
12386 # define ENABLE_RF7_CN_INTERRUPT() (RXY_GPIO_CNIE(RF7_CN) = 1)
12387 # define DISABLE_RF7_CN_INTERRUPT() (RXY_GPIO_CNIE(RF7_CN) = 0)
12388 
12389 # else
12390 # define DISABLE_RF7_PULLUP() ((void) 0)
12391 # define DISABLE_RF7_PULLDOWN() ((void) 0)
12392 # define DISABLE_RF7_CN_INTERRUPT() ((void) 0)
12393 # endif
12394 
12395 // High-level config
12396 // -----------------
12397 /** This macro disables pullups/downs, enables analog functionality, and configures
12398  * pin RF7 as an input.
12399  */
12400 # if defined(_ANSF7) || defined(RF7_AN) || defined(__DOXYGEN__)
12401 # define CONFIG_RF7_AS_ANALOG() \
12402  do { \
12403  ENABLE_RF7_ANALOG(); \
12404  CONFIG_RF7_AS_INPUT(); \
12405  DISABLE_RF7_OPENDRAIN(); \
12406  DISABLE_RF7_PULLUP(); \
12407  DISABLE_RF7_PULLDOWN(); \
12408  } while (0)
12409 # endif
12410 
12411 /** This macro disables open-drain and pullups/downs,
12412  * configures pin RF7 for digital (not analog) operation, and
12413  * configures the pin as an input.
12414  */
12415 # define CONFIG_RF7_AS_DIG_INPUT() \
12416  do { \
12417  DISABLE_RF7_ANALOG(); \
12418  CONFIG_RF7_AS_INPUT(); \
12419  DISABLE_RF7_OPENDRAIN(); \
12420  DISABLE_RF7_PULLUP(); \
12421  DISABLE_RF7_PULLDOWN(); \
12422  } while (0)
12423 
12424 /** This macro disables open-drain and pullups/downs,
12425  * configures pin RF7 for digital (not analog) operation, and
12426  * configures the pin as an output.
12427  */
12428 # define CONFIG_RF7_AS_DIG_OUTPUT() \
12429  do { \
12430  DISABLE_RF7_ANALOG(); \
12431  CONFIG_RF7_AS_OUTPUT(); \
12432  DISABLE_RF7_OPENDRAIN(); \
12433  DISABLE_RF7_PULLUP(); \
12434  DISABLE_RF7_PULLDOWN(); \
12435  } while (0)
12436 
12437 #endif // #if defined(_RF7) || defined(__DOXYGEN__): Provide GPIO for RF7
12438 
12439 
12440 
12441 
12442 
12443 // Provide GPIO for RF8
12444 // ====================
12445 #if defined(_RF8) || defined(__DOXYGEN__)
12446 
12447 // Dummy macros for documentation only
12448 # ifdef __DOXYGEN__
12449 /// This macro specifies the RPy value associated with pin RF8.
12450 /// Its device-specific definition is given in pic24_ports_mapping.h.
12451 # define RF8_RP xx
12452 
12453 /// This macro specifies the ANn value associated with pin RF8.
12454 /// Its device-specific definition is given in pic24_ports_mapping.h.
12455 # define RF8_AN xx
12456 
12457 /// This macro specifies the CNm value associated with pin RF8.
12458 /// Its device-specific definition is given in pic24_ports_mapping.h.
12459 # define RF8_CN xx
12460 
12461 //@}
12462 # endif // #ifdef __DOXYGEN__
12463 
12464 
12465 // Low-level config
12466 // ----------------
12467 // Analog:
12468 # if defined(_ANSF8) || defined(__DOXYGEN__)
12469 /// Enable analog functionality on pin RF8.
12470 # define ENABLE_RF8_ANALOG() (_ANSF8 = 1)
12471 /// Disable analog functionality on pin RF8.
12472 # define DISABLE_RF8_ANALOG() (_ANSF8 = 0)
12473 # elif defined(RF8_AN)
12474 # define ENABLE_RF8_ANALOG() (RXY_GPIO_PCFG(RF8_AN) = 0)
12475 # define DISABLE_RF8_ANALOG() (RXY_GPIO_PCFG(RF8_AN) = 1)
12476 # else
12477 # define DISABLE_RF8_ANALOG() ((void) 0)
12478 # endif
12479 
12480 // Input/output:
12481 /// Configure pin RF8 as an input.
12482 # define CONFIG_RF8_AS_INPUT() (_TRISF8 = 1)
12483 /// Configure pin RF8 as an output.
12484 # define CONFIG_RF8_AS_OUTPUT() (_TRISF8 = 0)
12485 
12486 // Open-drain:
12487 # if defined(_ODCF8) || defined(__DOXYGEN__)
12488 /// Enable the open-drain driver on pin RF8.
12489 # define ENABLE_RF8_OPENDRAIN() (_ODCF8 = 1)
12490 /// Disable the open-drain driver on pin RF8.
12491 # define DISABLE_RF8_OPENDRAIN() (_ODCF8 = 0)
12492 # elif defined(_ODF8) // The PIF24F names this bit _OD instead of _ODC.
12493 # define ENABLE_RF8_OPENDRAIN() (_ODF8 = 1)
12494 # define DISABLE_RF8_OPENDRAIN() (_ODF8 = 0)
12495 # else
12496 # define DISABLE_RF8_OPENDRAIN() ((void) 0)
12497 # endif
12498 
12499 // Change notification, pullups and pulldowns:
12500 # if defined(_CNIEF8) || defined(__DOXYGEN__)
12501 /// Enable the pullup on pin RF8.
12502 # define ENABLE_RF8_PULLUP() (_CNPUF8 = 1)
12503 /// Disable the pullup on pin RF8.
12504 # define DISABLE_RF8_PULLUP() (_CNPUF8 = 0)
12505 
12506 /// Enable the pulldown on pin RF8.
12507 # define ENABLE_RF8_PULLDOWN() (_CNPDF8 = 1)
12508 /// Disable the pulldown on pin RF8.
12509 # define DISABLE_RF8_PULLDOWN() (_CNPDF8 = 0)
12510 
12511 /// Enable the change notification interrupt on pin RF8.
12512 # define ENABLE_RF8_CN_INTERRUPT() (_CNIEF8 = 1)
12513 /// Disable the change notification interrupt on pin RF8.
12514 # define DISABLE_RF8_CN_INTERRUPT() (_CNIEF8 = 0)
12515 
12516 # elif defined(RF8_CN)
12517 # define ENABLE_RF8_PULLUP() (RXY_GPIO_CNPUE(RF8_CN) = 1)
12518 # define DISABLE_RF8_PULLUP() (RXY_GPIO_CNPUE(RF8_CN) = 0)
12519 
12520 # if RXY_HAS_CNPDE(RF8_CN)
12521 # define ENABLE_RF8_PULLDOWN() (RXY_GPIO_CNPDE(RF8_CN) = 1)
12522 # define DISABLE_RF8_PULLDOWN() (RXY_GPIO_CNPDE(RF8_CN) = 0)
12523 # else
12524 # define DISABLE_RF8_PULLDOWN() ((void) 0)
12525 # endif
12526 
12527 # define ENABLE_RF8_CN_INTERRUPT() (RXY_GPIO_CNIE(RF8_CN) = 1)
12528 # define DISABLE_RF8_CN_INTERRUPT() (RXY_GPIO_CNIE(RF8_CN) = 0)
12529 
12530 # else
12531 # define DISABLE_RF8_PULLUP() ((void) 0)
12532 # define DISABLE_RF8_PULLDOWN() ((void) 0)
12533 # define DISABLE_RF8_CN_INTERRUPT() ((void) 0)
12534 # endif
12535 
12536 // High-level config
12537 // -----------------
12538 /** This macro disables pullups/downs, enables analog functionality, and configures
12539  * pin RF8 as an input.
12540  */
12541 # if defined(_ANSF8) || defined(RF8_AN) || defined(__DOXYGEN__)
12542 # define CONFIG_RF8_AS_ANALOG() \
12543  do { \
12544  ENABLE_RF8_ANALOG(); \
12545  CONFIG_RF8_AS_INPUT(); \
12546  DISABLE_RF8_OPENDRAIN(); \
12547  DISABLE_RF8_PULLUP(); \
12548  DISABLE_RF8_PULLDOWN(); \
12549  } while (0)
12550 # endif
12551 
12552 /** This macro disables open-drain and pullups/downs,
12553  * configures pin RF8 for digital (not analog) operation, and
12554  * configures the pin as an input.
12555  */
12556 # define CONFIG_RF8_AS_DIG_INPUT() \
12557  do { \
12558  DISABLE_RF8_ANALOG(); \
12559  CONFIG_RF8_AS_INPUT(); \
12560  DISABLE_RF8_OPENDRAIN(); \
12561  DISABLE_RF8_PULLUP(); \
12562  DISABLE_RF8_PULLDOWN(); \
12563  } while (0)
12564 
12565 /** This macro disables open-drain and pullups/downs,
12566  * configures pin RF8 for digital (not analog) operation, and
12567  * configures the pin as an output.
12568  */
12569 # define CONFIG_RF8_AS_DIG_OUTPUT() \
12570  do { \
12571  DISABLE_RF8_ANALOG(); \
12572  CONFIG_RF8_AS_OUTPUT(); \
12573  DISABLE_RF8_OPENDRAIN(); \
12574  DISABLE_RF8_PULLUP(); \
12575  DISABLE_RF8_PULLDOWN(); \
12576  } while (0)
12577 
12578 #endif // #if defined(_RF8) || defined(__DOXYGEN__): Provide GPIO for RF8
12579 
12580 
12581 
12582 
12583 
12584 // Provide GPIO for RF9
12585 // ====================
12586 #if defined(_RF9) || defined(__DOXYGEN__)
12587 
12588 // Dummy macros for documentation only
12589 # ifdef __DOXYGEN__
12590 /// This macro specifies the RPy value associated with pin RF9.
12591 /// Its device-specific definition is given in pic24_ports_mapping.h.
12592 # define RF9_RP xx
12593 
12594 /// This macro specifies the ANn value associated with pin RF9.
12595 /// Its device-specific definition is given in pic24_ports_mapping.h.
12596 # define RF9_AN xx
12597 
12598 /// This macro specifies the CNm value associated with pin RF9.
12599 /// Its device-specific definition is given in pic24_ports_mapping.h.
12600 # define RF9_CN xx
12601 
12602 //@}
12603 # endif // #ifdef __DOXYGEN__
12604 
12605 
12606 // Low-level config
12607 // ----------------
12608 // Analog:
12609 # if defined(_ANSF9) || defined(__DOXYGEN__)
12610 /// Enable analog functionality on pin RF9.
12611 # define ENABLE_RF9_ANALOG() (_ANSF9 = 1)
12612 /// Disable analog functionality on pin RF9.
12613 # define DISABLE_RF9_ANALOG() (_ANSF9 = 0)
12614 # elif defined(RF9_AN)
12615 # define ENABLE_RF9_ANALOG() (RXY_GPIO_PCFG(RF9_AN) = 0)
12616 # define DISABLE_RF9_ANALOG() (RXY_GPIO_PCFG(RF9_AN) = 1)
12617 # else
12618 # define DISABLE_RF9_ANALOG() ((void) 0)
12619 # endif
12620 
12621 // Input/output:
12622 /// Configure pin RF9 as an input.
12623 # define CONFIG_RF9_AS_INPUT() (_TRISF9 = 1)
12624 /// Configure pin RF9 as an output.
12625 # define CONFIG_RF9_AS_OUTPUT() (_TRISF9 = 0)
12626 
12627 // Open-drain:
12628 # if defined(_ODCF9) || defined(__DOXYGEN__)
12629 /// Enable the open-drain driver on pin RF9.
12630 # define ENABLE_RF9_OPENDRAIN() (_ODCF9 = 1)
12631 /// Disable the open-drain driver on pin RF9.
12632 # define DISABLE_RF9_OPENDRAIN() (_ODCF9 = 0)
12633 # elif defined(_ODF9) // The PIF24F names this bit _OD instead of _ODC.
12634 # define ENABLE_RF9_OPENDRAIN() (_ODF9 = 1)
12635 # define DISABLE_RF9_OPENDRAIN() (_ODF9 = 0)
12636 # else
12637 # define DISABLE_RF9_OPENDRAIN() ((void) 0)
12638 # endif
12639 
12640 // Change notification, pullups and pulldowns:
12641 # if defined(_CNIEF9) || defined(__DOXYGEN__)
12642 /// Enable the pullup on pin RF9.
12643 # define ENABLE_RF9_PULLUP() (_CNPUF9 = 1)
12644 /// Disable the pullup on pin RF9.
12645 # define DISABLE_RF9_PULLUP() (_CNPUF9 = 0)
12646 
12647 /// Enable the pulldown on pin RF9.
12648 # define ENABLE_RF9_PULLDOWN() (_CNPDF9 = 1)
12649 /// Disable the pulldown on pin RF9.
12650 # define DISABLE_RF9_PULLDOWN() (_CNPDF9 = 0)
12651 
12652 /// Enable the change notification interrupt on pin RF9.
12653 # define ENABLE_RF9_CN_INTERRUPT() (_CNIEF9 = 1)
12654 /// Disable the change notification interrupt on pin RF9.
12655 # define DISABLE_RF9_CN_INTERRUPT() (_CNIEF9 = 0)
12656 
12657 # elif defined(RF9_CN)
12658 # define ENABLE_RF9_PULLUP() (RXY_GPIO_CNPUE(RF9_CN) = 1)
12659 # define DISABLE_RF9_PULLUP() (RXY_GPIO_CNPUE(RF9_CN) = 0)
12660 
12661 # if RXY_HAS_CNPDE(RF9_CN)
12662 # define ENABLE_RF9_PULLDOWN() (RXY_GPIO_CNPDE(RF9_CN) = 1)
12663 # define DISABLE_RF9_PULLDOWN() (RXY_GPIO_CNPDE(RF9_CN) = 0)
12664 # else
12665 # define DISABLE_RF9_PULLDOWN() ((void) 0)
12666 # endif
12667 
12668 # define ENABLE_RF9_CN_INTERRUPT() (RXY_GPIO_CNIE(RF9_CN) = 1)
12669 # define DISABLE_RF9_CN_INTERRUPT() (RXY_GPIO_CNIE(RF9_CN) = 0)
12670 
12671 # else
12672 # define DISABLE_RF9_PULLUP() ((void) 0)
12673 # define DISABLE_RF9_PULLDOWN() ((void) 0)
12674 # define DISABLE_RF9_CN_INTERRUPT() ((void) 0)
12675 # endif
12676 
12677 // High-level config
12678 // -----------------
12679 /** This macro disables pullups/downs, enables analog functionality, and configures
12680  * pin RF9 as an input.
12681  */
12682 # if defined(_ANSF9) || defined(RF9_AN) || defined(__DOXYGEN__)
12683 # define CONFIG_RF9_AS_ANALOG() \
12684  do { \
12685  ENABLE_RF9_ANALOG(); \
12686  CONFIG_RF9_AS_INPUT(); \
12687  DISABLE_RF9_OPENDRAIN(); \
12688  DISABLE_RF9_PULLUP(); \
12689  DISABLE_RF9_PULLDOWN(); \
12690  } while (0)
12691 # endif
12692 
12693 /** This macro disables open-drain and pullups/downs,
12694  * configures pin RF9 for digital (not analog) operation, and
12695  * configures the pin as an input.
12696  */
12697 # define CONFIG_RF9_AS_DIG_INPUT() \
12698  do { \
12699  DISABLE_RF9_ANALOG(); \
12700  CONFIG_RF9_AS_INPUT(); \
12701  DISABLE_RF9_OPENDRAIN(); \
12702  DISABLE_RF9_PULLUP(); \
12703  DISABLE_RF9_PULLDOWN(); \
12704  } while (0)
12705 
12706 /** This macro disables open-drain and pullups/downs,
12707  * configures pin RF9 for digital (not analog) operation, and
12708  * configures the pin as an output.
12709  */
12710 # define CONFIG_RF9_AS_DIG_OUTPUT() \
12711  do { \
12712  DISABLE_RF9_ANALOG(); \
12713  CONFIG_RF9_AS_OUTPUT(); \
12714  DISABLE_RF9_OPENDRAIN(); \
12715  DISABLE_RF9_PULLUP(); \
12716  DISABLE_RF9_PULLDOWN(); \
12717  } while (0)
12718 
12719 #endif // #if defined(_RF9) || defined(__DOXYGEN__): Provide GPIO for RF9
12720 
12721 
12722 
12723 
12724 
12725 // Provide GPIO for RF10
12726 // ====================
12727 #if defined(_RF10) || defined(__DOXYGEN__)
12728 
12729 // Dummy macros for documentation only
12730 # ifdef __DOXYGEN__
12731 /// This macro specifies the RPy value associated with pin RF10.
12732 /// Its device-specific definition is given in pic24_ports_mapping.h.
12733 # define RF10_RP xx
12734 
12735 /// This macro specifies the ANn value associated with pin RF10.
12736 /// Its device-specific definition is given in pic24_ports_mapping.h.
12737 # define RF10_AN xx
12738 
12739 /// This macro specifies the CNm value associated with pin RF10.
12740 /// Its device-specific definition is given in pic24_ports_mapping.h.
12741 # define RF10_CN xx
12742 
12743 //@}
12744 # endif // #ifdef __DOXYGEN__
12745 
12746 
12747 // Low-level config
12748 // ----------------
12749 // Analog:
12750 # if defined(_ANSF10) || defined(__DOXYGEN__)
12751 /// Enable analog functionality on pin RF10.
12752 # define ENABLE_RF10_ANALOG() (_ANSF10 = 1)
12753 /// Disable analog functionality on pin RF10.
12754 # define DISABLE_RF10_ANALOG() (_ANSF10 = 0)
12755 # elif defined(RF10_AN)
12756 # define ENABLE_RF10_ANALOG() (RXY_GPIO_PCFG(RF10_AN) = 0)
12757 # define DISABLE_RF10_ANALOG() (RXY_GPIO_PCFG(RF10_AN) = 1)
12758 # else
12759 # define DISABLE_RF10_ANALOG() ((void) 0)
12760 # endif
12761 
12762 // Input/output:
12763 /// Configure pin RF10 as an input.
12764 # define CONFIG_RF10_AS_INPUT() (_TRISF10 = 1)
12765 /// Configure pin RF10 as an output.
12766 # define CONFIG_RF10_AS_OUTPUT() (_TRISF10 = 0)
12767 
12768 // Open-drain:
12769 # if defined(_ODCF10) || defined(__DOXYGEN__)
12770 /// Enable the open-drain driver on pin RF10.
12771 # define ENABLE_RF10_OPENDRAIN() (_ODCF10 = 1)
12772 /// Disable the open-drain driver on pin RF10.
12773 # define DISABLE_RF10_OPENDRAIN() (_ODCF10 = 0)
12774 # elif defined(_ODF10) // The PIF24F names this bit _OD instead of _ODC.
12775 # define ENABLE_RF10_OPENDRAIN() (_ODF10 = 1)
12776 # define DISABLE_RF10_OPENDRAIN() (_ODF10 = 0)
12777 # else
12778 # define DISABLE_RF10_OPENDRAIN() ((void) 0)
12779 # endif
12780 
12781 // Change notification, pullups and pulldowns:
12782 # if defined(_CNIEF10) || defined(__DOXYGEN__)
12783 /// Enable the pullup on pin RF10.
12784 # define ENABLE_RF10_PULLUP() (_CNPUF10 = 1)
12785 /// Disable the pullup on pin RF10.
12786 # define DISABLE_RF10_PULLUP() (_CNPUF10 = 0)
12787 
12788 /// Enable the pulldown on pin RF10.
12789 # define ENABLE_RF10_PULLDOWN() (_CNPDF10 = 1)
12790 /// Disable the pulldown on pin RF10.
12791 # define DISABLE_RF10_PULLDOWN() (_CNPDF10 = 0)
12792 
12793 /// Enable the change notification interrupt on pin RF10.
12794 # define ENABLE_RF10_CN_INTERRUPT() (_CNIEF10 = 1)
12795 /// Disable the change notification interrupt on pin RF10.
12796 # define DISABLE_RF10_CN_INTERRUPT() (_CNIEF10 = 0)
12797 
12798 # elif defined(RF10_CN)
12799 # define ENABLE_RF10_PULLUP() (RXY_GPIO_CNPUE(RF10_CN) = 1)
12800 # define DISABLE_RF10_PULLUP() (RXY_GPIO_CNPUE(RF10_CN) = 0)
12801 
12802 # if RXY_HAS_CNPDE(RF10_CN)
12803 # define ENABLE_RF10_PULLDOWN() (RXY_GPIO_CNPDE(RF10_CN) = 1)
12804 # define DISABLE_RF10_PULLDOWN() (RXY_GPIO_CNPDE(RF10_CN) = 0)
12805 # else
12806 # define DISABLE_RF10_PULLDOWN() ((void) 0)
12807 # endif
12808 
12809 # define ENABLE_RF10_CN_INTERRUPT() (RXY_GPIO_CNIE(RF10_CN) = 1)
12810 # define DISABLE_RF10_CN_INTERRUPT() (RXY_GPIO_CNIE(RF10_CN) = 0)
12811 
12812 # else
12813 # define DISABLE_RF10_PULLUP() ((void) 0)
12814 # define DISABLE_RF10_PULLDOWN() ((void) 0)
12815 # define DISABLE_RF10_CN_INTERRUPT() ((void) 0)
12816 # endif
12817 
12818 // High-level config
12819 // -----------------
12820 /** This macro disables pullups/downs, enables analog functionality, and configures
12821  * pin RF10 as an input.
12822  */
12823 # if defined(_ANSF10) || defined(RF10_AN) || defined(__DOXYGEN__)
12824 # define CONFIG_RF10_AS_ANALOG() \
12825  do { \
12826  ENABLE_RF10_ANALOG(); \
12827  CONFIG_RF10_AS_INPUT(); \
12828  DISABLE_RF10_OPENDRAIN(); \
12829  DISABLE_RF10_PULLUP(); \
12830  DISABLE_RF10_PULLDOWN(); \
12831  } while (0)
12832 # endif
12833 
12834 /** This macro disables open-drain and pullups/downs,
12835  * configures pin RF10 for digital (not analog) operation, and
12836  * configures the pin as an input.
12837  */
12838 # define CONFIG_RF10_AS_DIG_INPUT() \
12839  do { \
12840  DISABLE_RF10_ANALOG(); \
12841  CONFIG_RF10_AS_INPUT(); \
12842  DISABLE_RF10_OPENDRAIN(); \
12843  DISABLE_RF10_PULLUP(); \
12844  DISABLE_RF10_PULLDOWN(); \
12845  } while (0)
12846 
12847 /** This macro disables open-drain and pullups/downs,
12848  * configures pin RF10 for digital (not analog) operation, and
12849  * configures the pin as an output.
12850  */
12851 # define CONFIG_RF10_AS_DIG_OUTPUT() \
12852  do { \
12853  DISABLE_RF10_ANALOG(); \
12854  CONFIG_RF10_AS_OUTPUT(); \
12855  DISABLE_RF10_OPENDRAIN(); \
12856  DISABLE_RF10_PULLUP(); \
12857  DISABLE_RF10_PULLDOWN(); \
12858  } while (0)
12859 
12860 #endif // #if defined(_RF10) || defined(__DOXYGEN__): Provide GPIO for RF10
12861 
12862 
12863 
12864 
12865 
12866 // Provide GPIO for RF11
12867 // ====================
12868 #if defined(_RF11) || defined(__DOXYGEN__)
12869 
12870 // Dummy macros for documentation only
12871 # ifdef __DOXYGEN__
12872 /// This macro specifies the RPy value associated with pin RF11.
12873 /// Its device-specific definition is given in pic24_ports_mapping.h.
12874 # define RF11_RP xx
12875 
12876 /// This macro specifies the ANn value associated with pin RF11.
12877 /// Its device-specific definition is given in pic24_ports_mapping.h.
12878 # define RF11_AN xx
12879 
12880 /// This macro specifies the CNm value associated with pin RF11.
12881 /// Its device-specific definition is given in pic24_ports_mapping.h.
12882 # define RF11_CN xx
12883 
12884 //@}
12885 # endif // #ifdef __DOXYGEN__
12886 
12887 
12888 // Low-level config
12889 // ----------------
12890 // Analog:
12891 # if defined(_ANSF11) || defined(__DOXYGEN__)
12892 /// Enable analog functionality on pin RF11.
12893 # define ENABLE_RF11_ANALOG() (_ANSF11 = 1)
12894 /// Disable analog functionality on pin RF11.
12895 # define DISABLE_RF11_ANALOG() (_ANSF11 = 0)
12896 # elif defined(RF11_AN)
12897 # define ENABLE_RF11_ANALOG() (RXY_GPIO_PCFG(RF11_AN) = 0)
12898 # define DISABLE_RF11_ANALOG() (RXY_GPIO_PCFG(RF11_AN) = 1)
12899 # else
12900 # define DISABLE_RF11_ANALOG() ((void) 0)
12901 # endif
12902 
12903 // Input/output:
12904 /// Configure pin RF11 as an input.
12905 # define CONFIG_RF11_AS_INPUT() (_TRISF11 = 1)
12906 /// Configure pin RF11 as an output.
12907 # define CONFIG_RF11_AS_OUTPUT() (_TRISF11 = 0)
12908 
12909 // Open-drain:
12910 # if defined(_ODCF11) || defined(__DOXYGEN__)
12911 /// Enable the open-drain driver on pin RF11.
12912 # define ENABLE_RF11_OPENDRAIN() (_ODCF11 = 1)
12913 /// Disable the open-drain driver on pin RF11.
12914 # define DISABLE_RF11_OPENDRAIN() (_ODCF11 = 0)
12915 # elif defined(_ODF11) // The PIF24F names this bit _OD instead of _ODC.
12916 # define ENABLE_RF11_OPENDRAIN() (_ODF11 = 1)
12917 # define DISABLE_RF11_OPENDRAIN() (_ODF11 = 0)
12918 # else
12919 # define DISABLE_RF11_OPENDRAIN() ((void) 0)
12920 # endif
12921 
12922 // Change notification, pullups and pulldowns:
12923 # if defined(_CNIEF11) || defined(__DOXYGEN__)
12924 /// Enable the pullup on pin RF11.
12925 # define ENABLE_RF11_PULLUP() (_CNPUF11 = 1)
12926 /// Disable the pullup on pin RF11.
12927 # define DISABLE_RF11_PULLUP() (_CNPUF11 = 0)
12928 
12929 /// Enable the pulldown on pin RF11.
12930 # define ENABLE_RF11_PULLDOWN() (_CNPDF11 = 1)
12931 /// Disable the pulldown on pin RF11.
12932 # define DISABLE_RF11_PULLDOWN() (_CNPDF11 = 0)
12933 
12934 /// Enable the change notification interrupt on pin RF11.
12935 # define ENABLE_RF11_CN_INTERRUPT() (_CNIEF11 = 1)
12936 /// Disable the change notification interrupt on pin RF11.
12937 # define DISABLE_RF11_CN_INTERRUPT() (_CNIEF11 = 0)
12938 
12939 # elif defined(RF11_CN)
12940 # define ENABLE_RF11_PULLUP() (RXY_GPIO_CNPUE(RF11_CN) = 1)
12941 # define DISABLE_RF11_PULLUP() (RXY_GPIO_CNPUE(RF11_CN) = 0)
12942 
12943 # if RXY_HAS_CNPDE(RF11_CN)
12944 # define ENABLE_RF11_PULLDOWN() (RXY_GPIO_CNPDE(RF11_CN) = 1)
12945 # define DISABLE_RF11_PULLDOWN() (RXY_GPIO_CNPDE(RF11_CN) = 0)
12946 # else
12947 # define DISABLE_RF11_PULLDOWN() ((void) 0)
12948 # endif
12949 
12950 # define ENABLE_RF11_CN_INTERRUPT() (RXY_GPIO_CNIE(RF11_CN) = 1)
12951 # define DISABLE_RF11_CN_INTERRUPT() (RXY_GPIO_CNIE(RF11_CN) = 0)
12952 
12953 # else
12954 # define DISABLE_RF11_PULLUP() ((void) 0)
12955 # define DISABLE_RF11_PULLDOWN() ((void) 0)
12956 # define DISABLE_RF11_CN_INTERRUPT() ((void) 0)
12957 # endif
12958 
12959 // High-level config
12960 // -----------------
12961 /** This macro disables pullups/downs, enables analog functionality, and configures
12962  * pin RF11 as an input.
12963  */
12964 # if defined(_ANSF11) || defined(RF11_AN) || defined(__DOXYGEN__)
12965 # define CONFIG_RF11_AS_ANALOG() \
12966  do { \
12967  ENABLE_RF11_ANALOG(); \
12968  CONFIG_RF11_AS_INPUT(); \
12969  DISABLE_RF11_OPENDRAIN(); \
12970  DISABLE_RF11_PULLUP(); \
12971  DISABLE_RF11_PULLDOWN(); \
12972  } while (0)
12973 # endif
12974 
12975 /** This macro disables open-drain and pullups/downs,
12976  * configures pin RF11 for digital (not analog) operation, and
12977  * configures the pin as an input.
12978  */
12979 # define CONFIG_RF11_AS_DIG_INPUT() \
12980  do { \
12981  DISABLE_RF11_ANALOG(); \
12982  CONFIG_RF11_AS_INPUT(); \
12983  DISABLE_RF11_OPENDRAIN(); \
12984  DISABLE_RF11_PULLUP(); \
12985  DISABLE_RF11_PULLDOWN(); \
12986  } while (0)
12987 
12988 /** This macro disables open-drain and pullups/downs,
12989  * configures pin RF11 for digital (not analog) operation, and
12990  * configures the pin as an output.
12991  */
12992 # define CONFIG_RF11_AS_DIG_OUTPUT() \
12993  do { \
12994  DISABLE_RF11_ANALOG(); \
12995  CONFIG_RF11_AS_OUTPUT(); \
12996  DISABLE_RF11_OPENDRAIN(); \
12997  DISABLE_RF11_PULLUP(); \
12998  DISABLE_RF11_PULLDOWN(); \
12999  } while (0)
13000 
13001 #endif // #if defined(_RF11) || defined(__DOXYGEN__): Provide GPIO for RF11
13002 
13003 
13004 
13005 
13006 
13007 // Provide GPIO for RF12
13008 // ====================
13009 #if defined(_RF12) || defined(__DOXYGEN__)
13010 
13011 // Dummy macros for documentation only
13012 # ifdef __DOXYGEN__
13013 /// This macro specifies the RPy value associated with pin RF12.
13014 /// Its device-specific definition is given in pic24_ports_mapping.h.
13015 # define RF12_RP xx
13016 
13017 /// This macro specifies the ANn value associated with pin RF12.
13018 /// Its device-specific definition is given in pic24_ports_mapping.h.
13019 # define RF12_AN xx
13020 
13021 /// This macro specifies the CNm value associated with pin RF12.
13022 /// Its device-specific definition is given in pic24_ports_mapping.h.
13023 # define RF12_CN xx
13024 
13025 //@}
13026 # endif // #ifdef __DOXYGEN__
13027 
13028 
13029 // Low-level config
13030 // ----------------
13031 // Analog:
13032 # if defined(_ANSF12) || defined(__DOXYGEN__)
13033 /// Enable analog functionality on pin RF12.
13034 # define ENABLE_RF12_ANALOG() (_ANSF12 = 1)
13035 /// Disable analog functionality on pin RF12.
13036 # define DISABLE_RF12_ANALOG() (_ANSF12 = 0)
13037 # elif defined(RF12_AN)
13038 # define ENABLE_RF12_ANALOG() (RXY_GPIO_PCFG(RF12_AN) = 0)
13039 # define DISABLE_RF12_ANALOG() (RXY_GPIO_PCFG(RF12_AN) = 1)
13040 # else
13041 # define DISABLE_RF12_ANALOG() ((void) 0)
13042 # endif
13043 
13044 // Input/output:
13045 /// Configure pin RF12 as an input.
13046 # define CONFIG_RF12_AS_INPUT() (_TRISF12 = 1)
13047 /// Configure pin RF12 as an output.
13048 # define CONFIG_RF12_AS_OUTPUT() (_TRISF12 = 0)
13049 
13050 // Open-drain:
13051 # if defined(_ODCF12) || defined(__DOXYGEN__)
13052 /// Enable the open-drain driver on pin RF12.
13053 # define ENABLE_RF12_OPENDRAIN() (_ODCF12 = 1)
13054 /// Disable the open-drain driver on pin RF12.
13055 # define DISABLE_RF12_OPENDRAIN() (_ODCF12 = 0)
13056 # elif defined(_ODF12) // The PIF24F names this bit _OD instead of _ODC.
13057 # define ENABLE_RF12_OPENDRAIN() (_ODF12 = 1)
13058 # define DISABLE_RF12_OPENDRAIN() (_ODF12 = 0)
13059 # else
13060 # define DISABLE_RF12_OPENDRAIN() ((void) 0)
13061 # endif
13062 
13063 // Change notification, pullups and pulldowns:
13064 # if defined(_CNIEF12) || defined(__DOXYGEN__)
13065 /// Enable the pullup on pin RF12.
13066 # define ENABLE_RF12_PULLUP() (_CNPUF12 = 1)
13067 /// Disable the pullup on pin RF12.
13068 # define DISABLE_RF12_PULLUP() (_CNPUF12 = 0)
13069 
13070 /// Enable the pulldown on pin RF12.
13071 # define ENABLE_RF12_PULLDOWN() (_CNPDF12 = 1)
13072 /// Disable the pulldown on pin RF12.
13073 # define DISABLE_RF12_PULLDOWN() (_CNPDF12 = 0)
13074 
13075 /// Enable the change notification interrupt on pin RF12.
13076 # define ENABLE_RF12_CN_INTERRUPT() (_CNIEF12 = 1)
13077 /// Disable the change notification interrupt on pin RF12.
13078 # define DISABLE_RF12_CN_INTERRUPT() (_CNIEF12 = 0)
13079 
13080 # elif defined(RF12_CN)
13081 # define ENABLE_RF12_PULLUP() (RXY_GPIO_CNPUE(RF12_CN) = 1)
13082 # define DISABLE_RF12_PULLUP() (RXY_GPIO_CNPUE(RF12_CN) = 0)
13083 
13084 # if RXY_HAS_CNPDE(RF12_CN)
13085 # define ENABLE_RF12_PULLDOWN() (RXY_GPIO_CNPDE(RF12_CN) = 1)
13086 # define DISABLE_RF12_PULLDOWN() (RXY_GPIO_CNPDE(RF12_CN) = 0)
13087 # else
13088 # define DISABLE_RF12_PULLDOWN() ((void) 0)
13089 # endif
13090 
13091 # define ENABLE_RF12_CN_INTERRUPT() (RXY_GPIO_CNIE(RF12_CN) = 1)
13092 # define DISABLE_RF12_CN_INTERRUPT() (RXY_GPIO_CNIE(RF12_CN) = 0)
13093 
13094 # else
13095 # define DISABLE_RF12_PULLUP() ((void) 0)
13096 # define DISABLE_RF12_PULLDOWN() ((void) 0)
13097 # define DISABLE_RF12_CN_INTERRUPT() ((void) 0)
13098 # endif
13099 
13100 // High-level config
13101 // -----------------
13102 /** This macro disables pullups/downs, enables analog functionality, and configures
13103  * pin RF12 as an input.
13104  */
13105 # if defined(_ANSF12) || defined(RF12_AN) || defined(__DOXYGEN__)
13106 # define CONFIG_RF12_AS_ANALOG() \
13107  do { \
13108  ENABLE_RF12_ANALOG(); \
13109  CONFIG_RF12_AS_INPUT(); \
13110  DISABLE_RF12_OPENDRAIN(); \
13111  DISABLE_RF12_PULLUP(); \
13112  DISABLE_RF12_PULLDOWN(); \
13113  } while (0)
13114 # endif
13115 
13116 /** This macro disables open-drain and pullups/downs,
13117  * configures pin RF12 for digital (not analog) operation, and
13118  * configures the pin as an input.
13119  */
13120 # define CONFIG_RF12_AS_DIG_INPUT() \
13121  do { \
13122  DISABLE_RF12_ANALOG(); \
13123  CONFIG_RF12_AS_INPUT(); \
13124  DISABLE_RF12_OPENDRAIN(); \
13125  DISABLE_RF12_PULLUP(); \
13126  DISABLE_RF12_PULLDOWN(); \
13127  } while (0)
13128 
13129 /** This macro disables open-drain and pullups/downs,
13130  * configures pin RF12 for digital (not analog) operation, and
13131  * configures the pin as an output.
13132  */
13133 # define CONFIG_RF12_AS_DIG_OUTPUT() \
13134  do { \
13135  DISABLE_RF12_ANALOG(); \
13136  CONFIG_RF12_AS_OUTPUT(); \
13137  DISABLE_RF12_OPENDRAIN(); \
13138  DISABLE_RF12_PULLUP(); \
13139  DISABLE_RF12_PULLDOWN(); \
13140  } while (0)
13141 
13142 #endif // #if defined(_RF12) || defined(__DOXYGEN__): Provide GPIO for RF12
13143 
13144 
13145 
13146 
13147 
13148 // Provide GPIO for RF13
13149 // ====================
13150 #if defined(_RF13) || defined(__DOXYGEN__)
13151 
13152 // Dummy macros for documentation only
13153 # ifdef __DOXYGEN__
13154 /// This macro specifies the RPy value associated with pin RF13.
13155 /// Its device-specific definition is given in pic24_ports_mapping.h.
13156 # define RF13_RP xx
13157 
13158 /// This macro specifies the ANn value associated with pin RF13.
13159 /// Its device-specific definition is given in pic24_ports_mapping.h.
13160 # define RF13_AN xx
13161 
13162 /// This macro specifies the CNm value associated with pin RF13.
13163 /// Its device-specific definition is given in pic24_ports_mapping.h.
13164 # define RF13_CN xx
13165 
13166 //@}
13167 # endif // #ifdef __DOXYGEN__
13168 
13169 
13170 // Low-level config
13171 // ----------------
13172 // Analog:
13173 # if defined(_ANSF13) || defined(__DOXYGEN__)
13174 /// Enable analog functionality on pin RF13.
13175 # define ENABLE_RF13_ANALOG() (_ANSF13 = 1)
13176 /// Disable analog functionality on pin RF13.
13177 # define DISABLE_RF13_ANALOG() (_ANSF13 = 0)
13178 # elif defined(RF13_AN)
13179 # define ENABLE_RF13_ANALOG() (RXY_GPIO_PCFG(RF13_AN) = 0)
13180 # define DISABLE_RF13_ANALOG() (RXY_GPIO_PCFG(RF13_AN) = 1)
13181 # else
13182 # define DISABLE_RF13_ANALOG() ((void) 0)
13183 # endif
13184 
13185 // Input/output:
13186 /// Configure pin RF13 as an input.
13187 # define CONFIG_RF13_AS_INPUT() (_TRISF13 = 1)
13188 /// Configure pin RF13 as an output.
13189 # define CONFIG_RF13_AS_OUTPUT() (_TRISF13 = 0)
13190 
13191 // Open-drain:
13192 # if defined(_ODCF13) || defined(__DOXYGEN__)
13193 /// Enable the open-drain driver on pin RF13.
13194 # define ENABLE_RF13_OPENDRAIN() (_ODCF13 = 1)
13195 /// Disable the open-drain driver on pin RF13.
13196 # define DISABLE_RF13_OPENDRAIN() (_ODCF13 = 0)
13197 # elif defined(_ODF13) // The PIF24F names this bit _OD instead of _ODC.
13198 # define ENABLE_RF13_OPENDRAIN() (_ODF13 = 1)
13199 # define DISABLE_RF13_OPENDRAIN() (_ODF13 = 0)
13200 # else
13201 # define DISABLE_RF13_OPENDRAIN() ((void) 0)
13202 # endif
13203 
13204 // Change notification, pullups and pulldowns:
13205 # if defined(_CNIEF13) || defined(__DOXYGEN__)
13206 /// Enable the pullup on pin RF13.
13207 # define ENABLE_RF13_PULLUP() (_CNPUF13 = 1)
13208 /// Disable the pullup on pin RF13.
13209 # define DISABLE_RF13_PULLUP() (_CNPUF13 = 0)
13210 
13211 /// Enable the pulldown on pin RF13.
13212 # define ENABLE_RF13_PULLDOWN() (_CNPDF13 = 1)
13213 /// Disable the pulldown on pin RF13.
13214 # define DISABLE_RF13_PULLDOWN() (_CNPDF13 = 0)
13215 
13216 /// Enable the change notification interrupt on pin RF13.
13217 # define ENABLE_RF13_CN_INTERRUPT() (_CNIEF13 = 1)
13218 /// Disable the change notification interrupt on pin RF13.
13219 # define DISABLE_RF13_CN_INTERRUPT() (_CNIEF13 = 0)
13220 
13221 # elif defined(RF13_CN)
13222 # define ENABLE_RF13_PULLUP() (RXY_GPIO_CNPUE(RF13_CN) = 1)
13223 # define DISABLE_RF13_PULLUP() (RXY_GPIO_CNPUE(RF13_CN) = 0)
13224 
13225 # if RXY_HAS_CNPDE(RF13_CN)
13226 # define ENABLE_RF13_PULLDOWN() (RXY_GPIO_CNPDE(RF13_CN) = 1)
13227 # define DISABLE_RF13_PULLDOWN() (RXY_GPIO_CNPDE(RF13_CN) = 0)
13228 # else
13229 # define DISABLE_RF13_PULLDOWN() ((void) 0)
13230 # endif
13231 
13232 # define ENABLE_RF13_CN_INTERRUPT() (RXY_GPIO_CNIE(RF13_CN) = 1)
13233 # define DISABLE_RF13_CN_INTERRUPT() (RXY_GPIO_CNIE(RF13_CN) = 0)
13234 
13235 # else
13236 # define DISABLE_RF13_PULLUP() ((void) 0)
13237 # define DISABLE_RF13_PULLDOWN() ((void) 0)
13238 # define DISABLE_RF13_CN_INTERRUPT() ((void) 0)
13239 # endif
13240 
13241 // High-level config
13242 // -----------------
13243 /** This macro disables pullups/downs, enables analog functionality, and configures
13244  * pin RF13 as an input.
13245  */
13246 # if defined(_ANSF13) || defined(RF13_AN) || defined(__DOXYGEN__)
13247 # define CONFIG_RF13_AS_ANALOG() \
13248  do { \
13249  ENABLE_RF13_ANALOG(); \
13250  CONFIG_RF13_AS_INPUT(); \
13251  DISABLE_RF13_OPENDRAIN(); \
13252  DISABLE_RF13_PULLUP(); \
13253  DISABLE_RF13_PULLDOWN(); \
13254  } while (0)
13255 # endif
13256 
13257 /** This macro disables open-drain and pullups/downs,
13258  * configures pin RF13 for digital (not analog) operation, and
13259  * configures the pin as an input.
13260  */
13261 # define CONFIG_RF13_AS_DIG_INPUT() \
13262  do { \
13263  DISABLE_RF13_ANALOG(); \
13264  CONFIG_RF13_AS_INPUT(); \
13265  DISABLE_RF13_OPENDRAIN(); \
13266  DISABLE_RF13_PULLUP(); \
13267  DISABLE_RF13_PULLDOWN(); \
13268  } while (0)
13269 
13270 /** This macro disables open-drain and pullups/downs,
13271  * configures pin RF13 for digital (not analog) operation, and
13272  * configures the pin as an output.
13273  */
13274 # define CONFIG_RF13_AS_DIG_OUTPUT() \
13275  do { \
13276  DISABLE_RF13_ANALOG(); \
13277  CONFIG_RF13_AS_OUTPUT(); \
13278  DISABLE_RF13_OPENDRAIN(); \
13279  DISABLE_RF13_PULLUP(); \
13280  DISABLE_RF13_PULLDOWN(); \
13281  } while (0)
13282 
13283 #endif // #if defined(_RF13) || defined(__DOXYGEN__): Provide GPIO for RF13
13284 
13285 
13286 
13287 
13288 
13289 // Provide GPIO for RF14
13290 // ====================
13291 #if defined(_RF14) || defined(__DOXYGEN__)
13292 
13293 // Dummy macros for documentation only
13294 # ifdef __DOXYGEN__
13295 /// This macro specifies the RPy value associated with pin RF14.
13296 /// Its device-specific definition is given in pic24_ports_mapping.h.
13297 # define RF14_RP xx
13298 
13299 /// This macro specifies the ANn value associated with pin RF14.
13300 /// Its device-specific definition is given in pic24_ports_mapping.h.
13301 # define RF14_AN xx
13302 
13303 /// This macro specifies the CNm value associated with pin RF14.
13304 /// Its device-specific definition is given in pic24_ports_mapping.h.
13305 # define RF14_CN xx
13306 
13307 //@}
13308 # endif // #ifdef __DOXYGEN__
13309 
13310 
13311 // Low-level config
13312 // ----------------
13313 // Analog:
13314 # if defined(_ANSF14) || defined(__DOXYGEN__)
13315 /// Enable analog functionality on pin RF14.
13316 # define ENABLE_RF14_ANALOG() (_ANSF14 = 1)
13317 /// Disable analog functionality on pin RF14.
13318 # define DISABLE_RF14_ANALOG() (_ANSF14 = 0)
13319 # elif defined(RF14_AN)
13320 # define ENABLE_RF14_ANALOG() (RXY_GPIO_PCFG(RF14_AN) = 0)
13321 # define DISABLE_RF14_ANALOG() (RXY_GPIO_PCFG(RF14_AN) = 1)
13322 # else
13323 # define DISABLE_RF14_ANALOG() ((void) 0)
13324 # endif
13325 
13326 // Input/output:
13327 /// Configure pin RF14 as an input.
13328 # define CONFIG_RF14_AS_INPUT() (_TRISF14 = 1)
13329 /// Configure pin RF14 as an output.
13330 # define CONFIG_RF14_AS_OUTPUT() (_TRISF14 = 0)
13331 
13332 // Open-drain:
13333 # if defined(_ODCF14) || defined(__DOXYGEN__)
13334 /// Enable the open-drain driver on pin RF14.
13335 # define ENABLE_RF14_OPENDRAIN() (_ODCF14 = 1)
13336 /// Disable the open-drain driver on pin RF14.
13337 # define DISABLE_RF14_OPENDRAIN() (_ODCF14 = 0)
13338 # elif defined(_ODF14) // The PIF24F names this bit _OD instead of _ODC.
13339 # define ENABLE_RF14_OPENDRAIN() (_ODF14 = 1)
13340 # define DISABLE_RF14_OPENDRAIN() (_ODF14 = 0)
13341 # else
13342 # define DISABLE_RF14_OPENDRAIN() ((void) 0)
13343 # endif
13344 
13345 // Change notification, pullups and pulldowns:
13346 # if defined(_CNIEF14) || defined(__DOXYGEN__)
13347 /// Enable the pullup on pin RF14.
13348 # define ENABLE_RF14_PULLUP() (_CNPUF14 = 1)
13349 /// Disable the pullup on pin RF14.
13350 # define DISABLE_RF14_PULLUP() (_CNPUF14 = 0)
13351 
13352 /// Enable the pulldown on pin RF14.
13353 # define ENABLE_RF14_PULLDOWN() (_CNPDF14 = 1)
13354 /// Disable the pulldown on pin RF14.
13355 # define DISABLE_RF14_PULLDOWN() (_CNPDF14 = 0)
13356 
13357 /// Enable the change notification interrupt on pin RF14.
13358 # define ENABLE_RF14_CN_INTERRUPT() (_CNIEF14 = 1)
13359 /// Disable the change notification interrupt on pin RF14.
13360 # define DISABLE_RF14_CN_INTERRUPT() (_CNIEF14 = 0)
13361 
13362 # elif defined(RF14_CN)
13363 # define ENABLE_RF14_PULLUP() (RXY_GPIO_CNPUE(RF14_CN) = 1)
13364 # define DISABLE_RF14_PULLUP() (RXY_GPIO_CNPUE(RF14_CN) = 0)
13365 
13366 # if RXY_HAS_CNPDE(RF14_CN)
13367 # define ENABLE_RF14_PULLDOWN() (RXY_GPIO_CNPDE(RF14_CN) = 1)
13368 # define DISABLE_RF14_PULLDOWN() (RXY_GPIO_CNPDE(RF14_CN) = 0)
13369 # else
13370 # define DISABLE_RF14_PULLDOWN() ((void) 0)
13371 # endif
13372 
13373 # define ENABLE_RF14_CN_INTERRUPT() (RXY_GPIO_CNIE(RF14_CN) = 1)
13374 # define DISABLE_RF14_CN_INTERRUPT() (RXY_GPIO_CNIE(RF14_CN) = 0)
13375 
13376 # else
13377 # define DISABLE_RF14_PULLUP() ((void) 0)
13378 # define DISABLE_RF14_PULLDOWN() ((void) 0)
13379 # define DISABLE_RF14_CN_INTERRUPT() ((void) 0)
13380 # endif
13381 
13382 // High-level config
13383 // -----------------
13384 /** This macro disables pullups/downs, enables analog functionality, and configures
13385  * pin RF14 as an input.
13386  */
13387 # if defined(_ANSF14) || defined(RF14_AN) || defined(__DOXYGEN__)
13388 # define CONFIG_RF14_AS_ANALOG() \
13389  do { \
13390  ENABLE_RF14_ANALOG(); \
13391  CONFIG_RF14_AS_INPUT(); \
13392  DISABLE_RF14_OPENDRAIN(); \
13393  DISABLE_RF14_PULLUP(); \
13394  DISABLE_RF14_PULLDOWN(); \
13395  } while (0)
13396 # endif
13397 
13398 /** This macro disables open-drain and pullups/downs,
13399  * configures pin RF14 for digital (not analog) operation, and
13400  * configures the pin as an input.
13401  */
13402 # define CONFIG_RF14_AS_DIG_INPUT() \
13403  do { \
13404  DISABLE_RF14_ANALOG(); \
13405  CONFIG_RF14_AS_INPUT(); \
13406  DISABLE_RF14_OPENDRAIN(); \
13407  DISABLE_RF14_PULLUP(); \
13408  DISABLE_RF14_PULLDOWN(); \
13409  } while (0)
13410 
13411 /** This macro disables open-drain and pullups/downs,
13412  * configures pin RF14 for digital (not analog) operation, and
13413  * configures the pin as an output.
13414  */
13415 # define CONFIG_RF14_AS_DIG_OUTPUT() \
13416  do { \
13417  DISABLE_RF14_ANALOG(); \
13418  CONFIG_RF14_AS_OUTPUT(); \
13419  DISABLE_RF14_OPENDRAIN(); \
13420  DISABLE_RF14_PULLUP(); \
13421  DISABLE_RF14_PULLDOWN(); \
13422  } while (0)
13423 
13424 #endif // #if defined(_RF14) || defined(__DOXYGEN__): Provide GPIO for RF14
13425 
13426 
13427 
13428 
13429 
13430 // Provide GPIO for RF15
13431 // ====================
13432 #if defined(_RF15) || defined(__DOXYGEN__)
13433 
13434 // Dummy macros for documentation only
13435 # ifdef __DOXYGEN__
13436 /// This macro specifies the RPy value associated with pin RF15.
13437 /// Its device-specific definition is given in pic24_ports_mapping.h.
13438 # define RF15_RP xx
13439 
13440 /// This macro specifies the ANn value associated with pin RF15.
13441 /// Its device-specific definition is given in pic24_ports_mapping.h.
13442 # define RF15_AN xx
13443 
13444 /// This macro specifies the CNm value associated with pin RF15.
13445 /// Its device-specific definition is given in pic24_ports_mapping.h.
13446 # define RF15_CN xx
13447 
13448 //@}
13449 # endif // #ifdef __DOXYGEN__
13450 
13451 
13452 // Low-level config
13453 // ----------------
13454 // Analog:
13455 # if defined(_ANSF15) || defined(__DOXYGEN__)
13456 /// Enable analog functionality on pin RF15.
13457 # define ENABLE_RF15_ANALOG() (_ANSF15 = 1)
13458 /// Disable analog functionality on pin RF15.
13459 # define DISABLE_RF15_ANALOG() (_ANSF15 = 0)
13460 # elif defined(RF15_AN)
13461 # define ENABLE_RF15_ANALOG() (RXY_GPIO_PCFG(RF15_AN) = 0)
13462 # define DISABLE_RF15_ANALOG() (RXY_GPIO_PCFG(RF15_AN) = 1)
13463 # else
13464 # define DISABLE_RF15_ANALOG() ((void) 0)
13465 # endif
13466 
13467 // Input/output:
13468 /// Configure pin RF15 as an input.
13469 # define CONFIG_RF15_AS_INPUT() (_TRISF15 = 1)
13470 /// Configure pin RF15 as an output.
13471 # define CONFIG_RF15_AS_OUTPUT() (_TRISF15 = 0)
13472 
13473 // Open-drain:
13474 # if defined(_ODCF15) || defined(__DOXYGEN__)
13475 /// Enable the open-drain driver on pin RF15.
13476 # define ENABLE_RF15_OPENDRAIN() (_ODCF15 = 1)
13477 /// Disable the open-drain driver on pin RF15.
13478 # define DISABLE_RF15_OPENDRAIN() (_ODCF15 = 0)
13479 # elif defined(_ODF15) // The PIF24F names this bit _OD instead of _ODC.
13480 # define ENABLE_RF15_OPENDRAIN() (_ODF15 = 1)
13481 # define DISABLE_RF15_OPENDRAIN() (_ODF15 = 0)
13482 # else
13483 # define DISABLE_RF15_OPENDRAIN() ((void) 0)
13484 # endif
13485 
13486 // Change notification, pullups and pulldowns:
13487 # if defined(_CNIEF15) || defined(__DOXYGEN__)
13488 /// Enable the pullup on pin RF15.
13489 # define ENABLE_RF15_PULLUP() (_CNPUF15 = 1)
13490 /// Disable the pullup on pin RF15.
13491 # define DISABLE_RF15_PULLUP() (_CNPUF15 = 0)
13492 
13493 /// Enable the pulldown on pin RF15.
13494 # define ENABLE_RF15_PULLDOWN() (_CNPDF15 = 1)
13495 /// Disable the pulldown on pin RF15.
13496 # define DISABLE_RF15_PULLDOWN() (_CNPDF15 = 0)
13497 
13498 /// Enable the change notification interrupt on pin RF15.
13499 # define ENABLE_RF15_CN_INTERRUPT() (_CNIEF15 = 1)
13500 /// Disable the change notification interrupt on pin RF15.
13501 # define DISABLE_RF15_CN_INTERRUPT() (_CNIEF15 = 0)
13502 
13503 # elif defined(RF15_CN)
13504 # define ENABLE_RF15_PULLUP() (RXY_GPIO_CNPUE(RF15_CN) = 1)
13505 # define DISABLE_RF15_PULLUP() (RXY_GPIO_CNPUE(RF15_CN) = 0)
13506 
13507 # if RXY_HAS_CNPDE(RF15_CN)
13508 # define ENABLE_RF15_PULLDOWN() (RXY_GPIO_CNPDE(RF15_CN) = 1)
13509 # define DISABLE_RF15_PULLDOWN() (RXY_GPIO_CNPDE(RF15_CN) = 0)
13510 # else
13511 # define DISABLE_RF15_PULLDOWN() ((void) 0)
13512 # endif
13513 
13514 # define ENABLE_RF15_CN_INTERRUPT() (RXY_GPIO_CNIE(RF15_CN) = 1)
13515 # define DISABLE_RF15_CN_INTERRUPT() (RXY_GPIO_CNIE(RF15_CN) = 0)
13516 
13517 # else
13518 # define DISABLE_RF15_PULLUP() ((void) 0)
13519 # define DISABLE_RF15_PULLDOWN() ((void) 0)
13520 # define DISABLE_RF15_CN_INTERRUPT() ((void) 0)
13521 # endif
13522 
13523 // High-level config
13524 // -----------------
13525 /** This macro disables pullups/downs, enables analog functionality, and configures
13526  * pin RF15 as an input.
13527  */
13528 # if defined(_ANSF15) || defined(RF15_AN) || defined(__DOXYGEN__)
13529 # define CONFIG_RF15_AS_ANALOG() \
13530  do { \
13531  ENABLE_RF15_ANALOG(); \
13532  CONFIG_RF15_AS_INPUT(); \
13533  DISABLE_RF15_OPENDRAIN(); \
13534  DISABLE_RF15_PULLUP(); \
13535  DISABLE_RF15_PULLDOWN(); \
13536  } while (0)
13537 # endif
13538 
13539 /** This macro disables open-drain and pullups/downs,
13540  * configures pin RF15 for digital (not analog) operation, and
13541  * configures the pin as an input.
13542  */
13543 # define CONFIG_RF15_AS_DIG_INPUT() \
13544  do { \
13545  DISABLE_RF15_ANALOG(); \
13546  CONFIG_RF15_AS_INPUT(); \
13547  DISABLE_RF15_OPENDRAIN(); \
13548  DISABLE_RF15_PULLUP(); \
13549  DISABLE_RF15_PULLDOWN(); \
13550  } while (0)
13551 
13552 /** This macro disables open-drain and pullups/downs,
13553  * configures pin RF15 for digital (not analog) operation, and
13554  * configures the pin as an output.
13555  */
13556 # define CONFIG_RF15_AS_DIG_OUTPUT() \
13557  do { \
13558  DISABLE_RF15_ANALOG(); \
13559  CONFIG_RF15_AS_OUTPUT(); \
13560  DISABLE_RF15_OPENDRAIN(); \
13561  DISABLE_RF15_PULLUP(); \
13562  DISABLE_RF15_PULLDOWN(); \
13563  } while (0)
13564 
13565 #endif // #if defined(_RF15) || defined(__DOXYGEN__): Provide GPIO for RF15
13566 
13567 
13568 
13569 
13570 
13571 // Provide GPIO for RG0
13572 // ====================
13573 #if defined(_RG0) || defined(__DOXYGEN__)
13574 
13575 // Dummy macros for documentation only
13576 # ifdef __DOXYGEN__
13577 /// This macro specifies the RPy value associated with pin RG0.
13578 /// Its device-specific definition is given in pic24_ports_mapping.h.
13579 # define RG0_RP xx
13580 
13581 /// This macro specifies the ANn value associated with pin RG0.
13582 /// Its device-specific definition is given in pic24_ports_mapping.h.
13583 # define RG0_AN xx
13584 
13585 /// This macro specifies the CNm value associated with pin RG0.
13586 /// Its device-specific definition is given in pic24_ports_mapping.h.
13587 # define RG0_CN xx
13588 
13589 //@}
13590 # endif // #ifdef __DOXYGEN__
13591 
13592 
13593 // Low-level config
13594 // ----------------
13595 // Analog:
13596 # if defined(_ANSG0) || defined(__DOXYGEN__)
13597 /// Enable analog functionality on pin RG0.
13598 # define ENABLE_RG0_ANALOG() (_ANSG0 = 1)
13599 /// Disable analog functionality on pin RG0.
13600 # define DISABLE_RG0_ANALOG() (_ANSG0 = 0)
13601 # elif defined(RG0_AN)
13602 # define ENABLE_RG0_ANALOG() (RXY_GPIO_PCFG(RG0_AN) = 0)
13603 # define DISABLE_RG0_ANALOG() (RXY_GPIO_PCFG(RG0_AN) = 1)
13604 # else
13605 # define DISABLE_RG0_ANALOG() ((void) 0)
13606 # endif
13607 
13608 // Input/output:
13609 /// Configure pin RG0 as an input.
13610 # define CONFIG_RG0_AS_INPUT() (_TRISG0 = 1)
13611 /// Configure pin RG0 as an output.
13612 # define CONFIG_RG0_AS_OUTPUT() (_TRISG0 = 0)
13613 
13614 // Open-drain:
13615 # if defined(_ODCG0) || defined(__DOXYGEN__)
13616 /// Enable the open-drain driver on pin RG0.
13617 # define ENABLE_RG0_OPENDRAIN() (_ODCG0 = 1)
13618 /// Disable the open-drain driver on pin RG0.
13619 # define DISABLE_RG0_OPENDRAIN() (_ODCG0 = 0)
13620 # elif defined(_ODG0) // The PIF24F names this bit _OD instead of _ODC.
13621 # define ENABLE_RG0_OPENDRAIN() (_ODG0 = 1)
13622 # define DISABLE_RG0_OPENDRAIN() (_ODG0 = 0)
13623 # else
13624 # define DISABLE_RG0_OPENDRAIN() ((void) 0)
13625 # endif
13626 
13627 // Change notification, pullups and pulldowns:
13628 # if defined(_CNIEG0) || defined(__DOXYGEN__)
13629 /// Enable the pullup on pin RG0.
13630 # define ENABLE_RG0_PULLUP() (_CNPUG0 = 1)
13631 /// Disable the pullup on pin RG0.
13632 # define DISABLE_RG0_PULLUP() (_CNPUG0 = 0)
13633 
13634 /// Enable the pulldown on pin RG0.
13635 # define ENABLE_RG0_PULLDOWN() (_CNPDG0 = 1)
13636 /// Disable the pulldown on pin RG0.
13637 # define DISABLE_RG0_PULLDOWN() (_CNPDG0 = 0)
13638 
13639 /// Enable the change notification interrupt on pin RG0.
13640 # define ENABLE_RG0_CN_INTERRUPT() (_CNIEG0 = 1)
13641 /// Disable the change notification interrupt on pin RG0.
13642 # define DISABLE_RG0_CN_INTERRUPT() (_CNIEG0 = 0)
13643 
13644 # elif defined(RG0_CN)
13645 # define ENABLE_RG0_PULLUP() (RXY_GPIO_CNPUE(RG0_CN) = 1)
13646 # define DISABLE_RG0_PULLUP() (RXY_GPIO_CNPUE(RG0_CN) = 0)
13647 
13648 # if RXY_HAS_CNPDE(RG0_CN)
13649 # define ENABLE_RG0_PULLDOWN() (RXY_GPIO_CNPDE(RG0_CN) = 1)
13650 # define DISABLE_RG0_PULLDOWN() (RXY_GPIO_CNPDE(RG0_CN) = 0)
13651 # else
13652 # define DISABLE_RG0_PULLDOWN() ((void) 0)
13653 # endif
13654 
13655 # define ENABLE_RG0_CN_INTERRUPT() (RXY_GPIO_CNIE(RG0_CN) = 1)
13656 # define DISABLE_RG0_CN_INTERRUPT() (RXY_GPIO_CNIE(RG0_CN) = 0)
13657 
13658 # else
13659 # define DISABLE_RG0_PULLUP() ((void) 0)
13660 # define DISABLE_RG0_PULLDOWN() ((void) 0)
13661 # define DISABLE_RG0_CN_INTERRUPT() ((void) 0)
13662 # endif
13663 
13664 // High-level config
13665 // -----------------
13666 /** This macro disables pullups/downs, enables analog functionality, and configures
13667  * pin RG0 as an input.
13668  */
13669 # if defined(_ANSG0) || defined(RG0_AN) || defined(__DOXYGEN__)
13670 # define CONFIG_RG0_AS_ANALOG() \
13671  do { \
13672  ENABLE_RG0_ANALOG(); \
13673  CONFIG_RG0_AS_INPUT(); \
13674  DISABLE_RG0_OPENDRAIN(); \
13675  DISABLE_RG0_PULLUP(); \
13676  DISABLE_RG0_PULLDOWN(); \
13677  } while (0)
13678 # endif
13679 
13680 /** This macro disables open-drain and pullups/downs,
13681  * configures pin RG0 for digital (not analog) operation, and
13682  * configures the pin as an input.
13683  */
13684 # define CONFIG_RG0_AS_DIG_INPUT() \
13685  do { \
13686  DISABLE_RG0_ANALOG(); \
13687  CONFIG_RG0_AS_INPUT(); \
13688  DISABLE_RG0_OPENDRAIN(); \
13689  DISABLE_RG0_PULLUP(); \
13690  DISABLE_RG0_PULLDOWN(); \
13691  } while (0)
13692 
13693 /** This macro disables open-drain and pullups/downs,
13694  * configures pin RG0 for digital (not analog) operation, and
13695  * configures the pin as an output.
13696  */
13697 # define CONFIG_RG0_AS_DIG_OUTPUT() \
13698  do { \
13699  DISABLE_RG0_ANALOG(); \
13700  CONFIG_RG0_AS_OUTPUT(); \
13701  DISABLE_RG0_OPENDRAIN(); \
13702  DISABLE_RG0_PULLUP(); \
13703  DISABLE_RG0_PULLDOWN(); \
13704  } while (0)
13705 
13706 #endif // #if defined(_RG0) || defined(__DOXYGEN__): Provide GPIO for RG0
13707 
13708 
13709 
13710 
13711 
13712 // Provide GPIO for RG1
13713 // ====================
13714 #if defined(_RG1) || defined(__DOXYGEN__)
13715 
13716 // Dummy macros for documentation only
13717 # ifdef __DOXYGEN__
13718 /// This macro specifies the RPy value associated with pin RG1.
13719 /// Its device-specific definition is given in pic24_ports_mapping.h.
13720 # define RG1_RP xx
13721 
13722 /// This macro specifies the ANn value associated with pin RG1.
13723 /// Its device-specific definition is given in pic24_ports_mapping.h.
13724 # define RG1_AN xx
13725 
13726 /// This macro specifies the CNm value associated with pin RG1.
13727 /// Its device-specific definition is given in pic24_ports_mapping.h.
13728 # define RG1_CN xx
13729 
13730 //@}
13731 # endif // #ifdef __DOXYGEN__
13732 
13733 
13734 // Low-level config
13735 // ----------------
13736 // Analog:
13737 # if defined(_ANSG1) || defined(__DOXYGEN__)
13738 /// Enable analog functionality on pin RG1.
13739 # define ENABLE_RG1_ANALOG() (_ANSG1 = 1)
13740 /// Disable analog functionality on pin RG1.
13741 # define DISABLE_RG1_ANALOG() (_ANSG1 = 0)
13742 # elif defined(RG1_AN)
13743 # define ENABLE_RG1_ANALOG() (RXY_GPIO_PCFG(RG1_AN) = 0)
13744 # define DISABLE_RG1_ANALOG() (RXY_GPIO_PCFG(RG1_AN) = 1)
13745 # else
13746 # define DISABLE_RG1_ANALOG() ((void) 0)
13747 # endif
13748 
13749 // Input/output:
13750 /// Configure pin RG1 as an input.
13751 # define CONFIG_RG1_AS_INPUT() (_TRISG1 = 1)
13752 /// Configure pin RG1 as an output.
13753 # define CONFIG_RG1_AS_OUTPUT() (_TRISG1 = 0)
13754 
13755 // Open-drain:
13756 # if defined(_ODCG1) || defined(__DOXYGEN__)
13757 /// Enable the open-drain driver on pin RG1.
13758 # define ENABLE_RG1_OPENDRAIN() (_ODCG1 = 1)
13759 /// Disable the open-drain driver on pin RG1.
13760 # define DISABLE_RG1_OPENDRAIN() (_ODCG1 = 0)
13761 # elif defined(_ODG1) // The PIF24F names this bit _OD instead of _ODC.
13762 # define ENABLE_RG1_OPENDRAIN() (_ODG1 = 1)
13763 # define DISABLE_RG1_OPENDRAIN() (_ODG1 = 0)
13764 # else
13765 # define DISABLE_RG1_OPENDRAIN() ((void) 0)
13766 # endif
13767 
13768 // Change notification, pullups and pulldowns:
13769 # if defined(_CNIEG1) || defined(__DOXYGEN__)
13770 /// Enable the pullup on pin RG1.
13771 # define ENABLE_RG1_PULLUP() (_CNPUG1 = 1)
13772 /// Disable the pullup on pin RG1.
13773 # define DISABLE_RG1_PULLUP() (_CNPUG1 = 0)
13774 
13775 /// Enable the pulldown on pin RG1.
13776 # define ENABLE_RG1_PULLDOWN() (_CNPDG1 = 1)
13777 /// Disable the pulldown on pin RG1.
13778 # define DISABLE_RG1_PULLDOWN() (_CNPDG1 = 0)
13779 
13780 /// Enable the change notification interrupt on pin RG1.
13781 # define ENABLE_RG1_CN_INTERRUPT() (_CNIEG1 = 1)
13782 /// Disable the change notification interrupt on pin RG1.
13783 # define DISABLE_RG1_CN_INTERRUPT() (_CNIEG1 = 0)
13784 
13785 # elif defined(RG1_CN)
13786 # define ENABLE_RG1_PULLUP() (RXY_GPIO_CNPUE(RG1_CN) = 1)
13787 # define DISABLE_RG1_PULLUP() (RXY_GPIO_CNPUE(RG1_CN) = 0)
13788 
13789 # if RXY_HAS_CNPDE(RG1_CN)
13790 # define ENABLE_RG1_PULLDOWN() (RXY_GPIO_CNPDE(RG1_CN) = 1)
13791 # define DISABLE_RG1_PULLDOWN() (RXY_GPIO_CNPDE(RG1_CN) = 0)
13792 # else
13793 # define DISABLE_RG1_PULLDOWN() ((void) 0)
13794 # endif
13795 
13796 # define ENABLE_RG1_CN_INTERRUPT() (RXY_GPIO_CNIE(RG1_CN) = 1)
13797 # define DISABLE_RG1_CN_INTERRUPT() (RXY_GPIO_CNIE(RG1_CN) = 0)
13798 
13799 # else
13800 # define DISABLE_RG1_PULLUP() ((void) 0)
13801 # define DISABLE_RG1_PULLDOWN() ((void) 0)
13802 # define DISABLE_RG1_CN_INTERRUPT() ((void) 0)
13803 # endif
13804 
13805 // High-level config
13806 // -----------------
13807 /** This macro disables pullups/downs, enables analog functionality, and configures
13808  * pin RG1 as an input.
13809  */
13810 # if defined(_ANSG1) || defined(RG1_AN) || defined(__DOXYGEN__)
13811 # define CONFIG_RG1_AS_ANALOG() \
13812  do { \
13813  ENABLE_RG1_ANALOG(); \
13814  CONFIG_RG1_AS_INPUT(); \
13815  DISABLE_RG1_OPENDRAIN(); \
13816  DISABLE_RG1_PULLUP(); \
13817  DISABLE_RG1_PULLDOWN(); \
13818  } while (0)
13819 # endif
13820 
13821 /** This macro disables open-drain and pullups/downs,
13822  * configures pin RG1 for digital (not analog) operation, and
13823  * configures the pin as an input.
13824  */
13825 # define CONFIG_RG1_AS_DIG_INPUT() \
13826  do { \
13827  DISABLE_RG1_ANALOG(); \
13828  CONFIG_RG1_AS_INPUT(); \
13829  DISABLE_RG1_OPENDRAIN(); \
13830  DISABLE_RG1_PULLUP(); \
13831  DISABLE_RG1_PULLDOWN(); \
13832  } while (0)
13833 
13834 /** This macro disables open-drain and pullups/downs,
13835  * configures pin RG1 for digital (not analog) operation, and
13836  * configures the pin as an output.
13837  */
13838 # define CONFIG_RG1_AS_DIG_OUTPUT() \
13839  do { \
13840  DISABLE_RG1_ANALOG(); \
13841  CONFIG_RG1_AS_OUTPUT(); \
13842  DISABLE_RG1_OPENDRAIN(); \
13843  DISABLE_RG1_PULLUP(); \
13844  DISABLE_RG1_PULLDOWN(); \
13845  } while (0)
13846 
13847 #endif // #if defined(_RG1) || defined(__DOXYGEN__): Provide GPIO for RG1
13848 
13849 
13850 
13851 
13852 
13853 // Provide GPIO for RG2
13854 // ====================
13855 #if defined(_RG2) || defined(__DOXYGEN__)
13856 
13857 // Dummy macros for documentation only
13858 # ifdef __DOXYGEN__
13859 /// This macro specifies the RPy value associated with pin RG2.
13860 /// Its device-specific definition is given in pic24_ports_mapping.h.
13861 # define RG2_RP xx
13862 
13863 /// This macro specifies the ANn value associated with pin RG2.
13864 /// Its device-specific definition is given in pic24_ports_mapping.h.
13865 # define RG2_AN xx
13866 
13867 /// This macro specifies the CNm value associated with pin RG2.
13868 /// Its device-specific definition is given in pic24_ports_mapping.h.
13869 # define RG2_CN xx
13870 
13871 //@}
13872 # endif // #ifdef __DOXYGEN__
13873 
13874 
13875 // Low-level config
13876 // ----------------
13877 // Analog:
13878 # if defined(_ANSG2) || defined(__DOXYGEN__)
13879 /// Enable analog functionality on pin RG2.
13880 # define ENABLE_RG2_ANALOG() (_ANSG2 = 1)
13881 /// Disable analog functionality on pin RG2.
13882 # define DISABLE_RG2_ANALOG() (_ANSG2 = 0)
13883 # elif defined(RG2_AN)
13884 # define ENABLE_RG2_ANALOG() (RXY_GPIO_PCFG(RG2_AN) = 0)
13885 # define DISABLE_RG2_ANALOG() (RXY_GPIO_PCFG(RG2_AN) = 1)
13886 # else
13887 # define DISABLE_RG2_ANALOG() ((void) 0)
13888 # endif
13889 
13890 // Input/output:
13891 /// Configure pin RG2 as an input.
13892 # define CONFIG_RG2_AS_INPUT() (_TRISG2 = 1)
13893 /// Configure pin RG2 as an output.
13894 # define CONFIG_RG2_AS_OUTPUT() (_TRISG2 = 0)
13895 
13896 // Open-drain:
13897 # if defined(_ODCG2) || defined(__DOXYGEN__)
13898 /// Enable the open-drain driver on pin RG2.
13899 # define ENABLE_RG2_OPENDRAIN() (_ODCG2 = 1)
13900 /// Disable the open-drain driver on pin RG2.
13901 # define DISABLE_RG2_OPENDRAIN() (_ODCG2 = 0)
13902 # elif defined(_ODG2) // The PIF24F names this bit _OD instead of _ODC.
13903 # define ENABLE_RG2_OPENDRAIN() (_ODG2 = 1)
13904 # define DISABLE_RG2_OPENDRAIN() (_ODG2 = 0)
13905 # else
13906 # define DISABLE_RG2_OPENDRAIN() ((void) 0)
13907 # endif
13908 
13909 // Change notification, pullups and pulldowns:
13910 # if defined(_CNIEG2) || defined(__DOXYGEN__)
13911 /// Enable the pullup on pin RG2.
13912 # define ENABLE_RG2_PULLUP() (_CNPUG2 = 1)
13913 /// Disable the pullup on pin RG2.
13914 # define DISABLE_RG2_PULLUP() (_CNPUG2 = 0)
13915 
13916 /// Enable the pulldown on pin RG2.
13917 # define ENABLE_RG2_PULLDOWN() (_CNPDG2 = 1)
13918 /// Disable the pulldown on pin RG2.
13919 # define DISABLE_RG2_PULLDOWN() (_CNPDG2 = 0)
13920 
13921 /// Enable the change notification interrupt on pin RG2.
13922 # define ENABLE_RG2_CN_INTERRUPT() (_CNIEG2 = 1)
13923 /// Disable the change notification interrupt on pin RG2.
13924 # define DISABLE_RG2_CN_INTERRUPT() (_CNIEG2 = 0)
13925 
13926 # elif defined(RG2_CN)
13927 # define ENABLE_RG2_PULLUP() (RXY_GPIO_CNPUE(RG2_CN) = 1)
13928 # define DISABLE_RG2_PULLUP() (RXY_GPIO_CNPUE(RG2_CN) = 0)
13929 
13930 # if RXY_HAS_CNPDE(RG2_CN)
13931 # define ENABLE_RG2_PULLDOWN() (RXY_GPIO_CNPDE(RG2_CN) = 1)
13932 # define DISABLE_RG2_PULLDOWN() (RXY_GPIO_CNPDE(RG2_CN) = 0)
13933 # else
13934 # define DISABLE_RG2_PULLDOWN() ((void) 0)
13935 # endif
13936 
13937 # define ENABLE_RG2_CN_INTERRUPT() (RXY_GPIO_CNIE(RG2_CN) = 1)
13938 # define DISABLE_RG2_CN_INTERRUPT() (RXY_GPIO_CNIE(RG2_CN) = 0)
13939 
13940 # else
13941 # define DISABLE_RG2_PULLUP() ((void) 0)
13942 # define DISABLE_RG2_PULLDOWN() ((void) 0)
13943 # define DISABLE_RG2_CN_INTERRUPT() ((void) 0)
13944 # endif
13945 
13946 // High-level config
13947 // -----------------
13948 /** This macro disables pullups/downs, enables analog functionality, and configures
13949  * pin RG2 as an input.
13950  */
13951 # if defined(_ANSG2) || defined(RG2_AN) || defined(__DOXYGEN__)
13952 # define CONFIG_RG2_AS_ANALOG() \
13953  do { \
13954  ENABLE_RG2_ANALOG(); \
13955  CONFIG_RG2_AS_INPUT(); \
13956  DISABLE_RG2_OPENDRAIN(); \
13957  DISABLE_RG2_PULLUP(); \
13958  DISABLE_RG2_PULLDOWN(); \
13959  } while (0)
13960 # endif
13961 
13962 /** This macro disables open-drain and pullups/downs,
13963  * configures pin RG2 for digital (not analog) operation, and
13964  * configures the pin as an input.
13965  */
13966 # define CONFIG_RG2_AS_DIG_INPUT() \
13967  do { \
13968  DISABLE_RG2_ANALOG(); \
13969  CONFIG_RG2_AS_INPUT(); \
13970  DISABLE_RG2_OPENDRAIN(); \
13971  DISABLE_RG2_PULLUP(); \
13972  DISABLE_RG2_PULLDOWN(); \
13973  } while (0)
13974 
13975 /** This macro disables open-drain and pullups/downs,
13976  * configures pin RG2 for digital (not analog) operation, and
13977  * configures the pin as an output.
13978  */
13979 # define CONFIG_RG2_AS_DIG_OUTPUT() \
13980  do { \
13981  DISABLE_RG2_ANALOG(); \
13982  CONFIG_RG2_AS_OUTPUT(); \
13983  DISABLE_RG2_OPENDRAIN(); \
13984  DISABLE_RG2_PULLUP(); \
13985  DISABLE_RG2_PULLDOWN(); \
13986  } while (0)
13987 
13988 #endif // #if defined(_RG2) || defined(__DOXYGEN__): Provide GPIO for RG2
13989 
13990 
13991 
13992 
13993 
13994 // Provide GPIO for RG3
13995 // ====================
13996 #if defined(_RG3) || defined(__DOXYGEN__)
13997 
13998 // Dummy macros for documentation only
13999 # ifdef __DOXYGEN__
14000 /// This macro specifies the RPy value associated with pin RG3.
14001 /// Its device-specific definition is given in pic24_ports_mapping.h.
14002 # define RG3_RP xx
14003 
14004 /// This macro specifies the ANn value associated with pin RG3.
14005 /// Its device-specific definition is given in pic24_ports_mapping.h.
14006 # define RG3_AN xx
14007 
14008 /// This macro specifies the CNm value associated with pin RG3.
14009 /// Its device-specific definition is given in pic24_ports_mapping.h.
14010 # define RG3_CN xx
14011 
14012 //@}
14013 # endif // #ifdef __DOXYGEN__
14014 
14015 
14016 // Low-level config
14017 // ----------------
14018 // Analog:
14019 # if defined(_ANSG3) || defined(__DOXYGEN__)
14020 /// Enable analog functionality on pin RG3.
14021 # define ENABLE_RG3_ANALOG() (_ANSG3 = 1)
14022 /// Disable analog functionality on pin RG3.
14023 # define DISABLE_RG3_ANALOG() (_ANSG3 = 0)
14024 # elif defined(RG3_AN)
14025 # define ENABLE_RG3_ANALOG() (RXY_GPIO_PCFG(RG3_AN) = 0)
14026 # define DISABLE_RG3_ANALOG() (RXY_GPIO_PCFG(RG3_AN) = 1)
14027 # else
14028 # define DISABLE_RG3_ANALOG() ((void) 0)
14029 # endif
14030 
14031 // Input/output:
14032 /// Configure pin RG3 as an input.
14033 # define CONFIG_RG3_AS_INPUT() (_TRISG3 = 1)
14034 /// Configure pin RG3 as an output.
14035 # define CONFIG_RG3_AS_OUTPUT() (_TRISG3 = 0)
14036 
14037 // Open-drain:
14038 # if defined(_ODCG3) || defined(__DOXYGEN__)
14039 /// Enable the open-drain driver on pin RG3.
14040 # define ENABLE_RG3_OPENDRAIN() (_ODCG3 = 1)
14041 /// Disable the open-drain driver on pin RG3.
14042 # define DISABLE_RG3_OPENDRAIN() (_ODCG3 = 0)
14043 # elif defined(_ODG3) // The PIF24F names this bit _OD instead of _ODC.
14044 # define ENABLE_RG3_OPENDRAIN() (_ODG3 = 1)
14045 # define DISABLE_RG3_OPENDRAIN() (_ODG3 = 0)
14046 # else
14047 # define DISABLE_RG3_OPENDRAIN() ((void) 0)
14048 # endif
14049 
14050 // Change notification, pullups and pulldowns:
14051 # if defined(_CNIEG3) || defined(__DOXYGEN__)
14052 /// Enable the pullup on pin RG3.
14053 # define ENABLE_RG3_PULLUP() (_CNPUG3 = 1)
14054 /// Disable the pullup on pin RG3.
14055 # define DISABLE_RG3_PULLUP() (_CNPUG3 = 0)
14056 
14057 /// Enable the pulldown on pin RG3.
14058 # define ENABLE_RG3_PULLDOWN() (_CNPDG3 = 1)
14059 /// Disable the pulldown on pin RG3.
14060 # define DISABLE_RG3_PULLDOWN() (_CNPDG3 = 0)
14061 
14062 /// Enable the change notification interrupt on pin RG3.
14063 # define ENABLE_RG3_CN_INTERRUPT() (_CNIEG3 = 1)
14064 /// Disable the change notification interrupt on pin RG3.
14065 # define DISABLE_RG3_CN_INTERRUPT() (_CNIEG3 = 0)
14066 
14067 # elif defined(RG3_CN)
14068 # define ENABLE_RG3_PULLUP() (RXY_GPIO_CNPUE(RG3_CN) = 1)
14069 # define DISABLE_RG3_PULLUP() (RXY_GPIO_CNPUE(RG3_CN) = 0)
14070 
14071 # if RXY_HAS_CNPDE(RG3_CN)
14072 # define ENABLE_RG3_PULLDOWN() (RXY_GPIO_CNPDE(RG3_CN) = 1)
14073 # define DISABLE_RG3_PULLDOWN() (RXY_GPIO_CNPDE(RG3_CN) = 0)
14074 # else
14075 # define DISABLE_RG3_PULLDOWN() ((void) 0)
14076 # endif
14077 
14078 # define ENABLE_RG3_CN_INTERRUPT() (RXY_GPIO_CNIE(RG3_CN) = 1)
14079 # define DISABLE_RG3_CN_INTERRUPT() (RXY_GPIO_CNIE(RG3_CN) = 0)
14080 
14081 # else
14082 # define DISABLE_RG3_PULLUP() ((void) 0)
14083 # define DISABLE_RG3_PULLDOWN() ((void) 0)
14084 # define DISABLE_RG3_CN_INTERRUPT() ((void) 0)
14085 # endif
14086 
14087 // High-level config
14088 // -----------------
14089 /** This macro disables pullups/downs, enables analog functionality, and configures
14090  * pin RG3 as an input.
14091  */
14092 # if defined(_ANSG3) || defined(RG3_AN) || defined(__DOXYGEN__)
14093 # define CONFIG_RG3_AS_ANALOG() \
14094  do { \
14095  ENABLE_RG3_ANALOG(); \
14096  CONFIG_RG3_AS_INPUT(); \
14097  DISABLE_RG3_OPENDRAIN(); \
14098  DISABLE_RG3_PULLUP(); \
14099  DISABLE_RG3_PULLDOWN(); \
14100  } while (0)
14101 # endif
14102 
14103 /** This macro disables open-drain and pullups/downs,
14104  * configures pin RG3 for digital (not analog) operation, and
14105  * configures the pin as an input.
14106  */
14107 # define CONFIG_RG3_AS_DIG_INPUT() \
14108  do { \
14109  DISABLE_RG3_ANALOG(); \
14110  CONFIG_RG3_AS_INPUT(); \
14111  DISABLE_RG3_OPENDRAIN(); \
14112  DISABLE_RG3_PULLUP(); \
14113  DISABLE_RG3_PULLDOWN(); \
14114  } while (0)
14115 
14116 /** This macro disables open-drain and pullups/downs,
14117  * configures pin RG3 for digital (not analog) operation, and
14118  * configures the pin as an output.
14119  */
14120 # define CONFIG_RG3_AS_DIG_OUTPUT() \
14121  do { \
14122  DISABLE_RG3_ANALOG(); \
14123  CONFIG_RG3_AS_OUTPUT(); \
14124  DISABLE_RG3_OPENDRAIN(); \
14125  DISABLE_RG3_PULLUP(); \
14126  DISABLE_RG3_PULLDOWN(); \
14127  } while (0)
14128 
14129 #endif // #if defined(_RG3) || defined(__DOXYGEN__): Provide GPIO for RG3
14130 
14131 
14132 
14133 
14134 
14135 // Provide GPIO for RG4
14136 // ====================
14137 #if defined(_RG4) || defined(__DOXYGEN__)
14138 
14139 // Dummy macros for documentation only
14140 # ifdef __DOXYGEN__
14141 /// This macro specifies the RPy value associated with pin RG4.
14142 /// Its device-specific definition is given in pic24_ports_mapping.h.
14143 # define RG4_RP xx
14144 
14145 /// This macro specifies the ANn value associated with pin RG4.
14146 /// Its device-specific definition is given in pic24_ports_mapping.h.
14147 # define RG4_AN xx
14148 
14149 /// This macro specifies the CNm value associated with pin RG4.
14150 /// Its device-specific definition is given in pic24_ports_mapping.h.
14151 # define RG4_CN xx
14152 
14153 //@}
14154 # endif // #ifdef __DOXYGEN__
14155 
14156 
14157 // Low-level config
14158 // ----------------
14159 // Analog:
14160 # if defined(_ANSG4) || defined(__DOXYGEN__)
14161 /// Enable analog functionality on pin RG4.
14162 # define ENABLE_RG4_ANALOG() (_ANSG4 = 1)
14163 /// Disable analog functionality on pin RG4.
14164 # define DISABLE_RG4_ANALOG() (_ANSG4 = 0)
14165 # elif defined(RG4_AN)
14166 # define ENABLE_RG4_ANALOG() (RXY_GPIO_PCFG(RG4_AN) = 0)
14167 # define DISABLE_RG4_ANALOG() (RXY_GPIO_PCFG(RG4_AN) = 1)
14168 # else
14169 # define DISABLE_RG4_ANALOG() ((void) 0)
14170 # endif
14171 
14172 // Input/output:
14173 /// Configure pin RG4 as an input.
14174 # define CONFIG_RG4_AS_INPUT() (_TRISG4 = 1)
14175 /// Configure pin RG4 as an output.
14176 # define CONFIG_RG4_AS_OUTPUT() (_TRISG4 = 0)
14177 
14178 // Open-drain:
14179 # if defined(_ODCG4) || defined(__DOXYGEN__)
14180 /// Enable the open-drain driver on pin RG4.
14181 # define ENABLE_RG4_OPENDRAIN() (_ODCG4 = 1)
14182 /// Disable the open-drain driver on pin RG4.
14183 # define DISABLE_RG4_OPENDRAIN() (_ODCG4 = 0)
14184 # elif defined(_ODG4) // The PIF24F names this bit _OD instead of _ODC.
14185 # define ENABLE_RG4_OPENDRAIN() (_ODG4 = 1)
14186 # define DISABLE_RG4_OPENDRAIN() (_ODG4 = 0)
14187 # else
14188 # define DISABLE_RG4_OPENDRAIN() ((void) 0)
14189 # endif
14190 
14191 // Change notification, pullups and pulldowns:
14192 # if defined(_CNIEG4) || defined(__DOXYGEN__)
14193 /// Enable the pullup on pin RG4.
14194 # define ENABLE_RG4_PULLUP() (_CNPUG4 = 1)
14195 /// Disable the pullup on pin RG4.
14196 # define DISABLE_RG4_PULLUP() (_CNPUG4 = 0)
14197 
14198 /// Enable the pulldown on pin RG4.
14199 # define ENABLE_RG4_PULLDOWN() (_CNPDG4 = 1)
14200 /// Disable the pulldown on pin RG4.
14201 # define DISABLE_RG4_PULLDOWN() (_CNPDG4 = 0)
14202 
14203 /// Enable the change notification interrupt on pin RG4.
14204 # define ENABLE_RG4_CN_INTERRUPT() (_CNIEG4 = 1)
14205 /// Disable the change notification interrupt on pin RG4.
14206 # define DISABLE_RG4_CN_INTERRUPT() (_CNIEG4 = 0)
14207 
14208 # elif defined(RG4_CN)
14209 # define ENABLE_RG4_PULLUP() (RXY_GPIO_CNPUE(RG4_CN) = 1)
14210 # define DISABLE_RG4_PULLUP() (RXY_GPIO_CNPUE(RG4_CN) = 0)
14211 
14212 # if RXY_HAS_CNPDE(RG4_CN)
14213 # define ENABLE_RG4_PULLDOWN() (RXY_GPIO_CNPDE(RG4_CN) = 1)
14214 # define DISABLE_RG4_PULLDOWN() (RXY_GPIO_CNPDE(RG4_CN) = 0)
14215 # else
14216 # define DISABLE_RG4_PULLDOWN() ((void) 0)
14217 # endif
14218 
14219 # define ENABLE_RG4_CN_INTERRUPT() (RXY_GPIO_CNIE(RG4_CN) = 1)
14220 # define DISABLE_RG4_CN_INTERRUPT() (RXY_GPIO_CNIE(RG4_CN) = 0)
14221 
14222 # else
14223 # define DISABLE_RG4_PULLUP() ((void) 0)
14224 # define DISABLE_RG4_PULLDOWN() ((void) 0)
14225 # define DISABLE_RG4_CN_INTERRUPT() ((void) 0)
14226 # endif
14227 
14228 // High-level config
14229 // -----------------
14230 /** This macro disables pullups/downs, enables analog functionality, and configures
14231  * pin RG4 as an input.
14232  */
14233 # if defined(_ANSG4) || defined(RG4_AN) || defined(__DOXYGEN__)
14234 # define CONFIG_RG4_AS_ANALOG() \
14235  do { \
14236  ENABLE_RG4_ANALOG(); \
14237  CONFIG_RG4_AS_INPUT(); \
14238  DISABLE_RG4_OPENDRAIN(); \
14239  DISABLE_RG4_PULLUP(); \
14240  DISABLE_RG4_PULLDOWN(); \
14241  } while (0)
14242 # endif
14243 
14244 /** This macro disables open-drain and pullups/downs,
14245  * configures pin RG4 for digital (not analog) operation, and
14246  * configures the pin as an input.
14247  */
14248 # define CONFIG_RG4_AS_DIG_INPUT() \
14249  do { \
14250  DISABLE_RG4_ANALOG(); \
14251  CONFIG_RG4_AS_INPUT(); \
14252  DISABLE_RG4_OPENDRAIN(); \
14253  DISABLE_RG4_PULLUP(); \
14254  DISABLE_RG4_PULLDOWN(); \
14255  } while (0)
14256 
14257 /** This macro disables open-drain and pullups/downs,
14258  * configures pin RG4 for digital (not analog) operation, and
14259  * configures the pin as an output.
14260  */
14261 # define CONFIG_RG4_AS_DIG_OUTPUT() \
14262  do { \
14263  DISABLE_RG4_ANALOG(); \
14264  CONFIG_RG4_AS_OUTPUT(); \
14265  DISABLE_RG4_OPENDRAIN(); \
14266  DISABLE_RG4_PULLUP(); \
14267  DISABLE_RG4_PULLDOWN(); \
14268  } while (0)
14269 
14270 #endif // #if defined(_RG4) || defined(__DOXYGEN__): Provide GPIO for RG4
14271 
14272 
14273 
14274 
14275 
14276 // Provide GPIO for RG5
14277 // ====================
14278 #if defined(_RG5) || defined(__DOXYGEN__)
14279 
14280 // Dummy macros for documentation only
14281 # ifdef __DOXYGEN__
14282 /// This macro specifies the RPy value associated with pin RG5.
14283 /// Its device-specific definition is given in pic24_ports_mapping.h.
14284 # define RG5_RP xx
14285 
14286 /// This macro specifies the ANn value associated with pin RG5.
14287 /// Its device-specific definition is given in pic24_ports_mapping.h.
14288 # define RG5_AN xx
14289 
14290 /// This macro specifies the CNm value associated with pin RG5.
14291 /// Its device-specific definition is given in pic24_ports_mapping.h.
14292 # define RG5_CN xx
14293 
14294 //@}
14295 # endif // #ifdef __DOXYGEN__
14296 
14297 
14298 // Low-level config
14299 // ----------------
14300 // Analog:
14301 # if defined(_ANSG5) || defined(__DOXYGEN__)
14302 /// Enable analog functionality on pin RG5.
14303 # define ENABLE_RG5_ANALOG() (_ANSG5 = 1)
14304 /// Disable analog functionality on pin RG5.
14305 # define DISABLE_RG5_ANALOG() (_ANSG5 = 0)
14306 # elif defined(RG5_AN)
14307 # define ENABLE_RG5_ANALOG() (RXY_GPIO_PCFG(RG5_AN) = 0)
14308 # define DISABLE_RG5_ANALOG() (RXY_GPIO_PCFG(RG5_AN) = 1)
14309 # else
14310 # define DISABLE_RG5_ANALOG() ((void) 0)
14311 # endif
14312 
14313 // Input/output:
14314 /// Configure pin RG5 as an input.
14315 # define CONFIG_RG5_AS_INPUT() (_TRISG5 = 1)
14316 /// Configure pin RG5 as an output.
14317 # define CONFIG_RG5_AS_OUTPUT() (_TRISG5 = 0)
14318 
14319 // Open-drain:
14320 # if defined(_ODCG5) || defined(__DOXYGEN__)
14321 /// Enable the open-drain driver on pin RG5.
14322 # define ENABLE_RG5_OPENDRAIN() (_ODCG5 = 1)
14323 /// Disable the open-drain driver on pin RG5.
14324 # define DISABLE_RG5_OPENDRAIN() (_ODCG5 = 0)
14325 # elif defined(_ODG5) // The PIF24F names this bit _OD instead of _ODC.
14326 # define ENABLE_RG5_OPENDRAIN() (_ODG5 = 1)
14327 # define DISABLE_RG5_OPENDRAIN() (_ODG5 = 0)
14328 # else
14329 # define DISABLE_RG5_OPENDRAIN() ((void) 0)
14330 # endif
14331 
14332 // Change notification, pullups and pulldowns:
14333 # if defined(_CNIEG5) || defined(__DOXYGEN__)
14334 /// Enable the pullup on pin RG5.
14335 # define ENABLE_RG5_PULLUP() (_CNPUG5 = 1)
14336 /// Disable the pullup on pin RG5.
14337 # define DISABLE_RG5_PULLUP() (_CNPUG5 = 0)
14338 
14339 /// Enable the pulldown on pin RG5.
14340 # define ENABLE_RG5_PULLDOWN() (_CNPDG5 = 1)
14341 /// Disable the pulldown on pin RG5.
14342 # define DISABLE_RG5_PULLDOWN() (_CNPDG5 = 0)
14343 
14344 /// Enable the change notification interrupt on pin RG5.
14345 # define ENABLE_RG5_CN_INTERRUPT() (_CNIEG5 = 1)
14346 /// Disable the change notification interrupt on pin RG5.
14347 # define DISABLE_RG5_CN_INTERRUPT() (_CNIEG5 = 0)
14348 
14349 # elif defined(RG5_CN)
14350 # define ENABLE_RG5_PULLUP() (RXY_GPIO_CNPUE(RG5_CN) = 1)
14351 # define DISABLE_RG5_PULLUP() (RXY_GPIO_CNPUE(RG5_CN) = 0)
14352 
14353 # if RXY_HAS_CNPDE(RG5_CN)
14354 # define ENABLE_RG5_PULLDOWN() (RXY_GPIO_CNPDE(RG5_CN) = 1)
14355 # define DISABLE_RG5_PULLDOWN() (RXY_GPIO_CNPDE(RG5_CN) = 0)
14356 # else
14357 # define DISABLE_RG5_PULLDOWN() ((void) 0)
14358 # endif
14359 
14360 # define ENABLE_RG5_CN_INTERRUPT() (RXY_GPIO_CNIE(RG5_CN) = 1)
14361 # define DISABLE_RG5_CN_INTERRUPT() (RXY_GPIO_CNIE(RG5_CN) = 0)
14362 
14363 # else
14364 # define DISABLE_RG5_PULLUP() ((void) 0)
14365 # define DISABLE_RG5_PULLDOWN() ((void) 0)
14366 # define DISABLE_RG5_CN_INTERRUPT() ((void) 0)
14367 # endif
14368 
14369 // High-level config
14370 // -----------------
14371 /** This macro disables pullups/downs, enables analog functionality, and configures
14372  * pin RG5 as an input.
14373  */
14374 # if defined(_ANSG5) || defined(RG5_AN) || defined(__DOXYGEN__)
14375 # define CONFIG_RG5_AS_ANALOG() \
14376  do { \
14377  ENABLE_RG5_ANALOG(); \
14378  CONFIG_RG5_AS_INPUT(); \
14379  DISABLE_RG5_OPENDRAIN(); \
14380  DISABLE_RG5_PULLUP(); \
14381  DISABLE_RG5_PULLDOWN(); \
14382  } while (0)
14383 # endif
14384 
14385 /** This macro disables open-drain and pullups/downs,
14386  * configures pin RG5 for digital (not analog) operation, and
14387  * configures the pin as an input.
14388  */
14389 # define CONFIG_RG5_AS_DIG_INPUT() \
14390  do { \
14391  DISABLE_RG5_ANALOG(); \
14392  CONFIG_RG5_AS_INPUT(); \
14393  DISABLE_RG5_OPENDRAIN(); \
14394  DISABLE_RG5_PULLUP(); \
14395  DISABLE_RG5_PULLDOWN(); \
14396  } while (0)
14397 
14398 /** This macro disables open-drain and pullups/downs,
14399  * configures pin RG5 for digital (not analog) operation, and
14400  * configures the pin as an output.
14401  */
14402 # define CONFIG_RG5_AS_DIG_OUTPUT() \
14403  do { \
14404  DISABLE_RG5_ANALOG(); \
14405  CONFIG_RG5_AS_OUTPUT(); \
14406  DISABLE_RG5_OPENDRAIN(); \
14407  DISABLE_RG5_PULLUP(); \
14408  DISABLE_RG5_PULLDOWN(); \
14409  } while (0)
14410 
14411 #endif // #if defined(_RG5) || defined(__DOXYGEN__): Provide GPIO for RG5
14412 
14413 
14414 
14415 
14416 
14417 // Provide GPIO for RG6
14418 // ====================
14419 #if defined(_RG6) || defined(__DOXYGEN__)
14420 
14421 // Dummy macros for documentation only
14422 # ifdef __DOXYGEN__
14423 /// This macro specifies the RPy value associated with pin RG6.
14424 /// Its device-specific definition is given in pic24_ports_mapping.h.
14425 # define RG6_RP xx
14426 
14427 /// This macro specifies the ANn value associated with pin RG6.
14428 /// Its device-specific definition is given in pic24_ports_mapping.h.
14429 # define RG6_AN xx
14430 
14431 /// This macro specifies the CNm value associated with pin RG6.
14432 /// Its device-specific definition is given in pic24_ports_mapping.h.
14433 # define RG6_CN xx
14434 
14435 //@}
14436 # endif // #ifdef __DOXYGEN__
14437 
14438 
14439 // Low-level config
14440 // ----------------
14441 // Analog:
14442 # if defined(_ANSG6) || defined(__DOXYGEN__)
14443 /// Enable analog functionality on pin RG6.
14444 # define ENABLE_RG6_ANALOG() (_ANSG6 = 1)
14445 /// Disable analog functionality on pin RG6.
14446 # define DISABLE_RG6_ANALOG() (_ANSG6 = 0)
14447 # elif defined(RG6_AN)
14448 # define ENABLE_RG6_ANALOG() (RXY_GPIO_PCFG(RG6_AN) = 0)
14449 # define DISABLE_RG6_ANALOG() (RXY_GPIO_PCFG(RG6_AN) = 1)
14450 # else
14451 # define DISABLE_RG6_ANALOG() ((void) 0)
14452 # endif
14453 
14454 // Input/output:
14455 /// Configure pin RG6 as an input.
14456 # define CONFIG_RG6_AS_INPUT() (_TRISG6 = 1)
14457 /// Configure pin RG6 as an output.
14458 # define CONFIG_RG6_AS_OUTPUT() (_TRISG6 = 0)
14459 
14460 // Open-drain:
14461 # if defined(_ODCG6) || defined(__DOXYGEN__)
14462 /// Enable the open-drain driver on pin RG6.
14463 # define ENABLE_RG6_OPENDRAIN() (_ODCG6 = 1)
14464 /// Disable the open-drain driver on pin RG6.
14465 # define DISABLE_RG6_OPENDRAIN() (_ODCG6 = 0)
14466 # elif defined(_ODG6) // The PIF24F names this bit _OD instead of _ODC.
14467 # define ENABLE_RG6_OPENDRAIN() (_ODG6 = 1)
14468 # define DISABLE_RG6_OPENDRAIN() (_ODG6 = 0)
14469 # else
14470 # define DISABLE_RG6_OPENDRAIN() ((void) 0)
14471 # endif
14472 
14473 // Change notification, pullups and pulldowns:
14474 # if defined(_CNIEG6) || defined(__DOXYGEN__)
14475 /// Enable the pullup on pin RG6.
14476 # define ENABLE_RG6_PULLUP() (_CNPUG6 = 1)
14477 /// Disable the pullup on pin RG6.
14478 # define DISABLE_RG6_PULLUP() (_CNPUG6 = 0)
14479 
14480 /// Enable the pulldown on pin RG6.
14481 # define ENABLE_RG6_PULLDOWN() (_CNPDG6 = 1)
14482 /// Disable the pulldown on pin RG6.
14483 # define DISABLE_RG6_PULLDOWN() (_CNPDG6 = 0)
14484 
14485 /// Enable the change notification interrupt on pin RG6.
14486 # define ENABLE_RG6_CN_INTERRUPT() (_CNIEG6 = 1)
14487 /// Disable the change notification interrupt on pin RG6.
14488 # define DISABLE_RG6_CN_INTERRUPT() (_CNIEG6 = 0)
14489 
14490 # elif defined(RG6_CN)
14491 # define ENABLE_RG6_PULLUP() (RXY_GPIO_CNPUE(RG6_CN) = 1)
14492 # define DISABLE_RG6_PULLUP() (RXY_GPIO_CNPUE(RG6_CN) = 0)
14493 
14494 # if RXY_HAS_CNPDE(RG6_CN)
14495 # define ENABLE_RG6_PULLDOWN() (RXY_GPIO_CNPDE(RG6_CN) = 1)
14496 # define DISABLE_RG6_PULLDOWN() (RXY_GPIO_CNPDE(RG6_CN) = 0)
14497 # else
14498 # define DISABLE_RG6_PULLDOWN() ((void) 0)
14499 # endif
14500 
14501 # define ENABLE_RG6_CN_INTERRUPT() (RXY_GPIO_CNIE(RG6_CN) = 1)
14502 # define DISABLE_RG6_CN_INTERRUPT() (RXY_GPIO_CNIE(RG6_CN) = 0)
14503 
14504 # else
14505 # define DISABLE_RG6_PULLUP() ((void) 0)
14506 # define DISABLE_RG6_PULLDOWN() ((void) 0)
14507 # define DISABLE_RG6_CN_INTERRUPT() ((void) 0)
14508 # endif
14509 
14510 // High-level config
14511 // -----------------
14512 /** This macro disables pullups/downs, enables analog functionality, and configures
14513  * pin RG6 as an input.
14514  */
14515 # if defined(_ANSG6) || defined(RG6_AN) || defined(__DOXYGEN__)
14516 # define CONFIG_RG6_AS_ANALOG() \
14517  do { \
14518  ENABLE_RG6_ANALOG(); \
14519  CONFIG_RG6_AS_INPUT(); \
14520  DISABLE_RG6_OPENDRAIN(); \
14521  DISABLE_RG6_PULLUP(); \
14522  DISABLE_RG6_PULLDOWN(); \
14523  } while (0)
14524 # endif
14525 
14526 /** This macro disables open-drain and pullups/downs,
14527  * configures pin RG6 for digital (not analog) operation, and
14528  * configures the pin as an input.
14529  */
14530 # define CONFIG_RG6_AS_DIG_INPUT() \
14531  do { \
14532  DISABLE_RG6_ANALOG(); \
14533  CONFIG_RG6_AS_INPUT(); \
14534  DISABLE_RG6_OPENDRAIN(); \
14535  DISABLE_RG6_PULLUP(); \
14536  DISABLE_RG6_PULLDOWN(); \
14537  } while (0)
14538 
14539 /** This macro disables open-drain and pullups/downs,
14540  * configures pin RG6 for digital (not analog) operation, and
14541  * configures the pin as an output.
14542  */
14543 # define CONFIG_RG6_AS_DIG_OUTPUT() \
14544  do { \
14545  DISABLE_RG6_ANALOG(); \
14546  CONFIG_RG6_AS_OUTPUT(); \
14547  DISABLE_RG6_OPENDRAIN(); \
14548  DISABLE_RG6_PULLUP(); \
14549  DISABLE_RG6_PULLDOWN(); \
14550  } while (0)
14551 
14552 #endif // #if defined(_RG6) || defined(__DOXYGEN__): Provide GPIO for RG6
14553 
14554 
14555 
14556 
14557 
14558 // Provide GPIO for RG7
14559 // ====================
14560 #if defined(_RG7) || defined(__DOXYGEN__)
14561 
14562 // Dummy macros for documentation only
14563 # ifdef __DOXYGEN__
14564 /// This macro specifies the RPy value associated with pin RG7.
14565 /// Its device-specific definition is given in pic24_ports_mapping.h.
14566 # define RG7_RP xx
14567 
14568 /// This macro specifies the ANn value associated with pin RG7.
14569 /// Its device-specific definition is given in pic24_ports_mapping.h.
14570 # define RG7_AN xx
14571 
14572 /// This macro specifies the CNm value associated with pin RG7.
14573 /// Its device-specific definition is given in pic24_ports_mapping.h.
14574 # define RG7_CN xx
14575 
14576 //@}
14577 # endif // #ifdef __DOXYGEN__
14578 
14579 
14580 // Low-level config
14581 // ----------------
14582 // Analog:
14583 # if defined(_ANSG7) || defined(__DOXYGEN__)
14584 /// Enable analog functionality on pin RG7.
14585 # define ENABLE_RG7_ANALOG() (_ANSG7 = 1)
14586 /// Disable analog functionality on pin RG7.
14587 # define DISABLE_RG7_ANALOG() (_ANSG7 = 0)
14588 # elif defined(RG7_AN)
14589 # define ENABLE_RG7_ANALOG() (RXY_GPIO_PCFG(RG7_AN) = 0)
14590 # define DISABLE_RG7_ANALOG() (RXY_GPIO_PCFG(RG7_AN) = 1)
14591 # else
14592 # define DISABLE_RG7_ANALOG() ((void) 0)
14593 # endif
14594 
14595 // Input/output:
14596 /// Configure pin RG7 as an input.
14597 # define CONFIG_RG7_AS_INPUT() (_TRISG7 = 1)
14598 /// Configure pin RG7 as an output.
14599 # define CONFIG_RG7_AS_OUTPUT() (_TRISG7 = 0)
14600 
14601 // Open-drain:
14602 # if defined(_ODCG7) || defined(__DOXYGEN__)
14603 /// Enable the open-drain driver on pin RG7.
14604 # define ENABLE_RG7_OPENDRAIN() (_ODCG7 = 1)
14605 /// Disable the open-drain driver on pin RG7.
14606 # define DISABLE_RG7_OPENDRAIN() (_ODCG7 = 0)
14607 # elif defined(_ODG7) // The PIF24F names this bit _OD instead of _ODC.
14608 # define ENABLE_RG7_OPENDRAIN() (_ODG7 = 1)
14609 # define DISABLE_RG7_OPENDRAIN() (_ODG7 = 0)
14610 # else
14611 # define DISABLE_RG7_OPENDRAIN() ((void) 0)
14612 # endif
14613 
14614 // Change notification, pullups and pulldowns:
14615 # if defined(_CNIEG7) || defined(__DOXYGEN__)
14616 /// Enable the pullup on pin RG7.
14617 # define ENABLE_RG7_PULLUP() (_CNPUG7 = 1)
14618 /// Disable the pullup on pin RG7.
14619 # define DISABLE_RG7_PULLUP() (_CNPUG7 = 0)
14620 
14621 /// Enable the pulldown on pin RG7.
14622 # define ENABLE_RG7_PULLDOWN() (_CNPDG7 = 1)
14623 /// Disable the pulldown on pin RG7.
14624 # define DISABLE_RG7_PULLDOWN() (_CNPDG7 = 0)
14625 
14626 /// Enable the change notification interrupt on pin RG7.
14627 # define ENABLE_RG7_CN_INTERRUPT() (_CNIEG7 = 1)
14628 /// Disable the change notification interrupt on pin RG7.
14629 # define DISABLE_RG7_CN_INTERRUPT() (_CNIEG7 = 0)
14630 
14631 # elif defined(RG7_CN)
14632 # define ENABLE_RG7_PULLUP() (RXY_GPIO_CNPUE(RG7_CN) = 1)
14633 # define DISABLE_RG7_PULLUP() (RXY_GPIO_CNPUE(RG7_CN) = 0)
14634 
14635 # if RXY_HAS_CNPDE(RG7_CN)
14636 # define ENABLE_RG7_PULLDOWN() (RXY_GPIO_CNPDE(RG7_CN) = 1)
14637 # define DISABLE_RG7_PULLDOWN() (RXY_GPIO_CNPDE(RG7_CN) = 0)
14638 # else
14639 # define DISABLE_RG7_PULLDOWN() ((void) 0)
14640 # endif
14641 
14642 # define ENABLE_RG7_CN_INTERRUPT() (RXY_GPIO_CNIE(RG7_CN) = 1)
14643 # define DISABLE_RG7_CN_INTERRUPT() (RXY_GPIO_CNIE(RG7_CN) = 0)
14644 
14645 # else
14646 # define DISABLE_RG7_PULLUP() ((void) 0)
14647 # define DISABLE_RG7_PULLDOWN() ((void) 0)
14648 # define DISABLE_RG7_CN_INTERRUPT() ((void) 0)
14649 # endif
14650 
14651 // High-level config
14652 // -----------------
14653 /** This macro disables pullups/downs, enables analog functionality, and configures
14654  * pin RG7 as an input.
14655  */
14656 # if defined(_ANSG7) || defined(RG7_AN) || defined(__DOXYGEN__)
14657 # define CONFIG_RG7_AS_ANALOG() \
14658  do { \
14659  ENABLE_RG7_ANALOG(); \
14660  CONFIG_RG7_AS_INPUT(); \
14661  DISABLE_RG7_OPENDRAIN(); \
14662  DISABLE_RG7_PULLUP(); \
14663  DISABLE_RG7_PULLDOWN(); \
14664  } while (0)
14665 # endif
14666 
14667 /** This macro disables open-drain and pullups/downs,
14668  * configures pin RG7 for digital (not analog) operation, and
14669  * configures the pin as an input.
14670  */
14671 # define CONFIG_RG7_AS_DIG_INPUT() \
14672  do { \
14673  DISABLE_RG7_ANALOG(); \
14674  CONFIG_RG7_AS_INPUT(); \
14675  DISABLE_RG7_OPENDRAIN(); \
14676  DISABLE_RG7_PULLUP(); \
14677  DISABLE_RG7_PULLDOWN(); \
14678  } while (0)
14679 
14680 /** This macro disables open-drain and pullups/downs,
14681  * configures pin RG7 for digital (not analog) operation, and
14682  * configures the pin as an output.
14683  */
14684 # define CONFIG_RG7_AS_DIG_OUTPUT() \
14685  do { \
14686  DISABLE_RG7_ANALOG(); \
14687  CONFIG_RG7_AS_OUTPUT(); \
14688  DISABLE_RG7_OPENDRAIN(); \
14689  DISABLE_RG7_PULLUP(); \
14690  DISABLE_RG7_PULLDOWN(); \
14691  } while (0)
14692 
14693 #endif // #if defined(_RG7) || defined(__DOXYGEN__): Provide GPIO for RG7
14694 
14695 
14696 
14697 
14698 
14699 // Provide GPIO for RG8
14700 // ====================
14701 #if defined(_RG8) || defined(__DOXYGEN__)
14702 
14703 // Dummy macros for documentation only
14704 # ifdef __DOXYGEN__
14705 /// This macro specifies the RPy value associated with pin RG8.
14706 /// Its device-specific definition is given in pic24_ports_mapping.h.
14707 # define RG8_RP xx
14708 
14709 /// This macro specifies the ANn value associated with pin RG8.
14710 /// Its device-specific definition is given in pic24_ports_mapping.h.
14711 # define RG8_AN xx
14712 
14713 /// This macro specifies the CNm value associated with pin RG8.
14714 /// Its device-specific definition is given in pic24_ports_mapping.h.
14715 # define RG8_CN xx
14716 
14717 //@}
14718 # endif // #ifdef __DOXYGEN__
14719 
14720 
14721 // Low-level config
14722 // ----------------
14723 // Analog:
14724 # if defined(_ANSG8) || defined(__DOXYGEN__)
14725 /// Enable analog functionality on pin RG8.
14726 # define ENABLE_RG8_ANALOG() (_ANSG8 = 1)
14727 /// Disable analog functionality on pin RG8.
14728 # define DISABLE_RG8_ANALOG() (_ANSG8 = 0)
14729 # elif defined(RG8_AN)
14730 # define ENABLE_RG8_ANALOG() (RXY_GPIO_PCFG(RG8_AN) = 0)
14731 # define DISABLE_RG8_ANALOG() (RXY_GPIO_PCFG(RG8_AN) = 1)
14732 # else
14733 # define DISABLE_RG8_ANALOG() ((void) 0)
14734 # endif
14735 
14736 // Input/output:
14737 /// Configure pin RG8 as an input.
14738 # define CONFIG_RG8_AS_INPUT() (_TRISG8 = 1)
14739 /// Configure pin RG8 as an output.
14740 # define CONFIG_RG8_AS_OUTPUT() (_TRISG8 = 0)
14741 
14742 // Open-drain:
14743 # if defined(_ODCG8) || defined(__DOXYGEN__)
14744 /// Enable the open-drain driver on pin RG8.
14745 # define ENABLE_RG8_OPENDRAIN() (_ODCG8 = 1)
14746 /// Disable the open-drain driver on pin RG8.
14747 # define DISABLE_RG8_OPENDRAIN() (_ODCG8 = 0)
14748 # elif defined(_ODG8) // The PIF24F names this bit _OD instead of _ODC.
14749 # define ENABLE_RG8_OPENDRAIN() (_ODG8 = 1)
14750 # define DISABLE_RG8_OPENDRAIN() (_ODG8 = 0)
14751 # else
14752 # define DISABLE_RG8_OPENDRAIN() ((void) 0)
14753 # endif
14754 
14755 // Change notification, pullups and pulldowns:
14756 # if defined(_CNIEG8) || defined(__DOXYGEN__)
14757 /// Enable the pullup on pin RG8.
14758 # define ENABLE_RG8_PULLUP() (_CNPUG8 = 1)
14759 /// Disable the pullup on pin RG8.
14760 # define DISABLE_RG8_PULLUP() (_CNPUG8 = 0)
14761 
14762 /// Enable the pulldown on pin RG8.
14763 # define ENABLE_RG8_PULLDOWN() (_CNPDG8 = 1)
14764 /// Disable the pulldown on pin RG8.
14765 # define DISABLE_RG8_PULLDOWN() (_CNPDG8 = 0)
14766 
14767 /// Enable the change notification interrupt on pin RG8.
14768 # define ENABLE_RG8_CN_INTERRUPT() (_CNIEG8 = 1)
14769 /// Disable the change notification interrupt on pin RG8.
14770 # define DISABLE_RG8_CN_INTERRUPT() (_CNIEG8 = 0)
14771 
14772 # elif defined(RG8_CN)
14773 # define ENABLE_RG8_PULLUP() (RXY_GPIO_CNPUE(RG8_CN) = 1)
14774 # define DISABLE_RG8_PULLUP() (RXY_GPIO_CNPUE(RG8_CN) = 0)
14775 
14776 # if RXY_HAS_CNPDE(RG8_CN)
14777 # define ENABLE_RG8_PULLDOWN() (RXY_GPIO_CNPDE(RG8_CN) = 1)
14778 # define DISABLE_RG8_PULLDOWN() (RXY_GPIO_CNPDE(RG8_CN) = 0)
14779 # else
14780 # define DISABLE_RG8_PULLDOWN() ((void) 0)
14781 # endif
14782 
14783 # define ENABLE_RG8_CN_INTERRUPT() (RXY_GPIO_CNIE(RG8_CN) = 1)
14784 # define DISABLE_RG8_CN_INTERRUPT() (RXY_GPIO_CNIE(RG8_CN) = 0)
14785 
14786 # else
14787 # define DISABLE_RG8_PULLUP() ((void) 0)
14788 # define DISABLE_RG8_PULLDOWN() ((void) 0)
14789 # define DISABLE_RG8_CN_INTERRUPT() ((void) 0)
14790 # endif
14791 
14792 // High-level config
14793 // -----------------
14794 /** This macro disables pullups/downs, enables analog functionality, and configures
14795  * pin RG8 as an input.
14796  */
14797 # if defined(_ANSG8) || defined(RG8_AN) || defined(__DOXYGEN__)
14798 # define CONFIG_RG8_AS_ANALOG() \
14799  do { \
14800  ENABLE_RG8_ANALOG(); \
14801  CONFIG_RG8_AS_INPUT(); \
14802  DISABLE_RG8_OPENDRAIN(); \
14803  DISABLE_RG8_PULLUP(); \
14804  DISABLE_RG8_PULLDOWN(); \
14805  } while (0)
14806 # endif
14807 
14808 /** This macro disables open-drain and pullups/downs,
14809  * configures pin RG8 for digital (not analog) operation, and
14810  * configures the pin as an input.
14811  */
14812 # define CONFIG_RG8_AS_DIG_INPUT() \
14813  do { \
14814  DISABLE_RG8_ANALOG(); \
14815  CONFIG_RG8_AS_INPUT(); \
14816  DISABLE_RG8_OPENDRAIN(); \
14817  DISABLE_RG8_PULLUP(); \
14818  DISABLE_RG8_PULLDOWN(); \
14819  } while (0)
14820 
14821 /** This macro disables open-drain and pullups/downs,
14822  * configures pin RG8 for digital (not analog) operation, and
14823  * configures the pin as an output.
14824  */
14825 # define CONFIG_RG8_AS_DIG_OUTPUT() \
14826  do { \
14827  DISABLE_RG8_ANALOG(); \
14828  CONFIG_RG8_AS_OUTPUT(); \
14829  DISABLE_RG8_OPENDRAIN(); \
14830  DISABLE_RG8_PULLUP(); \
14831  DISABLE_RG8_PULLDOWN(); \
14832  } while (0)
14833 
14834 #endif // #if defined(_RG8) || defined(__DOXYGEN__): Provide GPIO for RG8
14835 
14836 
14837 
14838 
14839 
14840 // Provide GPIO for RG9
14841 // ====================
14842 #if defined(_RG9) || defined(__DOXYGEN__)
14843 
14844 // Dummy macros for documentation only
14845 # ifdef __DOXYGEN__
14846 /// This macro specifies the RPy value associated with pin RG9.
14847 /// Its device-specific definition is given in pic24_ports_mapping.h.
14848 # define RG9_RP xx
14849 
14850 /// This macro specifies the ANn value associated with pin RG9.
14851 /// Its device-specific definition is given in pic24_ports_mapping.h.
14852 # define RG9_AN xx
14853 
14854 /// This macro specifies the CNm value associated with pin RG9.
14855 /// Its device-specific definition is given in pic24_ports_mapping.h.
14856 # define RG9_CN xx
14857 
14858 //@}
14859 # endif // #ifdef __DOXYGEN__
14860 
14861 
14862 // Low-level config
14863 // ----------------
14864 // Analog:
14865 # if defined(_ANSG9) || defined(__DOXYGEN__)
14866 /// Enable analog functionality on pin RG9.
14867 # define ENABLE_RG9_ANALOG() (_ANSG9 = 1)
14868 /// Disable analog functionality on pin RG9.
14869 # define DISABLE_RG9_ANALOG() (_ANSG9 = 0)
14870 # elif defined(RG9_AN)
14871 # define ENABLE_RG9_ANALOG() (RXY_GPIO_PCFG(RG9_AN) = 0)
14872 # define DISABLE_RG9_ANALOG() (RXY_GPIO_PCFG(RG9_AN) = 1)
14873 # else
14874 # define DISABLE_RG9_ANALOG() ((void) 0)
14875 # endif
14876 
14877 // Input/output:
14878 /// Configure pin RG9 as an input.
14879 # define CONFIG_RG9_AS_INPUT() (_TRISG9 = 1)
14880 /// Configure pin RG9 as an output.
14881 # define CONFIG_RG9_AS_OUTPUT() (_TRISG9 = 0)
14882 
14883 // Open-drain:
14884 # if defined(_ODCG9) || defined(__DOXYGEN__)
14885 /// Enable the open-drain driver on pin RG9.
14886 # define ENABLE_RG9_OPENDRAIN() (_ODCG9 = 1)
14887 /// Disable the open-drain driver on pin RG9.
14888 # define DISABLE_RG9_OPENDRAIN() (_ODCG9 = 0)
14889 # elif defined(_ODG9) // The PIF24F names this bit _OD instead of _ODC.
14890 # define ENABLE_RG9_OPENDRAIN() (_ODG9 = 1)
14891 # define DISABLE_RG9_OPENDRAIN() (_ODG9 = 0)
14892 # else
14893 # define DISABLE_RG9_OPENDRAIN() ((void) 0)
14894 # endif
14895 
14896 // Change notification, pullups and pulldowns:
14897 # if defined(_CNIEG9) || defined(__DOXYGEN__)
14898 /// Enable the pullup on pin RG9.
14899 # define ENABLE_RG9_PULLUP() (_CNPUG9 = 1)
14900 /// Disable the pullup on pin RG9.
14901 # define DISABLE_RG9_PULLUP() (_CNPUG9 = 0)
14902 
14903 /// Enable the pulldown on pin RG9.
14904 # define ENABLE_RG9_PULLDOWN() (_CNPDG9 = 1)
14905 /// Disable the pulldown on pin RG9.
14906 # define DISABLE_RG9_PULLDOWN() (_CNPDG9 = 0)
14907 
14908 /// Enable the change notification interrupt on pin RG9.
14909 # define ENABLE_RG9_CN_INTERRUPT() (_CNIEG9 = 1)
14910 /// Disable the change notification interrupt on pin RG9.
14911 # define DISABLE_RG9_CN_INTERRUPT() (_CNIEG9 = 0)
14912 
14913 # elif defined(RG9_CN)
14914 # define ENABLE_RG9_PULLUP() (RXY_GPIO_CNPUE(RG9_CN) = 1)
14915 # define DISABLE_RG9_PULLUP() (RXY_GPIO_CNPUE(RG9_CN) = 0)
14916 
14917 # if RXY_HAS_CNPDE(RG9_CN)
14918 # define ENABLE_RG9_PULLDOWN() (RXY_GPIO_CNPDE(RG9_CN) = 1)
14919 # define DISABLE_RG9_PULLDOWN() (RXY_GPIO_CNPDE(RG9_CN) = 0)
14920 # else
14921 # define DISABLE_RG9_PULLDOWN() ((void) 0)
14922 # endif
14923 
14924 # define ENABLE_RG9_CN_INTERRUPT() (RXY_GPIO_CNIE(RG9_CN) = 1)
14925 # define DISABLE_RG9_CN_INTERRUPT() (RXY_GPIO_CNIE(RG9_CN) = 0)
14926 
14927 # else
14928 # define DISABLE_RG9_PULLUP() ((void) 0)
14929 # define DISABLE_RG9_PULLDOWN() ((void) 0)
14930 # define DISABLE_RG9_CN_INTERRUPT() ((void) 0)
14931 # endif
14932 
14933 // High-level config
14934 // -----------------
14935 /** This macro disables pullups/downs, enables analog functionality, and configures
14936  * pin RG9 as an input.
14937  */
14938 # if defined(_ANSG9) || defined(RG9_AN) || defined(__DOXYGEN__)
14939 # define CONFIG_RG9_AS_ANALOG() \
14940  do { \
14941  ENABLE_RG9_ANALOG(); \
14942  CONFIG_RG9_AS_INPUT(); \
14943  DISABLE_RG9_OPENDRAIN(); \
14944  DISABLE_RG9_PULLUP(); \
14945  DISABLE_RG9_PULLDOWN(); \
14946  } while (0)
14947 # endif
14948 
14949 /** This macro disables open-drain and pullups/downs,
14950  * configures pin RG9 for digital (not analog) operation, and
14951  * configures the pin as an input.
14952  */
14953 # define CONFIG_RG9_AS_DIG_INPUT() \
14954  do { \
14955  DISABLE_RG9_ANALOG(); \
14956  CONFIG_RG9_AS_INPUT(); \
14957  DISABLE_RG9_OPENDRAIN(); \
14958  DISABLE_RG9_PULLUP(); \
14959  DISABLE_RG9_PULLDOWN(); \
14960  } while (0)
14961 
14962 /** This macro disables open-drain and pullups/downs,
14963  * configures pin RG9 for digital (not analog) operation, and
14964  * configures the pin as an output.
14965  */
14966 # define CONFIG_RG9_AS_DIG_OUTPUT() \
14967  do { \
14968  DISABLE_RG9_ANALOG(); \
14969  CONFIG_RG9_AS_OUTPUT(); \
14970  DISABLE_RG9_OPENDRAIN(); \
14971  DISABLE_RG9_PULLUP(); \
14972  DISABLE_RG9_PULLDOWN(); \
14973  } while (0)
14974 
14975 #endif // #if defined(_RG9) || defined(__DOXYGEN__): Provide GPIO for RG9
14976 
14977 
14978 
14979 
14980 
14981 // Provide GPIO for RG10
14982 // ====================
14983 #if defined(_RG10) || defined(__DOXYGEN__)
14984 
14985 // Dummy macros for documentation only
14986 # ifdef __DOXYGEN__
14987 /// This macro specifies the RPy value associated with pin RG10.
14988 /// Its device-specific definition is given in pic24_ports_mapping.h.
14989 # define RG10_RP xx
14990 
14991 /// This macro specifies the ANn value associated with pin RG10.
14992 /// Its device-specific definition is given in pic24_ports_mapping.h.
14993 # define RG10_AN xx
14994 
14995 /// This macro specifies the CNm value associated with pin RG10.
14996 /// Its device-specific definition is given in pic24_ports_mapping.h.
14997 # define RG10_CN xx
14998 
14999 //@}
15000 # endif // #ifdef __DOXYGEN__
15001 
15002 
15003 // Low-level config
15004 // ----------------
15005 // Analog:
15006 # if defined(_ANSG10) || defined(__DOXYGEN__)
15007 /// Enable analog functionality on pin RG10.
15008 # define ENABLE_RG10_ANALOG() (_ANSG10 = 1)
15009 /// Disable analog functionality on pin RG10.
15010 # define DISABLE_RG10_ANALOG() (_ANSG10 = 0)
15011 # elif defined(RG10_AN)
15012 # define ENABLE_RG10_ANALOG() (RXY_GPIO_PCFG(RG10_AN) = 0)
15013 # define DISABLE_RG10_ANALOG() (RXY_GPIO_PCFG(RG10_AN) = 1)
15014 # else
15015 # define DISABLE_RG10_ANALOG() ((void) 0)
15016 # endif
15017 
15018 // Input/output:
15019 /// Configure pin RG10 as an input.
15020 # define CONFIG_RG10_AS_INPUT() (_TRISG10 = 1)
15021 /// Configure pin RG10 as an output.
15022 # define CONFIG_RG10_AS_OUTPUT() (_TRISG10 = 0)
15023 
15024 // Open-drain:
15025 # if defined(_ODCG10) || defined(__DOXYGEN__)
15026 /// Enable the open-drain driver on pin RG10.
15027 # define ENABLE_RG10_OPENDRAIN() (_ODCG10 = 1)
15028 /// Disable the open-drain driver on pin RG10.
15029 # define DISABLE_RG10_OPENDRAIN() (_ODCG10 = 0)
15030 # elif defined(_ODG10) // The PIF24F names this bit _OD instead of _ODC.
15031 # define ENABLE_RG10_OPENDRAIN() (_ODG10 = 1)
15032 # define DISABLE_RG10_OPENDRAIN() (_ODG10 = 0)
15033 # else
15034 # define DISABLE_RG10_OPENDRAIN() ((void) 0)
15035 # endif
15036 
15037 // Change notification, pullups and pulldowns:
15038 # if defined(_CNIEG10) || defined(__DOXYGEN__)
15039 /// Enable the pullup on pin RG10.
15040 # define ENABLE_RG10_PULLUP() (_CNPUG10 = 1)
15041 /// Disable the pullup on pin RG10.
15042 # define DISABLE_RG10_PULLUP() (_CNPUG10 = 0)
15043 
15044 /// Enable the pulldown on pin RG10.
15045 # define ENABLE_RG10_PULLDOWN() (_CNPDG10 = 1)
15046 /// Disable the pulldown on pin RG10.
15047 # define DISABLE_RG10_PULLDOWN() (_CNPDG10 = 0)
15048 
15049 /// Enable the change notification interrupt on pin RG10.
15050 # define ENABLE_RG10_CN_INTERRUPT() (_CNIEG10 = 1)
15051 /// Disable the change notification interrupt on pin RG10.
15052 # define DISABLE_RG10_CN_INTERRUPT() (_CNIEG10 = 0)
15053 
15054 # elif defined(RG10_CN)
15055 # define ENABLE_RG10_PULLUP() (RXY_GPIO_CNPUE(RG10_CN) = 1)
15056 # define DISABLE_RG10_PULLUP() (RXY_GPIO_CNPUE(RG10_CN) = 0)
15057 
15058 # if RXY_HAS_CNPDE(RG10_CN)
15059 # define ENABLE_RG10_PULLDOWN() (RXY_GPIO_CNPDE(RG10_CN) = 1)
15060 # define DISABLE_RG10_PULLDOWN() (RXY_GPIO_CNPDE(RG10_CN) = 0)
15061 # else
15062 # define DISABLE_RG10_PULLDOWN() ((void) 0)
15063 # endif
15064 
15065 # define ENABLE_RG10_CN_INTERRUPT() (RXY_GPIO_CNIE(RG10_CN) = 1)
15066 # define DISABLE_RG10_CN_INTERRUPT() (RXY_GPIO_CNIE(RG10_CN) = 0)
15067 
15068 # else
15069 # define DISABLE_RG10_PULLUP() ((void) 0)
15070 # define DISABLE_RG10_PULLDOWN() ((void) 0)
15071 # define DISABLE_RG10_CN_INTERRUPT() ((void) 0)
15072 # endif
15073 
15074 // High-level config
15075 // -----------------
15076 /** This macro disables pullups/downs, enables analog functionality, and configures
15077  * pin RG10 as an input.
15078  */
15079 # if defined(_ANSG10) || defined(RG10_AN) || defined(__DOXYGEN__)
15080 # define CONFIG_RG10_AS_ANALOG() \
15081  do { \
15082  ENABLE_RG10_ANALOG(); \
15083  CONFIG_RG10_AS_INPUT(); \
15084  DISABLE_RG10_OPENDRAIN(); \
15085  DISABLE_RG10_PULLUP(); \
15086  DISABLE_RG10_PULLDOWN(); \
15087  } while (0)
15088 # endif
15089 
15090 /** This macro disables open-drain and pullups/downs,
15091  * configures pin RG10 for digital (not analog) operation, and
15092  * configures the pin as an input.
15093  */
15094 # define CONFIG_RG10_AS_DIG_INPUT() \
15095  do { \
15096  DISABLE_RG10_ANALOG(); \
15097  CONFIG_RG10_AS_INPUT(); \
15098  DISABLE_RG10_OPENDRAIN(); \
15099  DISABLE_RG10_PULLUP(); \
15100  DISABLE_RG10_PULLDOWN(); \
15101  } while (0)
15102 
15103 /** This macro disables open-drain and pullups/downs,
15104  * configures pin RG10 for digital (not analog) operation, and
15105  * configures the pin as an output.
15106  */
15107 # define CONFIG_RG10_AS_DIG_OUTPUT() \
15108  do { \
15109  DISABLE_RG10_ANALOG(); \
15110  CONFIG_RG10_AS_OUTPUT(); \
15111  DISABLE_RG10_OPENDRAIN(); \
15112  DISABLE_RG10_PULLUP(); \
15113  DISABLE_RG10_PULLDOWN(); \
15114  } while (0)
15115 
15116 #endif // #if defined(_RG10) || defined(__DOXYGEN__): Provide GPIO for RG10
15117 
15118 
15119 
15120 
15121 
15122 // Provide GPIO for RG11
15123 // ====================
15124 #if defined(_RG11) || defined(__DOXYGEN__)
15125 
15126 // Dummy macros for documentation only
15127 # ifdef __DOXYGEN__
15128 /// This macro specifies the RPy value associated with pin RG11.
15129 /// Its device-specific definition is given in pic24_ports_mapping.h.
15130 # define RG11_RP xx
15131 
15132 /// This macro specifies the ANn value associated with pin RG11.
15133 /// Its device-specific definition is given in pic24_ports_mapping.h.
15134 # define RG11_AN xx
15135 
15136 /// This macro specifies the CNm value associated with pin RG11.
15137 /// Its device-specific definition is given in pic24_ports_mapping.h.
15138 # define RG11_CN xx
15139 
15140 //@}
15141 # endif // #ifdef __DOXYGEN__
15142 
15143 
15144 // Low-level config
15145 // ----------------
15146 // Analog:
15147 # if defined(_ANSG11) || defined(__DOXYGEN__)
15148 /// Enable analog functionality on pin RG11.
15149 # define ENABLE_RG11_ANALOG() (_ANSG11 = 1)
15150 /// Disable analog functionality on pin RG11.
15151 # define DISABLE_RG11_ANALOG() (_ANSG11 = 0)
15152 # elif defined(RG11_AN)
15153 # define ENABLE_RG11_ANALOG() (RXY_GPIO_PCFG(RG11_AN) = 0)
15154 # define DISABLE_RG11_ANALOG() (RXY_GPIO_PCFG(RG11_AN) = 1)
15155 # else
15156 # define DISABLE_RG11_ANALOG() ((void) 0)
15157 # endif
15158 
15159 // Input/output:
15160 /// Configure pin RG11 as an input.
15161 # define CONFIG_RG11_AS_INPUT() (_TRISG11 = 1)
15162 /// Configure pin RG11 as an output.
15163 # define CONFIG_RG11_AS_OUTPUT() (_TRISG11 = 0)
15164 
15165 // Open-drain:
15166 # if defined(_ODCG11) || defined(__DOXYGEN__)
15167 /// Enable the open-drain driver on pin RG11.
15168 # define ENABLE_RG11_OPENDRAIN() (_ODCG11 = 1)
15169 /// Disable the open-drain driver on pin RG11.
15170 # define DISABLE_RG11_OPENDRAIN() (_ODCG11 = 0)
15171 # elif defined(_ODG11) // The PIF24F names this bit _OD instead of _ODC.
15172 # define ENABLE_RG11_OPENDRAIN() (_ODG11 = 1)
15173 # define DISABLE_RG11_OPENDRAIN() (_ODG11 = 0)
15174 # else
15175 # define DISABLE_RG11_OPENDRAIN() ((void) 0)
15176 # endif
15177 
15178 // Change notification, pullups and pulldowns:
15179 # if defined(_CNIEG11) || defined(__DOXYGEN__)
15180 /// Enable the pullup on pin RG11.
15181 # define ENABLE_RG11_PULLUP() (_CNPUG11 = 1)
15182 /// Disable the pullup on pin RG11.
15183 # define DISABLE_RG11_PULLUP() (_CNPUG11 = 0)
15184 
15185 /// Enable the pulldown on pin RG11.
15186 # define ENABLE_RG11_PULLDOWN() (_CNPDG11 = 1)
15187 /// Disable the pulldown on pin RG11.
15188 # define DISABLE_RG11_PULLDOWN() (_CNPDG11 = 0)
15189 
15190 /// Enable the change notification interrupt on pin RG11.
15191 # define ENABLE_RG11_CN_INTERRUPT() (_CNIEG11 = 1)
15192 /// Disable the change notification interrupt on pin RG11.
15193 # define DISABLE_RG11_CN_INTERRUPT() (_CNIEG11 = 0)
15194 
15195 # elif defined(RG11_CN)
15196 # define ENABLE_RG11_PULLUP() (RXY_GPIO_CNPUE(RG11_CN) = 1)
15197 # define DISABLE_RG11_PULLUP() (RXY_GPIO_CNPUE(RG11_CN) = 0)
15198 
15199 # if RXY_HAS_CNPDE(RG11_CN)
15200 # define ENABLE_RG11_PULLDOWN() (RXY_GPIO_CNPDE(RG11_CN) = 1)
15201 # define DISABLE_RG11_PULLDOWN() (RXY_GPIO_CNPDE(RG11_CN) = 0)
15202 # else
15203 # define DISABLE_RG11_PULLDOWN() ((void) 0)
15204 # endif
15205 
15206 # define ENABLE_RG11_CN_INTERRUPT() (RXY_GPIO_CNIE(RG11_CN) = 1)
15207 # define DISABLE_RG11_CN_INTERRUPT() (RXY_GPIO_CNIE(RG11_CN) = 0)
15208 
15209 # else
15210 # define DISABLE_RG11_PULLUP() ((void) 0)
15211 # define DISABLE_RG11_PULLDOWN() ((void) 0)
15212 # define DISABLE_RG11_CN_INTERRUPT() ((void) 0)
15213 # endif
15214 
15215 // High-level config
15216 // -----------------
15217 /** This macro disables pullups/downs, enables analog functionality, and configures
15218  * pin RG11 as an input.
15219  */
15220 # if defined(_ANSG11) || defined(RG11_AN) || defined(__DOXYGEN__)
15221 # define CONFIG_RG11_AS_ANALOG() \
15222  do { \
15223  ENABLE_RG11_ANALOG(); \
15224  CONFIG_RG11_AS_INPUT(); \
15225  DISABLE_RG11_OPENDRAIN(); \
15226  DISABLE_RG11_PULLUP(); \
15227  DISABLE_RG11_PULLDOWN(); \
15228  } while (0)
15229 # endif
15230 
15231 /** This macro disables open-drain and pullups/downs,
15232  * configures pin RG11 for digital (not analog) operation, and
15233  * configures the pin as an input.
15234  */
15235 # define CONFIG_RG11_AS_DIG_INPUT() \
15236  do { \
15237  DISABLE_RG11_ANALOG(); \
15238  CONFIG_RG11_AS_INPUT(); \
15239  DISABLE_RG11_OPENDRAIN(); \
15240  DISABLE_RG11_PULLUP(); \
15241  DISABLE_RG11_PULLDOWN(); \
15242  } while (0)
15243 
15244 /** This macro disables open-drain and pullups/downs,
15245  * configures pin RG11 for digital (not analog) operation, and
15246  * configures the pin as an output.
15247  */
15248 # define CONFIG_RG11_AS_DIG_OUTPUT() \
15249  do { \
15250  DISABLE_RG11_ANALOG(); \
15251  CONFIG_RG11_AS_OUTPUT(); \
15252  DISABLE_RG11_OPENDRAIN(); \
15253  DISABLE_RG11_PULLUP(); \
15254  DISABLE_RG11_PULLDOWN(); \
15255  } while (0)
15256 
15257 #endif // #if defined(_RG11) || defined(__DOXYGEN__): Provide GPIO for RG11
15258 
15259 
15260 
15261 
15262 
15263 // Provide GPIO for RG12
15264 // ====================
15265 #if defined(_RG12) || defined(__DOXYGEN__)
15266 
15267 // Dummy macros for documentation only
15268 # ifdef __DOXYGEN__
15269 /// This macro specifies the RPy value associated with pin RG12.
15270 /// Its device-specific definition is given in pic24_ports_mapping.h.
15271 # define RG12_RP xx
15272 
15273 /// This macro specifies the ANn value associated with pin RG12.
15274 /// Its device-specific definition is given in pic24_ports_mapping.h.
15275 # define RG12_AN xx
15276 
15277 /// This macro specifies the CNm value associated with pin RG12.
15278 /// Its device-specific definition is given in pic24_ports_mapping.h.
15279 # define RG12_CN xx
15280 
15281 //@}
15282 # endif // #ifdef __DOXYGEN__
15283 
15284 
15285 // Low-level config
15286 // ----------------
15287 // Analog:
15288 # if defined(_ANSG12) || defined(__DOXYGEN__)
15289 /// Enable analog functionality on pin RG12.
15290 # define ENABLE_RG12_ANALOG() (_ANSG12 = 1)
15291 /// Disable analog functionality on pin RG12.
15292 # define DISABLE_RG12_ANALOG() (_ANSG12 = 0)
15293 # elif defined(RG12_AN)
15294 # define ENABLE_RG12_ANALOG() (RXY_GPIO_PCFG(RG12_AN) = 0)
15295 # define DISABLE_RG12_ANALOG() (RXY_GPIO_PCFG(RG12_AN) = 1)
15296 # else
15297 # define DISABLE_RG12_ANALOG() ((void) 0)
15298 # endif
15299 
15300 // Input/output:
15301 /// Configure pin RG12 as an input.
15302 # define CONFIG_RG12_AS_INPUT() (_TRISG12 = 1)
15303 /// Configure pin RG12 as an output.
15304 # define CONFIG_RG12_AS_OUTPUT() (_TRISG12 = 0)
15305 
15306 // Open-drain:
15307 # if defined(_ODCG12) || defined(__DOXYGEN__)
15308 /// Enable the open-drain driver on pin RG12.
15309 # define ENABLE_RG12_OPENDRAIN() (_ODCG12 = 1)
15310 /// Disable the open-drain driver on pin RG12.
15311 # define DISABLE_RG12_OPENDRAIN() (_ODCG12 = 0)
15312 # elif defined(_ODG12) // The PIF24F names this bit _OD instead of _ODC.
15313 # define ENABLE_RG12_OPENDRAIN() (_ODG12 = 1)
15314 # define DISABLE_RG12_OPENDRAIN() (_ODG12 = 0)
15315 # else
15316 # define DISABLE_RG12_OPENDRAIN() ((void) 0)
15317 # endif
15318 
15319 // Change notification, pullups and pulldowns:
15320 # if defined(_CNIEG12) || defined(__DOXYGEN__)
15321 /// Enable the pullup on pin RG12.
15322 # define ENABLE_RG12_PULLUP() (_CNPUG12 = 1)
15323 /// Disable the pullup on pin RG12.
15324 # define DISABLE_RG12_PULLUP() (_CNPUG12 = 0)
15325 
15326 /// Enable the pulldown on pin RG12.
15327 # define ENABLE_RG12_PULLDOWN() (_CNPDG12 = 1)
15328 /// Disable the pulldown on pin RG12.
15329 # define DISABLE_RG12_PULLDOWN() (_CNPDG12 = 0)
15330 
15331 /// Enable the change notification interrupt on pin RG12.
15332 # define ENABLE_RG12_CN_INTERRUPT() (_CNIEG12 = 1)
15333 /// Disable the change notification interrupt on pin RG12.
15334 # define DISABLE_RG12_CN_INTERRUPT() (_CNIEG12 = 0)
15335 
15336 # elif defined(RG12_CN)
15337 # define ENABLE_RG12_PULLUP() (RXY_GPIO_CNPUE(RG12_CN) = 1)
15338 # define DISABLE_RG12_PULLUP() (RXY_GPIO_CNPUE(RG12_CN) = 0)
15339 
15340 # if RXY_HAS_CNPDE(RG12_CN)
15341 # define ENABLE_RG12_PULLDOWN() (RXY_GPIO_CNPDE(RG12_CN) = 1)
15342 # define DISABLE_RG12_PULLDOWN() (RXY_GPIO_CNPDE(RG12_CN) = 0)
15343 # else
15344 # define DISABLE_RG12_PULLDOWN() ((void) 0)
15345 # endif
15346 
15347 # define ENABLE_RG12_CN_INTERRUPT() (RXY_GPIO_CNIE(RG12_CN) = 1)
15348 # define DISABLE_RG12_CN_INTERRUPT() (RXY_GPIO_CNIE(RG12_CN) = 0)
15349 
15350 # else
15351 # define DISABLE_RG12_PULLUP() ((void) 0)
15352 # define DISABLE_RG12_PULLDOWN() ((void) 0)
15353 # define DISABLE_RG12_CN_INTERRUPT() ((void) 0)
15354 # endif
15355 
15356 // High-level config
15357 // -----------------
15358 /** This macro disables pullups/downs, enables analog functionality, and configures
15359  * pin RG12 as an input.
15360  */
15361 # if defined(_ANSG12) || defined(RG12_AN) || defined(__DOXYGEN__)
15362 # define CONFIG_RG12_AS_ANALOG() \
15363  do { \
15364  ENABLE_RG12_ANALOG(); \
15365  CONFIG_RG12_AS_INPUT(); \
15366  DISABLE_RG12_OPENDRAIN(); \
15367  DISABLE_RG12_PULLUP(); \
15368  DISABLE_RG12_PULLDOWN(); \
15369  } while (0)
15370 # endif
15371 
15372 /** This macro disables open-drain and pullups/downs,
15373  * configures pin RG12 for digital (not analog) operation, and
15374  * configures the pin as an input.
15375  */
15376 # define CONFIG_RG12_AS_DIG_INPUT() \
15377  do { \
15378  DISABLE_RG12_ANALOG(); \
15379  CONFIG_RG12_AS_INPUT(); \
15380  DISABLE_RG12_OPENDRAIN(); \
15381  DISABLE_RG12_PULLUP(); \
15382  DISABLE_RG12_PULLDOWN(); \
15383  } while (0)
15384 
15385 /** This macro disables open-drain and pullups/downs,
15386  * configures pin RG12 for digital (not analog) operation, and
15387  * configures the pin as an output.
15388  */
15389 # define CONFIG_RG12_AS_DIG_OUTPUT() \
15390  do { \
15391  DISABLE_RG12_ANALOG(); \
15392  CONFIG_RG12_AS_OUTPUT(); \
15393  DISABLE_RG12_OPENDRAIN(); \
15394  DISABLE_RG12_PULLUP(); \
15395  DISABLE_RG12_PULLDOWN(); \
15396  } while (0)
15397 
15398 #endif // #if defined(_RG12) || defined(__DOXYGEN__): Provide GPIO for RG12
15399 
15400 
15401 
15402 
15403 
15404 // Provide GPIO for RG13
15405 // ====================
15406 #if defined(_RG13) || defined(__DOXYGEN__)
15407 
15408 // Dummy macros for documentation only
15409 # ifdef __DOXYGEN__
15410 /// This macro specifies the RPy value associated with pin RG13.
15411 /// Its device-specific definition is given in pic24_ports_mapping.h.
15412 # define RG13_RP xx
15413 
15414 /// This macro specifies the ANn value associated with pin RG13.
15415 /// Its device-specific definition is given in pic24_ports_mapping.h.
15416 # define RG13_AN xx
15417 
15418 /// This macro specifies the CNm value associated with pin RG13.
15419 /// Its device-specific definition is given in pic24_ports_mapping.h.
15420 # define RG13_CN xx
15421 
15422 //@}
15423 # endif // #ifdef __DOXYGEN__
15424 
15425 
15426 // Low-level config
15427 // ----------------
15428 // Analog:
15429 # if defined(_ANSG13) || defined(__DOXYGEN__)
15430 /// Enable analog functionality on pin RG13.
15431 # define ENABLE_RG13_ANALOG() (_ANSG13 = 1)
15432 /// Disable analog functionality on pin RG13.
15433 # define DISABLE_RG13_ANALOG() (_ANSG13 = 0)
15434 # elif defined(RG13_AN)
15435 # define ENABLE_RG13_ANALOG() (RXY_GPIO_PCFG(RG13_AN) = 0)
15436 # define DISABLE_RG13_ANALOG() (RXY_GPIO_PCFG(RG13_AN) = 1)
15437 # else
15438 # define DISABLE_RG13_ANALOG() ((void) 0)
15439 # endif
15440 
15441 // Input/output:
15442 /// Configure pin RG13 as an input.
15443 # define CONFIG_RG13_AS_INPUT() (_TRISG13 = 1)
15444 /// Configure pin RG13 as an output.
15445 # define CONFIG_RG13_AS_OUTPUT() (_TRISG13 = 0)
15446 
15447 // Open-drain:
15448 # if defined(_ODCG13) || defined(__DOXYGEN__)
15449 /// Enable the open-drain driver on pin RG13.
15450 # define ENABLE_RG13_OPENDRAIN() (_ODCG13 = 1)
15451 /// Disable the open-drain driver on pin RG13.
15452 # define DISABLE_RG13_OPENDRAIN() (_ODCG13 = 0)
15453 # elif defined(_ODG13) // The PIF24F names this bit _OD instead of _ODC.
15454 # define ENABLE_RG13_OPENDRAIN() (_ODG13 = 1)
15455 # define DISABLE_RG13_OPENDRAIN() (_ODG13 = 0)
15456 # else
15457 # define DISABLE_RG13_OPENDRAIN() ((void) 0)
15458 # endif
15459 
15460 // Change notification, pullups and pulldowns:
15461 # if defined(_CNIEG13) || defined(__DOXYGEN__)
15462 /// Enable the pullup on pin RG13.
15463 # define ENABLE_RG13_PULLUP() (_CNPUG13 = 1)
15464 /// Disable the pullup on pin RG13.
15465 # define DISABLE_RG13_PULLUP() (_CNPUG13 = 0)
15466 
15467 /// Enable the pulldown on pin RG13.
15468 # define ENABLE_RG13_PULLDOWN() (_CNPDG13 = 1)
15469 /// Disable the pulldown on pin RG13.
15470 # define DISABLE_RG13_PULLDOWN() (_CNPDG13 = 0)
15471 
15472 /// Enable the change notification interrupt on pin RG13.
15473 # define ENABLE_RG13_CN_INTERRUPT() (_CNIEG13 = 1)
15474 /// Disable the change notification interrupt on pin RG13.
15475 # define DISABLE_RG13_CN_INTERRUPT() (_CNIEG13 = 0)
15476 
15477 # elif defined(RG13_CN)
15478 # define ENABLE_RG13_PULLUP() (RXY_GPIO_CNPUE(RG13_CN) = 1)
15479 # define DISABLE_RG13_PULLUP() (RXY_GPIO_CNPUE(RG13_CN) = 0)
15480 
15481 # if RXY_HAS_CNPDE(RG13_CN)
15482 # define ENABLE_RG13_PULLDOWN() (RXY_GPIO_CNPDE(RG13_CN) = 1)
15483 # define DISABLE_RG13_PULLDOWN() (RXY_GPIO_CNPDE(RG13_CN) = 0)
15484 # else
15485 # define DISABLE_RG13_PULLDOWN() ((void) 0)
15486 # endif
15487 
15488 # define ENABLE_RG13_CN_INTERRUPT() (RXY_GPIO_CNIE(RG13_CN) = 1)
15489 # define DISABLE_RG13_CN_INTERRUPT() (RXY_GPIO_CNIE(RG13_CN) = 0)
15490 
15491 # else
15492 # define DISABLE_RG13_PULLUP() ((void) 0)
15493 # define DISABLE_RG13_PULLDOWN() ((void) 0)
15494 # define DISABLE_RG13_CN_INTERRUPT() ((void) 0)
15495 # endif
15496 
15497 // High-level config
15498 // -----------------
15499 /** This macro disables pullups/downs, enables analog functionality, and configures
15500  * pin RG13 as an input.
15501  */
15502 # if defined(_ANSG13) || defined(RG13_AN) || defined(__DOXYGEN__)
15503 # define CONFIG_RG13_AS_ANALOG() \
15504  do { \
15505  ENABLE_RG13_ANALOG(); \
15506  CONFIG_RG13_AS_INPUT(); \
15507  DISABLE_RG13_OPENDRAIN(); \
15508  DISABLE_RG13_PULLUP(); \
15509  DISABLE_RG13_PULLDOWN(); \
15510  } while (0)
15511 # endif
15512 
15513 /** This macro disables open-drain and pullups/downs,
15514  * configures pin RG13 for digital (not analog) operation, and
15515  * configures the pin as an input.
15516  */
15517 # define CONFIG_RG13_AS_DIG_INPUT() \
15518  do { \
15519  DISABLE_RG13_ANALOG(); \
15520  CONFIG_RG13_AS_INPUT(); \
15521  DISABLE_RG13_OPENDRAIN(); \
15522  DISABLE_RG13_PULLUP(); \
15523  DISABLE_RG13_PULLDOWN(); \
15524  } while (0)
15525 
15526 /** This macro disables open-drain and pullups/downs,
15527  * configures pin RG13 for digital (not analog) operation, and
15528  * configures the pin as an output.
15529  */
15530 # define CONFIG_RG13_AS_DIG_OUTPUT() \
15531  do { \
15532  DISABLE_RG13_ANALOG(); \
15533  CONFIG_RG13_AS_OUTPUT(); \
15534  DISABLE_RG13_OPENDRAIN(); \
15535  DISABLE_RG13_PULLUP(); \
15536  DISABLE_RG13_PULLDOWN(); \
15537  } while (0)
15538 
15539 #endif // #if defined(_RG13) || defined(__DOXYGEN__): Provide GPIO for RG13
15540 
15541 
15542 
15543 
15544 
15545 // Provide GPIO for RG14
15546 // ====================
15547 #if defined(_RG14) || defined(__DOXYGEN__)
15548 
15549 // Dummy macros for documentation only
15550 # ifdef __DOXYGEN__
15551 /// This macro specifies the RPy value associated with pin RG14.
15552 /// Its device-specific definition is given in pic24_ports_mapping.h.
15553 # define RG14_RP xx
15554 
15555 /// This macro specifies the ANn value associated with pin RG14.
15556 /// Its device-specific definition is given in pic24_ports_mapping.h.
15557 # define RG14_AN xx
15558 
15559 /// This macro specifies the CNm value associated with pin RG14.
15560 /// Its device-specific definition is given in pic24_ports_mapping.h.
15561 # define RG14_CN xx
15562 
15563 //@}
15564 # endif // #ifdef __DOXYGEN__
15565 
15566 
15567 // Low-level config
15568 // ----------------
15569 // Analog:
15570 # if defined(_ANSG14) || defined(__DOXYGEN__)
15571 /// Enable analog functionality on pin RG14.
15572 # define ENABLE_RG14_ANALOG() (_ANSG14 = 1)
15573 /// Disable analog functionality on pin RG14.
15574 # define DISABLE_RG14_ANALOG() (_ANSG14 = 0)
15575 # elif defined(RG14_AN)
15576 # define ENABLE_RG14_ANALOG() (RXY_GPIO_PCFG(RG14_AN) = 0)
15577 # define DISABLE_RG14_ANALOG() (RXY_GPIO_PCFG(RG14_AN) = 1)
15578 # else
15579 # define DISABLE_RG14_ANALOG() ((void) 0)
15580 # endif
15581 
15582 // Input/output:
15583 /// Configure pin RG14 as an input.
15584 # define CONFIG_RG14_AS_INPUT() (_TRISG14 = 1)
15585 /// Configure pin RG14 as an output.
15586 # define CONFIG_RG14_AS_OUTPUT() (_TRISG14 = 0)
15587 
15588 // Open-drain:
15589 # if defined(_ODCG14) || defined(__DOXYGEN__)
15590 /// Enable the open-drain driver on pin RG14.
15591 # define ENABLE_RG14_OPENDRAIN() (_ODCG14 = 1)
15592 /// Disable the open-drain driver on pin RG14.
15593 # define DISABLE_RG14_OPENDRAIN() (_ODCG14 = 0)
15594 # elif defined(_ODG14) // The PIF24F names this bit _OD instead of _ODC.
15595 # define ENABLE_RG14_OPENDRAIN() (_ODG14 = 1)
15596 # define DISABLE_RG14_OPENDRAIN() (_ODG14 = 0)
15597 # else
15598 # define DISABLE_RG14_OPENDRAIN() ((void) 0)
15599 # endif
15600 
15601 // Change notification, pullups and pulldowns:
15602 # if defined(_CNIEG14) || defined(__DOXYGEN__)
15603 /// Enable the pullup on pin RG14.
15604 # define ENABLE_RG14_PULLUP() (_CNPUG14 = 1)
15605 /// Disable the pullup on pin RG14.
15606 # define DISABLE_RG14_PULLUP() (_CNPUG14 = 0)
15607 
15608 /// Enable the pulldown on pin RG14.
15609 # define ENABLE_RG14_PULLDOWN() (_CNPDG14 = 1)
15610 /// Disable the pulldown on pin RG14.
15611 # define DISABLE_RG14_PULLDOWN() (_CNPDG14 = 0)
15612 
15613 /// Enable the change notification interrupt on pin RG14.
15614 # define ENABLE_RG14_CN_INTERRUPT() (_CNIEG14 = 1)
15615 /// Disable the change notification interrupt on pin RG14.
15616 # define DISABLE_RG14_CN_INTERRUPT() (_CNIEG14 = 0)
15617 
15618 # elif defined(RG14_CN)
15619 # define ENABLE_RG14_PULLUP() (RXY_GPIO_CNPUE(RG14_CN) = 1)
15620 # define DISABLE_RG14_PULLUP() (RXY_GPIO_CNPUE(RG14_CN) = 0)
15621 
15622 # if RXY_HAS_CNPDE(RG14_CN)
15623 # define ENABLE_RG14_PULLDOWN() (RXY_GPIO_CNPDE(RG14_CN) = 1)
15624 # define DISABLE_RG14_PULLDOWN() (RXY_GPIO_CNPDE(RG14_CN) = 0)
15625 # else
15626 # define DISABLE_RG14_PULLDOWN() ((void) 0)
15627 # endif
15628 
15629 # define ENABLE_RG14_CN_INTERRUPT() (RXY_GPIO_CNIE(RG14_CN) = 1)
15630 # define DISABLE_RG14_CN_INTERRUPT() (RXY_GPIO_CNIE(RG14_CN) = 0)
15631 
15632 # else
15633 # define DISABLE_RG14_PULLUP() ((void) 0)
15634 # define DISABLE_RG14_PULLDOWN() ((void) 0)
15635 # define DISABLE_RG14_CN_INTERRUPT() ((void) 0)
15636 # endif
15637 
15638 // High-level config
15639 // -----------------
15640 /** This macro disables pullups/downs, enables analog functionality, and configures
15641  * pin RG14 as an input.
15642  */
15643 # if defined(_ANSG14) || defined(RG14_AN) || defined(__DOXYGEN__)
15644 # define CONFIG_RG14_AS_ANALOG() \
15645  do { \
15646  ENABLE_RG14_ANALOG(); \
15647  CONFIG_RG14_AS_INPUT(); \
15648  DISABLE_RG14_OPENDRAIN(); \
15649  DISABLE_RG14_PULLUP(); \
15650  DISABLE_RG14_PULLDOWN(); \
15651  } while (0)
15652 # endif
15653 
15654 /** This macro disables open-drain and pullups/downs,
15655  * configures pin RG14 for digital (not analog) operation, and
15656  * configures the pin as an input.
15657  */
15658 # define CONFIG_RG14_AS_DIG_INPUT() \
15659  do { \
15660  DISABLE_RG14_ANALOG(); \
15661  CONFIG_RG14_AS_INPUT(); \
15662  DISABLE_RG14_OPENDRAIN(); \
15663  DISABLE_RG14_PULLUP(); \
15664  DISABLE_RG14_PULLDOWN(); \
15665  } while (0)
15666 
15667 /** This macro disables open-drain and pullups/downs,
15668  * configures pin RG14 for digital (not analog) operation, and
15669  * configures the pin as an output.
15670  */
15671 # define CONFIG_RG14_AS_DIG_OUTPUT() \
15672  do { \
15673  DISABLE_RG14_ANALOG(); \
15674  CONFIG_RG14_AS_OUTPUT(); \
15675  DISABLE_RG14_OPENDRAIN(); \
15676  DISABLE_RG14_PULLUP(); \
15677  DISABLE_RG14_PULLDOWN(); \
15678  } while (0)
15679 
15680 #endif // #if defined(_RG14) || defined(__DOXYGEN__): Provide GPIO for RG14
15681 
15682 
15683 
15684 
15685 
15686 // Provide GPIO for RG15
15687 // ====================
15688 #if defined(_RG15) || defined(__DOXYGEN__)
15689 
15690 // Dummy macros for documentation only
15691 # ifdef __DOXYGEN__
15692 /// This macro specifies the RPy value associated with pin RG15.
15693 /// Its device-specific definition is given in pic24_ports_mapping.h.
15694 # define RG15_RP xx
15695 
15696 /// This macro specifies the ANn value associated with pin RG15.
15697 /// Its device-specific definition is given in pic24_ports_mapping.h.
15698 # define RG15_AN xx
15699 
15700 /// This macro specifies the CNm value associated with pin RG15.
15701 /// Its device-specific definition is given in pic24_ports_mapping.h.
15702 # define RG15_CN xx
15703 
15704 //@}
15705 # endif // #ifdef __DOXYGEN__
15706 
15707 
15708 // Low-level config
15709 // ----------------
15710 // Analog:
15711 # if defined(_ANSG15) || defined(__DOXYGEN__)
15712 /// Enable analog functionality on pin RG15.
15713 # define ENABLE_RG15_ANALOG() (_ANSG15 = 1)
15714 /// Disable analog functionality on pin RG15.
15715 # define DISABLE_RG15_ANALOG() (_ANSG15 = 0)
15716 # elif defined(RG15_AN)
15717 # define ENABLE_RG15_ANALOG() (RXY_GPIO_PCFG(RG15_AN) = 0)
15718 # define DISABLE_RG15_ANALOG() (RXY_GPIO_PCFG(RG15_AN) = 1)
15719 # else
15720 # define DISABLE_RG15_ANALOG() ((void) 0)
15721 # endif
15722 
15723 // Input/output:
15724 /// Configure pin RG15 as an input.
15725 # define CONFIG_RG15_AS_INPUT() (_TRISG15 = 1)
15726 /// Configure pin RG15 as an output.
15727 # define CONFIG_RG15_AS_OUTPUT() (_TRISG15 = 0)
15728 
15729 // Open-drain:
15730 # if defined(_ODCG15) || defined(__DOXYGEN__)
15731 /// Enable the open-drain driver on pin RG15.
15732 # define ENABLE_RG15_OPENDRAIN() (_ODCG15 = 1)
15733 /// Disable the open-drain driver on pin RG15.
15734 # define DISABLE_RG15_OPENDRAIN() (_ODCG15 = 0)
15735 # elif defined(_ODG15) // The PIF24F names this bit _OD instead of _ODC.
15736 # define ENABLE_RG15_OPENDRAIN() (_ODG15 = 1)
15737 # define DISABLE_RG15_OPENDRAIN() (_ODG15 = 0)
15738 # else
15739 # define DISABLE_RG15_OPENDRAIN() ((void) 0)
15740 # endif
15741 
15742 // Change notification, pullups and pulldowns:
15743 # if defined(_CNIEG15) || defined(__DOXYGEN__)
15744 /// Enable the pullup on pin RG15.
15745 # define ENABLE_RG15_PULLUP() (_CNPUG15 = 1)
15746 /// Disable the pullup on pin RG15.
15747 # define DISABLE_RG15_PULLUP() (_CNPUG15 = 0)
15748 
15749 /// Enable the pulldown on pin RG15.
15750 # define ENABLE_RG15_PULLDOWN() (_CNPDG15 = 1)
15751 /// Disable the pulldown on pin RG15.
15752 # define DISABLE_RG15_PULLDOWN() (_CNPDG15 = 0)
15753 
15754 /// Enable the change notification interrupt on pin RG15.
15755 # define ENABLE_RG15_CN_INTERRUPT() (_CNIEG15 = 1)
15756 /// Disable the change notification interrupt on pin RG15.
15757 # define DISABLE_RG15_CN_INTERRUPT() (_CNIEG15 = 0)
15758 
15759 # elif defined(RG15_CN)
15760 # define ENABLE_RG15_PULLUP() (RXY_GPIO_CNPUE(RG15_CN) = 1)
15761 # define DISABLE_RG15_PULLUP() (RXY_GPIO_CNPUE(RG15_CN) = 0)
15762 
15763 # if RXY_HAS_CNPDE(RG15_CN)
15764 # define ENABLE_RG15_PULLDOWN() (RXY_GPIO_CNPDE(RG15_CN) = 1)
15765 # define DISABLE_RG15_PULLDOWN() (RXY_GPIO_CNPDE(RG15_CN) = 0)
15766 # else
15767 # define DISABLE_RG15_PULLDOWN() ((void) 0)
15768 # endif
15769 
15770 # define ENABLE_RG15_CN_INTERRUPT() (RXY_GPIO_CNIE(RG15_CN) = 1)
15771 # define DISABLE_RG15_CN_INTERRUPT() (RXY_GPIO_CNIE(RG15_CN) = 0)
15772 
15773 # else
15774 # define DISABLE_RG15_PULLUP() ((void) 0)
15775 # define DISABLE_RG15_PULLDOWN() ((void) 0)
15776 # define DISABLE_RG15_CN_INTERRUPT() ((void) 0)
15777 # endif
15778 
15779 // High-level config
15780 // -----------------
15781 /** This macro disables pullups/downs, enables analog functionality, and configures
15782  * pin RG15 as an input.
15783  */
15784 # if defined(_ANSG15) || defined(RG15_AN) || defined(__DOXYGEN__)
15785 # define CONFIG_RG15_AS_ANALOG() \
15786  do { \
15787  ENABLE_RG15_ANALOG(); \
15788  CONFIG_RG15_AS_INPUT(); \
15789  DISABLE_RG15_OPENDRAIN(); \
15790  DISABLE_RG15_PULLUP(); \
15791  DISABLE_RG15_PULLDOWN(); \
15792  } while (0)
15793 # endif
15794 
15795 /** This macro disables open-drain and pullups/downs,
15796  * configures pin RG15 for digital (not analog) operation, and
15797  * configures the pin as an input.
15798  */
15799 # define CONFIG_RG15_AS_DIG_INPUT() \
15800  do { \
15801  DISABLE_RG15_ANALOG(); \
15802  CONFIG_RG15_AS_INPUT(); \
15803  DISABLE_RG15_OPENDRAIN(); \
15804  DISABLE_RG15_PULLUP(); \
15805  DISABLE_RG15_PULLDOWN(); \
15806  } while (0)
15807 
15808 /** This macro disables open-drain and pullups/downs,
15809  * configures pin RG15 for digital (not analog) operation, and
15810  * configures the pin as an output.
15811  */
15812 # define CONFIG_RG15_AS_DIG_OUTPUT() \
15813  do { \
15814  DISABLE_RG15_ANALOG(); \
15815  CONFIG_RG15_AS_OUTPUT(); \
15816  DISABLE_RG15_OPENDRAIN(); \
15817  DISABLE_RG15_PULLUP(); \
15818  DISABLE_RG15_PULLDOWN(); \
15819  } while (0)
15820 
15821 #endif // #if defined(_RG15) || defined(__DOXYGEN__): Provide GPIO for RG15
15822 
15823 
15824 
15825 
15826 
15827 // Provide GPIO for RH0
15828 // ====================
15829 #if defined(_RH0) || defined(__DOXYGEN__)
15830 
15831 // Dummy macros for documentation only
15832 # ifdef __DOXYGEN__
15833 /// This macro specifies the RPy value associated with pin RH0.
15834 /// Its device-specific definition is given in pic24_ports_mapping.h.
15835 # define RH0_RP xx
15836 
15837 /// This macro specifies the ANn value associated with pin RH0.
15838 /// Its device-specific definition is given in pic24_ports_mapping.h.
15839 # define RH0_AN xx
15840 
15841 /// This macro specifies the CNm value associated with pin RH0.
15842 /// Its device-specific definition is given in pic24_ports_mapping.h.
15843 # define RH0_CN xx
15844 
15845 //@}
15846 # endif // #ifdef __DOXYGEN__
15847 
15848 
15849 // Low-level config
15850 // ----------------
15851 // Analog:
15852 # if defined(_ANSH0) || defined(__DOXYGEN__)
15853 /// Enable analog functionality on pin RH0.
15854 # define ENABLE_RH0_ANALOG() (_ANSH0 = 1)
15855 /// Disable analog functionality on pin RH0.
15856 # define DISABLE_RH0_ANALOG() (_ANSH0 = 0)
15857 # elif defined(RH0_AN)
15858 # define ENABLE_RH0_ANALOG() (RXY_GPIO_PCFG(RH0_AN) = 0)
15859 # define DISABLE_RH0_ANALOG() (RXY_GPIO_PCFG(RH0_AN) = 1)
15860 # else
15861 # define DISABLE_RH0_ANALOG() ((void) 0)
15862 # endif
15863 
15864 // Input/output:
15865 /// Configure pin RH0 as an input.
15866 # define CONFIG_RH0_AS_INPUT() (_TRISH0 = 1)
15867 /// Configure pin RH0 as an output.
15868 # define CONFIG_RH0_AS_OUTPUT() (_TRISH0 = 0)
15869 
15870 // Open-drain:
15871 # if defined(_ODCH0) || defined(__DOXYGEN__)
15872 /// Enable the open-drain driver on pin RH0.
15873 # define ENABLE_RH0_OPENDRAIN() (_ODCH0 = 1)
15874 /// Disable the open-drain driver on pin RH0.
15875 # define DISABLE_RH0_OPENDRAIN() (_ODCH0 = 0)
15876 # elif defined(_ODH0) // The PIF24F names this bit _OD instead of _ODC.
15877 # define ENABLE_RH0_OPENDRAIN() (_ODH0 = 1)
15878 # define DISABLE_RH0_OPENDRAIN() (_ODH0 = 0)
15879 # else
15880 # define DISABLE_RH0_OPENDRAIN() ((void) 0)
15881 # endif
15882 
15883 // Change notification, pullups and pulldowns:
15884 # if defined(_CNIEH0) || defined(__DOXYGEN__)
15885 /// Enable the pullup on pin RH0.
15886 # define ENABLE_RH0_PULLUP() (_CNPUH0 = 1)
15887 /// Disable the pullup on pin RH0.
15888 # define DISABLE_RH0_PULLUP() (_CNPUH0 = 0)
15889 
15890 /// Enable the pulldown on pin RH0.
15891 # define ENABLE_RH0_PULLDOWN() (_CNPDH0 = 1)
15892 /// Disable the pulldown on pin RH0.
15893 # define DISABLE_RH0_PULLDOWN() (_CNPDH0 = 0)
15894 
15895 /// Enable the change notification interrupt on pin RH0.
15896 # define ENABLE_RH0_CN_INTERRUPT() (_CNIEH0 = 1)
15897 /// Disable the change notification interrupt on pin RH0.
15898 # define DISABLE_RH0_CN_INTERRUPT() (_CNIEH0 = 0)
15899 
15900 # elif defined(RH0_CN)
15901 # define ENABLE_RH0_PULLUP() (RXY_GPIO_CNPUE(RH0_CN) = 1)
15902 # define DISABLE_RH0_PULLUP() (RXY_GPIO_CNPUE(RH0_CN) = 0)
15903 
15904 # if RXY_HAS_CNPDE(RH0_CN)
15905 # define ENABLE_RH0_PULLDOWN() (RXY_GPIO_CNPDE(RH0_CN) = 1)
15906 # define DISABLE_RH0_PULLDOWN() (RXY_GPIO_CNPDE(RH0_CN) = 0)
15907 # else
15908 # define DISABLE_RH0_PULLDOWN() ((void) 0)
15909 # endif
15910 
15911 # define ENABLE_RH0_CN_INTERRUPT() (RXY_GPIO_CNIE(RH0_CN) = 1)
15912 # define DISABLE_RH0_CN_INTERRUPT() (RXY_GPIO_CNIE(RH0_CN) = 0)
15913 
15914 # else
15915 # define DISABLE_RH0_PULLUP() ((void) 0)
15916 # define DISABLE_RH0_PULLDOWN() ((void) 0)
15917 # define DISABLE_RH0_CN_INTERRUPT() ((void) 0)
15918 # endif
15919 
15920 // High-level config
15921 // -----------------
15922 /** This macro disables pullups/downs, enables analog functionality, and configures
15923  * pin RH0 as an input.
15924  */
15925 # if defined(_ANSH0) || defined(RH0_AN) || defined(__DOXYGEN__)
15926 # define CONFIG_RH0_AS_ANALOG() \
15927  do { \
15928  ENABLE_RH0_ANALOG(); \
15929  CONFIG_RH0_AS_INPUT(); \
15930  DISABLE_RH0_OPENDRAIN(); \
15931  DISABLE_RH0_PULLUP(); \
15932  DISABLE_RH0_PULLDOWN(); \
15933  } while (0)
15934 # endif
15935 
15936 /** This macro disables open-drain and pullups/downs,
15937  * configures pin RH0 for digital (not analog) operation, and
15938  * configures the pin as an input.
15939  */
15940 # define CONFIG_RH0_AS_DIG_INPUT() \
15941  do { \
15942  DISABLE_RH0_ANALOG(); \
15943  CONFIG_RH0_AS_INPUT(); \
15944  DISABLE_RH0_OPENDRAIN(); \
15945  DISABLE_RH0_PULLUP(); \
15946  DISABLE_RH0_PULLDOWN(); \
15947  } while (0)
15948 
15949 /** This macro disables open-drain and pullups/downs,
15950  * configures pin RH0 for digital (not analog) operation, and
15951  * configures the pin as an output.
15952  */
15953 # define CONFIG_RH0_AS_DIG_OUTPUT() \
15954  do { \
15955  DISABLE_RH0_ANALOG(); \
15956  CONFIG_RH0_AS_OUTPUT(); \
15957  DISABLE_RH0_OPENDRAIN(); \
15958  DISABLE_RH0_PULLUP(); \
15959  DISABLE_RH0_PULLDOWN(); \
15960  } while (0)
15961 
15962 #endif // #if defined(_RH0) || defined(__DOXYGEN__): Provide GPIO for RH0
15963 
15964 
15965 
15966 
15967 
15968 // Provide GPIO for RH1
15969 // ====================
15970 #if defined(_RH1) || defined(__DOXYGEN__)
15971 
15972 // Dummy macros for documentation only
15973 # ifdef __DOXYGEN__
15974 /// This macro specifies the RPy value associated with pin RH1.
15975 /// Its device-specific definition is given in pic24_ports_mapping.h.
15976 # define RH1_RP xx
15977 
15978 /// This macro specifies the ANn value associated with pin RH1.
15979 /// Its device-specific definition is given in pic24_ports_mapping.h.
15980 # define RH1_AN xx
15981 
15982 /// This macro specifies the CNm value associated with pin RH1.
15983 /// Its device-specific definition is given in pic24_ports_mapping.h.
15984 # define RH1_CN xx
15985 
15986 //@}
15987 # endif // #ifdef __DOXYGEN__
15988 
15989 
15990 // Low-level config
15991 // ----------------
15992 // Analog:
15993 # if defined(_ANSH1) || defined(__DOXYGEN__)
15994 /// Enable analog functionality on pin RH1.
15995 # define ENABLE_RH1_ANALOG() (_ANSH1 = 1)
15996 /// Disable analog functionality on pin RH1.
15997 # define DISABLE_RH1_ANALOG() (_ANSH1 = 0)
15998 # elif defined(RH1_AN)
15999 # define ENABLE_RH1_ANALOG() (RXY_GPIO_PCFG(RH1_AN) = 0)
16000 # define DISABLE_RH1_ANALOG() (RXY_GPIO_PCFG(RH1_AN) = 1)
16001 # else
16002 # define DISABLE_RH1_ANALOG() ((void) 0)
16003 # endif
16004 
16005 // Input/output:
16006 /// Configure pin RH1 as an input.
16007 # define CONFIG_RH1_AS_INPUT() (_TRISH1 = 1)
16008 /// Configure pin RH1 as an output.
16009 # define CONFIG_RH1_AS_OUTPUT() (_TRISH1 = 0)
16010 
16011 // Open-drain:
16012 # if defined(_ODCH1) || defined(__DOXYGEN__)
16013 /// Enable the open-drain driver on pin RH1.
16014 # define ENABLE_RH1_OPENDRAIN() (_ODCH1 = 1)
16015 /// Disable the open-drain driver on pin RH1.
16016 # define DISABLE_RH1_OPENDRAIN() (_ODCH1 = 0)
16017 # elif defined(_ODH1) // The PIF24F names this bit _OD instead of _ODC.
16018 # define ENABLE_RH1_OPENDRAIN() (_ODH1 = 1)
16019 # define DISABLE_RH1_OPENDRAIN() (_ODH1 = 0)
16020 # else
16021 # define DISABLE_RH1_OPENDRAIN() ((void) 0)
16022 # endif
16023 
16024 // Change notification, pullups and pulldowns:
16025 # if defined(_CNIEH1) || defined(__DOXYGEN__)
16026 /// Enable the pullup on pin RH1.
16027 # define ENABLE_RH1_PULLUP() (_CNPUH1 = 1)
16028 /// Disable the pullup on pin RH1.
16029 # define DISABLE_RH1_PULLUP() (_CNPUH1 = 0)
16030 
16031 /// Enable the pulldown on pin RH1.
16032 # define ENABLE_RH1_PULLDOWN() (_CNPDH1 = 1)
16033 /// Disable the pulldown on pin RH1.
16034 # define DISABLE_RH1_PULLDOWN() (_CNPDH1 = 0)
16035 
16036 /// Enable the change notification interrupt on pin RH1.
16037 # define ENABLE_RH1_CN_INTERRUPT() (_CNIEH1 = 1)
16038 /// Disable the change notification interrupt on pin RH1.
16039 # define DISABLE_RH1_CN_INTERRUPT() (_CNIEH1 = 0)
16040 
16041 # elif defined(RH1_CN)
16042 # define ENABLE_RH1_PULLUP() (RXY_GPIO_CNPUE(RH1_CN) = 1)
16043 # define DISABLE_RH1_PULLUP() (RXY_GPIO_CNPUE(RH1_CN) = 0)
16044 
16045 # if RXY_HAS_CNPDE(RH1_CN)
16046 # define ENABLE_RH1_PULLDOWN() (RXY_GPIO_CNPDE(RH1_CN) = 1)
16047 # define DISABLE_RH1_PULLDOWN() (RXY_GPIO_CNPDE(RH1_CN) = 0)
16048 # else
16049 # define DISABLE_RH1_PULLDOWN() ((void) 0)
16050 # endif
16051 
16052 # define ENABLE_RH1_CN_INTERRUPT() (RXY_GPIO_CNIE(RH1_CN) = 1)
16053 # define DISABLE_RH1_CN_INTERRUPT() (RXY_GPIO_CNIE(RH1_CN) = 0)
16054 
16055 # else
16056 # define DISABLE_RH1_PULLUP() ((void) 0)
16057 # define DISABLE_RH1_PULLDOWN() ((void) 0)
16058 # define DISABLE_RH1_CN_INTERRUPT() ((void) 0)
16059 # endif
16060 
16061 // High-level config
16062 // -----------------
16063 /** This macro disables pullups/downs, enables analog functionality, and configures
16064  * pin RH1 as an input.
16065  */
16066 # if defined(_ANSH1) || defined(RH1_AN) || defined(__DOXYGEN__)
16067 # define CONFIG_RH1_AS_ANALOG() \
16068  do { \
16069  ENABLE_RH1_ANALOG(); \
16070  CONFIG_RH1_AS_INPUT(); \
16071  DISABLE_RH1_OPENDRAIN(); \
16072  DISABLE_RH1_PULLUP(); \
16073  DISABLE_RH1_PULLDOWN(); \
16074  } while (0)
16075 # endif
16076 
16077 /** This macro disables open-drain and pullups/downs,
16078  * configures pin RH1 for digital (not analog) operation, and
16079  * configures the pin as an input.
16080  */
16081 # define CONFIG_RH1_AS_DIG_INPUT() \
16082  do { \
16083  DISABLE_RH1_ANALOG(); \
16084  CONFIG_RH1_AS_INPUT(); \
16085  DISABLE_RH1_OPENDRAIN(); \
16086  DISABLE_RH1_PULLUP(); \
16087  DISABLE_RH1_PULLDOWN(); \
16088  } while (0)
16089 
16090 /** This macro disables open-drain and pullups/downs,
16091  * configures pin RH1 for digital (not analog) operation, and
16092  * configures the pin as an output.
16093  */
16094 # define CONFIG_RH1_AS_DIG_OUTPUT() \
16095  do { \
16096  DISABLE_RH1_ANALOG(); \
16097  CONFIG_RH1_AS_OUTPUT(); \
16098  DISABLE_RH1_OPENDRAIN(); \
16099  DISABLE_RH1_PULLUP(); \
16100  DISABLE_RH1_PULLDOWN(); \
16101  } while (0)
16102 
16103 #endif // #if defined(_RH1) || defined(__DOXYGEN__): Provide GPIO for RH1
16104 
16105 
16106 
16107 
16108 
16109 // Provide GPIO for RH2
16110 // ====================
16111 #if defined(_RH2) || defined(__DOXYGEN__)
16112 
16113 // Dummy macros for documentation only
16114 # ifdef __DOXYGEN__
16115 /// This macro specifies the RPy value associated with pin RH2.
16116 /// Its device-specific definition is given in pic24_ports_mapping.h.
16117 # define RH2_RP xx
16118 
16119 /// This macro specifies the ANn value associated with pin RH2.
16120 /// Its device-specific definition is given in pic24_ports_mapping.h.
16121 # define RH2_AN xx
16122 
16123 /// This macro specifies the CNm value associated with pin RH2.
16124 /// Its device-specific definition is given in pic24_ports_mapping.h.
16125 # define RH2_CN xx
16126 
16127 //@}
16128 # endif // #ifdef __DOXYGEN__
16129 
16130 
16131 // Low-level config
16132 // ----------------
16133 // Analog:
16134 # if defined(_ANSH2) || defined(__DOXYGEN__)
16135 /// Enable analog functionality on pin RH2.
16136 # define ENABLE_RH2_ANALOG() (_ANSH2 = 1)
16137 /// Disable analog functionality on pin RH2.
16138 # define DISABLE_RH2_ANALOG() (_ANSH2 = 0)
16139 # elif defined(RH2_AN)
16140 # define ENABLE_RH2_ANALOG() (RXY_GPIO_PCFG(RH2_AN) = 0)
16141 # define DISABLE_RH2_ANALOG() (RXY_GPIO_PCFG(RH2_AN) = 1)
16142 # else
16143 # define DISABLE_RH2_ANALOG() ((void) 0)
16144 # endif
16145 
16146 // Input/output:
16147 /// Configure pin RH2 as an input.
16148 # define CONFIG_RH2_AS_INPUT() (_TRISH2 = 1)
16149 /// Configure pin RH2 as an output.
16150 # define CONFIG_RH2_AS_OUTPUT() (_TRISH2 = 0)
16151 
16152 // Open-drain:
16153 # if defined(_ODCH2) || defined(__DOXYGEN__)
16154 /// Enable the open-drain driver on pin RH2.
16155 # define ENABLE_RH2_OPENDRAIN() (_ODCH2 = 1)
16156 /// Disable the open-drain driver on pin RH2.
16157 # define DISABLE_RH2_OPENDRAIN() (_ODCH2 = 0)
16158 # elif defined(_ODH2) // The PIF24F names this bit _OD instead of _ODC.
16159 # define ENABLE_RH2_OPENDRAIN() (_ODH2 = 1)
16160 # define DISABLE_RH2_OPENDRAIN() (_ODH2 = 0)
16161 # else
16162 # define DISABLE_RH2_OPENDRAIN() ((void) 0)
16163 # endif
16164 
16165 // Change notification, pullups and pulldowns:
16166 # if defined(_CNIEH2) || defined(__DOXYGEN__)
16167 /// Enable the pullup on pin RH2.
16168 # define ENABLE_RH2_PULLUP() (_CNPUH2 = 1)
16169 /// Disable the pullup on pin RH2.
16170 # define DISABLE_RH2_PULLUP() (_CNPUH2 = 0)
16171 
16172 /// Enable the pulldown on pin RH2.
16173 # define ENABLE_RH2_PULLDOWN() (_CNPDH2 = 1)
16174 /// Disable the pulldown on pin RH2.
16175 # define DISABLE_RH2_PULLDOWN() (_CNPDH2 = 0)
16176 
16177 /// Enable the change notification interrupt on pin RH2.
16178 # define ENABLE_RH2_CN_INTERRUPT() (_CNIEH2 = 1)
16179 /// Disable the change notification interrupt on pin RH2.
16180 # define DISABLE_RH2_CN_INTERRUPT() (_CNIEH2 = 0)
16181 
16182 # elif defined(RH2_CN)
16183 # define ENABLE_RH2_PULLUP() (RXY_GPIO_CNPUE(RH2_CN) = 1)
16184 # define DISABLE_RH2_PULLUP() (RXY_GPIO_CNPUE(RH2_CN) = 0)
16185 
16186 # if RXY_HAS_CNPDE(RH2_CN)
16187 # define ENABLE_RH2_PULLDOWN() (RXY_GPIO_CNPDE(RH2_CN) = 1)
16188 # define DISABLE_RH2_PULLDOWN() (RXY_GPIO_CNPDE(RH2_CN) = 0)
16189 # else
16190 # define DISABLE_RH2_PULLDOWN() ((void) 0)
16191 # endif
16192 
16193 # define ENABLE_RH2_CN_INTERRUPT() (RXY_GPIO_CNIE(RH2_CN) = 1)
16194 # define DISABLE_RH2_CN_INTERRUPT() (RXY_GPIO_CNIE(RH2_CN) = 0)
16195 
16196 # else
16197 # define DISABLE_RH2_PULLUP() ((void) 0)
16198 # define DISABLE_RH2_PULLDOWN() ((void) 0)
16199 # define DISABLE_RH2_CN_INTERRUPT() ((void) 0)
16200 # endif
16201 
16202 // High-level config
16203 // -----------------
16204 /** This macro disables pullups/downs, enables analog functionality, and configures
16205  * pin RH2 as an input.
16206  */
16207 # if defined(_ANSH2) || defined(RH2_AN) || defined(__DOXYGEN__)
16208 # define CONFIG_RH2_AS_ANALOG() \
16209  do { \
16210  ENABLE_RH2_ANALOG(); \
16211  CONFIG_RH2_AS_INPUT(); \
16212  DISABLE_RH2_OPENDRAIN(); \
16213  DISABLE_RH2_PULLUP(); \
16214  DISABLE_RH2_PULLDOWN(); \
16215  } while (0)
16216 # endif
16217 
16218 /** This macro disables open-drain and pullups/downs,
16219  * configures pin RH2 for digital (not analog) operation, and
16220  * configures the pin as an input.
16221  */
16222 # define CONFIG_RH2_AS_DIG_INPUT() \
16223  do { \
16224  DISABLE_RH2_ANALOG(); \
16225  CONFIG_RH2_AS_INPUT(); \
16226  DISABLE_RH2_OPENDRAIN(); \
16227  DISABLE_RH2_PULLUP(); \
16228  DISABLE_RH2_PULLDOWN(); \
16229  } while (0)
16230 
16231 /** This macro disables open-drain and pullups/downs,
16232  * configures pin RH2 for digital (not analog) operation, and
16233  * configures the pin as an output.
16234  */
16235 # define CONFIG_RH2_AS_DIG_OUTPUT() \
16236  do { \
16237  DISABLE_RH2_ANALOG(); \
16238  CONFIG_RH2_AS_OUTPUT(); \
16239  DISABLE_RH2_OPENDRAIN(); \
16240  DISABLE_RH2_PULLUP(); \
16241  DISABLE_RH2_PULLDOWN(); \
16242  } while (0)
16243 
16244 #endif // #if defined(_RH2) || defined(__DOXYGEN__): Provide GPIO for RH2
16245 
16246 
16247 
16248 
16249 
16250 // Provide GPIO for RH3
16251 // ====================
16252 #if defined(_RH3) || defined(__DOXYGEN__)
16253 
16254 // Dummy macros for documentation only
16255 # ifdef __DOXYGEN__
16256 /// This macro specifies the RPy value associated with pin RH3.
16257 /// Its device-specific definition is given in pic24_ports_mapping.h.
16258 # define RH3_RP xx
16259 
16260 /// This macro specifies the ANn value associated with pin RH3.
16261 /// Its device-specific definition is given in pic24_ports_mapping.h.
16262 # define RH3_AN xx
16263 
16264 /// This macro specifies the CNm value associated with pin RH3.
16265 /// Its device-specific definition is given in pic24_ports_mapping.h.
16266 # define RH3_CN xx
16267 
16268 //@}
16269 # endif // #ifdef __DOXYGEN__
16270 
16271 
16272 // Low-level config
16273 // ----------------
16274 // Analog:
16275 # if defined(_ANSH3) || defined(__DOXYGEN__)
16276 /// Enable analog functionality on pin RH3.
16277 # define ENABLE_RH3_ANALOG() (_ANSH3 = 1)
16278 /// Disable analog functionality on pin RH3.
16279 # define DISABLE_RH3_ANALOG() (_ANSH3 = 0)
16280 # elif defined(RH3_AN)
16281 # define ENABLE_RH3_ANALOG() (RXY_GPIO_PCFG(RH3_AN) = 0)
16282 # define DISABLE_RH3_ANALOG() (RXY_GPIO_PCFG(RH3_AN) = 1)
16283 # else
16284 # define DISABLE_RH3_ANALOG() ((void) 0)
16285 # endif
16286 
16287 // Input/output:
16288 /// Configure pin RH3 as an input.
16289 # define CONFIG_RH3_AS_INPUT() (_TRISH3 = 1)
16290 /// Configure pin RH3 as an output.
16291 # define CONFIG_RH3_AS_OUTPUT() (_TRISH3 = 0)
16292 
16293 // Open-drain:
16294 # if defined(_ODCH3) || defined(__DOXYGEN__)
16295 /// Enable the open-drain driver on pin RH3.
16296 # define ENABLE_RH3_OPENDRAIN() (_ODCH3 = 1)
16297 /// Disable the open-drain driver on pin RH3.
16298 # define DISABLE_RH3_OPENDRAIN() (_ODCH3 = 0)
16299 # elif defined(_ODH3) // The PIF24F names this bit _OD instead of _ODC.
16300 # define ENABLE_RH3_OPENDRAIN() (_ODH3 = 1)
16301 # define DISABLE_RH3_OPENDRAIN() (_ODH3 = 0)
16302 # else
16303 # define DISABLE_RH3_OPENDRAIN() ((void) 0)
16304 # endif
16305 
16306 // Change notification, pullups and pulldowns:
16307 # if defined(_CNIEH3) || defined(__DOXYGEN__)
16308 /// Enable the pullup on pin RH3.
16309 # define ENABLE_RH3_PULLUP() (_CNPUH3 = 1)
16310 /// Disable the pullup on pin RH3.
16311 # define DISABLE_RH3_PULLUP() (_CNPUH3 = 0)
16312 
16313 /// Enable the pulldown on pin RH3.
16314 # define ENABLE_RH3_PULLDOWN() (_CNPDH3 = 1)
16315 /// Disable the pulldown on pin RH3.
16316 # define DISABLE_RH3_PULLDOWN() (_CNPDH3 = 0)
16317 
16318 /// Enable the change notification interrupt on pin RH3.
16319 # define ENABLE_RH3_CN_INTERRUPT() (_CNIEH3 = 1)
16320 /// Disable the change notification interrupt on pin RH3.
16321 # define DISABLE_RH3_CN_INTERRUPT() (_CNIEH3 = 0)
16322 
16323 # elif defined(RH3_CN)
16324 # define ENABLE_RH3_PULLUP() (RXY_GPIO_CNPUE(RH3_CN) = 1)
16325 # define DISABLE_RH3_PULLUP() (RXY_GPIO_CNPUE(RH3_CN) = 0)
16326 
16327 # if RXY_HAS_CNPDE(RH3_CN)
16328 # define ENABLE_RH3_PULLDOWN() (RXY_GPIO_CNPDE(RH3_CN) = 1)
16329 # define DISABLE_RH3_PULLDOWN() (RXY_GPIO_CNPDE(RH3_CN) = 0)
16330 # else
16331 # define DISABLE_RH3_PULLDOWN() ((void) 0)
16332 # endif
16333 
16334 # define ENABLE_RH3_CN_INTERRUPT() (RXY_GPIO_CNIE(RH3_CN) = 1)
16335 # define DISABLE_RH3_CN_INTERRUPT() (RXY_GPIO_CNIE(RH3_CN) = 0)
16336 
16337 # else
16338 # define DISABLE_RH3_PULLUP() ((void) 0)
16339 # define DISABLE_RH3_PULLDOWN() ((void) 0)
16340 # define DISABLE_RH3_CN_INTERRUPT() ((void) 0)
16341 # endif
16342 
16343 // High-level config
16344 // -----------------
16345 /** This macro disables pullups/downs, enables analog functionality, and configures
16346  * pin RH3 as an input.
16347  */
16348 # if defined(_ANSH3) || defined(RH3_AN) || defined(__DOXYGEN__)
16349 # define CONFIG_RH3_AS_ANALOG() \
16350  do { \
16351  ENABLE_RH3_ANALOG(); \
16352  CONFIG_RH3_AS_INPUT(); \
16353  DISABLE_RH3_OPENDRAIN(); \
16354  DISABLE_RH3_PULLUP(); \
16355  DISABLE_RH3_PULLDOWN(); \
16356  } while (0)
16357 # endif
16358 
16359 /** This macro disables open-drain and pullups/downs,
16360  * configures pin RH3 for digital (not analog) operation, and
16361  * configures the pin as an input.
16362  */
16363 # define CONFIG_RH3_AS_DIG_INPUT() \
16364  do { \
16365  DISABLE_RH3_ANALOG(); \
16366  CONFIG_RH3_AS_INPUT(); \
16367  DISABLE_RH3_OPENDRAIN(); \
16368  DISABLE_RH3_PULLUP(); \
16369  DISABLE_RH3_PULLDOWN(); \
16370  } while (0)
16371 
16372 /** This macro disables open-drain and pullups/downs,
16373  * configures pin RH3 for digital (not analog) operation, and
16374  * configures the pin as an output.
16375  */
16376 # define CONFIG_RH3_AS_DIG_OUTPUT() \
16377  do { \
16378  DISABLE_RH3_ANALOG(); \
16379  CONFIG_RH3_AS_OUTPUT(); \
16380  DISABLE_RH3_OPENDRAIN(); \
16381  DISABLE_RH3_PULLUP(); \
16382  DISABLE_RH3_PULLDOWN(); \
16383  } while (0)
16384 
16385 #endif // #if defined(_RH3) || defined(__DOXYGEN__): Provide GPIO for RH3
16386 
16387 
16388 
16389 
16390 
16391 // Provide GPIO for RH4
16392 // ====================
16393 #if defined(_RH4) || defined(__DOXYGEN__)
16394 
16395 // Dummy macros for documentation only
16396 # ifdef __DOXYGEN__
16397 /// This macro specifies the RPy value associated with pin RH4.
16398 /// Its device-specific definition is given in pic24_ports_mapping.h.
16399 # define RH4_RP xx
16400 
16401 /// This macro specifies the ANn value associated with pin RH4.
16402 /// Its device-specific definition is given in pic24_ports_mapping.h.
16403 # define RH4_AN xx
16404 
16405 /// This macro specifies the CNm value associated with pin RH4.
16406 /// Its device-specific definition is given in pic24_ports_mapping.h.
16407 # define RH4_CN xx
16408 
16409 //@}
16410 # endif // #ifdef __DOXYGEN__
16411 
16412 
16413 // Low-level config
16414 // ----------------
16415 // Analog:
16416 # if defined(_ANSH4) || defined(__DOXYGEN__)
16417 /// Enable analog functionality on pin RH4.
16418 # define ENABLE_RH4_ANALOG() (_ANSH4 = 1)
16419 /// Disable analog functionality on pin RH4.
16420 # define DISABLE_RH4_ANALOG() (_ANSH4 = 0)
16421 # elif defined(RH4_AN)
16422 # define ENABLE_RH4_ANALOG() (RXY_GPIO_PCFG(RH4_AN) = 0)
16423 # define DISABLE_RH4_ANALOG() (RXY_GPIO_PCFG(RH4_AN) = 1)
16424 # else
16425 # define DISABLE_RH4_ANALOG() ((void) 0)
16426 # endif
16427 
16428 // Input/output:
16429 /// Configure pin RH4 as an input.
16430 # define CONFIG_RH4_AS_INPUT() (_TRISH4 = 1)
16431 /// Configure pin RH4 as an output.
16432 # define CONFIG_RH4_AS_OUTPUT() (_TRISH4 = 0)
16433 
16434 // Open-drain:
16435 # if defined(_ODCH4) || defined(__DOXYGEN__)
16436 /// Enable the open-drain driver on pin RH4.
16437 # define ENABLE_RH4_OPENDRAIN() (_ODCH4 = 1)
16438 /// Disable the open-drain driver on pin RH4.
16439 # define DISABLE_RH4_OPENDRAIN() (_ODCH4 = 0)
16440 # elif defined(_ODH4) // The PIF24F names this bit _OD instead of _ODC.
16441 # define ENABLE_RH4_OPENDRAIN() (_ODH4 = 1)
16442 # define DISABLE_RH4_OPENDRAIN() (_ODH4 = 0)
16443 # else
16444 # define DISABLE_RH4_OPENDRAIN() ((void) 0)
16445 # endif
16446 
16447 // Change notification, pullups and pulldowns:
16448 # if defined(_CNIEH4) || defined(__DOXYGEN__)
16449 /// Enable the pullup on pin RH4.
16450 # define ENABLE_RH4_PULLUP() (_CNPUH4 = 1)
16451 /// Disable the pullup on pin RH4.
16452 # define DISABLE_RH4_PULLUP() (_CNPUH4 = 0)
16453 
16454 /// Enable the pulldown on pin RH4.
16455 # define ENABLE_RH4_PULLDOWN() (_CNPDH4 = 1)
16456 /// Disable the pulldown on pin RH4.
16457 # define DISABLE_RH4_PULLDOWN() (_CNPDH4 = 0)
16458 
16459 /// Enable the change notification interrupt on pin RH4.
16460 # define ENABLE_RH4_CN_INTERRUPT() (_CNIEH4 = 1)
16461 /// Disable the change notification interrupt on pin RH4.
16462 # define DISABLE_RH4_CN_INTERRUPT() (_CNIEH4 = 0)
16463 
16464 # elif defined(RH4_CN)
16465 # define ENABLE_RH4_PULLUP() (RXY_GPIO_CNPUE(RH4_CN) = 1)
16466 # define DISABLE_RH4_PULLUP() (RXY_GPIO_CNPUE(RH4_CN) = 0)
16467 
16468 # if RXY_HAS_CNPDE(RH4_CN)
16469 # define ENABLE_RH4_PULLDOWN() (RXY_GPIO_CNPDE(RH4_CN) = 1)
16470 # define DISABLE_RH4_PULLDOWN() (RXY_GPIO_CNPDE(RH4_CN) = 0)
16471 # else
16472 # define DISABLE_RH4_PULLDOWN() ((void) 0)
16473 # endif
16474 
16475 # define ENABLE_RH4_CN_INTERRUPT() (RXY_GPIO_CNIE(RH4_CN) = 1)
16476 # define DISABLE_RH4_CN_INTERRUPT() (RXY_GPIO_CNIE(RH4_CN) = 0)
16477 
16478 # else
16479 # define DISABLE_RH4_PULLUP() ((void) 0)
16480 # define DISABLE_RH4_PULLDOWN() ((void) 0)
16481 # define DISABLE_RH4_CN_INTERRUPT() ((void) 0)
16482 # endif
16483 
16484 // High-level config
16485 // -----------------
16486 /** This macro disables pullups/downs, enables analog functionality, and configures
16487  * pin RH4 as an input.
16488  */
16489 # if defined(_ANSH4) || defined(RH4_AN) || defined(__DOXYGEN__)
16490 # define CONFIG_RH4_AS_ANALOG() \
16491  do { \
16492  ENABLE_RH4_ANALOG(); \
16493  CONFIG_RH4_AS_INPUT(); \
16494  DISABLE_RH4_OPENDRAIN(); \
16495  DISABLE_RH4_PULLUP(); \
16496  DISABLE_RH4_PULLDOWN(); \
16497  } while (0)
16498 # endif
16499 
16500 /** This macro disables open-drain and pullups/downs,
16501  * configures pin RH4 for digital (not analog) operation, and
16502  * configures the pin as an input.
16503  */
16504 # define CONFIG_RH4_AS_DIG_INPUT() \
16505  do { \
16506  DISABLE_RH4_ANALOG(); \
16507  CONFIG_RH4_AS_INPUT(); \
16508  DISABLE_RH4_OPENDRAIN(); \
16509  DISABLE_RH4_PULLUP(); \
16510  DISABLE_RH4_PULLDOWN(); \
16511  } while (0)
16512 
16513 /** This macro disables open-drain and pullups/downs,
16514  * configures pin RH4 for digital (not analog) operation, and
16515  * configures the pin as an output.
16516  */
16517 # define CONFIG_RH4_AS_DIG_OUTPUT() \
16518  do { \
16519  DISABLE_RH4_ANALOG(); \
16520  CONFIG_RH4_AS_OUTPUT(); \
16521  DISABLE_RH4_OPENDRAIN(); \
16522  DISABLE_RH4_PULLUP(); \
16523  DISABLE_RH4_PULLDOWN(); \
16524  } while (0)
16525 
16526 #endif // #if defined(_RH4) || defined(__DOXYGEN__): Provide GPIO for RH4
16527 
16528 
16529 
16530 
16531 
16532 // Provide GPIO for RH5
16533 // ====================
16534 #if defined(_RH5) || defined(__DOXYGEN__)
16535 
16536 // Dummy macros for documentation only
16537 # ifdef __DOXYGEN__
16538 /// This macro specifies the RPy value associated with pin RH5.
16539 /// Its device-specific definition is given in pic24_ports_mapping.h.
16540 # define RH5_RP xx
16541 
16542 /// This macro specifies the ANn value associated with pin RH5.
16543 /// Its device-specific definition is given in pic24_ports_mapping.h.
16544 # define RH5_AN xx
16545 
16546 /// This macro specifies the CNm value associated with pin RH5.
16547 /// Its device-specific definition is given in pic24_ports_mapping.h.
16548 # define RH5_CN xx
16549 
16550 //@}
16551 # endif // #ifdef __DOXYGEN__
16552 
16553 
16554 // Low-level config
16555 // ----------------
16556 // Analog:
16557 # if defined(_ANSH5) || defined(__DOXYGEN__)
16558 /// Enable analog functionality on pin RH5.
16559 # define ENABLE_RH5_ANALOG() (_ANSH5 = 1)
16560 /// Disable analog functionality on pin RH5.
16561 # define DISABLE_RH5_ANALOG() (_ANSH5 = 0)
16562 # elif defined(RH5_AN)
16563 # define ENABLE_RH5_ANALOG() (RXY_GPIO_PCFG(RH5_AN) = 0)
16564 # define DISABLE_RH5_ANALOG() (RXY_GPIO_PCFG(RH5_AN) = 1)
16565 # else
16566 # define DISABLE_RH5_ANALOG() ((void) 0)
16567 # endif
16568 
16569 // Input/output:
16570 /// Configure pin RH5 as an input.
16571 # define CONFIG_RH5_AS_INPUT() (_TRISH5 = 1)
16572 /// Configure pin RH5 as an output.
16573 # define CONFIG_RH5_AS_OUTPUT() (_TRISH5 = 0)
16574 
16575 // Open-drain:
16576 # if defined(_ODCH5) || defined(__DOXYGEN__)
16577 /// Enable the open-drain driver on pin RH5.
16578 # define ENABLE_RH5_OPENDRAIN() (_ODCH5 = 1)
16579 /// Disable the open-drain driver on pin RH5.
16580 # define DISABLE_RH5_OPENDRAIN() (_ODCH5 = 0)
16581 # elif defined(_ODH5) // The PIF24F names this bit _OD instead of _ODC.
16582 # define ENABLE_RH5_OPENDRAIN() (_ODH5 = 1)
16583 # define DISABLE_RH5_OPENDRAIN() (_ODH5 = 0)
16584 # else
16585 # define DISABLE_RH5_OPENDRAIN() ((void) 0)
16586 # endif
16587 
16588 // Change notification, pullups and pulldowns:
16589 # if defined(_CNIEH5) || defined(__DOXYGEN__)
16590 /// Enable the pullup on pin RH5.
16591 # define ENABLE_RH5_PULLUP() (_CNPUH5 = 1)
16592 /// Disable the pullup on pin RH5.
16593 # define DISABLE_RH5_PULLUP() (_CNPUH5 = 0)
16594 
16595 /// Enable the pulldown on pin RH5.
16596 # define ENABLE_RH5_PULLDOWN() (_CNPDH5 = 1)
16597 /// Disable the pulldown on pin RH5.
16598 # define DISABLE_RH5_PULLDOWN() (_CNPDH5 = 0)
16599 
16600 /// Enable the change notification interrupt on pin RH5.
16601 # define ENABLE_RH5_CN_INTERRUPT() (_CNIEH5 = 1)
16602 /// Disable the change notification interrupt on pin RH5.
16603 # define DISABLE_RH5_CN_INTERRUPT() (_CNIEH5 = 0)
16604 
16605 # elif defined(RH5_CN)
16606 # define ENABLE_RH5_PULLUP() (RXY_GPIO_CNPUE(RH5_CN) = 1)
16607 # define DISABLE_RH5_PULLUP() (RXY_GPIO_CNPUE(RH5_CN) = 0)
16608 
16609 # if RXY_HAS_CNPDE(RH5_CN)
16610 # define ENABLE_RH5_PULLDOWN() (RXY_GPIO_CNPDE(RH5_CN) = 1)
16611 # define DISABLE_RH5_PULLDOWN() (RXY_GPIO_CNPDE(RH5_CN) = 0)
16612 # else
16613 # define DISABLE_RH5_PULLDOWN() ((void) 0)
16614 # endif
16615 
16616 # define ENABLE_RH5_CN_INTERRUPT() (RXY_GPIO_CNIE(RH5_CN) = 1)
16617 # define DISABLE_RH5_CN_INTERRUPT() (RXY_GPIO_CNIE(RH5_CN) = 0)
16618 
16619 # else
16620 # define DISABLE_RH5_PULLUP() ((void) 0)
16621 # define DISABLE_RH5_PULLDOWN() ((void) 0)
16622 # define DISABLE_RH5_CN_INTERRUPT() ((void) 0)
16623 # endif
16624 
16625 // High-level config
16626 // -----------------
16627 /** This macro disables pullups/downs, enables analog functionality, and configures
16628  * pin RH5 as an input.
16629  */
16630 # if defined(_ANSH5) || defined(RH5_AN) || defined(__DOXYGEN__)
16631 # define CONFIG_RH5_AS_ANALOG() \
16632  do { \
16633  ENABLE_RH5_ANALOG(); \
16634  CONFIG_RH5_AS_INPUT(); \
16635  DISABLE_RH5_OPENDRAIN(); \
16636  DISABLE_RH5_PULLUP(); \
16637  DISABLE_RH5_PULLDOWN(); \
16638  } while (0)
16639 # endif
16640 
16641 /** This macro disables open-drain and pullups/downs,
16642  * configures pin RH5 for digital (not analog) operation, and
16643  * configures the pin as an input.
16644  */
16645 # define CONFIG_RH5_AS_DIG_INPUT() \
16646  do { \
16647  DISABLE_RH5_ANALOG(); \
16648  CONFIG_RH5_AS_INPUT(); \
16649  DISABLE_RH5_OPENDRAIN(); \
16650  DISABLE_RH5_PULLUP(); \
16651  DISABLE_RH5_PULLDOWN(); \
16652  } while (0)
16653 
16654 /** This macro disables open-drain and pullups/downs,
16655  * configures pin RH5 for digital (not analog) operation, and
16656  * configures the pin as an output.
16657  */
16658 # define CONFIG_RH5_AS_DIG_OUTPUT() \
16659  do { \
16660  DISABLE_RH5_ANALOG(); \
16661  CONFIG_RH5_AS_OUTPUT(); \
16662  DISABLE_RH5_OPENDRAIN(); \
16663  DISABLE_RH5_PULLUP(); \
16664  DISABLE_RH5_PULLDOWN(); \
16665  } while (0)
16666 
16667 #endif // #if defined(_RH5) || defined(__DOXYGEN__): Provide GPIO for RH5
16668 
16669 
16670 
16671 
16672 
16673 // Provide GPIO for RH6
16674 // ====================
16675 #if defined(_RH6) || defined(__DOXYGEN__)
16676 
16677 // Dummy macros for documentation only
16678 # ifdef __DOXYGEN__
16679 /// This macro specifies the RPy value associated with pin RH6.
16680 /// Its device-specific definition is given in pic24_ports_mapping.h.
16681 # define RH6_RP xx
16682 
16683 /// This macro specifies the ANn value associated with pin RH6.
16684 /// Its device-specific definition is given in pic24_ports_mapping.h.
16685 # define RH6_AN xx
16686 
16687 /// This macro specifies the CNm value associated with pin RH6.
16688 /// Its device-specific definition is given in pic24_ports_mapping.h.
16689 # define RH6_CN xx
16690 
16691 //@}
16692 # endif // #ifdef __DOXYGEN__
16693 
16694 
16695 // Low-level config
16696 // ----------------
16697 // Analog:
16698 # if defined(_ANSH6) || defined(__DOXYGEN__)
16699 /// Enable analog functionality on pin RH6.
16700 # define ENABLE_RH6_ANALOG() (_ANSH6 = 1)
16701 /// Disable analog functionality on pin RH6.
16702 # define DISABLE_RH6_ANALOG() (_ANSH6 = 0)
16703 # elif defined(RH6_AN)
16704 # define ENABLE_RH6_ANALOG() (RXY_GPIO_PCFG(RH6_AN) = 0)
16705 # define DISABLE_RH6_ANALOG() (RXY_GPIO_PCFG(RH6_AN) = 1)
16706 # else
16707 # define DISABLE_RH6_ANALOG() ((void) 0)
16708 # endif
16709 
16710 // Input/output:
16711 /// Configure pin RH6 as an input.
16712 # define CONFIG_RH6_AS_INPUT() (_TRISH6 = 1)
16713 /// Configure pin RH6 as an output.
16714 # define CONFIG_RH6_AS_OUTPUT() (_TRISH6 = 0)
16715 
16716 // Open-drain:
16717 # if defined(_ODCH6) || defined(__DOXYGEN__)
16718 /// Enable the open-drain driver on pin RH6.
16719 # define ENABLE_RH6_OPENDRAIN() (_ODCH6 = 1)
16720 /// Disable the open-drain driver on pin RH6.
16721 # define DISABLE_RH6_OPENDRAIN() (_ODCH6 = 0)
16722 # elif defined(_ODH6) // The PIF24F names this bit _OD instead of _ODC.
16723 # define ENABLE_RH6_OPENDRAIN() (_ODH6 = 1)
16724 # define DISABLE_RH6_OPENDRAIN() (_ODH6 = 0)
16725 # else
16726 # define DISABLE_RH6_OPENDRAIN() ((void) 0)
16727 # endif
16728 
16729 // Change notification, pullups and pulldowns:
16730 # if defined(_CNIEH6) || defined(__DOXYGEN__)
16731 /// Enable the pullup on pin RH6.
16732 # define ENABLE_RH6_PULLUP() (_CNPUH6 = 1)
16733 /// Disable the pullup on pin RH6.
16734 # define DISABLE_RH6_PULLUP() (_CNPUH6 = 0)
16735 
16736 /// Enable the pulldown on pin RH6.
16737 # define ENABLE_RH6_PULLDOWN() (_CNPDH6 = 1)
16738 /// Disable the pulldown on pin RH6.
16739 # define DISABLE_RH6_PULLDOWN() (_CNPDH6 = 0)
16740 
16741 /// Enable the change notification interrupt on pin RH6.
16742 # define ENABLE_RH6_CN_INTERRUPT() (_CNIEH6 = 1)
16743 /// Disable the change notification interrupt on pin RH6.
16744 # define DISABLE_RH6_CN_INTERRUPT() (_CNIEH6 = 0)
16745 
16746 # elif defined(RH6_CN)
16747 # define ENABLE_RH6_PULLUP() (RXY_GPIO_CNPUE(RH6_CN) = 1)
16748 # define DISABLE_RH6_PULLUP() (RXY_GPIO_CNPUE(RH6_CN) = 0)
16749 
16750 # if RXY_HAS_CNPDE(RH6_CN)
16751 # define ENABLE_RH6_PULLDOWN() (RXY_GPIO_CNPDE(RH6_CN) = 1)
16752 # define DISABLE_RH6_PULLDOWN() (RXY_GPIO_CNPDE(RH6_CN) = 0)
16753 # else
16754 # define DISABLE_RH6_PULLDOWN() ((void) 0)
16755 # endif
16756 
16757 # define ENABLE_RH6_CN_INTERRUPT() (RXY_GPIO_CNIE(RH6_CN) = 1)
16758 # define DISABLE_RH6_CN_INTERRUPT() (RXY_GPIO_CNIE(RH6_CN) = 0)
16759 
16760 # else
16761 # define DISABLE_RH6_PULLUP() ((void) 0)
16762 # define DISABLE_RH6_PULLDOWN() ((void) 0)
16763 # define DISABLE_RH6_CN_INTERRUPT() ((void) 0)
16764 # endif
16765 
16766 // High-level config
16767 // -----------------
16768 /** This macro disables pullups/downs, enables analog functionality, and configures
16769  * pin RH6 as an input.
16770  */
16771 # if defined(_ANSH6) || defined(RH6_AN) || defined(__DOXYGEN__)
16772 # define CONFIG_RH6_AS_ANALOG() \
16773  do { \
16774  ENABLE_RH6_ANALOG(); \
16775  CONFIG_RH6_AS_INPUT(); \
16776  DISABLE_RH6_OPENDRAIN(); \
16777  DISABLE_RH6_PULLUP(); \
16778  DISABLE_RH6_PULLDOWN(); \
16779  } while (0)
16780 # endif
16781 
16782 /** This macro disables open-drain and pullups/downs,
16783  * configures pin RH6 for digital (not analog) operation, and
16784  * configures the pin as an input.
16785  */
16786 # define CONFIG_RH6_AS_DIG_INPUT() \
16787  do { \
16788  DISABLE_RH6_ANALOG(); \
16789  CONFIG_RH6_AS_INPUT(); \
16790  DISABLE_RH6_OPENDRAIN(); \
16791  DISABLE_RH6_PULLUP(); \
16792  DISABLE_RH6_PULLDOWN(); \
16793  } while (0)
16794 
16795 /** This macro disables open-drain and pullups/downs,
16796  * configures pin RH6 for digital (not analog) operation, and
16797  * configures the pin as an output.
16798  */
16799 # define CONFIG_RH6_AS_DIG_OUTPUT() \
16800  do { \
16801  DISABLE_RH6_ANALOG(); \
16802  CONFIG_RH6_AS_OUTPUT(); \
16803  DISABLE_RH6_OPENDRAIN(); \
16804  DISABLE_RH6_PULLUP(); \
16805  DISABLE_RH6_PULLDOWN(); \
16806  } while (0)
16807 
16808 #endif // #if defined(_RH6) || defined(__DOXYGEN__): Provide GPIO for RH6
16809 
16810 
16811 
16812 
16813 
16814 // Provide GPIO for RH7
16815 // ====================
16816 #if defined(_RH7) || defined(__DOXYGEN__)
16817 
16818 // Dummy macros for documentation only
16819 # ifdef __DOXYGEN__
16820 /// This macro specifies the RPy value associated with pin RH7.
16821 /// Its device-specific definition is given in pic24_ports_mapping.h.
16822 # define RH7_RP xx
16823 
16824 /// This macro specifies the ANn value associated with pin RH7.
16825 /// Its device-specific definition is given in pic24_ports_mapping.h.
16826 # define RH7_AN xx
16827 
16828 /// This macro specifies the CNm value associated with pin RH7.
16829 /// Its device-specific definition is given in pic24_ports_mapping.h.
16830 # define RH7_CN xx
16831 
16832 //@}
16833 # endif // #ifdef __DOXYGEN__
16834 
16835 
16836 // Low-level config
16837 // ----------------
16838 // Analog:
16839 # if defined(_ANSH7) || defined(__DOXYGEN__)
16840 /// Enable analog functionality on pin RH7.
16841 # define ENABLE_RH7_ANALOG() (_ANSH7 = 1)
16842 /// Disable analog functionality on pin RH7.
16843 # define DISABLE_RH7_ANALOG() (_ANSH7 = 0)
16844 # elif defined(RH7_AN)
16845 # define ENABLE_RH7_ANALOG() (RXY_GPIO_PCFG(RH7_AN) = 0)
16846 # define DISABLE_RH7_ANALOG() (RXY_GPIO_PCFG(RH7_AN) = 1)
16847 # else
16848 # define DISABLE_RH7_ANALOG() ((void) 0)
16849 # endif
16850 
16851 // Input/output:
16852 /// Configure pin RH7 as an input.
16853 # define CONFIG_RH7_AS_INPUT() (_TRISH7 = 1)
16854 /// Configure pin RH7 as an output.
16855 # define CONFIG_RH7_AS_OUTPUT() (_TRISH7 = 0)
16856 
16857 // Open-drain:
16858 # if defined(_ODCH7) || defined(__DOXYGEN__)
16859 /// Enable the open-drain driver on pin RH7.
16860 # define ENABLE_RH7_OPENDRAIN() (_ODCH7 = 1)
16861 /// Disable the open-drain driver on pin RH7.
16862 # define DISABLE_RH7_OPENDRAIN() (_ODCH7 = 0)
16863 # elif defined(_ODH7) // The PIF24F names this bit _OD instead of _ODC.
16864 # define ENABLE_RH7_OPENDRAIN() (_ODH7 = 1)
16865 # define DISABLE_RH7_OPENDRAIN() (_ODH7 = 0)
16866 # else
16867 # define DISABLE_RH7_OPENDRAIN() ((void) 0)
16868 # endif
16869 
16870 // Change notification, pullups and pulldowns:
16871 # if defined(_CNIEH7) || defined(__DOXYGEN__)
16872 /// Enable the pullup on pin RH7.
16873 # define ENABLE_RH7_PULLUP() (_CNPUH7 = 1)
16874 /// Disable the pullup on pin RH7.
16875 # define DISABLE_RH7_PULLUP() (_CNPUH7 = 0)
16876 
16877 /// Enable the pulldown on pin RH7.
16878 # define ENABLE_RH7_PULLDOWN() (_CNPDH7 = 1)
16879 /// Disable the pulldown on pin RH7.
16880 # define DISABLE_RH7_PULLDOWN() (_CNPDH7 = 0)
16881 
16882 /// Enable the change notification interrupt on pin RH7.
16883 # define ENABLE_RH7_CN_INTERRUPT() (_CNIEH7 = 1)
16884 /// Disable the change notification interrupt on pin RH7.
16885 # define DISABLE_RH7_CN_INTERRUPT() (_CNIEH7 = 0)
16886 
16887 # elif defined(RH7_CN)
16888 # define ENABLE_RH7_PULLUP() (RXY_GPIO_CNPUE(RH7_CN) = 1)
16889 # define DISABLE_RH7_PULLUP() (RXY_GPIO_CNPUE(RH7_CN) = 0)
16890 
16891 # if RXY_HAS_CNPDE(RH7_CN)
16892 # define ENABLE_RH7_PULLDOWN() (RXY_GPIO_CNPDE(RH7_CN) = 1)
16893 # define DISABLE_RH7_PULLDOWN() (RXY_GPIO_CNPDE(RH7_CN) = 0)
16894 # else
16895 # define DISABLE_RH7_PULLDOWN() ((void) 0)
16896 # endif
16897 
16898 # define ENABLE_RH7_CN_INTERRUPT() (RXY_GPIO_CNIE(RH7_CN) = 1)
16899 # define DISABLE_RH7_CN_INTERRUPT() (RXY_GPIO_CNIE(RH7_CN) = 0)
16900 
16901 # else
16902 # define DISABLE_RH7_PULLUP() ((void) 0)
16903 # define DISABLE_RH7_PULLDOWN() ((void) 0)
16904 # define DISABLE_RH7_CN_INTERRUPT() ((void) 0)
16905 # endif
16906 
16907 // High-level config
16908 // -----------------
16909 /** This macro disables pullups/downs, enables analog functionality, and configures
16910  * pin RH7 as an input.
16911  */
16912 # if defined(_ANSH7) || defined(RH7_AN) || defined(__DOXYGEN__)
16913 # define CONFIG_RH7_AS_ANALOG() \
16914  do { \
16915  ENABLE_RH7_ANALOG(); \
16916  CONFIG_RH7_AS_INPUT(); \
16917  DISABLE_RH7_OPENDRAIN(); \
16918  DISABLE_RH7_PULLUP(); \
16919  DISABLE_RH7_PULLDOWN(); \
16920  } while (0)
16921 # endif
16922 
16923 /** This macro disables open-drain and pullups/downs,
16924  * configures pin RH7 for digital (not analog) operation, and
16925  * configures the pin as an input.
16926  */
16927 # define CONFIG_RH7_AS_DIG_INPUT() \
16928  do { \
16929  DISABLE_RH7_ANALOG(); \
16930  CONFIG_RH7_AS_INPUT(); \
16931  DISABLE_RH7_OPENDRAIN(); \
16932  DISABLE_RH7_PULLUP(); \
16933  DISABLE_RH7_PULLDOWN(); \
16934  } while (0)
16935 
16936 /** This macro disables open-drain and pullups/downs,
16937  * configures pin RH7 for digital (not analog) operation, and
16938  * configures the pin as an output.
16939  */
16940 # define CONFIG_RH7_AS_DIG_OUTPUT() \
16941  do { \
16942  DISABLE_RH7_ANALOG(); \
16943  CONFIG_RH7_AS_OUTPUT(); \
16944  DISABLE_RH7_OPENDRAIN(); \
16945  DISABLE_RH7_PULLUP(); \
16946  DISABLE_RH7_PULLDOWN(); \
16947  } while (0)
16948 
16949 #endif // #if defined(_RH7) || defined(__DOXYGEN__): Provide GPIO for RH7
16950 
16951 
16952 
16953 
16954 
16955 // Provide GPIO for RH8
16956 // ====================
16957 #if defined(_RH8) || defined(__DOXYGEN__)
16958 
16959 // Dummy macros for documentation only
16960 # ifdef __DOXYGEN__
16961 /// This macro specifies the RPy value associated with pin RH8.
16962 /// Its device-specific definition is given in pic24_ports_mapping.h.
16963 # define RH8_RP xx
16964 
16965 /// This macro specifies the ANn value associated with pin RH8.
16966 /// Its device-specific definition is given in pic24_ports_mapping.h.
16967 # define RH8_AN xx
16968 
16969 /// This macro specifies the CNm value associated with pin RH8.
16970 /// Its device-specific definition is given in pic24_ports_mapping.h.
16971 # define RH8_CN xx
16972 
16973 //@}
16974 # endif // #ifdef __DOXYGEN__
16975 
16976 
16977 // Low-level config
16978 // ----------------
16979 // Analog:
16980 # if defined(_ANSH8) || defined(__DOXYGEN__)
16981 /// Enable analog functionality on pin RH8.
16982 # define ENABLE_RH8_ANALOG() (_ANSH8 = 1)
16983 /// Disable analog functionality on pin RH8.
16984 # define DISABLE_RH8_ANALOG() (_ANSH8 = 0)
16985 # elif defined(RH8_AN)
16986 # define ENABLE_RH8_ANALOG() (RXY_GPIO_PCFG(RH8_AN) = 0)
16987 # define DISABLE_RH8_ANALOG() (RXY_GPIO_PCFG(RH8_AN) = 1)
16988 # else
16989 # define DISABLE_RH8_ANALOG() ((void) 0)
16990 # endif
16991 
16992 // Input/output:
16993 /// Configure pin RH8 as an input.
16994 # define CONFIG_RH8_AS_INPUT() (_TRISH8 = 1)
16995 /// Configure pin RH8 as an output.
16996 # define CONFIG_RH8_AS_OUTPUT() (_TRISH8 = 0)
16997 
16998 // Open-drain:
16999 # if defined(_ODCH8) || defined(__DOXYGEN__)
17000 /// Enable the open-drain driver on pin RH8.
17001 # define ENABLE_RH8_OPENDRAIN() (_ODCH8 = 1)
17002 /// Disable the open-drain driver on pin RH8.
17003 # define DISABLE_RH8_OPENDRAIN() (_ODCH8 = 0)
17004 # elif defined(_ODH8) // The PIF24F names this bit _OD instead of _ODC.
17005 # define ENABLE_RH8_OPENDRAIN() (_ODH8 = 1)
17006 # define DISABLE_RH8_OPENDRAIN() (_ODH8 = 0)
17007 # else
17008 # define DISABLE_RH8_OPENDRAIN() ((void) 0)
17009 # endif
17010 
17011 // Change notification, pullups and pulldowns:
17012 # if defined(_CNIEH8) || defined(__DOXYGEN__)
17013 /// Enable the pullup on pin RH8.
17014 # define ENABLE_RH8_PULLUP() (_CNPUH8 = 1)
17015 /// Disable the pullup on pin RH8.
17016 # define DISABLE_RH8_PULLUP() (_CNPUH8 = 0)
17017 
17018 /// Enable the pulldown on pin RH8.
17019 # define ENABLE_RH8_PULLDOWN() (_CNPDH8 = 1)
17020 /// Disable the pulldown on pin RH8.
17021 # define DISABLE_RH8_PULLDOWN() (_CNPDH8 = 0)
17022 
17023 /// Enable the change notification interrupt on pin RH8.
17024 # define ENABLE_RH8_CN_INTERRUPT() (_CNIEH8 = 1)
17025 /// Disable the change notification interrupt on pin RH8.
17026 # define DISABLE_RH8_CN_INTERRUPT() (_CNIEH8 = 0)
17027 
17028 # elif defined(RH8_CN)
17029 # define ENABLE_RH8_PULLUP() (RXY_GPIO_CNPUE(RH8_CN) = 1)
17030 # define DISABLE_RH8_PULLUP() (RXY_GPIO_CNPUE(RH8_CN) = 0)
17031 
17032 # if RXY_HAS_CNPDE(RH8_CN)
17033 # define ENABLE_RH8_PULLDOWN() (RXY_GPIO_CNPDE(RH8_CN) = 1)
17034 # define DISABLE_RH8_PULLDOWN() (RXY_GPIO_CNPDE(RH8_CN) = 0)
17035 # else
17036 # define DISABLE_RH8_PULLDOWN() ((void) 0)
17037 # endif
17038 
17039 # define ENABLE_RH8_CN_INTERRUPT() (RXY_GPIO_CNIE(RH8_CN) = 1)
17040 # define DISABLE_RH8_CN_INTERRUPT() (RXY_GPIO_CNIE(RH8_CN) = 0)
17041 
17042 # else
17043 # define DISABLE_RH8_PULLUP() ((void) 0)
17044 # define DISABLE_RH8_PULLDOWN() ((void) 0)
17045 # define DISABLE_RH8_CN_INTERRUPT() ((void) 0)
17046 # endif
17047 
17048 // High-level config
17049 // -----------------
17050 /** This macro disables pullups/downs, enables analog functionality, and configures
17051  * pin RH8 as an input.
17052  */
17053 # if defined(_ANSH8) || defined(RH8_AN) || defined(__DOXYGEN__)
17054 # define CONFIG_RH8_AS_ANALOG() \
17055  do { \
17056  ENABLE_RH8_ANALOG(); \
17057  CONFIG_RH8_AS_INPUT(); \
17058  DISABLE_RH8_OPENDRAIN(); \
17059  DISABLE_RH8_PULLUP(); \
17060  DISABLE_RH8_PULLDOWN(); \
17061  } while (0)
17062 # endif
17063 
17064 /** This macro disables open-drain and pullups/downs,
17065  * configures pin RH8 for digital (not analog) operation, and
17066  * configures the pin as an input.
17067  */
17068 # define CONFIG_RH8_AS_DIG_INPUT() \
17069  do { \
17070  DISABLE_RH8_ANALOG(); \
17071  CONFIG_RH8_AS_INPUT(); \
17072  DISABLE_RH8_OPENDRAIN(); \
17073  DISABLE_RH8_PULLUP(); \
17074  DISABLE_RH8_PULLDOWN(); \
17075  } while (0)
17076 
17077 /** This macro disables open-drain and pullups/downs,
17078  * configures pin RH8 for digital (not analog) operation, and
17079  * configures the pin as an output.
17080  */
17081 # define CONFIG_RH8_AS_DIG_OUTPUT() \
17082  do { \
17083  DISABLE_RH8_ANALOG(); \
17084  CONFIG_RH8_AS_OUTPUT(); \
17085  DISABLE_RH8_OPENDRAIN(); \
17086  DISABLE_RH8_PULLUP(); \
17087  DISABLE_RH8_PULLDOWN(); \
17088  } while (0)
17089 
17090 #endif // #if defined(_RH8) || defined(__DOXYGEN__): Provide GPIO for RH8
17091 
17092 
17093 
17094 
17095 
17096 // Provide GPIO for RH9
17097 // ====================
17098 #if defined(_RH9) || defined(__DOXYGEN__)
17099 
17100 // Dummy macros for documentation only
17101 # ifdef __DOXYGEN__
17102 /// This macro specifies the RPy value associated with pin RH9.
17103 /// Its device-specific definition is given in pic24_ports_mapping.h.
17104 # define RH9_RP xx
17105 
17106 /// This macro specifies the ANn value associated with pin RH9.
17107 /// Its device-specific definition is given in pic24_ports_mapping.h.
17108 # define RH9_AN xx
17109 
17110 /// This macro specifies the CNm value associated with pin RH9.
17111 /// Its device-specific definition is given in pic24_ports_mapping.h.
17112 # define RH9_CN xx
17113 
17114 //@}
17115 # endif // #ifdef __DOXYGEN__
17116 
17117 
17118 // Low-level config
17119 // ----------------
17120 // Analog:
17121 # if defined(_ANSH9) || defined(__DOXYGEN__)
17122 /// Enable analog functionality on pin RH9.
17123 # define ENABLE_RH9_ANALOG() (_ANSH9 = 1)
17124 /// Disable analog functionality on pin RH9.
17125 # define DISABLE_RH9_ANALOG() (_ANSH9 = 0)
17126 # elif defined(RH9_AN)
17127 # define ENABLE_RH9_ANALOG() (RXY_GPIO_PCFG(RH9_AN) = 0)
17128 # define DISABLE_RH9_ANALOG() (RXY_GPIO_PCFG(RH9_AN) = 1)
17129 # else
17130 # define DISABLE_RH9_ANALOG() ((void) 0)
17131 # endif
17132 
17133 // Input/output:
17134 /// Configure pin RH9 as an input.
17135 # define CONFIG_RH9_AS_INPUT() (_TRISH9 = 1)
17136 /// Configure pin RH9 as an output.
17137 # define CONFIG_RH9_AS_OUTPUT() (_TRISH9 = 0)
17138 
17139 // Open-drain:
17140 # if defined(_ODCH9) || defined(__DOXYGEN__)
17141 /// Enable the open-drain driver on pin RH9.
17142 # define ENABLE_RH9_OPENDRAIN() (_ODCH9 = 1)
17143 /// Disable the open-drain driver on pin RH9.
17144 # define DISABLE_RH9_OPENDRAIN() (_ODCH9 = 0)
17145 # elif defined(_ODH9) // The PIF24F names this bit _OD instead of _ODC.
17146 # define ENABLE_RH9_OPENDRAIN() (_ODH9 = 1)
17147 # define DISABLE_RH9_OPENDRAIN() (_ODH9 = 0)
17148 # else
17149 # define DISABLE_RH9_OPENDRAIN() ((void) 0)
17150 # endif
17151 
17152 // Change notification, pullups and pulldowns:
17153 # if defined(_CNIEH9) || defined(__DOXYGEN__)
17154 /// Enable the pullup on pin RH9.
17155 # define ENABLE_RH9_PULLUP() (_CNPUH9 = 1)
17156 /// Disable the pullup on pin RH9.
17157 # define DISABLE_RH9_PULLUP() (_CNPUH9 = 0)
17158 
17159 /// Enable the pulldown on pin RH9.
17160 # define ENABLE_RH9_PULLDOWN() (_CNPDH9 = 1)
17161 /// Disable the pulldown on pin RH9.
17162 # define DISABLE_RH9_PULLDOWN() (_CNPDH9 = 0)
17163 
17164 /// Enable the change notification interrupt on pin RH9.
17165 # define ENABLE_RH9_CN_INTERRUPT() (_CNIEH9 = 1)
17166 /// Disable the change notification interrupt on pin RH9.
17167 # define DISABLE_RH9_CN_INTERRUPT() (_CNIEH9 = 0)
17168 
17169 # elif defined(RH9_CN)
17170 # define ENABLE_RH9_PULLUP() (RXY_GPIO_CNPUE(RH9_CN) = 1)
17171 # define DISABLE_RH9_PULLUP() (RXY_GPIO_CNPUE(RH9_CN) = 0)
17172 
17173 # if RXY_HAS_CNPDE(RH9_CN)
17174 # define ENABLE_RH9_PULLDOWN() (RXY_GPIO_CNPDE(RH9_CN) = 1)
17175 # define DISABLE_RH9_PULLDOWN() (RXY_GPIO_CNPDE(RH9_CN) = 0)
17176 # else
17177 # define DISABLE_RH9_PULLDOWN() ((void) 0)
17178 # endif
17179 
17180 # define ENABLE_RH9_CN_INTERRUPT() (RXY_GPIO_CNIE(RH9_CN) = 1)
17181 # define DISABLE_RH9_CN_INTERRUPT() (RXY_GPIO_CNIE(RH9_CN) = 0)
17182 
17183 # else
17184 # define DISABLE_RH9_PULLUP() ((void) 0)
17185 # define DISABLE_RH9_PULLDOWN() ((void) 0)
17186 # define DISABLE_RH9_CN_INTERRUPT() ((void) 0)
17187 # endif
17188 
17189 // High-level config
17190 // -----------------
17191 /** This macro disables pullups/downs, enables analog functionality, and configures
17192  * pin RH9 as an input.
17193  */
17194 # if defined(_ANSH9) || defined(RH9_AN) || defined(__DOXYGEN__)
17195 # define CONFIG_RH9_AS_ANALOG() \
17196  do { \
17197  ENABLE_RH9_ANALOG(); \
17198  CONFIG_RH9_AS_INPUT(); \
17199  DISABLE_RH9_OPENDRAIN(); \
17200  DISABLE_RH9_PULLUP(); \
17201  DISABLE_RH9_PULLDOWN(); \
17202  } while (0)
17203 # endif
17204 
17205 /** This macro disables open-drain and pullups/downs,
17206  * configures pin RH9 for digital (not analog) operation, and
17207  * configures the pin as an input.
17208  */
17209 # define CONFIG_RH9_AS_DIG_INPUT() \
17210  do { \
17211  DISABLE_RH9_ANALOG(); \
17212  CONFIG_RH9_AS_INPUT(); \
17213  DISABLE_RH9_OPENDRAIN(); \
17214  DISABLE_RH9_PULLUP(); \
17215  DISABLE_RH9_PULLDOWN(); \
17216  } while (0)
17217 
17218 /** This macro disables open-drain and pullups/downs,
17219  * configures pin RH9 for digital (not analog) operation, and
17220  * configures the pin as an output.
17221  */
17222 # define CONFIG_RH9_AS_DIG_OUTPUT() \
17223  do { \
17224  DISABLE_RH9_ANALOG(); \
17225  CONFIG_RH9_AS_OUTPUT(); \
17226  DISABLE_RH9_OPENDRAIN(); \
17227  DISABLE_RH9_PULLUP(); \
17228  DISABLE_RH9_PULLDOWN(); \
17229  } while (0)
17230 
17231 #endif // #if defined(_RH9) || defined(__DOXYGEN__): Provide GPIO for RH9
17232 
17233 
17234 
17235 
17236 
17237 // Provide GPIO for RH10
17238 // ====================
17239 #if defined(_RH10) || defined(__DOXYGEN__)
17240 
17241 // Dummy macros for documentation only
17242 # ifdef __DOXYGEN__
17243 /// This macro specifies the RPy value associated with pin RH10.
17244 /// Its device-specific definition is given in pic24_ports_mapping.h.
17245 # define RH10_RP xx
17246 
17247 /// This macro specifies the ANn value associated with pin RH10.
17248 /// Its device-specific definition is given in pic24_ports_mapping.h.
17249 # define RH10_AN xx
17250 
17251 /// This macro specifies the CNm value associated with pin RH10.
17252 /// Its device-specific definition is given in pic24_ports_mapping.h.
17253 # define RH10_CN xx
17254 
17255 //@}
17256 # endif // #ifdef __DOXYGEN__
17257 
17258 
17259 // Low-level config
17260 // ----------------
17261 // Analog:
17262 # if defined(_ANSH10) || defined(__DOXYGEN__)
17263 /// Enable analog functionality on pin RH10.
17264 # define ENABLE_RH10_ANALOG() (_ANSH10 = 1)
17265 /// Disable analog functionality on pin RH10.
17266 # define DISABLE_RH10_ANALOG() (_ANSH10 = 0)
17267 # elif defined(RH10_AN)
17268 # define ENABLE_RH10_ANALOG() (RXY_GPIO_PCFG(RH10_AN) = 0)
17269 # define DISABLE_RH10_ANALOG() (RXY_GPIO_PCFG(RH10_AN) = 1)
17270 # else
17271 # define DISABLE_RH10_ANALOG() ((void) 0)
17272 # endif
17273 
17274 // Input/output:
17275 /// Configure pin RH10 as an input.
17276 # define CONFIG_RH10_AS_INPUT() (_TRISH10 = 1)
17277 /// Configure pin RH10 as an output.
17278 # define CONFIG_RH10_AS_OUTPUT() (_TRISH10 = 0)
17279 
17280 // Open-drain:
17281 # if defined(_ODCH10) || defined(__DOXYGEN__)
17282 /// Enable the open-drain driver on pin RH10.
17283 # define ENABLE_RH10_OPENDRAIN() (_ODCH10 = 1)
17284 /// Disable the open-drain driver on pin RH10.
17285 # define DISABLE_RH10_OPENDRAIN() (_ODCH10 = 0)
17286 # elif defined(_ODH10) // The PIF24F names this bit _OD instead of _ODC.
17287 # define ENABLE_RH10_OPENDRAIN() (_ODH10 = 1)
17288 # define DISABLE_RH10_OPENDRAIN() (_ODH10 = 0)
17289 # else
17290 # define DISABLE_RH10_OPENDRAIN() ((void) 0)
17291 # endif
17292 
17293 // Change notification, pullups and pulldowns:
17294 # if defined(_CNIEH10) || defined(__DOXYGEN__)
17295 /// Enable the pullup on pin RH10.
17296 # define ENABLE_RH10_PULLUP() (_CNPUH10 = 1)
17297 /// Disable the pullup on pin RH10.
17298 # define DISABLE_RH10_PULLUP() (_CNPUH10 = 0)
17299 
17300 /// Enable the pulldown on pin RH10.
17301 # define ENABLE_RH10_PULLDOWN() (_CNPDH10 = 1)
17302 /// Disable the pulldown on pin RH10.
17303 # define DISABLE_RH10_PULLDOWN() (_CNPDH10 = 0)
17304 
17305 /// Enable the change notification interrupt on pin RH10.
17306 # define ENABLE_RH10_CN_INTERRUPT() (_CNIEH10 = 1)
17307 /// Disable the change notification interrupt on pin RH10.
17308 # define DISABLE_RH10_CN_INTERRUPT() (_CNIEH10 = 0)
17309 
17310 # elif defined(RH10_CN)
17311 # define ENABLE_RH10_PULLUP() (RXY_GPIO_CNPUE(RH10_CN) = 1)
17312 # define DISABLE_RH10_PULLUP() (RXY_GPIO_CNPUE(RH10_CN) = 0)
17313 
17314 # if RXY_HAS_CNPDE(RH10_CN)
17315 # define ENABLE_RH10_PULLDOWN() (RXY_GPIO_CNPDE(RH10_CN) = 1)
17316 # define DISABLE_RH10_PULLDOWN() (RXY_GPIO_CNPDE(RH10_CN) = 0)
17317 # else
17318 # define DISABLE_RH10_PULLDOWN() ((void) 0)
17319 # endif
17320 
17321 # define ENABLE_RH10_CN_INTERRUPT() (RXY_GPIO_CNIE(RH10_CN) = 1)
17322 # define DISABLE_RH10_CN_INTERRUPT() (RXY_GPIO_CNIE(RH10_CN) = 0)
17323 
17324 # else
17325 # define DISABLE_RH10_PULLUP() ((void) 0)
17326 # define DISABLE_RH10_PULLDOWN() ((void) 0)
17327 # define DISABLE_RH10_CN_INTERRUPT() ((void) 0)
17328 # endif
17329 
17330 // High-level config
17331 // -----------------
17332 /** This macro disables pullups/downs, enables analog functionality, and configures
17333  * pin RH10 as an input.
17334  */
17335 # if defined(_ANSH10) || defined(RH10_AN) || defined(__DOXYGEN__)
17336 # define CONFIG_RH10_AS_ANALOG() \
17337  do { \
17338  ENABLE_RH10_ANALOG(); \
17339  CONFIG_RH10_AS_INPUT(); \
17340  DISABLE_RH10_OPENDRAIN(); \
17341  DISABLE_RH10_PULLUP(); \
17342  DISABLE_RH10_PULLDOWN(); \
17343  } while (0)
17344 # endif
17345 
17346 /** This macro disables open-drain and pullups/downs,
17347  * configures pin RH10 for digital (not analog) operation, and
17348  * configures the pin as an input.
17349  */
17350 # define CONFIG_RH10_AS_DIG_INPUT() \
17351  do { \
17352  DISABLE_RH10_ANALOG(); \
17353  CONFIG_RH10_AS_INPUT(); \
17354  DISABLE_RH10_OPENDRAIN(); \
17355  DISABLE_RH10_PULLUP(); \
17356  DISABLE_RH10_PULLDOWN(); \
17357  } while (0)
17358 
17359 /** This macro disables open-drain and pullups/downs,
17360  * configures pin RH10 for digital (not analog) operation, and
17361  * configures the pin as an output.
17362  */
17363 # define CONFIG_RH10_AS_DIG_OUTPUT() \
17364  do { \
17365  DISABLE_RH10_ANALOG(); \
17366  CONFIG_RH10_AS_OUTPUT(); \
17367  DISABLE_RH10_OPENDRAIN(); \
17368  DISABLE_RH10_PULLUP(); \
17369  DISABLE_RH10_PULLDOWN(); \
17370  } while (0)
17371 
17372 #endif // #if defined(_RH10) || defined(__DOXYGEN__): Provide GPIO for RH10
17373 
17374 
17375 
17376 
17377 
17378 // Provide GPIO for RH11
17379 // ====================
17380 #if defined(_RH11) || defined(__DOXYGEN__)
17381 
17382 // Dummy macros for documentation only
17383 # ifdef __DOXYGEN__
17384 /// This macro specifies the RPy value associated with pin RH11.
17385 /// Its device-specific definition is given in pic24_ports_mapping.h.
17386 # define RH11_RP xx
17387 
17388 /// This macro specifies the ANn value associated with pin RH11.
17389 /// Its device-specific definition is given in pic24_ports_mapping.h.
17390 # define RH11_AN xx
17391 
17392 /// This macro specifies the CNm value associated with pin RH11.
17393 /// Its device-specific definition is given in pic24_ports_mapping.h.
17394 # define RH11_CN xx
17395 
17396 //@}
17397 # endif // #ifdef __DOXYGEN__
17398 
17399 
17400 // Low-level config
17401 // ----------------
17402 // Analog:
17403 # if defined(_ANSH11) || defined(__DOXYGEN__)
17404 /// Enable analog functionality on pin RH11.
17405 # define ENABLE_RH11_ANALOG() (_ANSH11 = 1)
17406 /// Disable analog functionality on pin RH11.
17407 # define DISABLE_RH11_ANALOG() (_ANSH11 = 0)
17408 # elif defined(RH11_AN)
17409 # define ENABLE_RH11_ANALOG() (RXY_GPIO_PCFG(RH11_AN) = 0)
17410 # define DISABLE_RH11_ANALOG() (RXY_GPIO_PCFG(RH11_AN) = 1)
17411 # else
17412 # define DISABLE_RH11_ANALOG() ((void) 0)
17413 # endif
17414 
17415 // Input/output:
17416 /// Configure pin RH11 as an input.
17417 # define CONFIG_RH11_AS_INPUT() (_TRISH11 = 1)
17418 /// Configure pin RH11 as an output.
17419 # define CONFIG_RH11_AS_OUTPUT() (_TRISH11 = 0)
17420 
17421 // Open-drain:
17422 # if defined(_ODCH11) || defined(__DOXYGEN__)
17423 /// Enable the open-drain driver on pin RH11.
17424 # define ENABLE_RH11_OPENDRAIN() (_ODCH11 = 1)
17425 /// Disable the open-drain driver on pin RH11.
17426 # define DISABLE_RH11_OPENDRAIN() (_ODCH11 = 0)
17427 # elif defined(_ODH11) // The PIF24F names this bit _OD instead of _ODC.
17428 # define ENABLE_RH11_OPENDRAIN() (_ODH11 = 1)
17429 # define DISABLE_RH11_OPENDRAIN() (_ODH11 = 0)
17430 # else
17431 # define DISABLE_RH11_OPENDRAIN() ((void) 0)
17432 # endif
17433 
17434 // Change notification, pullups and pulldowns:
17435 # if defined(_CNIEH11) || defined(__DOXYGEN__)
17436 /// Enable the pullup on pin RH11.
17437 # define ENABLE_RH11_PULLUP() (_CNPUH11 = 1)
17438 /// Disable the pullup on pin RH11.
17439 # define DISABLE_RH11_PULLUP() (_CNPUH11 = 0)
17440 
17441 /// Enable the pulldown on pin RH11.
17442 # define ENABLE_RH11_PULLDOWN() (_CNPDH11 = 1)
17443 /// Disable the pulldown on pin RH11.
17444 # define DISABLE_RH11_PULLDOWN() (_CNPDH11 = 0)
17445 
17446 /// Enable the change notification interrupt on pin RH11.
17447 # define ENABLE_RH11_CN_INTERRUPT() (_CNIEH11 = 1)
17448 /// Disable the change notification interrupt on pin RH11.
17449 # define DISABLE_RH11_CN_INTERRUPT() (_CNIEH11 = 0)
17450 
17451 # elif defined(RH11_CN)
17452 # define ENABLE_RH11_PULLUP() (RXY_GPIO_CNPUE(RH11_CN) = 1)
17453 # define DISABLE_RH11_PULLUP() (RXY_GPIO_CNPUE(RH11_CN) = 0)
17454 
17455 # if RXY_HAS_CNPDE(RH11_CN)
17456 # define ENABLE_RH11_PULLDOWN() (RXY_GPIO_CNPDE(RH11_CN) = 1)
17457 # define DISABLE_RH11_PULLDOWN() (RXY_GPIO_CNPDE(RH11_CN) = 0)
17458 # else
17459 # define DISABLE_RH11_PULLDOWN() ((void) 0)
17460 # endif
17461 
17462 # define ENABLE_RH11_CN_INTERRUPT() (RXY_GPIO_CNIE(RH11_CN) = 1)
17463 # define DISABLE_RH11_CN_INTERRUPT() (RXY_GPIO_CNIE(RH11_CN) = 0)
17464 
17465 # else
17466 # define DISABLE_RH11_PULLUP() ((void) 0)
17467 # define DISABLE_RH11_PULLDOWN() ((void) 0)
17468 # define DISABLE_RH11_CN_INTERRUPT() ((void) 0)
17469 # endif
17470 
17471 // High-level config
17472 // -----------------
17473 /** This macro disables pullups/downs, enables analog functionality, and configures
17474  * pin RH11 as an input.
17475  */
17476 # if defined(_ANSH11) || defined(RH11_AN) || defined(__DOXYGEN__)
17477 # define CONFIG_RH11_AS_ANALOG() \
17478  do { \
17479  ENABLE_RH11_ANALOG(); \
17480  CONFIG_RH11_AS_INPUT(); \
17481  DISABLE_RH11_OPENDRAIN(); \
17482  DISABLE_RH11_PULLUP(); \
17483  DISABLE_RH11_PULLDOWN(); \
17484  } while (0)
17485 # endif
17486 
17487 /** This macro disables open-drain and pullups/downs,
17488  * configures pin RH11 for digital (not analog) operation, and
17489  * configures the pin as an input.
17490  */
17491 # define CONFIG_RH11_AS_DIG_INPUT() \
17492  do { \
17493  DISABLE_RH11_ANALOG(); \
17494  CONFIG_RH11_AS_INPUT(); \
17495  DISABLE_RH11_OPENDRAIN(); \
17496  DISABLE_RH11_PULLUP(); \
17497  DISABLE_RH11_PULLDOWN(); \
17498  } while (0)
17499 
17500 /** This macro disables open-drain and pullups/downs,
17501  * configures pin RH11 for digital (not analog) operation, and
17502  * configures the pin as an output.
17503  */
17504 # define CONFIG_RH11_AS_DIG_OUTPUT() \
17505  do { \
17506  DISABLE_RH11_ANALOG(); \
17507  CONFIG_RH11_AS_OUTPUT(); \
17508  DISABLE_RH11_OPENDRAIN(); \
17509  DISABLE_RH11_PULLUP(); \
17510  DISABLE_RH11_PULLDOWN(); \
17511  } while (0)
17512 
17513 #endif // #if defined(_RH11) || defined(__DOXYGEN__): Provide GPIO for RH11
17514 
17515 
17516 
17517 
17518 
17519 // Provide GPIO for RH12
17520 // ====================
17521 #if defined(_RH12) || defined(__DOXYGEN__)
17522 
17523 // Dummy macros for documentation only
17524 # ifdef __DOXYGEN__
17525 /// This macro specifies the RPy value associated with pin RH12.
17526 /// Its device-specific definition is given in pic24_ports_mapping.h.
17527 # define RH12_RP xx
17528 
17529 /// This macro specifies the ANn value associated with pin RH12.
17530 /// Its device-specific definition is given in pic24_ports_mapping.h.
17531 # define RH12_AN xx
17532 
17533 /// This macro specifies the CNm value associated with pin RH12.
17534 /// Its device-specific definition is given in pic24_ports_mapping.h.
17535 # define RH12_CN xx
17536 
17537 //@}
17538 # endif // #ifdef __DOXYGEN__
17539 
17540 
17541 // Low-level config
17542 // ----------------
17543 // Analog:
17544 # if defined(_ANSH12) || defined(__DOXYGEN__)
17545 /// Enable analog functionality on pin RH12.
17546 # define ENABLE_RH12_ANALOG() (_ANSH12 = 1)
17547 /// Disable analog functionality on pin RH12.
17548 # define DISABLE_RH12_ANALOG() (_ANSH12 = 0)
17549 # elif defined(RH12_AN)
17550 # define ENABLE_RH12_ANALOG() (RXY_GPIO_PCFG(RH12_AN) = 0)
17551 # define DISABLE_RH12_ANALOG() (RXY_GPIO_PCFG(RH12_AN) = 1)
17552 # else
17553 # define DISABLE_RH12_ANALOG() ((void) 0)
17554 # endif
17555 
17556 // Input/output:
17557 /// Configure pin RH12 as an input.
17558 # define CONFIG_RH12_AS_INPUT() (_TRISH12 = 1)
17559 /// Configure pin RH12 as an output.
17560 # define CONFIG_RH12_AS_OUTPUT() (_TRISH12 = 0)
17561 
17562 // Open-drain:
17563 # if defined(_ODCH12) || defined(__DOXYGEN__)
17564 /// Enable the open-drain driver on pin RH12.
17565 # define ENABLE_RH12_OPENDRAIN() (_ODCH12 = 1)
17566 /// Disable the open-drain driver on pin RH12.
17567 # define DISABLE_RH12_OPENDRAIN() (_ODCH12 = 0)
17568 # elif defined(_ODH12) // The PIF24F names this bit _OD instead of _ODC.
17569 # define ENABLE_RH12_OPENDRAIN() (_ODH12 = 1)
17570 # define DISABLE_RH12_OPENDRAIN() (_ODH12 = 0)
17571 # else
17572 # define DISABLE_RH12_OPENDRAIN() ((void) 0)
17573 # endif
17574 
17575 // Change notification, pullups and pulldowns:
17576 # if defined(_CNIEH12) || defined(__DOXYGEN__)
17577 /// Enable the pullup on pin RH12.
17578 # define ENABLE_RH12_PULLUP() (_CNPUH12 = 1)
17579 /// Disable the pullup on pin RH12.
17580 # define DISABLE_RH12_PULLUP() (_CNPUH12 = 0)
17581 
17582 /// Enable the pulldown on pin RH12.
17583 # define ENABLE_RH12_PULLDOWN() (_CNPDH12 = 1)
17584 /// Disable the pulldown on pin RH12.
17585 # define DISABLE_RH12_PULLDOWN() (_CNPDH12 = 0)
17586 
17587 /// Enable the change notification interrupt on pin RH12.
17588 # define ENABLE_RH12_CN_INTERRUPT() (_CNIEH12 = 1)
17589 /// Disable the change notification interrupt on pin RH12.
17590 # define DISABLE_RH12_CN_INTERRUPT() (_CNIEH12 = 0)
17591 
17592 # elif defined(RH12_CN)
17593 # define ENABLE_RH12_PULLUP() (RXY_GPIO_CNPUE(RH12_CN) = 1)
17594 # define DISABLE_RH12_PULLUP() (RXY_GPIO_CNPUE(RH12_CN) = 0)
17595 
17596 # if RXY_HAS_CNPDE(RH12_CN)
17597 # define ENABLE_RH12_PULLDOWN() (RXY_GPIO_CNPDE(RH12_CN) = 1)
17598 # define DISABLE_RH12_PULLDOWN() (RXY_GPIO_CNPDE(RH12_CN) = 0)
17599 # else
17600 # define DISABLE_RH12_PULLDOWN() ((void) 0)
17601 # endif
17602 
17603 # define ENABLE_RH12_CN_INTERRUPT() (RXY_GPIO_CNIE(RH12_CN) = 1)
17604 # define DISABLE_RH12_CN_INTERRUPT() (RXY_GPIO_CNIE(RH12_CN) = 0)
17605 
17606 # else
17607 # define DISABLE_RH12_PULLUP() ((void) 0)
17608 # define DISABLE_RH12_PULLDOWN() ((void) 0)
17609 # define DISABLE_RH12_CN_INTERRUPT() ((void) 0)
17610 # endif
17611 
17612 // High-level config
17613 // -----------------
17614 /** This macro disables pullups/downs, enables analog functionality, and configures
17615  * pin RH12 as an input.
17616  */
17617 # if defined(_ANSH12) || defined(RH12_AN) || defined(__DOXYGEN__)
17618 # define CONFIG_RH12_AS_ANALOG() \
17619  do { \
17620  ENABLE_RH12_ANALOG(); \
17621  CONFIG_RH12_AS_INPUT(); \
17622  DISABLE_RH12_OPENDRAIN(); \
17623  DISABLE_RH12_PULLUP(); \
17624  DISABLE_RH12_PULLDOWN(); \
17625  } while (0)
17626 # endif
17627 
17628 /** This macro disables open-drain and pullups/downs,
17629  * configures pin RH12 for digital (not analog) operation, and
17630  * configures the pin as an input.
17631  */
17632 # define CONFIG_RH12_AS_DIG_INPUT() \
17633  do { \
17634  DISABLE_RH12_ANALOG(); \
17635  CONFIG_RH12_AS_INPUT(); \
17636  DISABLE_RH12_OPENDRAIN(); \
17637  DISABLE_RH12_PULLUP(); \
17638  DISABLE_RH12_PULLDOWN(); \
17639  } while (0)
17640 
17641 /** This macro disables open-drain and pullups/downs,
17642  * configures pin RH12 for digital (not analog) operation, and
17643  * configures the pin as an output.
17644  */
17645 # define CONFIG_RH12_AS_DIG_OUTPUT() \
17646  do { \
17647  DISABLE_RH12_ANALOG(); \
17648  CONFIG_RH12_AS_OUTPUT(); \
17649  DISABLE_RH12_OPENDRAIN(); \
17650  DISABLE_RH12_PULLUP(); \
17651  DISABLE_RH12_PULLDOWN(); \
17652  } while (0)
17653 
17654 #endif // #if defined(_RH12) || defined(__DOXYGEN__): Provide GPIO for RH12
17655 
17656 
17657 
17658 
17659 
17660 // Provide GPIO for RH13
17661 // ====================
17662 #if defined(_RH13) || defined(__DOXYGEN__)
17663 
17664 // Dummy macros for documentation only
17665 # ifdef __DOXYGEN__
17666 /// This macro specifies the RPy value associated with pin RH13.
17667 /// Its device-specific definition is given in pic24_ports_mapping.h.
17668 # define RH13_RP xx
17669 
17670 /// This macro specifies the ANn value associated with pin RH13.
17671 /// Its device-specific definition is given in pic24_ports_mapping.h.
17672 # define RH13_AN xx
17673 
17674 /// This macro specifies the CNm value associated with pin RH13.
17675 /// Its device-specific definition is given in pic24_ports_mapping.h.
17676 # define RH13_CN xx
17677 
17678 //@}
17679 # endif // #ifdef __DOXYGEN__
17680 
17681 
17682 // Low-level config
17683 // ----------------
17684 // Analog:
17685 # if defined(_ANSH13) || defined(__DOXYGEN__)
17686 /// Enable analog functionality on pin RH13.
17687 # define ENABLE_RH13_ANALOG() (_ANSH13 = 1)
17688 /// Disable analog functionality on pin RH13.
17689 # define DISABLE_RH13_ANALOG() (_ANSH13 = 0)
17690 # elif defined(RH13_AN)
17691 # define ENABLE_RH13_ANALOG() (RXY_GPIO_PCFG(RH13_AN) = 0)
17692 # define DISABLE_RH13_ANALOG() (RXY_GPIO_PCFG(RH13_AN) = 1)
17693 # else
17694 # define DISABLE_RH13_ANALOG() ((void) 0)
17695 # endif
17696 
17697 // Input/output:
17698 /// Configure pin RH13 as an input.
17699 # define CONFIG_RH13_AS_INPUT() (_TRISH13 = 1)
17700 /// Configure pin RH13 as an output.
17701 # define CONFIG_RH13_AS_OUTPUT() (_TRISH13 = 0)
17702 
17703 // Open-drain:
17704 # if defined(_ODCH13) || defined(__DOXYGEN__)
17705 /// Enable the open-drain driver on pin RH13.
17706 # define ENABLE_RH13_OPENDRAIN() (_ODCH13 = 1)
17707 /// Disable the open-drain driver on pin RH13.
17708 # define DISABLE_RH13_OPENDRAIN() (_ODCH13 = 0)
17709 # elif defined(_ODH13) // The PIF24F names this bit _OD instead of _ODC.
17710 # define ENABLE_RH13_OPENDRAIN() (_ODH13 = 1)
17711 # define DISABLE_RH13_OPENDRAIN() (_ODH13 = 0)
17712 # else
17713 # define DISABLE_RH13_OPENDRAIN() ((void) 0)
17714 # endif
17715 
17716 // Change notification, pullups and pulldowns:
17717 # if defined(_CNIEH13) || defined(__DOXYGEN__)
17718 /// Enable the pullup on pin RH13.
17719 # define ENABLE_RH13_PULLUP() (_CNPUH13 = 1)
17720 /// Disable the pullup on pin RH13.
17721 # define DISABLE_RH13_PULLUP() (_CNPUH13 = 0)
17722 
17723 /// Enable the pulldown on pin RH13.
17724 # define ENABLE_RH13_PULLDOWN() (_CNPDH13 = 1)
17725 /// Disable the pulldown on pin RH13.
17726 # define DISABLE_RH13_PULLDOWN() (_CNPDH13 = 0)
17727 
17728 /// Enable the change notification interrupt on pin RH13.
17729 # define ENABLE_RH13_CN_INTERRUPT() (_CNIEH13 = 1)
17730 /// Disable the change notification interrupt on pin RH13.
17731 # define DISABLE_RH13_CN_INTERRUPT() (_CNIEH13 = 0)
17732 
17733 # elif defined(RH13_CN)
17734 # define ENABLE_RH13_PULLUP() (RXY_GPIO_CNPUE(RH13_CN) = 1)
17735 # define DISABLE_RH13_PULLUP() (RXY_GPIO_CNPUE(RH13_CN) = 0)
17736 
17737 # if RXY_HAS_CNPDE(RH13_CN)
17738 # define ENABLE_RH13_PULLDOWN() (RXY_GPIO_CNPDE(RH13_CN) = 1)
17739 # define DISABLE_RH13_PULLDOWN() (RXY_GPIO_CNPDE(RH13_CN) = 0)
17740 # else
17741 # define DISABLE_RH13_PULLDOWN() ((void) 0)
17742 # endif
17743 
17744 # define ENABLE_RH13_CN_INTERRUPT() (RXY_GPIO_CNIE(RH13_CN) = 1)
17745 # define DISABLE_RH13_CN_INTERRUPT() (RXY_GPIO_CNIE(RH13_CN) = 0)
17746 
17747 # else
17748 # define DISABLE_RH13_PULLUP() ((void) 0)
17749 # define DISABLE_RH13_PULLDOWN() ((void) 0)
17750 # define DISABLE_RH13_CN_INTERRUPT() ((void) 0)
17751 # endif
17752 
17753 // High-level config
17754 // -----------------
17755 /** This macro disables pullups/downs, enables analog functionality, and configures
17756  * pin RH13 as an input.
17757  */
17758 # if defined(_ANSH13) || defined(RH13_AN) || defined(__DOXYGEN__)
17759 # define CONFIG_RH13_AS_ANALOG() \
17760  do { \
17761  ENABLE_RH13_ANALOG(); \
17762  CONFIG_RH13_AS_INPUT(); \
17763  DISABLE_RH13_OPENDRAIN(); \
17764  DISABLE_RH13_PULLUP(); \
17765  DISABLE_RH13_PULLDOWN(); \
17766  } while (0)
17767 # endif
17768 
17769 /** This macro disables open-drain and pullups/downs,
17770  * configures pin RH13 for digital (not analog) operation, and
17771  * configures the pin as an input.
17772  */
17773 # define CONFIG_RH13_AS_DIG_INPUT() \
17774  do { \
17775  DISABLE_RH13_ANALOG(); \
17776  CONFIG_RH13_AS_INPUT(); \
17777  DISABLE_RH13_OPENDRAIN(); \
17778  DISABLE_RH13_PULLUP(); \
17779  DISABLE_RH13_PULLDOWN(); \
17780  } while (0)
17781 
17782 /** This macro disables open-drain and pullups/downs,
17783  * configures pin RH13 for digital (not analog) operation, and
17784  * configures the pin as an output.
17785  */
17786 # define CONFIG_RH13_AS_DIG_OUTPUT() \
17787  do { \
17788  DISABLE_RH13_ANALOG(); \
17789  CONFIG_RH13_AS_OUTPUT(); \
17790  DISABLE_RH13_OPENDRAIN(); \
17791  DISABLE_RH13_PULLUP(); \
17792  DISABLE_RH13_PULLDOWN(); \
17793  } while (0)
17794 
17795 #endif // #if defined(_RH13) || defined(__DOXYGEN__): Provide GPIO for RH13
17796 
17797 
17798 
17799 
17800 
17801 // Provide GPIO for RH14
17802 // ====================
17803 #if defined(_RH14) || defined(__DOXYGEN__)
17804 
17805 // Dummy macros for documentation only
17806 # ifdef __DOXYGEN__
17807 /// This macro specifies the RPy value associated with pin RH14.
17808 /// Its device-specific definition is given in pic24_ports_mapping.h.
17809 # define RH14_RP xx
17810 
17811 /// This macro specifies the ANn value associated with pin RH14.
17812 /// Its device-specific definition is given in pic24_ports_mapping.h.
17813 # define RH14_AN xx
17814 
17815 /// This macro specifies the CNm value associated with pin RH14.
17816 /// Its device-specific definition is given in pic24_ports_mapping.h.
17817 # define RH14_CN xx
17818 
17819 //@}
17820 # endif // #ifdef __DOXYGEN__
17821 
17822 
17823 // Low-level config
17824 // ----------------
17825 // Analog:
17826 # if defined(_ANSH14) || defined(__DOXYGEN__)
17827 /// Enable analog functionality on pin RH14.
17828 # define ENABLE_RH14_ANALOG() (_ANSH14 = 1)
17829 /// Disable analog functionality on pin RH14.
17830 # define DISABLE_RH14_ANALOG() (_ANSH14 = 0)
17831 # elif defined(RH14_AN)
17832 # define ENABLE_RH14_ANALOG() (RXY_GPIO_PCFG(RH14_AN) = 0)
17833 # define DISABLE_RH14_ANALOG() (RXY_GPIO_PCFG(RH14_AN) = 1)
17834 # else
17835 # define DISABLE_RH14_ANALOG() ((void) 0)
17836 # endif
17837 
17838 // Input/output:
17839 /// Configure pin RH14 as an input.
17840 # define CONFIG_RH14_AS_INPUT() (_TRISH14 = 1)
17841 /// Configure pin RH14 as an output.
17842 # define CONFIG_RH14_AS_OUTPUT() (_TRISH14 = 0)
17843 
17844 // Open-drain:
17845 # if defined(_ODCH14) || defined(__DOXYGEN__)
17846 /// Enable the open-drain driver on pin RH14.
17847 # define ENABLE_RH14_OPENDRAIN() (_ODCH14 = 1)
17848 /// Disable the open-drain driver on pin RH14.
17849 # define DISABLE_RH14_OPENDRAIN() (_ODCH14 = 0)
17850 # elif defined(_ODH14) // The PIF24F names this bit _OD instead of _ODC.
17851 # define ENABLE_RH14_OPENDRAIN() (_ODH14 = 1)
17852 # define DISABLE_RH14_OPENDRAIN() (_ODH14 = 0)
17853 # else
17854 # define DISABLE_RH14_OPENDRAIN() ((void) 0)
17855 # endif
17856 
17857 // Change notification, pullups and pulldowns:
17858 # if defined(_CNIEH14) || defined(__DOXYGEN__)
17859 /// Enable the pullup on pin RH14.
17860 # define ENABLE_RH14_PULLUP() (_CNPUH14 = 1)
17861 /// Disable the pullup on pin RH14.
17862 # define DISABLE_RH14_PULLUP() (_CNPUH14 = 0)
17863 
17864 /// Enable the pulldown on pin RH14.
17865 # define ENABLE_RH14_PULLDOWN() (_CNPDH14 = 1)
17866 /// Disable the pulldown on pin RH14.
17867 # define DISABLE_RH14_PULLDOWN() (_CNPDH14 = 0)
17868 
17869 /// Enable the change notification interrupt on pin RH14.
17870 # define ENABLE_RH14_CN_INTERRUPT() (_CNIEH14 = 1)
17871 /// Disable the change notification interrupt on pin RH14.
17872 # define DISABLE_RH14_CN_INTERRUPT() (_CNIEH14 = 0)
17873 
17874 # elif defined(RH14_CN)
17875 # define ENABLE_RH14_PULLUP() (RXY_GPIO_CNPUE(RH14_CN) = 1)
17876 # define DISABLE_RH14_PULLUP() (RXY_GPIO_CNPUE(RH14_CN) = 0)
17877 
17878 # if RXY_HAS_CNPDE(RH14_CN)
17879 # define ENABLE_RH14_PULLDOWN() (RXY_GPIO_CNPDE(RH14_CN) = 1)
17880 # define DISABLE_RH14_PULLDOWN() (RXY_GPIO_CNPDE(RH14_CN) = 0)
17881 # else
17882 # define DISABLE_RH14_PULLDOWN() ((void) 0)
17883 # endif
17884 
17885 # define ENABLE_RH14_CN_INTERRUPT() (RXY_GPIO_CNIE(RH14_CN) = 1)
17886 # define DISABLE_RH14_CN_INTERRUPT() (RXY_GPIO_CNIE(RH14_CN) = 0)
17887 
17888 # else
17889 # define DISABLE_RH14_PULLUP() ((void) 0)
17890 # define DISABLE_RH14_PULLDOWN() ((void) 0)
17891 # define DISABLE_RH14_CN_INTERRUPT() ((void) 0)
17892 # endif
17893 
17894 // High-level config
17895 // -----------------
17896 /** This macro disables pullups/downs, enables analog functionality, and configures
17897  * pin RH14 as an input.
17898  */
17899 # if defined(_ANSH14) || defined(RH14_AN) || defined(__DOXYGEN__)
17900 # define CONFIG_RH14_AS_ANALOG() \
17901  do { \
17902  ENABLE_RH14_ANALOG(); \
17903  CONFIG_RH14_AS_INPUT(); \
17904  DISABLE_RH14_OPENDRAIN(); \
17905  DISABLE_RH14_PULLUP(); \
17906  DISABLE_RH14_PULLDOWN(); \
17907  } while (0)
17908 # endif
17909 
17910 /** This macro disables open-drain and pullups/downs,
17911  * configures pin RH14 for digital (not analog) operation, and
17912  * configures the pin as an input.
17913  */
17914 # define CONFIG_RH14_AS_DIG_INPUT() \
17915  do { \
17916  DISABLE_RH14_ANALOG(); \
17917  CONFIG_RH14_AS_INPUT(); \
17918  DISABLE_RH14_OPENDRAIN(); \
17919  DISABLE_RH14_PULLUP(); \
17920  DISABLE_RH14_PULLDOWN(); \
17921  } while (0)
17922 
17923 /** This macro disables open-drain and pullups/downs,
17924  * configures pin RH14 for digital (not analog) operation, and
17925  * configures the pin as an output.
17926  */
17927 # define CONFIG_RH14_AS_DIG_OUTPUT() \
17928  do { \
17929  DISABLE_RH14_ANALOG(); \
17930  CONFIG_RH14_AS_OUTPUT(); \
17931  DISABLE_RH14_OPENDRAIN(); \
17932  DISABLE_RH14_PULLUP(); \
17933  DISABLE_RH14_PULLDOWN(); \
17934  } while (0)
17935 
17936 #endif // #if defined(_RH14) || defined(__DOXYGEN__): Provide GPIO for RH14
17937 
17938 
17939 
17940 
17941 
17942 // Provide GPIO for RH15
17943 // ====================
17944 #if defined(_RH15) || defined(__DOXYGEN__)
17945 
17946 // Dummy macros for documentation only
17947 # ifdef __DOXYGEN__
17948 /// This macro specifies the RPy value associated with pin RH15.
17949 /// Its device-specific definition is given in pic24_ports_mapping.h.
17950 # define RH15_RP xx
17951 
17952 /// This macro specifies the ANn value associated with pin RH15.
17953 /// Its device-specific definition is given in pic24_ports_mapping.h.
17954 # define RH15_AN xx
17955 
17956 /// This macro specifies the CNm value associated with pin RH15.
17957 /// Its device-specific definition is given in pic24_ports_mapping.h.
17958 # define RH15_CN xx
17959 
17960 //@}
17961 # endif // #ifdef __DOXYGEN__
17962 
17963 
17964 // Low-level config
17965 // ----------------
17966 // Analog:
17967 # if defined(_ANSH15) || defined(__DOXYGEN__)
17968 /// Enable analog functionality on pin RH15.
17969 # define ENABLE_RH15_ANALOG() (_ANSH15 = 1)
17970 /// Disable analog functionality on pin RH15.
17971 # define DISABLE_RH15_ANALOG() (_ANSH15 = 0)
17972 # elif defined(RH15_AN)
17973 # define ENABLE_RH15_ANALOG() (RXY_GPIO_PCFG(RH15_AN) = 0)
17974 # define DISABLE_RH15_ANALOG() (RXY_GPIO_PCFG(RH15_AN) = 1)
17975 # else
17976 # define DISABLE_RH15_ANALOG() ((void) 0)
17977 # endif
17978 
17979 // Input/output:
17980 /// Configure pin RH15 as an input.
17981 # define CONFIG_RH15_AS_INPUT() (_TRISH15 = 1)
17982 /// Configure pin RH15 as an output.
17983 # define CONFIG_RH15_AS_OUTPUT() (_TRISH15 = 0)
17984 
17985 // Open-drain:
17986 # if defined(_ODCH15) || defined(__DOXYGEN__)
17987 /// Enable the open-drain driver on pin RH15.
17988 # define ENABLE_RH15_OPENDRAIN() (_ODCH15 = 1)
17989 /// Disable the open-drain driver on pin RH15.
17990 # define DISABLE_RH15_OPENDRAIN() (_ODCH15 = 0)
17991 # elif defined(_ODH15) // The PIF24F names this bit _OD instead of _ODC.
17992 # define ENABLE_RH15_OPENDRAIN() (_ODH15 = 1)
17993 # define DISABLE_RH15_OPENDRAIN() (_ODH15 = 0)
17994 # else
17995 # define DISABLE_RH15_OPENDRAIN() ((void) 0)
17996 # endif
17997 
17998 // Change notification, pullups and pulldowns:
17999 # if defined(_CNIEH15) || defined(__DOXYGEN__)
18000 /// Enable the pullup on pin RH15.
18001 # define ENABLE_RH15_PULLUP() (_CNPUH15 = 1)
18002 /// Disable the pullup on pin RH15.
18003 # define DISABLE_RH15_PULLUP() (_CNPUH15 = 0)
18004 
18005 /// Enable the pulldown on pin RH15.
18006 # define ENABLE_RH15_PULLDOWN() (_CNPDH15 = 1)
18007 /// Disable the pulldown on pin RH15.
18008 # define DISABLE_RH15_PULLDOWN() (_CNPDH15 = 0)
18009 
18010 /// Enable the change notification interrupt on pin RH15.
18011 # define ENABLE_RH15_CN_INTERRUPT() (_CNIEH15 = 1)
18012 /// Disable the change notification interrupt on pin RH15.
18013 # define DISABLE_RH15_CN_INTERRUPT() (_CNIEH15 = 0)
18014 
18015 # elif defined(RH15_CN)
18016 # define ENABLE_RH15_PULLUP() (RXY_GPIO_CNPUE(RH15_CN) = 1)
18017 # define DISABLE_RH15_PULLUP() (RXY_GPIO_CNPUE(RH15_CN) = 0)
18018 
18019 # if RXY_HAS_CNPDE(RH15_CN)
18020 # define ENABLE_RH15_PULLDOWN() (RXY_GPIO_CNPDE(RH15_CN) = 1)
18021 # define DISABLE_RH15_PULLDOWN() (RXY_GPIO_CNPDE(RH15_CN) = 0)
18022 # else
18023 # define DISABLE_RH15_PULLDOWN() ((void) 0)
18024 # endif
18025 
18026 # define ENABLE_RH15_CN_INTERRUPT() (RXY_GPIO_CNIE(RH15_CN) = 1)
18027 # define DISABLE_RH15_CN_INTERRUPT() (RXY_GPIO_CNIE(RH15_CN) = 0)
18028 
18029 # else
18030 # define DISABLE_RH15_PULLUP() ((void) 0)
18031 # define DISABLE_RH15_PULLDOWN() ((void) 0)
18032 # define DISABLE_RH15_CN_INTERRUPT() ((void) 0)
18033 # endif
18034 
18035 // High-level config
18036 // -----------------
18037 /** This macro disables pullups/downs, enables analog functionality, and configures
18038  * pin RH15 as an input.
18039  */
18040 # if defined(_ANSH15) || defined(RH15_AN) || defined(__DOXYGEN__)
18041 # define CONFIG_RH15_AS_ANALOG() \
18042  do { \
18043  ENABLE_RH15_ANALOG(); \
18044  CONFIG_RH15_AS_INPUT(); \
18045  DISABLE_RH15_OPENDRAIN(); \
18046  DISABLE_RH15_PULLUP(); \
18047  DISABLE_RH15_PULLDOWN(); \
18048  } while (0)
18049 # endif
18050 
18051 /** This macro disables open-drain and pullups/downs,
18052  * configures pin RH15 for digital (not analog) operation, and
18053  * configures the pin as an input.
18054  */
18055 # define CONFIG_RH15_AS_DIG_INPUT() \
18056  do { \
18057  DISABLE_RH15_ANALOG(); \
18058  CONFIG_RH15_AS_INPUT(); \
18059  DISABLE_RH15_OPENDRAIN(); \
18060  DISABLE_RH15_PULLUP(); \
18061  DISABLE_RH15_PULLDOWN(); \
18062  } while (0)
18063 
18064 /** This macro disables open-drain and pullups/downs,
18065  * configures pin RH15 for digital (not analog) operation, and
18066  * configures the pin as an output.
18067  */
18068 # define CONFIG_RH15_AS_DIG_OUTPUT() \
18069  do { \
18070  DISABLE_RH15_ANALOG(); \
18071  CONFIG_RH15_AS_OUTPUT(); \
18072  DISABLE_RH15_OPENDRAIN(); \
18073  DISABLE_RH15_PULLUP(); \
18074  DISABLE_RH15_PULLDOWN(); \
18075  } while (0)
18076 
18077 #endif // #if defined(_RH15) || defined(__DOXYGEN__): Provide GPIO for RH15
18078 
18079 
18080 
18081 
18082 
18083 // Provide GPIO for RJ0
18084 // ====================
18085 #if defined(_RJ0) || defined(__DOXYGEN__)
18086 
18087 // Dummy macros for documentation only
18088 # ifdef __DOXYGEN__
18089 /// This macro specifies the RPy value associated with pin RJ0.
18090 /// Its device-specific definition is given in pic24_ports_mapping.h.
18091 # define RJ0_RP xx
18092 
18093 /// This macro specifies the ANn value associated with pin RJ0.
18094 /// Its device-specific definition is given in pic24_ports_mapping.h.
18095 # define RJ0_AN xx
18096 
18097 /// This macro specifies the CNm value associated with pin RJ0.
18098 /// Its device-specific definition is given in pic24_ports_mapping.h.
18099 # define RJ0_CN xx
18100 
18101 //@}
18102 # endif // #ifdef __DOXYGEN__
18103 
18104 
18105 // Low-level config
18106 // ----------------
18107 // Analog:
18108 # if defined(_ANSJ0) || defined(__DOXYGEN__)
18109 /// Enable analog functionality on pin RJ0.
18110 # define ENABLE_RJ0_ANALOG() (_ANSJ0 = 1)
18111 /// Disable analog functionality on pin RJ0.
18112 # define DISABLE_RJ0_ANALOG() (_ANSJ0 = 0)
18113 # elif defined(RJ0_AN)
18114 # define ENABLE_RJ0_ANALOG() (RXY_GPIO_PCFG(RJ0_AN) = 0)
18115 # define DISABLE_RJ0_ANALOG() (RXY_GPIO_PCFG(RJ0_AN) = 1)
18116 # else
18117 # define DISABLE_RJ0_ANALOG() ((void) 0)
18118 # endif
18119 
18120 // Input/output:
18121 /// Configure pin RJ0 as an input.
18122 # define CONFIG_RJ0_AS_INPUT() (_TRISJ0 = 1)
18123 /// Configure pin RJ0 as an output.
18124 # define CONFIG_RJ0_AS_OUTPUT() (_TRISJ0 = 0)
18125 
18126 // Open-drain:
18127 # if defined(_ODCJ0) || defined(__DOXYGEN__)
18128 /// Enable the open-drain driver on pin RJ0.
18129 # define ENABLE_RJ0_OPENDRAIN() (_ODCJ0 = 1)
18130 /// Disable the open-drain driver on pin RJ0.
18131 # define DISABLE_RJ0_OPENDRAIN() (_ODCJ0 = 0)
18132 # elif defined(_ODJ0) // The PIF24F names this bit _OD instead of _ODC.
18133 # define ENABLE_RJ0_OPENDRAIN() (_ODJ0 = 1)
18134 # define DISABLE_RJ0_OPENDRAIN() (_ODJ0 = 0)
18135 # else
18136 # define DISABLE_RJ0_OPENDRAIN() ((void) 0)
18137 # endif
18138 
18139 // Change notification, pullups and pulldowns:
18140 # if defined(_CNIEJ0) || defined(__DOXYGEN__)
18141 /// Enable the pullup on pin RJ0.
18142 # define ENABLE_RJ0_PULLUP() (_CNPUJ0 = 1)
18143 /// Disable the pullup on pin RJ0.
18144 # define DISABLE_RJ0_PULLUP() (_CNPUJ0 = 0)
18145 
18146 /// Enable the pulldown on pin RJ0.
18147 # define ENABLE_RJ0_PULLDOWN() (_CNPDJ0 = 1)
18148 /// Disable the pulldown on pin RJ0.
18149 # define DISABLE_RJ0_PULLDOWN() (_CNPDJ0 = 0)
18150 
18151 /// Enable the change notification interrupt on pin RJ0.
18152 # define ENABLE_RJ0_CN_INTERRUPT() (_CNIEJ0 = 1)
18153 /// Disable the change notification interrupt on pin RJ0.
18154 # define DISABLE_RJ0_CN_INTERRUPT() (_CNIEJ0 = 0)
18155 
18156 # elif defined(RJ0_CN)
18157 # define ENABLE_RJ0_PULLUP() (RXY_GPIO_CNPUE(RJ0_CN) = 1)
18158 # define DISABLE_RJ0_PULLUP() (RXY_GPIO_CNPUE(RJ0_CN) = 0)
18159 
18160 # if RXY_HAS_CNPDE(RJ0_CN)
18161 # define ENABLE_RJ0_PULLDOWN() (RXY_GPIO_CNPDE(RJ0_CN) = 1)
18162 # define DISABLE_RJ0_PULLDOWN() (RXY_GPIO_CNPDE(RJ0_CN) = 0)
18163 # else
18164 # define DISABLE_RJ0_PULLDOWN() ((void) 0)
18165 # endif
18166 
18167 # define ENABLE_RJ0_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ0_CN) = 1)
18168 # define DISABLE_RJ0_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ0_CN) = 0)
18169 
18170 # else
18171 # define DISABLE_RJ0_PULLUP() ((void) 0)
18172 # define DISABLE_RJ0_PULLDOWN() ((void) 0)
18173 # define DISABLE_RJ0_CN_INTERRUPT() ((void) 0)
18174 # endif
18175 
18176 // High-level config
18177 // -----------------
18178 /** This macro disables pullups/downs, enables analog functionality, and configures
18179  * pin RJ0 as an input.
18180  */
18181 # if defined(_ANSJ0) || defined(RJ0_AN) || defined(__DOXYGEN__)
18182 # define CONFIG_RJ0_AS_ANALOG() \
18183  do { \
18184  ENABLE_RJ0_ANALOG(); \
18185  CONFIG_RJ0_AS_INPUT(); \
18186  DISABLE_RJ0_OPENDRAIN(); \
18187  DISABLE_RJ0_PULLUP(); \
18188  DISABLE_RJ0_PULLDOWN(); \
18189  } while (0)
18190 # endif
18191 
18192 /** This macro disables open-drain and pullups/downs,
18193  * configures pin RJ0 for digital (not analog) operation, and
18194  * configures the pin as an input.
18195  */
18196 # define CONFIG_RJ0_AS_DIG_INPUT() \
18197  do { \
18198  DISABLE_RJ0_ANALOG(); \
18199  CONFIG_RJ0_AS_INPUT(); \
18200  DISABLE_RJ0_OPENDRAIN(); \
18201  DISABLE_RJ0_PULLUP(); \
18202  DISABLE_RJ0_PULLDOWN(); \
18203  } while (0)
18204 
18205 /** This macro disables open-drain and pullups/downs,
18206  * configures pin RJ0 for digital (not analog) operation, and
18207  * configures the pin as an output.
18208  */
18209 # define CONFIG_RJ0_AS_DIG_OUTPUT() \
18210  do { \
18211  DISABLE_RJ0_ANALOG(); \
18212  CONFIG_RJ0_AS_OUTPUT(); \
18213  DISABLE_RJ0_OPENDRAIN(); \
18214  DISABLE_RJ0_PULLUP(); \
18215  DISABLE_RJ0_PULLDOWN(); \
18216  } while (0)
18217 
18218 #endif // #if defined(_RJ0) || defined(__DOXYGEN__): Provide GPIO for RJ0
18219 
18220 
18221 
18222 
18223 
18224 // Provide GPIO for RJ1
18225 // ====================
18226 #if defined(_RJ1) || defined(__DOXYGEN__)
18227 
18228 // Dummy macros for documentation only
18229 # ifdef __DOXYGEN__
18230 /// This macro specifies the RPy value associated with pin RJ1.
18231 /// Its device-specific definition is given in pic24_ports_mapping.h.
18232 # define RJ1_RP xx
18233 
18234 /// This macro specifies the ANn value associated with pin RJ1.
18235 /// Its device-specific definition is given in pic24_ports_mapping.h.
18236 # define RJ1_AN xx
18237 
18238 /// This macro specifies the CNm value associated with pin RJ1.
18239 /// Its device-specific definition is given in pic24_ports_mapping.h.
18240 # define RJ1_CN xx
18241 
18242 //@}
18243 # endif // #ifdef __DOXYGEN__
18244 
18245 
18246 // Low-level config
18247 // ----------------
18248 // Analog:
18249 # if defined(_ANSJ1) || defined(__DOXYGEN__)
18250 /// Enable analog functionality on pin RJ1.
18251 # define ENABLE_RJ1_ANALOG() (_ANSJ1 = 1)
18252 /// Disable analog functionality on pin RJ1.
18253 # define DISABLE_RJ1_ANALOG() (_ANSJ1 = 0)
18254 # elif defined(RJ1_AN)
18255 # define ENABLE_RJ1_ANALOG() (RXY_GPIO_PCFG(RJ1_AN) = 0)
18256 # define DISABLE_RJ1_ANALOG() (RXY_GPIO_PCFG(RJ1_AN) = 1)
18257 # else
18258 # define DISABLE_RJ1_ANALOG() ((void) 0)
18259 # endif
18260 
18261 // Input/output:
18262 /// Configure pin RJ1 as an input.
18263 # define CONFIG_RJ1_AS_INPUT() (_TRISJ1 = 1)
18264 /// Configure pin RJ1 as an output.
18265 # define CONFIG_RJ1_AS_OUTPUT() (_TRISJ1 = 0)
18266 
18267 // Open-drain:
18268 # if defined(_ODCJ1) || defined(__DOXYGEN__)
18269 /// Enable the open-drain driver on pin RJ1.
18270 # define ENABLE_RJ1_OPENDRAIN() (_ODCJ1 = 1)
18271 /// Disable the open-drain driver on pin RJ1.
18272 # define DISABLE_RJ1_OPENDRAIN() (_ODCJ1 = 0)
18273 # elif defined(_ODJ1) // The PIF24F names this bit _OD instead of _ODC.
18274 # define ENABLE_RJ1_OPENDRAIN() (_ODJ1 = 1)
18275 # define DISABLE_RJ1_OPENDRAIN() (_ODJ1 = 0)
18276 # else
18277 # define DISABLE_RJ1_OPENDRAIN() ((void) 0)
18278 # endif
18279 
18280 // Change notification, pullups and pulldowns:
18281 # if defined(_CNIEJ1) || defined(__DOXYGEN__)
18282 /// Enable the pullup on pin RJ1.
18283 # define ENABLE_RJ1_PULLUP() (_CNPUJ1 = 1)
18284 /// Disable the pullup on pin RJ1.
18285 # define DISABLE_RJ1_PULLUP() (_CNPUJ1 = 0)
18286 
18287 /// Enable the pulldown on pin RJ1.
18288 # define ENABLE_RJ1_PULLDOWN() (_CNPDJ1 = 1)
18289 /// Disable the pulldown on pin RJ1.
18290 # define DISABLE_RJ1_PULLDOWN() (_CNPDJ1 = 0)
18291 
18292 /// Enable the change notification interrupt on pin RJ1.
18293 # define ENABLE_RJ1_CN_INTERRUPT() (_CNIEJ1 = 1)
18294 /// Disable the change notification interrupt on pin RJ1.
18295 # define DISABLE_RJ1_CN_INTERRUPT() (_CNIEJ1 = 0)
18296 
18297 # elif defined(RJ1_CN)
18298 # define ENABLE_RJ1_PULLUP() (RXY_GPIO_CNPUE(RJ1_CN) = 1)
18299 # define DISABLE_RJ1_PULLUP() (RXY_GPIO_CNPUE(RJ1_CN) = 0)
18300 
18301 # if RXY_HAS_CNPDE(RJ1_CN)
18302 # define ENABLE_RJ1_PULLDOWN() (RXY_GPIO_CNPDE(RJ1_CN) = 1)
18303 # define DISABLE_RJ1_PULLDOWN() (RXY_GPIO_CNPDE(RJ1_CN) = 0)
18304 # else
18305 # define DISABLE_RJ1_PULLDOWN() ((void) 0)
18306 # endif
18307 
18308 # define ENABLE_RJ1_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ1_CN) = 1)
18309 # define DISABLE_RJ1_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ1_CN) = 0)
18310 
18311 # else
18312 # define DISABLE_RJ1_PULLUP() ((void) 0)
18313 # define DISABLE_RJ1_PULLDOWN() ((void) 0)
18314 # define DISABLE_RJ1_CN_INTERRUPT() ((void) 0)
18315 # endif
18316 
18317 // High-level config
18318 // -----------------
18319 /** This macro disables pullups/downs, enables analog functionality, and configures
18320  * pin RJ1 as an input.
18321  */
18322 # if defined(_ANSJ1) || defined(RJ1_AN) || defined(__DOXYGEN__)
18323 # define CONFIG_RJ1_AS_ANALOG() \
18324  do { \
18325  ENABLE_RJ1_ANALOG(); \
18326  CONFIG_RJ1_AS_INPUT(); \
18327  DISABLE_RJ1_OPENDRAIN(); \
18328  DISABLE_RJ1_PULLUP(); \
18329  DISABLE_RJ1_PULLDOWN(); \
18330  } while (0)
18331 # endif
18332 
18333 /** This macro disables open-drain and pullups/downs,
18334  * configures pin RJ1 for digital (not analog) operation, and
18335  * configures the pin as an input.
18336  */
18337 # define CONFIG_RJ1_AS_DIG_INPUT() \
18338  do { \
18339  DISABLE_RJ1_ANALOG(); \
18340  CONFIG_RJ1_AS_INPUT(); \
18341  DISABLE_RJ1_OPENDRAIN(); \
18342  DISABLE_RJ1_PULLUP(); \
18343  DISABLE_RJ1_PULLDOWN(); \
18344  } while (0)
18345 
18346 /** This macro disables open-drain and pullups/downs,
18347  * configures pin RJ1 for digital (not analog) operation, and
18348  * configures the pin as an output.
18349  */
18350 # define CONFIG_RJ1_AS_DIG_OUTPUT() \
18351  do { \
18352  DISABLE_RJ1_ANALOG(); \
18353  CONFIG_RJ1_AS_OUTPUT(); \
18354  DISABLE_RJ1_OPENDRAIN(); \
18355  DISABLE_RJ1_PULLUP(); \
18356  DISABLE_RJ1_PULLDOWN(); \
18357  } while (0)
18358 
18359 #endif // #if defined(_RJ1) || defined(__DOXYGEN__): Provide GPIO for RJ1
18360 
18361 
18362 
18363 
18364 
18365 // Provide GPIO for RJ2
18366 // ====================
18367 #if defined(_RJ2) || defined(__DOXYGEN__)
18368 
18369 // Dummy macros for documentation only
18370 # ifdef __DOXYGEN__
18371 /// This macro specifies the RPy value associated with pin RJ2.
18372 /// Its device-specific definition is given in pic24_ports_mapping.h.
18373 # define RJ2_RP xx
18374 
18375 /// This macro specifies the ANn value associated with pin RJ2.
18376 /// Its device-specific definition is given in pic24_ports_mapping.h.
18377 # define RJ2_AN xx
18378 
18379 /// This macro specifies the CNm value associated with pin RJ2.
18380 /// Its device-specific definition is given in pic24_ports_mapping.h.
18381 # define RJ2_CN xx
18382 
18383 //@}
18384 # endif // #ifdef __DOXYGEN__
18385 
18386 
18387 // Low-level config
18388 // ----------------
18389 // Analog:
18390 # if defined(_ANSJ2) || defined(__DOXYGEN__)
18391 /// Enable analog functionality on pin RJ2.
18392 # define ENABLE_RJ2_ANALOG() (_ANSJ2 = 1)
18393 /// Disable analog functionality on pin RJ2.
18394 # define DISABLE_RJ2_ANALOG() (_ANSJ2 = 0)
18395 # elif defined(RJ2_AN)
18396 # define ENABLE_RJ2_ANALOG() (RXY_GPIO_PCFG(RJ2_AN) = 0)
18397 # define DISABLE_RJ2_ANALOG() (RXY_GPIO_PCFG(RJ2_AN) = 1)
18398 # else
18399 # define DISABLE_RJ2_ANALOG() ((void) 0)
18400 # endif
18401 
18402 // Input/output:
18403 /// Configure pin RJ2 as an input.
18404 # define CONFIG_RJ2_AS_INPUT() (_TRISJ2 = 1)
18405 /// Configure pin RJ2 as an output.
18406 # define CONFIG_RJ2_AS_OUTPUT() (_TRISJ2 = 0)
18407 
18408 // Open-drain:
18409 # if defined(_ODCJ2) || defined(__DOXYGEN__)
18410 /// Enable the open-drain driver on pin RJ2.
18411 # define ENABLE_RJ2_OPENDRAIN() (_ODCJ2 = 1)
18412 /// Disable the open-drain driver on pin RJ2.
18413 # define DISABLE_RJ2_OPENDRAIN() (_ODCJ2 = 0)
18414 # elif defined(_ODJ2) // The PIF24F names this bit _OD instead of _ODC.
18415 # define ENABLE_RJ2_OPENDRAIN() (_ODJ2 = 1)
18416 # define DISABLE_RJ2_OPENDRAIN() (_ODJ2 = 0)
18417 # else
18418 # define DISABLE_RJ2_OPENDRAIN() ((void) 0)
18419 # endif
18420 
18421 // Change notification, pullups and pulldowns:
18422 # if defined(_CNIEJ2) || defined(__DOXYGEN__)
18423 /// Enable the pullup on pin RJ2.
18424 # define ENABLE_RJ2_PULLUP() (_CNPUJ2 = 1)
18425 /// Disable the pullup on pin RJ2.
18426 # define DISABLE_RJ2_PULLUP() (_CNPUJ2 = 0)
18427 
18428 /// Enable the pulldown on pin RJ2.
18429 # define ENABLE_RJ2_PULLDOWN() (_CNPDJ2 = 1)
18430 /// Disable the pulldown on pin RJ2.
18431 # define DISABLE_RJ2_PULLDOWN() (_CNPDJ2 = 0)
18432 
18433 /// Enable the change notification interrupt on pin RJ2.
18434 # define ENABLE_RJ2_CN_INTERRUPT() (_CNIEJ2 = 1)
18435 /// Disable the change notification interrupt on pin RJ2.
18436 # define DISABLE_RJ2_CN_INTERRUPT() (_CNIEJ2 = 0)
18437 
18438 # elif defined(RJ2_CN)
18439 # define ENABLE_RJ2_PULLUP() (RXY_GPIO_CNPUE(RJ2_CN) = 1)
18440 # define DISABLE_RJ2_PULLUP() (RXY_GPIO_CNPUE(RJ2_CN) = 0)
18441 
18442 # if RXY_HAS_CNPDE(RJ2_CN)
18443 # define ENABLE_RJ2_PULLDOWN() (RXY_GPIO_CNPDE(RJ2_CN) = 1)
18444 # define DISABLE_RJ2_PULLDOWN() (RXY_GPIO_CNPDE(RJ2_CN) = 0)
18445 # else
18446 # define DISABLE_RJ2_PULLDOWN() ((void) 0)
18447 # endif
18448 
18449 # define ENABLE_RJ2_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ2_CN) = 1)
18450 # define DISABLE_RJ2_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ2_CN) = 0)
18451 
18452 # else
18453 # define DISABLE_RJ2_PULLUP() ((void) 0)
18454 # define DISABLE_RJ2_PULLDOWN() ((void) 0)
18455 # define DISABLE_RJ2_CN_INTERRUPT() ((void) 0)
18456 # endif
18457 
18458 // High-level config
18459 // -----------------
18460 /** This macro disables pullups/downs, enables analog functionality, and configures
18461  * pin RJ2 as an input.
18462  */
18463 # if defined(_ANSJ2) || defined(RJ2_AN) || defined(__DOXYGEN__)
18464 # define CONFIG_RJ2_AS_ANALOG() \
18465  do { \
18466  ENABLE_RJ2_ANALOG(); \
18467  CONFIG_RJ2_AS_INPUT(); \
18468  DISABLE_RJ2_OPENDRAIN(); \
18469  DISABLE_RJ2_PULLUP(); \
18470  DISABLE_RJ2_PULLDOWN(); \
18471  } while (0)
18472 # endif
18473 
18474 /** This macro disables open-drain and pullups/downs,
18475  * configures pin RJ2 for digital (not analog) operation, and
18476  * configures the pin as an input.
18477  */
18478 # define CONFIG_RJ2_AS_DIG_INPUT() \
18479  do { \
18480  DISABLE_RJ2_ANALOG(); \
18481  CONFIG_RJ2_AS_INPUT(); \
18482  DISABLE_RJ2_OPENDRAIN(); \
18483  DISABLE_RJ2_PULLUP(); \
18484  DISABLE_RJ2_PULLDOWN(); \
18485  } while (0)
18486 
18487 /** This macro disables open-drain and pullups/downs,
18488  * configures pin RJ2 for digital (not analog) operation, and
18489  * configures the pin as an output.
18490  */
18491 # define CONFIG_RJ2_AS_DIG_OUTPUT() \
18492  do { \
18493  DISABLE_RJ2_ANALOG(); \
18494  CONFIG_RJ2_AS_OUTPUT(); \
18495  DISABLE_RJ2_OPENDRAIN(); \
18496  DISABLE_RJ2_PULLUP(); \
18497  DISABLE_RJ2_PULLDOWN(); \
18498  } while (0)
18499 
18500 #endif // #if defined(_RJ2) || defined(__DOXYGEN__): Provide GPIO for RJ2
18501 
18502 
18503 
18504 
18505 
18506 // Provide GPIO for RJ3
18507 // ====================
18508 #if defined(_RJ3) || defined(__DOXYGEN__)
18509 
18510 // Dummy macros for documentation only
18511 # ifdef __DOXYGEN__
18512 /// This macro specifies the RPy value associated with pin RJ3.
18513 /// Its device-specific definition is given in pic24_ports_mapping.h.
18514 # define RJ3_RP xx
18515 
18516 /// This macro specifies the ANn value associated with pin RJ3.
18517 /// Its device-specific definition is given in pic24_ports_mapping.h.
18518 # define RJ3_AN xx
18519 
18520 /// This macro specifies the CNm value associated with pin RJ3.
18521 /// Its device-specific definition is given in pic24_ports_mapping.h.
18522 # define RJ3_CN xx
18523 
18524 //@}
18525 # endif // #ifdef __DOXYGEN__
18526 
18527 
18528 // Low-level config
18529 // ----------------
18530 // Analog:
18531 # if defined(_ANSJ3) || defined(__DOXYGEN__)
18532 /// Enable analog functionality on pin RJ3.
18533 # define ENABLE_RJ3_ANALOG() (_ANSJ3 = 1)
18534 /// Disable analog functionality on pin RJ3.
18535 # define DISABLE_RJ3_ANALOG() (_ANSJ3 = 0)
18536 # elif defined(RJ3_AN)
18537 # define ENABLE_RJ3_ANALOG() (RXY_GPIO_PCFG(RJ3_AN) = 0)
18538 # define DISABLE_RJ3_ANALOG() (RXY_GPIO_PCFG(RJ3_AN) = 1)
18539 # else
18540 # define DISABLE_RJ3_ANALOG() ((void) 0)
18541 # endif
18542 
18543 // Input/output:
18544 /// Configure pin RJ3 as an input.
18545 # define CONFIG_RJ3_AS_INPUT() (_TRISJ3 = 1)
18546 /// Configure pin RJ3 as an output.
18547 # define CONFIG_RJ3_AS_OUTPUT() (_TRISJ3 = 0)
18548 
18549 // Open-drain:
18550 # if defined(_ODCJ3) || defined(__DOXYGEN__)
18551 /// Enable the open-drain driver on pin RJ3.
18552 # define ENABLE_RJ3_OPENDRAIN() (_ODCJ3 = 1)
18553 /// Disable the open-drain driver on pin RJ3.
18554 # define DISABLE_RJ3_OPENDRAIN() (_ODCJ3 = 0)
18555 # elif defined(_ODJ3) // The PIF24F names this bit _OD instead of _ODC.
18556 # define ENABLE_RJ3_OPENDRAIN() (_ODJ3 = 1)
18557 # define DISABLE_RJ3_OPENDRAIN() (_ODJ3 = 0)
18558 # else
18559 # define DISABLE_RJ3_OPENDRAIN() ((void) 0)
18560 # endif
18561 
18562 // Change notification, pullups and pulldowns:
18563 # if defined(_CNIEJ3) || defined(__DOXYGEN__)
18564 /// Enable the pullup on pin RJ3.
18565 # define ENABLE_RJ3_PULLUP() (_CNPUJ3 = 1)
18566 /// Disable the pullup on pin RJ3.
18567 # define DISABLE_RJ3_PULLUP() (_CNPUJ3 = 0)
18568 
18569 /// Enable the pulldown on pin RJ3.
18570 # define ENABLE_RJ3_PULLDOWN() (_CNPDJ3 = 1)
18571 /// Disable the pulldown on pin RJ3.
18572 # define DISABLE_RJ3_PULLDOWN() (_CNPDJ3 = 0)
18573 
18574 /// Enable the change notification interrupt on pin RJ3.
18575 # define ENABLE_RJ3_CN_INTERRUPT() (_CNIEJ3 = 1)
18576 /// Disable the change notification interrupt on pin RJ3.
18577 # define DISABLE_RJ3_CN_INTERRUPT() (_CNIEJ3 = 0)
18578 
18579 # elif defined(RJ3_CN)
18580 # define ENABLE_RJ3_PULLUP() (RXY_GPIO_CNPUE(RJ3_CN) = 1)
18581 # define DISABLE_RJ3_PULLUP() (RXY_GPIO_CNPUE(RJ3_CN) = 0)
18582 
18583 # if RXY_HAS_CNPDE(RJ3_CN)
18584 # define ENABLE_RJ3_PULLDOWN() (RXY_GPIO_CNPDE(RJ3_CN) = 1)
18585 # define DISABLE_RJ3_PULLDOWN() (RXY_GPIO_CNPDE(RJ3_CN) = 0)
18586 # else
18587 # define DISABLE_RJ3_PULLDOWN() ((void) 0)
18588 # endif
18589 
18590 # define ENABLE_RJ3_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ3_CN) = 1)
18591 # define DISABLE_RJ3_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ3_CN) = 0)
18592 
18593 # else
18594 # define DISABLE_RJ3_PULLUP() ((void) 0)
18595 # define DISABLE_RJ3_PULLDOWN() ((void) 0)
18596 # define DISABLE_RJ3_CN_INTERRUPT() ((void) 0)
18597 # endif
18598 
18599 // High-level config
18600 // -----------------
18601 /** This macro disables pullups/downs, enables analog functionality, and configures
18602  * pin RJ3 as an input.
18603  */
18604 # if defined(_ANSJ3) || defined(RJ3_AN) || defined(__DOXYGEN__)
18605 # define CONFIG_RJ3_AS_ANALOG() \
18606  do { \
18607  ENABLE_RJ3_ANALOG(); \
18608  CONFIG_RJ3_AS_INPUT(); \
18609  DISABLE_RJ3_OPENDRAIN(); \
18610  DISABLE_RJ3_PULLUP(); \
18611  DISABLE_RJ3_PULLDOWN(); \
18612  } while (0)
18613 # endif
18614 
18615 /** This macro disables open-drain and pullups/downs,
18616  * configures pin RJ3 for digital (not analog) operation, and
18617  * configures the pin as an input.
18618  */
18619 # define CONFIG_RJ3_AS_DIG_INPUT() \
18620  do { \
18621  DISABLE_RJ3_ANALOG(); \
18622  CONFIG_RJ3_AS_INPUT(); \
18623  DISABLE_RJ3_OPENDRAIN(); \
18624  DISABLE_RJ3_PULLUP(); \
18625  DISABLE_RJ3_PULLDOWN(); \
18626  } while (0)
18627 
18628 /** This macro disables open-drain and pullups/downs,
18629  * configures pin RJ3 for digital (not analog) operation, and
18630  * configures the pin as an output.
18631  */
18632 # define CONFIG_RJ3_AS_DIG_OUTPUT() \
18633  do { \
18634  DISABLE_RJ3_ANALOG(); \
18635  CONFIG_RJ3_AS_OUTPUT(); \
18636  DISABLE_RJ3_OPENDRAIN(); \
18637  DISABLE_RJ3_PULLUP(); \
18638  DISABLE_RJ3_PULLDOWN(); \
18639  } while (0)
18640 
18641 #endif // #if defined(_RJ3) || defined(__DOXYGEN__): Provide GPIO for RJ3
18642 
18643 
18644 
18645 
18646 
18647 // Provide GPIO for RJ4
18648 // ====================
18649 #if defined(_RJ4) || defined(__DOXYGEN__)
18650 
18651 // Dummy macros for documentation only
18652 # ifdef __DOXYGEN__
18653 /// This macro specifies the RPy value associated with pin RJ4.
18654 /// Its device-specific definition is given in pic24_ports_mapping.h.
18655 # define RJ4_RP xx
18656 
18657 /// This macro specifies the ANn value associated with pin RJ4.
18658 /// Its device-specific definition is given in pic24_ports_mapping.h.
18659 # define RJ4_AN xx
18660 
18661 /// This macro specifies the CNm value associated with pin RJ4.
18662 /// Its device-specific definition is given in pic24_ports_mapping.h.
18663 # define RJ4_CN xx
18664 
18665 //@}
18666 # endif // #ifdef __DOXYGEN__
18667 
18668 
18669 // Low-level config
18670 // ----------------
18671 // Analog:
18672 # if defined(_ANSJ4) || defined(__DOXYGEN__)
18673 /// Enable analog functionality on pin RJ4.
18674 # define ENABLE_RJ4_ANALOG() (_ANSJ4 = 1)
18675 /// Disable analog functionality on pin RJ4.
18676 # define DISABLE_RJ4_ANALOG() (_ANSJ4 = 0)
18677 # elif defined(RJ4_AN)
18678 # define ENABLE_RJ4_ANALOG() (RXY_GPIO_PCFG(RJ4_AN) = 0)
18679 # define DISABLE_RJ4_ANALOG() (RXY_GPIO_PCFG(RJ4_AN) = 1)
18680 # else
18681 # define DISABLE_RJ4_ANALOG() ((void) 0)
18682 # endif
18683 
18684 // Input/output:
18685 /// Configure pin RJ4 as an input.
18686 # define CONFIG_RJ4_AS_INPUT() (_TRISJ4 = 1)
18687 /// Configure pin RJ4 as an output.
18688 # define CONFIG_RJ4_AS_OUTPUT() (_TRISJ4 = 0)
18689 
18690 // Open-drain:
18691 # if defined(_ODCJ4) || defined(__DOXYGEN__)
18692 /// Enable the open-drain driver on pin RJ4.
18693 # define ENABLE_RJ4_OPENDRAIN() (_ODCJ4 = 1)
18694 /// Disable the open-drain driver on pin RJ4.
18695 # define DISABLE_RJ4_OPENDRAIN() (_ODCJ4 = 0)
18696 # elif defined(_ODJ4) // The PIF24F names this bit _OD instead of _ODC.
18697 # define ENABLE_RJ4_OPENDRAIN() (_ODJ4 = 1)
18698 # define DISABLE_RJ4_OPENDRAIN() (_ODJ4 = 0)
18699 # else
18700 # define DISABLE_RJ4_OPENDRAIN() ((void) 0)
18701 # endif
18702 
18703 // Change notification, pullups and pulldowns:
18704 # if defined(_CNIEJ4) || defined(__DOXYGEN__)
18705 /// Enable the pullup on pin RJ4.
18706 # define ENABLE_RJ4_PULLUP() (_CNPUJ4 = 1)
18707 /// Disable the pullup on pin RJ4.
18708 # define DISABLE_RJ4_PULLUP() (_CNPUJ4 = 0)
18709 
18710 /// Enable the pulldown on pin RJ4.
18711 # define ENABLE_RJ4_PULLDOWN() (_CNPDJ4 = 1)
18712 /// Disable the pulldown on pin RJ4.
18713 # define DISABLE_RJ4_PULLDOWN() (_CNPDJ4 = 0)
18714 
18715 /// Enable the change notification interrupt on pin RJ4.
18716 # define ENABLE_RJ4_CN_INTERRUPT() (_CNIEJ4 = 1)
18717 /// Disable the change notification interrupt on pin RJ4.
18718 # define DISABLE_RJ4_CN_INTERRUPT() (_CNIEJ4 = 0)
18719 
18720 # elif defined(RJ4_CN)
18721 # define ENABLE_RJ4_PULLUP() (RXY_GPIO_CNPUE(RJ4_CN) = 1)
18722 # define DISABLE_RJ4_PULLUP() (RXY_GPIO_CNPUE(RJ4_CN) = 0)
18723 
18724 # if RXY_HAS_CNPDE(RJ4_CN)
18725 # define ENABLE_RJ4_PULLDOWN() (RXY_GPIO_CNPDE(RJ4_CN) = 1)
18726 # define DISABLE_RJ4_PULLDOWN() (RXY_GPIO_CNPDE(RJ4_CN) = 0)
18727 # else
18728 # define DISABLE_RJ4_PULLDOWN() ((void) 0)
18729 # endif
18730 
18731 # define ENABLE_RJ4_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ4_CN) = 1)
18732 # define DISABLE_RJ4_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ4_CN) = 0)
18733 
18734 # else
18735 # define DISABLE_RJ4_PULLUP() ((void) 0)
18736 # define DISABLE_RJ4_PULLDOWN() ((void) 0)
18737 # define DISABLE_RJ4_CN_INTERRUPT() ((void) 0)
18738 # endif
18739 
18740 // High-level config
18741 // -----------------
18742 /** This macro disables pullups/downs, enables analog functionality, and configures
18743  * pin RJ4 as an input.
18744  */
18745 # if defined(_ANSJ4) || defined(RJ4_AN) || defined(__DOXYGEN__)
18746 # define CONFIG_RJ4_AS_ANALOG() \
18747  do { \
18748  ENABLE_RJ4_ANALOG(); \
18749  CONFIG_RJ4_AS_INPUT(); \
18750  DISABLE_RJ4_OPENDRAIN(); \
18751  DISABLE_RJ4_PULLUP(); \
18752  DISABLE_RJ4_PULLDOWN(); \
18753  } while (0)
18754 # endif
18755 
18756 /** This macro disables open-drain and pullups/downs,
18757  * configures pin RJ4 for digital (not analog) operation, and
18758  * configures the pin as an input.
18759  */
18760 # define CONFIG_RJ4_AS_DIG_INPUT() \
18761  do { \
18762  DISABLE_RJ4_ANALOG(); \
18763  CONFIG_RJ4_AS_INPUT(); \
18764  DISABLE_RJ4_OPENDRAIN(); \
18765  DISABLE_RJ4_PULLUP(); \
18766  DISABLE_RJ4_PULLDOWN(); \
18767  } while (0)
18768 
18769 /** This macro disables open-drain and pullups/downs,
18770  * configures pin RJ4 for digital (not analog) operation, and
18771  * configures the pin as an output.
18772  */
18773 # define CONFIG_RJ4_AS_DIG_OUTPUT() \
18774  do { \
18775  DISABLE_RJ4_ANALOG(); \
18776  CONFIG_RJ4_AS_OUTPUT(); \
18777  DISABLE_RJ4_OPENDRAIN(); \
18778  DISABLE_RJ4_PULLUP(); \
18779  DISABLE_RJ4_PULLDOWN(); \
18780  } while (0)
18781 
18782 #endif // #if defined(_RJ4) || defined(__DOXYGEN__): Provide GPIO for RJ4
18783 
18784 
18785 
18786 
18787 
18788 // Provide GPIO for RJ5
18789 // ====================
18790 #if defined(_RJ5) || defined(__DOXYGEN__)
18791 
18792 // Dummy macros for documentation only
18793 # ifdef __DOXYGEN__
18794 /// This macro specifies the RPy value associated with pin RJ5.
18795 /// Its device-specific definition is given in pic24_ports_mapping.h.
18796 # define RJ5_RP xx
18797 
18798 /// This macro specifies the ANn value associated with pin RJ5.
18799 /// Its device-specific definition is given in pic24_ports_mapping.h.
18800 # define RJ5_AN xx
18801 
18802 /// This macro specifies the CNm value associated with pin RJ5.
18803 /// Its device-specific definition is given in pic24_ports_mapping.h.
18804 # define RJ5_CN xx
18805 
18806 //@}
18807 # endif // #ifdef __DOXYGEN__
18808 
18809 
18810 // Low-level config
18811 // ----------------
18812 // Analog:
18813 # if defined(_ANSJ5) || defined(__DOXYGEN__)
18814 /// Enable analog functionality on pin RJ5.
18815 # define ENABLE_RJ5_ANALOG() (_ANSJ5 = 1)
18816 /// Disable analog functionality on pin RJ5.
18817 # define DISABLE_RJ5_ANALOG() (_ANSJ5 = 0)
18818 # elif defined(RJ5_AN)
18819 # define ENABLE_RJ5_ANALOG() (RXY_GPIO_PCFG(RJ5_AN) = 0)
18820 # define DISABLE_RJ5_ANALOG() (RXY_GPIO_PCFG(RJ5_AN) = 1)
18821 # else
18822 # define DISABLE_RJ5_ANALOG() ((void) 0)
18823 # endif
18824 
18825 // Input/output:
18826 /// Configure pin RJ5 as an input.
18827 # define CONFIG_RJ5_AS_INPUT() (_TRISJ5 = 1)
18828 /// Configure pin RJ5 as an output.
18829 # define CONFIG_RJ5_AS_OUTPUT() (_TRISJ5 = 0)
18830 
18831 // Open-drain:
18832 # if defined(_ODCJ5) || defined(__DOXYGEN__)
18833 /// Enable the open-drain driver on pin RJ5.
18834 # define ENABLE_RJ5_OPENDRAIN() (_ODCJ5 = 1)
18835 /// Disable the open-drain driver on pin RJ5.
18836 # define DISABLE_RJ5_OPENDRAIN() (_ODCJ5 = 0)
18837 # elif defined(_ODJ5) // The PIF24F names this bit _OD instead of _ODC.
18838 # define ENABLE_RJ5_OPENDRAIN() (_ODJ5 = 1)
18839 # define DISABLE_RJ5_OPENDRAIN() (_ODJ5 = 0)
18840 # else
18841 # define DISABLE_RJ5_OPENDRAIN() ((void) 0)
18842 # endif
18843 
18844 // Change notification, pullups and pulldowns:
18845 # if defined(_CNIEJ5) || defined(__DOXYGEN__)
18846 /// Enable the pullup on pin RJ5.
18847 # define ENABLE_RJ5_PULLUP() (_CNPUJ5 = 1)
18848 /// Disable the pullup on pin RJ5.
18849 # define DISABLE_RJ5_PULLUP() (_CNPUJ5 = 0)
18850 
18851 /// Enable the pulldown on pin RJ5.
18852 # define ENABLE_RJ5_PULLDOWN() (_CNPDJ5 = 1)
18853 /// Disable the pulldown on pin RJ5.
18854 # define DISABLE_RJ5_PULLDOWN() (_CNPDJ5 = 0)
18855 
18856 /// Enable the change notification interrupt on pin RJ5.
18857 # define ENABLE_RJ5_CN_INTERRUPT() (_CNIEJ5 = 1)
18858 /// Disable the change notification interrupt on pin RJ5.
18859 # define DISABLE_RJ5_CN_INTERRUPT() (_CNIEJ5 = 0)
18860 
18861 # elif defined(RJ5_CN)
18862 # define ENABLE_RJ5_PULLUP() (RXY_GPIO_CNPUE(RJ5_CN) = 1)
18863 # define DISABLE_RJ5_PULLUP() (RXY_GPIO_CNPUE(RJ5_CN) = 0)
18864 
18865 # if RXY_HAS_CNPDE(RJ5_CN)
18866 # define ENABLE_RJ5_PULLDOWN() (RXY_GPIO_CNPDE(RJ5_CN) = 1)
18867 # define DISABLE_RJ5_PULLDOWN() (RXY_GPIO_CNPDE(RJ5_CN) = 0)
18868 # else
18869 # define DISABLE_RJ5_PULLDOWN() ((void) 0)
18870 # endif
18871 
18872 # define ENABLE_RJ5_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ5_CN) = 1)
18873 # define DISABLE_RJ5_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ5_CN) = 0)
18874 
18875 # else
18876 # define DISABLE_RJ5_PULLUP() ((void) 0)
18877 # define DISABLE_RJ5_PULLDOWN() ((void) 0)
18878 # define DISABLE_RJ5_CN_INTERRUPT() ((void) 0)
18879 # endif
18880 
18881 // High-level config
18882 // -----------------
18883 /** This macro disables pullups/downs, enables analog functionality, and configures
18884  * pin RJ5 as an input.
18885  */
18886 # if defined(_ANSJ5) || defined(RJ5_AN) || defined(__DOXYGEN__)
18887 # define CONFIG_RJ5_AS_ANALOG() \
18888  do { \
18889  ENABLE_RJ5_ANALOG(); \
18890  CONFIG_RJ5_AS_INPUT(); \
18891  DISABLE_RJ5_OPENDRAIN(); \
18892  DISABLE_RJ5_PULLUP(); \
18893  DISABLE_RJ5_PULLDOWN(); \
18894  } while (0)
18895 # endif
18896 
18897 /** This macro disables open-drain and pullups/downs,
18898  * configures pin RJ5 for digital (not analog) operation, and
18899  * configures the pin as an input.
18900  */
18901 # define CONFIG_RJ5_AS_DIG_INPUT() \
18902  do { \
18903  DISABLE_RJ5_ANALOG(); \
18904  CONFIG_RJ5_AS_INPUT(); \
18905  DISABLE_RJ5_OPENDRAIN(); \
18906  DISABLE_RJ5_PULLUP(); \
18907  DISABLE_RJ5_PULLDOWN(); \
18908  } while (0)
18909 
18910 /** This macro disables open-drain and pullups/downs,
18911  * configures pin RJ5 for digital (not analog) operation, and
18912  * configures the pin as an output.
18913  */
18914 # define CONFIG_RJ5_AS_DIG_OUTPUT() \
18915  do { \
18916  DISABLE_RJ5_ANALOG(); \
18917  CONFIG_RJ5_AS_OUTPUT(); \
18918  DISABLE_RJ5_OPENDRAIN(); \
18919  DISABLE_RJ5_PULLUP(); \
18920  DISABLE_RJ5_PULLDOWN(); \
18921  } while (0)
18922 
18923 #endif // #if defined(_RJ5) || defined(__DOXYGEN__): Provide GPIO for RJ5
18924 
18925 
18926 
18927 
18928 
18929 // Provide GPIO for RJ6
18930 // ====================
18931 #if defined(_RJ6) || defined(__DOXYGEN__)
18932 
18933 // Dummy macros for documentation only
18934 # ifdef __DOXYGEN__
18935 /// This macro specifies the RPy value associated with pin RJ6.
18936 /// Its device-specific definition is given in pic24_ports_mapping.h.
18937 # define RJ6_RP xx
18938 
18939 /// This macro specifies the ANn value associated with pin RJ6.
18940 /// Its device-specific definition is given in pic24_ports_mapping.h.
18941 # define RJ6_AN xx
18942 
18943 /// This macro specifies the CNm value associated with pin RJ6.
18944 /// Its device-specific definition is given in pic24_ports_mapping.h.
18945 # define RJ6_CN xx
18946 
18947 //@}
18948 # endif // #ifdef __DOXYGEN__
18949 
18950 
18951 // Low-level config
18952 // ----------------
18953 // Analog:
18954 # if defined(_ANSJ6) || defined(__DOXYGEN__)
18955 /// Enable analog functionality on pin RJ6.
18956 # define ENABLE_RJ6_ANALOG() (_ANSJ6 = 1)
18957 /// Disable analog functionality on pin RJ6.
18958 # define DISABLE_RJ6_ANALOG() (_ANSJ6 = 0)
18959 # elif defined(RJ6_AN)
18960 # define ENABLE_RJ6_ANALOG() (RXY_GPIO_PCFG(RJ6_AN) = 0)
18961 # define DISABLE_RJ6_ANALOG() (RXY_GPIO_PCFG(RJ6_AN) = 1)
18962 # else
18963 # define DISABLE_RJ6_ANALOG() ((void) 0)
18964 # endif
18965 
18966 // Input/output:
18967 /// Configure pin RJ6 as an input.
18968 # define CONFIG_RJ6_AS_INPUT() (_TRISJ6 = 1)
18969 /// Configure pin RJ6 as an output.
18970 # define CONFIG_RJ6_AS_OUTPUT() (_TRISJ6 = 0)
18971 
18972 // Open-drain:
18973 # if defined(_ODCJ6) || defined(__DOXYGEN__)
18974 /// Enable the open-drain driver on pin RJ6.
18975 # define ENABLE_RJ6_OPENDRAIN() (_ODCJ6 = 1)
18976 /// Disable the open-drain driver on pin RJ6.
18977 # define DISABLE_RJ6_OPENDRAIN() (_ODCJ6 = 0)
18978 # elif defined(_ODJ6) // The PIF24F names this bit _OD instead of _ODC.
18979 # define ENABLE_RJ6_OPENDRAIN() (_ODJ6 = 1)
18980 # define DISABLE_RJ6_OPENDRAIN() (_ODJ6 = 0)
18981 # else
18982 # define DISABLE_RJ6_OPENDRAIN() ((void) 0)
18983 # endif
18984 
18985 // Change notification, pullups and pulldowns:
18986 # if defined(_CNIEJ6) || defined(__DOXYGEN__)
18987 /// Enable the pullup on pin RJ6.
18988 # define ENABLE_RJ6_PULLUP() (_CNPUJ6 = 1)
18989 /// Disable the pullup on pin RJ6.
18990 # define DISABLE_RJ6_PULLUP() (_CNPUJ6 = 0)
18991 
18992 /// Enable the pulldown on pin RJ6.
18993 # define ENABLE_RJ6_PULLDOWN() (_CNPDJ6 = 1)
18994 /// Disable the pulldown on pin RJ6.
18995 # define DISABLE_RJ6_PULLDOWN() (_CNPDJ6 = 0)
18996 
18997 /// Enable the change notification interrupt on pin RJ6.
18998 # define ENABLE_RJ6_CN_INTERRUPT() (_CNIEJ6 = 1)
18999 /// Disable the change notification interrupt on pin RJ6.
19000 # define DISABLE_RJ6_CN_INTERRUPT() (_CNIEJ6 = 0)
19001 
19002 # elif defined(RJ6_CN)
19003 # define ENABLE_RJ6_PULLUP() (RXY_GPIO_CNPUE(RJ6_CN) = 1)
19004 # define DISABLE_RJ6_PULLUP() (RXY_GPIO_CNPUE(RJ6_CN) = 0)
19005 
19006 # if RXY_HAS_CNPDE(RJ6_CN)
19007 # define ENABLE_RJ6_PULLDOWN() (RXY_GPIO_CNPDE(RJ6_CN) = 1)
19008 # define DISABLE_RJ6_PULLDOWN() (RXY_GPIO_CNPDE(RJ6_CN) = 0)
19009 # else
19010 # define DISABLE_RJ6_PULLDOWN() ((void) 0)
19011 # endif
19012 
19013 # define ENABLE_RJ6_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ6_CN) = 1)
19014 # define DISABLE_RJ6_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ6_CN) = 0)
19015 
19016 # else
19017 # define DISABLE_RJ6_PULLUP() ((void) 0)
19018 # define DISABLE_RJ6_PULLDOWN() ((void) 0)
19019 # define DISABLE_RJ6_CN_INTERRUPT() ((void) 0)
19020 # endif
19021 
19022 // High-level config
19023 // -----------------
19024 /** This macro disables pullups/downs, enables analog functionality, and configures
19025  * pin RJ6 as an input.
19026  */
19027 # if defined(_ANSJ6) || defined(RJ6_AN) || defined(__DOXYGEN__)
19028 # define CONFIG_RJ6_AS_ANALOG() \
19029  do { \
19030  ENABLE_RJ6_ANALOG(); \
19031  CONFIG_RJ6_AS_INPUT(); \
19032  DISABLE_RJ6_OPENDRAIN(); \
19033  DISABLE_RJ6_PULLUP(); \
19034  DISABLE_RJ6_PULLDOWN(); \
19035  } while (0)
19036 # endif
19037 
19038 /** This macro disables open-drain and pullups/downs,
19039  * configures pin RJ6 for digital (not analog) operation, and
19040  * configures the pin as an input.
19041  */
19042 # define CONFIG_RJ6_AS_DIG_INPUT() \
19043  do { \
19044  DISABLE_RJ6_ANALOG(); \
19045  CONFIG_RJ6_AS_INPUT(); \
19046  DISABLE_RJ6_OPENDRAIN(); \
19047  DISABLE_RJ6_PULLUP(); \
19048  DISABLE_RJ6_PULLDOWN(); \
19049  } while (0)
19050 
19051 /** This macro disables open-drain and pullups/downs,
19052  * configures pin RJ6 for digital (not analog) operation, and
19053  * configures the pin as an output.
19054  */
19055 # define CONFIG_RJ6_AS_DIG_OUTPUT() \
19056  do { \
19057  DISABLE_RJ6_ANALOG(); \
19058  CONFIG_RJ6_AS_OUTPUT(); \
19059  DISABLE_RJ6_OPENDRAIN(); \
19060  DISABLE_RJ6_PULLUP(); \
19061  DISABLE_RJ6_PULLDOWN(); \
19062  } while (0)
19063 
19064 #endif // #if defined(_RJ6) || defined(__DOXYGEN__): Provide GPIO for RJ6
19065 
19066 
19067 
19068 
19069 
19070 // Provide GPIO for RJ7
19071 // ====================
19072 #if defined(_RJ7) || defined(__DOXYGEN__)
19073 
19074 // Dummy macros for documentation only
19075 # ifdef __DOXYGEN__
19076 /// This macro specifies the RPy value associated with pin RJ7.
19077 /// Its device-specific definition is given in pic24_ports_mapping.h.
19078 # define RJ7_RP xx
19079 
19080 /// This macro specifies the ANn value associated with pin RJ7.
19081 /// Its device-specific definition is given in pic24_ports_mapping.h.
19082 # define RJ7_AN xx
19083 
19084 /// This macro specifies the CNm value associated with pin RJ7.
19085 /// Its device-specific definition is given in pic24_ports_mapping.h.
19086 # define RJ7_CN xx
19087 
19088 //@}
19089 # endif // #ifdef __DOXYGEN__
19090 
19091 
19092 // Low-level config
19093 // ----------------
19094 // Analog:
19095 # if defined(_ANSJ7) || defined(__DOXYGEN__)
19096 /// Enable analog functionality on pin RJ7.
19097 # define ENABLE_RJ7_ANALOG() (_ANSJ7 = 1)
19098 /// Disable analog functionality on pin RJ7.
19099 # define DISABLE_RJ7_ANALOG() (_ANSJ7 = 0)
19100 # elif defined(RJ7_AN)
19101 # define ENABLE_RJ7_ANALOG() (RXY_GPIO_PCFG(RJ7_AN) = 0)
19102 # define DISABLE_RJ7_ANALOG() (RXY_GPIO_PCFG(RJ7_AN) = 1)
19103 # else
19104 # define DISABLE_RJ7_ANALOG() ((void) 0)
19105 # endif
19106 
19107 // Input/output:
19108 /// Configure pin RJ7 as an input.
19109 # define CONFIG_RJ7_AS_INPUT() (_TRISJ7 = 1)
19110 /// Configure pin RJ7 as an output.
19111 # define CONFIG_RJ7_AS_OUTPUT() (_TRISJ7 = 0)
19112 
19113 // Open-drain:
19114 # if defined(_ODCJ7) || defined(__DOXYGEN__)
19115 /// Enable the open-drain driver on pin RJ7.
19116 # define ENABLE_RJ7_OPENDRAIN() (_ODCJ7 = 1)
19117 /// Disable the open-drain driver on pin RJ7.
19118 # define DISABLE_RJ7_OPENDRAIN() (_ODCJ7 = 0)
19119 # elif defined(_ODJ7) // The PIF24F names this bit _OD instead of _ODC.
19120 # define ENABLE_RJ7_OPENDRAIN() (_ODJ7 = 1)
19121 # define DISABLE_RJ7_OPENDRAIN() (_ODJ7 = 0)
19122 # else
19123 # define DISABLE_RJ7_OPENDRAIN() ((void) 0)
19124 # endif
19125 
19126 // Change notification, pullups and pulldowns:
19127 # if defined(_CNIEJ7) || defined(__DOXYGEN__)
19128 /// Enable the pullup on pin RJ7.
19129 # define ENABLE_RJ7_PULLUP() (_CNPUJ7 = 1)
19130 /// Disable the pullup on pin RJ7.
19131 # define DISABLE_RJ7_PULLUP() (_CNPUJ7 = 0)
19132 
19133 /// Enable the pulldown on pin RJ7.
19134 # define ENABLE_RJ7_PULLDOWN() (_CNPDJ7 = 1)
19135 /// Disable the pulldown on pin RJ7.
19136 # define DISABLE_RJ7_PULLDOWN() (_CNPDJ7 = 0)
19137 
19138 /// Enable the change notification interrupt on pin RJ7.
19139 # define ENABLE_RJ7_CN_INTERRUPT() (_CNIEJ7 = 1)
19140 /// Disable the change notification interrupt on pin RJ7.
19141 # define DISABLE_RJ7_CN_INTERRUPT() (_CNIEJ7 = 0)
19142 
19143 # elif defined(RJ7_CN)
19144 # define ENABLE_RJ7_PULLUP() (RXY_GPIO_CNPUE(RJ7_CN) = 1)
19145 # define DISABLE_RJ7_PULLUP() (RXY_GPIO_CNPUE(RJ7_CN) = 0)
19146 
19147 # if RXY_HAS_CNPDE(RJ7_CN)
19148 # define ENABLE_RJ7_PULLDOWN() (RXY_GPIO_CNPDE(RJ7_CN) = 1)
19149 # define DISABLE_RJ7_PULLDOWN() (RXY_GPIO_CNPDE(RJ7_CN) = 0)
19150 # else
19151 # define DISABLE_RJ7_PULLDOWN() ((void) 0)
19152 # endif
19153 
19154 # define ENABLE_RJ7_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ7_CN) = 1)
19155 # define DISABLE_RJ7_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ7_CN) = 0)
19156 
19157 # else
19158 # define DISABLE_RJ7_PULLUP() ((void) 0)
19159 # define DISABLE_RJ7_PULLDOWN() ((void) 0)
19160 # define DISABLE_RJ7_CN_INTERRUPT() ((void) 0)
19161 # endif
19162 
19163 // High-level config
19164 // -----------------
19165 /** This macro disables pullups/downs, enables analog functionality, and configures
19166  * pin RJ7 as an input.
19167  */
19168 # if defined(_ANSJ7) || defined(RJ7_AN) || defined(__DOXYGEN__)
19169 # define CONFIG_RJ7_AS_ANALOG() \
19170  do { \
19171  ENABLE_RJ7_ANALOG(); \
19172  CONFIG_RJ7_AS_INPUT(); \
19173  DISABLE_RJ7_OPENDRAIN(); \
19174  DISABLE_RJ7_PULLUP(); \
19175  DISABLE_RJ7_PULLDOWN(); \
19176  } while (0)
19177 # endif
19178 
19179 /** This macro disables open-drain and pullups/downs,
19180  * configures pin RJ7 for digital (not analog) operation, and
19181  * configures the pin as an input.
19182  */
19183 # define CONFIG_RJ7_AS_DIG_INPUT() \
19184  do { \
19185  DISABLE_RJ7_ANALOG(); \
19186  CONFIG_RJ7_AS_INPUT(); \
19187  DISABLE_RJ7_OPENDRAIN(); \
19188  DISABLE_RJ7_PULLUP(); \
19189  DISABLE_RJ7_PULLDOWN(); \
19190  } while (0)
19191 
19192 /** This macro disables open-drain and pullups/downs,
19193  * configures pin RJ7 for digital (not analog) operation, and
19194  * configures the pin as an output.
19195  */
19196 # define CONFIG_RJ7_AS_DIG_OUTPUT() \
19197  do { \
19198  DISABLE_RJ7_ANALOG(); \
19199  CONFIG_RJ7_AS_OUTPUT(); \
19200  DISABLE_RJ7_OPENDRAIN(); \
19201  DISABLE_RJ7_PULLUP(); \
19202  DISABLE_RJ7_PULLDOWN(); \
19203  } while (0)
19204 
19205 #endif // #if defined(_RJ7) || defined(__DOXYGEN__): Provide GPIO for RJ7
19206 
19207 
19208 
19209 
19210 
19211 // Provide GPIO for RJ8
19212 // ====================
19213 #if defined(_RJ8) || defined(__DOXYGEN__)
19214 
19215 // Dummy macros for documentation only
19216 # ifdef __DOXYGEN__
19217 /// This macro specifies the RPy value associated with pin RJ8.
19218 /// Its device-specific definition is given in pic24_ports_mapping.h.
19219 # define RJ8_RP xx
19220 
19221 /// This macro specifies the ANn value associated with pin RJ8.
19222 /// Its device-specific definition is given in pic24_ports_mapping.h.
19223 # define RJ8_AN xx
19224 
19225 /// This macro specifies the CNm value associated with pin RJ8.
19226 /// Its device-specific definition is given in pic24_ports_mapping.h.
19227 # define RJ8_CN xx
19228 
19229 //@}
19230 # endif // #ifdef __DOXYGEN__
19231 
19232 
19233 // Low-level config
19234 // ----------------
19235 // Analog:
19236 # if defined(_ANSJ8) || defined(__DOXYGEN__)
19237 /// Enable analog functionality on pin RJ8.
19238 # define ENABLE_RJ8_ANALOG() (_ANSJ8 = 1)
19239 /// Disable analog functionality on pin RJ8.
19240 # define DISABLE_RJ8_ANALOG() (_ANSJ8 = 0)
19241 # elif defined(RJ8_AN)
19242 # define ENABLE_RJ8_ANALOG() (RXY_GPIO_PCFG(RJ8_AN) = 0)
19243 # define DISABLE_RJ8_ANALOG() (RXY_GPIO_PCFG(RJ8_AN) = 1)
19244 # else
19245 # define DISABLE_RJ8_ANALOG() ((void) 0)
19246 # endif
19247 
19248 // Input/output:
19249 /// Configure pin RJ8 as an input.
19250 # define CONFIG_RJ8_AS_INPUT() (_TRISJ8 = 1)
19251 /// Configure pin RJ8 as an output.
19252 # define CONFIG_RJ8_AS_OUTPUT() (_TRISJ8 = 0)
19253 
19254 // Open-drain:
19255 # if defined(_ODCJ8) || defined(__DOXYGEN__)
19256 /// Enable the open-drain driver on pin RJ8.
19257 # define ENABLE_RJ8_OPENDRAIN() (_ODCJ8 = 1)
19258 /// Disable the open-drain driver on pin RJ8.
19259 # define DISABLE_RJ8_OPENDRAIN() (_ODCJ8 = 0)
19260 # elif defined(_ODJ8) // The PIF24F names this bit _OD instead of _ODC.
19261 # define ENABLE_RJ8_OPENDRAIN() (_ODJ8 = 1)
19262 # define DISABLE_RJ8_OPENDRAIN() (_ODJ8 = 0)
19263 # else
19264 # define DISABLE_RJ8_OPENDRAIN() ((void) 0)
19265 # endif
19266 
19267 // Change notification, pullups and pulldowns:
19268 # if defined(_CNIEJ8) || defined(__DOXYGEN__)
19269 /// Enable the pullup on pin RJ8.
19270 # define ENABLE_RJ8_PULLUP() (_CNPUJ8 = 1)
19271 /// Disable the pullup on pin RJ8.
19272 # define DISABLE_RJ8_PULLUP() (_CNPUJ8 = 0)
19273 
19274 /// Enable the pulldown on pin RJ8.
19275 # define ENABLE_RJ8_PULLDOWN() (_CNPDJ8 = 1)
19276 /// Disable the pulldown on pin RJ8.
19277 # define DISABLE_RJ8_PULLDOWN() (_CNPDJ8 = 0)
19278 
19279 /// Enable the change notification interrupt on pin RJ8.
19280 # define ENABLE_RJ8_CN_INTERRUPT() (_CNIEJ8 = 1)
19281 /// Disable the change notification interrupt on pin RJ8.
19282 # define DISABLE_RJ8_CN_INTERRUPT() (_CNIEJ8 = 0)
19283 
19284 # elif defined(RJ8_CN)
19285 # define ENABLE_RJ8_PULLUP() (RXY_GPIO_CNPUE(RJ8_CN) = 1)
19286 # define DISABLE_RJ8_PULLUP() (RXY_GPIO_CNPUE(RJ8_CN) = 0)
19287 
19288 # if RXY_HAS_CNPDE(RJ8_CN)
19289 # define ENABLE_RJ8_PULLDOWN() (RXY_GPIO_CNPDE(RJ8_CN) = 1)
19290 # define DISABLE_RJ8_PULLDOWN() (RXY_GPIO_CNPDE(RJ8_CN) = 0)
19291 # else
19292 # define DISABLE_RJ8_PULLDOWN() ((void) 0)
19293 # endif
19294 
19295 # define ENABLE_RJ8_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ8_CN) = 1)
19296 # define DISABLE_RJ8_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ8_CN) = 0)
19297 
19298 # else
19299 # define DISABLE_RJ8_PULLUP() ((void) 0)
19300 # define DISABLE_RJ8_PULLDOWN() ((void) 0)
19301 # define DISABLE_RJ8_CN_INTERRUPT() ((void) 0)
19302 # endif
19303 
19304 // High-level config
19305 // -----------------
19306 /** This macro disables pullups/downs, enables analog functionality, and configures
19307  * pin RJ8 as an input.
19308  */
19309 # if defined(_ANSJ8) || defined(RJ8_AN) || defined(__DOXYGEN__)
19310 # define CONFIG_RJ8_AS_ANALOG() \
19311  do { \
19312  ENABLE_RJ8_ANALOG(); \
19313  CONFIG_RJ8_AS_INPUT(); \
19314  DISABLE_RJ8_OPENDRAIN(); \
19315  DISABLE_RJ8_PULLUP(); \
19316  DISABLE_RJ8_PULLDOWN(); \
19317  } while (0)
19318 # endif
19319 
19320 /** This macro disables open-drain and pullups/downs,
19321  * configures pin RJ8 for digital (not analog) operation, and
19322  * configures the pin as an input.
19323  */
19324 # define CONFIG_RJ8_AS_DIG_INPUT() \
19325  do { \
19326  DISABLE_RJ8_ANALOG(); \
19327  CONFIG_RJ8_AS_INPUT(); \
19328  DISABLE_RJ8_OPENDRAIN(); \
19329  DISABLE_RJ8_PULLUP(); \
19330  DISABLE_RJ8_PULLDOWN(); \
19331  } while (0)
19332 
19333 /** This macro disables open-drain and pullups/downs,
19334  * configures pin RJ8 for digital (not analog) operation, and
19335  * configures the pin as an output.
19336  */
19337 # define CONFIG_RJ8_AS_DIG_OUTPUT() \
19338  do { \
19339  DISABLE_RJ8_ANALOG(); \
19340  CONFIG_RJ8_AS_OUTPUT(); \
19341  DISABLE_RJ8_OPENDRAIN(); \
19342  DISABLE_RJ8_PULLUP(); \
19343  DISABLE_RJ8_PULLDOWN(); \
19344  } while (0)
19345 
19346 #endif // #if defined(_RJ8) || defined(__DOXYGEN__): Provide GPIO for RJ8
19347 
19348 
19349 
19350 
19351 
19352 // Provide GPIO for RJ9
19353 // ====================
19354 #if defined(_RJ9) || defined(__DOXYGEN__)
19355 
19356 // Dummy macros for documentation only
19357 # ifdef __DOXYGEN__
19358 /// This macro specifies the RPy value associated with pin RJ9.
19359 /// Its device-specific definition is given in pic24_ports_mapping.h.
19360 # define RJ9_RP xx
19361 
19362 /// This macro specifies the ANn value associated with pin RJ9.
19363 /// Its device-specific definition is given in pic24_ports_mapping.h.
19364 # define RJ9_AN xx
19365 
19366 /// This macro specifies the CNm value associated with pin RJ9.
19367 /// Its device-specific definition is given in pic24_ports_mapping.h.
19368 # define RJ9_CN xx
19369 
19370 //@}
19371 # endif // #ifdef __DOXYGEN__
19372 
19373 
19374 // Low-level config
19375 // ----------------
19376 // Analog:
19377 # if defined(_ANSJ9) || defined(__DOXYGEN__)
19378 /// Enable analog functionality on pin RJ9.
19379 # define ENABLE_RJ9_ANALOG() (_ANSJ9 = 1)
19380 /// Disable analog functionality on pin RJ9.
19381 # define DISABLE_RJ9_ANALOG() (_ANSJ9 = 0)
19382 # elif defined(RJ9_AN)
19383 # define ENABLE_RJ9_ANALOG() (RXY_GPIO_PCFG(RJ9_AN) = 0)
19384 # define DISABLE_RJ9_ANALOG() (RXY_GPIO_PCFG(RJ9_AN) = 1)
19385 # else
19386 # define DISABLE_RJ9_ANALOG() ((void) 0)
19387 # endif
19388 
19389 // Input/output:
19390 /// Configure pin RJ9 as an input.
19391 # define CONFIG_RJ9_AS_INPUT() (_TRISJ9 = 1)
19392 /// Configure pin RJ9 as an output.
19393 # define CONFIG_RJ9_AS_OUTPUT() (_TRISJ9 = 0)
19394 
19395 // Open-drain:
19396 # if defined(_ODCJ9) || defined(__DOXYGEN__)
19397 /// Enable the open-drain driver on pin RJ9.
19398 # define ENABLE_RJ9_OPENDRAIN() (_ODCJ9 = 1)
19399 /// Disable the open-drain driver on pin RJ9.
19400 # define DISABLE_RJ9_OPENDRAIN() (_ODCJ9 = 0)
19401 # elif defined(_ODJ9) // The PIF24F names this bit _OD instead of _ODC.
19402 # define ENABLE_RJ9_OPENDRAIN() (_ODJ9 = 1)
19403 # define DISABLE_RJ9_OPENDRAIN() (_ODJ9 = 0)
19404 # else
19405 # define DISABLE_RJ9_OPENDRAIN() ((void) 0)
19406 # endif
19407 
19408 // Change notification, pullups and pulldowns:
19409 # if defined(_CNIEJ9) || defined(__DOXYGEN__)
19410 /// Enable the pullup on pin RJ9.
19411 # define ENABLE_RJ9_PULLUP() (_CNPUJ9 = 1)
19412 /// Disable the pullup on pin RJ9.
19413 # define DISABLE_RJ9_PULLUP() (_CNPUJ9 = 0)
19414 
19415 /// Enable the pulldown on pin RJ9.
19416 # define ENABLE_RJ9_PULLDOWN() (_CNPDJ9 = 1)
19417 /// Disable the pulldown on pin RJ9.
19418 # define DISABLE_RJ9_PULLDOWN() (_CNPDJ9 = 0)
19419 
19420 /// Enable the change notification interrupt on pin RJ9.
19421 # define ENABLE_RJ9_CN_INTERRUPT() (_CNIEJ9 = 1)
19422 /// Disable the change notification interrupt on pin RJ9.
19423 # define DISABLE_RJ9_CN_INTERRUPT() (_CNIEJ9 = 0)
19424 
19425 # elif defined(RJ9_CN)
19426 # define ENABLE_RJ9_PULLUP() (RXY_GPIO_CNPUE(RJ9_CN) = 1)
19427 # define DISABLE_RJ9_PULLUP() (RXY_GPIO_CNPUE(RJ9_CN) = 0)
19428 
19429 # if RXY_HAS_CNPDE(RJ9_CN)
19430 # define ENABLE_RJ9_PULLDOWN() (RXY_GPIO_CNPDE(RJ9_CN) = 1)
19431 # define DISABLE_RJ9_PULLDOWN() (RXY_GPIO_CNPDE(RJ9_CN) = 0)
19432 # else
19433 # define DISABLE_RJ9_PULLDOWN() ((void) 0)
19434 # endif
19435 
19436 # define ENABLE_RJ9_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ9_CN) = 1)
19437 # define DISABLE_RJ9_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ9_CN) = 0)
19438 
19439 # else
19440 # define DISABLE_RJ9_PULLUP() ((void) 0)
19441 # define DISABLE_RJ9_PULLDOWN() ((void) 0)
19442 # define DISABLE_RJ9_CN_INTERRUPT() ((void) 0)
19443 # endif
19444 
19445 // High-level config
19446 // -----------------
19447 /** This macro disables pullups/downs, enables analog functionality, and configures
19448  * pin RJ9 as an input.
19449  */
19450 # if defined(_ANSJ9) || defined(RJ9_AN) || defined(__DOXYGEN__)
19451 # define CONFIG_RJ9_AS_ANALOG() \
19452  do { \
19453  ENABLE_RJ9_ANALOG(); \
19454  CONFIG_RJ9_AS_INPUT(); \
19455  DISABLE_RJ9_OPENDRAIN(); \
19456  DISABLE_RJ9_PULLUP(); \
19457  DISABLE_RJ9_PULLDOWN(); \
19458  } while (0)
19459 # endif
19460 
19461 /** This macro disables open-drain and pullups/downs,
19462  * configures pin RJ9 for digital (not analog) operation, and
19463  * configures the pin as an input.
19464  */
19465 # define CONFIG_RJ9_AS_DIG_INPUT() \
19466  do { \
19467  DISABLE_RJ9_ANALOG(); \
19468  CONFIG_RJ9_AS_INPUT(); \
19469  DISABLE_RJ9_OPENDRAIN(); \
19470  DISABLE_RJ9_PULLUP(); \
19471  DISABLE_RJ9_PULLDOWN(); \
19472  } while (0)
19473 
19474 /** This macro disables open-drain and pullups/downs,
19475  * configures pin RJ9 for digital (not analog) operation, and
19476  * configures the pin as an output.
19477  */
19478 # define CONFIG_RJ9_AS_DIG_OUTPUT() \
19479  do { \
19480  DISABLE_RJ9_ANALOG(); \
19481  CONFIG_RJ9_AS_OUTPUT(); \
19482  DISABLE_RJ9_OPENDRAIN(); \
19483  DISABLE_RJ9_PULLUP(); \
19484  DISABLE_RJ9_PULLDOWN(); \
19485  } while (0)
19486 
19487 #endif // #if defined(_RJ9) || defined(__DOXYGEN__): Provide GPIO for RJ9
19488 
19489 
19490 
19491 
19492 
19493 // Provide GPIO for RJ10
19494 // ====================
19495 #if defined(_RJ10) || defined(__DOXYGEN__)
19496 
19497 // Dummy macros for documentation only
19498 # ifdef __DOXYGEN__
19499 /// This macro specifies the RPy value associated with pin RJ10.
19500 /// Its device-specific definition is given in pic24_ports_mapping.h.
19501 # define RJ10_RP xx
19502 
19503 /// This macro specifies the ANn value associated with pin RJ10.
19504 /// Its device-specific definition is given in pic24_ports_mapping.h.
19505 # define RJ10_AN xx
19506 
19507 /// This macro specifies the CNm value associated with pin RJ10.
19508 /// Its device-specific definition is given in pic24_ports_mapping.h.
19509 # define RJ10_CN xx
19510 
19511 //@}
19512 # endif // #ifdef __DOXYGEN__
19513 
19514 
19515 // Low-level config
19516 // ----------------
19517 // Analog:
19518 # if defined(_ANSJ10) || defined(__DOXYGEN__)
19519 /// Enable analog functionality on pin RJ10.
19520 # define ENABLE_RJ10_ANALOG() (_ANSJ10 = 1)
19521 /// Disable analog functionality on pin RJ10.
19522 # define DISABLE_RJ10_ANALOG() (_ANSJ10 = 0)
19523 # elif defined(RJ10_AN)
19524 # define ENABLE_RJ10_ANALOG() (RXY_GPIO_PCFG(RJ10_AN) = 0)
19525 # define DISABLE_RJ10_ANALOG() (RXY_GPIO_PCFG(RJ10_AN) = 1)
19526 # else
19527 # define DISABLE_RJ10_ANALOG() ((void) 0)
19528 # endif
19529 
19530 // Input/output:
19531 /// Configure pin RJ10 as an input.
19532 # define CONFIG_RJ10_AS_INPUT() (_TRISJ10 = 1)
19533 /// Configure pin RJ10 as an output.
19534 # define CONFIG_RJ10_AS_OUTPUT() (_TRISJ10 = 0)
19535 
19536 // Open-drain:
19537 # if defined(_ODCJ10) || defined(__DOXYGEN__)
19538 /// Enable the open-drain driver on pin RJ10.
19539 # define ENABLE_RJ10_OPENDRAIN() (_ODCJ10 = 1)
19540 /// Disable the open-drain driver on pin RJ10.
19541 # define DISABLE_RJ10_OPENDRAIN() (_ODCJ10 = 0)
19542 # elif defined(_ODJ10) // The PIF24F names this bit _OD instead of _ODC.
19543 # define ENABLE_RJ10_OPENDRAIN() (_ODJ10 = 1)
19544 # define DISABLE_RJ10_OPENDRAIN() (_ODJ10 = 0)
19545 # else
19546 # define DISABLE_RJ10_OPENDRAIN() ((void) 0)
19547 # endif
19548 
19549 // Change notification, pullups and pulldowns:
19550 # if defined(_CNIEJ10) || defined(__DOXYGEN__)
19551 /// Enable the pullup on pin RJ10.
19552 # define ENABLE_RJ10_PULLUP() (_CNPUJ10 = 1)
19553 /// Disable the pullup on pin RJ10.
19554 # define DISABLE_RJ10_PULLUP() (_CNPUJ10 = 0)
19555 
19556 /// Enable the pulldown on pin RJ10.
19557 # define ENABLE_RJ10_PULLDOWN() (_CNPDJ10 = 1)
19558 /// Disable the pulldown on pin RJ10.
19559 # define DISABLE_RJ10_PULLDOWN() (_CNPDJ10 = 0)
19560 
19561 /// Enable the change notification interrupt on pin RJ10.
19562 # define ENABLE_RJ10_CN_INTERRUPT() (_CNIEJ10 = 1)
19563 /// Disable the change notification interrupt on pin RJ10.
19564 # define DISABLE_RJ10_CN_INTERRUPT() (_CNIEJ10 = 0)
19565 
19566 # elif defined(RJ10_CN)
19567 # define ENABLE_RJ10_PULLUP() (RXY_GPIO_CNPUE(RJ10_CN) = 1)
19568 # define DISABLE_RJ10_PULLUP() (RXY_GPIO_CNPUE(RJ10_CN) = 0)
19569 
19570 # if RXY_HAS_CNPDE(RJ10_CN)
19571 # define ENABLE_RJ10_PULLDOWN() (RXY_GPIO_CNPDE(RJ10_CN) = 1)
19572 # define DISABLE_RJ10_PULLDOWN() (RXY_GPIO_CNPDE(RJ10_CN) = 0)
19573 # else
19574 # define DISABLE_RJ10_PULLDOWN() ((void) 0)
19575 # endif
19576 
19577 # define ENABLE_RJ10_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ10_CN) = 1)
19578 # define DISABLE_RJ10_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ10_CN) = 0)
19579 
19580 # else
19581 # define DISABLE_RJ10_PULLUP() ((void) 0)
19582 # define DISABLE_RJ10_PULLDOWN() ((void) 0)
19583 # define DISABLE_RJ10_CN_INTERRUPT() ((void) 0)
19584 # endif
19585 
19586 // High-level config
19587 // -----------------
19588 /** This macro disables pullups/downs, enables analog functionality, and configures
19589  * pin RJ10 as an input.
19590  */
19591 # if defined(_ANSJ10) || defined(RJ10_AN) || defined(__DOXYGEN__)
19592 # define CONFIG_RJ10_AS_ANALOG() \
19593  do { \
19594  ENABLE_RJ10_ANALOG(); \
19595  CONFIG_RJ10_AS_INPUT(); \
19596  DISABLE_RJ10_OPENDRAIN(); \
19597  DISABLE_RJ10_PULLUP(); \
19598  DISABLE_RJ10_PULLDOWN(); \
19599  } while (0)
19600 # endif
19601 
19602 /** This macro disables open-drain and pullups/downs,
19603  * configures pin RJ10 for digital (not analog) operation, and
19604  * configures the pin as an input.
19605  */
19606 # define CONFIG_RJ10_AS_DIG_INPUT() \
19607  do { \
19608  DISABLE_RJ10_ANALOG(); \
19609  CONFIG_RJ10_AS_INPUT(); \
19610  DISABLE_RJ10_OPENDRAIN(); \
19611  DISABLE_RJ10_PULLUP(); \
19612  DISABLE_RJ10_PULLDOWN(); \
19613  } while (0)
19614 
19615 /** This macro disables open-drain and pullups/downs,
19616  * configures pin RJ10 for digital (not analog) operation, and
19617  * configures the pin as an output.
19618  */
19619 # define CONFIG_RJ10_AS_DIG_OUTPUT() \
19620  do { \
19621  DISABLE_RJ10_ANALOG(); \
19622  CONFIG_RJ10_AS_OUTPUT(); \
19623  DISABLE_RJ10_OPENDRAIN(); \
19624  DISABLE_RJ10_PULLUP(); \
19625  DISABLE_RJ10_PULLDOWN(); \
19626  } while (0)
19627 
19628 #endif // #if defined(_RJ10) || defined(__DOXYGEN__): Provide GPIO for RJ10
19629 
19630 
19631 
19632 
19633 
19634 // Provide GPIO for RJ11
19635 // ====================
19636 #if defined(_RJ11) || defined(__DOXYGEN__)
19637 
19638 // Dummy macros for documentation only
19639 # ifdef __DOXYGEN__
19640 /// This macro specifies the RPy value associated with pin RJ11.
19641 /// Its device-specific definition is given in pic24_ports_mapping.h.
19642 # define RJ11_RP xx
19643 
19644 /// This macro specifies the ANn value associated with pin RJ11.
19645 /// Its device-specific definition is given in pic24_ports_mapping.h.
19646 # define RJ11_AN xx
19647 
19648 /// This macro specifies the CNm value associated with pin RJ11.
19649 /// Its device-specific definition is given in pic24_ports_mapping.h.
19650 # define RJ11_CN xx
19651 
19652 //@}
19653 # endif // #ifdef __DOXYGEN__
19654 
19655 
19656 // Low-level config
19657 // ----------------
19658 // Analog:
19659 # if defined(_ANSJ11) || defined(__DOXYGEN__)
19660 /// Enable analog functionality on pin RJ11.
19661 # define ENABLE_RJ11_ANALOG() (_ANSJ11 = 1)
19662 /// Disable analog functionality on pin RJ11.
19663 # define DISABLE_RJ11_ANALOG() (_ANSJ11 = 0)
19664 # elif defined(RJ11_AN)
19665 # define ENABLE_RJ11_ANALOG() (RXY_GPIO_PCFG(RJ11_AN) = 0)
19666 # define DISABLE_RJ11_ANALOG() (RXY_GPIO_PCFG(RJ11_AN) = 1)
19667 # else
19668 # define DISABLE_RJ11_ANALOG() ((void) 0)
19669 # endif
19670 
19671 // Input/output:
19672 /// Configure pin RJ11 as an input.
19673 # define CONFIG_RJ11_AS_INPUT() (_TRISJ11 = 1)
19674 /// Configure pin RJ11 as an output.
19675 # define CONFIG_RJ11_AS_OUTPUT() (_TRISJ11 = 0)
19676 
19677 // Open-drain:
19678 # if defined(_ODCJ11) || defined(__DOXYGEN__)
19679 /// Enable the open-drain driver on pin RJ11.
19680 # define ENABLE_RJ11_OPENDRAIN() (_ODCJ11 = 1)
19681 /// Disable the open-drain driver on pin RJ11.
19682 # define DISABLE_RJ11_OPENDRAIN() (_ODCJ11 = 0)
19683 # elif defined(_ODJ11) // The PIF24F names this bit _OD instead of _ODC.
19684 # define ENABLE_RJ11_OPENDRAIN() (_ODJ11 = 1)
19685 # define DISABLE_RJ11_OPENDRAIN() (_ODJ11 = 0)
19686 # else
19687 # define DISABLE_RJ11_OPENDRAIN() ((void) 0)
19688 # endif
19689 
19690 // Change notification, pullups and pulldowns:
19691 # if defined(_CNIEJ11) || defined(__DOXYGEN__)
19692 /// Enable the pullup on pin RJ11.
19693 # define ENABLE_RJ11_PULLUP() (_CNPUJ11 = 1)
19694 /// Disable the pullup on pin RJ11.
19695 # define DISABLE_RJ11_PULLUP() (_CNPUJ11 = 0)
19696 
19697 /// Enable the pulldown on pin RJ11.
19698 # define ENABLE_RJ11_PULLDOWN() (_CNPDJ11 = 1)
19699 /// Disable the pulldown on pin RJ11.
19700 # define DISABLE_RJ11_PULLDOWN() (_CNPDJ11 = 0)
19701 
19702 /// Enable the change notification interrupt on pin RJ11.
19703 # define ENABLE_RJ11_CN_INTERRUPT() (_CNIEJ11 = 1)
19704 /// Disable the change notification interrupt on pin RJ11.
19705 # define DISABLE_RJ11_CN_INTERRUPT() (_CNIEJ11 = 0)
19706 
19707 # elif defined(RJ11_CN)
19708 # define ENABLE_RJ11_PULLUP() (RXY_GPIO_CNPUE(RJ11_CN) = 1)
19709 # define DISABLE_RJ11_PULLUP() (RXY_GPIO_CNPUE(RJ11_CN) = 0)
19710 
19711 # if RXY_HAS_CNPDE(RJ11_CN)
19712 # define ENABLE_RJ11_PULLDOWN() (RXY_GPIO_CNPDE(RJ11_CN) = 1)
19713 # define DISABLE_RJ11_PULLDOWN() (RXY_GPIO_CNPDE(RJ11_CN) = 0)
19714 # else
19715 # define DISABLE_RJ11_PULLDOWN() ((void) 0)
19716 # endif
19717 
19718 # define ENABLE_RJ11_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ11_CN) = 1)
19719 # define DISABLE_RJ11_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ11_CN) = 0)
19720 
19721 # else
19722 # define DISABLE_RJ11_PULLUP() ((void) 0)
19723 # define DISABLE_RJ11_PULLDOWN() ((void) 0)
19724 # define DISABLE_RJ11_CN_INTERRUPT() ((void) 0)
19725 # endif
19726 
19727 // High-level config
19728 // -----------------
19729 /** This macro disables pullups/downs, enables analog functionality, and configures
19730  * pin RJ11 as an input.
19731  */
19732 # if defined(_ANSJ11) || defined(RJ11_AN) || defined(__DOXYGEN__)
19733 # define CONFIG_RJ11_AS_ANALOG() \
19734  do { \
19735  ENABLE_RJ11_ANALOG(); \
19736  CONFIG_RJ11_AS_INPUT(); \
19737  DISABLE_RJ11_OPENDRAIN(); \
19738  DISABLE_RJ11_PULLUP(); \
19739  DISABLE_RJ11_PULLDOWN(); \
19740  } while (0)
19741 # endif
19742 
19743 /** This macro disables open-drain and pullups/downs,
19744  * configures pin RJ11 for digital (not analog) operation, and
19745  * configures the pin as an input.
19746  */
19747 # define CONFIG_RJ11_AS_DIG_INPUT() \
19748  do { \
19749  DISABLE_RJ11_ANALOG(); \
19750  CONFIG_RJ11_AS_INPUT(); \
19751  DISABLE_RJ11_OPENDRAIN(); \
19752  DISABLE_RJ11_PULLUP(); \
19753  DISABLE_RJ11_PULLDOWN(); \
19754  } while (0)
19755 
19756 /** This macro disables open-drain and pullups/downs,
19757  * configures pin RJ11 for digital (not analog) operation, and
19758  * configures the pin as an output.
19759  */
19760 # define CONFIG_RJ11_AS_DIG_OUTPUT() \
19761  do { \
19762  DISABLE_RJ11_ANALOG(); \
19763  CONFIG_RJ11_AS_OUTPUT(); \
19764  DISABLE_RJ11_OPENDRAIN(); \
19765  DISABLE_RJ11_PULLUP(); \
19766  DISABLE_RJ11_PULLDOWN(); \
19767  } while (0)
19768 
19769 #endif // #if defined(_RJ11) || defined(__DOXYGEN__): Provide GPIO for RJ11
19770 
19771 
19772 
19773 
19774 
19775 // Provide GPIO for RJ12
19776 // ====================
19777 #if defined(_RJ12) || defined(__DOXYGEN__)
19778 
19779 // Dummy macros for documentation only
19780 # ifdef __DOXYGEN__
19781 /// This macro specifies the RPy value associated with pin RJ12.
19782 /// Its device-specific definition is given in pic24_ports_mapping.h.
19783 # define RJ12_RP xx
19784 
19785 /// This macro specifies the ANn value associated with pin RJ12.
19786 /// Its device-specific definition is given in pic24_ports_mapping.h.
19787 # define RJ12_AN xx
19788 
19789 /// This macro specifies the CNm value associated with pin RJ12.
19790 /// Its device-specific definition is given in pic24_ports_mapping.h.
19791 # define RJ12_CN xx
19792 
19793 //@}
19794 # endif // #ifdef __DOXYGEN__
19795 
19796 
19797 // Low-level config
19798 // ----------------
19799 // Analog:
19800 # if defined(_ANSJ12) || defined(__DOXYGEN__)
19801 /// Enable analog functionality on pin RJ12.
19802 # define ENABLE_RJ12_ANALOG() (_ANSJ12 = 1)
19803 /// Disable analog functionality on pin RJ12.
19804 # define DISABLE_RJ12_ANALOG() (_ANSJ12 = 0)
19805 # elif defined(RJ12_AN)
19806 # define ENABLE_RJ12_ANALOG() (RXY_GPIO_PCFG(RJ12_AN) = 0)
19807 # define DISABLE_RJ12_ANALOG() (RXY_GPIO_PCFG(RJ12_AN) = 1)
19808 # else
19809 # define DISABLE_RJ12_ANALOG() ((void) 0)
19810 # endif
19811 
19812 // Input/output:
19813 /// Configure pin RJ12 as an input.
19814 # define CONFIG_RJ12_AS_INPUT() (_TRISJ12 = 1)
19815 /// Configure pin RJ12 as an output.
19816 # define CONFIG_RJ12_AS_OUTPUT() (_TRISJ12 = 0)
19817 
19818 // Open-drain:
19819 # if defined(_ODCJ12) || defined(__DOXYGEN__)
19820 /// Enable the open-drain driver on pin RJ12.
19821 # define ENABLE_RJ12_OPENDRAIN() (_ODCJ12 = 1)
19822 /// Disable the open-drain driver on pin RJ12.
19823 # define DISABLE_RJ12_OPENDRAIN() (_ODCJ12 = 0)
19824 # elif defined(_ODJ12) // The PIF24F names this bit _OD instead of _ODC.
19825 # define ENABLE_RJ12_OPENDRAIN() (_ODJ12 = 1)
19826 # define DISABLE_RJ12_OPENDRAIN() (_ODJ12 = 0)
19827 # else
19828 # define DISABLE_RJ12_OPENDRAIN() ((void) 0)
19829 # endif
19830 
19831 // Change notification, pullups and pulldowns:
19832 # if defined(_CNIEJ12) || defined(__DOXYGEN__)
19833 /// Enable the pullup on pin RJ12.
19834 # define ENABLE_RJ12_PULLUP() (_CNPUJ12 = 1)
19835 /// Disable the pullup on pin RJ12.
19836 # define DISABLE_RJ12_PULLUP() (_CNPUJ12 = 0)
19837 
19838 /// Enable the pulldown on pin RJ12.
19839 # define ENABLE_RJ12_PULLDOWN() (_CNPDJ12 = 1)
19840 /// Disable the pulldown on pin RJ12.
19841 # define DISABLE_RJ12_PULLDOWN() (_CNPDJ12 = 0)
19842 
19843 /// Enable the change notification interrupt on pin RJ12.
19844 # define ENABLE_RJ12_CN_INTERRUPT() (_CNIEJ12 = 1)
19845 /// Disable the change notification interrupt on pin RJ12.
19846 # define DISABLE_RJ12_CN_INTERRUPT() (_CNIEJ12 = 0)
19847 
19848 # elif defined(RJ12_CN)
19849 # define ENABLE_RJ12_PULLUP() (RXY_GPIO_CNPUE(RJ12_CN) = 1)
19850 # define DISABLE_RJ12_PULLUP() (RXY_GPIO_CNPUE(RJ12_CN) = 0)
19851 
19852 # if RXY_HAS_CNPDE(RJ12_CN)
19853 # define ENABLE_RJ12_PULLDOWN() (RXY_GPIO_CNPDE(RJ12_CN) = 1)
19854 # define DISABLE_RJ12_PULLDOWN() (RXY_GPIO_CNPDE(RJ12_CN) = 0)
19855 # else
19856 # define DISABLE_RJ12_PULLDOWN() ((void) 0)
19857 # endif
19858 
19859 # define ENABLE_RJ12_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ12_CN) = 1)
19860 # define DISABLE_RJ12_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ12_CN) = 0)
19861 
19862 # else
19863 # define DISABLE_RJ12_PULLUP() ((void) 0)
19864 # define DISABLE_RJ12_PULLDOWN() ((void) 0)
19865 # define DISABLE_RJ12_CN_INTERRUPT() ((void) 0)
19866 # endif
19867 
19868 // High-level config
19869 // -----------------
19870 /** This macro disables pullups/downs, enables analog functionality, and configures
19871  * pin RJ12 as an input.
19872  */
19873 # if defined(_ANSJ12) || defined(RJ12_AN) || defined(__DOXYGEN__)
19874 # define CONFIG_RJ12_AS_ANALOG() \
19875  do { \
19876  ENABLE_RJ12_ANALOG(); \
19877  CONFIG_RJ12_AS_INPUT(); \
19878  DISABLE_RJ12_OPENDRAIN(); \
19879  DISABLE_RJ12_PULLUP(); \
19880  DISABLE_RJ12_PULLDOWN(); \
19881  } while (0)
19882 # endif
19883 
19884 /** This macro disables open-drain and pullups/downs,
19885  * configures pin RJ12 for digital (not analog) operation, and
19886  * configures the pin as an input.
19887  */
19888 # define CONFIG_RJ12_AS_DIG_INPUT() \
19889  do { \
19890  DISABLE_RJ12_ANALOG(); \
19891  CONFIG_RJ12_AS_INPUT(); \
19892  DISABLE_RJ12_OPENDRAIN(); \
19893  DISABLE_RJ12_PULLUP(); \
19894  DISABLE_RJ12_PULLDOWN(); \
19895  } while (0)
19896 
19897 /** This macro disables open-drain and pullups/downs,
19898  * configures pin RJ12 for digital (not analog) operation, and
19899  * configures the pin as an output.
19900  */
19901 # define CONFIG_RJ12_AS_DIG_OUTPUT() \
19902  do { \
19903  DISABLE_RJ12_ANALOG(); \
19904  CONFIG_RJ12_AS_OUTPUT(); \
19905  DISABLE_RJ12_OPENDRAIN(); \
19906  DISABLE_RJ12_PULLUP(); \
19907  DISABLE_RJ12_PULLDOWN(); \
19908  } while (0)
19909 
19910 #endif // #if defined(_RJ12) || defined(__DOXYGEN__): Provide GPIO for RJ12
19911 
19912 
19913 
19914 
19915 
19916 // Provide GPIO for RJ13
19917 // ====================
19918 #if defined(_RJ13) || defined(__DOXYGEN__)
19919 
19920 // Dummy macros for documentation only
19921 # ifdef __DOXYGEN__
19922 /// This macro specifies the RPy value associated with pin RJ13.
19923 /// Its device-specific definition is given in pic24_ports_mapping.h.
19924 # define RJ13_RP xx
19925 
19926 /// This macro specifies the ANn value associated with pin RJ13.
19927 /// Its device-specific definition is given in pic24_ports_mapping.h.
19928 # define RJ13_AN xx
19929 
19930 /// This macro specifies the CNm value associated with pin RJ13.
19931 /// Its device-specific definition is given in pic24_ports_mapping.h.
19932 # define RJ13_CN xx
19933 
19934 //@}
19935 # endif // #ifdef __DOXYGEN__
19936 
19937 
19938 // Low-level config
19939 // ----------------
19940 // Analog:
19941 # if defined(_ANSJ13) || defined(__DOXYGEN__)
19942 /// Enable analog functionality on pin RJ13.
19943 # define ENABLE_RJ13_ANALOG() (_ANSJ13 = 1)
19944 /// Disable analog functionality on pin RJ13.
19945 # define DISABLE_RJ13_ANALOG() (_ANSJ13 = 0)
19946 # elif defined(RJ13_AN)
19947 # define ENABLE_RJ13_ANALOG() (RXY_GPIO_PCFG(RJ13_AN) = 0)
19948 # define DISABLE_RJ13_ANALOG() (RXY_GPIO_PCFG(RJ13_AN) = 1)
19949 # else
19950 # define DISABLE_RJ13_ANALOG() ((void) 0)
19951 # endif
19952 
19953 // Input/output:
19954 /// Configure pin RJ13 as an input.
19955 # define CONFIG_RJ13_AS_INPUT() (_TRISJ13 = 1)
19956 /// Configure pin RJ13 as an output.
19957 # define CONFIG_RJ13_AS_OUTPUT() (_TRISJ13 = 0)
19958 
19959 // Open-drain:
19960 # if defined(_ODCJ13) || defined(__DOXYGEN__)
19961 /// Enable the open-drain driver on pin RJ13.
19962 # define ENABLE_RJ13_OPENDRAIN() (_ODCJ13 = 1)
19963 /// Disable the open-drain driver on pin RJ13.
19964 # define DISABLE_RJ13_OPENDRAIN() (_ODCJ13 = 0)
19965 # elif defined(_ODJ13) // The PIF24F names this bit _OD instead of _ODC.
19966 # define ENABLE_RJ13_OPENDRAIN() (_ODJ13 = 1)
19967 # define DISABLE_RJ13_OPENDRAIN() (_ODJ13 = 0)
19968 # else
19969 # define DISABLE_RJ13_OPENDRAIN() ((void) 0)
19970 # endif
19971 
19972 // Change notification, pullups and pulldowns:
19973 # if defined(_CNIEJ13) || defined(__DOXYGEN__)
19974 /// Enable the pullup on pin RJ13.
19975 # define ENABLE_RJ13_PULLUP() (_CNPUJ13 = 1)
19976 /// Disable the pullup on pin RJ13.
19977 # define DISABLE_RJ13_PULLUP() (_CNPUJ13 = 0)
19978 
19979 /// Enable the pulldown on pin RJ13.
19980 # define ENABLE_RJ13_PULLDOWN() (_CNPDJ13 = 1)
19981 /// Disable the pulldown on pin RJ13.
19982 # define DISABLE_RJ13_PULLDOWN() (_CNPDJ13 = 0)
19983 
19984 /// Enable the change notification interrupt on pin RJ13.
19985 # define ENABLE_RJ13_CN_INTERRUPT() (_CNIEJ13 = 1)
19986 /// Disable the change notification interrupt on pin RJ13.
19987 # define DISABLE_RJ13_CN_INTERRUPT() (_CNIEJ13 = 0)
19988 
19989 # elif defined(RJ13_CN)
19990 # define ENABLE_RJ13_PULLUP() (RXY_GPIO_CNPUE(RJ13_CN) = 1)
19991 # define DISABLE_RJ13_PULLUP() (RXY_GPIO_CNPUE(RJ13_CN) = 0)
19992 
19993 # if RXY_HAS_CNPDE(RJ13_CN)
19994 # define ENABLE_RJ13_PULLDOWN() (RXY_GPIO_CNPDE(RJ13_CN) = 1)
19995 # define DISABLE_RJ13_PULLDOWN() (RXY_GPIO_CNPDE(RJ13_CN) = 0)
19996 # else
19997 # define DISABLE_RJ13_PULLDOWN() ((void) 0)
19998 # endif
19999 
20000 # define ENABLE_RJ13_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ13_CN) = 1)
20001 # define DISABLE_RJ13_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ13_CN) = 0)
20002 
20003 # else
20004 # define DISABLE_RJ13_PULLUP() ((void) 0)
20005 # define DISABLE_RJ13_PULLDOWN() ((void) 0)
20006 # define DISABLE_RJ13_CN_INTERRUPT() ((void) 0)
20007 # endif
20008 
20009 // High-level config
20010 // -----------------
20011 /** This macro disables pullups/downs, enables analog functionality, and configures
20012  * pin RJ13 as an input.
20013  */
20014 # if defined(_ANSJ13) || defined(RJ13_AN) || defined(__DOXYGEN__)
20015 # define CONFIG_RJ13_AS_ANALOG() \
20016  do { \
20017  ENABLE_RJ13_ANALOG(); \
20018  CONFIG_RJ13_AS_INPUT(); \
20019  DISABLE_RJ13_OPENDRAIN(); \
20020  DISABLE_RJ13_PULLUP(); \
20021  DISABLE_RJ13_PULLDOWN(); \
20022  } while (0)
20023 # endif
20024 
20025 /** This macro disables open-drain and pullups/downs,
20026  * configures pin RJ13 for digital (not analog) operation, and
20027  * configures the pin as an input.
20028  */
20029 # define CONFIG_RJ13_AS_DIG_INPUT() \
20030  do { \
20031  DISABLE_RJ13_ANALOG(); \
20032  CONFIG_RJ13_AS_INPUT(); \
20033  DISABLE_RJ13_OPENDRAIN(); \
20034  DISABLE_RJ13_PULLUP(); \
20035  DISABLE_RJ13_PULLDOWN(); \
20036  } while (0)
20037 
20038 /** This macro disables open-drain and pullups/downs,
20039  * configures pin RJ13 for digital (not analog) operation, and
20040  * configures the pin as an output.
20041  */
20042 # define CONFIG_RJ13_AS_DIG_OUTPUT() \
20043  do { \
20044  DISABLE_RJ13_ANALOG(); \
20045  CONFIG_RJ13_AS_OUTPUT(); \
20046  DISABLE_RJ13_OPENDRAIN(); \
20047  DISABLE_RJ13_PULLUP(); \
20048  DISABLE_RJ13_PULLDOWN(); \
20049  } while (0)
20050 
20051 #endif // #if defined(_RJ13) || defined(__DOXYGEN__): Provide GPIO for RJ13
20052 
20053 
20054 
20055 
20056 
20057 // Provide GPIO for RJ14
20058 // ====================
20059 #if defined(_RJ14) || defined(__DOXYGEN__)
20060 
20061 // Dummy macros for documentation only
20062 # ifdef __DOXYGEN__
20063 /// This macro specifies the RPy value associated with pin RJ14.
20064 /// Its device-specific definition is given in pic24_ports_mapping.h.
20065 # define RJ14_RP xx
20066 
20067 /// This macro specifies the ANn value associated with pin RJ14.
20068 /// Its device-specific definition is given in pic24_ports_mapping.h.
20069 # define RJ14_AN xx
20070 
20071 /// This macro specifies the CNm value associated with pin RJ14.
20072 /// Its device-specific definition is given in pic24_ports_mapping.h.
20073 # define RJ14_CN xx
20074 
20075 //@}
20076 # endif // #ifdef __DOXYGEN__
20077 
20078 
20079 // Low-level config
20080 // ----------------
20081 // Analog:
20082 # if defined(_ANSJ14) || defined(__DOXYGEN__)
20083 /// Enable analog functionality on pin RJ14.
20084 # define ENABLE_RJ14_ANALOG() (_ANSJ14 = 1)
20085 /// Disable analog functionality on pin RJ14.
20086 # define DISABLE_RJ14_ANALOG() (_ANSJ14 = 0)
20087 # elif defined(RJ14_AN)
20088 # define ENABLE_RJ14_ANALOG() (RXY_GPIO_PCFG(RJ14_AN) = 0)
20089 # define DISABLE_RJ14_ANALOG() (RXY_GPIO_PCFG(RJ14_AN) = 1)
20090 # else
20091 # define DISABLE_RJ14_ANALOG() ((void) 0)
20092 # endif
20093 
20094 // Input/output:
20095 /// Configure pin RJ14 as an input.
20096 # define CONFIG_RJ14_AS_INPUT() (_TRISJ14 = 1)
20097 /// Configure pin RJ14 as an output.
20098 # define CONFIG_RJ14_AS_OUTPUT() (_TRISJ14 = 0)
20099 
20100 // Open-drain:
20101 # if defined(_ODCJ14) || defined(__DOXYGEN__)
20102 /// Enable the open-drain driver on pin RJ14.
20103 # define ENABLE_RJ14_OPENDRAIN() (_ODCJ14 = 1)
20104 /// Disable the open-drain driver on pin RJ14.
20105 # define DISABLE_RJ14_OPENDRAIN() (_ODCJ14 = 0)
20106 # elif defined(_ODJ14) // The PIF24F names this bit _OD instead of _ODC.
20107 # define ENABLE_RJ14_OPENDRAIN() (_ODJ14 = 1)
20108 # define DISABLE_RJ14_OPENDRAIN() (_ODJ14 = 0)
20109 # else
20110 # define DISABLE_RJ14_OPENDRAIN() ((void) 0)
20111 # endif
20112 
20113 // Change notification, pullups and pulldowns:
20114 # if defined(_CNIEJ14) || defined(__DOXYGEN__)
20115 /// Enable the pullup on pin RJ14.
20116 # define ENABLE_RJ14_PULLUP() (_CNPUJ14 = 1)
20117 /// Disable the pullup on pin RJ14.
20118 # define DISABLE_RJ14_PULLUP() (_CNPUJ14 = 0)
20119 
20120 /// Enable the pulldown on pin RJ14.
20121 # define ENABLE_RJ14_PULLDOWN() (_CNPDJ14 = 1)
20122 /// Disable the pulldown on pin RJ14.
20123 # define DISABLE_RJ14_PULLDOWN() (_CNPDJ14 = 0)
20124 
20125 /// Enable the change notification interrupt on pin RJ14.
20126 # define ENABLE_RJ14_CN_INTERRUPT() (_CNIEJ14 = 1)
20127 /// Disable the change notification interrupt on pin RJ14.
20128 # define DISABLE_RJ14_CN_INTERRUPT() (_CNIEJ14 = 0)
20129 
20130 # elif defined(RJ14_CN)
20131 # define ENABLE_RJ14_PULLUP() (RXY_GPIO_CNPUE(RJ14_CN) = 1)
20132 # define DISABLE_RJ14_PULLUP() (RXY_GPIO_CNPUE(RJ14_CN) = 0)
20133 
20134 # if RXY_HAS_CNPDE(RJ14_CN)
20135 # define ENABLE_RJ14_PULLDOWN() (RXY_GPIO_CNPDE(RJ14_CN) = 1)
20136 # define DISABLE_RJ14_PULLDOWN() (RXY_GPIO_CNPDE(RJ14_CN) = 0)
20137 # else
20138 # define DISABLE_RJ14_PULLDOWN() ((void) 0)
20139 # endif
20140 
20141 # define ENABLE_RJ14_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ14_CN) = 1)
20142 # define DISABLE_RJ14_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ14_CN) = 0)
20143 
20144 # else
20145 # define DISABLE_RJ14_PULLUP() ((void) 0)
20146 # define DISABLE_RJ14_PULLDOWN() ((void) 0)
20147 # define DISABLE_RJ14_CN_INTERRUPT() ((void) 0)
20148 # endif
20149 
20150 // High-level config
20151 // -----------------
20152 /** This macro disables pullups/downs, enables analog functionality, and configures
20153  * pin RJ14 as an input.
20154  */
20155 # if defined(_ANSJ14) || defined(RJ14_AN) || defined(__DOXYGEN__)
20156 # define CONFIG_RJ14_AS_ANALOG() \
20157  do { \
20158  ENABLE_RJ14_ANALOG(); \
20159  CONFIG_RJ14_AS_INPUT(); \
20160  DISABLE_RJ14_OPENDRAIN(); \
20161  DISABLE_RJ14_PULLUP(); \
20162  DISABLE_RJ14_PULLDOWN(); \
20163  } while (0)
20164 # endif
20165 
20166 /** This macro disables open-drain and pullups/downs,
20167  * configures pin RJ14 for digital (not analog) operation, and
20168  * configures the pin as an input.
20169  */
20170 # define CONFIG_RJ14_AS_DIG_INPUT() \
20171  do { \
20172  DISABLE_RJ14_ANALOG(); \
20173  CONFIG_RJ14_AS_INPUT(); \
20174  DISABLE_RJ14_OPENDRAIN(); \
20175  DISABLE_RJ14_PULLUP(); \
20176  DISABLE_RJ14_PULLDOWN(); \
20177  } while (0)
20178 
20179 /** This macro disables open-drain and pullups/downs,
20180  * configures pin RJ14 for digital (not analog) operation, and
20181  * configures the pin as an output.
20182  */
20183 # define CONFIG_RJ14_AS_DIG_OUTPUT() \
20184  do { \
20185  DISABLE_RJ14_ANALOG(); \
20186  CONFIG_RJ14_AS_OUTPUT(); \
20187  DISABLE_RJ14_OPENDRAIN(); \
20188  DISABLE_RJ14_PULLUP(); \
20189  DISABLE_RJ14_PULLDOWN(); \
20190  } while (0)
20191 
20192 #endif // #if defined(_RJ14) || defined(__DOXYGEN__): Provide GPIO for RJ14
20193 
20194 
20195 
20196 
20197 
20198 // Provide GPIO for RJ15
20199 // ====================
20200 #if defined(_RJ15) || defined(__DOXYGEN__)
20201 
20202 // Dummy macros for documentation only
20203 # ifdef __DOXYGEN__
20204 /// This macro specifies the RPy value associated with pin RJ15.
20205 /// Its device-specific definition is given in pic24_ports_mapping.h.
20206 # define RJ15_RP xx
20207 
20208 /// This macro specifies the ANn value associated with pin RJ15.
20209 /// Its device-specific definition is given in pic24_ports_mapping.h.
20210 # define RJ15_AN xx
20211 
20212 /// This macro specifies the CNm value associated with pin RJ15.
20213 /// Its device-specific definition is given in pic24_ports_mapping.h.
20214 # define RJ15_CN xx
20215 
20216 //@}
20217 # endif // #ifdef __DOXYGEN__
20218 
20219 
20220 // Low-level config
20221 // ----------------
20222 // Analog:
20223 # if defined(_ANSJ15) || defined(__DOXYGEN__)
20224 /// Enable analog functionality on pin RJ15.
20225 # define ENABLE_RJ15_ANALOG() (_ANSJ15 = 1)
20226 /// Disable analog functionality on pin RJ15.
20227 # define DISABLE_RJ15_ANALOG() (_ANSJ15 = 0)
20228 # elif defined(RJ15_AN)
20229 # define ENABLE_RJ15_ANALOG() (RXY_GPIO_PCFG(RJ15_AN) = 0)
20230 # define DISABLE_RJ15_ANALOG() (RXY_GPIO_PCFG(RJ15_AN) = 1)
20231 # else
20232 # define DISABLE_RJ15_ANALOG() ((void) 0)
20233 # endif
20234 
20235 // Input/output:
20236 /// Configure pin RJ15 as an input.
20237 # define CONFIG_RJ15_AS_INPUT() (_TRISJ15 = 1)
20238 /// Configure pin RJ15 as an output.
20239 # define CONFIG_RJ15_AS_OUTPUT() (_TRISJ15 = 0)
20240 
20241 // Open-drain:
20242 # if defined(_ODCJ15) || defined(__DOXYGEN__)
20243 /// Enable the open-drain driver on pin RJ15.
20244 # define ENABLE_RJ15_OPENDRAIN() (_ODCJ15 = 1)
20245 /// Disable the open-drain driver on pin RJ15.
20246 # define DISABLE_RJ15_OPENDRAIN() (_ODCJ15 = 0)
20247 # elif defined(_ODJ15) // The PIF24F names this bit _OD instead of _ODC.
20248 # define ENABLE_RJ15_OPENDRAIN() (_ODJ15 = 1)
20249 # define DISABLE_RJ15_OPENDRAIN() (_ODJ15 = 0)
20250 # else
20251 # define DISABLE_RJ15_OPENDRAIN() ((void) 0)
20252 # endif
20253 
20254 // Change notification, pullups and pulldowns:
20255 # if defined(_CNIEJ15) || defined(__DOXYGEN__)
20256 /// Enable the pullup on pin RJ15.
20257 # define ENABLE_RJ15_PULLUP() (_CNPUJ15 = 1)
20258 /// Disable the pullup on pin RJ15.
20259 # define DISABLE_RJ15_PULLUP() (_CNPUJ15 = 0)
20260 
20261 /// Enable the pulldown on pin RJ15.
20262 # define ENABLE_RJ15_PULLDOWN() (_CNPDJ15 = 1)
20263 /// Disable the pulldown on pin RJ15.
20264 # define DISABLE_RJ15_PULLDOWN() (_CNPDJ15 = 0)
20265 
20266 /// Enable the change notification interrupt on pin RJ15.
20267 # define ENABLE_RJ15_CN_INTERRUPT() (_CNIEJ15 = 1)
20268 /// Disable the change notification interrupt on pin RJ15.
20269 # define DISABLE_RJ15_CN_INTERRUPT() (_CNIEJ15 = 0)
20270 
20271 # elif defined(RJ15_CN)
20272 # define ENABLE_RJ15_PULLUP() (RXY_GPIO_CNPUE(RJ15_CN) = 1)
20273 # define DISABLE_RJ15_PULLUP() (RXY_GPIO_CNPUE(RJ15_CN) = 0)
20274 
20275 # if RXY_HAS_CNPDE(RJ15_CN)
20276 # define ENABLE_RJ15_PULLDOWN() (RXY_GPIO_CNPDE(RJ15_CN) = 1)
20277 # define DISABLE_RJ15_PULLDOWN() (RXY_GPIO_CNPDE(RJ15_CN) = 0)
20278 # else
20279 # define DISABLE_RJ15_PULLDOWN() ((void) 0)
20280 # endif
20281 
20282 # define ENABLE_RJ15_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ15_CN) = 1)
20283 # define DISABLE_RJ15_CN_INTERRUPT() (RXY_GPIO_CNIE(RJ15_CN) = 0)
20284 
20285 # else
20286 # define DISABLE_RJ15_PULLUP() ((void) 0)
20287 # define DISABLE_RJ15_PULLDOWN() ((void) 0)
20288 # define DISABLE_RJ15_CN_INTERRUPT() ((void) 0)
20289 # endif
20290 
20291 // High-level config
20292 // -----------------
20293 /** This macro disables pullups/downs, enables analog functionality, and configures
20294  * pin RJ15 as an input.
20295  */
20296 # if defined(_ANSJ15) || defined(RJ15_AN) || defined(__DOXYGEN__)
20297 # define CONFIG_RJ15_AS_ANALOG() \
20298  do { \
20299  ENABLE_RJ15_ANALOG(); \
20300  CONFIG_RJ15_AS_INPUT(); \
20301  DISABLE_RJ15_OPENDRAIN(); \
20302  DISABLE_RJ15_PULLUP(); \
20303  DISABLE_RJ15_PULLDOWN(); \
20304  } while (0)
20305 # endif
20306 
20307 /** This macro disables open-drain and pullups/downs,
20308  * configures pin RJ15 for digital (not analog) operation, and
20309  * configures the pin as an input.
20310  */
20311 # define CONFIG_RJ15_AS_DIG_INPUT() \
20312  do { \
20313  DISABLE_RJ15_ANALOG(); \
20314  CONFIG_RJ15_AS_INPUT(); \
20315  DISABLE_RJ15_OPENDRAIN(); \
20316  DISABLE_RJ15_PULLUP(); \
20317  DISABLE_RJ15_PULLDOWN(); \
20318  } while (0)
20319 
20320 /** This macro disables open-drain and pullups/downs,
20321  * configures pin RJ15 for digital (not analog) operation, and
20322  * configures the pin as an output.
20323  */
20324 # define CONFIG_RJ15_AS_DIG_OUTPUT() \
20325  do { \
20326  DISABLE_RJ15_ANALOG(); \
20327  CONFIG_RJ15_AS_OUTPUT(); \
20328  DISABLE_RJ15_OPENDRAIN(); \
20329  DISABLE_RJ15_PULLUP(); \
20330  DISABLE_RJ15_PULLDOWN(); \
20331  } while (0)
20332 
20333 #endif // #if defined(_RJ15) || defined(__DOXYGEN__): Provide GPIO for RJ15
20334 
20335 
20336 
20337 
20338 
20339 // Provide GPIO for RK0
20340 // ====================
20341 #if defined(_RK0) || defined(__DOXYGEN__)
20342 
20343 // Dummy macros for documentation only
20344 # ifdef __DOXYGEN__
20345 /// This macro specifies the RPy value associated with pin RK0.
20346 /// Its device-specific definition is given in pic24_ports_mapping.h.
20347 # define RK0_RP xx
20348 
20349 /// This macro specifies the ANn value associated with pin RK0.
20350 /// Its device-specific definition is given in pic24_ports_mapping.h.
20351 # define RK0_AN xx
20352 
20353 /// This macro specifies the CNm value associated with pin RK0.
20354 /// Its device-specific definition is given in pic24_ports_mapping.h.
20355 # define RK0_CN xx
20356 
20357 //@}
20358 # endif // #ifdef __DOXYGEN__
20359 
20360 
20361 // Low-level config
20362 // ----------------
20363 // Analog:
20364 # if defined(_ANSK0) || defined(__DOXYGEN__)
20365 /// Enable analog functionality on pin RK0.
20366 # define ENABLE_RK0_ANALOG() (_ANSK0 = 1)
20367 /// Disable analog functionality on pin RK0.
20368 # define DISABLE_RK0_ANALOG() (_ANSK0 = 0)
20369 # elif defined(RK0_AN)
20370 # define ENABLE_RK0_ANALOG() (RXY_GPIO_PCFG(RK0_AN) = 0)
20371 # define DISABLE_RK0_ANALOG() (RXY_GPIO_PCFG(RK0_AN) = 1)
20372 # else
20373 # define DISABLE_RK0_ANALOG() ((void) 0)
20374 # endif
20375 
20376 // Input/output:
20377 /// Configure pin RK0 as an input.
20378 # define CONFIG_RK0_AS_INPUT() (_TRISK0 = 1)
20379 /// Configure pin RK0 as an output.
20380 # define CONFIG_RK0_AS_OUTPUT() (_TRISK0 = 0)
20381 
20382 // Open-drain:
20383 # if defined(_ODCK0) || defined(__DOXYGEN__)
20384 /// Enable the open-drain driver on pin RK0.
20385 # define ENABLE_RK0_OPENDRAIN() (_ODCK0 = 1)
20386 /// Disable the open-drain driver on pin RK0.
20387 # define DISABLE_RK0_OPENDRAIN() (_ODCK0 = 0)
20388 # elif defined(_ODK0) // The PIF24F names this bit _OD instead of _ODC.
20389 # define ENABLE_RK0_OPENDRAIN() (_ODK0 = 1)
20390 # define DISABLE_RK0_OPENDRAIN() (_ODK0 = 0)
20391 # else
20392 # define DISABLE_RK0_OPENDRAIN() ((void) 0)
20393 # endif
20394 
20395 // Change notification, pullups and pulldowns:
20396 # if defined(_CNIEK0) || defined(__DOXYGEN__)
20397 /// Enable the pullup on pin RK0.
20398 # define ENABLE_RK0_PULLUP() (_CNPUK0 = 1)
20399 /// Disable the pullup on pin RK0.
20400 # define DISABLE_RK0_PULLUP() (_CNPUK0 = 0)
20401 
20402 /// Enable the pulldown on pin RK0.
20403 # define ENABLE_RK0_PULLDOWN() (_CNPDK0 = 1)
20404 /// Disable the pulldown on pin RK0.
20405 # define DISABLE_RK0_PULLDOWN() (_CNPDK0 = 0)
20406 
20407 /// Enable the change notification interrupt on pin RK0.
20408 # define ENABLE_RK0_CN_INTERRUPT() (_CNIEK0 = 1)
20409 /// Disable the change notification interrupt on pin RK0.
20410 # define DISABLE_RK0_CN_INTERRUPT() (_CNIEK0 = 0)
20411 
20412 # elif defined(RK0_CN)
20413 # define ENABLE_RK0_PULLUP() (RXY_GPIO_CNPUE(RK0_CN) = 1)
20414 # define DISABLE_RK0_PULLUP() (RXY_GPIO_CNPUE(RK0_CN) = 0)
20415 
20416 # if RXY_HAS_CNPDE(RK0_CN)
20417 # define ENABLE_RK0_PULLDOWN() (RXY_GPIO_CNPDE(RK0_CN) = 1)
20418 # define DISABLE_RK0_PULLDOWN() (RXY_GPIO_CNPDE(RK0_CN) = 0)
20419 # else
20420 # define DISABLE_RK0_PULLDOWN() ((void) 0)
20421 # endif
20422 
20423 # define ENABLE_RK0_CN_INTERRUPT() (RXY_GPIO_CNIE(RK0_CN) = 1)
20424 # define DISABLE_RK0_CN_INTERRUPT() (RXY_GPIO_CNIE(RK0_CN) = 0)
20425 
20426 # else
20427 # define DISABLE_RK0_PULLUP() ((void) 0)
20428 # define DISABLE_RK0_PULLDOWN() ((void) 0)
20429 # define DISABLE_RK0_CN_INTERRUPT() ((void) 0)
20430 # endif
20431 
20432 // High-level config
20433 // -----------------
20434 /** This macro disables pullups/downs, enables analog functionality, and configures
20435  * pin RK0 as an input.
20436  */
20437 # if defined(_ANSK0) || defined(RK0_AN) || defined(__DOXYGEN__)
20438 # define CONFIG_RK0_AS_ANALOG() \
20439  do { \
20440  ENABLE_RK0_ANALOG(); \
20441  CONFIG_RK0_AS_INPUT(); \
20442  DISABLE_RK0_OPENDRAIN(); \
20443  DISABLE_RK0_PULLUP(); \
20444  DISABLE_RK0_PULLDOWN(); \
20445  } while (0)
20446 # endif
20447 
20448 /** This macro disables open-drain and pullups/downs,
20449  * configures pin RK0 for digital (not analog) operation, and
20450  * configures the pin as an input.
20451  */
20452 # define CONFIG_RK0_AS_DIG_INPUT() \
20453  do { \
20454  DISABLE_RK0_ANALOG(); \
20455  CONFIG_RK0_AS_INPUT(); \
20456  DISABLE_RK0_OPENDRAIN(); \
20457  DISABLE_RK0_PULLUP(); \
20458  DISABLE_RK0_PULLDOWN(); \
20459  } while (0)
20460 
20461 /** This macro disables open-drain and pullups/downs,
20462  * configures pin RK0 for digital (not analog) operation, and
20463  * configures the pin as an output.
20464  */
20465 # define CONFIG_RK0_AS_DIG_OUTPUT() \
20466  do { \
20467  DISABLE_RK0_ANALOG(); \
20468  CONFIG_RK0_AS_OUTPUT(); \
20469  DISABLE_RK0_OPENDRAIN(); \
20470  DISABLE_RK0_PULLUP(); \
20471  DISABLE_RK0_PULLDOWN(); \
20472  } while (0)
20473 
20474 #endif // #if defined(_RK0) || defined(__DOXYGEN__): Provide GPIO for RK0
20475 
20476 
20477 
20478 
20479 
20480 // Provide GPIO for RK1
20481 // ====================
20482 #if defined(_RK1) || defined(__DOXYGEN__)
20483 
20484 // Dummy macros for documentation only
20485 # ifdef __DOXYGEN__
20486 /// This macro specifies the RPy value associated with pin RK1.
20487 /// Its device-specific definition is given in pic24_ports_mapping.h.
20488 # define RK1_RP xx
20489 
20490 /// This macro specifies the ANn value associated with pin RK1.
20491 /// Its device-specific definition is given in pic24_ports_mapping.h.
20492 # define RK1_AN xx
20493 
20494 /// This macro specifies the CNm value associated with pin RK1.
20495 /// Its device-specific definition is given in pic24_ports_mapping.h.
20496 # define RK1_CN xx
20497 
20498 //@}
20499 # endif // #ifdef __DOXYGEN__
20500 
20501 
20502 // Low-level config
20503 // ----------------
20504 // Analog:
20505 # if defined(_ANSK1) || defined(__DOXYGEN__)
20506 /// Enable analog functionality on pin RK1.
20507 # define ENABLE_RK1_ANALOG() (_ANSK1 = 1)
20508 /// Disable analog functionality on pin RK1.
20509 # define DISABLE_RK1_ANALOG() (_ANSK1 = 0)
20510 # elif defined(RK1_AN)
20511 # define ENABLE_RK1_ANALOG() (RXY_GPIO_PCFG(RK1_AN) = 0)
20512 # define DISABLE_RK1_ANALOG() (RXY_GPIO_PCFG(RK1_AN) = 1)
20513 # else
20514 # define DISABLE_RK1_ANALOG() ((void) 0)
20515 # endif
20516 
20517 // Input/output:
20518 /// Configure pin RK1 as an input.
20519 # define CONFIG_RK1_AS_INPUT() (_TRISK1 = 1)
20520 /// Configure pin RK1 as an output.
20521 # define CONFIG_RK1_AS_OUTPUT() (_TRISK1 = 0)
20522 
20523 // Open-drain:
20524 # if defined(_ODCK1) || defined(__DOXYGEN__)
20525 /// Enable the open-drain driver on pin RK1.
20526 # define ENABLE_RK1_OPENDRAIN() (_ODCK1 = 1)
20527 /// Disable the open-drain driver on pin RK1.
20528 # define DISABLE_RK1_OPENDRAIN() (_ODCK1 = 0)
20529 # elif defined(_ODK1) // The PIF24F names this bit _OD instead of _ODC.
20530 # define ENABLE_RK1_OPENDRAIN() (_ODK1 = 1)
20531 # define DISABLE_RK1_OPENDRAIN() (_ODK1 = 0)
20532 # else
20533 # define DISABLE_RK1_OPENDRAIN() ((void) 0)
20534 # endif
20535 
20536 // Change notification, pullups and pulldowns:
20537 # if defined(_CNIEK1) || defined(__DOXYGEN__)
20538 /// Enable the pullup on pin RK1.
20539 # define ENABLE_RK1_PULLUP() (_CNPUK1 = 1)
20540 /// Disable the pullup on pin RK1.
20541 # define DISABLE_RK1_PULLUP() (_CNPUK1 = 0)
20542 
20543 /// Enable the pulldown on pin RK1.
20544 # define ENABLE_RK1_PULLDOWN() (_CNPDK1 = 1)
20545 /// Disable the pulldown on pin RK1.
20546 # define DISABLE_RK1_PULLDOWN() (_CNPDK1 = 0)
20547 
20548 /// Enable the change notification interrupt on pin RK1.
20549 # define ENABLE_RK1_CN_INTERRUPT() (_CNIEK1 = 1)
20550 /// Disable the change notification interrupt on pin RK1.
20551 # define DISABLE_RK1_CN_INTERRUPT() (_CNIEK1 = 0)
20552 
20553 # elif defined(RK1_CN)
20554 # define ENABLE_RK1_PULLUP() (RXY_GPIO_CNPUE(RK1_CN) = 1)
20555 # define DISABLE_RK1_PULLUP() (RXY_GPIO_CNPUE(RK1_CN) = 0)
20556 
20557 # if RXY_HAS_CNPDE(RK1_CN)
20558 # define ENABLE_RK1_PULLDOWN() (RXY_GPIO_CNPDE(RK1_CN) = 1)
20559 # define DISABLE_RK1_PULLDOWN() (RXY_GPIO_CNPDE(RK1_CN) = 0)
20560 # else
20561 # define DISABLE_RK1_PULLDOWN() ((void) 0)
20562 # endif
20563 
20564 # define ENABLE_RK1_CN_INTERRUPT() (RXY_GPIO_CNIE(RK1_CN) = 1)
20565 # define DISABLE_RK1_CN_INTERRUPT() (RXY_GPIO_CNIE(RK1_CN) = 0)
20566 
20567 # else
20568 # define DISABLE_RK1_PULLUP() ((void) 0)
20569 # define DISABLE_RK1_PULLDOWN() ((void) 0)
20570 # define DISABLE_RK1_CN_INTERRUPT() ((void) 0)
20571 # endif
20572 
20573 // High-level config
20574 // -----------------
20575 /** This macro disables pullups/downs, enables analog functionality, and configures
20576  * pin RK1 as an input.
20577  */
20578 # if defined(_ANSK1) || defined(RK1_AN) || defined(__DOXYGEN__)
20579 # define CONFIG_RK1_AS_ANALOG() \
20580  do { \
20581  ENABLE_RK1_ANALOG(); \
20582  CONFIG_RK1_AS_INPUT(); \
20583  DISABLE_RK1_OPENDRAIN(); \
20584  DISABLE_RK1_PULLUP(); \
20585  DISABLE_RK1_PULLDOWN(); \
20586  } while (0)
20587 # endif
20588 
20589 /** This macro disables open-drain and pullups/downs,
20590  * configures pin RK1 for digital (not analog) operation, and
20591  * configures the pin as an input.
20592  */
20593 # define CONFIG_RK1_AS_DIG_INPUT() \
20594  do { \
20595  DISABLE_RK1_ANALOG(); \
20596  CONFIG_RK1_AS_INPUT(); \
20597  DISABLE_RK1_OPENDRAIN(); \
20598  DISABLE_RK1_PULLUP(); \
20599  DISABLE_RK1_PULLDOWN(); \
20600  } while (0)
20601 
20602 /** This macro disables open-drain and pullups/downs,
20603  * configures pin RK1 for digital (not analog) operation, and
20604  * configures the pin as an output.
20605  */
20606 # define CONFIG_RK1_AS_DIG_OUTPUT() \
20607  do { \
20608  DISABLE_RK1_ANALOG(); \
20609  CONFIG_RK1_AS_OUTPUT(); \
20610  DISABLE_RK1_OPENDRAIN(); \
20611  DISABLE_RK1_PULLUP(); \
20612  DISABLE_RK1_PULLDOWN(); \
20613  } while (0)
20614 
20615 #endif // #if defined(_RK1) || defined(__DOXYGEN__): Provide GPIO for RK1
20616 
20617 
20618 
20619 
20620 
20621 // Provide GPIO for RK2
20622 // ====================
20623 #if defined(_RK2) || defined(__DOXYGEN__)
20624 
20625 // Dummy macros for documentation only
20626 # ifdef __DOXYGEN__
20627 /// This macro specifies the RPy value associated with pin RK2.
20628 /// Its device-specific definition is given in pic24_ports_mapping.h.
20629 # define RK2_RP xx
20630 
20631 /// This macro specifies the ANn value associated with pin RK2.
20632 /// Its device-specific definition is given in pic24_ports_mapping.h.
20633 # define RK2_AN xx
20634 
20635 /// This macro specifies the CNm value associated with pin RK2.
20636 /// Its device-specific definition is given in pic24_ports_mapping.h.
20637 # define RK2_CN xx
20638 
20639 //@}
20640 # endif // #ifdef __DOXYGEN__
20641 
20642 
20643 // Low-level config
20644 // ----------------
20645 // Analog:
20646 # if defined(_ANSK2) || defined(__DOXYGEN__)
20647 /// Enable analog functionality on pin RK2.
20648 # define ENABLE_RK2_ANALOG() (_ANSK2 = 1)
20649 /// Disable analog functionality on pin RK2.
20650 # define DISABLE_RK2_ANALOG() (_ANSK2 = 0)
20651 # elif defined(RK2_AN)
20652 # define ENABLE_RK2_ANALOG() (RXY_GPIO_PCFG(RK2_AN) = 0)
20653 # define DISABLE_RK2_ANALOG() (RXY_GPIO_PCFG(RK2_AN) = 1)
20654 # else
20655 # define DISABLE_RK2_ANALOG() ((void) 0)
20656 # endif
20657 
20658 // Input/output:
20659 /// Configure pin RK2 as an input.
20660 # define CONFIG_RK2_AS_INPUT() (_TRISK2 = 1)
20661 /// Configure pin RK2 as an output.
20662 # define CONFIG_RK2_AS_OUTPUT() (_TRISK2 = 0)
20663 
20664 // Open-drain:
20665 # if defined(_ODCK2) || defined(__DOXYGEN__)
20666 /// Enable the open-drain driver on pin RK2.
20667 # define ENABLE_RK2_OPENDRAIN() (_ODCK2 = 1)
20668 /// Disable the open-drain driver on pin RK2.
20669 # define DISABLE_RK2_OPENDRAIN() (_ODCK2 = 0)
20670 # elif defined(_ODK2) // The PIF24F names this bit _OD instead of _ODC.
20671 # define ENABLE_RK2_OPENDRAIN() (_ODK2 = 1)
20672 # define DISABLE_RK2_OPENDRAIN() (_ODK2 = 0)
20673 # else
20674 # define DISABLE_RK2_OPENDRAIN() ((void) 0)
20675 # endif
20676 
20677 // Change notification, pullups and pulldowns:
20678 # if defined(_CNIEK2) || defined(__DOXYGEN__)
20679 /// Enable the pullup on pin RK2.
20680 # define ENABLE_RK2_PULLUP() (_CNPUK2 = 1)
20681 /// Disable the pullup on pin RK2.
20682 # define DISABLE_RK2_PULLUP() (_CNPUK2 = 0)
20683 
20684 /// Enable the pulldown on pin RK2.
20685 # define ENABLE_RK2_PULLDOWN() (_CNPDK2 = 1)
20686 /// Disable the pulldown on pin RK2.
20687 # define DISABLE_RK2_PULLDOWN() (_CNPDK2 = 0)
20688 
20689 /// Enable the change notification interrupt on pin RK2.
20690 # define ENABLE_RK2_CN_INTERRUPT() (_CNIEK2 = 1)
20691 /// Disable the change notification interrupt on pin RK2.
20692 # define DISABLE_RK2_CN_INTERRUPT() (_CNIEK2 = 0)
20693 
20694 # elif defined(RK2_CN)
20695 # define ENABLE_RK2_PULLUP() (RXY_GPIO_CNPUE(RK2_CN) = 1)
20696 # define DISABLE_RK2_PULLUP() (RXY_GPIO_CNPUE(RK2_CN) = 0)
20697 
20698 # if RXY_HAS_CNPDE(RK2_CN)
20699 # define ENABLE_RK2_PULLDOWN() (RXY_GPIO_CNPDE(RK2_CN) = 1)
20700 # define DISABLE_RK2_PULLDOWN() (RXY_GPIO_CNPDE(RK2_CN) = 0)
20701 # else
20702 # define DISABLE_RK2_PULLDOWN() ((void) 0)
20703 # endif
20704 
20705 # define ENABLE_RK2_CN_INTERRUPT() (RXY_GPIO_CNIE(RK2_CN) = 1)
20706 # define DISABLE_RK2_CN_INTERRUPT() (RXY_GPIO_CNIE(RK2_CN) = 0)
20707 
20708 # else
20709 # define DISABLE_RK2_PULLUP() ((void) 0)
20710 # define DISABLE_RK2_PULLDOWN() ((void) 0)
20711 # define DISABLE_RK2_CN_INTERRUPT() ((void) 0)
20712 # endif
20713 
20714 // High-level config
20715 // -----------------
20716 /** This macro disables pullups/downs, enables analog functionality, and configures
20717  * pin RK2 as an input.
20718  */
20719 # if defined(_ANSK2) || defined(RK2_AN) || defined(__DOXYGEN__)
20720 # define CONFIG_RK2_AS_ANALOG() \
20721  do { \
20722  ENABLE_RK2_ANALOG(); \
20723  CONFIG_RK2_AS_INPUT(); \
20724  DISABLE_RK2_OPENDRAIN(); \
20725  DISABLE_RK2_PULLUP(); \
20726  DISABLE_RK2_PULLDOWN(); \
20727  } while (0)
20728 # endif
20729 
20730 /** This macro disables open-drain and pullups/downs,
20731  * configures pin RK2 for digital (not analog) operation, and
20732  * configures the pin as an input.
20733  */
20734 # define CONFIG_RK2_AS_DIG_INPUT() \
20735  do { \
20736  DISABLE_RK2_ANALOG(); \
20737  CONFIG_RK2_AS_INPUT(); \
20738  DISABLE_RK2_OPENDRAIN(); \
20739  DISABLE_RK2_PULLUP(); \
20740  DISABLE_RK2_PULLDOWN(); \
20741  } while (0)
20742 
20743 /** This macro disables open-drain and pullups/downs,
20744  * configures pin RK2 for digital (not analog) operation, and
20745  * configures the pin as an output.
20746  */
20747 # define CONFIG_RK2_AS_DIG_OUTPUT() \
20748  do { \
20749  DISABLE_RK2_ANALOG(); \
20750  CONFIG_RK2_AS_OUTPUT(); \
20751  DISABLE_RK2_OPENDRAIN(); \
20752  DISABLE_RK2_PULLUP(); \
20753  DISABLE_RK2_PULLDOWN(); \
20754  } while (0)
20755 
20756 #endif // #if defined(_RK2) || defined(__DOXYGEN__): Provide GPIO for RK2
20757 
20758 
20759 
20760 
20761 
20762 // Provide GPIO for RK3
20763 // ====================
20764 #if defined(_RK3) || defined(__DOXYGEN__)
20765 
20766 // Dummy macros for documentation only
20767 # ifdef __DOXYGEN__
20768 /// This macro specifies the RPy value associated with pin RK3.
20769 /// Its device-specific definition is given in pic24_ports_mapping.h.
20770 # define RK3_RP xx
20771 
20772 /// This macro specifies the ANn value associated with pin RK3.
20773 /// Its device-specific definition is given in pic24_ports_mapping.h.
20774 # define RK3_AN xx
20775 
20776 /// This macro specifies the CNm value associated with pin RK3.
20777 /// Its device-specific definition is given in pic24_ports_mapping.h.
20778 # define RK3_CN xx
20779 
20780 //@}
20781 # endif // #ifdef __DOXYGEN__
20782 
20783 
20784 // Low-level config
20785 // ----------------
20786 // Analog:
20787 # if defined(_ANSK3) || defined(__DOXYGEN__)
20788 /// Enable analog functionality on pin RK3.
20789 # define ENABLE_RK3_ANALOG() (_ANSK3 = 1)
20790 /// Disable analog functionality on pin RK3.
20791 # define DISABLE_RK3_ANALOG() (_ANSK3 = 0)
20792 # elif defined(RK3_AN)
20793 # define ENABLE_RK3_ANALOG() (RXY_GPIO_PCFG(RK3_AN) = 0)
20794 # define DISABLE_RK3_ANALOG() (RXY_GPIO_PCFG(RK3_AN) = 1)
20795 # else
20796 # define DISABLE_RK3_ANALOG() ((void) 0)
20797 # endif
20798 
20799 // Input/output:
20800 /// Configure pin RK3 as an input.
20801 # define CONFIG_RK3_AS_INPUT() (_TRISK3 = 1)
20802 /// Configure pin RK3 as an output.
20803 # define CONFIG_RK3_AS_OUTPUT() (_TRISK3 = 0)
20804 
20805 // Open-drain:
20806 # if defined(_ODCK3) || defined(__DOXYGEN__)
20807 /// Enable the open-drain driver on pin RK3.
20808 # define ENABLE_RK3_OPENDRAIN() (_ODCK3 = 1)
20809 /// Disable the open-drain driver on pin RK3.
20810 # define DISABLE_RK3_OPENDRAIN() (_ODCK3 = 0)
20811 # elif defined(_ODK3) // The PIF24F names this bit _OD instead of _ODC.
20812 # define ENABLE_RK3_OPENDRAIN() (_ODK3 = 1)
20813 # define DISABLE_RK3_OPENDRAIN() (_ODK3 = 0)
20814 # else
20815 # define DISABLE_RK3_OPENDRAIN() ((void) 0)
20816 # endif
20817 
20818 // Change notification, pullups and pulldowns:
20819 # if defined(_CNIEK3) || defined(__DOXYGEN__)
20820 /// Enable the pullup on pin RK3.
20821 # define ENABLE_RK3_PULLUP() (_CNPUK3 = 1)
20822 /// Disable the pullup on pin RK3.
20823 # define DISABLE_RK3_PULLUP() (_CNPUK3 = 0)
20824 
20825 /// Enable the pulldown on pin RK3.
20826 # define ENABLE_RK3_PULLDOWN() (_CNPDK3 = 1)
20827 /// Disable the pulldown on pin RK3.
20828 # define DISABLE_RK3_PULLDOWN() (_CNPDK3 = 0)
20829 
20830 /// Enable the change notification interrupt on pin RK3.
20831 # define ENABLE_RK3_CN_INTERRUPT() (_CNIEK3 = 1)
20832 /// Disable the change notification interrupt on pin RK3.
20833 # define DISABLE_RK3_CN_INTERRUPT() (_CNIEK3 = 0)
20834 
20835 # elif defined(RK3_CN)
20836 # define ENABLE_RK3_PULLUP() (RXY_GPIO_CNPUE(RK3_CN) = 1)
20837 # define DISABLE_RK3_PULLUP() (RXY_GPIO_CNPUE(RK3_CN) = 0)
20838 
20839 # if RXY_HAS_CNPDE(RK3_CN)
20840 # define ENABLE_RK3_PULLDOWN() (RXY_GPIO_CNPDE(RK3_CN) = 1)
20841 # define DISABLE_RK3_PULLDOWN() (RXY_GPIO_CNPDE(RK3_CN) = 0)
20842 # else
20843 # define DISABLE_RK3_PULLDOWN() ((void) 0)
20844 # endif
20845 
20846 # define ENABLE_RK3_CN_INTERRUPT() (RXY_GPIO_CNIE(RK3_CN) = 1)
20847 # define DISABLE_RK3_CN_INTERRUPT() (RXY_GPIO_CNIE(RK3_CN) = 0)
20848 
20849 # else
20850 # define DISABLE_RK3_PULLUP() ((void) 0)
20851 # define DISABLE_RK3_PULLDOWN() ((void) 0)
20852 # define DISABLE_RK3_CN_INTERRUPT() ((void) 0)
20853 # endif
20854 
20855 // High-level config
20856 // -----------------
20857 /** This macro disables pullups/downs, enables analog functionality, and configures
20858  * pin RK3 as an input.
20859  */
20860 # if defined(_ANSK3) || defined(RK3_AN) || defined(__DOXYGEN__)
20861 # define CONFIG_RK3_AS_ANALOG() \
20862  do { \
20863  ENABLE_RK3_ANALOG(); \
20864  CONFIG_RK3_AS_INPUT(); \
20865  DISABLE_RK3_OPENDRAIN(); \
20866  DISABLE_RK3_PULLUP(); \
20867  DISABLE_RK3_PULLDOWN(); \
20868  } while (0)
20869 # endif
20870 
20871 /** This macro disables open-drain and pullups/downs,
20872  * configures pin RK3 for digital (not analog) operation, and
20873  * configures the pin as an input.
20874  */
20875 # define CONFIG_RK3_AS_DIG_INPUT() \
20876  do { \
20877  DISABLE_RK3_ANALOG(); \
20878  CONFIG_RK3_AS_INPUT(); \
20879  DISABLE_RK3_OPENDRAIN(); \
20880  DISABLE_RK3_PULLUP(); \
20881  DISABLE_RK3_PULLDOWN(); \
20882  } while (0)
20883 
20884 /** This macro disables open-drain and pullups/downs,
20885  * configures pin RK3 for digital (not analog) operation, and
20886  * configures the pin as an output.
20887  */
20888 # define CONFIG_RK3_AS_DIG_OUTPUT() \
20889  do { \
20890  DISABLE_RK3_ANALOG(); \
20891  CONFIG_RK3_AS_OUTPUT(); \
20892  DISABLE_RK3_OPENDRAIN(); \
20893  DISABLE_RK3_PULLUP(); \
20894  DISABLE_RK3_PULLDOWN(); \
20895  } while (0)
20896 
20897 #endif // #if defined(_RK3) || defined(__DOXYGEN__): Provide GPIO for RK3
20898 
20899 
20900 
20901 
20902 
20903 // Provide GPIO for RK4
20904 // ====================
20905 #if defined(_RK4) || defined(__DOXYGEN__)
20906 
20907 // Dummy macros for documentation only
20908 # ifdef __DOXYGEN__
20909 /// This macro specifies the RPy value associated with pin RK4.
20910 /// Its device-specific definition is given in pic24_ports_mapping.h.
20911 # define RK4_RP xx
20912 
20913 /// This macro specifies the ANn value associated with pin RK4.
20914 /// Its device-specific definition is given in pic24_ports_mapping.h.
20915 # define RK4_AN xx
20916 
20917 /// This macro specifies the CNm value associated with pin RK4.
20918 /// Its device-specific definition is given in pic24_ports_mapping.h.
20919 # define RK4_CN xx
20920 
20921 //@}
20922 # endif // #ifdef __DOXYGEN__
20923 
20924 
20925 // Low-level config
20926 // ----------------
20927 // Analog:
20928 # if defined(_ANSK4) || defined(__DOXYGEN__)
20929 /// Enable analog functionality on pin RK4.
20930 # define ENABLE_RK4_ANALOG() (_ANSK4 = 1)
20931 /// Disable analog functionality on pin RK4.
20932 # define DISABLE_RK4_ANALOG() (_ANSK4 = 0)
20933 # elif defined(RK4_AN)
20934 # define ENABLE_RK4_ANALOG() (RXY_GPIO_PCFG(RK4_AN) = 0)
20935 # define DISABLE_RK4_ANALOG() (RXY_GPIO_PCFG(RK4_AN) = 1)
20936 # else
20937 # define DISABLE_RK4_ANALOG() ((void) 0)
20938 # endif
20939 
20940 // Input/output:
20941 /// Configure pin RK4 as an input.
20942 # define CONFIG_RK4_AS_INPUT() (_TRISK4 = 1)
20943 /// Configure pin RK4 as an output.
20944 # define CONFIG_RK4_AS_OUTPUT() (_TRISK4 = 0)
20945 
20946 // Open-drain:
20947 # if defined(_ODCK4) || defined(__DOXYGEN__)
20948 /// Enable the open-drain driver on pin RK4.
20949 # define ENABLE_RK4_OPENDRAIN() (_ODCK4 = 1)
20950 /// Disable the open-drain driver on pin RK4.
20951 # define DISABLE_RK4_OPENDRAIN() (_ODCK4 = 0)
20952 # elif defined(_ODK4) // The PIF24F names this bit _OD instead of _ODC.
20953 # define ENABLE_RK4_OPENDRAIN() (_ODK4 = 1)
20954 # define DISABLE_RK4_OPENDRAIN() (_ODK4 = 0)
20955 # else
20956 # define DISABLE_RK4_OPENDRAIN() ((void) 0)
20957 # endif
20958 
20959 // Change notification, pullups and pulldowns:
20960 # if defined(_CNIEK4) || defined(__DOXYGEN__)
20961 /// Enable the pullup on pin RK4.
20962 # define ENABLE_RK4_PULLUP() (_CNPUK4 = 1)
20963 /// Disable the pullup on pin RK4.
20964 # define DISABLE_RK4_PULLUP() (_CNPUK4 = 0)
20965 
20966 /// Enable the pulldown on pin RK4.
20967 # define ENABLE_RK4_PULLDOWN() (_CNPDK4 = 1)
20968 /// Disable the pulldown on pin RK4.
20969 # define DISABLE_RK4_PULLDOWN() (_CNPDK4 = 0)
20970 
20971 /// Enable the change notification interrupt on pin RK4.
20972 # define ENABLE_RK4_CN_INTERRUPT() (_CNIEK4 = 1)
20973 /// Disable the change notification interrupt on pin RK4.
20974 # define DISABLE_RK4_CN_INTERRUPT() (_CNIEK4 = 0)
20975 
20976 # elif defined(RK4_CN)
20977 # define ENABLE_RK4_PULLUP() (RXY_GPIO_CNPUE(RK4_CN) = 1)
20978 # define DISABLE_RK4_PULLUP() (RXY_GPIO_CNPUE(RK4_CN) = 0)
20979 
20980 # if RXY_HAS_CNPDE(RK4_CN)
20981 # define ENABLE_RK4_PULLDOWN() (RXY_GPIO_CNPDE(RK4_CN) = 1)
20982 # define DISABLE_RK4_PULLDOWN() (RXY_GPIO_CNPDE(RK4_CN) = 0)
20983 # else
20984 # define DISABLE_RK4_PULLDOWN() ((void) 0)
20985 # endif
20986 
20987 # define ENABLE_RK4_CN_INTERRUPT() (RXY_GPIO_CNIE(RK4_CN) = 1)
20988 # define DISABLE_RK4_CN_INTERRUPT() (RXY_GPIO_CNIE(RK4_CN) = 0)
20989 
20990 # else
20991 # define DISABLE_RK4_PULLUP() ((void) 0)
20992 # define DISABLE_RK4_PULLDOWN() ((void) 0)
20993 # define DISABLE_RK4_CN_INTERRUPT() ((void) 0)
20994 # endif
20995 
20996 // High-level config
20997 // -----------------
20998 /** This macro disables pullups/downs, enables analog functionality, and configures
20999  * pin RK4 as an input.
21000  */
21001 # if defined(_ANSK4) || defined(RK4_AN) || defined(__DOXYGEN__)
21002 # define CONFIG_RK4_AS_ANALOG() \
21003  do { \
21004  ENABLE_RK4_ANALOG(); \
21005  CONFIG_RK4_AS_INPUT(); \
21006  DISABLE_RK4_OPENDRAIN(); \
21007  DISABLE_RK4_PULLUP(); \
21008  DISABLE_RK4_PULLDOWN(); \
21009  } while (0)
21010 # endif
21011 
21012 /** This macro disables open-drain and pullups/downs,
21013  * configures pin RK4 for digital (not analog) operation, and
21014  * configures the pin as an input.
21015  */
21016 # define CONFIG_RK4_AS_DIG_INPUT() \
21017  do { \
21018  DISABLE_RK4_ANALOG(); \
21019  CONFIG_RK4_AS_INPUT(); \
21020  DISABLE_RK4_OPENDRAIN(); \
21021  DISABLE_RK4_PULLUP(); \
21022  DISABLE_RK4_PULLDOWN(); \
21023  } while (0)
21024 
21025 /** This macro disables open-drain and pullups/downs,
21026  * configures pin RK4 for digital (not analog) operation, and
21027  * configures the pin as an output.
21028  */
21029 # define CONFIG_RK4_AS_DIG_OUTPUT() \
21030  do { \
21031  DISABLE_RK4_ANALOG(); \
21032  CONFIG_RK4_AS_OUTPUT(); \
21033  DISABLE_RK4_OPENDRAIN(); \
21034  DISABLE_RK4_PULLUP(); \
21035  DISABLE_RK4_PULLDOWN(); \
21036  } while (0)
21037 
21038 #endif // #if defined(_RK4) || defined(__DOXYGEN__): Provide GPIO for RK4
21039 
21040 
21041 
21042 
21043 
21044 // Provide GPIO for RK5
21045 // ====================
21046 #if defined(_RK5) || defined(__DOXYGEN__)
21047 
21048 // Dummy macros for documentation only
21049 # ifdef __DOXYGEN__
21050 /// This macro specifies the RPy value associated with pin RK5.
21051 /// Its device-specific definition is given in pic24_ports_mapping.h.
21052 # define RK5_RP xx
21053 
21054 /// This macro specifies the ANn value associated with pin RK5.
21055 /// Its device-specific definition is given in pic24_ports_mapping.h.
21056 # define RK5_AN xx
21057 
21058 /// This macro specifies the CNm value associated with pin RK5.
21059 /// Its device-specific definition is given in pic24_ports_mapping.h.
21060 # define RK5_CN xx
21061 
21062 //@}
21063 # endif // #ifdef __DOXYGEN__
21064 
21065 
21066 // Low-level config
21067 // ----------------
21068 // Analog:
21069 # if defined(_ANSK5) || defined(__DOXYGEN__)
21070 /// Enable analog functionality on pin RK5.
21071 # define ENABLE_RK5_ANALOG() (_ANSK5 = 1)
21072 /// Disable analog functionality on pin RK5.
21073 # define DISABLE_RK5_ANALOG() (_ANSK5 = 0)
21074 # elif defined(RK5_AN)
21075 # define ENABLE_RK5_ANALOG() (RXY_GPIO_PCFG(RK5_AN) = 0)
21076 # define DISABLE_RK5_ANALOG() (RXY_GPIO_PCFG(RK5_AN) = 1)
21077 # else
21078 # define DISABLE_RK5_ANALOG() ((void) 0)
21079 # endif
21080 
21081 // Input/output:
21082 /// Configure pin RK5 as an input.
21083 # define CONFIG_RK5_AS_INPUT() (_TRISK5 = 1)
21084 /// Configure pin RK5 as an output.
21085 # define CONFIG_RK5_AS_OUTPUT() (_TRISK5 = 0)
21086 
21087 // Open-drain:
21088 # if defined(_ODCK5) || defined(__DOXYGEN__)
21089 /// Enable the open-drain driver on pin RK5.
21090 # define ENABLE_RK5_OPENDRAIN() (_ODCK5 = 1)
21091 /// Disable the open-drain driver on pin RK5.
21092 # define DISABLE_RK5_OPENDRAIN() (_ODCK5 = 0)
21093 # elif defined(_ODK5) // The PIF24F names this bit _OD instead of _ODC.
21094 # define ENABLE_RK5_OPENDRAIN() (_ODK5 = 1)
21095 # define DISABLE_RK5_OPENDRAIN() (_ODK5 = 0)
21096 # else
21097 # define DISABLE_RK5_OPENDRAIN() ((void) 0)
21098 # endif
21099 
21100 // Change notification, pullups and pulldowns:
21101 # if defined(_CNIEK5) || defined(__DOXYGEN__)
21102 /// Enable the pullup on pin RK5.
21103 # define ENABLE_RK5_PULLUP() (_CNPUK5 = 1)
21104 /// Disable the pullup on pin RK5.
21105 # define DISABLE_RK5_PULLUP() (_CNPUK5 = 0)
21106 
21107 /// Enable the pulldown on pin RK5.
21108 # define ENABLE_RK5_PULLDOWN() (_CNPDK5 = 1)
21109 /// Disable the pulldown on pin RK5.
21110 # define DISABLE_RK5_PULLDOWN() (_CNPDK5 = 0)
21111 
21112 /// Enable the change notification interrupt on pin RK5.
21113 # define ENABLE_RK5_CN_INTERRUPT() (_CNIEK5 = 1)
21114 /// Disable the change notification interrupt on pin RK5.
21115 # define DISABLE_RK5_CN_INTERRUPT() (_CNIEK5 = 0)
21116 
21117 # elif defined(RK5_CN)
21118 # define ENABLE_RK5_PULLUP() (RXY_GPIO_CNPUE(RK5_CN) = 1)
21119 # define DISABLE_RK5_PULLUP() (RXY_GPIO_CNPUE(RK5_CN) = 0)
21120 
21121 # if RXY_HAS_CNPDE(RK5_CN)
21122 # define ENABLE_RK5_PULLDOWN() (RXY_GPIO_CNPDE(RK5_CN) = 1)
21123 # define DISABLE_RK5_PULLDOWN() (RXY_GPIO_CNPDE(RK5_CN) = 0)
21124 # else
21125 # define DISABLE_RK5_PULLDOWN() ((void) 0)
21126 # endif
21127 
21128 # define ENABLE_RK5_CN_INTERRUPT() (RXY_GPIO_CNIE(RK5_CN) = 1)
21129 # define DISABLE_RK5_CN_INTERRUPT() (RXY_GPIO_CNIE(RK5_CN) = 0)
21130 
21131 # else
21132 # define DISABLE_RK5_PULLUP() ((void) 0)
21133 # define DISABLE_RK5_PULLDOWN() ((void) 0)
21134 # define DISABLE_RK5_CN_INTERRUPT() ((void) 0)
21135 # endif
21136 
21137 // High-level config
21138 // -----------------
21139 /** This macro disables pullups/downs, enables analog functionality, and configures
21140  * pin RK5 as an input.
21141  */
21142 # if defined(_ANSK5) || defined(RK5_AN) || defined(__DOXYGEN__)
21143 # define CONFIG_RK5_AS_ANALOG() \
21144  do { \
21145  ENABLE_RK5_ANALOG(); \
21146  CONFIG_RK5_AS_INPUT(); \
21147  DISABLE_RK5_OPENDRAIN(); \
21148  DISABLE_RK5_PULLUP(); \
21149  DISABLE_RK5_PULLDOWN(); \
21150  } while (0)
21151 # endif
21152 
21153 /** This macro disables open-drain and pullups/downs,
21154  * configures pin RK5 for digital (not analog) operation, and
21155  * configures the pin as an input.
21156  */
21157 # define CONFIG_RK5_AS_DIG_INPUT() \
21158  do { \
21159  DISABLE_RK5_ANALOG(); \
21160  CONFIG_RK5_AS_INPUT(); \
21161  DISABLE_RK5_OPENDRAIN(); \
21162  DISABLE_RK5_PULLUP(); \
21163  DISABLE_RK5_PULLDOWN(); \
21164  } while (0)
21165 
21166 /** This macro disables open-drain and pullups/downs,
21167  * configures pin RK5 for digital (not analog) operation, and
21168  * configures the pin as an output.
21169  */
21170 # define CONFIG_RK5_AS_DIG_OUTPUT() \
21171  do { \
21172  DISABLE_RK5_ANALOG(); \
21173  CONFIG_RK5_AS_OUTPUT(); \
21174  DISABLE_RK5_OPENDRAIN(); \
21175  DISABLE_RK5_PULLUP(); \
21176  DISABLE_RK5_PULLDOWN(); \
21177  } while (0)
21178 
21179 #endif // #if defined(_RK5) || defined(__DOXYGEN__): Provide GPIO for RK5
21180 
21181 
21182 
21183 
21184 
21185 // Provide GPIO for RK6
21186 // ====================
21187 #if defined(_RK6) || defined(__DOXYGEN__)
21188 
21189 // Dummy macros for documentation only
21190 # ifdef __DOXYGEN__
21191 /// This macro specifies the RPy value associated with pin RK6.
21192 /// Its device-specific definition is given in pic24_ports_mapping.h.
21193 # define RK6_RP xx
21194 
21195 /// This macro specifies the ANn value associated with pin RK6.
21196 /// Its device-specific definition is given in pic24_ports_mapping.h.
21197 # define RK6_AN xx
21198 
21199 /// This macro specifies the CNm value associated with pin RK6.
21200 /// Its device-specific definition is given in pic24_ports_mapping.h.
21201 # define RK6_CN xx
21202 
21203 //@}
21204 # endif // #ifdef __DOXYGEN__
21205 
21206 
21207 // Low-level config
21208 // ----------------
21209 // Analog:
21210 # if defined(_ANSK6) || defined(__DOXYGEN__)
21211 /// Enable analog functionality on pin RK6.
21212 # define ENABLE_RK6_ANALOG() (_ANSK6 = 1)
21213 /// Disable analog functionality on pin RK6.
21214 # define DISABLE_RK6_ANALOG() (_ANSK6 = 0)
21215 # elif defined(RK6_AN)
21216 # define ENABLE_RK6_ANALOG() (RXY_GPIO_PCFG(RK6_AN) = 0)
21217 # define DISABLE_RK6_ANALOG() (RXY_GPIO_PCFG(RK6_AN) = 1)
21218 # else
21219 # define DISABLE_RK6_ANALOG() ((void) 0)
21220 # endif
21221 
21222 // Input/output:
21223 /// Configure pin RK6 as an input.
21224 # define CONFIG_RK6_AS_INPUT() (_TRISK6 = 1)
21225 /// Configure pin RK6 as an output.
21226 # define CONFIG_RK6_AS_OUTPUT() (_TRISK6 = 0)
21227 
21228 // Open-drain:
21229 # if defined(_ODCK6) || defined(__DOXYGEN__)
21230 /// Enable the open-drain driver on pin RK6.
21231 # define ENABLE_RK6_OPENDRAIN() (_ODCK6 = 1)
21232 /// Disable the open-drain driver on pin RK6.
21233 # define DISABLE_RK6_OPENDRAIN() (_ODCK6 = 0)
21234 # elif defined(_ODK6) // The PIF24F names this bit _OD instead of _ODC.
21235 # define ENABLE_RK6_OPENDRAIN() (_ODK6 = 1)
21236 # define DISABLE_RK6_OPENDRAIN() (_ODK6 = 0)
21237 # else
21238 # define DISABLE_RK6_OPENDRAIN() ((void) 0)
21239 # endif
21240 
21241 // Change notification, pullups and pulldowns:
21242 # if defined(_CNIEK6) || defined(__DOXYGEN__)
21243 /// Enable the pullup on pin RK6.
21244 # define ENABLE_RK6_PULLUP() (_CNPUK6 = 1)
21245 /// Disable the pullup on pin RK6.
21246 # define DISABLE_RK6_PULLUP() (_CNPUK6 = 0)
21247 
21248 /// Enable the pulldown on pin RK6.
21249 # define ENABLE_RK6_PULLDOWN() (_CNPDK6 = 1)
21250 /// Disable the pulldown on pin RK6.
21251 # define DISABLE_RK6_PULLDOWN() (_CNPDK6 = 0)
21252 
21253 /// Enable the change notification interrupt on pin RK6.
21254 # define ENABLE_RK6_CN_INTERRUPT() (_CNIEK6 = 1)
21255 /// Disable the change notification interrupt on pin RK6.
21256 # define DISABLE_RK6_CN_INTERRUPT() (_CNIEK6 = 0)
21257 
21258 # elif defined(RK6_CN)
21259 # define ENABLE_RK6_PULLUP() (RXY_GPIO_CNPUE(RK6_CN) = 1)
21260 # define DISABLE_RK6_PULLUP() (RXY_GPIO_CNPUE(RK6_CN) = 0)
21261 
21262 # if RXY_HAS_CNPDE(RK6_CN)
21263 # define ENABLE_RK6_PULLDOWN() (RXY_GPIO_CNPDE(RK6_CN) = 1)
21264 # define DISABLE_RK6_PULLDOWN() (RXY_GPIO_CNPDE(RK6_CN) = 0)
21265 # else
21266 # define DISABLE_RK6_PULLDOWN() ((void) 0)
21267 # endif
21268 
21269 # define ENABLE_RK6_CN_INTERRUPT() (RXY_GPIO_CNIE(RK6_CN) = 1)
21270 # define DISABLE_RK6_CN_INTERRUPT() (RXY_GPIO_CNIE(RK6_CN) = 0)
21271 
21272 # else
21273 # define DISABLE_RK6_PULLUP() ((void) 0)
21274 # define DISABLE_RK6_PULLDOWN() ((void) 0)
21275 # define DISABLE_RK6_CN_INTERRUPT() ((void) 0)
21276 # endif
21277 
21278 // High-level config
21279 // -----------------
21280 /** This macro disables pullups/downs, enables analog functionality, and configures
21281  * pin RK6 as an input.
21282  */
21283 # if defined(_ANSK6) || defined(RK6_AN) || defined(__DOXYGEN__)
21284 # define CONFIG_RK6_AS_ANALOG() \
21285  do { \
21286  ENABLE_RK6_ANALOG(); \
21287  CONFIG_RK6_AS_INPUT(); \
21288  DISABLE_RK6_OPENDRAIN(); \
21289  DISABLE_RK6_PULLUP(); \
21290  DISABLE_RK6_PULLDOWN(); \
21291  } while (0)
21292 # endif
21293 
21294 /** This macro disables open-drain and pullups/downs,
21295  * configures pin RK6 for digital (not analog) operation, and
21296  * configures the pin as an input.
21297  */
21298 # define CONFIG_RK6_AS_DIG_INPUT() \
21299  do { \
21300  DISABLE_RK6_ANALOG(); \
21301  CONFIG_RK6_AS_INPUT(); \
21302  DISABLE_RK6_OPENDRAIN(); \
21303  DISABLE_RK6_PULLUP(); \
21304  DISABLE_RK6_PULLDOWN(); \
21305  } while (0)
21306 
21307 /** This macro disables open-drain and pullups/downs,
21308  * configures pin RK6 for digital (not analog) operation, and
21309  * configures the pin as an output.
21310  */
21311 # define CONFIG_RK6_AS_DIG_OUTPUT() \
21312  do { \
21313  DISABLE_RK6_ANALOG(); \
21314  CONFIG_RK6_AS_OUTPUT(); \
21315  DISABLE_RK6_OPENDRAIN(); \
21316  DISABLE_RK6_PULLUP(); \
21317  DISABLE_RK6_PULLDOWN(); \
21318  } while (0)
21319 
21320 #endif // #if defined(_RK6) || defined(__DOXYGEN__): Provide GPIO for RK6
21321 
21322 
21323 
21324 
21325 
21326 // Provide GPIO for RK7
21327 // ====================
21328 #if defined(_RK7) || defined(__DOXYGEN__)
21329 
21330 // Dummy macros for documentation only
21331 # ifdef __DOXYGEN__
21332 /// This macro specifies the RPy value associated with pin RK7.
21333 /// Its device-specific definition is given in pic24_ports_mapping.h.
21334 # define RK7_RP xx
21335 
21336 /// This macro specifies the ANn value associated with pin RK7.
21337 /// Its device-specific definition is given in pic24_ports_mapping.h.
21338 # define RK7_AN xx
21339 
21340 /// This macro specifies the CNm value associated with pin RK7.
21341 /// Its device-specific definition is given in pic24_ports_mapping.h.
21342 # define RK7_CN xx
21343 
21344 //@}
21345 # endif // #ifdef __DOXYGEN__
21346 
21347 
21348 // Low-level config
21349 // ----------------
21350 // Analog:
21351 # if defined(_ANSK7) || defined(__DOXYGEN__)
21352 /// Enable analog functionality on pin RK7.
21353 # define ENABLE_RK7_ANALOG() (_ANSK7 = 1)
21354 /// Disable analog functionality on pin RK7.
21355 # define DISABLE_RK7_ANALOG() (_ANSK7 = 0)
21356 # elif defined(RK7_AN)
21357 # define ENABLE_RK7_ANALOG() (RXY_GPIO_PCFG(RK7_AN) = 0)
21358 # define DISABLE_RK7_ANALOG() (RXY_GPIO_PCFG(RK7_AN) = 1)
21359 # else
21360 # define DISABLE_RK7_ANALOG() ((void) 0)
21361 # endif
21362 
21363 // Input/output:
21364 /// Configure pin RK7 as an input.
21365 # define CONFIG_RK7_AS_INPUT() (_TRISK7 = 1)
21366 /// Configure pin RK7 as an output.
21367 # define CONFIG_RK7_AS_OUTPUT() (_TRISK7 = 0)
21368 
21369 // Open-drain:
21370 # if defined(_ODCK7) || defined(__DOXYGEN__)
21371 /// Enable the open-drain driver on pin RK7.
21372 # define ENABLE_RK7_OPENDRAIN() (_ODCK7 = 1)
21373 /// Disable the open-drain driver on pin RK7.
21374 # define DISABLE_RK7_OPENDRAIN() (_ODCK7 = 0)
21375 # elif defined(_ODK7) // The PIF24F names this bit _OD instead of _ODC.
21376 # define ENABLE_RK7_OPENDRAIN() (_ODK7 = 1)
21377 # define DISABLE_RK7_OPENDRAIN() (_ODK7 = 0)
21378 # else
21379 # define DISABLE_RK7_OPENDRAIN() ((void) 0)
21380 # endif
21381 
21382 // Change notification, pullups and pulldowns:
21383 # if defined(_CNIEK7) || defined(__DOXYGEN__)
21384 /// Enable the pullup on pin RK7.
21385 # define ENABLE_RK7_PULLUP() (_CNPUK7 = 1)
21386 /// Disable the pullup on pin RK7.
21387 # define DISABLE_RK7_PULLUP() (_CNPUK7 = 0)
21388 
21389 /// Enable the pulldown on pin RK7.
21390 # define ENABLE_RK7_PULLDOWN() (_CNPDK7 = 1)
21391 /// Disable the pulldown on pin RK7.
21392 # define DISABLE_RK7_PULLDOWN() (_CNPDK7 = 0)
21393 
21394 /// Enable the change notification interrupt on pin RK7.
21395 # define ENABLE_RK7_CN_INTERRUPT() (_CNIEK7 = 1)
21396 /// Disable the change notification interrupt on pin RK7.
21397 # define DISABLE_RK7_CN_INTERRUPT() (_CNIEK7 = 0)
21398 
21399 # elif defined(RK7_CN)
21400 # define ENABLE_RK7_PULLUP() (RXY_GPIO_CNPUE(RK7_CN) = 1)
21401 # define DISABLE_RK7_PULLUP() (RXY_GPIO_CNPUE(RK7_CN) = 0)
21402 
21403 # if RXY_HAS_CNPDE(RK7_CN)
21404 # define ENABLE_RK7_PULLDOWN() (RXY_GPIO_CNPDE(RK7_CN) = 1)
21405 # define DISABLE_RK7_PULLDOWN() (RXY_GPIO_CNPDE(RK7_CN) = 0)
21406 # else
21407 # define DISABLE_RK7_PULLDOWN() ((void) 0)
21408 # endif
21409 
21410 # define ENABLE_RK7_CN_INTERRUPT() (RXY_GPIO_CNIE(RK7_CN) = 1)
21411 # define DISABLE_RK7_CN_INTERRUPT() (RXY_GPIO_CNIE(RK7_CN) = 0)
21412 
21413 # else
21414 # define DISABLE_RK7_PULLUP() ((void) 0)
21415 # define DISABLE_RK7_PULLDOWN() ((void) 0)
21416 # define DISABLE_RK7_CN_INTERRUPT() ((void) 0)
21417 # endif
21418 
21419 // High-level config
21420 // -----------------
21421 /** This macro disables pullups/downs, enables analog functionality, and configures
21422  * pin RK7 as an input.
21423  */
21424 # if defined(_ANSK7) || defined(RK7_AN) || defined(__DOXYGEN__)
21425 # define CONFIG_RK7_AS_ANALOG() \
21426  do { \
21427  ENABLE_RK7_ANALOG(); \
21428  CONFIG_RK7_AS_INPUT(); \
21429  DISABLE_RK7_OPENDRAIN(); \
21430  DISABLE_RK7_PULLUP(); \
21431  DISABLE_RK7_PULLDOWN(); \
21432  } while (0)
21433 # endif
21434 
21435 /** This macro disables open-drain and pullups/downs,
21436  * configures pin RK7 for digital (not analog) operation, and
21437  * configures the pin as an input.
21438  */
21439 # define CONFIG_RK7_AS_DIG_INPUT() \
21440  do { \
21441  DISABLE_RK7_ANALOG(); \
21442  CONFIG_RK7_AS_INPUT(); \
21443  DISABLE_RK7_OPENDRAIN(); \
21444  DISABLE_RK7_PULLUP(); \
21445  DISABLE_RK7_PULLDOWN(); \
21446  } while (0)
21447 
21448 /** This macro disables open-drain and pullups/downs,
21449  * configures pin RK7 for digital (not analog) operation, and
21450  * configures the pin as an output.
21451  */
21452 # define CONFIG_RK7_AS_DIG_OUTPUT() \
21453  do { \
21454  DISABLE_RK7_ANALOG(); \
21455  CONFIG_RK7_AS_OUTPUT(); \
21456  DISABLE_RK7_OPENDRAIN(); \
21457  DISABLE_RK7_PULLUP(); \
21458  DISABLE_RK7_PULLDOWN(); \
21459  } while (0)
21460 
21461 #endif // #if defined(_RK7) || defined(__DOXYGEN__): Provide GPIO for RK7
21462 
21463 
21464 
21465 
21466 
21467 // Provide GPIO for RK8
21468 // ====================
21469 #if defined(_RK8) || defined(__DOXYGEN__)
21470 
21471 // Dummy macros for documentation only
21472 # ifdef __DOXYGEN__
21473 /// This macro specifies the RPy value associated with pin RK8.
21474 /// Its device-specific definition is given in pic24_ports_mapping.h.
21475 # define RK8_RP xx
21476 
21477 /// This macro specifies the ANn value associated with pin RK8.
21478 /// Its device-specific definition is given in pic24_ports_mapping.h.
21479 # define RK8_AN xx
21480 
21481 /// This macro specifies the CNm value associated with pin RK8.
21482 /// Its device-specific definition is given in pic24_ports_mapping.h.
21483 # define RK8_CN xx
21484 
21485 //@}
21486 # endif // #ifdef __DOXYGEN__
21487 
21488 
21489 // Low-level config
21490 // ----------------
21491 // Analog:
21492 # if defined(_ANSK8) || defined(__DOXYGEN__)
21493 /// Enable analog functionality on pin RK8.
21494 # define ENABLE_RK8_ANALOG() (_ANSK8 = 1)
21495 /// Disable analog functionality on pin RK8.
21496 # define DISABLE_RK8_ANALOG() (_ANSK8 = 0)
21497 # elif defined(RK8_AN)
21498 # define ENABLE_RK8_ANALOG() (RXY_GPIO_PCFG(RK8_AN) = 0)
21499 # define DISABLE_RK8_ANALOG() (RXY_GPIO_PCFG(RK8_AN) = 1)
21500 # else
21501 # define DISABLE_RK8_ANALOG() ((void) 0)
21502 # endif
21503 
21504 // Input/output:
21505 /// Configure pin RK8 as an input.
21506 # define CONFIG_RK8_AS_INPUT() (_TRISK8 = 1)
21507 /// Configure pin RK8 as an output.
21508 # define CONFIG_RK8_AS_OUTPUT() (_TRISK8 = 0)
21509 
21510 // Open-drain:
21511 # if defined(_ODCK8) || defined(__DOXYGEN__)
21512 /// Enable the open-drain driver on pin RK8.
21513 # define ENABLE_RK8_OPENDRAIN() (_ODCK8 = 1)
21514 /// Disable the open-drain driver on pin RK8.
21515 # define DISABLE_RK8_OPENDRAIN() (_ODCK8 = 0)
21516 # elif defined(_ODK8) // The PIF24F names this bit _OD instead of _ODC.
21517 # define ENABLE_RK8_OPENDRAIN() (_ODK8 = 1)
21518 # define DISABLE_RK8_OPENDRAIN() (_ODK8 = 0)
21519 # else
21520 # define DISABLE_RK8_OPENDRAIN() ((void) 0)
21521 # endif
21522 
21523 // Change notification, pullups and pulldowns:
21524 # if defined(_CNIEK8) || defined(__DOXYGEN__)
21525 /// Enable the pullup on pin RK8.
21526 # define ENABLE_RK8_PULLUP() (_CNPUK8 = 1)
21527 /// Disable the pullup on pin RK8.
21528 # define DISABLE_RK8_PULLUP() (_CNPUK8 = 0)
21529 
21530 /// Enable the pulldown on pin RK8.
21531 # define ENABLE_RK8_PULLDOWN() (_CNPDK8 = 1)
21532 /// Disable the pulldown on pin RK8.
21533 # define DISABLE_RK8_PULLDOWN() (_CNPDK8 = 0)
21534 
21535 /// Enable the change notification interrupt on pin RK8.
21536 # define ENABLE_RK8_CN_INTERRUPT() (_CNIEK8 = 1)
21537 /// Disable the change notification interrupt on pin RK8.
21538 # define DISABLE_RK8_CN_INTERRUPT() (_CNIEK8 = 0)
21539 
21540 # elif defined(RK8_CN)
21541 # define ENABLE_RK8_PULLUP() (RXY_GPIO_CNPUE(RK8_CN) = 1)
21542 # define DISABLE_RK8_PULLUP() (RXY_GPIO_CNPUE(RK8_CN) = 0)
21543 
21544 # if RXY_HAS_CNPDE(RK8_CN)
21545 # define ENABLE_RK8_PULLDOWN() (RXY_GPIO_CNPDE(RK8_CN) = 1)
21546 # define DISABLE_RK8_PULLDOWN() (RXY_GPIO_CNPDE(RK8_CN) = 0)
21547 # else
21548 # define DISABLE_RK8_PULLDOWN() ((void) 0)
21549 # endif
21550 
21551 # define ENABLE_RK8_CN_INTERRUPT() (RXY_GPIO_CNIE(RK8_CN) = 1)
21552 # define DISABLE_RK8_CN_INTERRUPT() (RXY_GPIO_CNIE(RK8_CN) = 0)
21553 
21554 # else
21555 # define DISABLE_RK8_PULLUP() ((void) 0)
21556 # define DISABLE_RK8_PULLDOWN() ((void) 0)
21557 # define DISABLE_RK8_CN_INTERRUPT() ((void) 0)
21558 # endif
21559 
21560 // High-level config
21561 // -----------------
21562 /** This macro disables pullups/downs, enables analog functionality, and configures
21563  * pin RK8 as an input.
21564  */
21565 # if defined(_ANSK8) || defined(RK8_AN) || defined(__DOXYGEN__)
21566 # define CONFIG_RK8_AS_ANALOG() \
21567  do { \
21568  ENABLE_RK8_ANALOG(); \
21569  CONFIG_RK8_AS_INPUT(); \
21570  DISABLE_RK8_OPENDRAIN(); \
21571  DISABLE_RK8_PULLUP(); \
21572  DISABLE_RK8_PULLDOWN(); \
21573  } while (0)
21574 # endif
21575 
21576 /** This macro disables open-drain and pullups/downs,
21577  * configures pin RK8 for digital (not analog) operation, and
21578  * configures the pin as an input.
21579  */
21580 # define CONFIG_RK8_AS_DIG_INPUT() \
21581  do { \
21582  DISABLE_RK8_ANALOG(); \
21583  CONFIG_RK8_AS_INPUT(); \
21584  DISABLE_RK8_OPENDRAIN(); \
21585  DISABLE_RK8_PULLUP(); \
21586  DISABLE_RK8_PULLDOWN(); \
21587  } while (0)
21588 
21589 /** This macro disables open-drain and pullups/downs,
21590  * configures pin RK8 for digital (not analog) operation, and
21591  * configures the pin as an output.
21592  */
21593 # define CONFIG_RK8_AS_DIG_OUTPUT() \
21594  do { \
21595  DISABLE_RK8_ANALOG(); \
21596  CONFIG_RK8_AS_OUTPUT(); \
21597  DISABLE_RK8_OPENDRAIN(); \
21598  DISABLE_RK8_PULLUP(); \
21599  DISABLE_RK8_PULLDOWN(); \
21600  } while (0)
21601 
21602 #endif // #if defined(_RK8) || defined(__DOXYGEN__): Provide GPIO for RK8
21603 
21604 
21605 
21606 
21607 
21608 // Provide GPIO for RK9
21609 // ====================
21610 #if defined(_RK9) || defined(__DOXYGEN__)
21611 
21612 // Dummy macros for documentation only
21613 # ifdef __DOXYGEN__
21614 /// This macro specifies the RPy value associated with pin RK9.
21615 /// Its device-specific definition is given in pic24_ports_mapping.h.
21616 # define RK9_RP xx
21617 
21618 /// This macro specifies the ANn value associated with pin RK9.
21619 /// Its device-specific definition is given in pic24_ports_mapping.h.
21620 # define RK9_AN xx
21621 
21622 /// This macro specifies the CNm value associated with pin RK9.
21623 /// Its device-specific definition is given in pic24_ports_mapping.h.
21624 # define RK9_CN xx
21625 
21626 //@}
21627 # endif // #ifdef __DOXYGEN__
21628 
21629 
21630 // Low-level config
21631 // ----------------
21632 // Analog:
21633 # if defined(_ANSK9) || defined(__DOXYGEN__)
21634 /// Enable analog functionality on pin RK9.
21635 # define ENABLE_RK9_ANALOG() (_ANSK9 = 1)
21636 /// Disable analog functionality on pin RK9.
21637 # define DISABLE_RK9_ANALOG() (_ANSK9 = 0)
21638 # elif defined(RK9_AN)
21639 # define ENABLE_RK9_ANALOG() (RXY_GPIO_PCFG(RK9_AN) = 0)
21640 # define DISABLE_RK9_ANALOG() (RXY_GPIO_PCFG(RK9_AN) = 1)
21641 # else
21642 # define DISABLE_RK9_ANALOG() ((void) 0)
21643 # endif
21644 
21645 // Input/output:
21646 /// Configure pin RK9 as an input.
21647 # define CONFIG_RK9_AS_INPUT() (_TRISK9 = 1)
21648 /// Configure pin RK9 as an output.
21649 # define CONFIG_RK9_AS_OUTPUT() (_TRISK9 = 0)
21650 
21651 // Open-drain:
21652 # if defined(_ODCK9) || defined(__DOXYGEN__)
21653 /// Enable the open-drain driver on pin RK9.
21654 # define ENABLE_RK9_OPENDRAIN() (_ODCK9 = 1)
21655 /// Disable the open-drain driver on pin RK9.
21656 # define DISABLE_RK9_OPENDRAIN() (_ODCK9 = 0)
21657 # elif defined(_ODK9) // The PIF24F names this bit _OD instead of _ODC.
21658 # define ENABLE_RK9_OPENDRAIN() (_ODK9 = 1)
21659 # define DISABLE_RK9_OPENDRAIN() (_ODK9 = 0)
21660 # else
21661 # define DISABLE_RK9_OPENDRAIN() ((void) 0)
21662 # endif
21663 
21664 // Change notification, pullups and pulldowns:
21665 # if defined(_CNIEK9) || defined(__DOXYGEN__)
21666 /// Enable the pullup on pin RK9.
21667 # define ENABLE_RK9_PULLUP() (_CNPUK9 = 1)
21668 /// Disable the pullup on pin RK9.
21669 # define DISABLE_RK9_PULLUP() (_CNPUK9 = 0)
21670 
21671 /// Enable the pulldown on pin RK9.
21672 # define ENABLE_RK9_PULLDOWN() (_CNPDK9 = 1)
21673 /// Disable the pulldown on pin RK9.
21674 # define DISABLE_RK9_PULLDOWN() (_CNPDK9 = 0)
21675 
21676 /// Enable the change notification interrupt on pin RK9.
21677 # define ENABLE_RK9_CN_INTERRUPT() (_CNIEK9 = 1)
21678 /// Disable the change notification interrupt on pin RK9.
21679 # define DISABLE_RK9_CN_INTERRUPT() (_CNIEK9 = 0)
21680 
21681 # elif defined(RK9_CN)
21682 # define ENABLE_RK9_PULLUP() (RXY_GPIO_CNPUE(RK9_CN) = 1)
21683 # define DISABLE_RK9_PULLUP() (RXY_GPIO_CNPUE(RK9_CN) = 0)
21684 
21685 # if RXY_HAS_CNPDE(RK9_CN)
21686 # define ENABLE_RK9_PULLDOWN() (RXY_GPIO_CNPDE(RK9_CN) = 1)
21687 # define DISABLE_RK9_PULLDOWN() (RXY_GPIO_CNPDE(RK9_CN) = 0)
21688 # else
21689 # define DISABLE_RK9_PULLDOWN() ((void) 0)
21690 # endif
21691 
21692 # define ENABLE_RK9_CN_INTERRUPT() (RXY_GPIO_CNIE(RK9_CN) = 1)
21693 # define DISABLE_RK9_CN_INTERRUPT() (RXY_GPIO_CNIE(RK9_CN) = 0)
21694 
21695 # else
21696 # define DISABLE_RK9_PULLUP() ((void) 0)
21697 # define DISABLE_RK9_PULLDOWN() ((void) 0)
21698 # define DISABLE_RK9_CN_INTERRUPT() ((void) 0)
21699 # endif
21700 
21701 // High-level config
21702 // -----------------
21703 /** This macro disables pullups/downs, enables analog functionality, and configures
21704  * pin RK9 as an input.
21705  */
21706 # if defined(_ANSK9) || defined(RK9_AN) || defined(__DOXYGEN__)
21707 # define CONFIG_RK9_AS_ANALOG() \
21708  do { \
21709  ENABLE_RK9_ANALOG(); \
21710  CONFIG_RK9_AS_INPUT(); \
21711  DISABLE_RK9_OPENDRAIN(); \
21712  DISABLE_RK9_PULLUP(); \
21713  DISABLE_RK9_PULLDOWN(); \
21714  } while (0)
21715 # endif
21716 
21717 /** This macro disables open-drain and pullups/downs,
21718  * configures pin RK9 for digital (not analog) operation, and
21719  * configures the pin as an input.
21720  */
21721 # define CONFIG_RK9_AS_DIG_INPUT() \
21722  do { \
21723  DISABLE_RK9_ANALOG(); \
21724  CONFIG_RK9_AS_INPUT(); \
21725  DISABLE_RK9_OPENDRAIN(); \
21726  DISABLE_RK9_PULLUP(); \
21727  DISABLE_RK9_PULLDOWN(); \
21728  } while (0)
21729 
21730 /** This macro disables open-drain and pullups/downs,
21731  * configures pin RK9 for digital (not analog) operation, and
21732  * configures the pin as an output.
21733  */
21734 # define CONFIG_RK9_AS_DIG_OUTPUT() \
21735  do { \
21736  DISABLE_RK9_ANALOG(); \
21737  CONFIG_RK9_AS_OUTPUT(); \
21738  DISABLE_RK9_OPENDRAIN(); \
21739  DISABLE_RK9_PULLUP(); \
21740  DISABLE_RK9_PULLDOWN(); \
21741  } while (0)
21742 
21743 #endif // #if defined(_RK9) || defined(__DOXYGEN__): Provide GPIO for RK9
21744 
21745 
21746 
21747 
21748 
21749 // Provide GPIO for RK10
21750 // ====================
21751 #if defined(_RK10) || defined(__DOXYGEN__)
21752 
21753 // Dummy macros for documentation only
21754 # ifdef __DOXYGEN__
21755 /// This macro specifies the RPy value associated with pin RK10.
21756 /// Its device-specific definition is given in pic24_ports_mapping.h.
21757 # define RK10_RP xx
21758 
21759 /// This macro specifies the ANn value associated with pin RK10.
21760 /// Its device-specific definition is given in pic24_ports_mapping.h.
21761 # define RK10_AN xx
21762 
21763 /// This macro specifies the CNm value associated with pin RK10.
21764 /// Its device-specific definition is given in pic24_ports_mapping.h.
21765 # define RK10_CN xx
21766 
21767 //@}
21768 # endif // #ifdef __DOXYGEN__
21769 
21770 
21771 // Low-level config
21772 // ----------------
21773 // Analog:
21774 # if defined(_ANSK10) || defined(__DOXYGEN__)
21775 /// Enable analog functionality on pin RK10.
21776 # define ENABLE_RK10_ANALOG() (_ANSK10 = 1)
21777 /// Disable analog functionality on pin RK10.
21778 # define DISABLE_RK10_ANALOG() (_ANSK10 = 0)
21779 # elif defined(RK10_AN)
21780 # define ENABLE_RK10_ANALOG() (RXY_GPIO_PCFG(RK10_AN) = 0)
21781 # define DISABLE_RK10_ANALOG() (RXY_GPIO_PCFG(RK10_AN) = 1)
21782 # else
21783 # define DISABLE_RK10_ANALOG() ((void) 0)
21784 # endif
21785 
21786 // Input/output:
21787 /// Configure pin RK10 as an input.
21788 # define CONFIG_RK10_AS_INPUT() (_TRISK10 = 1)
21789 /// Configure pin RK10 as an output.
21790 # define CONFIG_RK10_AS_OUTPUT() (_TRISK10 = 0)
21791 
21792 // Open-drain:
21793 # if defined(_ODCK10) || defined(__DOXYGEN__)
21794 /// Enable the open-drain driver on pin RK10.
21795 # define ENABLE_RK10_OPENDRAIN() (_ODCK10 = 1)
21796 /// Disable the open-drain driver on pin RK10.
21797 # define DISABLE_RK10_OPENDRAIN() (_ODCK10 = 0)
21798 # elif defined(_ODK10) // The PIF24F names this bit _OD instead of _ODC.
21799 # define ENABLE_RK10_OPENDRAIN() (_ODK10 = 1)
21800 # define DISABLE_RK10_OPENDRAIN() (_ODK10 = 0)
21801 # else
21802 # define DISABLE_RK10_OPENDRAIN() ((void) 0)
21803 # endif
21804 
21805 // Change notification, pullups and pulldowns:
21806 # if defined(_CNIEK10) || defined(__DOXYGEN__)
21807 /// Enable the pullup on pin RK10.
21808 # define ENABLE_RK10_PULLUP() (_CNPUK10 = 1)
21809 /// Disable the pullup on pin RK10.
21810 # define DISABLE_RK10_PULLUP() (_CNPUK10 = 0)
21811 
21812 /// Enable the pulldown on pin RK10.
21813 # define ENABLE_RK10_PULLDOWN() (_CNPDK10 = 1)
21814 /// Disable the pulldown on pin RK10.
21815 # define DISABLE_RK10_PULLDOWN() (_CNPDK10 = 0)
21816 
21817 /// Enable the change notification interrupt on pin RK10.
21818 # define ENABLE_RK10_CN_INTERRUPT() (_CNIEK10 = 1)
21819 /// Disable the change notification interrupt on pin RK10.
21820 # define DISABLE_RK10_CN_INTERRUPT() (_CNIEK10 = 0)
21821 
21822 # elif defined(RK10_CN)
21823 # define ENABLE_RK10_PULLUP() (RXY_GPIO_CNPUE(RK10_CN) = 1)
21824 # define DISABLE_RK10_PULLUP() (RXY_GPIO_CNPUE(RK10_CN) = 0)
21825 
21826 # if RXY_HAS_CNPDE(RK10_CN)
21827 # define ENABLE_RK10_PULLDOWN() (RXY_GPIO_CNPDE(RK10_CN) = 1)
21828 # define DISABLE_RK10_PULLDOWN() (RXY_GPIO_CNPDE(RK10_CN) = 0)
21829 # else
21830 # define DISABLE_RK10_PULLDOWN() ((void) 0)
21831 # endif
21832 
21833 # define ENABLE_RK10_CN_INTERRUPT() (RXY_GPIO_CNIE(RK10_CN) = 1)
21834 # define DISABLE_RK10_CN_INTERRUPT() (RXY_GPIO_CNIE(RK10_CN) = 0)
21835 
21836 # else
21837 # define DISABLE_RK10_PULLUP() ((void) 0)
21838 # define DISABLE_RK10_PULLDOWN() ((void) 0)
21839 # define DISABLE_RK10_CN_INTERRUPT() ((void) 0)
21840 # endif
21841 
21842 // High-level config
21843 // -----------------
21844 /** This macro disables pullups/downs, enables analog functionality, and configures
21845  * pin RK10 as an input.
21846  */
21847 # if defined(_ANSK10) || defined(RK10_AN) || defined(__DOXYGEN__)
21848 # define CONFIG_RK10_AS_ANALOG() \
21849  do { \
21850  ENABLE_RK10_ANALOG(); \
21851  CONFIG_RK10_AS_INPUT(); \
21852  DISABLE_RK10_OPENDRAIN(); \
21853  DISABLE_RK10_PULLUP(); \
21854  DISABLE_RK10_PULLDOWN(); \
21855  } while (0)
21856 # endif
21857 
21858 /** This macro disables open-drain and pullups/downs,
21859  * configures pin RK10 for digital (not analog) operation, and
21860  * configures the pin as an input.
21861  */
21862 # define CONFIG_RK10_AS_DIG_INPUT() \
21863  do { \
21864  DISABLE_RK10_ANALOG(); \
21865  CONFIG_RK10_AS_INPUT(); \
21866  DISABLE_RK10_OPENDRAIN(); \
21867  DISABLE_RK10_PULLUP(); \
21868  DISABLE_RK10_PULLDOWN(); \
21869  } while (0)
21870 
21871 /** This macro disables open-drain and pullups/downs,
21872  * configures pin RK10 for digital (not analog) operation, and
21873  * configures the pin as an output.
21874  */
21875 # define CONFIG_RK10_AS_DIG_OUTPUT() \
21876  do { \
21877  DISABLE_RK10_ANALOG(); \
21878  CONFIG_RK10_AS_OUTPUT(); \
21879  DISABLE_RK10_OPENDRAIN(); \
21880  DISABLE_RK10_PULLUP(); \
21881  DISABLE_RK10_PULLDOWN(); \
21882  } while (0)
21883 
21884 #endif // #if defined(_RK10) || defined(__DOXYGEN__): Provide GPIO for RK10
21885 
21886 
21887 
21888 
21889 
21890 // Provide GPIO for RK11
21891 // ====================
21892 #if defined(_RK11) || defined(__DOXYGEN__)
21893 
21894 // Dummy macros for documentation only
21895 # ifdef __DOXYGEN__
21896 /// This macro specifies the RPy value associated with pin RK11.
21897 /// Its device-specific definition is given in pic24_ports_mapping.h.
21898 # define RK11_RP xx
21899 
21900 /// This macro specifies the ANn value associated with pin RK11.
21901 /// Its device-specific definition is given in pic24_ports_mapping.h.
21902 # define RK11_AN xx
21903 
21904 /// This macro specifies the CNm value associated with pin RK11.
21905 /// Its device-specific definition is given in pic24_ports_mapping.h.
21906 # define RK11_CN xx
21907 
21908 //@}
21909 # endif // #ifdef __DOXYGEN__
21910 
21911 
21912 // Low-level config
21913 // ----------------
21914 // Analog:
21915 # if defined(_ANSK11) || defined(__DOXYGEN__)
21916 /// Enable analog functionality on pin RK11.
21917 # define ENABLE_RK11_ANALOG() (_ANSK11 = 1)
21918 /// Disable analog functionality on pin RK11.
21919 # define DISABLE_RK11_ANALOG() (_ANSK11 = 0)
21920 # elif defined(RK11_AN)
21921 # define ENABLE_RK11_ANALOG() (RXY_GPIO_PCFG(RK11_AN) = 0)
21922 # define DISABLE_RK11_ANALOG() (RXY_GPIO_PCFG(RK11_AN) = 1)
21923 # else
21924 # define DISABLE_RK11_ANALOG() ((void) 0)
21925 # endif
21926 
21927 // Input/output:
21928 /// Configure pin RK11 as an input.
21929 # define CONFIG_RK11_AS_INPUT() (_TRISK11 = 1)
21930 /// Configure pin RK11 as an output.
21931 # define CONFIG_RK11_AS_OUTPUT() (_TRISK11 = 0)
21932 
21933 // Open-drain:
21934 # if defined(_ODCK11) || defined(__DOXYGEN__)
21935 /// Enable the open-drain driver on pin RK11.
21936 # define ENABLE_RK11_OPENDRAIN() (_ODCK11 = 1)
21937 /// Disable the open-drain driver on pin RK11.
21938 # define DISABLE_RK11_OPENDRAIN() (_ODCK11 = 0)
21939 # elif defined(_ODK11) // The PIF24F names this bit _OD instead of _ODC.
21940 # define ENABLE_RK11_OPENDRAIN() (_ODK11 = 1)
21941 # define DISABLE_RK11_OPENDRAIN() (_ODK11 = 0)
21942 # else
21943 # define DISABLE_RK11_OPENDRAIN() ((void) 0)
21944 # endif
21945 
21946 // Change notification, pullups and pulldowns:
21947 # if defined(_CNIEK11) || defined(__DOXYGEN__)
21948 /// Enable the pullup on pin RK11.
21949 # define ENABLE_RK11_PULLUP() (_CNPUK11 = 1)
21950 /// Disable the pullup on pin RK11.
21951 # define DISABLE_RK11_PULLUP() (_CNPUK11 = 0)
21952 
21953 /// Enable the pulldown on pin RK11.
21954 # define ENABLE_RK11_PULLDOWN() (_CNPDK11 = 1)
21955 /// Disable the pulldown on pin RK11.
21956 # define DISABLE_RK11_PULLDOWN() (_CNPDK11 = 0)
21957 
21958 /// Enable the change notification interrupt on pin RK11.
21959 # define ENABLE_RK11_CN_INTERRUPT() (_CNIEK11 = 1)
21960 /// Disable the change notification interrupt on pin RK11.
21961 # define DISABLE_RK11_CN_INTERRUPT() (_CNIEK11 = 0)
21962 
21963 # elif defined(RK11_CN)
21964 # define ENABLE_RK11_PULLUP() (RXY_GPIO_CNPUE(RK11_CN) = 1)
21965 # define DISABLE_RK11_PULLUP() (RXY_GPIO_CNPUE(RK11_CN) = 0)
21966 
21967 # if RXY_HAS_CNPDE(RK11_CN)
21968 # define ENABLE_RK11_PULLDOWN() (RXY_GPIO_CNPDE(RK11_CN) = 1)
21969 # define DISABLE_RK11_PULLDOWN() (RXY_GPIO_CNPDE(RK11_CN) = 0)
21970 # else
21971 # define DISABLE_RK11_PULLDOWN() ((void) 0)
21972 # endif
21973 
21974 # define ENABLE_RK11_CN_INTERRUPT() (RXY_GPIO_CNIE(RK11_CN) = 1)
21975 # define DISABLE_RK11_CN_INTERRUPT() (RXY_GPIO_CNIE(RK11_CN) = 0)
21976 
21977 # else
21978 # define DISABLE_RK11_PULLUP() ((void) 0)
21979 # define DISABLE_RK11_PULLDOWN() ((void) 0)
21980 # define DISABLE_RK11_CN_INTERRUPT() ((void) 0)
21981 # endif
21982 
21983 // High-level config
21984 // -----------------
21985 /** This macro disables pullups/downs, enables analog functionality, and configures
21986  * pin RK11 as an input.
21987  */
21988 # if defined(_ANSK11) || defined(RK11_AN) || defined(__DOXYGEN__)
21989 # define CONFIG_RK11_AS_ANALOG() \
21990  do { \
21991  ENABLE_RK11_ANALOG(); \
21992  CONFIG_RK11_AS_INPUT(); \
21993  DISABLE_RK11_OPENDRAIN(); \
21994  DISABLE_RK11_PULLUP(); \
21995  DISABLE_RK11_PULLDOWN(); \
21996  } while (0)
21997 # endif
21998 
21999 /** This macro disables open-drain and pullups/downs,
22000  * configures pin RK11 for digital (not analog) operation, and
22001  * configures the pin as an input.
22002  */
22003 # define CONFIG_RK11_AS_DIG_INPUT() \
22004  do { \
22005  DISABLE_RK11_ANALOG(); \
22006  CONFIG_RK11_AS_INPUT(); \
22007  DISABLE_RK11_OPENDRAIN(); \
22008  DISABLE_RK11_PULLUP(); \
22009  DISABLE_RK11_PULLDOWN(); \
22010  } while (0)
22011 
22012 /** This macro disables open-drain and pullups/downs,
22013  * configures pin RK11 for digital (not analog) operation, and
22014  * configures the pin as an output.
22015  */
22016 # define CONFIG_RK11_AS_DIG_OUTPUT() \
22017  do { \
22018  DISABLE_RK11_ANALOG(); \
22019  CONFIG_RK11_AS_OUTPUT(); \
22020  DISABLE_RK11_OPENDRAIN(); \
22021  DISABLE_RK11_PULLUP(); \
22022  DISABLE_RK11_PULLDOWN(); \
22023  } while (0)
22024 
22025 #endif // #if defined(_RK11) || defined(__DOXYGEN__): Provide GPIO for RK11
22026 
22027 
22028 
22029 
22030 
22031 // Provide GPIO for RK12
22032 // ====================
22033 #if defined(_RK12) || defined(__DOXYGEN__)
22034 
22035 // Dummy macros for documentation only
22036 # ifdef __DOXYGEN__
22037 /// This macro specifies the RPy value associated with pin RK12.
22038 /// Its device-specific definition is given in pic24_ports_mapping.h.
22039 # define RK12_RP xx
22040 
22041 /// This macro specifies the ANn value associated with pin RK12.
22042 /// Its device-specific definition is given in pic24_ports_mapping.h.
22043 # define RK12_AN xx
22044 
22045 /// This macro specifies the CNm value associated with pin RK12.
22046 /// Its device-specific definition is given in pic24_ports_mapping.h.
22047 # define RK12_CN xx
22048 
22049 //@}
22050 # endif // #ifdef __DOXYGEN__
22051 
22052 
22053 // Low-level config
22054 // ----------------
22055 // Analog:
22056 # if defined(_ANSK12) || defined(__DOXYGEN__)
22057 /// Enable analog functionality on pin RK12.
22058 # define ENABLE_RK12_ANALOG() (_ANSK12 = 1)
22059 /// Disable analog functionality on pin RK12.
22060 # define DISABLE_RK12_ANALOG() (_ANSK12 = 0)
22061 # elif defined(RK12_AN)
22062 # define ENABLE_RK12_ANALOG() (RXY_GPIO_PCFG(RK12_AN) = 0)
22063 # define DISABLE_RK12_ANALOG() (RXY_GPIO_PCFG(RK12_AN) = 1)
22064 # else
22065 # define DISABLE_RK12_ANALOG() ((void) 0)
22066 # endif
22067 
22068 // Input/output:
22069 /// Configure pin RK12 as an input.
22070 # define CONFIG_RK12_AS_INPUT() (_TRISK12 = 1)
22071 /// Configure pin RK12 as an output.
22072 # define CONFIG_RK12_AS_OUTPUT() (_TRISK12 = 0)
22073 
22074 // Open-drain:
22075 # if defined(_ODCK12) || defined(__DOXYGEN__)
22076 /// Enable the open-drain driver on pin RK12.
22077 # define ENABLE_RK12_OPENDRAIN() (_ODCK12 = 1)
22078 /// Disable the open-drain driver on pin RK12.
22079 # define DISABLE_RK12_OPENDRAIN() (_ODCK12 = 0)
22080 # elif defined(_ODK12) // The PIF24F names this bit _OD instead of _ODC.
22081 # define ENABLE_RK12_OPENDRAIN() (_ODK12 = 1)
22082 # define DISABLE_RK12_OPENDRAIN() (_ODK12 = 0)
22083 # else
22084 # define DISABLE_RK12_OPENDRAIN() ((void) 0)
22085 # endif
22086 
22087 // Change notification, pullups and pulldowns:
22088 # if defined(_CNIEK12) || defined(__DOXYGEN__)
22089 /// Enable the pullup on pin RK12.
22090 # define ENABLE_RK12_PULLUP() (_CNPUK12 = 1)
22091 /// Disable the pullup on pin RK12.
22092 # define DISABLE_RK12_PULLUP() (_CNPUK12 = 0)
22093 
22094 /// Enable the pulldown on pin RK12.
22095 # define ENABLE_RK12_PULLDOWN() (_CNPDK12 = 1)
22096 /// Disable the pulldown on pin RK12.
22097 # define DISABLE_RK12_PULLDOWN() (_CNPDK12 = 0)
22098 
22099 /// Enable the change notification interrupt on pin RK12.
22100 # define ENABLE_RK12_CN_INTERRUPT() (_CNIEK12 = 1)
22101 /// Disable the change notification interrupt on pin RK12.
22102 # define DISABLE_RK12_CN_INTERRUPT() (_CNIEK12 = 0)
22103 
22104 # elif defined(RK12_CN)
22105 # define ENABLE_RK12_PULLUP() (RXY_GPIO_CNPUE(RK12_CN) = 1)
22106 # define DISABLE_RK12_PULLUP() (RXY_GPIO_CNPUE(RK12_CN) = 0)
22107 
22108 # if RXY_HAS_CNPDE(RK12_CN)
22109 # define ENABLE_RK12_PULLDOWN() (RXY_GPIO_CNPDE(RK12_CN) = 1)
22110 # define DISABLE_RK12_PULLDOWN() (RXY_GPIO_CNPDE(RK12_CN) = 0)
22111 # else
22112 # define DISABLE_RK12_PULLDOWN() ((void) 0)
22113 # endif
22114 
22115 # define ENABLE_RK12_CN_INTERRUPT() (RXY_GPIO_CNIE(RK12_CN) = 1)
22116 # define DISABLE_RK12_CN_INTERRUPT() (RXY_GPIO_CNIE(RK12_CN) = 0)
22117 
22118 # else
22119 # define DISABLE_RK12_PULLUP() ((void) 0)
22120 # define DISABLE_RK12_PULLDOWN() ((void) 0)
22121 # define DISABLE_RK12_CN_INTERRUPT() ((void) 0)
22122 # endif
22123 
22124 // High-level config
22125 // -----------------
22126 /** This macro disables pullups/downs, enables analog functionality, and configures
22127  * pin RK12 as an input.
22128  */
22129 # if defined(_ANSK12) || defined(RK12_AN) || defined(__DOXYGEN__)
22130 # define CONFIG_RK12_AS_ANALOG() \
22131  do { \
22132  ENABLE_RK12_ANALOG(); \
22133  CONFIG_RK12_AS_INPUT(); \
22134  DISABLE_RK12_OPENDRAIN(); \
22135  DISABLE_RK12_PULLUP(); \
22136  DISABLE_RK12_PULLDOWN(); \
22137  } while (0)
22138 # endif
22139 
22140 /** This macro disables open-drain and pullups/downs,
22141  * configures pin RK12 for digital (not analog) operation, and
22142  * configures the pin as an input.
22143  */
22144 # define CONFIG_RK12_AS_DIG_INPUT() \
22145  do { \
22146  DISABLE_RK12_ANALOG(); \
22147  CONFIG_RK12_AS_INPUT(); \
22148  DISABLE_RK12_OPENDRAIN(); \
22149  DISABLE_RK12_PULLUP(); \
22150  DISABLE_RK12_PULLDOWN(); \
22151  } while (0)
22152 
22153 /** This macro disables open-drain and pullups/downs,
22154  * configures pin RK12 for digital (not analog) operation, and
22155  * configures the pin as an output.
22156  */
22157 # define CONFIG_RK12_AS_DIG_OUTPUT() \
22158  do { \
22159  DISABLE_RK12_ANALOG(); \
22160  CONFIG_RK12_AS_OUTPUT(); \
22161  DISABLE_RK12_OPENDRAIN(); \
22162  DISABLE_RK12_PULLUP(); \
22163  DISABLE_RK12_PULLDOWN(); \
22164  } while (0)
22165 
22166 #endif // #if defined(_RK12) || defined(__DOXYGEN__): Provide GPIO for RK12
22167 
22168 
22169 
22170 
22171 
22172 // Provide GPIO for RK13
22173 // ====================
22174 #if defined(_RK13) || defined(__DOXYGEN__)
22175 
22176 // Dummy macros for documentation only
22177 # ifdef __DOXYGEN__
22178 /// This macro specifies the RPy value associated with pin RK13.
22179 /// Its device-specific definition is given in pic24_ports_mapping.h.
22180 # define RK13_RP xx
22181 
22182 /// This macro specifies the ANn value associated with pin RK13.
22183 /// Its device-specific definition is given in pic24_ports_mapping.h.
22184 # define RK13_AN xx
22185 
22186 /// This macro specifies the CNm value associated with pin RK13.
22187 /// Its device-specific definition is given in pic24_ports_mapping.h.
22188 # define RK13_CN xx
22189 
22190 //@}
22191 # endif // #ifdef __DOXYGEN__
22192 
22193 
22194 // Low-level config
22195 // ----------------
22196 // Analog:
22197 # if defined(_ANSK13) || defined(__DOXYGEN__)
22198 /// Enable analog functionality on pin RK13.
22199 # define ENABLE_RK13_ANALOG() (_ANSK13 = 1)
22200 /// Disable analog functionality on pin RK13.
22201 # define DISABLE_RK13_ANALOG() (_ANSK13 = 0)
22202 # elif defined(RK13_AN)
22203 # define ENABLE_RK13_ANALOG() (RXY_GPIO_PCFG(RK13_AN) = 0)
22204 # define DISABLE_RK13_ANALOG() (RXY_GPIO_PCFG(RK13_AN) = 1)
22205 # else
22206 # define DISABLE_RK13_ANALOG() ((void) 0)
22207 # endif
22208 
22209 // Input/output:
22210 /// Configure pin RK13 as an input.
22211 # define CONFIG_RK13_AS_INPUT() (_TRISK13 = 1)
22212 /// Configure pin RK13 as an output.
22213 # define CONFIG_RK13_AS_OUTPUT() (_TRISK13 = 0)
22214 
22215 // Open-drain:
22216 # if defined(_ODCK13) || defined(__DOXYGEN__)
22217 /// Enable the open-drain driver on pin RK13.
22218 # define ENABLE_RK13_OPENDRAIN() (_ODCK13 = 1)
22219 /// Disable the open-drain driver on pin RK13.
22220 # define DISABLE_RK13_OPENDRAIN() (_ODCK13 = 0)
22221 # elif defined(_ODK13) // The PIF24F names this bit _OD instead of _ODC.
22222 # define ENABLE_RK13_OPENDRAIN() (_ODK13 = 1)
22223 # define DISABLE_RK13_OPENDRAIN() (_ODK13 = 0)
22224 # else
22225 # define DISABLE_RK13_OPENDRAIN() ((void) 0)
22226 # endif
22227 
22228 // Change notification, pullups and pulldowns:
22229 # if defined(_CNIEK13) || defined(__DOXYGEN__)
22230 /// Enable the pullup on pin RK13.
22231 # define ENABLE_RK13_PULLUP() (_CNPUK13 = 1)
22232 /// Disable the pullup on pin RK13.
22233 # define DISABLE_RK13_PULLUP() (_CNPUK13 = 0)
22234 
22235 /// Enable the pulldown on pin RK13.
22236 # define ENABLE_RK13_PULLDOWN() (_CNPDK13 = 1)
22237 /// Disable the pulldown on pin RK13.
22238 # define DISABLE_RK13_PULLDOWN() (_CNPDK13 = 0)
22239 
22240 /// Enable the change notification interrupt on pin RK13.
22241 # define ENABLE_RK13_CN_INTERRUPT() (_CNIEK13 = 1)
22242 /// Disable the change notification interrupt on pin RK13.
22243 # define DISABLE_RK13_CN_INTERRUPT() (_CNIEK13 = 0)
22244 
22245 # elif defined(RK13_CN)
22246 # define ENABLE_RK13_PULLUP() (RXY_GPIO_CNPUE(RK13_CN) = 1)
22247 # define DISABLE_RK13_PULLUP() (RXY_GPIO_CNPUE(RK13_CN) = 0)
22248 
22249 # if RXY_HAS_CNPDE(RK13_CN)
22250 # define ENABLE_RK13_PULLDOWN() (RXY_GPIO_CNPDE(RK13_CN) = 1)
22251 # define DISABLE_RK13_PULLDOWN() (RXY_GPIO_CNPDE(RK13_CN) = 0)
22252 # else
22253 # define DISABLE_RK13_PULLDOWN() ((void) 0)
22254 # endif
22255 
22256 # define ENABLE_RK13_CN_INTERRUPT() (RXY_GPIO_CNIE(RK13_CN) = 1)
22257 # define DISABLE_RK13_CN_INTERRUPT() (RXY_GPIO_CNIE(RK13_CN) = 0)
22258 
22259 # else
22260 # define DISABLE_RK13_PULLUP() ((void) 0)
22261 # define DISABLE_RK13_PULLDOWN() ((void) 0)
22262 # define DISABLE_RK13_CN_INTERRUPT() ((void) 0)
22263 # endif
22264 
22265 // High-level config
22266 // -----------------
22267 /** This macro disables pullups/downs, enables analog functionality, and configures
22268  * pin RK13 as an input.
22269  */
22270 # if defined(_ANSK13) || defined(RK13_AN) || defined(__DOXYGEN__)
22271 # define CONFIG_RK13_AS_ANALOG() \
22272  do { \
22273  ENABLE_RK13_ANALOG(); \
22274  CONFIG_RK13_AS_INPUT(); \
22275  DISABLE_RK13_OPENDRAIN(); \
22276  DISABLE_RK13_PULLUP(); \
22277  DISABLE_RK13_PULLDOWN(); \
22278  } while (0)
22279 # endif
22280 
22281 /** This macro disables open-drain and pullups/downs,
22282  * configures pin RK13 for digital (not analog) operation, and
22283  * configures the pin as an input.
22284  */
22285 # define CONFIG_RK13_AS_DIG_INPUT() \
22286  do { \
22287  DISABLE_RK13_ANALOG(); \
22288  CONFIG_RK13_AS_INPUT(); \
22289  DISABLE_RK13_OPENDRAIN(); \
22290  DISABLE_RK13_PULLUP(); \
22291  DISABLE_RK13_PULLDOWN(); \
22292  } while (0)
22293 
22294 /** This macro disables open-drain and pullups/downs,
22295  * configures pin RK13 for digital (not analog) operation, and
22296  * configures the pin as an output.
22297  */
22298 # define CONFIG_RK13_AS_DIG_OUTPUT() \
22299  do { \
22300  DISABLE_RK13_ANALOG(); \
22301  CONFIG_RK13_AS_OUTPUT(); \
22302  DISABLE_RK13_OPENDRAIN(); \
22303  DISABLE_RK13_PULLUP(); \
22304  DISABLE_RK13_PULLDOWN(); \
22305  } while (0)
22306 
22307 #endif // #if defined(_RK13) || defined(__DOXYGEN__): Provide GPIO for RK13
22308 
22309 
22310 
22311 
22312 
22313 // Provide GPIO for RK14
22314 // ====================
22315 #if defined(_RK14) || defined(__DOXYGEN__)
22316 
22317 // Dummy macros for documentation only
22318 # ifdef __DOXYGEN__
22319 /// This macro specifies the RPy value associated with pin RK14.
22320 /// Its device-specific definition is given in pic24_ports_mapping.h.
22321 # define RK14_RP xx
22322 
22323 /// This macro specifies the ANn value associated with pin RK14.
22324 /// Its device-specific definition is given in pic24_ports_mapping.h.
22325 # define RK14_AN xx
22326 
22327 /// This macro specifies the CNm value associated with pin RK14.
22328 /// Its device-specific definition is given in pic24_ports_mapping.h.
22329 # define RK14_CN xx
22330 
22331 //@}
22332 # endif // #ifdef __DOXYGEN__
22333 
22334 
22335 // Low-level config
22336 // ----------------
22337 // Analog:
22338 # if defined(_ANSK14) || defined(__DOXYGEN__)
22339 /// Enable analog functionality on pin RK14.
22340 # define ENABLE_RK14_ANALOG() (_ANSK14 = 1)
22341 /// Disable analog functionality on pin RK14.
22342 # define DISABLE_RK14_ANALOG() (_ANSK14 = 0)
22343 # elif defined(RK14_AN)
22344 # define ENABLE_RK14_ANALOG() (RXY_GPIO_PCFG(RK14_AN) = 0)
22345 # define DISABLE_RK14_ANALOG() (RXY_GPIO_PCFG(RK14_AN) = 1)
22346 # else
22347 # define DISABLE_RK14_ANALOG() ((void) 0)
22348 # endif
22349 
22350 // Input/output:
22351 /// Configure pin RK14 as an input.
22352 # define CONFIG_RK14_AS_INPUT() (_TRISK14 = 1)
22353 /// Configure pin RK14 as an output.
22354 # define CONFIG_RK14_AS_OUTPUT() (_TRISK14 = 0)
22355 
22356 // Open-drain:
22357 # if defined(_ODCK14) || defined(__DOXYGEN__)
22358 /// Enable the open-drain driver on pin RK14.
22359 # define ENABLE_RK14_OPENDRAIN() (_ODCK14 = 1)
22360 /// Disable the open-drain driver on pin RK14.
22361 # define DISABLE_RK14_OPENDRAIN() (_ODCK14 = 0)
22362 # elif defined(_ODK14) // The PIF24F names this bit _OD instead of _ODC.
22363 # define ENABLE_RK14_OPENDRAIN() (_ODK14 = 1)
22364 # define DISABLE_RK14_OPENDRAIN() (_ODK14 = 0)
22365 # else
22366 # define DISABLE_RK14_OPENDRAIN() ((void) 0)
22367 # endif
22368 
22369 // Change notification, pullups and pulldowns:
22370 # if defined(_CNIEK14) || defined(__DOXYGEN__)
22371 /// Enable the pullup on pin RK14.
22372 # define ENABLE_RK14_PULLUP() (_CNPUK14 = 1)
22373 /// Disable the pullup on pin RK14.
22374 # define DISABLE_RK14_PULLUP() (_CNPUK14 = 0)
22375 
22376 /// Enable the pulldown on pin RK14.
22377 # define ENABLE_RK14_PULLDOWN() (_CNPDK14 = 1)
22378 /// Disable the pulldown on pin RK14.
22379 # define DISABLE_RK14_PULLDOWN() (_CNPDK14 = 0)
22380 
22381 /// Enable the change notification interrupt on pin RK14.
22382 # define ENABLE_RK14_CN_INTERRUPT() (_CNIEK14 = 1)
22383 /// Disable the change notification interrupt on pin RK14.
22384 # define DISABLE_RK14_CN_INTERRUPT() (_CNIEK14 = 0)
22385 
22386 # elif defined(RK14_CN)
22387 # define ENABLE_RK14_PULLUP() (RXY_GPIO_CNPUE(RK14_CN) = 1)
22388 # define DISABLE_RK14_PULLUP() (RXY_GPIO_CNPUE(RK14_CN) = 0)
22389 
22390 # if RXY_HAS_CNPDE(RK14_CN)
22391 # define ENABLE_RK14_PULLDOWN() (RXY_GPIO_CNPDE(RK14_CN) = 1)
22392 # define DISABLE_RK14_PULLDOWN() (RXY_GPIO_CNPDE(RK14_CN) = 0)
22393 # else
22394 # define DISABLE_RK14_PULLDOWN() ((void) 0)
22395 # endif
22396 
22397 # define ENABLE_RK14_CN_INTERRUPT() (RXY_GPIO_CNIE(RK14_CN) = 1)
22398 # define DISABLE_RK14_CN_INTERRUPT() (RXY_GPIO_CNIE(RK14_CN) = 0)
22399 
22400 # else
22401 # define DISABLE_RK14_PULLUP() ((void) 0)
22402 # define DISABLE_RK14_PULLDOWN() ((void) 0)
22403 # define DISABLE_RK14_CN_INTERRUPT() ((void) 0)
22404 # endif
22405 
22406 // High-level config
22407 // -----------------
22408 /** This macro disables pullups/downs, enables analog functionality, and configures
22409  * pin RK14 as an input.
22410  */
22411 # if defined(_ANSK14) || defined(RK14_AN) || defined(__DOXYGEN__)
22412 # define CONFIG_RK14_AS_ANALOG() \
22413  do { \
22414  ENABLE_RK14_ANALOG(); \
22415  CONFIG_RK14_AS_INPUT(); \
22416  DISABLE_RK14_OPENDRAIN(); \
22417  DISABLE_RK14_PULLUP(); \
22418  DISABLE_RK14_PULLDOWN(); \
22419  } while (0)
22420 # endif
22421 
22422 /** This macro disables open-drain and pullups/downs,
22423  * configures pin RK14 for digital (not analog) operation, and
22424  * configures the pin as an input.
22425  */
22426 # define CONFIG_RK14_AS_DIG_INPUT() \
22427  do { \
22428  DISABLE_RK14_ANALOG(); \
22429  CONFIG_RK14_AS_INPUT(); \
22430  DISABLE_RK14_OPENDRAIN(); \
22431  DISABLE_RK14_PULLUP(); \
22432  DISABLE_RK14_PULLDOWN(); \
22433  } while (0)
22434 
22435 /** This macro disables open-drain and pullups/downs,
22436  * configures pin RK14 for digital (not analog) operation, and
22437  * configures the pin as an output.
22438  */
22439 # define CONFIG_RK14_AS_DIG_OUTPUT() \
22440  do { \
22441  DISABLE_RK14_ANALOG(); \
22442  CONFIG_RK14_AS_OUTPUT(); \
22443  DISABLE_RK14_OPENDRAIN(); \
22444  DISABLE_RK14_PULLUP(); \
22445  DISABLE_RK14_PULLDOWN(); \
22446  } while (0)
22447 
22448 #endif // #if defined(_RK14) || defined(__DOXYGEN__): Provide GPIO for RK14
22449 
22450 
22451 
22452 
22453 
22454 // Provide GPIO for RK15
22455 // ====================
22456 #if defined(_RK15) || defined(__DOXYGEN__)
22457 
22458 // Dummy macros for documentation only
22459 # ifdef __DOXYGEN__
22460 /// This macro specifies the RPy value associated with pin RK15.
22461 /// Its device-specific definition is given in pic24_ports_mapping.h.
22462 # define RK15_RP xx
22463 
22464 /// This macro specifies the ANn value associated with pin RK15.
22465 /// Its device-specific definition is given in pic24_ports_mapping.h.
22466 # define RK15_AN xx
22467 
22468 /// This macro specifies the CNm value associated with pin RK15.
22469 /// Its device-specific definition is given in pic24_ports_mapping.h.
22470 # define RK15_CN xx
22471 
22472 //@}
22473 # endif // #ifdef __DOXYGEN__
22474 
22475 
22476 // Low-level config
22477 // ----------------
22478 // Analog:
22479 # if defined(_ANSK15) || defined(__DOXYGEN__)
22480 /// Enable analog functionality on pin RK15.
22481 # define ENABLE_RK15_ANALOG() (_ANSK15 = 1)
22482 /// Disable analog functionality on pin RK15.
22483 # define DISABLE_RK15_ANALOG() (_ANSK15 = 0)
22484 # elif defined(RK15_AN)
22485 # define ENABLE_RK15_ANALOG() (RXY_GPIO_PCFG(RK15_AN) = 0)
22486 # define DISABLE_RK15_ANALOG() (RXY_GPIO_PCFG(RK15_AN) = 1)
22487 # else
22488 # define DISABLE_RK15_ANALOG() ((void) 0)
22489 # endif
22490 
22491 // Input/output:
22492 /// Configure pin RK15 as an input.
22493 # define CONFIG_RK15_AS_INPUT() (_TRISK15 = 1)
22494 /// Configure pin RK15 as an output.
22495 # define CONFIG_RK15_AS_OUTPUT() (_TRISK15 = 0)
22496 
22497 // Open-drain:
22498 # if defined(_ODCK15) || defined(__DOXYGEN__)
22499 /// Enable the open-drain driver on pin RK15.
22500 # define ENABLE_RK15_OPENDRAIN() (_ODCK15 = 1)
22501 /// Disable the open-drain driver on pin RK15.
22502 # define DISABLE_RK15_OPENDRAIN() (_ODCK15 = 0)
22503 # elif defined(_ODK15) // The PIF24F names this bit _OD instead of _ODC.
22504 # define ENABLE_RK15_OPENDRAIN() (_ODK15 = 1)
22505 # define DISABLE_RK15_OPENDRAIN() (_ODK15 = 0)
22506 # else
22507 # define DISABLE_RK15_OPENDRAIN() ((void) 0)
22508 # endif
22509 
22510 // Change notification, pullups and pulldowns:
22511 # if defined(_CNIEK15) || defined(__DOXYGEN__)
22512 /// Enable the pullup on pin RK15.
22513 # define ENABLE_RK15_PULLUP() (_CNPUK15 = 1)
22514 /// Disable the pullup on pin RK15.
22515 # define DISABLE_RK15_PULLUP() (_CNPUK15 = 0)
22516 
22517 /// Enable the pulldown on pin RK15.
22518 # define ENABLE_RK15_PULLDOWN() (_CNPDK15 = 1)
22519 /// Disable the pulldown on pin RK15.
22520 # define DISABLE_RK15_PULLDOWN() (_CNPDK15 = 0)
22521 
22522 /// Enable the change notification interrupt on pin RK15.
22523 # define ENABLE_RK15_CN_INTERRUPT() (_CNIEK15 = 1)
22524 /// Disable the change notification interrupt on pin RK15.
22525 # define DISABLE_RK15_CN_INTERRUPT() (_CNIEK15 = 0)
22526 
22527 # elif defined(RK15_CN)
22528 # define ENABLE_RK15_PULLUP() (RXY_GPIO_CNPUE(RK15_CN) = 1)
22529 # define DISABLE_RK15_PULLUP() (RXY_GPIO_CNPUE(RK15_CN) = 0)
22530 
22531 # if RXY_HAS_CNPDE(RK15_CN)
22532 # define ENABLE_RK15_PULLDOWN() (RXY_GPIO_CNPDE(RK15_CN) = 1)
22533 # define DISABLE_RK15_PULLDOWN() (RXY_GPIO_CNPDE(RK15_CN) = 0)
22534 # else
22535 # define DISABLE_RK15_PULLDOWN() ((void) 0)
22536 # endif
22537 
22538 # define ENABLE_RK15_CN_INTERRUPT() (RXY_GPIO_CNIE(RK15_CN) = 1)
22539 # define DISABLE_RK15_CN_INTERRUPT() (RXY_GPIO_CNIE(RK15_CN) = 0)
22540 
22541 # else
22542 # define DISABLE_RK15_PULLUP() ((void) 0)
22543 # define DISABLE_RK15_PULLDOWN() ((void) 0)
22544 # define DISABLE_RK15_CN_INTERRUPT() ((void) 0)
22545 # endif
22546 
22547 // High-level config
22548 // -----------------
22549 /** This macro disables pullups/downs, enables analog functionality, and configures
22550  * pin RK15 as an input.
22551  */
22552 # if defined(_ANSK15) || defined(RK15_AN) || defined(__DOXYGEN__)
22553 # define CONFIG_RK15_AS_ANALOG() \
22554  do { \
22555  ENABLE_RK15_ANALOG(); \
22556  CONFIG_RK15_AS_INPUT(); \
22557  DISABLE_RK15_OPENDRAIN(); \
22558  DISABLE_RK15_PULLUP(); \
22559  DISABLE_RK15_PULLDOWN(); \
22560  } while (0)
22561 # endif
22562 
22563 /** This macro disables open-drain and pullups/downs,
22564  * configures pin RK15 for digital (not analog) operation, and
22565  * configures the pin as an input.
22566  */
22567 # define CONFIG_RK15_AS_DIG_INPUT() \
22568  do { \
22569  DISABLE_RK15_ANALOG(); \
22570  CONFIG_RK15_AS_INPUT(); \
22571  DISABLE_RK15_OPENDRAIN(); \
22572  DISABLE_RK15_PULLUP(); \
22573  DISABLE_RK15_PULLDOWN(); \
22574  } while (0)
22575 
22576 /** This macro disables open-drain and pullups/downs,
22577  * configures pin RK15 for digital (not analog) operation, and
22578  * configures the pin as an output.
22579  */
22580 # define CONFIG_RK15_AS_DIG_OUTPUT() \
22581  do { \
22582  DISABLE_RK15_ANALOG(); \
22583  CONFIG_RK15_AS_OUTPUT(); \
22584  DISABLE_RK15_OPENDRAIN(); \
22585  DISABLE_RK15_PULLUP(); \
22586  DISABLE_RK15_PULLDOWN(); \
22587  } while (0)
22588 
22589 #endif // #if defined(_RK15) || defined(__DOXYGEN__): Provide GPIO for RK15
22590 
22591 
22592 
22593 
22594 
22595 // Provide GPIO for RT1
22596 // ====================
22597 #if defined(_RT1) || defined(__DOXYGEN__)
22598 
22599 // Dummy macros for documentation only
22600 # ifdef __DOXYGEN__
22601 /// This macro specifies the RPy value associated with pin RT1.
22602 /// Its device-specific definition is given in pic24_ports_mapping.h.
22603 # define RT1_RP xx
22604 
22605 /// This macro specifies the ANn value associated with pin RT1.
22606 /// Its device-specific definition is given in pic24_ports_mapping.h.
22607 # define RT1_AN xx
22608 
22609 /// This macro specifies the CNm value associated with pin RT1.
22610 /// Its device-specific definition is given in pic24_ports_mapping.h.
22611 # define RT1_CN xx
22612 
22613 //@}
22614 # endif // #ifdef __DOXYGEN__
22615 
22616 
22617 // Low-level config
22618 // ----------------
22619 // Analog:
22620 # if defined(_ANST1) || defined(__DOXYGEN__)
22621 /// Enable analog functionality on pin RT1.
22622 # define ENABLE_RT1_ANALOG() (_ANST1 = 1)
22623 /// Disable analog functionality on pin RT1.
22624 # define DISABLE_RT1_ANALOG() (_ANST1 = 0)
22625 # elif defined(RT1_AN)
22626 # define ENABLE_RT1_ANALOG() (RXY_GPIO_PCFG(RT1_AN) = 0)
22627 # define DISABLE_RT1_ANALOG() (RXY_GPIO_PCFG(RT1_AN) = 1)
22628 # else
22629 # define DISABLE_RT1_ANALOG() ((void) 0)
22630 # endif
22631 
22632 // Input/output:
22633 /// Configure pin RT1 as an input.
22634 # define CONFIG_RT1_AS_INPUT() (_TRIST1 = 1)
22635 /// Configure pin RT1 as an output.
22636 # define CONFIG_RT1_AS_OUTPUT() (_TRIST1 = 0)
22637 
22638 // Open-drain:
22639 # if defined(_ODCT1) || defined(__DOXYGEN__)
22640 /// Enable the open-drain driver on pin RT1.
22641 # define ENABLE_RT1_OPENDRAIN() (_ODCT1 = 1)
22642 /// Disable the open-drain driver on pin RT1.
22643 # define DISABLE_RT1_OPENDRAIN() (_ODCT1 = 0)
22644 # elif defined(_ODT1) // The PIF24F names this bit _OD instead of _ODC.
22645 # define ENABLE_RT1_OPENDRAIN() (_ODT1 = 1)
22646 # define DISABLE_RT1_OPENDRAIN() (_ODT1 = 0)
22647 # else
22648 # define DISABLE_RT1_OPENDRAIN() ((void) 0)
22649 # endif
22650 
22651 // Change notification, pullups and pulldowns:
22652 # if defined(_CNIET1) || defined(__DOXYGEN__)
22653 /// Enable the pullup on pin RT1.
22654 # define ENABLE_RT1_PULLUP() (_CNPUT1 = 1)
22655 /// Disable the pullup on pin RT1.
22656 # define DISABLE_RT1_PULLUP() (_CNPUT1 = 0)
22657 
22658 /// Enable the pulldown on pin RT1.
22659 # define ENABLE_RT1_PULLDOWN() (_CNPDT1 = 1)
22660 /// Disable the pulldown on pin RT1.
22661 # define DISABLE_RT1_PULLDOWN() (_CNPDT1 = 0)
22662 
22663 /// Enable the change notification interrupt on pin RT1.
22664 # define ENABLE_RT1_CN_INTERRUPT() (_CNIET1 = 1)
22665 /// Disable the change notification interrupt on pin RT1.
22666 # define DISABLE_RT1_CN_INTERRUPT() (_CNIET1 = 0)
22667 
22668 # elif defined(RT1_CN)
22669 # define ENABLE_RT1_PULLUP() (RXY_GPIO_CNPUE(RT1_CN) = 1)
22670 # define DISABLE_RT1_PULLUP() (RXY_GPIO_CNPUE(RT1_CN) = 0)
22671 
22672 # if RXY_HAS_CNPDE(RT1_CN)
22673 # define ENABLE_RT1_PULLDOWN() (RXY_GPIO_CNPDE(RT1_CN) = 1)
22674 # define DISABLE_RT1_PULLDOWN() (RXY_GPIO_CNPDE(RT1_CN) = 0)
22675 # else
22676 # define DISABLE_RT1_PULLDOWN() ((void) 0)
22677 # endif
22678 
22679 # define ENABLE_RT1_CN_INTERRUPT() (RXY_GPIO_CNIE(RT1_CN) = 1)
22680 # define DISABLE_RT1_CN_INTERRUPT() (RXY_GPIO_CNIE(RT1_CN) = 0)
22681 
22682 # else
22683 # define DISABLE_RT1_PULLUP() ((void) 0)
22684 # define DISABLE_RT1_PULLDOWN() ((void) 0)
22685 # define DISABLE_RT1_CN_INTERRUPT() ((void) 0)
22686 # endif
22687 
22688 // High-level config
22689 // -----------------
22690 /** This macro disables pullups/downs, enables analog functionality, and configures
22691  * pin RT1 as an input.
22692  */
22693 # if defined(_ANST1) || defined(RT1_AN) || defined(__DOXYGEN__)
22694 # define CONFIG_RT1_AS_ANALOG() \
22695  do { \
22696  ENABLE_RT1_ANALOG(); \
22697  CONFIG_RT1_AS_INPUT(); \
22698  DISABLE_RT1_OPENDRAIN(); \
22699  DISABLE_RT1_PULLUP(); \
22700  DISABLE_RT1_PULLDOWN(); \
22701  } while (0)
22702 # endif
22703 
22704 /** This macro disables open-drain and pullups/downs,
22705  * configures pin RT1 for digital (not analog) operation, and
22706  * configures the pin as an input.
22707  */
22708 # define CONFIG_RT1_AS_DIG_INPUT() \
22709  do { \
22710  DISABLE_RT1_ANALOG(); \
22711  CONFIG_RT1_AS_INPUT(); \
22712  DISABLE_RT1_OPENDRAIN(); \
22713  DISABLE_RT1_PULLUP(); \
22714  DISABLE_RT1_PULLDOWN(); \
22715  } while (0)
22716 
22717 /** This macro disables open-drain and pullups/downs,
22718  * configures pin RT1 for digital (not analog) operation, and
22719  * configures the pin as an output.
22720  */
22721 # define CONFIG_RT1_AS_DIG_OUTPUT() \
22722  do { \
22723  DISABLE_RT1_ANALOG(); \
22724  CONFIG_RT1_AS_OUTPUT(); \
22725  DISABLE_RT1_OPENDRAIN(); \
22726  DISABLE_RT1_PULLUP(); \
22727  DISABLE_RT1_PULLDOWN(); \
22728  } while (0)
22729 
22730 #endif // #if defined(_RT1) || defined(__DOXYGEN__): Provide GPIO for RT1
22731 
22732 
22733 
22734 
22735 
22736 // Provide GPIO for RT2
22737 // ====================
22738 #if defined(_RT2) || defined(__DOXYGEN__)
22739 
22740 // Dummy macros for documentation only
22741 # ifdef __DOXYGEN__
22742 /// This macro specifies the RPy value associated with pin RT2.
22743 /// Its device-specific definition is given in pic24_ports_mapping.h.
22744 # define RT2_RP xx
22745 
22746 /// This macro specifies the ANn value associated with pin RT2.
22747 /// Its device-specific definition is given in pic24_ports_mapping.h.
22748 # define RT2_AN xx
22749 
22750 /// This macro specifies the CNm value associated with pin RT2.
22751 /// Its device-specific definition is given in pic24_ports_mapping.h.
22752 # define RT2_CN xx
22753 
22754 //@}
22755 # endif // #ifdef __DOXYGEN__
22756 
22757 
22758 // Low-level config
22759 // ----------------
22760 // Analog:
22761 # if defined(_ANST2) || defined(__DOXYGEN__)
22762 /// Enable analog functionality on pin RT2.
22763 # define ENABLE_RT2_ANALOG() (_ANST2 = 1)
22764 /// Disable analog functionality on pin RT2.
22765 # define DISABLE_RT2_ANALOG() (_ANST2 = 0)
22766 # elif defined(RT2_AN)
22767 # define ENABLE_RT2_ANALOG() (RXY_GPIO_PCFG(RT2_AN) = 0)
22768 # define DISABLE_RT2_ANALOG() (RXY_GPIO_PCFG(RT2_AN) = 1)
22769 # else
22770 # define DISABLE_RT2_ANALOG() ((void) 0)
22771 # endif
22772 
22773 // Input/output:
22774 /// Configure pin RT2 as an input.
22775 # define CONFIG_RT2_AS_INPUT() (_TRIST2 = 1)
22776 /// Configure pin RT2 as an output.
22777 # define CONFIG_RT2_AS_OUTPUT() (_TRIST2 = 0)
22778 
22779 // Open-drain:
22780 # if defined(_ODCT2) || defined(__DOXYGEN__)
22781 /// Enable the open-drain driver on pin RT2.
22782 # define ENABLE_RT2_OPENDRAIN() (_ODCT2 = 1)
22783 /// Disable the open-drain driver on pin RT2.
22784 # define DISABLE_RT2_OPENDRAIN() (_ODCT2 = 0)
22785 # elif defined(_ODT2) // The PIF24F names this bit _OD instead of _ODC.
22786 # define ENABLE_RT2_OPENDRAIN() (_ODT2 = 1)
22787 # define DISABLE_RT2_OPENDRAIN() (_ODT2 = 0)
22788 # else
22789 # define DISABLE_RT2_OPENDRAIN() ((void) 0)
22790 # endif
22791 
22792 // Change notification, pullups and pulldowns:
22793 # if defined(_CNIET2) || defined(__DOXYGEN__)
22794 /// Enable the pullup on pin RT2.
22795 # define ENABLE_RT2_PULLUP() (_CNPUT2 = 1)
22796 /// Disable the pullup on pin RT2.
22797 # define DISABLE_RT2_PULLUP() (_CNPUT2 = 0)
22798 
22799 /// Enable the pulldown on pin RT2.
22800 # define ENABLE_RT2_PULLDOWN() (_CNPDT2 = 1)
22801 /// Disable the pulldown on pin RT2.
22802 # define DISABLE_RT2_PULLDOWN() (_CNPDT2 = 0)
22803 
22804 /// Enable the change notification interrupt on pin RT2.
22805 # define ENABLE_RT2_CN_INTERRUPT() (_CNIET2 = 1)
22806 /// Disable the change notification interrupt on pin RT2.
22807 # define DISABLE_RT2_CN_INTERRUPT() (_CNIET2 = 0)
22808 
22809 # elif defined(RT2_CN)
22810 # define ENABLE_RT2_PULLUP() (RXY_GPIO_CNPUE(RT2_CN) = 1)
22811 # define DISABLE_RT2_PULLUP() (RXY_GPIO_CNPUE(RT2_CN) = 0)
22812 
22813 # if RXY_HAS_CNPDE(RT2_CN)
22814 # define ENABLE_RT2_PULLDOWN() (RXY_GPIO_CNPDE(RT2_CN) = 1)
22815 # define DISABLE_RT2_PULLDOWN() (RXY_GPIO_CNPDE(RT2_CN) = 0)
22816 # else
22817 # define DISABLE_RT2_PULLDOWN() ((void) 0)
22818 # endif
22819 
22820 # define ENABLE_RT2_CN_INTERRUPT() (RXY_GPIO_CNIE(RT2_CN) = 1)
22821 # define DISABLE_RT2_CN_INTERRUPT() (RXY_GPIO_CNIE(RT2_CN) = 0)
22822 
22823 # else
22824 # define DISABLE_RT2_PULLUP() ((void) 0)
22825 # define DISABLE_RT2_PULLDOWN() ((void) 0)
22826 # define DISABLE_RT2_CN_INTERRUPT() ((void) 0)
22827 # endif
22828 
22829 // High-level config
22830 // -----------------
22831 /** This macro disables pullups/downs, enables analog functionality, and configures
22832  * pin RT2 as an input.
22833  */
22834 # if defined(_ANST2) || defined(RT2_AN) || defined(__DOXYGEN__)
22835 # define CONFIG_RT2_AS_ANALOG() \
22836  do { \
22837  ENABLE_RT2_ANALOG(); \
22838  CONFIG_RT2_AS_INPUT(); \
22839  DISABLE_RT2_OPENDRAIN(); \
22840  DISABLE_RT2_PULLUP(); \
22841  DISABLE_RT2_PULLDOWN(); \
22842  } while (0)
22843 # endif
22844 
22845 /** This macro disables open-drain and pullups/downs,
22846  * configures pin RT2 for digital (not analog) operation, and
22847  * configures the pin as an input.
22848  */
22849 # define CONFIG_RT2_AS_DIG_INPUT() \
22850  do { \
22851  DISABLE_RT2_ANALOG(); \
22852  CONFIG_RT2_AS_INPUT(); \
22853  DISABLE_RT2_OPENDRAIN(); \
22854  DISABLE_RT2_PULLUP(); \
22855  DISABLE_RT2_PULLDOWN(); \
22856  } while (0)
22857 
22858 /** This macro disables open-drain and pullups/downs,
22859  * configures pin RT2 for digital (not analog) operation, and
22860  * configures the pin as an output.
22861  */
22862 # define CONFIG_RT2_AS_DIG_OUTPUT() \
22863  do { \
22864  DISABLE_RT2_ANALOG(); \
22865  CONFIG_RT2_AS_OUTPUT(); \
22866  DISABLE_RT2_OPENDRAIN(); \
22867  DISABLE_RT2_PULLUP(); \
22868  DISABLE_RT2_PULLDOWN(); \
22869  } while (0)
22870 
22871 #endif // #if defined(_RT2) || defined(__DOXYGEN__): Provide GPIO for RT2
22872 
22873 
22874 
22875 
22876 
22877 // Provide GPIO for RT3
22878 // ====================
22879 #if defined(_RT3) || defined(__DOXYGEN__)
22880 
22881 // Dummy macros for documentation only
22882 # ifdef __DOXYGEN__
22883 /// This macro specifies the RPy value associated with pin RT3.
22884 /// Its device-specific definition is given in pic24_ports_mapping.h.
22885 # define RT3_RP xx
22886 
22887 /// This macro specifies the ANn value associated with pin RT3.
22888 /// Its device-specific definition is given in pic24_ports_mapping.h.
22889 # define RT3_AN xx
22890 
22891 /// This macro specifies the CNm value associated with pin RT3.
22892 /// Its device-specific definition is given in pic24_ports_mapping.h.
22893 # define RT3_CN xx
22894 
22895 //@}
22896 # endif // #ifdef __DOXYGEN__
22897 
22898 
22899 // Low-level config
22900 // ----------------
22901 // Analog:
22902 # if defined(_ANST3) || defined(__DOXYGEN__)
22903 /// Enable analog functionality on pin RT3.
22904 # define ENABLE_RT3_ANALOG() (_ANST3 = 1)
22905 /// Disable analog functionality on pin RT3.
22906 # define DISABLE_RT3_ANALOG() (_ANST3 = 0)
22907 # elif defined(RT3_AN)
22908 # define ENABLE_RT3_ANALOG() (RXY_GPIO_PCFG(RT3_AN) = 0)
22909 # define DISABLE_RT3_ANALOG() (RXY_GPIO_PCFG(RT3_AN) = 1)
22910 # else
22911 # define DISABLE_RT3_ANALOG() ((void) 0)
22912 # endif
22913 
22914 // Input/output:
22915 /// Configure pin RT3 as an input.
22916 # define CONFIG_RT3_AS_INPUT() (_TRIST3 = 1)
22917 /// Configure pin RT3 as an output.
22918 # define CONFIG_RT3_AS_OUTPUT() (_TRIST3 = 0)
22919 
22920 // Open-drain:
22921 # if defined(_ODCT3) || defined(__DOXYGEN__)
22922 /// Enable the open-drain driver on pin RT3.
22923 # define ENABLE_RT3_OPENDRAIN() (_ODCT3 = 1)
22924 /// Disable the open-drain driver on pin RT3.
22925 # define DISABLE_RT3_OPENDRAIN() (_ODCT3 = 0)
22926 # elif defined(_ODT3) // The PIF24F names this bit _OD instead of _ODC.
22927 # define ENABLE_RT3_OPENDRAIN() (_ODT3 = 1)
22928 # define DISABLE_RT3_OPENDRAIN() (_ODT3 = 0)
22929 # else
22930 # define DISABLE_RT3_OPENDRAIN() ((void) 0)
22931 # endif
22932 
22933 // Change notification, pullups and pulldowns:
22934 # if defined(_CNIET3) || defined(__DOXYGEN__)
22935 /// Enable the pullup on pin RT3.
22936 # define ENABLE_RT3_PULLUP() (_CNPUT3 = 1)
22937 /// Disable the pullup on pin RT3.
22938 # define DISABLE_RT3_PULLUP() (_CNPUT3 = 0)
22939 
22940 /// Enable the pulldown on pin RT3.
22941 # define ENABLE_RT3_PULLDOWN() (_CNPDT3 = 1)
22942 /// Disable the pulldown on pin RT3.
22943 # define DISABLE_RT3_PULLDOWN() (_CNPDT3 = 0)
22944 
22945 /// Enable the change notification interrupt on pin RT3.
22946 # define ENABLE_RT3_CN_INTERRUPT() (_CNIET3 = 1)
22947 /// Disable the change notification interrupt on pin RT3.
22948 # define DISABLE_RT3_CN_INTERRUPT() (_CNIET3 = 0)
22949 
22950 # elif defined(RT3_CN)
22951 # define ENABLE_RT3_PULLUP() (RXY_GPIO_CNPUE(RT3_CN) = 1)
22952 # define DISABLE_RT3_PULLUP() (RXY_GPIO_CNPUE(RT3_CN) = 0)
22953 
22954 # if RXY_HAS_CNPDE(RT3_CN)
22955 # define ENABLE_RT3_PULLDOWN() (RXY_GPIO_CNPDE(RT3_CN) = 1)
22956 # define DISABLE_RT3_PULLDOWN() (RXY_GPIO_CNPDE(RT3_CN) = 0)
22957 # else
22958 # define DISABLE_RT3_PULLDOWN() ((void) 0)
22959 # endif
22960 
22961 # define ENABLE_RT3_CN_INTERRUPT() (RXY_GPIO_CNIE(RT3_CN) = 1)
22962 # define DISABLE_RT3_CN_INTERRUPT() (RXY_GPIO_CNIE(RT3_CN) = 0)
22963 
22964 # else
22965 # define DISABLE_RT3_PULLUP() ((void) 0)
22966 # define DISABLE_RT3_PULLDOWN() ((void) 0)
22967 # define DISABLE_RT3_CN_INTERRUPT() ((void) 0)
22968 # endif
22969 
22970 // High-level config
22971 // -----------------
22972 /** This macro disables pullups/downs, enables analog functionality, and configures
22973  * pin RT3 as an input.
22974  */
22975 # if defined(_ANST3) || defined(RT3_AN) || defined(__DOXYGEN__)
22976 # define CONFIG_RT3_AS_ANALOG() \
22977  do { \
22978  ENABLE_RT3_ANALOG(); \
22979  CONFIG_RT3_AS_INPUT(); \
22980  DISABLE_RT3_OPENDRAIN(); \
22981  DISABLE_RT3_PULLUP(); \
22982  DISABLE_RT3_PULLDOWN(); \
22983  } while (0)
22984 # endif
22985 
22986 /** This macro disables open-drain and pullups/downs,
22987  * configures pin RT3 for digital (not analog) operation, and
22988  * configures the pin as an input.
22989  */
22990 # define CONFIG_RT3_AS_DIG_INPUT() \
22991  do { \
22992  DISABLE_RT3_ANALOG(); \
22993  CONFIG_RT3_AS_INPUT(); \
22994  DISABLE_RT3_OPENDRAIN(); \
22995  DISABLE_RT3_PULLUP(); \
22996  DISABLE_RT3_PULLDOWN(); \
22997  } while (0)
22998 
22999 /** This macro disables open-drain and pullups/downs,
23000  * configures pin RT3 for digital (not analog) operation, and
23001  * configures the pin as an output.
23002  */
23003 # define CONFIG_RT3_AS_DIG_OUTPUT() \
23004  do { \
23005  DISABLE_RT3_ANALOG(); \
23006  CONFIG_RT3_AS_OUTPUT(); \
23007  DISABLE_RT3_OPENDRAIN(); \
23008  DISABLE_RT3_PULLUP(); \
23009  DISABLE_RT3_PULLDOWN(); \
23010  } while (0)
23011 
23012 #endif // #if defined(_RT3) || defined(__DOXYGEN__): Provide GPIO for RT3
23013 
23014 
23015 
23016 
23017