VSF Documented
driver.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// To correctly provide information to the upper layer for arch or vendor,
21// it is necessary to check whether __VSF_HEADER_ONLY_SHOW_ARCH_INFO__ or __VSF_HAL_SHOW_VENDOR_INFO__ is defined
22#if defined(__VSF_HEADER_ONLY_SHOW_ARCH_INFO__) || defined(__VSF_HAL_SHOW_VENDOR_INFO__)
23
24# include "../__device.h"
25
26#else
27
28#ifndef __VSF_HAL_DRIVER_${VENDOR}_${DEVICE}_H__
29#define __VSF_HAL_DRIVER_${VENDOR}_${DEVICE}_H__
30
31/*============================ INCLUDES ======================================*/
32
33# include "hal/vsf_hal_cfg.h"
34# include "./device.h"
35
36// for common hal structure/enum/etc, include before user driver headers below.
38
39// For SWI
41
42/*\note It's up to developer to decide the actual path of the driver headers. */
43
44# if VSF_HAL_USE_ADC == ENABLED
45# include "../common/adc/adc.h"
46# endif
47# if VSF_HAL_USE_FLASH == ENABLED
48# include "../common/flash/flash.h"
49# endif
50# if VSF_HAL_USE_GPIO == ENABLED
51# include "../common/gpio/gpio.h"
52# endif
53# if VSF_HAL_USE_I2C == ENABLED
54# include "../common/i2c/i2c.h"
55# endif
56# if VSF_HAL_USE_PWM == ENABLED
57# include "../common/pwm/pwm.h"
58# endif
59# if VSF_HAL_USE_RTC == ENABLED
60# include "../common/rtc/rtc.h"
61# endif
62# if VSF_HAL_USE_SPI == ENABLED
63# include "../common/spi/spi.h"
64# endif
65# if VSF_HAL_USE_TIMER == ENABLED
66# include "../common/timer/timer.h"
67# endif
68# if VSF_HAL_USE_TRNG == ENABLED
69# include "../common/rng/rng.h"
70# endif
71# if VSF_HAL_USE_USART == ENABLED
72# include "../common/usart/usart.h"
73# endif
74# if VSF_HAL_USE_USB == ENABLED
75// For non-IPCore devices, we usually use usb_otg.nonip.h
76// For IPCore devices, we usually use usb.h
77//# include "../common/usb/usb.h"
78# include "../common/usb_otg.nonip/usb_otg.nonip.h"
79# endif
80# if VSF_HAL_USE_SDIO == ENABLED
81# include "../common/sdio/sdio.h"
82# endif
83# if VSF_HAL_USE_I2S == ENABLED
84# include "../common/i2s/i2s.h"
85# endif
86# if VSF_HAL_USE_WDT == ENABLED
87# include "../common/wdt/wdt.h"
88# endif
89# if VSF_HAL_USE_ETH == ENABLED
90# include "../common/eth/eth.h"
91# endif
92
93/*============================ MACROS ========================================*/
94/*============================ MACROFIED FUNCTIONS ===========================*/
95/*============================ TYPES =========================================*/
96/*============================ GLOBAL VARIABLES ==============================*/
97/*============================ LOCAL VARIABLES ===============================*/
98/*============================ PROTOTYPES ====================================*/
99
100
101
102/*============================ INCLUDES ======================================*/
103
104#if VSF_HAL_USE_GPIO == ENABLED
106
107# define VSF_GPIO_CFG_DEC_PREFIX vsf_hw
108# define VSF_GPIO_CFG_DEC_UPCASE_PREFIX VSF_HW
110#endif
111
112#if VSF_HAL_USE_ADC == ENABLED
114
115# define VSF_ADC_CFG_DEC_PREFIX vsf_hw
116# define VSF_ADC_CFG_DEC_UPCASE_PREFIX VSF_HW
118#endif
119
120#if VSF_HAL_USE_FLASH == ENABLED
122
123# define VSF_FLASH_CFG_DEC_PREFIX vsf_hw
124# define VSF_FLASH_CFG_DEC_UPCASE_PREFIX VSF_HW
126#endif
127
128#if VSF_HAL_USE_I2C == ENABLED
130
131# define VSF_I2C_CFG_DEC_PREFIX vsf_hw
132# define VSF_I2C_CFG_DEC_UPCASE_PREFIX VSF_HW
134#endif
135
136#if VSF_HAL_USE_PWM == ENABLED
138
139# define VSF_PWM_CFG_DEC_PREFIX vsf_hw
140# define VSF_PWM_CFG_DEC_UPCASE_PREFIX VSF_HW
142#endif
143
144#if VSF_HAL_USE_RTC == ENABLED
146
147# define VSF_RTC_CFG_DEC_PREFIX vsf_hw
148# define VSF_RTC_CFG_DEC_UPCASE_PREFIX VSF_HW
150#endif
151
152#if VSF_HAL_USE_SPI == ENABLED
154
155# define VSF_SPI_CFG_DEC_PREFIX vsf_hw
156# define VSF_SPI_CFG_DEC_UPCASE_PREFIX VSF_HW
158
159// Optional: Add QSPI
160//# define VSF_SPI_CFG_DEC_DEVICE_PREFIX vsf_hw_qspi
161//# define VSF_SPI_CFG_DEC_DEVICE_UPCASE_PREFIX VSF_HW_QSPI
162//# define VSF_SPI_CFG_DEC_RENAME_DEVICE_PREFIX ENABLED
163//# include "hal/driver/common/spi/spi_template.h"
164#endif
165
166#if VSF_HAL_USE_TIMER == ENABLED
168
169# define VSF_TIMER_CFG_DEC_PREFIX vsf_hw
170# define VSF_TIMER_CFG_DEC_UPCASE_PREFIX VSF_HW
172#endif
173
174#if VSF_HAL_USE_RNG == ENABLED
176
177# define VSF_RNG_CFG_DEC_PREFIX vsf_hw
178# define VSF_RNG_CFG_DEC_UPCASE_PREFIX VSF_HW
180#endif
181
182#if VSF_HAL_USE_USART == ENABLED
184
185# define VSF_USART_CFG_DEC_PREFIX vsf_hw
186# define VSF_USART_CFG_DEC_UPCASE_PREFIX VSF_HW
188#endif
189
190#if VSF_HAL_USE_WDT == ENABLED
192
193# define VSF_WDT_CFG_DEC_PREFIX vsf_hw
194# define VSF_WDT_CFG_DEC_UPCASE_PREFIX VSF_HW
196#endif
197
198#endif // __VSF_HAL_DRIVER_${VENDOR}_${DEVICE}_H__
199#endif // !__VSF_HEADER_ONLY_SHOW_ARCH_INFO__ && !__VSF_HAL_SHOW_VENDOR_INFO__
200/* EOF */
Generated from commit: vsfteam/vsf@74aa6ce