summaryrefslogtreecommitdiff
path: root/tinyusb/device/usbd.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-18 18:07:48 +0700
committerhathach <[email protected]>2014-03-18 18:07:48 +0700
commiteab4f9642c27749a3232f09857079a9c9ab7aeb9 (patch)
tree65c054f1a27ac572f2a1664a90b153fc4d5ba028 /tinyusb/device/usbd.h
parent34756f3862d61187b3efec00eda50774ab451a21 (diff)
refractor descriptor passing for device with user-friendly structures
Diffstat (limited to 'tinyusb/device/usbd.h')
-rw-r--r--tinyusb/device/usbd.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/tinyusb/device/usbd.h b/tinyusb/device/usbd.h
index 9a7be465c..684d2fbed 100644
--- a/tinyusb/device/usbd.h
+++ b/tinyusb/device/usbd.h
@@ -43,17 +43,19 @@
#ifndef _TUSB_USBD_H_
#define _TUSB_USBD_H_
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
#include "common/common.h"
-#include "osal/osal.h"
#include "dcd.h"
-#ifdef __cplusplus
- extern "C" {
-#endif
-
+//--------------------------------------------------------------------+
+// MACRO CONSTANT TYPEDEF
+//--------------------------------------------------------------------+
// LPC11uxx and LPC13uxx requires each buffer has to be 64-byte alignment
#if TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX
#define ATTR_USB_MIN_ALIGNMENT ATTR_ALIGNED(64)
@@ -61,9 +63,18 @@
#define ATTR_USB_MIN_ALIGNMENT
#endif
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
+typedef struct {
+ uint8_t * p_device;
+ uint8_t * p_configuration;
+ uint8_t * p_string_arr[TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT];
+
+ uint8_t * p_hid_keyboard_report;
+ uint8_t * p_hid_mouse_report;
+}tusbd_descriptor_pointer_t;
+
+// define by application
+extern tusbd_descriptor_pointer_t tusbd_descriptor_pointers;
+
typedef struct {
void (* const init) (void);
tusb_error_t (* const open)(uint8_t, tusb_descriptor_interface_t const *, uint16_t*);