3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
Content
Loading...
Searching...
No Matches
pins.c
Go to the documentation of this file.
1
17
/*
18
© [2024] Microchip Technology Inc. and its subsidiaries.
19
20
Subject to your compliance with these terms, you may use Microchip
21
software and any derivatives exclusively with Microchip products.
22
You are responsible for complying with 3rd party license terms
23
applicable to your use of 3rd party software (including open source
24
software) that may accompany Microchip software. SOFTWARE IS ?AS IS.?
25
NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS
26
SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
27
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
28
WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
29
INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY
30
KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
31
MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
32
FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S
33
TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT
34
EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR
35
THIS SOFTWARE.
36
*/
37
38
// Section: Includes
39
#include <xc.h>
40
#include <stddef.h>
41
#include "../pins.h"
42
43
// Section: File specific functions
44
45
// Section: Driver Interface Function Definitions
46
void
PINS_Initialize
(
void
)
47
{
48
51
LATA = 0x0000;
52
LATB = 0x0000;
53
LATC = 0x0000;
54
LATD = 0x0000;
55
56
59
TRISA = 0x001F;
60
TRISB = 0xF7FF;
61
TRISC = 0xFFFF;
62
TRISD = 0x5FFF;
63
64
65
68
CNPUA = 0x0000;
69
CNPUB = 0x0400;
70
CNPUC = 0x0000;
71
CNPUD = 0x0000;
72
CNPDA = 0x0000;
73
CNPDB = 0x0000;
74
CNPDC = 0x0100;
75
CNPDD = 0x0000;
76
77
78
81
ODCA = 0x0000;
82
ODCB = 0x0000;
83
ODCC = 0x0000;
84
ODCD = 0x0000;
85
86
87
90
ANSELA = 0x001F;
91
ANSELB = 0x0386;
92
ANSELC = 0x00CF;
93
ANSELD = 0x5C00;
94
95
98
__builtin_write_RPCON(0x0000);
// unlock PPS
99
100
RPINR20bits.SCK1R = 0x0038;
//RC8->SPI1:SCK1IN;
101
RPINR20bits.SDI1R = 0x002C;
//RB12->SPI1:SDI1;
102
RPINR26bits.CAN1RXR = 0x002A;
//RB10->CAN1:CAN1RX;
103
RPOR5bits.RP43R = 0x0015;
//RB11->CAN1:CAN1TX;
104
105
__builtin_write_RPCON(0x0800);
// lock PPS
106
107
108
}
109
PINS_Initialize
void PINS_Initialize(void)
Initializes the PINS module.
Definition
pins.c:46
© Copyright 1998-2022 Microchip Technology Inc. All rights reserved.