PIC24 Support Libraries
pic24_ports.h
Go to the documentation of this file.
1 /*
2  * "Copyright (c) 2008 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 
31 #pragma once
32 
33 // Documentation for this file. If the \file tag isn't present,
34 // this file won't be documented.
35 /** \file
36  * This file defines a series of macros which provide GPIO and related configuration for
37  * each pin of a given PIC24/dsPIC33. Configuration is first defined at a low level,
38  * by providing the following:
39  *
40  * * Analog/digital configuration: ENABLE/DISABLE_Rxy_ANALOG(). The DISABLE version
41  * will always exist; the ENABLE version exists only if the given pin has analog
42  * capability.
43  * * Input/output configuration: CONFIG_Rxy_AS_INPUT/OUTPUT(). This exists for every pin.
44  * * Open collector/normal (totem-pole) output driver configuration:
45  * ENABLE/DISABLE_Rxy_OPENDRAIN(). The DISABLE version
46  * will always exist; the ENABLE version exists only if the given pin has open-drain
47  * capability.
48  * * Pullup/pulldown configuration: ENABLE/DISABLE_Rxy_PULLUP/DOWN(). The DISABLE version
49  * will always exist; the ENABLE version exists only if the given pin has pullup/pulldown
50  * capability.
51  *
52  * Related low-level configuration:
53  * * Change notification interrupts: ENABLE/DISABLE_Rxy_CN_INTERRUPT(). The DISABLE version
54  * will always exist; the ENABLE version exists only if the given pin has change notification
55  * capability.
56  * * Remappable pin to Rxy translation: the Rxy_RP macro identifies the RPy value for
57  * the given Rxy port. Typical usage with the remappable macros: CONFIG_INT1_TO(RB4_RP);
58  * * Analog port to Rxy translation: The Rxy_AN macro identifies the ANn value for
59  * the given Rxy port. Typical usage: configADC1_ManualCH0(RB4_AN, 31, 0).
60  * * Change notification pin to Rxy translation: The Rxy_CN macro identifies the CNm value for
61  * the given Rxy port. Rather than directly using this value, the ENABLE/DISABLE_Rxy_PULLUP/DOWN()
62  * and ENABLE/DISABLE_Rxy_CN_INTERRUPT() are typically used.
63  *
64  * Combining these produces higher-level configuration:
65  * * CONFIG_Rxy_AS_ANALOG(): disables pullups/pulldowns, makes pin an input, and
66  * of course enables analog.
67  * * CONFIG_Rxy_AS_DIG_INPUT/OUTPUT(): disables analog, pullups/pulldowns, and
68  * open-drain.
69  *
70  * Implementation notes
71  * --------------------
72  * \todo Explain double macros
73  */
74 
75 
76 // Port configuration
77 // ==================
78 // Port configuration macros
79 // -------------------------
80 // The macros below are used by the following include files to define GPIO macros.
81 //
82 // Analog
83 // ^^^^^^
84 // Return the PCFG pin for the given Rxy_AN value.
85 #define RXY_GPIO_PCFG(Rxy_AN) _RXY_GPIO_PCFG(Rxy_AN)
86 #define _RXY_GPIO_PCFG(Rxy_AN) (_PCFG ## Rxy_AN)
87 
88 // Change notification / pullups and pulldowns
89 // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90 // Return the _CNmPUE pin for the given Rxy_CN value.
91 #define RXY_GPIO_CNPUE(Rxy_CN) _RXY_GPIO_CNPUE(Rxy_CN)
92 #define _RXY_GPIO_CNPUE(Rxy_CN) (_CN ## Rxy_CN ## PUE)
93 // Return the _CNmIE pin for the given Rxy_CN value.
94 #define RXY_GPIO_CNIE(Rxy_CN) _RXY_GPIO_CNIE(Rxy_CN)
95 #define _RXY_GPIO_CNIE(Rxy_CN) (_CN ## Rxy_CN ## IE)
96 
97 // Return true if the given Rxy_CN pin has pulldown capabilities.
98 #define RXY_HAS_CNPDE(Rxy_CN) _RXY_HAS_CNPDE(Rxy_CN)
99 #define _RXY_HAS_CNPDE(Rxy_CN) defined(_CN ## Rxy_CN ## PDE)
100 // Return the _CNmPDE pin for the given Rxy_GPIO value.
101 #define RXY_GPIO_CNPDE(Rxy_CN) _RXY_GPIO_CNPDE(Rxy_CN)
102 #define _RXY_GPIO_CNPDE(Rxy_CN) (_CN ## Rxy_CN ## PDE)
103 
104 // Include the table data used to drive GPIO config.
105 #include "pic24_ports_mapping.h"
106 
107 // Using the above macros, transform the table data into GPIO config.
108 #include "pic24_ports_config.h"
109 
110 
111 
112 /** \name Remappable peripheral input support
113  * <a name="remappableInputs">These</a> funcions map an input internal
114  * to the PIC to an input pin.
115  * For example, CONFIG_INT1_TO_RP(10) maps the INT1 edge-triggered
116  * interrupt to port P, pin 10.
117  */
118 //@{
119 
120 #if defined(_INT1R) || defined(__DOXYGEN__)
121 /// Maps INT1 to a remappable pin;
122 /// see <a href="#remappableInputs">remappable peripheral input support</a>
123 /// for more information.
124 # define CONFIG_INT1_TO_RP(pin) _INT1R = pin
125 #endif
126 
127 /// Maps INT2 to a remappable pin;
128 /// see <a href="#remappableInputs">remappable peripheral input support</a>
129 /// for more informatino.
130 #if defined(_INT2R) || defined(__DOXYGEN__)
131 # define CONFIG_INT2_TO_RP(pin) _INT2R = pin
132 #endif
133 
134 /// Maps INT3 to a remappable pin;
135 /// see <a href="#remappableInputs">remappable peripheral input support</a>
136 /// for more informatino.
137 #if defined(_INT3R) || defined(__DOXYGEN__)
138 # define CONFIG_INT3_TO_RP(pin) _INT3R = pin
139 #endif
140 
141 /// Maps INT4 to a remappable pin;
142 /// see <a href="#remappableInputs">remappable peripheral input support</a>
143 /// for more informatino.
144 #if defined(_INT4R) || defined(__DOXYGEN__)
145 #define CONFIG_INT4_TO_RP(pin) _INT4R = pin
146 #endif
147 
148 /// Maps T1CK to a remappable pin;
149 /// see <a href="#remappableInputs">remappable peripheral input support</a>
150 /// for more informatino.
151 #if defined(_T1CKR) || defined(__DOXYGEN__)
152 #define CONFIG_T1CK_TO_RP(pin) _T1CKR = pin
153 #endif
154 
155 /// Maps T2CK to a remappable pin;
156 /// see <a href="#remappableInputs">remappable peripheral input support</a>
157 /// for more informatino.
158 #if defined(_T2CKR) || defined(__DOXYGEN__)
159 #define CONFIG_T2CK_TO_RP(pin) _T2CKR = pin
160 #endif
161 
162 /// Maps T3CK to a remappable pin;
163 /// see <a href="#remappableInputs">remappable peripheral input support</a>
164 /// for more informatino.
165 #if defined(_T3CKR) || defined(__DOXYGEN__)
166 #define CONFIG_T3CK_TO_RP(pin) _T3CKR = pin
167 #endif
168 
169 /// Maps T4CK to a remappable pin;
170 /// see <a href="#remappableInputs">remappable peripheral input support</a>
171 /// for more informatino.
172 #if defined(_T4CKR) || defined(__DOXYGEN__)
173 #define CONFIG_T4CK_TO_RP(pin) _T4CKR = pin
174 #endif
175 
176 /// Maps T5CK to a remappable pin;
177 /// see <a href="#remappableInputs">remappable peripheral input support</a>
178 /// for more informatino.
179 #if defined(_T5CKR) || defined(__DOXYGEN__)
180 #define CONFIG_T5CK_TO_RP(pin) _T5CKR = pin
181 #endif
182 
183 /// Maps T6CK to a remappable pin;
184 /// see <a href="#remappableInputs">remappable peripheral input support</a>
185 /// for more informatino.
186 #if defined(_T6CKR) || defined(__DOXYGEN__)
187 #define CONFIG_T6CK_TO_RP(pin) _T6CKR = pin
188 #endif
189 
190 /// Maps T7CK to a remappable pin;
191 /// see <a href="#remappableInputs">remappable peripheral input support</a>
192 /// for more informatino.
193 #if defined(_T7CKR) || defined(__DOXYGEN__)
194 #define CONFIG_T7CK_TO_RP(pin) _T7CKR = pin
195 #endif
196 
197 /// Maps T8CK to a remappable pin;
198 /// see <a href="#remappableInputs">remappable peripheral input support</a>
199 /// for more informatino.
200 #if defined(_T8CKR) || defined(__DOXYGEN__)
201 #define CONFIG_T8CK_TO_RP(pin) _T8CKR = pin
202 #endif
203 
204 /// Maps T9CK to a remappable pin;
205 /// see <a href="#remappableInputs">remappable peripheral input support</a>
206 /// for more informatino.
207 #if defined(_T9CKR) || defined(__DOXYGEN__)
208 #define CONFIG_T9CK_TO_RP(pin) _T9CKR = pin
209 #endif
210 
211 /// Maps IC1 to a remappable pin;
212 /// see <a href="#remappableInputs">remappable peripheral input support</a>
213 /// for more informatino.
214 #if defined(_IC1R) || defined(__DOXYGEN__)
215 #define CONFIG_IC1_TO_RP(pin) _IC1R = pin
216 #endif
217 
218 /// Maps IC2 to a remappable pin;
219 /// see <a href="#remappableInputs">remappable peripheral input support</a>
220 /// for more informatino.
221 #if defined(_IC2R) || defined(__DOXYGEN__)
222 #define CONFIG_IC2_TO_RP(pin) _IC2R = pin
223 #endif
224 
225 /// Maps IC3 to a remappable pin;
226 /// see <a href="#remappableInputs">remappable peripheral input support</a>
227 /// for more informatino.
228 #if defined(_IC3R) || defined(__DOXYGEN__)
229 #define CONFIG_IC3_TO_RP(pin) _IC3R = pin
230 #endif
231 
232 /// Maps IC4 to a remappable pin;
233 /// see <a href="#remappableInputs">remappable peripheral input support</a>
234 /// for more informatino.
235 #if defined(_IC4R) || defined(__DOXYGEN__)
236 #define CONFIG_IC4_TO_RP(pin) _IC4R = pin
237 #endif
238 
239 /// Maps IC5 to a remappable pin;
240 /// see <a href="#remappableInputs">remappable peripheral input support</a>
241 /// for more informatino.
242 #if defined(_IC5R) || defined(__DOXYGEN__)
243 #define CONFIG_IC5_TO_RP(pin) _IC5R = pin
244 #endif
245 
246 /// Maps IC6 to a remappable pin;
247 /// see <a href="#remappableInputs">remappable peripheral input support</a>
248 /// for more informatino.
249 #if defined(_IC6R) || defined(__DOXYGEN__)
250 #define CONFIG_IC6_TO_RP(pin) _IC6R = pin
251 #endif
252 
253 /// Maps IC7 to a remappable pin;
254 /// see <a href="#remappableInputs">remappable peripheral input support</a>
255 /// for more informatino.
256 #if defined(_IC7R) || defined(__DOXYGEN__)
257 #define CONFIG_IC7_TO_RP(pin) _IC7R = pin
258 #endif
259 
260 /// Maps IC8 to a remappable pin;
261 /// see <a href="#remappableInputs">remappable peripheral input support</a>
262 /// for more informatino.
263 #if defined(_IC8R) || defined(__DOXYGEN__)
264 #define CONFIG_IC8_TO_RP(pin) _IC8R = pin
265 #endif
266 
267 /// Maps OCFA to a remappable pin;
268 /// see <a href="#remappableInputs">remappable peripheral input support</a>
269 /// for more informatino.
270 #if defined(_OCFAR) || defined(__DOXYGEN__)
271 #define CONFIG_OCFA_TO_RP(pin) _OCFAR = pin
272 #endif
273 
274 /// Maps OCFB to a remappable pin;
275 /// see <a href="#remappableInputs">remappable peripheral input support</a>
276 /// for more informatino.
277 #if defined(_OCFBR) || defined(__DOXYGEN__)
278 #define CONFIG_OCFB_TO_RP(pin) _OCFBR = pin
279 #endif
280 
281 /// \todo More mapping for dsPIC33E missing here, starting with FLT1.
282 
283 /// Maps U1RX to a remappable pin;
284 /// see <a href="#remappableInputs">remappable peripheral input support</a>
285 /// for more informatino.
286 #if defined(_U1RXR) || defined(__DOXYGEN__)
287 #define CONFIG_U1RX_TO_RP(pin) _U1RXR = pin
288 #endif
289 
290 /// Maps U1CTS to a remappable pin;
291 /// see <a href="#remappableInputs">remappable peripheral input support</a>
292 /// for more informatino.
293 #if defined(_U1CTSR) || defined(__DOXYGEN__)
294 #define CONFIG_U1CTS_TO_RP(pin) _U1CTSR = pin
295 #endif
296 
297 /// Maps U2RX to a remappable pin;
298 /// see <a href="#remappableInputs">remappable peripheral input support</a>
299 /// for more informatino.
300 #if defined(_U2RXR) || defined(__DOXYGEN__)
301 #define CONFIG_U2RX_TO_RP(pin) _U2RXR = pin
302 #endif
303 
304 /// Maps U2CTS to a remappable pin;
305 /// see <a href="#remappableInputs">remappable peripheral input support</a>
306 /// for more informatino.
307 #if defined(_U2CTSR) || defined(__DOXYGEN__)
308 #define CONFIG_U2CTS_TO_RP(pin) _U2CTSR = pin
309 #endif
310 
311 /// Maps SDI1 to a remappable pin;
312 /// see <a href="#remappableInputs">remappable peripheral input support</a>
313 /// for more informatino.
314 #if defined(_SDI1R) || defined(__DOXYGEN__)
315 #define CONFIG_SDI1_TO_RP(pin) _SDI1R = pin
316 #endif
317 
318 /// Maps SCK1 to a remappable pin;
319 /// see <a href="#remappableInputs">remappable peripheral input support</a>
320 /// for more informatino.
321 #if defined(_SCK1R) || defined(__DOXYGEN__)
322 #define CONFIG_SCK1IN_TO_RP(pin) _SCK1R = pin
323 #endif
324 
325 /// Maps SS1 to a remappable pin;
326 /// see <a href="#remappableInputs">remappable peripheral input support</a>
327 /// for more informatino.
328 #if defined(_SS1R) || defined(__DOXYGEN__)
329 #define CONFIG_SS1IN_TO_RP(pin) _SS1R = pin
330 #endif
331 
332 /// Maps SDI2 to a remappable pin;
333 /// see <a href="#remappableInputs">remappable peripheral input support</a>
334 /// for more informatino.
335 #if defined(_SDI2R) || defined(__DOXYGEN__)
336 #define CONFIG_SDI2_TO_RP(pin) _SDI2R = pin
337 #endif
338 
339 /// Maps SCK2 to a remappable pin;
340 /// see <a href="#remappableInputs">remappable peripheral input support</a>
341 /// for more informatino.
342 #if defined(_SCK2R) || defined(__DOXYGEN__)
343 #define CONFIG_SCK2IN_TO_RP(pin) _SCK2R = pin
344 #endif
345 
346 /// Maps SS2 to a remappable pin;
347 /// see <a href="#remappableInputs">remappable peripheral input support</a>
348 /// for more informatino.
349 #if defined(_SS2R) || defined(__DOXYGEN__)
350 #define CONFIG_SS2IN_TO_RP(pin) _SS2R = pin
351 #endif
352 
353 /// Maps CSDI to a remappable pin;
354 /// see <a href="#remappableInputs">remappable peripheral input support</a>
355 /// for more informatino.
356 #if defined(_CSDIR) || defined(__DOXYGEN__)
357 #define CONFIG_CDSI_TO_RP(pin) _CSDIR = pin
358 #endif
359 
360 /// Maps CSCKIN to a remappable pin;
361 /// see <a href="#remappableInputs">remappable peripheral input support</a>
362 /// for more informatino.
363 #if defined(_CSCKINR) || defined(__DOXYGEN__)
364 #define CONFIG_CSCKIN_TO_RP(pin) _CSCKINR = pin
365 #endif
366 
367 /// Maps COFSIN to a remappable pin;
368 /// see <a href="#remappableInputs">remappable peripheral input support</a>
369 /// for more informatino.
370 #if defined(_COFSINR) || defined(__DOXYGEN__)
371 #define CONFIG_COFSIN_TO_RP(pin) _COFSINR = pin
372 #endif
373 
374 /// Maps C1RX to a remappable pin;
375 /// see <a href="#remappableInputs">remappable peripheral input support</a>
376 /// for more informatino.
377 #if defined(_C1RXR) || defined(__DOXYGEN__)
378 #define CONFIG_C1RX_TO_RP(pin) _C1RXR = pin
379 #endif
380 
381 /// Maps C2RX to a remappable pin;
382 /// see <a href="#remappableInputs">remappable peripheral input support</a>
383 /// for more informatino.
384 #if defined(_C2RXR) || defined(__DOXYGEN__)
385 #define CONFIG_C2RX_TO_RP(pin) _C2RXR = pin
386 #endif
387 
388 /// \todo More mappings, starting with U3RX for the dsPIC33E.
389 //@}
390 
391 
392 /** \name Remappable peripheral output support
393  * <a name="remappableOutputs">These</a> functions maps an output
394  * internal to the PIC to an output pin.
395  * For example, CONFIG_C1OUT_TO_RP(10) maps the C1OUT comparator
396  * output to port P, pin 10.
397  *
398  * Not all devices support remappable peripherals. In these cases,
399  * the macros below evalaute to nothing: CONFIG_C1OUT_TO_RP(10) is
400  * a valid C statement which does nothing.
401  */
402 //@{
403 
404 /*****************************************************************************
405 ***
406 *** Look for a way so that the compiler can determine whether or not the
407 *** target chip supports remappable perihperals. So, we will look for
408 *** a bit field in the lowest possible RPORx registers. Unfortunately,
409 *** Microchip has redefined these over the families and even within families.
410 ***
411 *** xxxxxx devices start with _RP0R
412 *** dsPIC33E 50x devices start with _RP20R
413 *** dsPIC33E 80x devices start with _RP64R
414 ***
415 *****************************************************************************/
416 #if defined(_RP0R) || defined(_RP20R) || defined(_RP64R) || defined(__DOXYGEN__)
417 /// CONFIG_NULL_TO_RP(n) returns RPn to an 'unmapped' state
418 /// (i.e, the reset condition).
419 # define CONFIG_NULL_TO_RP(Rxy_RP) _CONFIG_NULL_TO_RP(Rxy_RP)
420 # define _CONFIG_NULL_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = 0)
421 #endif
422 
423 /// Maps C1OUT to a remappable pin;
424 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
425 /// for more information.
426 #if defined(_RPOUT_C1OUT) || defined(__DOXYGEN__)
427 # define CONFIG_C1OUT_TO_RP(Rxy_RP) _CONFIG_C1OUT_TO_RP(Rxy_RP)
428 # define _CONFIG_C1OUT_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_C1OUT)
429 #endif
430 
431 /// Maps C2OUT to a remappable pin;
432 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
433 /// for more information.
434 #if defined(_RPOUT_C2OUT) || defined(__DOXYGEN__)
435 # define CONFIG_C2OUT_TO_RP(Rxy_RP) _CONFIG_C2OUT_TO_RP(Rxy_RP)
436 # define _CONFIG_C2OUT_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_C2OUT)
437 #endif
438 
439 /// Maps U1TX to a remappable pin;
440 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
441 /// for more information.
442 #if defined(_RPOUT_U1TX) || defined(__DOXYGEN__)
443 # define CONFIG_U1TX_TO_RP(Rxy_RP) _CONFIG_U1TX_TO_RP(Rxy_RP)
444 # define _CONFIG_U1TX_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_U1TX)
445 #endif
446 
447 /// Maps U1RTS to a remappable pin;
448 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
449 /// for more information.
450 #if defined(_RPOUT_U1RTS) || defined(__DOXYGEN__)
451 # define CONFIG_U1RTS_TO_RP(Rxy_RP) _CONFIG_U1RTS_TO_RP(Rxy_RP)
452 # define _CONFIG_U1RTS_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_U1RTS)
453 #endif
454 
455 /// Maps U2TX to a remappable pin;
456 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
457 /// for more information.
458 #if defined(_RPOUT_U2TX) || defined(__DOXYGEN__)
459 # define CONFIG_U2TX_TO_RP(Rxy_RP) _CONFIG_U2TX_TO_RP(Rxy_RP)
460 # define _CONFIG_U2TX_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_U2TX)
461 #endif
462 
463 /// Maps U2RTS to a remappable pin;
464 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
465 /// for more information.
466 #if defined(_RPOUT_U2RTS) || defined(__DOXYGEN__)
467 # define CONFIG_U2RTS_TO_RP(Rxy_RP) _CONFIG_U2RTS_TO_RP(Rxy_RP)
468 # define _CONFIG_U2RTS_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_U2RTS)
469 #endif
470 
471 /// Maps SDO1 to a remappable pin;
472 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
473 /// for more information.
474 #if defined(_RPOUT_SDO1) || defined(__DOXYGEN__)
475 # define CONFIG_SDO1_TO_RP(Rxy_RP) _CONFIG_SDO1_TO_RP(Rxy_RP)
476 # define _CONFIG_SDO1_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_SDO1)
477 #endif
478 
479 /// Maps SCK1OUT to a remappable pin;
480 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
481 /// for more information.
482 #if defined(_RPOUT_SCK1OUT) || defined(__DOXYGEN__)
483 # define CONFIG_SCK1OUT_TO_RP(Rxy_RP) _CONFIG_SCK1OUT_TO_RP(Rxy_RP)
484 # define _CONFIG_SCK1OUT_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_SCK1OUT)
485 #endif
486 
487 /// Maps SS11OUT to a remappable pin;
488 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
489 /// for more information.
490 #if defined(_RPOUT_SS1OUT) || defined(__DOXYGEN__)
491 # define CONFIG_SS1OUT_TO_RP(Rxy_RP) _CONFIG_SS1OUT_TO_RP(Rxy_RP)
492 # define _CONFIG_SS1OUT_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_SS1OUT)
493 #endif
494 
495 /// Maps SDO2 to a remappable pin;
496 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
497 /// for more information.
498 #if defined(_RPOUT_SDO2) || defined(__DOXYGEN__)
499 # define CONFIG_SDO2_TO_RP(Rxy_RP) _CONFIG_SDO2_TO_RP(Rxy_RP)
500 # define _CONFIG_SDO2_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_SDO2)
501 #endif
502 
503 /// Maps SCK2OUT to a remappable pin;
504 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
505 /// for more information.
506 #if defined(_RPOUT_SCK2OUT) || defined(__DOXYGEN__)
507 # define CONFIG_SCK2OUT_TO_RP(Rxy_RP) _CONFIG_SCK2OUT_TO_RP(Rxy_RP)
508 # define _CONFIG_SCK2OUT_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_SCK2OUT)
509 #endif
510 
511 /// Maps SS2OUT to a remappable pin;
512 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
513 /// for more information.
514 #if defined(_RPOUT_SS2OUT) || defined(__DOXYGEN__)
515 # define CONFIG_SS2OUT_TO_RP(Rxy_RP) _CONFIG_SS2OUT_TO_RP(Rxy_RP)
516 # define _CONFIG_SS2OUT_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_SS2OUT)
517 #endif
518 
519 /// Maps C1TX to a remappable pin;
520 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
521 /// for more information.
522 #if defined(_RPOUT_C1TX) || defined(__DOXYGEN__)
523 # define CONFIG_C1TX_TO_RP(Rxy_RP) _CONFIG_C1TX_TO_RP(Rxy_RP)
524 # define _CONFIG_C1TX_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_C1TX)
525 #endif
526 
527 /// Maps OC1 to a remappable pin;
528 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
529 /// for more information.
530 #if defined(_RPOUT_OC1) || defined(__DOXYGEN__)
531 # define CONFIG_OC1_TO_RP(Rxy_RP) _CONFIG_OC1_TO_RP(Rxy_RP)
532 # define _CONFIG_OC1_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_OC1)
533 #endif
534 
535 /// Maps OC2 to a remappable pin;
536 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
537 /// for more information.
538 #if defined(_RPOUT_OC2) || defined(__DOXYGEN__)
539 # define CONFIG_OC2_TO_RP(Rxy_RP) _CONFIG_OC2_TO_RP(Rxy_RP)
540 # define _CONFIG_OC2_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_OC2)
541 #endif
542 
543 /// Maps OC3 to a remappable pin;
544 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
545 /// for more information.
546 #if defined(_RPOUT_OC3) || defined(__DOXYGEN__)
547 # define CONFIG_OC3_TO_RP(Rxy_RP) _CONFIG_OC3_TO_RP(Rxy_RP)
548 # define _CONFIG_OC3_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_OC3)
549 #endif
550 
551 /// Maps OC4 to a remappable pin;
552 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
553 /// for more information.
554 #if defined(_RPOUT_OC4) || defined(__DOXYGEN__)
555 # define CONFIG_OC4_TO_RP(Rxy_RP) _CONFIG_OC4_TO_RP(Rxy_RP)
556 # define _CONFIG_OC4_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_OC4)
557 #endif
558 
559 /// Maps OC5 to a remappable pin;
560 /// see <a href="#remappableOutputs">remappable peripheral output support</a>
561 /// for more information.
562 #if defined(_RPOUT_OC5) || defined(__DOXYGEN__)
563 # define CONFIG_OC5_TO_RP(Rxy_RP) _CONFIG_OC5_TO_RP(Rxy_RP)
564 # define _CONFIG_OC5_TO_RP(Rxy_RP) (_RP##Rxy_RP##R = _RPOUT_OC5)
565 #endif
566 //@}
Define device-specific mappings from Rxy to RPy, ANn, and CNm pins.
Define GPIO configuration macros for all pins of a device. See pic24_ports.h for more details...