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:51:52 +0300
committerKarl Palsson <karlp@tweak.net.au>2017-10-26 01:42:26 +0300
commit2bc19d499c1d4dff873827268ac236d37f0ef4fb (patch)
treefa96b5654d1e2930ae58b3bec51fbebb9ddbda14 /include/libopencm3/stm32/common/usart_common_all.h
parent3dbbbe11133568cb30255092c07100a0e11447bd (diff)
stm32:usart: Pull stop bit definitions up as common
Diffstat (limited to 'include/libopencm3/stm32/common/usart_common_all.h')
-rw-r--r--include/libopencm3/stm32/common/usart_common_all.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libopencm3/stm32/common/usart_common_all.h b/include/libopencm3/stm32/common/usart_common_all.h
index f838dfea..a8e0272e 100644
--- a/include/libopencm3/stm32/common/usart_common_all.h
+++ b/include/libopencm3/stm32/common/usart_common_all.h
@@ -85,6 +85,15 @@ specific memorymap.h header before including this header file.*/
#define USART_STOPBITS_1_5 USART_CR2_STOPBITS_1_5 /* 1.5 stop bit*/
/**@}*/
+/* STOP[13:12]: STOP bits */
+#define USART_CR2_STOPBITS_1 (0x00 << 12) /* 1 stop bit */
+#define USART_CR2_STOPBITS_0_5 (0x01 << 12) /* 0.5 stop bits */
+#define USART_CR2_STOPBITS_2 (0x02 << 12) /* 2 stop bits */
+#define USART_CR2_STOPBITS_1_5 (0x03 << 12) /* 1.5 stop bits */
+#define USART_CR2_STOPBITS_MASK (0x03 << 12)
+#define USART_CR2_STOPBITS_SHIFT 12
+
+
/* CR3_CTSE/CR3_RTSE combined values */
/****************************************************************************/
/** @defgroup usart_cr3_flowcontrol USART Hardware Flow Control Selection