Skip to content

Commit

Permalink
configure RS pin for CAN PHY (1&2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pi-low committed Mar 11, 2023
1 parent bb9723f commit 35276ca
Show file tree
Hide file tree
Showing 2 changed files with 298 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mcc_generated_files/pin_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ void PIN_MANAGER_Initialize (void)
/****************************************************************************
* Setting the Output Latch SFR(s)
***************************************************************************/
LATA = 0x0400;
LATA = 0x0200;
LATB = 0x0100;
LATC = 0x0000;
LATC = 0x0008;

/****************************************************************************
* Setting the GPIO Direction SFR(s)
***************************************************************************/
TRISA = 0x0387;
TRISA = 0x0187;
TRISB = 0xFEFF;
TRISC = 0x03BF;
TRISC = 0x03B7;

/****************************************************************************
* Setting the Weak Pull Up and Weak Pull Down SFR(s)
Expand All @@ -92,9 +92,9 @@ void PIN_MANAGER_Initialize (void)
/****************************************************************************
* Setting the Analog/Digital Configuration SFR(s)
***************************************************************************/
ANSELA = 0x020A;
ANSELA = 0x000A;
ANSELB = 0x0203;
ANSELC = 0x003F;
ANSELC = 0x0037;

/****************************************************************************
* Set the PPS
Expand Down
292 changes: 292 additions & 0 deletions mcc_generated_files/pin_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,152 @@
*/
#define MCU_FPWM_SetDigitalOutput() (_TRISA10 = 0)
/**
@Summary
Sets the GPIO pin, RA9, high using LATA9.
@Description
Sets the GPIO pin, RA9, high using LATA9.
@Preconditions
The RA9 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Set RA9 high (1)
CAN1_RS_SetHigh();
</code>
*/
#define CAN1_RS_SetHigh() (_LATA9 = 1)
/**
@Summary
Sets the GPIO pin, RA9, low using LATA9.
@Description
Sets the GPIO pin, RA9, low using LATA9.
@Preconditions
The RA9 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Set RA9 low (0)
CAN1_RS_SetLow();
</code>
*/
#define CAN1_RS_SetLow() (_LATA9 = 0)
/**
@Summary
Toggles the GPIO pin, RA9, using LATA9.
@Description
Toggles the GPIO pin, RA9, using LATA9.
@Preconditions
The RA9 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Toggle RA9
CAN1_RS_Toggle();
</code>
*/
#define CAN1_RS_Toggle() (_LATA9 ^= 1)
/**
@Summary
Reads the value of the GPIO pin, RA9.
@Description
Reads the value of the GPIO pin, RA9.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
uint16_t portValue;
// Read RA9
postValue = CAN1_RS_GetValue();
</code>
*/
#define CAN1_RS_GetValue() _RA9
/**
@Summary
Configures the GPIO pin, RA9, as an input.
@Description
Configures the GPIO pin, RA9, as an input.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
// Sets the RA9 as an input
CAN1_RS_SetDigitalInput();
</code>
*/
#define CAN1_RS_SetDigitalInput() (_TRISA9 = 1)
/**
@Summary
Configures the GPIO pin, RA9, as an output.
@Description
Configures the GPIO pin, RA9, as an output.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
// Sets the RA9 as an output
CAN1_RS_SetDigitalOutput();
</code>
*/
#define CAN1_RS_SetDigitalOutput() (_TRISA9 = 0)
/**
@Summary
Sets the GPIO pin, RB1, high using LATB1.
Expand Down Expand Up @@ -638,6 +784,152 @@
*/
#define MCU_MEAS_TEMP_SetDigitalOutput() (_TRISB1 = 0)
/**
@Summary
Sets the GPIO pin, RC3, high using LATC3.
@Description
Sets the GPIO pin, RC3, high using LATC3.
@Preconditions
The RC3 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Set RC3 high (1)
CAN2_RS_SetHigh();
</code>
*/
#define CAN2_RS_SetHigh() (_LATC3 = 1)
/**
@Summary
Sets the GPIO pin, RC3, low using LATC3.
@Description
Sets the GPIO pin, RC3, low using LATC3.
@Preconditions
The RC3 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Set RC3 low (0)
CAN2_RS_SetLow();
</code>
*/
#define CAN2_RS_SetLow() (_LATC3 = 0)
/**
@Summary
Toggles the GPIO pin, RC3, using LATC3.
@Description
Toggles the GPIO pin, RC3, using LATC3.
@Preconditions
The RC3 must be set to an output.
@Returns
None.
@Param
None.
@Example
<code>
// Toggle RC3
CAN2_RS_Toggle();
</code>
*/
#define CAN2_RS_Toggle() (_LATC3 ^= 1)
/**
@Summary
Reads the value of the GPIO pin, RC3.
@Description
Reads the value of the GPIO pin, RC3.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
uint16_t portValue;
// Read RC3
postValue = CAN2_RS_GetValue();
</code>
*/
#define CAN2_RS_GetValue() _RC3
/**
@Summary
Configures the GPIO pin, RC3, as an input.
@Description
Configures the GPIO pin, RC3, as an input.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
// Sets the RC3 as an input
CAN2_RS_SetDigitalInput();
</code>
*/
#define CAN2_RS_SetDigitalInput() (_TRISC3 = 1)
/**
@Summary
Configures the GPIO pin, RC3, as an output.
@Description
Configures the GPIO pin, RC3, as an output.
@Preconditions
None.
@Returns
None.
@Param
None.
@Example
<code>
// Sets the RC3 as an output
CAN2_RS_SetDigitalOutput();
</code>
*/
#define CAN2_RS_SetDigitalOutput() (_TRISC3 = 0)
/**
@Summary
Sets the GPIO pin, RC6, high using LATC6.
Expand Down

0 comments on commit 35276ca

Please sign in to comment.