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/*\note first define basic info for arch. */
25#if defined(__VSF_HEADER_ONLY_SHOW_ARCH_INFO__)
26
27#ifndef VSF_ARCH_SWI_NUM
28# define VSF_ARCH_SWI_NUM 4
29#endif
30
31#ifndef VSF_ARCH_RTOS_CFG_STACK_DEPTH
32# define VSF_ARCH_RTOS_CFG_STACK_DEPTH 4096
33#endif
34
35#define VSF_ARCH_FREERTOS_CFG_IS_IN_ISR xPortInIsrContext
36
37// software interrupt provided by a dedicated device
38#define VSF_DEV_SWI_NUM 0
39
40#ifndef __RTOS__
41# define __RTOS__
42#endif
43#ifndef __FREERTOS__
44# define __FREERTOS__
45#endif
46
47// alu types, should be defined in target-specified compiler header
48// but xtensa uses generic compiler header, so define alu types here
49typedef unsigned int uintalu_t;
50typedef int intalu_t;
51
52// SET_STACK will fail to pass stack check
53//#include "xt_instr_macros.h"
54//#define VSF_ARCH_RTOS_CFG_SET_STACK(__STACK) SET_STACK(__STACK)
55
56// 16-byte align, necessary if > 8
57#define VSF_ARCH_STACK_ALIGN_BIT 4
58
59#else
60
61#ifndef __HAL_DEVICE_ESPRESSIF_ESP32S2_H__
62#define __HAL_DEVICE_ESPRESSIF_ESP32S2_H__
63
64/*============================ INCLUDES ======================================*/
65
66#include "soc/periph_defs.h"
67
68// to avoid namespace pollution in original headers, copy constants need here
69// for USB consts
70//#include "soc/usb_periph.h"
71
72/*============================ MACROS ========================================*/
73
74#define USB_OTG_COUNT 1
75// required by dwcotg, define the max ep number of dwcotg include ep0
76#define USB_DWCOTG_MAX_EP_NUM 8
77
78#define USB_BASE_REG 0x60080000
79
80#define USB_OTG0_CONFIG \
81 .dc_ep_num = 7 << 1, \
82 .hc_ep_num = 8, \
83 .periph_module = PERIPH_USB_MODULE, \
84 .intr_source = ETS_USB_INTR_SOURCE, \
85 .reg = (void *)USB_BASE_REG, \
86 /* vk_dwcotg_hw_info_t */ \
87 .buffer_word_size = 1024 >> 2, \
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#endif // __HAL_DEVICE_ESPRESSIF_ESP32S2_H__
101#endif // __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
102/* EOF */
int_fast8_t intalu_t
Definition type.h:89
uint_fast8_t uintalu_t
Definition type.h:88