VSF Documented
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
Examples
File List
Globals
source
hal
driver
RaspberryPi
RP2040
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
#if defined(__VSF_HEADER_ONLY_SHOW_ARCH_INFO__) || defined(__VSF_HAL_SHOW_VENDOR_INFO__)
19
20
# include "__device.h"
21
22
#else
23
24
#ifndef __HAL_DRIVER_RASPBERRYPI_RP2040_H__
25
#define __HAL_DRIVER_RASPBERRYPI_RP2040_H__
26
27
/*============================ INCLUDES ======================================*/
28
29
# include "
hal/vsf_hal_cfg.h
"
30
# include "
hal/driver/common/swi/vsf_swi_template.h
"
31
# include "
./device.h
"
32
33
// for clock_num_t
34
# include "hardware/structs/clocks.h"
35
36
# include "gpio/gpio.h"
37
# include "i2c/i2c.h"
38
# include "uart/uart.h"
39
# include "rtc/rtc.h"
40
# include "flash/flash.h"
41
# include "wdt/wdt.h"
42
# include "adc/adc.h"
43
# include "pwm/pwm.h"
44
# include "timer/timer.h"
45
# include "spi/spi.h"
46
# include "rng/rng.h"
47
# include "dma/dma.h"
48
49
/*============================ MACROFIED FUNCTIONS ===========================*/
50
/*============================ TYPES =========================================*/
51
/*============================ INCLUDES ======================================*/
52
/*============================ TYPES =========================================*/
53
/*============================ INCLUDES ======================================*/
54
55
#if VSF_HAL_USE_IO == ENABLED
56
//# define VSF_IO_CFG_REIMPLEMENT_TYPE_MODE ENABLED
57
# include "hal/driver/common/template/vsf_template_io.h"
58
59
# define VSF_IO_CFG_DEC_PREFIX vsf_hw
60
# define VSF_IO_CFG_DEC_UPCASE_PREFIX VSF_HW
61
# include "hal/driver/common/io/io_template.h"
62
#endif
63
64
#if VSF_HAL_USE_GPIO == ENABLED
65
# define VSF_GPIO_USE_IO_MODE_TYPE ENABLED
66
# include "
hal/driver/common/template/vsf_template_gpio.h
"
67
68
# define VSF_GPIO_CFG_DEC_PREFIX vsf_hw
69
# define VSF_GPIO_CFG_DEC_UPCASE_PREFIX VSF_HW
70
# include "
hal/driver/common/gpio/gpio_template.h
"
71
#endif
72
73
#if VSF_HAL_USE_ADC == ENABLED
74
# include "
hal/driver/common/template/vsf_template_adc.h
"
75
76
# define VSF_ADC_CFG_DEC_PREFIX vsf_hw
77
# define VSF_ADC_CFG_DEC_UPCASE_PREFIX VSF_HW
78
# include "
hal/driver/common/adc/adc_template.h
"
79
#endif
80
81
#if VSF_HAL_USE_FLASH == ENABLED
82
# include "
hal/driver/common/template/vsf_template_flash.h
"
83
84
# define VSF_FLASH_CFG_DEC_PREFIX vsf_hw
85
# define VSF_FLASH_CFG_DEC_UPCASE_PREFIX VSF_HW
86
# include "
hal/driver/common/flash/flash_template.h
"
87
#endif
88
89
#if VSF_HAL_USE_I2C == ENABLED
90
# include "
hal/driver/common/template/vsf_template_i2c.h
"
91
92
# define VSF_I2C_CFG_DEC_PREFIX vsf_hw
93
# define VSF_I2C_CFG_DEC_UPCASE_PREFIX VSF_HW
94
# include "
hal/driver/common/i2c/i2c_template.h
"
95
#endif
96
97
#if VSF_HAL_USE_PWM == ENABLED
98
# include "
hal/driver/common/template/vsf_template_pwm.h
"
99
100
# define VSF_PWM_CFG_DEC_PREFIX vsf_hw
101
# define VSF_PWM_CFG_DEC_UPCASE_PREFIX VSF_HW
102
# include "
hal/driver/common/pwm/pwm_template.h
"
103
#endif
104
105
#if VSF_HAL_USE_RTC == ENABLED
106
# include "
hal/driver/common/template/vsf_template_rtc.h
"
107
108
# define VSF_RTC_CFG_DEC_PREFIX vsf_hw
109
# define VSF_RTC_CFG_DEC_UPCASE_PREFIX VSF_HW
110
# include "
hal/driver/common/rtc/rtc_template.h
"
111
#endif
112
113
#if VSF_HAL_USE_SPI == ENABLED
114
//# define VSF_SPI_CFG_REIMPLEMENT_TYPE_MODE ENABLED
115
# include "
hal/driver/common/template/vsf_template_spi.h
"
116
117
# define VSF_SPI_CFG_DEC_PREFIX vsf_hw
118
# define VSF_SPI_CFG_DEC_UPCASE_PREFIX VSF_HW
119
# include "
hal/driver/common/spi/spi_template.h
"
120
#endif
121
122
#if VSF_HAL_USE_TIMER == ENABLED
123
# include "
hal/driver/common/template/vsf_template_timer.h
"
124
125
# define VSF_TIMER_CFG_DEC_PREFIX vsf_hw
126
# define VSF_TIMER_CFG_DEC_UPCASE_PREFIX VSF_HW
127
# include "
hal/driver/common/timer/timer_template.h
"
128
129
# define VSF_TIMER_CFG_DEC_PREFIX vsf_hw_lp
130
# define VSF_TIMER_CFG_DEC_UPCASE_PREFIX VSF_HW_LP
131
# include "
hal/driver/common/timer/timer_template.h
"
132
#endif
133
134
#if VSF_HAL_USE_RNG == ENABLED
135
# include "
hal/driver/common/template/vsf_template_rng.h
"
136
137
# define VSF_RNG_CFG_DEC_PREFIX vsf_hw
138
# define VSF_RNG_CFG_DEC_UPCASE_PREFIX VSF_HW
139
# include "
hal/driver/common/rng/rng_template.h
"
140
#endif
141
142
#if VSF_HAL_USE_USART == ENABLED
143
# include "
hal/driver/common/template/vsf_template_usart.h
"
144
145
# define VSF_USART_CFG_DEC_PREFIX vsf_hw
146
# define VSF_USART_CFG_DEC_UPCASE_PREFIX VSF_HW
147
# include "
hal/driver/common/usart/usart_template.h
"
148
#endif
149
150
#if VSF_HAL_USE_DMA == ENABLED
151
# include "
hal/driver/common/template/vsf_template_dma.h
"
152
153
# define VSF_DMA_CFG_DEC_PREFIX vsf_hw
154
# define VSF_DMA_CFG_DEC_UPCASE_PREFIX VSF_HW
155
# include "
hal/driver/common/dma/dma_template.h
"
156
#endif
157
158
#if VSF_HAL_USE_WDT == ENABLED
159
//# define VSF_WDT_CFG_REIMPLEMENT_TYPE_MODE ENABLED
160
# include "
hal/driver/common/template/vsf_template_wdt.h
"
161
162
# define VSF_WDT_CFG_DEC_PREFIX vsf_hw
163
# define VSF_WDT_CFG_DEC_UPCASE_PREFIX VSF_HW
164
# include "
hal/driver/common/wdt/wdt_template.h
"
165
#endif
166
167
/*============================ MACROS ========================================*/
168
/*============================ MACROFIED FUNCTIONS ===========================*/
169
/*============================ TYPES =========================================*/
170
/*============================ GLOBAL VARIABLES ==============================*/
171
/*============================ LOCAL VARIABLES ===============================*/
172
/*============================ PROTOTYPES ====================================*/
173
174
extern
bool
clock_configure
(clock_num_t clk_index,
uint32_t
src,
uint32_t
auxsrc,
uint32_t
src_freq,
uint32_t
freq);
175
extern
uint32_t
clock_get_hz
(clock_num_t clk_index);
176
177
# endif
// __HAL_DRIVER_RASPBERRYPI_RP2040_H__
178
#endif
// __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
179
/* EOF */
adc_template.h
dma_template.h
flash_template.h
gpio_template.h
clock_configure
bool clock_configure(clock_num_t clk_index, uint32_t src, uint32_t auxsrc, uint32_t src_freq, uint32_t freq)
\tagclock_configure[]
Definition
driver.c:307
clock_get_hz
uint32_t clock_get_hz(clock_num_t clk_index)
\endclock_configure[]
Definition
driver.c:381
i2c_template.h
pwm_template.h
rng_template.h
rtc_template.h
device.h
spi_template.h
uint32_t
unsigned uint32_t
Definition
stdint.h:9
timer_template.h
usart_template.h
vsf_hal_cfg.h
vsf_swi_template.h
vsf_template_adc.h
vsf_template_dma.h
vsf_template_flash.h
vsf_template_gpio.h
vsf_template_i2c.h
vsf_template_pwm.h
vsf_template_rng.h
vsf_template_rtc.h
vsf_template_spi.h
vsf_template_timer.h
vsf_template_usart.h
vsf_template_wdt.h
wdt_template.h
Generated from commit:
vsfteam/vsf@3b461d0