summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorWini-Buh <[email protected]>2021-05-29 21:23:39 +0200
committerWini-Buh <[email protected]>2021-05-29 21:23:39 +0200
commitb4f092ec74d85d4e5567ebb45e1bd0dec20f0e02 (patch)
treef325fe267004a5368da6eb2bcd100a6026d46646 /src/device/usbd.h
parent4e2684f23aacfd9a08046c2a60da50bd1af09a27 (diff)
Adaptations for Renesas CCRX toolchain and Rx72N controller performed
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h74
1 files changed, 70 insertions, 4 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 53519c4de..04597a215 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -103,10 +103,6 @@ bool tud_control_status(uint8_t rhport, tusb_control_request_t const * request);
// Application return pointer to descriptor
uint8_t const * tud_descriptor_device_cb(void);
-// Invoked when received GET BOS DESCRIPTOR request
-// Application return pointer to descriptor
-TU_ATTR_WEAK uint8_t const * tud_descriptor_bos_cb(void);
-
// Invoked when received GET CONFIGURATION DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
uint8_t const * tud_descriptor_configuration_cb(uint8_t index);
@@ -115,6 +111,11 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index);
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid);
+#if !defined(TU_HAS_NO_ATTR_WEAK)
+// Invoked when received GET BOS DESCRIPTOR request
+// Application return pointer to descriptor
+TU_ATTR_WEAK uint8_t const * tud_descriptor_bos_cb(void);
+
// Invoked when received GET DEVICE QUALIFIER DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
TU_ATTR_WEAK uint8_t const* tud_descriptor_device_qualifier_cb(void);
@@ -135,6 +136,71 @@ TU_ATTR_WEAK void tud_resume_cb(void);
// Invoked when received control request with VENDOR TYPE
TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
+#else
+ #if ADD_WEAK_FUNC_TUD_DESCRIPTOR_BOS_CB
+ #define TUD_DESCRIPTOR_BOS_CB tud_descriptor_bos_cb
+ #endif
+ #ifndef TUD_DESCRIPTOR_BOS_CB
+ #define TUD_DESCRIPTOR_BOS_CB NULL
+ #else
+ extern uint8_t const* TUD_DESCRIPTOR_BOS_CB(void);
+ #endif
+
+ #if ADD_WEAK_FUNC_TUD_DESCRIPTOR_DEVICE_QUALIFIER_CB
+ #define TUD_DESCRIPTOR_DEVICE_QUALIFIER_CB tud_descriptor_device_qualifier_cb
+ #endif
+ #ifndef TUD_DESCRIPTOR_DEVICE_QUALIFIER_CB
+ #define TUD_DESCRIPTOR_DEVICE_QUALIFIER_CB NULL
+ #else
+ extern uint8_t const* TUD_DESCRIPTOR_DEVICE_QUALIFIER_CB(void);
+ #endif
+
+ #if ADD_WEAK_FUNC_TUD_MOUNT_CB
+ #define TUD_MOUNT_CB tud_mount_cb
+ #endif
+ #ifndef TUD_MOUNT_CB
+ #define TUD_MOUNT_CB NULL
+ #else
+ extern void TUD_MOUNT_CB(void);
+ #endif
+
+ #if ADD_WEAK_FUNC_TUD_UMOUNT_CB
+ #define TUD_UMOUNT_CB tud_umount_cb
+ #endif
+ #ifndef TUD_UMOUNT_CB
+ #define TUD_UMOUNT_CB NULL
+ #else
+ extern void TUD_UMOUNT_CB(void);
+ #endif
+
+ #if ADD_WEAK_FUNC_TUD_SUSPEND_CB
+ #define TUD_SUSPEND_CB tud_suspend_cb
+ #endif
+ #ifndef TUD_SUSPEND_CB
+ #define TUD_SUSPEND_CB NULL
+ #else
+ extern void TUD_SUSPEND_CB(bool remote_wakeup_en);
+ #endif
+
+ #if ADD_WEAK_FUNC_TUD_RESUME_CB
+ #define TUD_RESUME_CB tud_resume_cb
+ #endif
+ #ifndef TUD_RESUME_CB
+ #define TUD_RESUME_CB NULL
+ #else
+ extern void TUD_RESUME_CB(void);
+ #endif
+
+ #if ADD_WEAK_FUNC_TUD_VENDOR_CONTROL_XFER_CB
+ #define TUD_VENDOR_CONTROL_XFER_CB tud_vendor_control_xfer_cb
+ #endif
+ #ifndef TUD_VENDOR_CONTROL_XFER_CB
+ #define TUD_VENDOR_CONTROL_XFER_CB NULL
+ #else
+ extern bool TUD_VENDOR_CONTROL_XFER_CB(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
+ #endif
+#endif
+
//--------------------------------------------------------------------+
// Binary Device Object Store (BOS) Descriptor Templates
//--------------------------------------------------------------------+