Skip to content

Commit

Permalink
usb-device: Allow signaling capability of remote_wakeup.
Browse files Browse the repository at this point in the history
To use this feature you need to create a usb device signaling remote wakeup
and then enable remote wakeup on the host (on linux write enabled to
/sys/bus/usb/devices/<device>/power/wakeup). Then you can wake up the host
when is on standby using USBDevice.remote_wakeup.

Signed-off-by: Felix Dörre <[email protected]>
  • Loading branch information
felixdoerre committed Jul 6, 2024
1 parent fbf7e12 commit 6b37987
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion micropython/usb/usb-device/manifest.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
metadata(version="0.1.0")
metadata(version="0.1.1")
package("usb")
3 changes: 2 additions & 1 deletion micropython/usb/usb-device/usb/device/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def config( # noqa: PLR0913
device_protocol=0,
config_str=None,
max_power_ma=None,
remote_wakeup=False,
):
# Configure the USB device with a set of interfaces, and optionally reconfiguring the
# device and configuration descriptor fields
Expand Down Expand Up @@ -189,7 +190,7 @@ def maybe_set(value, idx):
bmAttributes = (
(1 << 7) # Reserved
| (0 if max_power_ma else (1 << 6)) # Self-Powered
# Remote Wakeup not currently supported
| ((1 << 5) if remote_wakeup else 0)
)

# Configuration string is optional but supported
Expand Down

0 comments on commit 6b37987

Please sign in to comment.