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#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"
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
67
68# define VSF_GPIO_CFG_DEC_PREFIX vsf_hw
69# define VSF_GPIO_CFG_DEC_UPCASE_PREFIX VSF_HW
71#endif
72
73#if VSF_HAL_USE_ADC == ENABLED
75
76# define VSF_ADC_CFG_DEC_PREFIX vsf_hw
77# define VSF_ADC_CFG_DEC_UPCASE_PREFIX VSF_HW
79#endif
80
81#if VSF_HAL_USE_FLASH == ENABLED
83
84# define VSF_FLASH_CFG_DEC_PREFIX vsf_hw
85# define VSF_FLASH_CFG_DEC_UPCASE_PREFIX VSF_HW
87#endif
88
89#if VSF_HAL_USE_I2C == ENABLED
91
92# define VSF_I2C_CFG_DEC_PREFIX vsf_hw
93# define VSF_I2C_CFG_DEC_UPCASE_PREFIX VSF_HW
95#endif
96
97#if VSF_HAL_USE_PWM == ENABLED
99
100# define VSF_PWM_CFG_DEC_PREFIX vsf_hw
101# define VSF_PWM_CFG_DEC_UPCASE_PREFIX VSF_HW
103#endif
104
105#if VSF_HAL_USE_RTC == ENABLED
107
108# define VSF_RTC_CFG_DEC_PREFIX vsf_hw
109# define VSF_RTC_CFG_DEC_UPCASE_PREFIX VSF_HW
111#endif
112
113#if VSF_HAL_USE_SPI == ENABLED
114//# define VSF_SPI_CFG_REIMPLEMENT_TYPE_MODE ENABLED
116
117# define VSF_SPI_CFG_DEC_PREFIX vsf_hw
118# define VSF_SPI_CFG_DEC_UPCASE_PREFIX VSF_HW
120#endif
121
122#if VSF_HAL_USE_TIMER == ENABLED
124
125# define VSF_TIMER_CFG_DEC_PREFIX vsf_hw
126# define VSF_TIMER_CFG_DEC_UPCASE_PREFIX VSF_HW
128
129# define VSF_TIMER_CFG_DEC_PREFIX vsf_hw_lp
130# define VSF_TIMER_CFG_DEC_UPCASE_PREFIX VSF_HW_LP
132#endif
133
134#if VSF_HAL_USE_RNG == ENABLED
136
137# define VSF_RNG_CFG_DEC_PREFIX vsf_hw
138# define VSF_RNG_CFG_DEC_UPCASE_PREFIX VSF_HW
140#endif
141
142#if VSF_HAL_USE_USART == ENABLED
144
145# define VSF_USART_CFG_DEC_PREFIX vsf_hw
146# define VSF_USART_CFG_DEC_UPCASE_PREFIX VSF_HW
148#endif
149
150#if VSF_HAL_USE_DMA == ENABLED
152
153# define VSF_DMA_CFG_DEC_PREFIX vsf_hw
154# define VSF_DMA_CFG_DEC_UPCASE_PREFIX VSF_HW
156#endif
157
158#if VSF_HAL_USE_WDT == ENABLED
159//# define VSF_WDT_CFG_REIMPLEMENT_TYPE_MODE ENABLED
161
162# define VSF_WDT_CFG_DEC_PREFIX vsf_hw
163# define VSF_WDT_CFG_DEC_UPCASE_PREFIX VSF_HW
165#endif
166
167/*============================ MACROS ========================================*/
168/*============================ MACROFIED FUNCTIONS ===========================*/
169/*============================ TYPES =========================================*/
170/*============================ GLOBAL VARIABLES ==============================*/
171/*============================ LOCAL VARIABLES ===============================*/
172/*============================ PROTOTYPES ====================================*/
173
174extern bool clock_configure(clock_num_t clk_index, uint32_t src, uint32_t auxsrc, uint32_t src_freq, uint32_t freq);
175extern 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 */
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
uint32_t clock_get_hz(clock_num_t clk_index)
\endclock_configure[]
Definition driver.c:381
unsigned uint32_t
Definition stdint.h:9
Generated from commit: vsfteam/vsf@3b461d0