Skip to content

Commit

Permalink
Fix UART2 pins not matching labels
Browse files Browse the repository at this point in the history
  • Loading branch information
bessman committed Aug 19, 2024
1 parent 6913f50 commit 5728b36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/registers/system/pin_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ void PIN_MANAGER_Initialize(void) {
***************************************************************************/
RPOR2bits.RP39R = RPN_U1TX_PORT; //RB7->UART1:U1TX
RPINR18bits.U1RXR = RPI_RP40; //RB8->UART1:U1RX
RPOR2bits.RP38R = RPN_U2TX_PORT; // RB6->UART2:U2TX
RPINR19bits.U2RXR = RPI_RP37; // RB5->UART2:U2RX
RPOR1bits.RP37R = RPN_U2TX_PORT; // RB5->UART2:U2TX
RPINR19bits.U2RXR = RPI_RP38; // RB6->UART2:U2RX

LED_SetHigh();
}
Expand Down
26 changes: 13 additions & 13 deletions src/registers/system/pin_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@
#define UART1_TX_SetDigitalInput() (_TRISB7 = 1)
#define UART1_TX_SetDigitalOutput() (_TRISB7 = 0)

#define UART2_RX_SetHigh() (_LATB5 = 1)
#define UART2_RX_SetLow() (_LATB5 = 0)
#define UART2_RX_Toggle() (_LATB5 ^= 1)
#define UART2_RX_GetValue() _RB5
#define UART2_RX_SetDigitalInput() (_TRISB5 = 1)
#define UART2_RX_SetDigitalOutput() (_TRISB5 = 0)

#define UART2_TX_SetHigh() (_LATB6 = 1)
#define UART2_TX_SetLow() (_LATB6 = 0)
#define UART2_TX_Toggle() (_LATB6 ^= 1)
#define UART2_TX_GetValue() _RB6
#define UART2_TX_SetDigitalInput() (_TRISB6 = 1)
#define UART2_TX_SetDigitalOutput() (_TRISB6 = 0)
#define UART2_RX_SetHigh() (_LATB6 = 1)
#define UART2_RX_SetLow() (_LATB6 = 0)
#define UART2_RX_Toggle() (_LATB6 ^= 1)
#define UART2_RX_GetValue() _RB6
#define UART2_RX_SetDigitalInput() (_TRISB6 = 1)
#define UART2_RX_SetDigitalOutput() (_TRISB6 = 0)

#define UART2_TX_SetHigh() (_LATB5 = 1)
#define UART2_TX_SetLow() (_LATB5 = 0)
#define UART2_TX_Toggle() (_LATB5 ^= 1)
#define UART2_TX_GetValue() _RB5
#define UART2_TX_SetDigitalInput() (_TRISB5 = 1)
#define UART2_TX_SetDigitalOutput() (_TRISB5 = 0)

/*******************************************************************************
* Oscilloscope
Expand Down

0 comments on commit 5728b36

Please sign in to comment.