/* * uart_sample * Пример работы с UART. * Эхо - данные, принятые по UART0, отправляются обратно. */ #include "mcom_runtime/mcom02.h" #include "mcom_runtime/uart.h" #define UART_num 0 int main() { short sc = 0; uart_config(UART_num, BAUD115200, UART_8BIT, UART_STOPBIT1, UART_NOPARITY); uart_putstr(UART_num, "\nPrint some symbols to test uart connection...\n"); uart_putchar(0, '>'); for (;;) { /// read data received uart_num sc = uart_getchar(UART_num); /// send back received character to uart_num uart_putchar(UART_num, sc); } return 0; }