Skip to content

Commit

Permalink
feat(uart):define TX and RX pin
Browse files Browse the repository at this point in the history
-UART_TX_PIN
-UART_RX_PIN
  • Loading branch information
abdullahbagyapan committed Apr 19, 2024
1 parent aa23592 commit 2a6e0a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uart/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ void UART_Init(void) {
uart_init(UART_DEFAULT_INSTANCE, UART_BAUDRATE);

// set gpio 0 & 1 pins as UART
gpio_set_function(0, GPIO_FUNC_UART);
gpio_set_function(1, GPIO_FUNC_UART);
gpio_set_function(UART_TX_PIN, GPIO_FUNC_UART);
gpio_set_function(UART_RX_PIN, GPIO_FUNC_UART);

}

Expand Down
3 changes: 3 additions & 0 deletions uart/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#define UART_DEFAULT_INSTANCE uart0
#define UART_BAUDRATE 115200

#define UART_TX_PIN 0
#define UART_RX_PIN 1


/*================================== Functions ==================================*/

Expand Down

0 comments on commit 2a6e0a7

Please sign in to comment.