/**
  @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.81.8
        Device            :  PIC18F86K22
        Driver Version    :  2.11
    The generated drivers are tested against the following:
        Compiler          :  XC8 2.36 and above
        MPLAB 	          :  MPLAB X 6.00	
*/

/*
    (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

/**
  Section: Included Files
*/

#include <xc.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 INPUT1 aliases
#define INPUT1_TRIS                 TRISBbits.TRISB0
#define INPUT1_LAT                  LATBbits.LATB0
#define INPUT1_PORT                 PORTBbits.RB0
#define INPUT1_SetHigh()            do { LATBbits.LATB0 = 1; } while(0)
#define INPUT1_SetLow()             do { LATBbits.LATB0 = 0; } while(0)
#define INPUT1_Toggle()             do { LATBbits.LATB0 = ~LATBbits.LATB0; } while(0)
#define INPUT1_GetValue()           PORTBbits.RB0
#define INPUT1_SetDigitalInput()    do { TRISBbits.TRISB0 = 1; } while(0)
#define INPUT1_SetDigitalOutput()   do { TRISBbits.TRISB0 = 0; } while(0)

// get/set INPUT2 aliases
#define INPUT2_TRIS                 TRISBbits.TRISB1
#define INPUT2_LAT                  LATBbits.LATB1
#define INPUT2_PORT                 PORTBbits.RB1
#define INPUT2_SetHigh()            do { LATBbits.LATB1 = 1; } while(0)
#define INPUT2_SetLow()             do { LATBbits.LATB1 = 0; } while(0)
#define INPUT2_Toggle()             do { LATBbits.LATB1 = ~LATBbits.LATB1; } while(0)
#define INPUT2_GetValue()           PORTBbits.RB1
#define INPUT2_SetDigitalInput()    do { TRISBbits.TRISB1 = 1; } while(0)
#define INPUT2_SetDigitalOutput()   do { TRISBbits.TRISB1 = 0; } while(0)

// get/set INPUT3 aliases
#define INPUT3_TRIS                 TRISBbits.TRISB4
#define INPUT3_LAT                  LATBbits.LATB4
#define INPUT3_PORT                 PORTBbits.RB4
#define INPUT3_SetHigh()            do { LATBbits.LATB4 = 1; } while(0)
#define INPUT3_SetLow()             do { LATBbits.LATB4 = 0; } while(0)
#define INPUT3_Toggle()             do { LATBbits.LATB4 = ~LATBbits.LATB4; } while(0)
#define INPUT3_GetValue()           PORTBbits.RB4
#define INPUT3_SetDigitalInput()    do { TRISBbits.TRISB4 = 1; } while(0)
#define INPUT3_SetDigitalOutput()   do { TRISBbits.TRISB4 = 0; } while(0)

// get/set OUTPUT9 aliases
#define OUTPUT9_TRIS                 TRISGbits.TRISG3
#define OUTPUT9_LAT                  LATGbits.LATG3
#define OUTPUT9_PORT                 PORTGbits.RG3
#define OUTPUT9_ANS                  ANCON2bits.ANSEL17
#define OUTPUT9_SetHigh()            do { LATGbits.LATG3 = 1; } while(0)
#define OUTPUT9_SetLow()             do { LATGbits.LATG3 = 0; } while(0)
#define OUTPUT9_Toggle()             do { LATGbits.LATG3 = ~LATGbits.LATG3; } while(0)
#define OUTPUT9_GetValue()           PORTGbits.RG3
#define OUTPUT9_SetDigitalInput()    do { TRISGbits.TRISG3 = 1; } while(0)
#define OUTPUT9_SetDigitalOutput()   do { TRISGbits.TRISG3 = 0; } while(0)
#define OUTPUT9_SetAnalogMode()      do { ANCON2bits.ANSEL17 = 1; } while(0)
#define OUTPUT9_SetDigitalMode()     do { ANCON2bits.ANSEL17 = 0; } while(0)

// get/set OUTPUT10 aliases
#define OUTPUT10_TRIS                 TRISGbits.TRISG4
#define OUTPUT10_LAT                  LATGbits.LATG4
#define OUTPUT10_PORT                 PORTGbits.RG4
#define OUTPUT10_ANS                  ANCON2bits.ANSEL16
#define OUTPUT10_SetHigh()            do { LATGbits.LATG4 = 1; } while(0)
#define OUTPUT10_SetLow()             do { LATGbits.LATG4 = 0; } while(0)
#define OUTPUT10_Toggle()             do { LATGbits.LATG4 = ~LATGbits.LATG4; } while(0)
#define OUTPUT10_GetValue()           PORTGbits.RG4
#define OUTPUT10_SetDigitalInput()    do { TRISGbits.TRISG4 = 1; } while(0)
#define OUTPUT10_SetDigitalOutput()   do { TRISGbits.TRISG4 = 0; } while(0)
#define OUTPUT10_SetAnalogMode()      do { ANCON2bits.ANSEL16 = 1; } while(0)
#define OUTPUT10_SetDigitalMode()     do { ANCON2bits.ANSEL16 = 0; } while(0)

// get/set OUTPUT1 aliases
#define OUTPUT1_TRIS                 TRISHbits.TRISH0
#define OUTPUT1_LAT                  LATHbits.LATH0
#define OUTPUT1_PORT                 PORTHbits.RH0
#define OUTPUT1_ANS                  ANCON2bits.ANSEL23
#define OUTPUT1_SetHigh()            do { LATHbits.LATH0 = 1; } while(0)
#define OUTPUT1_SetLow()             do { LATHbits.LATH0 = 0; } while(0)
#define OUTPUT1_Toggle()             do { LATHbits.LATH0 = ~LATHbits.LATH0; } while(0)
#define OUTPUT1_GetValue()           PORTHbits.RH0
#define OUTPUT1_SetDigitalInput()    do { TRISHbits.TRISH0 = 1; } while(0)
#define OUTPUT1_SetDigitalOutput()   do { TRISHbits.TRISH0 = 0; } while(0)
#define OUTPUT1_SetAnalogMode()      do { ANCON2bits.ANSEL23 = 1; } while(0)
#define OUTPUT1_SetDigitalMode()     do { ANCON2bits.ANSEL23 = 0; } while(0)

// get/set OUTPUT2 aliases
#define OUTPUT2_TRIS                 TRISHbits.TRISH1
#define OUTPUT2_LAT                  LATHbits.LATH1
#define OUTPUT2_PORT                 PORTHbits.RH1
#define OUTPUT2_ANS                  ANCON2bits.ANSEL22
#define OUTPUT2_SetHigh()            do { LATHbits.LATH1 = 1; } while(0)
#define OUTPUT2_SetLow()             do { LATHbits.LATH1 = 0; } while(0)
#define OUTPUT2_Toggle()             do { LATHbits.LATH1 = ~LATHbits.LATH1; } while(0)
#define OUTPUT2_GetValue()           PORTHbits.RH1
#define OUTPUT2_SetDigitalInput()    do { TRISHbits.TRISH1 = 1; } while(0)
#define OUTPUT2_SetDigitalOutput()   do { TRISHbits.TRISH1 = 0; } while(0)
#define OUTPUT2_SetAnalogMode()      do { ANCON2bits.ANSEL22 = 1; } while(0)
#define OUTPUT2_SetDigitalMode()     do { ANCON2bits.ANSEL22 = 0; } while(0)

// get/set OUTPUT3 aliases
#define OUTPUT3_TRIS                 TRISHbits.TRISH2
#define OUTPUT3_LAT                  LATHbits.LATH2
#define OUTPUT3_PORT                 PORTHbits.RH2
#define OUTPUT3_ANS                  ANCON2bits.ANSEL21
#define OUTPUT3_SetHigh()            do { LATHbits.LATH2 = 1; } while(0)
#define OUTPUT3_SetLow()             do { LATHbits.LATH2 = 0; } while(0)
#define OUTPUT3_Toggle()             do { LATHbits.LATH2 = ~LATHbits.LATH2; } while(0)
#define OUTPUT3_GetValue()           PORTHbits.RH2
#define OUTPUT3_SetDigitalInput()    do { TRISHbits.TRISH2 = 1; } while(0)
#define OUTPUT3_SetDigitalOutput()   do { TRISHbits.TRISH2 = 0; } while(0)
#define OUTPUT3_SetAnalogMode()      do { ANCON2bits.ANSEL21 = 1; } while(0)
#define OUTPUT3_SetDigitalMode()     do { ANCON2bits.ANSEL21 = 0; } while(0)

// get/set OUTPUT4 aliases
#define OUTPUT4_TRIS                 TRISHbits.TRISH3
#define OUTPUT4_LAT                  LATHbits.LATH3
#define OUTPUT4_PORT                 PORTHbits.RH3
#define OUTPUT4_ANS                  ANCON2bits.ANSEL20
#define OUTPUT4_SetHigh()            do { LATHbits.LATH3 = 1; } while(0)
#define OUTPUT4_SetLow()             do { LATHbits.LATH3 = 0; } while(0)
#define OUTPUT4_Toggle()             do { LATHbits.LATH3 = ~LATHbits.LATH3; } while(0)
#define OUTPUT4_GetValue()           PORTHbits.RH3
#define OUTPUT4_SetDigitalInput()    do { TRISHbits.TRISH3 = 1; } while(0)
#define OUTPUT4_SetDigitalOutput()   do { TRISHbits.TRISH3 = 0; } while(0)
#define OUTPUT4_SetAnalogMode()      do { ANCON2bits.ANSEL20 = 1; } while(0)
#define OUTPUT4_SetDigitalMode()     do { ANCON2bits.ANSEL20 = 0; } while(0)

// get/set OUTPUT5 aliases
#define OUTPUT5_TRIS                 TRISHbits.TRISH4
#define OUTPUT5_LAT                  LATHbits.LATH4
#define OUTPUT5_PORT                 PORTHbits.RH4
#define OUTPUT5_ANS                  ANCON1bits.ANSEL12
#define OUTPUT5_SetHigh()            do { LATHbits.LATH4 = 1; } while(0)
#define OUTPUT5_SetLow()             do { LATHbits.LATH4 = 0; } while(0)
#define OUTPUT5_Toggle()             do { LATHbits.LATH4 = ~LATHbits.LATH4; } while(0)
#define OUTPUT5_GetValue()           PORTHbits.RH4
#define OUTPUT5_SetDigitalInput()    do { TRISHbits.TRISH4 = 1; } while(0)
#define OUTPUT5_SetDigitalOutput()   do { TRISHbits.TRISH4 = 0; } while(0)
#define OUTPUT5_SetAnalogMode()      do { ANCON1bits.ANSEL12 = 1; } while(0)
#define OUTPUT5_SetDigitalMode()     do { ANCON1bits.ANSEL12 = 0; } while(0)

// get/set OUTPUT6 aliases
#define OUTPUT6_TRIS                 TRISHbits.TRISH5
#define OUTPUT6_LAT                  LATHbits.LATH5
#define OUTPUT6_PORT                 PORTHbits.RH5
#define OUTPUT6_ANS                  ANCON1bits.ANSEL13
#define OUTPUT6_SetHigh()            do { LATHbits.LATH5 = 1; } while(0)
#define OUTPUT6_SetLow()             do { LATHbits.LATH5 = 0; } while(0)
#define OUTPUT6_Toggle()             do { LATHbits.LATH5 = ~LATHbits.LATH5; } while(0)
#define OUTPUT6_GetValue()           PORTHbits.RH5
#define OUTPUT6_SetDigitalInput()    do { TRISHbits.TRISH5 = 1; } while(0)
#define OUTPUT6_SetDigitalOutput()   do { TRISHbits.TRISH5 = 0; } while(0)
#define OUTPUT6_SetAnalogMode()      do { ANCON1bits.ANSEL13 = 1; } while(0)
#define OUTPUT6_SetDigitalMode()     do { ANCON1bits.ANSEL13 = 0; } while(0)

// get/set OUTPUT7 aliases
#define OUTPUT7_TRIS                 TRISHbits.TRISH6
#define OUTPUT7_LAT                  LATHbits.LATH6
#define OUTPUT7_PORT                 PORTHbits.RH6
#define OUTPUT7_ANS                  ANCON1bits.ANSEL14
#define OUTPUT7_SetHigh()            do { LATHbits.LATH6 = 1; } while(0)
#define OUTPUT7_SetLow()             do { LATHbits.LATH6 = 0; } while(0)
#define OUTPUT7_Toggle()             do { LATHbits.LATH6 = ~LATHbits.LATH6; } while(0)
#define OUTPUT7_GetValue()           PORTHbits.RH6
#define OUTPUT7_SetDigitalInput()    do { TRISHbits.TRISH6 = 1; } while(0)
#define OUTPUT7_SetDigitalOutput()   do { TRISHbits.TRISH6 = 0; } while(0)
#define OUTPUT7_SetAnalogMode()      do { ANCON1bits.ANSEL14 = 1; } while(0)
#define OUTPUT7_SetDigitalMode()     do { ANCON1bits.ANSEL14 = 0; } while(0)

// get/set OUTPUT8 aliases
#define OUTPUT8_TRIS                 TRISHbits.TRISH7
#define OUTPUT8_LAT                  LATHbits.LATH7
#define OUTPUT8_PORT                 PORTHbits.RH7
#define OUTPUT8_ANS                  ANCON1bits.ANSEL15
#define OUTPUT8_SetHigh()            do { LATHbits.LATH7 = 1; } while(0)
#define OUTPUT8_SetLow()             do { LATHbits.LATH7 = 0; } while(0)
#define OUTPUT8_Toggle()             do { LATHbits.LATH7 = ~LATHbits.LATH7; } while(0)
#define OUTPUT8_GetValue()           PORTHbits.RH7
#define OUTPUT8_SetDigitalInput()    do { TRISHbits.TRISH7 = 1; } while(0)
#define OUTPUT8_SetDigitalOutput()   do { TRISHbits.TRISH7 = 0; } while(0)
#define OUTPUT8_SetAnalogMode()      do { ANCON1bits.ANSEL15 = 1; } while(0)
#define OUTPUT8_SetDigitalMode()     do { ANCON1bits.ANSEL15 = 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
*/