VSF Documented
device.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#include "hal/vsf_hal_cfg.h"
21
22/*============================ MACROS ========================================*/
23
24#if defined(__VSF_HEADER_ONLY_SHOW_ARCH_INFO__)
25
26/*\note first define basic info for arch. */
28# define VSF_ARCH_PRI_NUM 4
29# define VSF_ARCH_PRI_BIT 2
30
31#elif defined(__VSF_HAL_SHOW_VENDOR_INFO__)
32
33# define __VSF_HEADER_ONLY_SHOW_VENDOR_INFO__
34# include "RP2040.h"
35
36#else
37
38#ifndef __HAL_DEVICE_RASPBERRYPI_RP2040_H__
39#define __HAL_DEVICE_RASPBERRYPI_RP2040_H__
40
41/*============================ INCLUDES ======================================*/
42
43// for XXXX_BASE
44#include "hardware/regs/addressmap.h"
45
46//#include "common.h"
47
48/*============================ MACROS ========================================*/
49
50#define USB_OTG_COUNT 1
51// required by dwcotg, define the max ep number of dwcotg include ep0
52#define USB_DWCOTG_MAX_EP_NUM 16
53
54#define USB_OTG0_IRQHandler USBDMA_IRQHandler
55#define USB_OTG0_CONFIG \
56 .dc_ep_num = 4 << 1, \
57 .hc_ep_num = 5, \
58 .reg = (void *)0, \
59 /* vk_dwcotg_hw_info_t */ \
60 .buffer_word_size = 948, \
61 .speed = USB_SPEED_FULL, \
62 .dma_en = true, \
63 .ulpi_en = true, \
64 .utmi_en = false, \
65 .vbus_en = false,
66
67#define VSF_HW_I2C_COUNT 2
68#define VSF_HW_I2C0_IRQN I2C0_IRQ_IRQn
69#define VSF_HW_I2C0_IRQHandler I2C0_IRQHandler
70#define VSF_HW_I2C0_REG I2C0_BASE
71#define VSF_HW_I2C1_IRQN I2C1_IRQ_IRQn
72#define VSF_HW_I2C1_IRQHandler I2C1_IRQHandler
73#define VSF_HW_I2C1_REG I2C1_BASE
74
75#define VSF_HW_USART_COUNT 2
76#define VSF_HW_USART0_IRQN UART0_IRQ_IRQn
77#define VSF_HW_USART0_IRQHandler UART0_IRQHandler
78#define VSF_HW_USART0_REG UART0_BASE
79#define VSF_HW_USART1_IRQN UART1_IRQ_IRQn
80#define VSF_HW_USART1_IRQHandler UART1_IRQHandler
81#define VSF_HW_USART1_REG UART1_BASE
82
83/*============================ MACROFIED FUNCTIONS ===========================*/
84/*============================ TYPES =========================================*/
85/*============================ GLOBAL VARIABLES ==============================*/
86/*============================ LOCAL VARIABLES ===============================*/
87/*============================ PROTOTYPES ====================================*/
88
89#endif // __HAL_DEVICE_RASPBERRYPI_RP2040_H__
90#endif // __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
91/* EOF */