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-dev by
targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_ll_lpuart.c@178:c26431f84b0d, 2017-11-09 (annotated)
- Committer:
- amithy
- Date:
- Thu Nov 09 22:14:37 2017 +0000
- Revision:
- 178:c26431f84b0d
- Parent:
- 158:b23ee177fd68
test export
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Kojto | 158:b23ee177fd68 | 1 | /** |
| Kojto | 158:b23ee177fd68 | 2 | ****************************************************************************** |
| Kojto | 158:b23ee177fd68 | 3 | * @file stm32l0xx_ll_lpuart.c |
| Kojto | 158:b23ee177fd68 | 4 | * @author MCD Application Team |
| Kojto | 158:b23ee177fd68 | 5 | * @version V1.7.0 |
| Kojto | 158:b23ee177fd68 | 6 | * @date 31-May-2016 |
| Kojto | 158:b23ee177fd68 | 7 | * @brief LPUART LL module driver. |
| Kojto | 158:b23ee177fd68 | 8 | ****************************************************************************** |
| Kojto | 158:b23ee177fd68 | 9 | * @attention |
| Kojto | 158:b23ee177fd68 | 10 | * |
| Kojto | 158:b23ee177fd68 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
| Kojto | 158:b23ee177fd68 | 12 | * |
| Kojto | 158:b23ee177fd68 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
| Kojto | 158:b23ee177fd68 | 14 | * are permitted provided that the following conditions are met: |
| Kojto | 158:b23ee177fd68 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
| Kojto | 158:b23ee177fd68 | 16 | * this list of conditions and the following disclaimer. |
| Kojto | 158:b23ee177fd68 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| Kojto | 158:b23ee177fd68 | 18 | * this list of conditions and the following disclaimer in the documentation |
| Kojto | 158:b23ee177fd68 | 19 | * and/or other materials provided with the distribution. |
| Kojto | 158:b23ee177fd68 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| Kojto | 158:b23ee177fd68 | 21 | * may be used to endorse or promote products derived from this software |
| Kojto | 158:b23ee177fd68 | 22 | * without specific prior written permission. |
| Kojto | 158:b23ee177fd68 | 23 | * |
| Kojto | 158:b23ee177fd68 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| Kojto | 158:b23ee177fd68 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| Kojto | 158:b23ee177fd68 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| Kojto | 158:b23ee177fd68 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| Kojto | 158:b23ee177fd68 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| Kojto | 158:b23ee177fd68 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| Kojto | 158:b23ee177fd68 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| Kojto | 158:b23ee177fd68 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| Kojto | 158:b23ee177fd68 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| Kojto | 158:b23ee177fd68 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Kojto | 158:b23ee177fd68 | 34 | * |
| Kojto | 158:b23ee177fd68 | 35 | ****************************************************************************** |
| Kojto | 158:b23ee177fd68 | 36 | */ |
| Kojto | 158:b23ee177fd68 | 37 | #if defined(USE_FULL_LL_DRIVER) |
| Kojto | 158:b23ee177fd68 | 38 | |
| Kojto | 158:b23ee177fd68 | 39 | /* Includes ------------------------------------------------------------------*/ |
| Kojto | 158:b23ee177fd68 | 40 | #include "stm32l0xx_ll_lpuart.h" |
| Kojto | 158:b23ee177fd68 | 41 | #include "stm32l0xx_ll_rcc.h" |
| Kojto | 158:b23ee177fd68 | 42 | #include "stm32l0xx_ll_bus.h" |
| Kojto | 158:b23ee177fd68 | 43 | #ifdef USE_FULL_ASSERT |
| Kojto | 158:b23ee177fd68 | 44 | #include "stm32_assert.h" |
| Kojto | 158:b23ee177fd68 | 45 | #else |
| Kojto | 158:b23ee177fd68 | 46 | #define assert_param(expr) ((void)0U) |
| Kojto | 158:b23ee177fd68 | 47 | #endif |
| Kojto | 158:b23ee177fd68 | 48 | |
| Kojto | 158:b23ee177fd68 | 49 | /** @addtogroup STM32L0xx_LL_Driver |
| Kojto | 158:b23ee177fd68 | 50 | * @{ |
| Kojto | 158:b23ee177fd68 | 51 | */ |
| Kojto | 158:b23ee177fd68 | 52 | |
| Kojto | 158:b23ee177fd68 | 53 | #if defined (LPUART1) |
| Kojto | 158:b23ee177fd68 | 54 | |
| Kojto | 158:b23ee177fd68 | 55 | /** @addtogroup LPUART_LL |
| Kojto | 158:b23ee177fd68 | 56 | * @{ |
| Kojto | 158:b23ee177fd68 | 57 | */ |
| Kojto | 158:b23ee177fd68 | 58 | |
| Kojto | 158:b23ee177fd68 | 59 | /* Private types -------------------------------------------------------------*/ |
| Kojto | 158:b23ee177fd68 | 60 | /* Private variables ---------------------------------------------------------*/ |
| Kojto | 158:b23ee177fd68 | 61 | /* Private constants ---------------------------------------------------------*/ |
| Kojto | 158:b23ee177fd68 | 62 | /** @addtogroup LPUART_LL_Private_Constants |
| Kojto | 158:b23ee177fd68 | 63 | * @{ |
| Kojto | 158:b23ee177fd68 | 64 | */ |
| Kojto | 158:b23ee177fd68 | 65 | |
| Kojto | 158:b23ee177fd68 | 66 | /** |
| Kojto | 158:b23ee177fd68 | 67 | * @} |
| Kojto | 158:b23ee177fd68 | 68 | */ |
| Kojto | 158:b23ee177fd68 | 69 | |
| Kojto | 158:b23ee177fd68 | 70 | |
| Kojto | 158:b23ee177fd68 | 71 | /* Private macros ------------------------------------------------------------*/ |
| Kojto | 158:b23ee177fd68 | 72 | /** @addtogroup LPUART_LL_Private_Macros |
| Kojto | 158:b23ee177fd68 | 73 | * @{ |
| Kojto | 158:b23ee177fd68 | 74 | */ |
| Kojto | 158:b23ee177fd68 | 75 | |
| Kojto | 158:b23ee177fd68 | 76 | /* Check of parameters for configuration of LPUART registers */ |
| Kojto | 158:b23ee177fd68 | 77 | |
| Kojto | 158:b23ee177fd68 | 78 | /* __BAUDRATE__ Depending on constraints applicable for LPUART BRR register */ |
| Kojto | 158:b23ee177fd68 | 79 | /* value : */ |
| Kojto | 158:b23ee177fd68 | 80 | /* - fck must be in the range [3 x baudrate, 4096 x baudrate] */ |
| Kojto | 158:b23ee177fd68 | 81 | /* - LPUART_BRR register value should be >= 0x300 */ |
| Kojto | 158:b23ee177fd68 | 82 | /* - LPUART_BRR register value should be <= 0xFFFFF (20 bits) */ |
| Kojto | 158:b23ee177fd68 | 83 | /* Baudrate specified by the user should belong to [8, 10600000].*/ |
| Kojto | 158:b23ee177fd68 | 84 | #define IS_LL_LPUART_BAUDRATE(__BAUDRATE__) (((__BAUDRATE__) <= 10600000U) && ((__BAUDRATE__) >= 8U)) |
| Kojto | 158:b23ee177fd68 | 85 | |
| Kojto | 158:b23ee177fd68 | 86 | #define IS_LL_LPUART_DIRECTION(__VALUE__) (((__VALUE__) == LL_LPUART_DIRECTION_NONE) \ |
| Kojto | 158:b23ee177fd68 | 87 | || ((__VALUE__) == LL_LPUART_DIRECTION_RX) \ |
| Kojto | 158:b23ee177fd68 | 88 | || ((__VALUE__) == LL_LPUART_DIRECTION_TX) \ |
| Kojto | 158:b23ee177fd68 | 89 | || ((__VALUE__) == LL_LPUART_DIRECTION_TX_RX)) |
| Kojto | 158:b23ee177fd68 | 90 | |
| Kojto | 158:b23ee177fd68 | 91 | #define IS_LL_LPUART_PARITY(__VALUE__) (((__VALUE__) == LL_LPUART_PARITY_NONE) \ |
| Kojto | 158:b23ee177fd68 | 92 | || ((__VALUE__) == LL_LPUART_PARITY_EVEN) \ |
| Kojto | 158:b23ee177fd68 | 93 | || ((__VALUE__) == LL_LPUART_PARITY_ODD)) |
| Kojto | 158:b23ee177fd68 | 94 | |
| Kojto | 158:b23ee177fd68 | 95 | #define IS_LL_LPUART_DATAWIDTH(__VALUE__) (((__VALUE__) == LL_LPUART_DATAWIDTH_7B) \ |
| Kojto | 158:b23ee177fd68 | 96 | || ((__VALUE__) == LL_LPUART_DATAWIDTH_8B) \ |
| Kojto | 158:b23ee177fd68 | 97 | || ((__VALUE__) == LL_LPUART_DATAWIDTH_9B)) |
| Kojto | 158:b23ee177fd68 | 98 | |
| Kojto | 158:b23ee177fd68 | 99 | #define IS_LL_LPUART_STOPBITS(__VALUE__) (((__VALUE__) == LL_LPUART_STOPBITS_1) \ |
| Kojto | 158:b23ee177fd68 | 100 | || ((__VALUE__) == LL_LPUART_STOPBITS_2)) |
| Kojto | 158:b23ee177fd68 | 101 | |
| Kojto | 158:b23ee177fd68 | 102 | #define IS_LL_LPUART_HWCONTROL(__VALUE__) (((__VALUE__) == LL_LPUART_HWCONTROL_NONE) \ |
| Kojto | 158:b23ee177fd68 | 103 | || ((__VALUE__) == LL_LPUART_HWCONTROL_RTS) \ |
| Kojto | 158:b23ee177fd68 | 104 | || ((__VALUE__) == LL_LPUART_HWCONTROL_CTS) \ |
| Kojto | 158:b23ee177fd68 | 105 | || ((__VALUE__) == LL_LPUART_HWCONTROL_RTS_CTS)) |
| Kojto | 158:b23ee177fd68 | 106 | |
| Kojto | 158:b23ee177fd68 | 107 | /** |
| Kojto | 158:b23ee177fd68 | 108 | * @} |
| Kojto | 158:b23ee177fd68 | 109 | */ |
| Kojto | 158:b23ee177fd68 | 110 | |
| Kojto | 158:b23ee177fd68 | 111 | /* Private function prototypes -----------------------------------------------*/ |
| Kojto | 158:b23ee177fd68 | 112 | |
| Kojto | 158:b23ee177fd68 | 113 | /* Exported functions --------------------------------------------------------*/ |
| Kojto | 158:b23ee177fd68 | 114 | /** @addtogroup LPUART_LL_Exported_Functions |
| Kojto | 158:b23ee177fd68 | 115 | * @{ |
| Kojto | 158:b23ee177fd68 | 116 | */ |
| Kojto | 158:b23ee177fd68 | 117 | |
| Kojto | 158:b23ee177fd68 | 118 | /** @addtogroup LPUART_LL_EF_Init |
| Kojto | 158:b23ee177fd68 | 119 | * @{ |
| Kojto | 158:b23ee177fd68 | 120 | */ |
| Kojto | 158:b23ee177fd68 | 121 | |
| Kojto | 158:b23ee177fd68 | 122 | /** |
| Kojto | 158:b23ee177fd68 | 123 | * @brief De-initialize LPUART registers (Registers restored to their default values). |
| Kojto | 158:b23ee177fd68 | 124 | * @param LPUARTx LPUART Instance |
| Kojto | 158:b23ee177fd68 | 125 | * @retval An ErrorStatus enumeration value: |
| Kojto | 158:b23ee177fd68 | 126 | * - SUCCESS: LPUART registers are de-initialized |
| Kojto | 158:b23ee177fd68 | 127 | * - ERROR: not applicable |
| Kojto | 158:b23ee177fd68 | 128 | */ |
| Kojto | 158:b23ee177fd68 | 129 | ErrorStatus LL_LPUART_DeInit(USART_TypeDef *LPUARTx) |
| Kojto | 158:b23ee177fd68 | 130 | { |
| Kojto | 158:b23ee177fd68 | 131 | ErrorStatus status = SUCCESS; |
| Kojto | 158:b23ee177fd68 | 132 | |
| Kojto | 158:b23ee177fd68 | 133 | /* Check the parameters */ |
| Kojto | 158:b23ee177fd68 | 134 | assert_param(IS_LPUART_INSTANCE(LPUARTx)); |
| Kojto | 158:b23ee177fd68 | 135 | |
| Kojto | 158:b23ee177fd68 | 136 | /* Force reset of LPUART peripheral */ |
| Kojto | 158:b23ee177fd68 | 137 | LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_LPUART1); |
| Kojto | 158:b23ee177fd68 | 138 | |
| Kojto | 158:b23ee177fd68 | 139 | /* Release reset of LPUART peripheral */ |
| Kojto | 158:b23ee177fd68 | 140 | LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_LPUART1); |
| Kojto | 158:b23ee177fd68 | 141 | |
| Kojto | 158:b23ee177fd68 | 142 | return (status); |
| Kojto | 158:b23ee177fd68 | 143 | } |
| Kojto | 158:b23ee177fd68 | 144 | |
| Kojto | 158:b23ee177fd68 | 145 | /** |
| Kojto | 158:b23ee177fd68 | 146 | * @brief Initialize LPUART registers according to the specified |
| Kojto | 158:b23ee177fd68 | 147 | * parameters in LPUART_InitStruct. |
| Kojto | 158:b23ee177fd68 | 148 | * @note As some bits in LPUART configuration registers can only be written when the LPUART is disabled (USART_CR1_UE bit =0), |
| Kojto | 158:b23ee177fd68 | 149 | * LPUART IP should be in disabled state prior calling this function. Otherwise, ERROR result will be returned. |
| Kojto | 158:b23ee177fd68 | 150 | * @note Baud rate value stored in LPUART_InitStruct BaudRate field, should be valid (different from 0). |
| Kojto | 158:b23ee177fd68 | 151 | * @param LPUARTx LPUART Instance |
| Kojto | 158:b23ee177fd68 | 152 | * @param LPUART_InitStruct pointer to a @ref LL_LPUART_InitTypeDef structure |
| Kojto | 158:b23ee177fd68 | 153 | * that contains the configuration information for the specified LPUART peripheral. |
| Kojto | 158:b23ee177fd68 | 154 | * @retval An ErrorStatus enumeration value: |
| Kojto | 158:b23ee177fd68 | 155 | * - SUCCESS: LPUART registers are initialized according to LPUART_InitStruct content |
| Kojto | 158:b23ee177fd68 | 156 | * - ERROR: Problem occurred during LPUART Registers initialization |
| Kojto | 158:b23ee177fd68 | 157 | */ |
| Kojto | 158:b23ee177fd68 | 158 | ErrorStatus LL_LPUART_Init(USART_TypeDef *LPUARTx, LL_LPUART_InitTypeDef *LPUART_InitStruct) |
| Kojto | 158:b23ee177fd68 | 159 | { |
| Kojto | 158:b23ee177fd68 | 160 | ErrorStatus status = ERROR; |
| Kojto | 158:b23ee177fd68 | 161 | uint32_t periphclk = LL_RCC_PERIPH_FREQUENCY_NO; |
| Kojto | 158:b23ee177fd68 | 162 | |
| Kojto | 158:b23ee177fd68 | 163 | /* Check the parameters */ |
| Kojto | 158:b23ee177fd68 | 164 | assert_param(IS_LPUART_INSTANCE(LPUARTx)); |
| Kojto | 158:b23ee177fd68 | 165 | assert_param(IS_LL_LPUART_BAUDRATE(LPUART_InitStruct->BaudRate)); |
| Kojto | 158:b23ee177fd68 | 166 | assert_param(IS_LL_LPUART_DATAWIDTH(LPUART_InitStruct->DataWidth)); |
| Kojto | 158:b23ee177fd68 | 167 | assert_param(IS_LL_LPUART_STOPBITS(LPUART_InitStruct->StopBits)); |
| Kojto | 158:b23ee177fd68 | 168 | assert_param(IS_LL_LPUART_PARITY(LPUART_InitStruct->Parity)); |
| Kojto | 158:b23ee177fd68 | 169 | assert_param(IS_LL_LPUART_DIRECTION(LPUART_InitStruct->TransferDirection)); |
| Kojto | 158:b23ee177fd68 | 170 | assert_param(IS_LL_LPUART_HWCONTROL(LPUART_InitStruct->HardwareFlowControl)); |
| Kojto | 158:b23ee177fd68 | 171 | |
| Kojto | 158:b23ee177fd68 | 172 | /* LPUART needs to be in disabled state, in order to be able to configure some bits in |
| Kojto | 158:b23ee177fd68 | 173 | CRx registers. Otherwise (LPUART not in Disabled state) => return ERROR */ |
| Kojto | 158:b23ee177fd68 | 174 | if (LL_LPUART_IsEnabled(LPUARTx) == 0U) |
| Kojto | 158:b23ee177fd68 | 175 | { |
| Kojto | 158:b23ee177fd68 | 176 | /*---------------------------- LPUART CR1 Configuration ----------------------- |
| Kojto | 158:b23ee177fd68 | 177 | * Configure LPUARTx CR1 (LPUART Word Length, Parity and Transfer Direction bits) with parameters: |
| Kojto | 158:b23ee177fd68 | 178 | * - DataWidth: USART_CR1_M bits according to LPUART_InitStruct->DataWidth value |
| Kojto | 158:b23ee177fd68 | 179 | * - Parity: USART_CR1_PCE, USART_CR1_PS bits according to LPUART_InitStruct->Parity value |
| Kojto | 158:b23ee177fd68 | 180 | * - TransferDirection: USART_CR1_TE, USART_CR1_RE bits according to LPUART_InitStruct->TransferDirection value |
| Kojto | 158:b23ee177fd68 | 181 | */ |
| Kojto | 158:b23ee177fd68 | 182 | MODIFY_REG(LPUARTx->CR1, |
| Kojto | 158:b23ee177fd68 | 183 | (USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | USART_CR1_TE | USART_CR1_RE), |
| Kojto | 158:b23ee177fd68 | 184 | (LPUART_InitStruct->DataWidth | LPUART_InitStruct->Parity | LPUART_InitStruct->TransferDirection)); |
| Kojto | 158:b23ee177fd68 | 185 | |
| Kojto | 158:b23ee177fd68 | 186 | /*---------------------------- LPUART CR2 Configuration ----------------------- |
| Kojto | 158:b23ee177fd68 | 187 | * Configure LPUARTx CR2 (Stop bits) with parameters: |
| Kojto | 158:b23ee177fd68 | 188 | * - Stop Bits: USART_CR2_STOP bits according to LPUART_InitStruct->StopBits value. |
| Kojto | 158:b23ee177fd68 | 189 | */ |
| Kojto | 158:b23ee177fd68 | 190 | LL_LPUART_SetStopBitsLength(LPUARTx, LPUART_InitStruct->StopBits); |
| Kojto | 158:b23ee177fd68 | 191 | |
| Kojto | 158:b23ee177fd68 | 192 | /*---------------------------- LPUART CR3 Configuration ----------------------- |
| Kojto | 158:b23ee177fd68 | 193 | * Configure LPUARTx CR3 (Hardware Flow Control) with parameters: |
| Kojto | 158:b23ee177fd68 | 194 | * - HardwareFlowControl: USART_CR3_RTSE, USART_CR3_CTSE bits according to LPUART_InitStruct->HardwareFlowControl value. |
| Kojto | 158:b23ee177fd68 | 195 | */ |
| Kojto | 158:b23ee177fd68 | 196 | LL_LPUART_SetHWFlowCtrl(LPUARTx, LPUART_InitStruct->HardwareFlowControl); |
| Kojto | 158:b23ee177fd68 | 197 | |
| Kojto | 158:b23ee177fd68 | 198 | /*---------------------------- LPUART BRR Configuration ----------------------- |
| Kojto | 158:b23ee177fd68 | 199 | * Retrieve Clock frequency used for LPUART Peripheral |
| Kojto | 158:b23ee177fd68 | 200 | */ |
| Kojto | 158:b23ee177fd68 | 201 | periphclk = LL_RCC_GetLPUARTClockFreq(LL_RCC_LPUART1_CLKSOURCE); |
| Kojto | 158:b23ee177fd68 | 202 | |
| Kojto | 158:b23ee177fd68 | 203 | /* Configure the LPUART Baud Rate : |
| Kojto | 158:b23ee177fd68 | 204 | - valid baud rate value (different from 0) is required |
| Kojto | 158:b23ee177fd68 | 205 | - Peripheral clock as returned by RCC service, should be valid (different from 0). |
| Kojto | 158:b23ee177fd68 | 206 | */ |
| Kojto | 158:b23ee177fd68 | 207 | if ((periphclk != LL_RCC_PERIPH_FREQUENCY_NO) |
| Kojto | 158:b23ee177fd68 | 208 | && (LPUART_InitStruct->BaudRate != 0U)) |
| Kojto | 158:b23ee177fd68 | 209 | { |
| Kojto | 158:b23ee177fd68 | 210 | status = SUCCESS; |
| Kojto | 158:b23ee177fd68 | 211 | LL_LPUART_SetBaudRate(LPUARTx, |
| Kojto | 158:b23ee177fd68 | 212 | periphclk, |
| Kojto | 158:b23ee177fd68 | 213 | LPUART_InitStruct->BaudRate); |
| Kojto | 158:b23ee177fd68 | 214 | } |
| Kojto | 158:b23ee177fd68 | 215 | } |
| Kojto | 158:b23ee177fd68 | 216 | |
| Kojto | 158:b23ee177fd68 | 217 | return (status); |
| Kojto | 158:b23ee177fd68 | 218 | } |
| Kojto | 158:b23ee177fd68 | 219 | |
| Kojto | 158:b23ee177fd68 | 220 | /** |
| Kojto | 158:b23ee177fd68 | 221 | * @brief Set each @ref LL_LPUART_InitTypeDef field to default value. |
| Kojto | 158:b23ee177fd68 | 222 | * @param LPUART_InitStruct pointer to a @ref LL_LPUART_InitTypeDef structure |
| Kojto | 158:b23ee177fd68 | 223 | * whose fields will be set to default values. |
| Kojto | 158:b23ee177fd68 | 224 | * @retval None |
| Kojto | 158:b23ee177fd68 | 225 | */ |
| Kojto | 158:b23ee177fd68 | 226 | |
| Kojto | 158:b23ee177fd68 | 227 | void LL_LPUART_StructInit(LL_LPUART_InitTypeDef *LPUART_InitStruct) |
| Kojto | 158:b23ee177fd68 | 228 | { |
| Kojto | 158:b23ee177fd68 | 229 | /* Set LPUART_InitStruct fields to default values */ |
| Kojto | 158:b23ee177fd68 | 230 | LPUART_InitStruct->BaudRate = 9600U; |
| Kojto | 158:b23ee177fd68 | 231 | LPUART_InitStruct->DataWidth = LL_LPUART_DATAWIDTH_8B; |
| Kojto | 158:b23ee177fd68 | 232 | LPUART_InitStruct->StopBits = LL_LPUART_STOPBITS_1; |
| Kojto | 158:b23ee177fd68 | 233 | LPUART_InitStruct->Parity = LL_LPUART_PARITY_NONE ; |
| Kojto | 158:b23ee177fd68 | 234 | LPUART_InitStruct->TransferDirection = LL_LPUART_DIRECTION_TX_RX; |
| Kojto | 158:b23ee177fd68 | 235 | LPUART_InitStruct->HardwareFlowControl = LL_LPUART_HWCONTROL_NONE; |
| Kojto | 158:b23ee177fd68 | 236 | } |
| Kojto | 158:b23ee177fd68 | 237 | |
| Kojto | 158:b23ee177fd68 | 238 | /** |
| Kojto | 158:b23ee177fd68 | 239 | * @} |
| Kojto | 158:b23ee177fd68 | 240 | */ |
| Kojto | 158:b23ee177fd68 | 241 | |
| Kojto | 158:b23ee177fd68 | 242 | /** |
| Kojto | 158:b23ee177fd68 | 243 | * @} |
| Kojto | 158:b23ee177fd68 | 244 | */ |
| Kojto | 158:b23ee177fd68 | 245 | |
| Kojto | 158:b23ee177fd68 | 246 | /** |
| Kojto | 158:b23ee177fd68 | 247 | * @} |
| Kojto | 158:b23ee177fd68 | 248 | */ |
| Kojto | 158:b23ee177fd68 | 249 | |
| Kojto | 158:b23ee177fd68 | 250 | #endif /* defined (LPUART1) */ |
| Kojto | 158:b23ee177fd68 | 251 | |
| Kojto | 158:b23ee177fd68 | 252 | /** |
| Kojto | 158:b23ee177fd68 | 253 | * @} |
| Kojto | 158:b23ee177fd68 | 254 | */ |
| Kojto | 158:b23ee177fd68 | 255 | |
| Kojto | 158:b23ee177fd68 | 256 | #endif /* USE_FULL_LL_DRIVER */ |
| Kojto | 158:b23ee177fd68 | 257 | |
| Kojto | 158:b23ee177fd68 | 258 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
| Kojto | 158:b23ee177fd68 | 259 |
