[riot-notifications] [RIOT-OS/RIOT] cpu/esp32: add the new API function uart_mode to periph/uart (#11231)

Yegor Yefremov notifications at github.com
Thu Mar 28 14:35:43 CET 2019

At least this is how ESP-IDF sets stop bits: https://github.com/espressif/esp-idf/blob/106dc05903a1691c024bb61ac7b29ca728829671/components/driver/uart.c#L139

esp_err_t uart_set_stop_bits(uart_port_t uart_num, uart_stop_bits_t stop_bit)
    UART_CHECK((uart_num < UART_NUM_MAX), "uart_num error", ESP_FAIL);
    UART_CHECK((stop_bit < UART_STOP_BITS_MAX), "stop bit error", ESP_FAIL);

    //workaround for hardware bug, when uart stop bit set as 2-bit mode.
    if (stop_bit == UART_STOP_BITS_2) {
        stop_bit = UART_STOP_BITS_1;
        UART[uart_num]->rs485_conf.dl1_en = 1;
    } else {
        UART[uart_num]->rs485_conf.dl1_en = 0;
    UART[uart_num]->conf0.stop_bit_num = stop_bit;
    return ESP_OK;

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190328/29fe055d/attachment-0001.html>

More information about the notifications mailing list