/*
*****************************************************************************
* This file add support for PIC24FJ256GA110 for Peripheral Pin Select (PPS)
* features. The peripherals managed by PPS are all all digital only peripherals.
* These include serial communications (UART and SPI), input capture and output
* capture, etc. Please refer to Section 9.4 of PIC24FJ256GA110 Family for details.
* This example uses Touch Panel, thus SPI pin remapped is required.
* 
* Programmer: John Leung
* Web presence: www.TechToys.com.hk
* Date: 25 March 2009
*****************************************************************************
*/


/*
*****************************************************************************
* This macro assign SPI2 pins to the correct RP pins for hardware
* PIC24-Eval Board C2
* Eeprom using SPI2. 
* To map SPI2 for the original pins, we need 
* Refer to TABLE9-2: Selectable Output Sources on datasheet 
* Assign SDO2 to Pin RP19, physically Pin number 12 on the mcu 
* Assign SCK2 to Pin RP21, physically Pin number 10 on the mcu 
* Input function 
* SPI2 data input RPINR22 SDI2R5:SDI2R0 
* Assign SDI2 to Pin RP26 (physical it is Pin 11) 
*****************************************************************************
*/
#define pps_spi2() {RPOR9bits.RP19R= 10;RPOR10bits.RP21R = 11; RPINR22bits.SDI2R = 26;}

/*
*****************************************************************************
* This macro assign UART2 to the correct RP pins for hardware
* PIC24-Eval Board C2
* 
* Configure Input Functions (Table 9-1))
* Assign U2RX To Pin RP10
* Configure Output Functions (Table 9-2)
* Assign U2TX To Pin RP17
*****************************************************************************
*/

#define pps_uart2() { RPINR19bits.U2RXR = 10; RPOR8bits.RP17R = 5;}
