feat(usb_device_uac): add I2S example and volume dB callback (AEGHB-1254) #593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR enhances the USB Device UAC component with better volume control support and adds a new example demonstrating I2S audio integration.
Closes: #586
Component Changes
Added a new
set_volume_db_cbcallback to theuac_device_config_tstructure that provides volume changes in decibels (dB), complementing the existing percentage-basedset_volume_cb. This allows applications to implement more accurate gain control using logarithmic scaling.New Example: usb_uac_i2s
Added a comprehensive example (
examples/usb/device/usb_uac_i2s) demonstrating USB Audio Class integration with I2S peripherals:Features:
Hardware Support:
Documentation Updates
Updated both English and Chinese documentation (
docs/en/usb/usb_device/usb_device_uac.rstanddocs/zh_CN/usb/usb_device/usb_device_uac.rst) with:set_volume_db_cbcallbackRelated
usb_uacexample but demonstrates I2S peripheral integrationTesting
Test Environment:
Checklist
Before submitting a Pull Request, please ensure the following: