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#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/*============================ MACROS ========================================*/
97/*============================ MACROFIED FUNCTIONS ===========================*/
98/*============================ TYPES =========================================*/
99/*============================ GLOBAL VARIABLES ==============================*/
100/*============================ LOCAL VARIABLES ===============================*/
101/*============================ PROTOTYPES ====================================*/
102
103#endif // __VSF_HAL_DEVICE_EMULATION_DISTBUS_H__
104#endif
105/* EOF */
Generated from commit: vsfteam/vsf@74aa6ce