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#if defined(__VSF_HEADER_ONLY_SHOW_ARCH_INFO__) || defined(__VSF_HAL_SHOW_VENDOR_INFO__)
21
22# include "../__device.h"
23
24#else
25
26#ifndef __VSF_HAL_DRIVER_${VENDOR}_${DEVICE}_H__
27#define __VSF_HAL_DRIVER_${VENDOR}_${DEVICE}_H__
28
29/*============================ INCLUDES ======================================*/
30
31# include "hal/vsf_hal_cfg.h"
32# include "./device.h"
33
34// for common hal structure/enum/etc, include before user driver headers below.
36
37// For SWI
39
40/*\note It's up to developer to decide the actual path of the driver headers. */
41
42# if VSF_HAL_USE_ADC == ENABLED
43# include "../common/adc/adc.h"
44# endif
45# if VSF_HAL_USE_FLASH == ENABLED
46# include "../common/flash/flash.h"
47# endif
48# if VSF_HAL_USE_GPIO == ENABLED
49# include "../common/gpio/gpio.h"
50# endif
51# if VSF_HAL_USE_I2C == ENABLED
52# include "../common/i2c/i2c.h"
53# endif
54# if VSF_HAL_USE_PWM == ENABLED
55# include "../common/pwm/pwm.h"
56# endif
57# if VSF_HAL_USE_RTC == ENABLED
58# include "../common/rtc/rtc.h"
59# endif
60# if VSF_HAL_USE_SPI == ENABLED
61# include "../common/spi/spi.h"
62# endif
63# if VSF_HAL_USE_TIMER == ENABLED
64# include "../common/timer/timer.h"
65# endif
66# if VSF_HAL_USE_TRNG == ENABLED
67# include "../common/trng/trng.h"
68# endif
69# if VSF_HAL_USE_USART == ENABLED
70# include "../common/uart/uart.h"
71# endif
72# if VSF_HAL_USE_USB == ENABLED
73# include "../common/usb/usb.h"
74# endif
75# if VSF_HAL_USE_SDIO == ENABLED
76# include "../common/sdio/sdio.h"
77# endif
78# if VSF_HAL_USE_I2S == ENABLED
79# include "../common/i2s/i2s.h"
80# endif
81# if VSF_HAL_USE_WDT == ENABLED
82# include "../common/wdt/wdt.h"
83# endif
84
85/*============================ MACROS ========================================*/
86/*============================ MACROFIED FUNCTIONS ===========================*/
87/*============================ TYPES =========================================*/
88/*============================ GLOBAL VARIABLES ==============================*/
89/*============================ LOCAL VARIABLES ===============================*/
90/*============================ PROTOTYPES ====================================*/
91
92
93
94/*============================ INCLUDES ======================================*/
95
96#if VSF_HAL_USE_GPIO == ENABLED
98
99# define VSF_GPIO_CFG_DEC_PREFIX vsf_hw
100# define VSF_GPIO_CFG_DEC_UPCASE_PREFIX VSF_HW
102#endif
103
104#if VSF_HAL_USE_ADC == ENABLED
106
107# define VSF_ADC_CFG_DEC_PREFIX vsf_hw
108# define VSF_ADC_CFG_DEC_UPCASE_PREFIX VSF_HW
110#endif
111
112#if VSF_HAL_USE_FLASH == ENABLED
114
115# define VSF_FLASH_CFG_DEC_PREFIX vsf_hw
116# define VSF_FLASH_CFG_DEC_UPCASE_PREFIX VSF_HW
118#endif
119
120#if VSF_HAL_USE_I2C == ENABLED
122
123# define VSF_I2C_CFG_DEC_PREFIX vsf_hw
124# define VSF_I2C_CFG_DEC_UPCASE_PREFIX VSF_HW
126#endif
127
128#if VSF_HAL_USE_PWM == ENABLED
130
131# define VSF_PWM_CFG_DEC_PREFIX vsf_hw
132# define VSF_PWM_CFG_DEC_UPCASE_PREFIX VSF_HW
134#endif
135
136#if VSF_HAL_USE_RTC == ENABLED
138
139# define VSF_RTC_CFG_DEC_PREFIX vsf_hw
140# define VSF_RTC_CFG_DEC_UPCASE_PREFIX VSF_HW
142#endif
143
144#if VSF_HAL_USE_SPI == ENABLED
146
147# define VSF_SPI_CFG_DEC_PREFIX vsf_hw
148# define VSF_SPI_CFG_DEC_UPCASE_PREFIX VSF_HW
150#endif
151
152#if VSF_HAL_USE_TIMER == ENABLED
154
155# define VSF_TIMER_CFG_DEC_PREFIX vsf_hw
156# define VSF_TIMER_CFG_DEC_UPCASE_PREFIX VSF_HW
158#endif
159
160#if VSF_HAL_USE_RNG == ENABLED
162
163# define VSF_RNG_CFG_DEC_PREFIX vsf_hw
164# define VSF_RNG_CFG_DEC_UPCASE_PREFIX VSF_HW
166#endif
167
168#if VSF_HAL_USE_USART == ENABLED
170
171# define VSF_USART_CFG_DEC_PREFIX vsf_hw
172# define VSF_USART_CFG_DEC_UPCASE_PREFIX VSF_HW
174#endif
175
176#if VSF_HAL_USE_WDT == ENABLED
178
179# define VSF_WDT_CFG_DEC_PREFIX vsf_hw
180# define VSF_WDT_CFG_DEC_UPCASE_PREFIX VSF_HW
182#endif
183
184#endif // __VSF_HAL_DRIVER_${VENDOR}_${DEVICE}_H__
185#endif // !__VSF_HEADER_ONLY_SHOW_ARCH_INFO__ && !__VSF_HAL_SHOW_VENDOR_INFO__
186/* EOF */