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_DAC == ENABLED
48# include "../common/dac/dac.h"
49# endif
50# if VSF_HAL_USE_DMA == ENABLED
51# include "../common/dma/dma.h"
52# endif
53# if VSF_HAL_USE_FLASH == ENABLED
54# include "../common/flash/flash.h"
55# endif
56# if VSF_HAL_USE_GPIO == ENABLED
57# include "../common/gpio/gpio.h"
58# endif
59# if VSF_HAL_USE_I2C == ENABLED
60# include "../common/i2c/i2c.h"
61# endif
62# if VSF_HAL_USE_PWM == ENABLED
63# include "../common/pwm/pwm.h"
64# endif
65# if VSF_HAL_USE_RTC == ENABLED
66# include "../common/rtc/rtc.h"
67# endif
68# if VSF_HAL_USE_SPI == ENABLED
69# include "../common/spi/spi.h"
70# endif
71# if VSF_HAL_USE_TIMER == ENABLED
72# include "../common/timer/timer.h"
73# endif
74# if VSF_HAL_USE_TRNG == ENABLED
75# include "../common/rng/rng.h"
76# endif
77# if VSF_HAL_USE_USART == ENABLED
78# include "../common/usart/usart.h"
79# endif
80# if VSF_HAL_USE_USB == ENABLED
81// For non-IPCore devices, we usually use usb_otg.nonip.h
82// For IPCore devices, we usually use usb.h
83//# include "../common/usb/usb.h"
84# include "../common/usb_otg.nonip/usb_otg.nonip.h"
85# endif
86# if VSF_HAL_USE_SDIO == ENABLED
87# include "../common/sdio/sdio.h"
88# endif
89# if VSF_HAL_USE_I2S == ENABLED
90# include "../common/i2s/i2s.h"
91# endif
92# if VSF_HAL_USE_WDT == ENABLED
93# include "../common/wdt/wdt.h"
94# endif
95# if VSF_HAL_USE_ETH == ENABLED
96# include "../common/eth/eth.h"
97# endif
98
99/*============================ MACROS ========================================*/
100/*============================ MACROFIED FUNCTIONS ===========================*/
101/*============================ TYPES =========================================*/
102/*============================ GLOBAL VARIABLES ==============================*/
103/*============================ LOCAL VARIABLES ===============================*/
104/*============================ PROTOTYPES ====================================*/
105
106
107
108/*============================ INCLUDES ======================================*/
109
110#if VSF_HAL_USE_GPIO == ENABLED
112
113# define VSF_GPIO_CFG_DEC_PREFIX vsf_hw
114# define VSF_GPIO_CFG_DEC_UPCASE_PREFIX VSF_HW
116#endif
117
118#if VSF_HAL_USE_ADC == ENABLED
120
121# define VSF_ADC_CFG_DEC_PREFIX vsf_hw
122# define VSF_ADC_CFG_DEC_UPCASE_PREFIX VSF_HW
124#endif
125
126#if VSF_HAL_USE_DAC == ENABLED
128
129# define VSF_DAC_CFG_DEC_PREFIX vsf_hw
130# define VSF_DAC_CFG_DEC_UPCASE_PREFIX VSF_HW
132#endif
133
134#if VSF_HAL_USE_DMA == ENABLED
136
137# define VSF_DMA_CFG_DEC_PREFIX vsf_hw
138# define VSF_DMA_CFG_DEC_UPCASE_PREFIX VSF_HW
140#endif
141
142#if VSF_HAL_USE_FLASH == ENABLED
144
145# define VSF_FLASH_CFG_DEC_PREFIX vsf_hw
146# define VSF_FLASH_CFG_DEC_UPCASE_PREFIX VSF_HW
148#endif
149
150#if VSF_HAL_USE_I2C == ENABLED
152
153# define VSF_I2C_CFG_DEC_PREFIX vsf_hw
154# define VSF_I2C_CFG_DEC_UPCASE_PREFIX VSF_HW
156#endif
157
158#if VSF_HAL_USE_PWM == ENABLED
160
161# define VSF_PWM_CFG_DEC_PREFIX vsf_hw
162# define VSF_PWM_CFG_DEC_UPCASE_PREFIX VSF_HW
164#endif
165
166#if VSF_HAL_USE_RTC == ENABLED
168
169# define VSF_RTC_CFG_DEC_PREFIX vsf_hw
170# define VSF_RTC_CFG_DEC_UPCASE_PREFIX VSF_HW
172#endif
173
174#if VSF_HAL_USE_SPI == ENABLED
176
177# define VSF_SPI_CFG_DEC_PREFIX vsf_hw
178# define VSF_SPI_CFG_DEC_UPCASE_PREFIX VSF_HW
180
181// Optional: Add QSPI
182//# define VSF_SPI_CFG_DEC_DEVICE_PREFIX vsf_hw_qspi
183//# define VSF_SPI_CFG_DEC_DEVICE_UPCASE_PREFIX VSF_HW_QSPI
184//# define VSF_SPI_CFG_DEC_RENAME_DEVICE_PREFIX ENABLED
185//# include "hal/driver/common/spi/spi_template.h"
186#endif
187
188#if VSF_HAL_USE_TIMER == ENABLED
190
191# define VSF_TIMER_CFG_DEC_PREFIX vsf_hw
192# define VSF_TIMER_CFG_DEC_UPCASE_PREFIX VSF_HW
194#endif
195
196#if VSF_HAL_USE_RNG == ENABLED
198
199# define VSF_RNG_CFG_DEC_PREFIX vsf_hw
200# define VSF_RNG_CFG_DEC_UPCASE_PREFIX VSF_HW
202#endif
203
204#if VSF_HAL_USE_USART == ENABLED
206
207# define VSF_USART_CFG_DEC_PREFIX vsf_hw
208# define VSF_USART_CFG_DEC_UPCASE_PREFIX VSF_HW
210#endif
211
212#if VSF_HAL_USE_WDT == ENABLED
214
215# define VSF_WDT_CFG_DEC_PREFIX vsf_hw
216# define VSF_WDT_CFG_DEC_UPCASE_PREFIX VSF_HW
218#endif
219
220#if VSF_HAL_USE_SDIO == ENABLED
222
223# define VSF_SDIO_CFG_DEC_PREFIX vsf_hw
224# define VSF_SDIO_CFG_DEC_UPCASE_PREFIX VSF_HW
226#endif
227
228#if VSF_HAL_USE_I2S == ENABLED
230
231# define VSF_I2S_CFG_DEC_PREFIX vsf_hw
232# define VSF_I2S_CFG_DEC_UPCASE_PREFIX VSF_HW
234#endif
235
236#if VSF_HAL_USE_ETH == ENABLED
238
239# define VSF_ETH_CFG_DEC_PREFIX vsf_hw
240# define VSF_ETH_CFG_DEC_UPCASE_PREFIX VSF_HW
242#endif
243
244#endif // __VSF_HAL_DRIVER_${VENDOR}_${DEVICE}_H__
245#endif // !__VSF_HEADER_ONLY_SHOW_ARCH_INFO__ && !__VSF_HAL_SHOW_VENDOR_INFO__
246/* EOF */
Generated from commit: vsfteam/vsf@8634e61