From 580a2a4a63cad6ca32ac837cf6d1c64664ce80f3 Mon Sep 17 00:00:00 2001 From: Yonghua Zheng Date: Mon, 4 Dec 2017 10:51:29 +0800 Subject: [PATCH] stm32f7: usart: enable usart peripheral Add usart-v2 to stm32f7 to provide usart support in f7 series. --- include/libopencm3/stm32/f7/usart.h | 55 +++++++++++++++++++++++++++++ include/libopencm3/stm32/usart.h | 2 ++ lib/stm32/f7/Makefile | 2 ++ 3 files changed, 59 insertions(+) create mode 100644 include/libopencm3/stm32/f7/usart.h diff --git a/include/libopencm3/stm32/f7/usart.h b/include/libopencm3/stm32/f7/usart.h new file mode 100644 index 00000000..9a3e874c --- /dev/null +++ b/include/libopencm3/stm32/f7/usart.h @@ -0,0 +1,55 @@ +/** @defgroup usart_defines USART Defines + * + * @brief Defined Constants and Types for the STM32F7xx USART + * + * @ingroup STM32F7xx_defines + * + * @version 1.0.0 + * + * @date 5 December 2012 + * + * 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 USART3 USART3_BASE +#define UART4 UART4_BASE +#define UART5 UART5_BASE +/**@}*/ + +BEGIN_DECLS + +END_DECLS + +#endif + diff --git a/include/libopencm3/stm32/usart.h b/include/libopencm3/stm32/usart.h index 2c29a832..7f3b11e9 100644 --- a/include/libopencm3/stm32/usart.h +++ b/include/libopencm3/stm32/usart.h @@ -30,6 +30,8 @@ # include #elif defined(STM32F4) # include +#elif defined(STM32F7) +# include #elif defined(STM32L0) # include #elif defined(STM32L1) diff --git a/lib/stm32/f7/Makefile b/lib/stm32/f7/Makefile index 97c31d6a..35efba6e 100644 --- a/lib/stm32/f7/Makefile +++ b/lib/stm32/f7/Makefile @@ -48,6 +48,8 @@ OBJS += rcc_common_all.o flash_common_f234.o flash_common_f24.o OBJS += rng_common_v1.o +OBJS += usart_common_all.o usart_common_v2.o + VPATH += ../../usb:../:../../cm3:../common VPATH += ../../ethernet