From c119ee7f9a3c8c7472dfeff28acd5f7cf9fce6bb Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 25 Oct 2017 23:26:08 +0000 Subject: [PATCH] stm32:l0: enable usart peripheral Now that the usart-v2 peripheral is extracted cleanly, adding it for l0 is very simple. --- include/libopencm3/stm32/l0/usart.h | 49 +++++++++++++++++++++++++++++ include/libopencm3/stm32/usart.h | 2 ++ lib/stm32/l0/Makefile | 1 + 3 files changed, 52 insertions(+) create mode 100644 include/libopencm3/stm32/l0/usart.h diff --git a/include/libopencm3/stm32/l0/usart.h b/include/libopencm3/stm32/l0/usart.h new file mode 100644 index 00000000..d3777707 --- /dev/null +++ b/include/libopencm3/stm32/l0/usart.h @@ -0,0 +1,49 @@ +/** @defgroup usart_defines USART Defines + * + * @brief Defined Constants and Types for the STM32L0xx USART + * + * @ingroup STM32L0xx_defines + * + * LGPL License Terms @ref lgpl_license + */ + +/* + * 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 . + */ + +#ifndef LIBOPENCM3_USART_H +#define LIBOPENCM3_USART_H + +#include +#include + +/** @defgroup usart_reg_base USART register base addresses + * @ingroup STM32F_usart_defines + * Holds all the U(S)ART peripherals supported. + * @{ + */ +#define USART1 USART1_BASE +#define USART2 USART2_BASE +#define USART4 USART4_BASE +#define USART5 USART5_BASE +#define LPUART1 LPUART1_BASE +/**@}*/ + +BEGIN_DECLS + +END_DECLS + +#endif diff --git a/include/libopencm3/stm32/usart.h b/include/libopencm3/stm32/usart.h index 6121ff6e..d98b9c26 100644 --- a/include/libopencm3/stm32/usart.h +++ b/include/libopencm3/stm32/usart.h @@ -30,6 +30,8 @@ # include #elif defined(STM32F4) # include +#elif defined(STM32L0) +# include #elif defined(STM32L1) # include #else diff --git a/lib/stm32/l0/Makefile b/lib/stm32/l0/Makefile index d2a7a6b3..358bbacf 100644 --- a/lib/stm32/l0/Makefile +++ b/lib/stm32/l0/Makefile @@ -47,6 +47,7 @@ OBJS += exti_common_all.o OBJS += flash.o flash_common_l01.o OBJS += i2c_common_v2.o OBJS += rng_common_v1.o +OBJS += usart_common_all.o usart_common_v2.o OBJS += usb.o usb_control.o usb_standard.o OBJS += st_usbfs_core.o st_usbfs_v2.o