Skip to content

add setConfigurationMaxPower() and setConfigurationAttribute #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025

Conversation

hathach
Copy link
Member

@hathach hathach commented May 22, 2025

follow up to #505 , fix #421
This pull request introduces two new methods to the Adafruit_USBD_Device class in src/arduino/Adafruit_USBD_Device.h to enhance configuration management for USB devices. These changes allow setting configuration attributes and specifying maximum power consumption.

Enhancements to USB configuration management:

  • Added setConfigurationAttribute method: This method allows setting the configuration attribute by modifying the bmAttributes field in the configuration descriptor.
  • Added setConfigurationMaxPower method: This method enables setting the maximum power consumption (in mA) for the USB device, with a validation check to ensure the value does not exceed the USB specification's limit of 510mA.

@hathach hathach force-pushed the add-set-maxpower branch from 271f416 to 60fb663 Compare May 22, 2025 04:07
@hathach hathach merged commit 59d4393 into master May 22, 2025
24 checks passed
@hathach hathach deleted the add-set-maxpower branch May 22, 2025 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow setting of USB Power parameter
1 participant