Config UART with N81 settings; no receive, break character function and interrupt disabled

This commit is contained in:
Miducc
2023-06-23 09:49:30 +07:00
parent ca87312d05
commit 8324fbe84b
2 changed files with 30 additions and 0 deletions

9
inc/uart_configuration.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef _UART_CONFIGURATION_
#define _UART_CONFIGURATION_
#include "stdint.h"
void uart_init();
void uart_transmit(uint8_t data);
#endif

21
src/uart_configuration.c Normal file
View File

@@ -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);
}