mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
c6c5d9a1a7
C has this feature that the order of struct members in the initialization doesn't need to match the order in the declaration. C++ has not yet caught up: boards/common/gd32v/include/cfg_usbdev_default.h:50:1: error: designator order for field 'dwc2_usb_otg_fshs_config_t::type' does not match declaration order in 'const dwc2_usb_otg_fshs_config_t' So, just reorder the fields for now by hand.
64 lines
1.3 KiB
C
64 lines
1.3 KiB
C
/*
|
|
* Copyright (C) 2023 Gunar Schorcht <gunar@schorcht.net>
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
* directory for more details.
|
|
*/
|
|
|
|
/**
|
|
* @ingroup boards_common_gd32v
|
|
* @{
|
|
*
|
|
* @file
|
|
* @brief Default USB OTG configuration for GD32 RISC-V board
|
|
*
|
|
* @author Gunar Schorcht <gunar@schorcht.net>
|
|
*/
|
|
|
|
#ifndef CFG_USBDEV_DEFAULT_H
|
|
#define CFG_USBDEV_DEFAULT_H
|
|
|
|
#include "vendor/usbdev_gd32v.h"
|
|
#include "usbdev_synopsys_dwc2.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @name USB OTG configuration
|
|
* @{
|
|
*/
|
|
/**
|
|
* @brief Enable the full speed USB OTG peripheral
|
|
*/
|
|
#define DWC2_USB_OTG_FS_ENABLED
|
|
|
|
/**
|
|
* @brief Common USB OTG FS configuration
|
|
*/
|
|
static const dwc2_usb_otg_fshs_config_t dwc2_usb_otg_fshs_config[] = {
|
|
{
|
|
.periph = USB_OTG_FS_PERIPH_BASE,
|
|
.type = DWC2_USB_OTG_FS,
|
|
.phy = DWC2_USB_OTG_PHY_BUILTIN,
|
|
.rcu_mask = RCU_AHBEN_USBFSEN_Msk,
|
|
.irqn = USBFS_IRQn,
|
|
.bus = AHB,
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Number of available USB OTG peripherals
|
|
*/
|
|
#define USBDEV_NUMOF ARRAY_SIZE(dwc2_usb_otg_fshs_config)
|
|
/** @} */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* CFG_USBDEV_DEFAULT_H */
|
|
/** @} */
|