Skip to content

Commit

Permalink
feat(uart):add uart module
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullahbagyapan committed Apr 19, 2024
1 parent 4b5828a commit ab5059e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
21 changes: 21 additions & 0 deletions uart/uart.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
@module: UART
@author: Abdullah Bagyapan
@date: 18/04/2024
*/

/*================================== Libraries ==================================*/

#include "uart.h"

#include "pico/stdlib.h"


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


void UART_Init(void) {

stdio_uart_init_full(UART_INSTANCE, UART_BAUDRATE, UART_TX_PIN, UART_RX_PIN);

}
35 changes: 35 additions & 0 deletions uart/uart.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
@module: UART
@author: Abdullah Bagyapan
@date: 18/04/2024
*/

/*================================== Libraries ==================================*/

#include "pico/stdlib.h"


/*================================== Defined Variables ==================================*/

#define UART_INSTANCE uart0
#define UART_BAUDRATE 115200

#define UART_TX_PIN 0
#define UART_RX_PIN 1


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


/*
@brief: Initialize UART module
@author Abdullah Bagyapan
@date 18/04/2024
@param None
@return None
*/
void UART_Init(void);

0 comments on commit ab5059e

Please sign in to comment.