feature: Add uart hal support.

This commit is contained in:
houwenxiang
2019-04-17 20:19:44 +08:00
committed by kooho
parent 1dd2443758
commit f27ae9b0e2
44 changed files with 3281 additions and 976 deletions

View File

@@ -86,7 +86,6 @@ static void uart1_deinit(void)
close(uart_fd);
uart_fd = -1;
uart_driver_delete(UART_NUM_1);
UART1.conf0.loopback = 0;
}
static void uart1_init(void)
@@ -96,11 +95,12 @@ static void uart1_init(void)
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.source_clk = UART_SCLK_APB,
};
uart_param_config(UART_NUM_1, &uart_config);
uart_driver_install(UART_NUM_1, 256, 0, 0, NULL, 0);
UART1.conf0.loopback = 1;
uart_param_config(UART_NUM_1, &uart_config);
uart_set_loop_back(UART_NUM_1, true);
if ((uart_fd = open("/dev/uart/1", O_RDWR | O_NONBLOCK)) == -1) {
ESP_LOGE(TAG, "Cannot open UART1");