mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-14 22:16:46 +00:00
feature: Add uart hal support.
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user