VSF Documented
vsf_usbd_DFU_desc.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_USBD_DFU_DESC_H__
19#define __VSF_USBD_DFU_DESC_H__
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*============================ INCLUDES ======================================*/
26/*============================ MACROS ========================================*/
27
28#define USB_DESC_DFU(__IFS, __I_FUNC, __PROTOCOL, __DFU_ATTR, __DETACH_TIMEOUT, __TRANSFER_SIZE)\
29 USB_DESC_IFS((__IFS), 0, 0, 0xFE, 0x01, (__PROTOCOL), (__I_FUNC)) \
30 USB_DT_DFU_FUNCTIONAL_SIZE, \
31 USB_DT_DFU_FUNCTIONAL, \
32 (__DFU_ATTR), \
33 USB_DESC_WORD(__DETACH_TIMEOUT), \
34 USB_DESC_WORD(__TRANSFER_SIZE), \
35 USB_DESC_WORD(0x0110),
36#define USB_DESC_DFU_LEN (USB_DESC_IFS_LEN + USB_DT_DFU_FUNCTIONAL_SIZE)
37
38#define USB_DESC_DFU_IAD(__IFS, __I_FUNC, __PROTOCOL, __DFU_ATTR, __DETACH_TIMEOUT, __TRANSFER_SIZE)\
39 USB_DESC_IAD((__IFS), 1, 0xFE, 0x01, (__PROTOCOL), (__I_FUNC)) \
40 USB_DESC_DFU((__IFS), (__I_FUNC), (__PROTOCOL), (__DFU_ATTR), (__DETACH_TIMEOUT), (__TRANSFER_SIZE))
41#define USB_DESC_HID_IAD_LEN (USB_DESC_IAD_LEN + USB_DESC_DFU_LEN)
42
43/*============================ MACROFIED FUNCTIONS ===========================*/
44/*============================ TYPES =========================================*/
45/*============================ GLOBAL VARIABLES ==============================*/
46/*============================ PROTOTYPES ====================================*/
47
48#ifdef __cplusplus
49}
50#endif
51
52#endif // __VSF_USBD_DFU_DESC_H__