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.
This commit is contained in:
parent
5dd0b46298
commit
9d709e52b4
@ -34,19 +34,6 @@ specific memorymap.h header before including this header file.*/
|
|||||||
#ifndef LIBOPENCM3_USART_COMMON_ALL_H
|
#ifndef LIBOPENCM3_USART_COMMON_ALL_H
|
||||||
#define 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 ------------------------------------------------- */
|
/* --- Convenience defines ------------------------------------------------- */
|
||||||
|
|
||||||
|
@ -37,6 +37,19 @@ specific memorymap.h header before including this header file.*/
|
|||||||
|
|
||||||
#include <libopencm3/stm32/common/usart_common_all.h>
|
#include <libopencm3/stm32/common/usart_common_all.h>
|
||||||
|
|
||||||
|
|
||||||
|
/** @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 ----------------------------------------------------- */
|
/* --- USART registers ----------------------------------------------------- */
|
||||||
|
|
||||||
/* Status register (USARTx_SR) */
|
/* Status register (USARTx_SR) */
|
||||||
|
@ -35,6 +35,17 @@
|
|||||||
#include <libopencm3/stm32/common/usart_common_v2.h>
|
#include <libopencm3/stm32/common/usart_common_v2.h>
|
||||||
|
|
||||||
|
|
||||||
|
/** @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 ---------------------------------------------------- */
|
/* --- USART_CR2 values ---------------------------------------------------- */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user