aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/USBCore.h
diff options
context:
space:
mode:
authorMartino Facchin <m.facchin@arduino.cc>2015-06-26 15:05:57 +0200
committerCristian Maglie <c.maglie@arduino.cc>2015-07-16 13:13:51 +0200
commit3ee0fa126506c623bf45ddcfccce1bf2abd2e41e (patch)
treea041952834b2b07c5b31b1ebba62ab7d701adc45 /cores/arduino/USBCore.h
parentf367bcca2c2938a4b2853df7c58856ef390a4769 (diff)
Add support for waking up a host via USB HID
this is a rework of commit fbcf94801b8bba7f1c8c79cc7ae402b6b9dbb2d3
Diffstat (limited to 'cores/arduino/USBCore.h')
-rw-r--r--cores/arduino/USBCore.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/cores/arduino/USBCore.h b/cores/arduino/USBCore.h
index cd2191c..c19d68a 100644
--- a/cores/arduino/USBCore.h
+++ b/cores/arduino/USBCore.h
@@ -81,6 +81,15 @@
#define USB_INTERFACE_DESCRIPTOR_TYPE 4
#define USB_ENDPOINT_DESCRIPTOR_TYPE 5
+// usb_20.pdf Table 9.6 Standard Feature Selectors
+#define DEVICE_REMOTE_WAKEUP 1
+#define ENDPOINT_HALT 2
+#define TEST_MODE 3
+
+// usb_20.pdf Figure 9-4. Information Returned by a GetStatus() Request to a Device
+#define FEATURE_SELFPOWERED_ENABLED (1 << 0)
+#define FEATURE_REMOTE_WAKEUP_ENABLED (1 << 1)
+
#define USB_DEVICE_CLASS_COMMUNICATIONS 0x02
#define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03
#define USB_DEVICE_CLASS_STORAGE 0x08
@@ -264,7 +273,7 @@ typedef struct
{ 18, 1, 0x200, _class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs }
#define D_CONFIG(_totalLength,_interfaces) \
- { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED, USB_CONFIG_POWER_MA(500) }
+ { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(500) }
#define D_INTERFACE(_n,_numEndpoints,_class,_subClass,_protocol) \
{ 9, 4, _n, 0, _numEndpoints, _class,_subClass, _protocol, 0 }