1 |
/** |
---|
2 |
Generated Pin Manager File |
---|
3 |
|
---|
4 |
Company: |
---|
5 |
Microchip Technology Inc. |
---|
6 |
|
---|
7 |
File Name: |
---|
8 |
pin_manager.c |
---|
9 |
|
---|
10 |
Summary: |
---|
11 |
This is the Pin Manager file generated using PIC10 / PIC12 / PIC16 / PIC18 MCUs |
---|
12 |
|
---|
13 |
Description: |
---|
14 |
This header file provides implementations for pin APIs for all pins selected in the GUI. |
---|
15 |
Generation Information : |
---|
16 |
Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65.2 |
---|
17 |
Device : PIC16F1579 |
---|
18 |
Driver Version : 2.11 |
---|
19 |
The generated drivers are tested against the following: |
---|
20 |
Compiler : XC8 1.45 |
---|
21 |
MPLAB : MPLAB X 4.15 |
---|
22 |
|
---|
23 |
Copyright (c) 2013 - 2015 released Microchip Technology Inc. All rights reserved. |
---|
24 |
*/ |
---|
25 |
|
---|
26 |
/* |
---|
27 |
(c) 2018 Microchip Technology Inc. and its subsidiaries. |
---|
28 |
|
---|
29 |
Subject to your compliance with these terms, you may use Microchip software and any |
---|
30 |
derivatives exclusively with Microchip products. It is your responsibility to comply with third party |
---|
31 |
license terms applicable to your use of third party software (including open source software) that |
---|
32 |
may accompany Microchip software. |
---|
33 |
|
---|
34 |
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER |
---|
35 |
EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY |
---|
36 |
IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS |
---|
37 |
FOR A PARTICULAR PURPOSE. |
---|
38 |
|
---|
39 |
IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, |
---|
40 |
INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND |
---|
41 |
WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP |
---|
42 |
HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO |
---|
43 |
THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL |
---|
44 |
CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT |
---|
45 |
OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS |
---|
46 |
SOFTWARE. |
---|
47 |
*/ |
---|
48 |
|
---|
49 |
#include <xc.h> |
---|
50 |
#include "pin_manager.h" |
---|
51 |
#include "stdbool.h" |
---|
52 |
|
---|
53 |
|
---|
54 |
|
---|
55 |
|
---|
56 |
|
---|
57 |
void PIN_MANAGER_Initialize(void) |
---|
58 |
{ |
---|
59 |
/** |
---|
60 |
LATx registers |
---|
61 |
*/ |
---|
62 |
LATA = 0x30; |
---|
63 |
LATB = 0x10; |
---|
64 |
LATC = 0x00; |
---|
65 |
|
---|
66 |
/** |
---|
67 |
TRISx registers |
---|
68 |
*/ |
---|
69 |
TRISA = 0x00; |
---|
70 |
TRISB = 0x00; |
---|
71 |
TRISC = 0x6E; |
---|
72 |
|
---|
73 |
/** |
---|
74 |
ANSELx registers |
---|
75 |
*/ |
---|
76 |
ANSELC = 0x06; |
---|
77 |
ANSELB = 0x00; |
---|
78 |
ANSELA = 0x00; |
---|
79 |
|
---|
80 |
/** |
---|
81 |
WPUx registers |
---|
82 |
*/ |
---|
83 |
WPUB = 0x00; |
---|
84 |
WPUA = 0x00; |
---|
85 |
WPUC = 0x00; |
---|
86 |
OPTION_REGbits.nWPUEN = 1; |
---|
87 |
|
---|
88 |
/** |
---|
89 |
ODx registers |
---|
90 |
*/ |
---|
91 |
ODCONA = 0x00; |
---|
92 |
ODCONB = 0x00; |
---|
93 |
ODCONC = 0x00; |
---|
94 |
|
---|
95 |
/** |
---|
96 |
SLRCONx registers |
---|
97 |
*/ |
---|
98 |
SLRCONA = 0x37; |
---|
99 |
SLRCONB = 0xF0; |
---|
100 |
SLRCONC = 0xFF; |
---|
101 |
|
---|
102 |
|
---|
103 |
|
---|
104 |
|
---|
105 |
|
---|
106 |
|
---|
107 |
|
---|
108 |
|
---|
109 |
RXPPS = 0x13; //RC3->EUSART:RX; |
---|
110 |
T1GPPS = 0x13; //RC3->TMR1:T1G; |
---|
111 |
RB6PPS = 0x04; //RB6->PWM2:PWM2OUT; |
---|
112 |
RB7PPS = 0x05; //RB7->PWM3:PWM3OUT; |
---|
113 |
RB5PPS = 0x03; //RB5->PWM1:PWM1OUT; |
---|
114 |
RC4PPS = 0x09; //RC4->EUSART:TX; |
---|
115 |
} |
---|
116 |
|
---|
117 |
void PIN_MANAGER_IOC(void) |
---|
118 |
{ |
---|
119 |
} |
---|
120 |
|
---|
121 |
/** |
---|
122 |
End of File |
---|
123 |
*/ |
---|