Espressif ESP32-S2 Programming Manual page 785

Table of Contents

Advertisement

Chapter 2. API Reference
esp_err_t esp_vfs_register_fd(esp_vfs_id_t
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
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
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
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
Notification from a VFS driver about a read/write/error condition (ISR version)
Espressif Systems
vfs_id, int *fd)
nent, int *fd)
vfs_id, int fd)
sem)
774
Submit Document Feedback
vfs_id, int local_fd, bool perma-
sem, BaseType_t *woken)
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?

Table of Contents

Save PDF