Chapter 2. API Reference
esp_err_t
esp_tusb_deinit_console(int cdc_intf)
Switch log to the default output.
Return esp_err_t
Parameters
• cdc_intf: - interface number of TinyUSB's CDC
Header File
•
components/tinyusb/additions/include/tusb_tasks.h
Functions
esp_err_t
tusb_run_task(void)
This helper function creates and starts a task which wraps tud_task().
The wrapper function basically wraps tud_task and some log. Default parameters: stack size and priority as
configured, argument = NULL, not pinned to any core. If you have more requirements for this task, you can
create your own task which calls tud_task as the last step.
Return Value
• ESP_OK: run tinyusb main task successfully
• ESP_FAIL: run tinyusb main task failed of internal error
• ESP_ERR_INVALID_STATE: tinyusb main task has been created before
esp_err_t
tusb_stop_task(void)
This helper function stops and destroys the task created by tusb_run_task()
Return Value
• ESP_OK: stop and destory tinyusb main task successfully
• ESP_ERR_INVALID_STATE: tinyusb main task hasn't been created yet
Header File
•
components/tinyusb/additions/include/vfs_tinyusb.h
Functions
esp_err_t
esp_vfs_tusb_cdc_register(int cdc_intf, char const *path)
Register TinyUSB CDC at VFS with path.
Return esp_err_t ESP_OK or ESP_FAIL
Parameters
• cdc_intf: - interface number of TinyUSB's CDC
• path: - path where the CDC will be registered, /dev/tusb_cdc will be used if left NULL.
esp_err_t
esp_vfs_tusb_cdc_unregister(char const *path)
Unregister TinyUSB CDC from VFS.
Return esp_err_t ESP_OK or ESP_FAIL
Parameters
• path: - path where the CDC will be unregistered if NULL will be used /dev/tusb_cdc
2.2.25 USB Host
Warning: The USB Host Library API is a beta version thus is subject to change.
The following document lists the API and types of the USB Host Library (that is currently under development).
Espressif Systems
487
Submit Document Feedback
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?