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