Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2017-10-25 02:52:38 +0300
committerKarl Palsson <karlp@tweak.net.au>2017-10-26 01:53:31 +0300
commit557e2a0b09b978969a4a800ea57e5f0edb22e9e9 (patch)
tree76a0d3b9dc3f377a05eacce919ff873755e7ca7e /include/libopencm3/stm32/common/usart_common_v2.h
parent2bc19d499c1d4dff873827268ac236d37f0ef4fb (diff)
stm32: uart: add USART_FLAG_ defines
Similar to how we have abstract defines for the stop bits, parity and flow control common mode namees, provide abstract flag names for the "standard" flags. This allows us to start using common API code for v1 and v2 uarts For stm32f3, drop the "compatibility" defines that simply pollute the namespace, making it confusingly appear as if f3 has both SR and ISR registers.
Diffstat (limited to 'include/libopencm3/stm32/common/usart_common_v2.h')
-rw-r--r--include/libopencm3/stm32/common/usart_common_v2.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/libopencm3/stm32/common/usart_common_v2.h b/include/libopencm3/stm32/common/usart_common_v2.h
index 2ae3ee35..4b5bee60 100644
--- a/include/libopencm3/stm32/common/usart_common_v2.h
+++ b/include/libopencm3/stm32/common/usart_common_v2.h
@@ -196,6 +196,24 @@
/**@}*/
+/** @defgroup usart_convenience_flags U(S)ART convenience Flags
+ * @ingroup STM32F_usart_defines
+ * We define the "common" lower flag bits using a standard name,
+ * allowing them to be used regardless of which usart peripheral
+ * version you have.
+ * @{
+ */
+#define USART_FLAG_PE USART_ISR_PE
+#define USART_FLAG_FE USART_ISR_FE
+#define USART_FLAG_NF USART_ISR_NF
+#define USART_FLAG_ORE USART_ISR_ORE
+#define USART_FLAG_IDLE USART_ISR_IDLE
+#define USART_FLAG_RXNE USART_ISR_RXNE
+#define USART_FLAG_TC USART_ISR_TC
+#define USART_FLAG_TXE USART_ISR_TXE
+/**@}*/
+
+
/*****************************************************************************/
/* Register values */
/*****************************************************************************/