stm32/usbd: Support USB device mode on STM32L432 MCUs.

pull/4910/head
Damien George 2019-08-15 12:46:04 +10:00
rodzic bf733c27bb
commit 97e8e036c5
3 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -288,7 +288,7 @@
#endif
// Whether the USB peripheral is device-only, or multiple OTG
#if defined(STM32L0) || defined(STM32WB)
#if defined(STM32L0) || defined(STM32L432xx) || defined(STM32WB)
#define MICROPY_HW_USB_IS_MULTI_OTG (0)
#else
#define MICROPY_HW_USB_IS_MULTI_OTG (1)

Wyświetl plik

@ -298,7 +298,7 @@ void DebugMon_Handler(void) {
/* file (startup_stm32f4xx.s). */
/******************************************************************************/
#if defined(STM32L0)
#if defined(STM32L0) || defined(STM32L432xx)
#if MICROPY_HW_USB_FS
void USB_IRQHandler(void) {

Wyświetl plik

@ -64,6 +64,8 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) {
const uint32_t otg_alt = GPIO_AF10_OTG1_FS;
#elif defined(STM32L0)
const uint32_t otg_alt = GPIO_AF0_USB;
#elif defined(STM32L432xx)
const uint32_t otg_alt = GPIO_AF10_USB_FS;
#elif defined(STM32WB)
const uint32_t otg_alt = GPIO_AF10_USB;
#else
@ -113,6 +115,9 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) {
#if defined(STM32L0)
NVIC_SetPriority(USB_IRQn, IRQ_PRI_OTG_FS);
HAL_NVIC_EnableIRQ(USB_IRQn);
#elif defined(STM32L432xx)
NVIC_SetPriority(USB_FS_IRQn, IRQ_PRI_OTG_FS);
HAL_NVIC_EnableIRQ(USB_FS_IRQn);
#elif defined(STM32WB)
NVIC_SetPriority(USB_LP_IRQn, IRQ_PRI_OTG_FS);
HAL_NVIC_EnableIRQ(USB_LP_IRQn);