VSF Documented
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
source
hal
driver
Emulation
distbus
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
#if defined(__VSF_HEADER_ONLY_SHOW_ARCH_INFO__)
25
26
/*\note __VSF_HEADER_ONLY_SHOW_ARCH_INFO__ is defined to include arch information only.
27
* Some arch provide chip-vendor with some vendor-specified options, define these options here.
28
*/
29
31
32
# define VSF_ARCH_LIMIT_NO_SET_STACK
33
34
#elif defined(__VSF_HAL_SHOW_VENDOR_INFO__)
35
36
/*\note __VSF_HAL_SHOW_VENDOR_INFO__ is defined to include vendor information only.
37
* Vendor information means the registers/structures/macros from vendor SDK.
38
* Usually these information are not visible from user side to avoid name-space pollution.
39
*/
40
41
# define __VSF_HEADER_ONLY_SHOW_VENDOR_INFO__
42
43
#else
44
45
/*\note __VSF_HEADER_ONLY_SHOW_ARCH_INFO__ and __VSF_HAL_SHOW_VENDOR_INFO__ are not defined.
46
* Define device information here.
47
*/
48
49
#ifndef __VSF_HAL_DEVICE_EMULATION_DISTBUS_H__
50
#define __VSF_HAL_DEVICE_EMULATION_DISTBUS_H__
51
52
/*============================ MACROS ========================================*/
53
54
/*\note For specified peripheral, VSF_HW_PERIPHERAL_COUNT MUST be defined as number of peripheral instance.
55
* If peripheral instances start from 0, and are in sequence order(eg, 3 I2Cs: I2C0, I2C1, I2C2), VSF_HW_PERIPHERAL_MASK is not needed.
56
* Otherwise, define VSF_HW_PERIPHERAL_MASK to indicate which peripheral instances to implmenent.
57
* eg: 3 I2Cs: I2C0, I2C2, I2C4, define VSF_HW_I2C_MASK to 0x15(BIT(0) | BIT(2)) | BIT(4)).
58
*
59
* Other configurations are vendor specified, drivers will use these information to generate peripheral instances.
60
* Usually need irqn, irqhandler, peripheral clock enable bits, peripheral reset bites, etc.
61
*/
62
63
// GPIO
64
65
#ifndef VSF_HW_GPIO_PORT_COUNT
66
# define VSF_HW_GPIO_PORT_COUNT 1
67
#endif
68
#ifndef VSF_HW_GPIO_PIN_COUNT
69
# define VSF_HW_GPIO_PIN_COUNT 16
70
#endif
71
72
// USART UART
73
74
#ifndef VSF_HW_USART_COUNT
75
# define VSF_HW_USART_COUNT 1
76
#endif
77
78
// SPI
79
80
#ifndef VSF_HW_SPI_COUNT
81
# define VSF_HW_SPI_COUNT 1
82
#endif
83
84
// I2C
85
86
#ifndef VSF_HW_I2C_COUNT
87
# define VSF_HW_I2C_COUNT 1
88
#endif
89
90
// SDIO
91
92
#ifndef VSF_HW_SDIO_COUNT
93
# define VSF_HW_SDIO_COUNT 1
94
#endif
95
96
/*============================ INCLUDES ======================================*/
97
98
// Include common irq and af headers after peripherals are defined, so that
99
// irq and af can be adjusted according to the dedicated device configuration.
100
101
#include "
./device_irq.h
"
102
#include "
./device_af.h
"
103
104
// for VSF_MREPEAT used below
105
#include "
utilities/vsf_utilities.h
"
106
107
/*============================ MACROS ========================================*/
108
/*============================ MACROFIED FUNCTIONS ===========================*/
109
/*============================ TYPES =========================================*/
110
/*============================ GLOBAL VARIABLES ==============================*/
111
/*============================ LOCAL VARIABLES ===============================*/
112
/*============================ PROTOTYPES ====================================*/
113
114
#define DECLARE_VSF_HW_INTERRUPT(__N) \
115
extern void VSF_MCONNECT(VSF_HW_INTERRUPT, __N)(void);
116
VSF_MREPEAT
(
VSF_HW_INTERRUPTS_NUM
,
DECLARE_VSF_HW_INTERRUPT
)
117
118
#endif
// __VSF_HAL_DEVICE_EMULATION_DISTBUS_H__
119
#endif
120
/* EOF */
VSF_HW_INTERRUPTS_NUM
#define VSF_HW_INTERRUPTS_NUM
Definition
device_irq.h:1
device_af.h
device_irq.h
DECLARE_VSF_HW_INTERRUPT
#define DECLARE_VSF_HW_INTERRUPT(__N)
Definition
device.h:114
vsf_hal_cfg.h
VSF_MREPEAT
#define VSF_MREPEAT(__COUNT, __MACRO, __PARAM)
Definition
vsf_repeat_macro.h:51
vsf_utilities.h
Generated from commit:
vsfteam/vsf@3f091ef