forked from RIOT-OS/RIOT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request RIOT-OS#12556 from bergzand/wip/stusbdev
stm32_common: Add USB OTG FS/HS usbdev peripheral driver
- Loading branch information
Showing
33 changed files
with
1,491 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (C) 2019 Koen Zandberg | ||
* | ||
* 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_stm32 | ||
* @{ | ||
* | ||
* @file | ||
* @brief Common configuration for STM32 OTG FS peripheral | ||
* | ||
* @author Koen Zandberg <[email protected]> | ||
*/ | ||
|
||
#ifndef CFG_USB_OTG_FS_H | ||
#define CFG_USB_OTG_FS_H | ||
|
||
#include "periph_cpu.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Enable the full speed USB OTG peripheral | ||
*/ | ||
#define STM32_USB_OTG_FS_ENABLED | ||
|
||
/** | ||
* @name common USB OTG FS configuration | ||
* @{ | ||
*/ | ||
static const stm32_usb_otg_fshs_config_t stm32_usb_otg_fshs_config[] = { | ||
{ | ||
.periph = (uint8_t *)USB_OTG_FS_PERIPH_BASE, | ||
.rcc_mask = RCC_AHB2ENR_OTGFSEN, | ||
.phy = STM32_USB_OTG_PHY_BUILTIN, | ||
.type = STM32_USB_OTG_FS, | ||
.irqn = OTG_FS_IRQn, | ||
.ahb = AHB2, | ||
.dm = GPIO_PIN(PORT_A, 11), | ||
.dp = GPIO_PIN(PORT_A, 12), | ||
.af = GPIO_AF10, | ||
} | ||
}; | ||
/** @} */ | ||
|
||
/** | ||
* @brief Number of available USB OTG peripherals | ||
*/ | ||
#define USBDEV_NUMOF ARRAY_SIZE(stm32_usb_otg_fshs_config) | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* CFG_USB_OTG_FS_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (C) 2019 Koen Zandberg | ||
* | ||
* 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_stm32 | ||
* @{ | ||
* | ||
* @file | ||
* @brief Common configuration for STM32 OTG HS peripheral with FS phy | ||
* | ||
* @author Koen Zandberg <[email protected]> | ||
*/ | ||
|
||
#ifndef CFG_USB_OTG_HS_FS_H | ||
#define CFG_USB_OTG_HS_FS_H | ||
|
||
#include "periph_cpu.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Enable the full speed USB OTG peripheral | ||
*/ | ||
#define STM32_USB_OTG_HS_ENABLED | ||
|
||
/** | ||
* @name common USB OTG FS configuration | ||
* @{ | ||
*/ | ||
static const stm32_usb_otg_fshs_config_t stm32_usb_otg_fshs_config[] = { | ||
{ | ||
.periph = (uint8_t *)USB_OTG_HS_PERIPH_BASE, | ||
.rcc_mask = RCC_AHB1ENR_OTGHSEN, | ||
.phy = STM32_USB_OTG_PHY_BUILTIN, | ||
.type = STM32_USB_OTG_HS, | ||
.irqn = OTG_HS_IRQn, | ||
.ahb = AHB1, | ||
.dm = GPIO_PIN(PORT_B, 14), | ||
.dp = GPIO_PIN(PORT_B, 15), | ||
.af = GPIO_AF12, | ||
} | ||
}; | ||
/** @} */ | ||
|
||
/** | ||
* @brief Number of available USB OTG peripherals | ||
*/ | ||
#define USBDEV_NUMOF ARRAY_SIZE(stm32_usb_otg_fshs_config) | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* CFG_USB_OTG_HS_FS_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.