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#ifdef __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
25
26/*\note first define basic info for arch. */
28# define VSF_ARCH_PRI_NUM 8
29# define VSF_ARCH_PRI_BIT 3
30
31// software interrupt provided by a dedicated device
32#define VSF_DEV_SWI_NUM 19
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37extern unsigned int system_core_clock;
38#ifdef __cplusplus
39}
40#endif
41#define VSF_ARCH_SYSTIMER_FREQ system_core_clock
42
43#else
44
45#ifndef __HAL_DEVICE_GEEHY_APM32F407_H__
46#define __HAL_DEVICE_GEEHY_APM32F407_H__
47
48// software interrupt provided by a dedicated device
49#define VSF_DEV_SWI_LIST 70, 74, 75, 79, 80, 85, 86, 87, 88, 89, 90, 93, 95, 96, 97, 98, 99, 100, 101
50
51/*============================ INCLUDES ======================================*/
52
53/*\note this is should be the only place where __common.h is included.*/
54#include "../common/__common.h"
55
56/*============================ MACROS ========================================*/
57
58// user configurations with default value
59
60// HW definition
61
62#define VSF_HW_USB_OTG_COUNT 2
63// required by dwcotg, define the max ep number of dwcotg include ep0
64#define USB_DWCOTG_MAX_EP_NUM 16
65
66#define VSF_HW_USB_OTG0_IRQHandler OTGFS1_IRQHandler
67#define VSF_HW_USB_OTG0_CONFIG \
68 .dc_ep_num = 8 << 1, \
69 .hc_ep_num = 16, \
70 .reg = (void *)OTGFS1_BASE, \
71 .irq = OTGFS1_IRQn, \
72 /* vk_dwcotg_hw_info_t */ \
73 .buffer_word_size = 320, \
74 .speed = USB_SPEED_FULL, \
75 .dma_en = false, \
76 .ulpi_en = false, \
77 .utmi_en = false, \
78 .vbus_en = false,
79
80#define VSF_HW_USB_OTG1_IRQHandler OTGFS2_IRQHandler
81#define VSF_HW_USB_OTG1_CONFIG \
82 .dc_ep_num = 8 << 1, \
83 .hc_ep_num = 16, \
84 .reg = (void *)OTGFS2_BASE, \
85 .irq = OTGFS2_IRQn, \
86 /* vk_dwcotg_hw_info_t */ \
87 .buffer_word_size = 320, \
88 .speed = USB_SPEED_FULL, \
89 .dma_en = false, \
90 .ulpi_en = false, \
91 .utmi_en = false, \
92 .vbus_en = false,
93
94/*============================ MACROFIED FUNCTIONS ===========================*/
95/*============================ TYPES =========================================*/
96/*============================ GLOBAL VARIABLES ==============================*/
97/*============================ LOCAL VARIABLES ===============================*/
98/*============================ PROTOTYPES ====================================*/
99
100
101#endif // __HAL_DEVICE_GEEHY_APM32F407_H__
102#endif // __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
103/* EOF */