stm32:l4: Enable USB FS support

Reviewed against RM0394 and tested with STM32L433CC.
Aparently some other L4 have USB OTG.
This commit is contained in:
Bruno Randolf 2017-12-20 20:11:37 +00:00 committed by Karl Palsson
parent de39ab1584
commit 075ef82a4b
5 changed files with 36 additions and 0 deletions

View File

@ -58,6 +58,8 @@
#define I2C3_BASE (PERIPH_BASE_APB1 + 0x5c00)
#define CRS_BASE (PERIPH_BASE_APB1 + 0x6000)
#define CAN1_BASE (PERIPH_BASE_APB1 + 0x6400)
#define USB_DEV_FS_BASE (PERIPH_BASE_APB1 + 0x6800)
#define USB_PMA_BASE (PERIPH_BASE_APB1 + 0x6c00)
#define POWER_CONTROL_BASE (PERIPH_BASE_APB1 + 0x7000)
#define DAC1_BASE (PERIPH_BASE_APB1 + 0x7400)
#define OPAMP_BASE (PERIPH_BASE_APB1 + 0x7800)

View File

@ -757,6 +757,7 @@ enum rcc_periph_clken {
RCC_OPAMP = _REG_BIT(RCC_APB1ENR1_OFFSET, 30),
RCC_DAC1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 29),
RCC_PWR = _REG_BIT(RCC_APB1ENR1_OFFSET, 28),
RCC_USB = _REG_BIT(RCC_APB1ENR1_OFFSET, 26),
RCC_CAN1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 25),
RCC_CRS = _REG_BIT(RCC_APB1ENR1_OFFSET, 24),
RCC_I2C3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 23),
@ -898,6 +899,7 @@ enum rcc_periph_rst {
RST_OPAMP = _REG_BIT(RCC_APB1RSTR1_OFFSET, 30),
RST_DAC1 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 29),
RST_PWR = _REG_BIT(RCC_APB1RSTR1_OFFSET, 28),
RST_USB = _REG_BIT(RCC_APB1RSTR1_OFFSET, 26),
RST_CAN1 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 25),
RST_CRS = _REG_BIT(RCC_APB1RSTR1_OFFSET, 24),
RST_I2C3 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 23),

View File

@ -0,0 +1,27 @@
/*
* This file is part of the libopencm3 project.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY !
* Use top-level <libopencm3/stm32/st_usbfs.h>
*/
#ifndef LIBOPENCM3_ST_USBFS_H
# error Do not include directly !
#else
#include <libopencm3/stm32/common/st_usbfs_v2.h>
#endif

View File

@ -33,6 +33,8 @@
# include <libopencm3/stm32/l0/st_usbfs.h>
#elif defined(STM32L1)
# include <libopencm3/stm32/l1/st_usbfs.h>
#elif defined(STM32L4)
# include <libopencm3/stm32/l4/st_usbfs.h>
#else
# error "STM32 family not defined or not supported."
#endif

View File

@ -54,6 +54,9 @@ OBJS += dma_common_l1f013.o
OBJS += iwdg_common_all.o
OBJS += rtc_common_l1f024.o
OBJS += usb.o usb_control.o usb_standard.o
OBJS += st_usbfs_core.o st_usbfs_v2.o
VPATH += ../../usb:../:../../cm3:../common
VPATH += ../../ethernet