We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdc07c1 commit 271f416Copy full SHA for 271f416
src/arduino/Adafruit_USBD_Device.h
@@ -80,6 +80,21 @@ class Adafruit_USBD_Device {
80
// Clear/Reset configuration descriptor
81
void clearConfiguration(void);
82
83
+ // Set configuration attribute
84
+ void setConfigurationAttribute(uint8_t attribute) {
85
+ _desc_cfg[offsetof(tusb_desc_configuration_t, bmAttributes)] = attribute;
86
+ }
87
+
88
+ // Set max power consumption in mA (absolute max is 510ma)
89
+ bool setConfigurationMaxPower(uint16_t power_ma) {
90
+ if (power_ma > 255 * 2u) {
91
+ return false;
92
93
+ _desc_cfg[offsetof(tusb_desc_configuration_t, bMaxPower)] =
94
+ (uint8_t)(power_ma / 2);
95
+ return true;
96
97
98
// Provide user buffer for configuration descriptor, if total length > 256
99
void setConfigurationBuffer(uint8_t *buf, uint32_t buflen);
100
0 commit comments