VSF Documented
usb.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#ifndef __OSA_HAL_DRIVER_ARTERY_AT32F402_405_USB_H__
19#define __OSA_HAL_DRIVER_ARTERY_AT32F402_405_USB_H__
20
21/*============================ INCLUDES ======================================*/
22#include "hal/vsf_hal.h"
23
24#if (VSF_USE_USB_DEVICE == ENABLED && VSF_USBD_USE_DCD_DWCOTG == ENABLED) \
25 || (VSF_USE_USB_HOST == ENABLED && VSF_USBH_USE_HCD_DWCOTG == ENABLED)
26
28
29// for dedicated vk_dwcotg_hw_info_t
31
32/*============================ MACROS ========================================*/
33/*============================ MACROFIED FUNCTIONS ===========================*/
34
35#define ____USB_OTG_DEF(__N, __VALUE) \
36 extern vsf_hw_usb_t USB_OTG##__N##_IP; \
37 extern const i_usb_dc_ip_t VSF_USB_DC##__N##_IP; \
38 extern const i_usb_hc_ip_t VSF_USB_HC##__N##_IP;
39#define __USB_OTG_DEF(__N, __VALUE) ____USB_OTG_DEF(__N, __VALUE)
40#define USB_OTG_DEF(__N, __VALUE) __USB_OTG_DEF(__N, __VALUE)
41
42/*============================ TYPES =========================================*/
43
44typedef struct vsf_hw_usb_const_t {
48 void *reg;
52
53 implement(vk_dwcotg_hw_info_t)
55
56typedef struct vsf_hw_usb_t {
57 bool is_host;
58 struct {
60 void *param;
64
65/*============================ INCLUDES ======================================*/
66
67#include "./hc/usbh.h"
68#include "./dc/usbd.h"
69
74
75/*============================ GLOBAL VARIABLES ==============================*/
76
78
79/*============================ INCLUDES ======================================*/
80/*============================ PROTOTYPES ====================================*/
81
82#endif
83#endif
84/* EOF */
#define VSF_HW_USB_OTG_COUNT
Definition device.h:85
void vsf_hw_usbd_irq_enable(vsf_hw_usb_t *dc)
Definition usbd.c:56
void vsf_hw_usbh_irq_enable(vsf_hw_usb_t *hc)
Definition usbh.c:61
void vsf_hw_usbh_irq_disable(vsf_hw_usb_t *hc)
Definition usbh.c:66
void vsf_hw_usbd_irq_disable(vsf_hw_usb_t *dc)
Definition usbd.c:61
struct vsf_hw_usb_const_t vsf_hw_usb_const_t
struct vsf_hw_usb_t vsf_hw_usb_t
#define USB_OTG_DEF(__N, __VALUE)
Definition usb.h:40
#define NULL
Definition lvgl.h:26
unsigned uint32_t
Definition stdint.h:9
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_dwcotg_hw.h:38
Definition driver.c:44
Definition usb.h:44
uint8_t hc_ep_num
Definition usb.h:46
uint32_t en
Definition usb.h:49
uint32_t irq
Definition usb.h:47
uint8_t dc_ep_num
Definition usb.h:45
uint32_t phyclk_freq_required
Definition usb.h:51
const vsf_hw_clk_t * phyclk
Definition usb.h:50
void * reg
Definition usb.h:48
Definition usb.h:56
usb_ip_irqhandler_t irqhandler
Definition usb.h:59
const vsf_hw_usb_const_t * param
Definition usb.h:62
struct vsf_hw_usb_t::@526 callback
void * param
Definition usb.h:60
bool is_host
Definition usb.h:57
#define VSF_MREPEAT(__COUNT, __MACRO, __PARAM)
Definition vsf_repeat_macro.h:51
void(* usb_ip_irqhandler_t)(void *param)
Definition vsf_template_usb.h:324
Generated from commit: vsfteam/vsf@3f091ef