From 1dfac0074baddcbe28c9be11407e8961e576350e Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Sat, 18 May 2024 02:14:33 +0200 Subject: [PATCH] Initial commit --- uart_send_chr.c | 10 ++++++++++ uart_send_str.c | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 uart_send_chr.c create mode 100644 uart_send_str.c diff --git a/uart_send_chr.c b/uart_send_chr.c new file mode 100644 index 0000000..5a2db35 --- /dev/null +++ b/uart_send_chr.c @@ -0,0 +1,10 @@ + +#include "mc8051fun.h" + +void uart_send_chr(char tx_data) +{ + TI = 0; /* Clear TI flag */ + SBUF = tx_data; /* Load char in SBUF register */ + while (TI==0); /* Wait until stop bit transmit */ +} + diff --git a/uart_send_str.c b/uart_send_str.c new file mode 100644 index 0000000..1fbe704 --- /dev/null +++ b/uart_send_str.c @@ -0,0 +1,8 @@ + +#include "mc8051fun.h" + +void uart_send_str(const char *str) +{ + while(*str) + uart_send_chr(*str++); +}