1 /*********************************************************************** 2 * $Id:: mw_usbd_rom_api.h 331 2012-08-09 18:54:34Z usb10131 $ 3 * 4 * Project: USB device ROM Stack 5 * 6 * Description: 7 * ROM API Module definitions. 8 * 9 *********************************************************************** 10 * Copyright(C) 2011, NXP Semiconductor 11 * All rights reserved. 12 * 13 * Software that is described herein is for illustrative purposes only 14 * which provides customers with programming information regarding the 15 * products. This software is supplied "AS IS" without any warranties. 16 * NXP Semiconductors assumes no responsibility or liability for the 17 * use of the software, conveys no license or title under any patent, 18 * copyright, or mask work right to the product. NXP Semiconductors 19 * reserves the right to make changes in the software without 20 * notification. NXP Semiconductors also make no representation or 21 * warranty that such application will be suitable for the specified 22 * use without further testing or modification. 23 **********************************************************************/ 24 #ifndef __MW_USBD_ROM_API_H 25 #define __MW_USBD_ROM_API_H 26 /** \file 27 * \brief ROM API for USB device stack. 28 * 29 * Definition of functions exported by ROM based USB device stack. 30 * 31 */ 32 33 #include "error.h" 34 #include "usbd.h" 35 #include "usbd_hw.h" 36 #include "usbd_core.h" 37 #include "usbd_mscuser.h" 38 #include "usbd_dfuuser.h" 39 #include "usbd_hiduser.h" 40 #include "usbd_cdcuser.h" 41 42 /** \brief Main USBD API functions structure. 43 * \ingroup Group_USBD 44 * 45 * This structure contains pointer to various USB Device stack's sub-module 46 * function tables. This structure is used as main entry point to access 47 * various methods (grouped in sub-modules) exposed by ROM based USB device 48 * stack. 49 * 50 */ 51 typedef struct USBD_API 52 { 53 const USBD_HW_API_T* hw; /**< Pointer to function table which exposes functions 54 which interact directly with USB device stack's core 55 layer.*/ 56 const USBD_CORE_API_T* core; /**< Pointer to function table which exposes functions 57 which interact directly with USB device controller 58 hardware.*/ 59 const USBD_MSC_API_T* msc; /**< Pointer to function table which exposes functions 60 provided by MSC function driver module. 61 */ 62 const USBD_DFU_API_T* dfu; /**< Pointer to function table which exposes functions 63 provided by DFU function driver module. 64 */ 65 const USBD_HID_API_T* hid; /**< Pointer to function table which exposes functions 66 provided by HID function driver module. 67 */ 68 const USBD_CDC_API_T* cdc; /**< Pointer to function table which exposes functions 69 provided by CDC-ACM function driver module. 70 */ 71 const uint32_t* reserved6; /**< Reserved for future function driver module. 72 */ 73 const uint32_t version; /**< Version identifier of USB ROM stack. The version is 74 defined as 0x0CHDMhCC where each nibble represents version 75 number of the corresponding component. 76 CC - 7:0 - 8bit core version number 77 h - 11:8 - 4bit hardware interface version number 78 M - 15:12 - 4bit MSC class module version number 79 D - 19:16 - 4bit DFU class module version number 80 H - 23:20 - 4bit HID class module version number 81 C - 27:24 - 4bit CDC class module version number 82 H - 31:28 - 4bit reserved 83 */ 84 85 } USBD_API_T; 86 87 /* Applications using USBD ROM API should define this instance. The pointer should be assigned a value computed based on chip definitions. */ 88 extern const USBD_API_T* g_pUsbApi; 89 #define USBD_API g_pUsbApi 90 91 #endif /*__MW_USBD_ROM_API_H*/ 92 93