File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 4646 - type : input
4747 attributes :
4848 label : TinyUSB Library version
49- placeholder : " Release version or github latest "
49+ placeholder : " Release version or commit SHA "
5050 validations :
5151 required : true
5252
Original file line number Diff line number Diff line change @@ -80,6 +80,21 @@ class Adafruit_USBD_Device {
8080 // Clear/Reset configuration descriptor
8181 void clearConfiguration (void );
8282
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+
8398 // Provide user buffer for configuration descriptor, if total length > 256
8499 void setConfigurationBuffer (uint8_t *buf, uint32_t buflen);
85100
You can’t perform that action at this time.
0 commit comments