/** @Generated Pin Manager Header File @Company: Microchip Technology Inc. @File Name: pin_manager.h @Summary: This is the Pin Manager file generated using PIC10 / PIC12 / PIC16 / PIC18 MCUs @Description This header file provides APIs for driver for . Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65.2 Device : PIC16F1579 Driver Version : 2.11 The generated drivers are tested against the following: Compiler : XC8 1.45 MPLAB : MPLAB X 4.15 */ /* (c) 2018 Microchip Technology Inc. and its subsidiaries. Subject to your compliance with these terms, you may use Microchip software and any derivatives exclusively with Microchip products. It is your responsibility to comply with third party license terms applicable to your use of third party software (including open source software) that may accompany Microchip software. THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. */ #ifndef PIN_MANAGER_H #define PIN_MANAGER_H #define INPUT 1 #define OUTPUT 0 #define HIGH 1 #define LOW 0 #define ANALOG 1 #define DIGITAL 0 #define PULL_UP_ENABLED 1 #define PULL_UP_DISABLED 0 // get/set UNUSED1 aliases #define UNUSED1_TRIS TRISAbits.TRISA0 #define UNUSED1_LAT LATAbits.LATA0 #define UNUSED1_PORT PORTAbits.RA0 #define UNUSED1_WPU WPUAbits.WPUA0 #define UNUSED1_OD ODCONAbits.ODA0 #define UNUSED1_ANS ANSELAbits.ANSA0 #define UNUSED1_SetHigh() do { LATAbits.LATA0 = 1; } while(0) #define UNUSED1_SetLow() do { LATAbits.LATA0 = 0; } while(0) #define UNUSED1_Toggle() do { LATAbits.LATA0 = ~LATAbits.LATA0; } while(0) #define UNUSED1_GetValue() PORTAbits.RA0 #define UNUSED1_SetDigitalInput() do { TRISAbits.TRISA0 = 1; } while(0) #define UNUSED1_SetDigitalOutput() do { TRISAbits.TRISA0 = 0; } while(0) #define UNUSED1_SetPullup() do { WPUAbits.WPUA0 = 1; } while(0) #define UNUSED1_ResetPullup() do { WPUAbits.WPUA0 = 0; } while(0) #define UNUSED1_SetPushPull() do { ODCONAbits.ODA0 = 0; } while(0) #define UNUSED1_SetOpenDrain() do { ODCONAbits.ODA0 = 1; } while(0) #define UNUSED1_SetAnalogMode() do { ANSELAbits.ANSA0 = 1; } while(0) #define UNUSED1_SetDigitalMode() do { ANSELAbits.ANSA0 = 0; } while(0) // get/set UNUSED2 aliases #define UNUSED2_TRIS TRISAbits.TRISA1 #define UNUSED2_LAT LATAbits.LATA1 #define UNUSED2_PORT PORTAbits.RA1 #define UNUSED2_WPU WPUAbits.WPUA1 #define UNUSED2_OD ODCONAbits.ODA1 #define UNUSED2_ANS ANSELAbits.ANSA1 #define UNUSED2_SetHigh() do { LATAbits.LATA1 = 1; } while(0) #define UNUSED2_SetLow() do { LATAbits.LATA1 = 0; } while(0) #define UNUSED2_Toggle() do { LATAbits.LATA1 = ~LATAbits.LATA1; } while(0) #define UNUSED2_GetValue() PORTAbits.RA1 #define UNUSED2_SetDigitalInput() do { TRISAbits.TRISA1 = 1; } while(0) #define UNUSED2_SetDigitalOutput() do { TRISAbits.TRISA1 = 0; } while(0) #define UNUSED2_SetPullup() do { WPUAbits.WPUA1 = 1; } while(0) #define UNUSED2_ResetPullup() do { WPUAbits.WPUA1 = 0; } while(0) #define UNUSED2_SetPushPull() do { ODCONAbits.ODA1 = 0; } while(0) #define UNUSED2_SetOpenDrain() do { ODCONAbits.ODA1 = 1; } while(0) #define UNUSED2_SetAnalogMode() do { ANSELAbits.ANSA1 = 1; } while(0) #define UNUSED2_SetDigitalMode() do { ANSELAbits.ANSA1 = 0; } while(0) // get/set UNUSED3 aliases #define UNUSED3_TRIS TRISAbits.TRISA2 #define UNUSED3_LAT LATAbits.LATA2 #define UNUSED3_PORT PORTAbits.RA2 #define UNUSED3_WPU WPUAbits.WPUA2 #define UNUSED3_OD ODCONAbits.ODA2 #define UNUSED3_ANS ANSELAbits.ANSA2 #define UNUSED3_SetHigh() do { LATAbits.LATA2 = 1; } while(0) #define UNUSED3_SetLow() do { LATAbits.LATA2 = 0; } while(0) #define UNUSED3_Toggle() do { LATAbits.LATA2 = ~LATAbits.LATA2; } while(0) #define UNUSED3_GetValue() PORTAbits.RA2 #define UNUSED3_SetDigitalInput() do { TRISAbits.TRISA2 = 1; } while(0) #define UNUSED3_SetDigitalOutput() do { TRISAbits.TRISA2 = 0; } while(0) #define UNUSED3_SetPullup() do { WPUAbits.WPUA2 = 1; } while(0) #define UNUSED3_ResetPullup() do { WPUAbits.WPUA2 = 0; } while(0) #define UNUSED3_SetPushPull() do { ODCONAbits.ODA2 = 0; } while(0) #define UNUSED3_SetOpenDrain() do { ODCONAbits.ODA2 = 1; } while(0) #define UNUSED3_SetAnalogMode() do { ANSELAbits.ANSA2 = 1; } while(0) #define UNUSED3_SetDigitalMode() do { ANSELAbits.ANSA2 = 0; } while(0) // get/set UNUSED4 aliases #define UNUSED4_TRIS TRISAbits.TRISA3 #define UNUSED4_PORT PORTAbits.RA3 #define UNUSED4_WPU WPUAbits.WPUA3 #define UNUSED4_GetValue() PORTAbits.RA3 #define UNUSED4_SetDigitalInput() do { TRISAbits.TRISA3 = 1; } while(0) #define UNUSED4_SetDigitalOutput() do { TRISAbits.TRISA3 = 0; } while(0) #define UNUSED4_SetPullup() do { WPUAbits.WPUA3 = 1; } while(0) #define UNUSED4_ResetPullup() do { WPUAbits.WPUA3 = 0; } while(0) // get/set IO_LED_BLUE_N aliases #define IO_LED_BLUE_N_TRIS TRISAbits.TRISA4 #define IO_LED_BLUE_N_LAT LATAbits.LATA4 #define IO_LED_BLUE_N_PORT PORTAbits.RA4 #define IO_LED_BLUE_N_WPU WPUAbits.WPUA4 #define IO_LED_BLUE_N_OD ODCONAbits.ODA4 #define IO_LED_BLUE_N_ANS ANSELAbits.ANSA4 #define IO_LED_BLUE_N_SetHigh() do { LATAbits.LATA4 = 1; } while(0) #define IO_LED_BLUE_N_SetLow() do { LATAbits.LATA4 = 0; } while(0) #define IO_LED_BLUE_N_Toggle() do { LATAbits.LATA4 = ~LATAbits.LATA4; } while(0) #define IO_LED_BLUE_N_GetValue() PORTAbits.RA4 #define IO_LED_BLUE_N_SetDigitalInput() do { TRISAbits.TRISA4 = 1; } while(0) #define IO_LED_BLUE_N_SetDigitalOutput() do { TRISAbits.TRISA4 = 0; } while(0) #define IO_LED_BLUE_N_SetPullup() do { WPUAbits.WPUA4 = 1; } while(0) #define IO_LED_BLUE_N_ResetPullup() do { WPUAbits.WPUA4 = 0; } while(0) #define IO_LED_BLUE_N_SetPushPull() do { ODCONAbits.ODA4 = 0; } while(0) #define IO_LED_BLUE_N_SetOpenDrain() do { ODCONAbits.ODA4 = 1; } while(0) #define IO_LED_BLUE_N_SetAnalogMode() do { ANSELAbits.ANSA4 = 1; } while(0) #define IO_LED_BLUE_N_SetDigitalMode() do { ANSELAbits.ANSA4 = 0; } while(0) // get/set IO_LED_RED_N aliases #define IO_LED_RED_N_TRIS TRISAbits.TRISA5 #define IO_LED_RED_N_LAT LATAbits.LATA5 #define IO_LED_RED_N_PORT PORTAbits.RA5 #define IO_LED_RED_N_WPU WPUAbits.WPUA5 #define IO_LED_RED_N_OD ODCONAbits.ODA5 #define IO_LED_RED_N_SetHigh() do { LATAbits.LATA5 = 1; } while(0) #define IO_LED_RED_N_SetLow() do { LATAbits.LATA5 = 0; } while(0) #define IO_LED_RED_N_Toggle() do { LATAbits.LATA5 = ~LATAbits.LATA5; } while(0) #define IO_LED_RED_N_GetValue() PORTAbits.RA5 #define IO_LED_RED_N_SetDigitalInput() do { TRISAbits.TRISA5 = 1; } while(0) #define IO_LED_RED_N_SetDigitalOutput() do { TRISAbits.TRISA5 = 0; } while(0) #define IO_LED_RED_N_SetPullup() do { WPUAbits.WPUA5 = 1; } while(0) #define IO_LED_RED_N_ResetPullup() do { WPUAbits.WPUA5 = 0; } while(0) #define IO_LED_RED_N_SetPushPull() do { ODCONAbits.ODA5 = 0; } while(0) #define IO_LED_RED_N_SetOpenDrain() do { ODCONAbits.ODA5 = 1; } while(0) // get/set IO_POW aliases #define IO_POW_TRIS TRISBbits.TRISB4 #define IO_POW_LAT LATBbits.LATB4 #define IO_POW_PORT PORTBbits.RB4 #define IO_POW_WPU WPUBbits.WPUB4 #define IO_POW_OD ODCONBbits.ODB4 #define IO_POW_ANS ANSELBbits.ANSB4 #define IO_POW_SetHigh() do { LATBbits.LATB4 = 1; } while(0) #define IO_POW_SetLow() do { LATBbits.LATB4 = 0; } while(0) #define IO_POW_Toggle() do { LATBbits.LATB4 = ~LATBbits.LATB4; } while(0) #define IO_POW_GetValue() PORTBbits.RB4 #define IO_POW_SetDigitalInput() do { TRISBbits.TRISB4 = 1; } while(0) #define IO_POW_SetDigitalOutput() do { TRISBbits.TRISB4 = 0; } while(0) #define IO_POW_SetPullup() do { WPUBbits.WPUB4 = 1; } while(0) #define IO_POW_ResetPullup() do { WPUBbits.WPUB4 = 0; } while(0) #define IO_POW_SetPushPull() do { ODCONBbits.ODB4 = 0; } while(0) #define IO_POW_SetOpenDrain() do { ODCONBbits.ODB4 = 1; } while(0) #define IO_POW_SetAnalogMode() do { ANSELBbits.ANSB4 = 1; } while(0) #define IO_POW_SetDigitalMode() do { ANSELBbits.ANSB4 = 0; } while(0) // get/set IO_PWM1 aliases #define IO_PWM1_TRIS TRISBbits.TRISB5 #define IO_PWM1_LAT LATBbits.LATB5 #define IO_PWM1_PORT PORTBbits.RB5 #define IO_PWM1_WPU WPUBbits.WPUB5 #define IO_PWM1_OD ODCONBbits.ODB5 #define IO_PWM1_ANS ANSELBbits.ANSB5 #define IO_PWM1_SetHigh() do { LATBbits.LATB5 = 1; } while(0) #define IO_PWM1_SetLow() do { LATBbits.LATB5 = 0; } while(0) #define IO_PWM1_Toggle() do { LATBbits.LATB5 = ~LATBbits.LATB5; } while(0) #define IO_PWM1_GetValue() PORTBbits.RB5 #define IO_PWM1_SetDigitalInput() do { TRISBbits.TRISB5 = 1; } while(0) #define IO_PWM1_SetDigitalOutput() do { TRISBbits.TRISB5 = 0; } while(0) #define IO_PWM1_SetPullup() do { WPUBbits.WPUB5 = 1; } while(0) #define IO_PWM1_ResetPullup() do { WPUBbits.WPUB5 = 0; } while(0) #define IO_PWM1_SetPushPull() do { ODCONBbits.ODB5 = 0; } while(0) #define IO_PWM1_SetOpenDrain() do { ODCONBbits.ODB5 = 1; } while(0) #define IO_PWM1_SetAnalogMode() do { ANSELBbits.ANSB5 = 1; } while(0) #define IO_PWM1_SetDigitalMode() do { ANSELBbits.ANSB5 = 0; } while(0) // get/set IO_PWM2 aliases #define IO_PWM2_TRIS TRISBbits.TRISB6 #define IO_PWM2_LAT LATBbits.LATB6 #define IO_PWM2_PORT PORTBbits.RB6 #define IO_PWM2_WPU WPUBbits.WPUB6 #define IO_PWM2_OD ODCONBbits.ODB6 #define IO_PWM2_SetHigh() do { LATBbits.LATB6 = 1; } while(0) #define IO_PWM2_SetLow() do { LATBbits.LATB6 = 0; } while(0) #define IO_PWM2_Toggle() do { LATBbits.LATB6 = ~LATBbits.LATB6; } while(0) #define IO_PWM2_GetValue() PORTBbits.RB6 #define IO_PWM2_SetDigitalInput() do { TRISBbits.TRISB6 = 1; } while(0) #define IO_PWM2_SetDigitalOutput() do { TRISBbits.TRISB6 = 0; } while(0) #define IO_PWM2_SetPullup() do { WPUBbits.WPUB6 = 1; } while(0) #define IO_PWM2_ResetPullup() do { WPUBbits.WPUB6 = 0; } while(0) #define IO_PWM2_SetPushPull() do { ODCONBbits.ODB6 = 0; } while(0) #define IO_PWM2_SetOpenDrain() do { ODCONBbits.ODB6 = 1; } while(0) // get/set IO_PWM_LEDS aliases #define IO_PWM_LEDS_TRIS TRISBbits.TRISB7 #define IO_PWM_LEDS_LAT LATBbits.LATB7 #define IO_PWM_LEDS_PORT PORTBbits.RB7 #define IO_PWM_LEDS_WPU WPUBbits.WPUB7 #define IO_PWM_LEDS_OD ODCONBbits.ODB7 #define IO_PWM_LEDS_SetHigh() do { LATBbits.LATB7 = 1; } while(0) #define IO_PWM_LEDS_SetLow() do { LATBbits.LATB7 = 0; } while(0) #define IO_PWM_LEDS_Toggle() do { LATBbits.LATB7 = ~LATBbits.LATB7; } while(0) #define IO_PWM_LEDS_GetValue() PORTBbits.RB7 #define IO_PWM_LEDS_SetDigitalInput() do { TRISBbits.TRISB7 = 1; } while(0) #define IO_PWM_LEDS_SetDigitalOutput() do { TRISBbits.TRISB7 = 0; } while(0) #define IO_PWM_LEDS_SetPullup() do { WPUBbits.WPUB7 = 1; } while(0) #define IO_PWM_LEDS_ResetPullup() do { WPUBbits.WPUB7 = 0; } while(0) #define IO_PWM_LEDS_SetPushPull() do { ODCONBbits.ODB7 = 0; } while(0) #define IO_PWM_LEDS_SetOpenDrain() do { ODCONBbits.ODB7 = 1; } while(0) // get/set IO_RC0 aliases #define IO_RC0_TRIS TRISCbits.TRISC0 #define IO_RC0_LAT LATCbits.LATC0 #define IO_RC0_PORT PORTCbits.RC0 #define IO_RC0_WPU WPUCbits.WPUC0 #define IO_RC0_OD ODCONCbits.ODC0 #define IO_RC0_ANS ANSELCbits.ANSC0 #define IO_RC0_SetHigh() do { LATCbits.LATC0 = 1; } while(0) #define IO_RC0_SetLow() do { LATCbits.LATC0 = 0; } while(0) #define IO_RC0_Toggle() do { LATCbits.LATC0 = ~LATCbits.LATC0; } while(0) #define IO_RC0_GetValue() PORTCbits.RC0 #define IO_RC0_SetDigitalInput() do { TRISCbits.TRISC0 = 1; } while(0) #define IO_RC0_SetDigitalOutput() do { TRISCbits.TRISC0 = 0; } while(0) #define IO_RC0_SetPullup() do { WPUCbits.WPUC0 = 1; } while(0) #define IO_RC0_ResetPullup() do { WPUCbits.WPUC0 = 0; } while(0) #define IO_RC0_SetPushPull() do { ODCONCbits.ODC0 = 0; } while(0) #define IO_RC0_SetOpenDrain() do { ODCONCbits.ODC0 = 1; } while(0) #define IO_RC0_SetAnalogMode() do { ANSELCbits.ANSC0 = 1; } while(0) #define IO_RC0_SetDigitalMode() do { ANSELCbits.ANSC0 = 0; } while(0) // get/set ADC_BATT aliases #define ADC_BATT_TRIS TRISCbits.TRISC1 #define ADC_BATT_LAT LATCbits.LATC1 #define ADC_BATT_PORT PORTCbits.RC1 #define ADC_BATT_WPU WPUCbits.WPUC1 #define ADC_BATT_OD ODCONCbits.ODC1 #define ADC_BATT_ANS ANSELCbits.ANSC1 #define ADC_BATT_SetHigh() do { LATCbits.LATC1 = 1; } while(0) #define ADC_BATT_SetLow() do { LATCbits.LATC1 = 0; } while(0) #define ADC_BATT_Toggle() do { LATCbits.LATC1 = ~LATCbits.LATC1; } while(0) #define ADC_BATT_GetValue() PORTCbits.RC1 #define ADC_BATT_SetDigitalInput() do { TRISCbits.TRISC1 = 1; } while(0) #define ADC_BATT_SetDigitalOutput() do { TRISCbits.TRISC1 = 0; } while(0) #define ADC_BATT_SetPullup() do { WPUCbits.WPUC1 = 1; } while(0) #define ADC_BATT_ResetPullup() do { WPUCbits.WPUC1 = 0; } while(0) #define ADC_BATT_SetPushPull() do { ODCONCbits.ODC1 = 0; } while(0) #define ADC_BATT_SetOpenDrain() do { ODCONCbits.ODC1 = 1; } while(0) #define ADC_BATT_SetAnalogMode() do { ANSELCbits.ANSC1 = 1; } while(0) #define ADC_BATT_SetDigitalMode() do { ANSELCbits.ANSC1 = 0; } while(0) // get/set RC2 procedures #define RC2_SetHigh() do { LATCbits.LATC2 = 1; } while(0) #define RC2_SetLow() do { LATCbits.LATC2 = 0; } while(0) #define RC2_Toggle() do { LATCbits.LATC2 = ~LATCbits.LATC2; } while(0) #define RC2_GetValue() PORTCbits.RC2 #define RC2_SetDigitalInput() do { TRISCbits.TRISC2 = 1; } while(0) #define RC2_SetDigitalOutput() do { TRISCbits.TRISC2 = 0; } while(0) #define RC2_SetPullup() do { WPUCbits.WPUC2 = 1; } while(0) #define RC2_ResetPullup() do { WPUCbits.WPUC2 = 0; } while(0) #define RC2_SetAnalogMode() do { ANSELCbits.ANSC2 = 1; } while(0) #define RC2_SetDigitalMode() do { ANSELCbits.ANSC2 = 0; } while(0) // get/set RC3 procedures #define RC3_SetHigh() do { LATCbits.LATC3 = 1; } while(0) #define RC3_SetLow() do { LATCbits.LATC3 = 0; } while(0) #define RC3_Toggle() do { LATCbits.LATC3 = ~LATCbits.LATC3; } while(0) #define RC3_GetValue() PORTCbits.RC3 #define RC3_SetDigitalInput() do { TRISCbits.TRISC3 = 1; } while(0) #define RC3_SetDigitalOutput() do { TRISCbits.TRISC3 = 0; } while(0) #define RC3_SetPullup() do { WPUCbits.WPUC3 = 1; } while(0) #define RC3_ResetPullup() do { WPUCbits.WPUC3 = 0; } while(0) #define RC3_SetAnalogMode() do { ANSELCbits.ANSC3 = 1; } while(0) #define RC3_SetDigitalMode() do { ANSELCbits.ANSC3 = 0; } while(0) // get/set RC4 procedures #define RC4_SetHigh() do { LATCbits.LATC4 = 1; } while(0) #define RC4_SetLow() do { LATCbits.LATC4 = 0; } while(0) #define RC4_Toggle() do { LATCbits.LATC4 = ~LATCbits.LATC4; } while(0) #define RC4_GetValue() PORTCbits.RC4 #define RC4_SetDigitalInput() do { TRISCbits.TRISC4 = 1; } while(0) #define RC4_SetDigitalOutput() do { TRISCbits.TRISC4 = 0; } while(0) #define RC4_SetPullup() do { WPUCbits.WPUC4 = 1; } while(0) #define RC4_ResetPullup() do { WPUCbits.WPUC4 = 0; } while(0) // get/set IO_PWRC aliases #define IO_PWRC_TRIS TRISCbits.TRISC5 #define IO_PWRC_LAT LATCbits.LATC5 #define IO_PWRC_PORT PORTCbits.RC5 #define IO_PWRC_WPU WPUCbits.WPUC5 #define IO_PWRC_OD ODCONCbits.ODC5 #define IO_PWRC_SetHigh() do { LATCbits.LATC5 = 1; } while(0) #define IO_PWRC_SetLow() do { LATCbits.LATC5 = 0; } while(0) #define IO_PWRC_Toggle() do { LATCbits.LATC5 = ~LATCbits.LATC5; } while(0) #define IO_PWRC_GetValue() PORTCbits.RC5 #define IO_PWRC_SetDigitalInput() do { TRISCbits.TRISC5 = 1; } while(0) #define IO_PWRC_SetDigitalOutput() do { TRISCbits.TRISC5 = 0; } while(0) #define IO_PWRC_SetPullup() do { WPUCbits.WPUC5 = 1; } while(0) #define IO_PWRC_ResetPullup() do { WPUCbits.WPUC5 = 0; } while(0) #define IO_PWRC_SetPushPull() do { ODCONCbits.ODC5 = 0; } while(0) #define IO_PWRC_SetOpenDrain() do { ODCONCbits.ODC5 = 1; } while(0) // get/set IO_STA aliases #define IO_STA_TRIS TRISCbits.TRISC6 #define IO_STA_LAT LATCbits.LATC6 #define IO_STA_PORT PORTCbits.RC6 #define IO_STA_WPU WPUCbits.WPUC6 #define IO_STA_OD ODCONCbits.ODC6 #define IO_STA_ANS ANSELCbits.ANSC6 #define IO_STA_SetHigh() do { LATCbits.LATC6 = 1; } while(0) #define IO_STA_SetLow() do { LATCbits.LATC6 = 0; } while(0) #define IO_STA_Toggle() do { LATCbits.LATC6 = ~LATCbits.LATC6; } while(0) #define IO_STA_GetValue() PORTCbits.RC6 #define IO_STA_SetDigitalInput() do { TRISCbits.TRISC6 = 1; } while(0) #define IO_STA_SetDigitalOutput() do { TRISCbits.TRISC6 = 0; } while(0) #define IO_STA_SetPullup() do { WPUCbits.WPUC6 = 1; } while(0) #define IO_STA_ResetPullup() do { WPUCbits.WPUC6 = 0; } while(0) #define IO_STA_SetPushPull() do { ODCONCbits.ODC6 = 0; } while(0) #define IO_STA_SetOpenDrain() do { ODCONCbits.ODC6 = 1; } while(0) #define IO_STA_SetAnalogMode() do { ANSELCbits.ANSC6 = 1; } while(0) #define IO_STA_SetDigitalMode() do { ANSELCbits.ANSC6 = 0; } while(0) // get/set IO_SERVOS aliases #define IO_SERVOS_TRIS TRISCbits.TRISC7 #define IO_SERVOS_LAT LATCbits.LATC7 #define IO_SERVOS_PORT PORTCbits.RC7 #define IO_SERVOS_WPU WPUCbits.WPUC7 #define IO_SERVOS_OD ODCONCbits.ODC7 #define IO_SERVOS_ANS ANSELCbits.ANSC7 #define IO_SERVOS_SetHigh() do { LATCbits.LATC7 = 1; } while(0) #define IO_SERVOS_SetLow() do { LATCbits.LATC7 = 0; } while(0) #define IO_SERVOS_Toggle() do { LATCbits.LATC7 = ~LATCbits.LATC7; } while(0) #define IO_SERVOS_GetValue() PORTCbits.RC7 #define IO_SERVOS_SetDigitalInput() do { TRISCbits.TRISC7 = 1; } while(0) #define IO_SERVOS_SetDigitalOutput() do { TRISCbits.TRISC7 = 0; } while(0) #define IO_SERVOS_SetPullup() do { WPUCbits.WPUC7 = 1; } while(0) #define IO_SERVOS_ResetPullup() do { WPUCbits.WPUC7 = 0; } while(0) #define IO_SERVOS_SetPushPull() do { ODCONCbits.ODC7 = 0; } while(0) #define IO_SERVOS_SetOpenDrain() do { ODCONCbits.ODC7 = 1; } while(0) #define IO_SERVOS_SetAnalogMode() do { ANSELCbits.ANSC7 = 1; } while(0) #define IO_SERVOS_SetDigitalMode() do { ANSELCbits.ANSC7 = 0; } while(0) /** @Param none @Returns none @Description GPIO and peripheral I/O initialization @Example PIN_MANAGER_Initialize(); */ void PIN_MANAGER_Initialize (void); /** * @Param none * @Returns none * @Description Interrupt on Change Handling routine * @Example PIN_MANAGER_IOC(); */ void PIN_MANAGER_IOC(void); #endif // PIN_MANAGER_H /** End of File */