summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-04-18 22:31:35 +0700
committerhathach <[email protected]>2019-04-18 22:31:35 +0700
commit307ba23046ff4c0795009c1426708facb37bdf82 (patch)
tree9f0e80d00ee3c44d3937353c860cb84064c20c35 /src/device/usbd.h
parenta30461b078445ab2d11319fade47789ecc866b7d (diff)
wrap up hid device refactor
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index f90c40aab..b3b66768c 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -91,6 +91,13 @@ ATTR_WEAK void tud_suspend_cb(bool remote_wakeup_en);
// Invoked when usb bus is resumed
ATTR_WEAK void tud_resume_cb(void);
+//--------------------------------------------------------------------+
+// Interface Descriptor Template
+//--------------------------------------------------------------------+
+
+#define TUD_CONFIG_DESCRIPTOR(_itfcount, _stridx, _total_len, _attribute, _power_ma) \
+ 9, TUSB_DESC_CONFIGURATION, U16_TO_U8S_LE(_total_len), _itfcount, 1, _stridx, TU_BIT(7) | _attribute, (_power_ma)/2
+
#ifdef __cplusplus
}
#endif