From 8324fbe84bfc3e34bba82117c1a8d3b777116243 Mon Sep 17 00:00:00 2001 From: Miducc Date: Fri, 23 Jun 2023 09:49:30 +0700 Subject: [PATCH] Config UART with N81 settings; no receive, break character function and interrupt disabled --- inc/uart_configuration.h | 9 +++++++++ src/uart_configuration.c | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 inc/uart_configuration.h create mode 100644 src/uart_configuration.c diff --git a/inc/uart_configuration.h b/inc/uart_configuration.h new file mode 100644 index 0000000..aa60d8b --- /dev/null +++ b/inc/uart_configuration.h @@ -0,0 +1,9 @@ +#ifndef _UART_CONFIGURATION_ +#define _UART_CONFIGURATION_ + +#include "stdint.h" + +void uart_init(); +void uart_transmit(uint8_t data); + +#endif \ No newline at end of file diff --git a/src/uart_configuration.c b/src/uart_configuration.c new file mode 100644 index 0000000..fc47851 --- /dev/null +++ b/src/uart_configuration.c @@ -0,0 +1,21 @@ +#include "BA45F5250.h" +#include "stdint.h" +#include "build-in.h" +#include "uart_configuration.h" + +void uart_init() +{ + _pbs0 = 0b11001100; + _simc0 = 0b11100000; + _ucr1 = 0b10000000; + _ucr2 = 0b10100000; + _brg = 0b00000011; + _sime = 0; + _simf = 0; +} + +void uart_transmit(uint8_t data) +{ + _txr_rxr = data; + while (!_tidle); +} \ No newline at end of file