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