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// peripheral includes
45
46# if VSF_HAL_USE_ADC == ENABLED
47# include "../common/adc/adc.h"
48# endif
49# if VSF_HAL_USE_DAC == ENABLED
50# include "../common/dac/dac.h"
51# endif
52# if VSF_HAL_USE_DMA == ENABLED
53# include "../common/dma/dma.h"
54# endif
55# if VSF_HAL_USE_FLASH == ENABLED
56# include "../common/flash/flash.h"
57# endif
58# if VSF_HAL_USE_GPIO == ENABLED
59# include "../common/gpio/gpio.h"
60# endif
61# if VSF_HAL_USE_I2C == ENABLED
62# include "../common/i2c/i2c.h"
63# endif
64# if VSF_HAL_USE_PWM == ENABLED
65# include "../common/pwm/pwm.h"
66# endif
67# if VSF_HAL_USE_RTC == ENABLED
68# include "../common/rtc/rtc.h"
69# endif
70# if VSF_HAL_USE_SPI == ENABLED
71# include "../common/spi/spi.h"
72# endif
73# if VSF_HAL_USE_TIMER == ENABLED
74# include "../common/timer/timer.h"
75# endif
76# if VSF_HAL_USE_RNG == ENABLED
77# include "../common/rng/rng.h"
78# endif
79# if VSF_HAL_USE_USART == ENABLED
80# include "../common/usart/usart.h"
81# endif
82# if VSF_HAL_USE_USB == ENABLED
83// For non-IPCore devices, we usually use usb_otg.nonip.h
84// For IPCore devices, we usually use usb.h
85//# include "../common/usb/usb.h"
86# include "../common/usb_otg.nonip/usb_otg.nonip.h"
87# endif
88# if VSF_HAL_USE_SDIO == ENABLED
89# include "../common/sdio/sdio.h"
90# endif
91# if VSF_HAL_USE_I2S == ENABLED
92# include "../common/i2s/i2s.h"
93# endif
94# if VSF_HAL_USE_WDT == ENABLED
95# include "../common/wdt/wdt.h"
96# endif
97# if VSF_HAL_USE_ETH == ENABLED
98# include "../common/eth/eth.h"
99# endif
100
101// peripheral includes end
102
103/*============================ MACROS ========================================*/
104/*============================ MACROFIED FUNCTIONS ===========================*/
105/*============================ TYPES =========================================*/
106/*============================ GLOBAL VARIABLES ==============================*/
107/*============================ LOCAL VARIABLES ===============================*/
108/*============================ PROTOTYPES ====================================*/
109
110
111
112/*============================ INCLUDES ======================================*/
113
114// template blocks
115
116#if VSF_HAL_USE_GPIO == ENABLED
118
119# define VSF_GPIO_CFG_DEC_PREFIX vsf_hw
120# define VSF_GPIO_CFG_DEC_UPCASE_PREFIX VSF_HW
122#endif
123
124#if VSF_HAL_USE_ADC == ENABLED
126
127# define VSF_ADC_CFG_DEC_PREFIX vsf_hw
128# define VSF_ADC_CFG_DEC_UPCASE_PREFIX VSF_HW
130#endif
131
132#if VSF_HAL_USE_DAC == ENABLED
134
135# define VSF_DAC_CFG_DEC_PREFIX vsf_hw
136# define VSF_DAC_CFG_DEC_UPCASE_PREFIX VSF_HW
138#endif
139
140#if VSF_HAL_USE_DMA == ENABLED
142
143# define VSF_DMA_CFG_DEC_PREFIX vsf_hw
144# define VSF_DMA_CFG_DEC_UPCASE_PREFIX VSF_HW
146#endif
147
148#if VSF_HAL_USE_FLASH == ENABLED
150
151# define VSF_FLASH_CFG_DEC_PREFIX vsf_hw
152# define VSF_FLASH_CFG_DEC_UPCASE_PREFIX VSF_HW
154#endif
155
156#if VSF_HAL_USE_I2C == ENABLED
158
159# define VSF_I2C_CFG_DEC_PREFIX vsf_hw
160# define VSF_I2C_CFG_DEC_UPCASE_PREFIX VSF_HW
162#endif
163
164#if VSF_HAL_USE_PWM == ENABLED
166
167# define VSF_PWM_CFG_DEC_PREFIX vsf_hw
168# define VSF_PWM_CFG_DEC_UPCASE_PREFIX VSF_HW
170#endif
171
172#if VSF_HAL_USE_RTC == ENABLED
174
175# define VSF_RTC_CFG_DEC_PREFIX vsf_hw
176# define VSF_RTC_CFG_DEC_UPCASE_PREFIX VSF_HW
178#endif
179
180#if VSF_HAL_USE_SPI == ENABLED
182
183# define VSF_SPI_CFG_DEC_PREFIX vsf_hw
184# define VSF_SPI_CFG_DEC_UPCASE_PREFIX VSF_HW
186
187// Optional: Add QSPI
188//# define VSF_SPI_CFG_DEC_DEVICE_PREFIX vsf_hw_qspi
189//# define VSF_SPI_CFG_DEC_DEVICE_UPCASE_PREFIX VSF_HW_QSPI
190//# define VSF_SPI_CFG_DEC_RENAME_DEVICE_PREFIX ENABLED
191//# include "hal/driver/common/spi/spi_template.h"
192#endif
193
194#if VSF_HAL_USE_TIMER == ENABLED
196
197# define VSF_TIMER_CFG_DEC_PREFIX vsf_hw
198# define VSF_TIMER_CFG_DEC_UPCASE_PREFIX VSF_HW
200#endif
201
202#if VSF_HAL_USE_RNG == ENABLED
204
205# define VSF_RNG_CFG_DEC_PREFIX vsf_hw
206# define VSF_RNG_CFG_DEC_UPCASE_PREFIX VSF_HW
208#endif
209
210#if VSF_HAL_USE_USART == ENABLED
212
213# define VSF_USART_CFG_DEC_PREFIX vsf_hw
214# define VSF_USART_CFG_DEC_UPCASE_PREFIX VSF_HW
216#endif
217
218#if VSF_HAL_USE_WDT == ENABLED
220
221# define VSF_WDT_CFG_DEC_PREFIX vsf_hw
222# define VSF_WDT_CFG_DEC_UPCASE_PREFIX VSF_HW
224#endif
225
226#if VSF_HAL_USE_SDIO == ENABLED
228
229# define VSF_SDIO_CFG_DEC_PREFIX vsf_hw
230# define VSF_SDIO_CFG_DEC_UPCASE_PREFIX VSF_HW
232#endif
233
234#if VSF_HAL_USE_I2S == ENABLED
236
237# define VSF_I2S_CFG_DEC_PREFIX vsf_hw
238# define VSF_I2S_CFG_DEC_UPCASE_PREFIX VSF_HW
240#endif
241
242#if VSF_HAL_USE_ETH == ENABLED
244
245# define VSF_ETH_CFG_DEC_PREFIX vsf_hw
246# define VSF_ETH_CFG_DEC_UPCASE_PREFIX VSF_HW
248#endif
249
250// template blocks end
251
252#endif // __VSF_HAL_DRIVER_${VENDOR}_${DEVICE}_H__
253#endif // !__VSF_HEADER_ONLY_SHOW_ARCH_INFO__ && !__VSF_HAL_SHOW_VENDOR_INFO__
254/* EOF */
Generated from commit: vsfteam/vsf@3b461d0