Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed by
Diff: TARGET_NUCLEO_F030R8/stm32f0xx_hal_usart.h
- Revision:
- 122:f9eeca106725
- Parent:
- 108:34e6b704fe68
--- a/TARGET_NUCLEO_F030R8/stm32f0xx_hal_usart.h Wed May 25 16:44:06 2016 +0100
+++ b/TARGET_NUCLEO_F030R8/stm32f0xx_hal_usart.h Thu Jul 07 14:34:11 2016 +0100
@@ -2,13 +2,13 @@
******************************************************************************
* @file stm32f0xx_hal_usart.h
* @author MCD Application Team
- * @version V1.3.0
- * @date 26-June-2015
+ * @version V1.4.0
+ * @date 27-May-2016
* @brief Header file of USART HAL module.
******************************************************************************
* @attention
*
- * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
+ * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -183,12 +183,18 @@
/** @defgroup USART_Stop_Bits USART Number of Stop Bits
* @{
*/
-#define USART_STOPBITS_1 ((uint32_t)0x0000)
-#define USART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1)
-#define USART_STOPBITS_1_5 ((uint32_t)(USART_CR2_STOP_0 | USART_CR2_STOP_1))
+#ifdef USART_SMARTCARD_SUPPORT
+#define USART_STOPBITS_0_5 ((uint32_t)USART_CR2_STOP_0) /*!< USART frame with 0.5 stop bit */
+#define USART_STOPBITS_1 ((uint32_t)0x00000000) /*!< USART frame with 1 stop bit */
+#define USART_STOPBITS_1_5 ((uint32_t)(USART_CR2_STOP_0 | USART_CR2_STOP_1)) /*!< USART frame with 1.5 stop bits */
+#define USART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1) /*!< USART frame with 2 stop bits */
+#else
+#define USART_STOPBITS_1 ((uint32_t)0x00000000) /*!< USART frame with 1 stop bit */
+#define USART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1) /*!< USART frame with 2 stop bits */
+#endif
/**
* @}
- */
+ */
/** @defgroup USART_Parity USART Parity
* @{
@@ -506,20 +512,26 @@
/** @brief Check USART Baud rate
* @param __BAUDRATE__: Baudrate specified by the user.
- * The maximum Baud Rate is derived from the maximum clock on F0 (i.e. 48 MHz)
+ * The maximum Baud Rate is derived from the maximum clock on F0 (i.e. 48 MHz)
* divided by the smallest oversampling used on the USART (i.e. 8)
* @retval Test result (TRUE or FALSE).
- */
-#define IS_USART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) < 9000001)
+ */
+#define IS_USART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) < 6000001)
/**
* @brief Ensure that USART frame number of stop bits is valid.
* @param __STOPBITS__: USART frame number of stop bits.
* @retval SET (__STOPBITS__ is valid) or RESET (__STOPBITS__ is invalid)
*/
-#define IS_USART_STOPBITS(__STOPBITS__) (((__STOPBITS__) == USART_STOPBITS_1) || \
+#ifdef USART_SMARTCARD_SUPPORT
+#define IS_USART_STOPBITS(__STOPBITS__) (((__STOPBITS__) == USART_STOPBITS_0_5) || \
+ ((__STOPBITS__) == USART_STOPBITS_1) || \
((__STOPBITS__) == USART_STOPBITS_1_5) || \
((__STOPBITS__) == USART_STOPBITS_2))
+#else
+#define IS_USART_STOPBITS(__STOPBITS__) (((__STOPBITS__) == USART_STOPBITS_1) || \
+ ((__STOPBITS__) == USART_STOPBITS_2))
+#endif
/**
* @brief Ensure that USART frame parity is valid.
@@ -535,7 +547,7 @@
* @param __MODE__: USART communication mode.
* @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid)
*/
-#define IS_USART_MODE(__MODE__) ((((__MODE__) & (uint32_t)0xFFFFFFF3) == 0x00) && ((__MODE__) != (uint32_t)0x00))
+#define IS_USART_MODE(__MODE__) ((((__MODE__) & (uint32_t)0xFFFFFFF3U) == 0x00) && ((__MODE__) != (uint32_t)0x00))
/**
* @brief Ensure that USART clock state is valid.
@@ -624,7 +636,7 @@
/* Peripheral Control functions ***********************************************/
-/** @addtogroup USART_Exported_Functions_Group3 Peripheral State and Error functions
+/** @addtogroup USART_Exported_Functions_Group3 Peripheral State and Error functions
* @{
*/
