Skip to content

Commit d55878d

Browse files
feat(uac_host): Add global suspend/resume
1 parent 26f9973 commit d55878d

4 files changed

Lines changed: 742 additions & 54 deletions

File tree

host/class/uac/usb_host_uac/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this component will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [unreleased]
8+
9+
### Added
10+
11+
- Added global suspend/resume support
12+
713
## [1.3.3] - 2025-11-27
814

915
### Changed

host/class/uac/usb_host_uac/include/usb/uac_host.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <stdint.h>
1111
#include "freertos/FreeRTOS.h"
1212
#include "esp_err.h"
13+
#include "usb/usb_host.h"
1314
#include "uac.h"
1415

1516
#ifdef __cplusplus
@@ -36,6 +37,11 @@ extern "C" {
3637
*/
3738
#define FLAG_STREAM_SUSPEND_AFTER_START (1 << 0)
3839

40+
// For backward compatibility with older idf versions without suspend/resume API
41+
#ifdef USB_HOST_LIB_EVENT_FLAGS_AUTO_SUSPEND
42+
#define UAC_HOST_SUSPEND_RESUME_API_SUPPORTED
43+
#endif
44+
3945
typedef struct uac_interface *uac_host_device_handle_t; /*!< Logic Device Handle. Handle to a particular UAC interface */
4046

4147
// ------------------------ USB UAC Host events --------------------------------
@@ -55,6 +61,10 @@ typedef enum {
5561
UAC_HOST_DEVICE_EVENT_TX_DONE, /*!< TX Done: the transmit buffer data size falls below the threshold */
5662
UAC_HOST_DEVICE_EVENT_TRANSFER_ERROR, /*!< UAC Device transfer error */
5763
UAC_HOST_DRIVER_EVENT_DISCONNECTED, /*!< UAC Device has been disconnected */
64+
#ifdef UAC_HOST_SUSPEND_RESUME_API_SUPPORTED
65+
UAC_HOST_DEVICE_EVENT_SUSPENDED, /*!< UAC Device has been suspended */
66+
UAC_HOST_DEVICE_EVENT_RESUMED, /*!< UAC Device has been resumed */
67+
#endif // UAC_HOST_SUSPEND_RESUME_API_SUPPORTED
5868
} uac_host_device_event_t;
5969

6070
// ------------------------ USB UAC Host events callbacks -----------------------------

0 commit comments

Comments
 (0)