From 9d709e52b46d328f98f9eabd80f98aa5a80726f8 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 25 Oct 2017 22:14:30 +0000 Subject: [PATCH] stm32: usart: move USARTX definitions to target/version specific Instead of declaring that _every_ device has USART1,2,3 and UART4,5, let the targets themselves define what periphs they do, along with their USARTx_BASE defines, and let the common headers just have the common abstractions. --- include/libopencm3/stm32/common/usart_common_all.h | 13 ------------- include/libopencm3/stm32/common/usart_common_f124.h | 13 +++++++++++++ include/libopencm3/stm32/f3/usart.h | 11 +++++++++++ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/include/libopencm3/stm32/common/usart_common_all.h b/include/libopencm3/stm32/common/usart_common_all.h index a8e0272e..a39d6833 100644 --- a/include/libopencm3/stm32/common/usart_common_all.h +++ b/include/libopencm3/stm32/common/usart_common_all.h @@ -34,19 +34,6 @@ specific memorymap.h header before including this header file.*/ #ifndef LIBOPENCM3_USART_COMMON_ALL_H #define LIBOPENCM3_USART_COMMON_ALL_H -/* --- Convenience macros -------------------------------------------------- */ - -/****************************************************************************/ -/** @defgroup usart_reg_base USART register base addresses -@ingroup STM32F_usart_defines - -@{*/ -#define USART1 USART1_BASE -#define USART2 USART2_BASE -#define USART3 USART3_BASE -/**@}*/ -#define UART4 UART4_BASE -#define UART5 UART5_BASE /* --- Convenience defines ------------------------------------------------- */ diff --git a/include/libopencm3/stm32/common/usart_common_f124.h b/include/libopencm3/stm32/common/usart_common_f124.h index bfe50cd0..41ce2999 100644 --- a/include/libopencm3/stm32/common/usart_common_f124.h +++ b/include/libopencm3/stm32/common/usart_common_f124.h @@ -37,6 +37,19 @@ specific memorymap.h header before including this header file.*/ #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 +/**@}*/ + /* --- USART registers ----------------------------------------------------- */ /* Status register (USARTx_SR) */ diff --git a/include/libopencm3/stm32/f3/usart.h b/include/libopencm3/stm32/f3/usart.h index f2de8f0f..34cc9933 100644 --- a/include/libopencm3/stm32/f3/usart.h +++ b/include/libopencm3/stm32/f3/usart.h @@ -35,6 +35,17 @@ #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 +/**@}*/ /* --- USART_CR2 values ---------------------------------------------------- */