149 lines
5.5 KiB
C
149 lines
5.5 KiB
C
|
/**
|
||
|
@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 : PIC18F26K83
|
||
|
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 IO_RA7 aliases
|
||
|
#define IO_RA7_TRIS TRISAbits.TRISA7
|
||
|
#define IO_RA7_LAT LATAbits.LATA7
|
||
|
#define IO_RA7_PORT PORTAbits.RA7
|
||
|
#define IO_RA7_WPU WPUAbits.WPUA7
|
||
|
#define IO_RA7_OD ODCONAbits.ODCA7
|
||
|
#define IO_RA7_ANS ANSELAbits.ANSELA7
|
||
|
#define IO_RA7_SetHigh() do { LATAbits.LATA7 = 1; } while(0)
|
||
|
#define IO_RA7_SetLow() do { LATAbits.LATA7 = 0; } while(0)
|
||
|
#define IO_RA7_Toggle() do { LATAbits.LATA7 = ~LATAbits.LATA7; } while(0)
|
||
|
#define IO_RA7_GetValue() PORTAbits.RA7
|
||
|
#define IO_RA7_SetDigitalInput() do { TRISAbits.TRISA7 = 1; } while(0)
|
||
|
#define IO_RA7_SetDigitalOutput() do { TRISAbits.TRISA7 = 0; } while(0)
|
||
|
#define IO_RA7_SetPullup() do { WPUAbits.WPUA7 = 1; } while(0)
|
||
|
#define IO_RA7_ResetPullup() do { WPUAbits.WPUA7 = 0; } while(0)
|
||
|
#define IO_RA7_SetPushPull() do { ODCONAbits.ODCA7 = 0; } while(0)
|
||
|
#define IO_RA7_SetOpenDrain() do { ODCONAbits.ODCA7 = 1; } while(0)
|
||
|
#define IO_RA7_SetAnalogMode() do { ANSELAbits.ANSELA7 = 1; } while(0)
|
||
|
#define IO_RA7_SetDigitalMode() do { ANSELAbits.ANSELA7 = 0; } while(0)
|
||
|
|
||
|
// get/set IO_RB0 aliases
|
||
|
#define IO_RB0_TRIS TRISBbits.TRISB0
|
||
|
#define IO_RB0_LAT LATBbits.LATB0
|
||
|
#define IO_RB0_PORT PORTBbits.RB0
|
||
|
#define IO_RB0_WPU WPUBbits.WPUB0
|
||
|
#define IO_RB0_OD ODCONBbits.ODCB0
|
||
|
#define IO_RB0_ANS ANSELBbits.ANSELB0
|
||
|
#define IO_RB0_SetHigh() do { LATBbits.LATB0 = 1; } while(0)
|
||
|
#define IO_RB0_SetLow() do { LATBbits.LATB0 = 0; } while(0)
|
||
|
#define IO_RB0_Toggle() do { LATBbits.LATB0 = ~LATBbits.LATB0; } while(0)
|
||
|
#define IO_RB0_GetValue() PORTBbits.RB0
|
||
|
#define IO_RB0_SetDigitalInput() do { TRISBbits.TRISB0 = 1; } while(0)
|
||
|
#define IO_RB0_SetDigitalOutput() do { TRISBbits.TRISB0 = 0; } while(0)
|
||
|
#define IO_RB0_SetPullup() do { WPUBbits.WPUB0 = 1; } while(0)
|
||
|
#define IO_RB0_ResetPullup() do { WPUBbits.WPUB0 = 0; } while(0)
|
||
|
#define IO_RB0_SetPushPull() do { ODCONBbits.ODCB0 = 0; } while(0)
|
||
|
#define IO_RB0_SetOpenDrain() do { ODCONBbits.ODCB0 = 1; } while(0)
|
||
|
#define IO_RB0_SetAnalogMode() do { ANSELBbits.ANSELB0 = 1; } while(0)
|
||
|
#define IO_RB0_SetDigitalMode() do { ANSELBbits.ANSELB0 = 0; } while(0)
|
||
|
|
||
|
// get/set RB3 procedures
|
||
|
#define RB3_SetHigh() do { LATBbits.LATB3 = 1; } while(0)
|
||
|
#define RB3_SetLow() do { LATBbits.LATB3 = 0; } while(0)
|
||
|
#define RB3_Toggle() do { LATBbits.LATB3 = ~LATBbits.LATB3; } while(0)
|
||
|
#define RB3_GetValue() PORTBbits.RB3
|
||
|
#define RB3_SetDigitalInput() do { TRISBbits.TRISB3 = 1; } while(0)
|
||
|
#define RB3_SetDigitalOutput() do { TRISBbits.TRISB3 = 0; } while(0)
|
||
|
#define RB3_SetPullup() do { WPUBbits.WPUB3 = 1; } while(0)
|
||
|
#define RB3_ResetPullup() do { WPUBbits.WPUB3 = 0; } while(0)
|
||
|
#define RB3_SetAnalogMode() do { ANSELBbits.ANSELB3 = 1; } while(0)
|
||
|
#define RB3_SetDigitalMode() do { ANSELBbits.ANSELB3 = 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
|
||
|
*/
|