]> git.sur5r.net Git - armstart-ibdap/blobdiff - inc/usbd/usbd_rom_api.h
initial commit
[armstart-ibdap] / inc / usbd / usbd_rom_api.h
diff --git a/inc/usbd/usbd_rom_api.h b/inc/usbd/usbd_rom_api.h
new file mode 100644 (file)
index 0000000..b00bb52
--- /dev/null
@@ -0,0 +1,92 @@
+/***********************************************************************\r
+* $Id:: mw_usbd_rom_api.h 331 2012-08-09 18:54:34Z usb10131                   $\r
+*\r
+* Project: USB device ROM Stack\r
+*\r
+* Description:\r
+*     ROM API Module definitions.\r
+*\r
+***********************************************************************\r
+*   Copyright(C) 2011, NXP Semiconductor\r
+*   All rights reserved.\r
+*\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+#ifndef __MW_USBD_ROM_API_H\r
+#define __MW_USBD_ROM_API_H\r
+/** \file\r
+ *  \brief ROM API for USB device stack.\r
+ *\r
+ *  Definition of functions exported by ROM based USB device stack.\r
+ *\r
+ */\r
+\r
+#include "error.h"\r
+#include "usbd.h"\r
+#include "usbd_hw.h"\r
+#include "usbd_core.h"\r
+#include "usbd_mscuser.h"\r
+#include "usbd_dfuuser.h"\r
+#include "usbd_hiduser.h"\r
+#include "usbd_cdcuser.h"\r
+\r
+/** \brief Main USBD API functions structure.\r
+ *  \ingroup Group_USBD\r
+ *\r
+ *  This structure contains pointer to various USB Device stack's sub-module \r
+ *  function tables. This structure is used as main entry point to access\r
+ *  various methods (grouped in sub-modules) exposed by ROM based USB device \r
+ *  stack.\r
+ *\r
+ */\r
+typedef struct USBD_API \r
+{\r
+  const USBD_HW_API_T* hw; /**< Pointer to function table which exposes functions \r
+                           which interact directly with USB device stack's core \r
+                           layer.*/\r
+  const USBD_CORE_API_T* core; /**< Pointer to function table which exposes functions \r
+                           which interact directly with USB device controller \r
+                           hardware.*/\r
+  const USBD_MSC_API_T* msc; /**< Pointer to function table which exposes functions \r
+                           provided by MSC function driver module.\r
+                           */\r
+  const USBD_DFU_API_T* dfu; /**< Pointer to function table which exposes functions \r
+                           provided by DFU function driver module.\r
+                           */\r
+  const USBD_HID_API_T* hid; /**< Pointer to function table which exposes functions \r
+                           provided by HID function driver module.\r
+                           */\r
+  const USBD_CDC_API_T* cdc; /**< Pointer to function table which exposes functions \r
+                           provided by CDC-ACM function driver module.\r
+                           */\r
+  const uint32_t* reserved6; /**< Reserved for future function driver module.\r
+                           */\r
+  const uint32_t version; /**< Version identifier of USB ROM stack. The version is\r
+                          defined as 0x0CHDMhCC where each nibble represents version\r
+                          number of the corresponding component.\r
+                          CC -  7:0  - 8bit core version number\r
+                           h - 11:8  - 4bit hardware interface version number\r
+                           M - 15:12 - 4bit MSC class module version number\r
+                           D - 19:16 - 4bit DFU class module version number\r
+                           H - 23:20 - 4bit HID class module version number\r
+                           C - 27:24 - 4bit CDC class module version number\r
+                           H - 31:28 - 4bit reserved \r
+                           */\r
+\r
+} USBD_API_T;\r
+\r
+/* Applications using USBD ROM API should define this instance. The pointer should be assigned a value computed based on chip definitions. */ \r
+extern const USBD_API_T* g_pUsbApi;\r
+#define USBD_API g_pUsbApi\r
+\r
+#endif /*__MW_USBD_ROM_API_H*/\r
+\r