EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #785 background imageLoading...
Page #785 background image
Chapter 2. API Reference
esp_err_t esp_vfs_register_fd(esp_vfs_id_t vfs_id, int *fd)
Special function for registering another file descriptor for a VFS registered by esp_vfs_register_with_id.
Return ESP_OK if the registration is successful, ESP_ERR_NO_MEM if too many file descriptors are reg-
istered, ESP_ERR_INVALID_ARG if the arguments are incorrect.
Parameters
vfs_id: VFS identificator returned by esp_vfs_register_with_id.
fd: The registered file descriptor will be written to this address.
esp_err_t esp_vfs_register_fd_with_local_fd(esp_vfs_id_t vfs_id, int local_fd, bool perma-
nent, int *fd)
Special function for registering another file descriptor with given local_fd for a VFS registered by
esp_vfs_register_with_id.
Return ESP_OK if the registration is successful, ESP_ERR_NO_MEM if too many file descriptors are reg-
istered, ESP_ERR_INVALID_ARG if the arguments are incorrect.
Parameters
vfs_id: VFS identificator returned by esp_vfs_register_with_id.
local_fd: The fd in the local vfs. Passing -1 will set the local fd as the (*fd) value.
permanent: Whether the fd should be treated as permannet (not removed after close())
fd: The registered file descriptor will be written to this address.
esp_err_t esp_vfs_unregister_fd(esp_vfs_id_t vfs_id, int fd)
Special function for unregistering a file descriptor belonging to a VFS registered by esp_vfs_register_with_id.
Return ESP_OK if the registration is successful, ESP_ERR_INVALID_ARG if the arguments are incorrect.
Parameters
vfs_id: VFS identificator returned by esp_vfs_register_with_id.
fd: File descriptor which should be unregistered.
int esp_vfs_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval
*timeout)
Synchronous I/O multiplexing which implements the functionality of POSIX select() for VFS.
Return The number of descriptors set in the descriptor sets, or -1 when an error (specified by errno) have
occurred.
Parameters
nfds: Specifies the range of descriptors which should be checked. The first nfds descriptors will
be checked in each set.
readfds: If not NULL, then points to a descriptor set that on input specifies which descriptors
should be checked for being ready to read, and on output indicates which descriptors are ready to
read.
writefds: If not NULL, then points to a descriptor set that on input specifies which descriptors
should be checked for being ready to write, and on output indicates which descriptors are ready to
write.
errorfds: If not NULL, then points to a descriptor set that on input specifies which descrip-
tors should be checked for error conditions, and on output indicates which descriptors have error
conditions.
timeout: If not NULL, then points to timeval structure which specifies the time period after which
the functions should time-out and return. If it is NULL, then the function will not time-out. Note
that the timeout period is rounded up to the system tick and incremented by one.
void esp_vfs_select_triggered(esp_vfs_select_sem_t sem)
Notification from a VFS driver about a read/write/error condition.
This function is called when the VFS driver detects a read/write/error condition as it was requested by the
previous call to start_select.
Parameters
sem: semaphore structure which was passed to the driver by the start_select call
void esp_vfs_select_triggered_isr(esp_vfs_select_sem_t sem, BaseType_t *woken)
Notification from a VFS driver about a read/write/error condition (ISR version)
Espressif Systems 774
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish