Espressif ESP32-S2 Programming Manual page 791

Table of Contents

Advertisement

Chapter 2. API Reference
Note this function is not thread safe w.r.t. writing to UART
Parameters
• mode: line endings to send to UART
int esp_vfs_dev_uart_port_set_rx_line_endings(int uart_num, esp_line_endings_t mode)
Set the line endings expected to be received on specified UART.
This specifies the conversion between line endings received on UART and newlines ('', LF) passed into
stdin:
• ESP_LINE_ENDINGS_CRLF: convert CRLF to LF
• ESP_LINE_ENDINGS_CR: convert CR to LF
• ESP_LINE_ENDINGS_LF: no modification
Note this function is not thread safe w.r.t. reading from UART
Return 0 if successed, or -1 when an error (specified by errno) have occurred.
Parameters
• uart_num: the UART number
• mode: line endings to send to UART
int esp_vfs_dev_uart_port_set_tx_line_endings(int uart_num, esp_line_endings_t mode)
Set the line endings to sent to specified UART.
This specifies the conversion between newlines ('', LF) on stdout and line endings sent over UART:
• ESP_LINE_ENDINGS_CRLF: convert LF to CRLF
• ESP_LINE_ENDINGS_CR: convert LF to CR
• ESP_LINE_ENDINGS_LF: no modification
Note this function is not thread safe w.r.t. writing to UART
Return 0 if successed, or -1 when an error (specified by errno) have occurred.
Parameters
• uart_num: the UART number
• mode: line endings to send to UART
void esp_vfs_dev_uart_use_nonblocking(int uart_num)
set VFS to use simple functions for reading and writing UART Read is non-blocking, write is busy waiting
until TX FIFO has enough space. These functions are used by default.
Parameters
• uart_num: UART peripheral number
void esp_vfs_dev_uart_use_driver(int uart_num)
set VFS to use UART driver for reading and writing
Note application must configure UART driver before calling these functions With these functions, read and
write are blocking and interrupt-driven.
Parameters
• uart_num: UART peripheral number
void esp_vfs_usb_serial_jtag_use_driver(void)
set VFS to use USB-SERIAL-JTAG driver for reading and writing
Note application must configure USB-SERIAL-JTAG driver before calling these functions With these func-
tions, read and write are blocking and interrupt-driven.
void esp_vfs_usb_serial_jtag_use_nonblocking(void)
set VFS to use simple functions for reading and writing UART Read is non-blocking, write is busy waiting
until TX FIFO has enough space. These functions are used by default.
Header File
components/vfs/include/esp_vfs_eventfd.h
Espressif Systems
780
Submit Document Feedback
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF