mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Parent:
573:ad23fe03a082
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 573:ad23fe03a082 1 /**
mbed_official 573:ad23fe03a082 2 ******************************************************************************
mbed_official 573:ad23fe03a082 3 * @file stm32f7xx_hal_usart_ex.h
mbed_official 573:ad23fe03a082 4 * @author MCD Application Team
mbed_official 610:813dcc80987e 5 * @version V1.0.1
mbed_official 610:813dcc80987e 6 * @date 25-June-2015
mbed_official 573:ad23fe03a082 7 * @brief Header file of USART HAL Extension module.
mbed_official 573:ad23fe03a082 8 ******************************************************************************
mbed_official 573:ad23fe03a082 9 * @attention
mbed_official 573:ad23fe03a082 10 *
mbed_official 573:ad23fe03a082 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 573:ad23fe03a082 12 *
mbed_official 573:ad23fe03a082 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 573:ad23fe03a082 14 * are permitted provided that the following conditions are met:
mbed_official 573:ad23fe03a082 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 573:ad23fe03a082 16 * this list of conditions and the following disclaimer.
mbed_official 573:ad23fe03a082 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 573:ad23fe03a082 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 573:ad23fe03a082 19 * and/or other materials provided with the distribution.
mbed_official 573:ad23fe03a082 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 573:ad23fe03a082 21 * may be used to endorse or promote products derived from this software
mbed_official 573:ad23fe03a082 22 * without specific prior written permission.
mbed_official 573:ad23fe03a082 23 *
mbed_official 573:ad23fe03a082 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 573:ad23fe03a082 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 573:ad23fe03a082 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 573:ad23fe03a082 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 573:ad23fe03a082 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 573:ad23fe03a082 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 573:ad23fe03a082 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 573:ad23fe03a082 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 573:ad23fe03a082 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 573:ad23fe03a082 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 573:ad23fe03a082 34 *
mbed_official 573:ad23fe03a082 35 ******************************************************************************
mbed_official 573:ad23fe03a082 36 */
mbed_official 573:ad23fe03a082 37
mbed_official 573:ad23fe03a082 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 573:ad23fe03a082 39 #ifndef __STM32F7xx_HAL_USART_EX_H
mbed_official 573:ad23fe03a082 40 #define __STM32F7xx_HAL_USART_EX_H
mbed_official 573:ad23fe03a082 41
mbed_official 573:ad23fe03a082 42 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 43 extern "C" {
mbed_official 573:ad23fe03a082 44 #endif
mbed_official 573:ad23fe03a082 45
mbed_official 573:ad23fe03a082 46 /* Includes ------------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 47 #include "stm32f7xx_hal_def.h"
mbed_official 573:ad23fe03a082 48
mbed_official 573:ad23fe03a082 49 /** @addtogroup STM32F7xx_HAL_Driver
mbed_official 573:ad23fe03a082 50 * @{
mbed_official 573:ad23fe03a082 51 */
mbed_official 573:ad23fe03a082 52
mbed_official 573:ad23fe03a082 53 /** @addtogroup USARTEx
mbed_official 573:ad23fe03a082 54 * @{
mbed_official 573:ad23fe03a082 55 */
mbed_official 573:ad23fe03a082 56
mbed_official 573:ad23fe03a082 57 /* Exported types ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 58 /* Exported constants --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 59 /** @defgroup USARTEx_Exported_Constants USARTEx Exported Constants
mbed_official 573:ad23fe03a082 60 * @{
mbed_official 573:ad23fe03a082 61 */
mbed_official 573:ad23fe03a082 62
mbed_official 573:ad23fe03a082 63 /** @defgroup USARTEx_Word_Length USARTEx Word Length
mbed_official 573:ad23fe03a082 64 * @{
mbed_official 573:ad23fe03a082 65 */
mbed_official 573:ad23fe03a082 66 #define USART_WORDLENGTH_7B ((uint32_t)USART_CR1_M_1)
mbed_official 573:ad23fe03a082 67 #define USART_WORDLENGTH_8B ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 68 #define USART_WORDLENGTH_9B ((uint32_t)USART_CR1_M_0)
mbed_official 573:ad23fe03a082 69 /**
mbed_official 573:ad23fe03a082 70 * @}
mbed_official 573:ad23fe03a082 71 */
mbed_official 573:ad23fe03a082 72
mbed_official 573:ad23fe03a082 73 /**
mbed_official 573:ad23fe03a082 74 * @}
mbed_official 573:ad23fe03a082 75 */
mbed_official 573:ad23fe03a082 76
mbed_official 573:ad23fe03a082 77 /* Exported functions --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 78
mbed_official 573:ad23fe03a082 79 /* Private macros ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 80 /** @defgroup USARTEx_Private_Macros USARTEx Private Macros
mbed_official 573:ad23fe03a082 81 * @{
mbed_official 573:ad23fe03a082 82 */
mbed_official 573:ad23fe03a082 83
mbed_official 573:ad23fe03a082 84 /** @brief Computes the USART mask to apply to retrieve the received data
mbed_official 573:ad23fe03a082 85 * according to the word length and to the parity bits activation.
mbed_official 573:ad23fe03a082 86 * If PCE = 1, the parity bit is not included in the data extracted
mbed_official 573:ad23fe03a082 87 * by the reception API().
mbed_official 573:ad23fe03a082 88 * This masking operation is not carried out in the case of
mbed_official 573:ad23fe03a082 89 * DMA transfers.
mbed_official 573:ad23fe03a082 90 * @param __HANDLE__: specifies the USART Handle
mbed_official 573:ad23fe03a082 91 * @retval none
mbed_official 573:ad23fe03a082 92 */
mbed_official 573:ad23fe03a082 93 #define __HAL_USART_MASK_COMPUTATION(__HANDLE__) \
mbed_official 573:ad23fe03a082 94 do { \
mbed_official 573:ad23fe03a082 95 if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_9B) \
mbed_official 573:ad23fe03a082 96 { \
mbed_official 573:ad23fe03a082 97 if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
mbed_official 573:ad23fe03a082 98 { \
mbed_official 573:ad23fe03a082 99 (__HANDLE__)->Mask = 0x01FF ; \
mbed_official 573:ad23fe03a082 100 } \
mbed_official 573:ad23fe03a082 101 else \
mbed_official 573:ad23fe03a082 102 { \
mbed_official 573:ad23fe03a082 103 (__HANDLE__)->Mask = 0x00FF ; \
mbed_official 573:ad23fe03a082 104 } \
mbed_official 573:ad23fe03a082 105 } \
mbed_official 573:ad23fe03a082 106 else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_8B) \
mbed_official 573:ad23fe03a082 107 { \
mbed_official 573:ad23fe03a082 108 if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
mbed_official 573:ad23fe03a082 109 { \
mbed_official 573:ad23fe03a082 110 (__HANDLE__)->Mask = 0x00FF ; \
mbed_official 573:ad23fe03a082 111 } \
mbed_official 573:ad23fe03a082 112 else \
mbed_official 573:ad23fe03a082 113 { \
mbed_official 573:ad23fe03a082 114 (__HANDLE__)->Mask = 0x007F ; \
mbed_official 573:ad23fe03a082 115 } \
mbed_official 573:ad23fe03a082 116 } \
mbed_official 573:ad23fe03a082 117 else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_7B) \
mbed_official 573:ad23fe03a082 118 { \
mbed_official 573:ad23fe03a082 119 if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
mbed_official 573:ad23fe03a082 120 { \
mbed_official 573:ad23fe03a082 121 (__HANDLE__)->Mask = 0x007F ; \
mbed_official 573:ad23fe03a082 122 } \
mbed_official 573:ad23fe03a082 123 else \
mbed_official 573:ad23fe03a082 124 { \
mbed_official 573:ad23fe03a082 125 (__HANDLE__)->Mask = 0x003F ; \
mbed_official 573:ad23fe03a082 126 } \
mbed_official 573:ad23fe03a082 127 } \
mbed_official 573:ad23fe03a082 128 } while(0)
mbed_official 573:ad23fe03a082 129
mbed_official 573:ad23fe03a082 130 #define IS_USART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == USART_WORDLENGTH_7B) || \
mbed_official 573:ad23fe03a082 131 ((__LENGTH__) == USART_WORDLENGTH_8B) || \
mbed_official 573:ad23fe03a082 132 ((__LENGTH__) == USART_WORDLENGTH_9B))
mbed_official 573:ad23fe03a082 133 /**
mbed_official 573:ad23fe03a082 134 * @}
mbed_official 573:ad23fe03a082 135 */
mbed_official 573:ad23fe03a082 136
mbed_official 573:ad23fe03a082 137 /* Exported functions --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 138 /* Initialization/de-initialization methods **********************************/
mbed_official 573:ad23fe03a082 139 /* IO operation methods *******************************************************/
mbed_official 573:ad23fe03a082 140 /* Peripheral Control methods ************************************************/
mbed_official 573:ad23fe03a082 141 /* Peripheral State methods **************************************************/
mbed_official 573:ad23fe03a082 142
mbed_official 573:ad23fe03a082 143
mbed_official 573:ad23fe03a082 144 /**
mbed_official 573:ad23fe03a082 145 * @}
mbed_official 573:ad23fe03a082 146 */
mbed_official 573:ad23fe03a082 147
mbed_official 573:ad23fe03a082 148 /**
mbed_official 573:ad23fe03a082 149 * @}
mbed_official 573:ad23fe03a082 150 */
mbed_official 573:ad23fe03a082 151
mbed_official 573:ad23fe03a082 152 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 153 }
mbed_official 573:ad23fe03a082 154 #endif
mbed_official 573:ad23fe03a082 155
mbed_official 573:ad23fe03a082 156 #endif /* __STM32F7xx_HAL_USART_EX_H */
mbed_official 573:ad23fe03a082 157
mbed_official 573:ad23fe03a082 158 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/