VSF Documented
device.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/*============================ INCLUDES ======================================*/
19
20#include "hal/vsf_hal_cfg.h"
21
22/*============================ MACROS ========================================*/
23
24
25#if defined(__VSF_HEADER_ONLY_SHOW_ARCH_INFO__)
26
28# define VSF_ARCH_PRI_NUM 1
29# define VSF_ARCH_PRI_BIT 1
30
31#else
32
33# ifndef __HAL_DEVICE_HERCULES_CMEM7_H__
34# define __HAL_DEVICE_HERCULES_CMEM7_H__
35
36/*============================ INCLUDES ======================================*/
37
38/*\note this is should be the only place where __common.h is included.*/
39#include "hal/vsf_hal_cfg.h"
40#include "hal/arch/vsf_arch.h"
41
42// TODO: fixed high speed bug
43// In usbd_msc demo with USB_SPEED_HIGH, device send Bulk IN(512 byte),
44// which is 511 bytes in the usb analyzer
45#define VSF_CMEM7_USB_CFG_SPEED USB_SPEED_FULL
46
47
48#define USB_OTG_COUNT 1
49#define USB_OTG0_IRQHandler USB_IRQHandler
50// required by dwcotg, define the max ep number of dwcotg include ep0
51#define USB_DWCOTG_MAX_EP_NUM 4
52#define USB_OTG0_CONFIG \
53 .dc_ep_num = 7 << 1, \
54 .hc_ep_num = 8, \
55 .reg = (void *)USB_BASE, \
56 /* vk_dwcotg_hw_info_t */ \
57 .buffer_word_size = (8 * 1024) >> 2, \
58 .speed = VSF_CMEM7_USB_CFG_SPEED, \
59 .dma_en = true, \
60 .ulpi_en = true, \
61 .utmi_en = false, \
62 .vbus_en = false,
63
64/*============================ MACROFIED FUNCTIONS ===========================*/
65/*============================ TYPES =========================================*/
66/*============================ GLOBAL VARIABLES ==============================*/
67/*============================ LOCAL VARIABLES ===============================*/
68/*============================ PROTOTYPES ====================================*/
69# endif // __HAL_DEVICE_HERCULES_CMEM7_H__
70
71#endif //__VSF_HEADER_ONLY_SHOW_ARCH_INFO__
72/* EOF */