Initial commit
mbed-dev-master/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_ll_rng.h@0:bb348c97df44, 2020-09-16 (annotated)
- Committer:
- lypinator
- Date:
- Wed Sep 16 01:11:49 2020 +0000
- Revision:
- 0:bb348c97df44
Added PWM
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lypinator | 0:bb348c97df44 | 1 | /** |
lypinator | 0:bb348c97df44 | 2 | ****************************************************************************** |
lypinator | 0:bb348c97df44 | 3 | * @file stm32f4xx_ll_rng.h |
lypinator | 0:bb348c97df44 | 4 | * @author MCD Application Team |
lypinator | 0:bb348c97df44 | 5 | * @brief Header file of RNG LL module. |
lypinator | 0:bb348c97df44 | 6 | ****************************************************************************** |
lypinator | 0:bb348c97df44 | 7 | * @attention |
lypinator | 0:bb348c97df44 | 8 | * |
lypinator | 0:bb348c97df44 | 9 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
lypinator | 0:bb348c97df44 | 10 | * |
lypinator | 0:bb348c97df44 | 11 | * Redistribution and use in source and binary forms, with or without modification, |
lypinator | 0:bb348c97df44 | 12 | * are permitted provided that the following conditions are met: |
lypinator | 0:bb348c97df44 | 13 | * 1. Redistributions of source code must retain the above copyright notice, |
lypinator | 0:bb348c97df44 | 14 | * this list of conditions and the following disclaimer. |
lypinator | 0:bb348c97df44 | 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
lypinator | 0:bb348c97df44 | 16 | * this list of conditions and the following disclaimer in the documentation |
lypinator | 0:bb348c97df44 | 17 | * and/or other materials provided with the distribution. |
lypinator | 0:bb348c97df44 | 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
lypinator | 0:bb348c97df44 | 19 | * may be used to endorse or promote products derived from this software |
lypinator | 0:bb348c97df44 | 20 | * without specific prior written permission. |
lypinator | 0:bb348c97df44 | 21 | * |
lypinator | 0:bb348c97df44 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
lypinator | 0:bb348c97df44 | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
lypinator | 0:bb348c97df44 | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
lypinator | 0:bb348c97df44 | 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
lypinator | 0:bb348c97df44 | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
lypinator | 0:bb348c97df44 | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
lypinator | 0:bb348c97df44 | 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
lypinator | 0:bb348c97df44 | 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
lypinator | 0:bb348c97df44 | 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
lypinator | 0:bb348c97df44 | 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
lypinator | 0:bb348c97df44 | 32 | * |
lypinator | 0:bb348c97df44 | 33 | ****************************************************************************** |
lypinator | 0:bb348c97df44 | 34 | */ |
lypinator | 0:bb348c97df44 | 35 | |
lypinator | 0:bb348c97df44 | 36 | /* Define to prevent recursive inclusion -------------------------------------*/ |
lypinator | 0:bb348c97df44 | 37 | #ifndef __STM32F4xx_LL_RNG_H |
lypinator | 0:bb348c97df44 | 38 | #define __STM32F4xx_LL_RNG_H |
lypinator | 0:bb348c97df44 | 39 | |
lypinator | 0:bb348c97df44 | 40 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 41 | extern "C" { |
lypinator | 0:bb348c97df44 | 42 | #endif |
lypinator | 0:bb348c97df44 | 43 | |
lypinator | 0:bb348c97df44 | 44 | /* Includes ------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 45 | #include "stm32f4xx.h" |
lypinator | 0:bb348c97df44 | 46 | |
lypinator | 0:bb348c97df44 | 47 | /** @addtogroup STM32F4xx_LL_Driver |
lypinator | 0:bb348c97df44 | 48 | * @{ |
lypinator | 0:bb348c97df44 | 49 | */ |
lypinator | 0:bb348c97df44 | 50 | |
lypinator | 0:bb348c97df44 | 51 | #if defined(RNG) |
lypinator | 0:bb348c97df44 | 52 | |
lypinator | 0:bb348c97df44 | 53 | /** @defgroup RNG_LL RNG |
lypinator | 0:bb348c97df44 | 54 | * @{ |
lypinator | 0:bb348c97df44 | 55 | */ |
lypinator | 0:bb348c97df44 | 56 | |
lypinator | 0:bb348c97df44 | 57 | /* Private types -------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 58 | /* Private variables ---------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 59 | /* Private constants ---------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 60 | /* Private macros ------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 61 | |
lypinator | 0:bb348c97df44 | 62 | /* Exported types ------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 63 | /* Exported constants --------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 64 | /** @defgroup RNG_LL_Exported_Constants RNG Exported Constants |
lypinator | 0:bb348c97df44 | 65 | * @{ |
lypinator | 0:bb348c97df44 | 66 | */ |
lypinator | 0:bb348c97df44 | 67 | |
lypinator | 0:bb348c97df44 | 68 | /** @defgroup RNG_LL_EC_GET_FLAG Get Flags Defines |
lypinator | 0:bb348c97df44 | 69 | * @brief Flags defines which can be used with LL_RNG_ReadReg function |
lypinator | 0:bb348c97df44 | 70 | * @{ |
lypinator | 0:bb348c97df44 | 71 | */ |
lypinator | 0:bb348c97df44 | 72 | #define LL_RNG_SR_DRDY RNG_SR_DRDY /*!< Register contains valid random data */ |
lypinator | 0:bb348c97df44 | 73 | #define LL_RNG_SR_CECS RNG_SR_CECS /*!< Clock error current status */ |
lypinator | 0:bb348c97df44 | 74 | #define LL_RNG_SR_SECS RNG_SR_SECS /*!< Seed error current status */ |
lypinator | 0:bb348c97df44 | 75 | #define LL_RNG_SR_CEIS RNG_SR_CEIS /*!< Clock error interrupt status */ |
lypinator | 0:bb348c97df44 | 76 | #define LL_RNG_SR_SEIS RNG_SR_SEIS /*!< Seed error interrupt status */ |
lypinator | 0:bb348c97df44 | 77 | /** |
lypinator | 0:bb348c97df44 | 78 | * @} |
lypinator | 0:bb348c97df44 | 79 | */ |
lypinator | 0:bb348c97df44 | 80 | |
lypinator | 0:bb348c97df44 | 81 | /** @defgroup RNG_LL_EC_IT IT Defines |
lypinator | 0:bb348c97df44 | 82 | * @brief IT defines which can be used with LL_RNG_ReadReg and LL_RNG_WriteReg macros |
lypinator | 0:bb348c97df44 | 83 | * @{ |
lypinator | 0:bb348c97df44 | 84 | */ |
lypinator | 0:bb348c97df44 | 85 | #define LL_RNG_CR_IE RNG_CR_IE /*!< RNG Interrupt enable */ |
lypinator | 0:bb348c97df44 | 86 | /** |
lypinator | 0:bb348c97df44 | 87 | * @} |
lypinator | 0:bb348c97df44 | 88 | */ |
lypinator | 0:bb348c97df44 | 89 | |
lypinator | 0:bb348c97df44 | 90 | /** |
lypinator | 0:bb348c97df44 | 91 | * @} |
lypinator | 0:bb348c97df44 | 92 | */ |
lypinator | 0:bb348c97df44 | 93 | |
lypinator | 0:bb348c97df44 | 94 | /* Exported macro ------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 95 | /** @defgroup RNG_LL_Exported_Macros RNG Exported Macros |
lypinator | 0:bb348c97df44 | 96 | * @{ |
lypinator | 0:bb348c97df44 | 97 | */ |
lypinator | 0:bb348c97df44 | 98 | |
lypinator | 0:bb348c97df44 | 99 | /** @defgroup RNG_LL_EM_WRITE_READ Common Write and read registers Macros |
lypinator | 0:bb348c97df44 | 100 | * @{ |
lypinator | 0:bb348c97df44 | 101 | */ |
lypinator | 0:bb348c97df44 | 102 | |
lypinator | 0:bb348c97df44 | 103 | /** |
lypinator | 0:bb348c97df44 | 104 | * @brief Write a value in RNG register |
lypinator | 0:bb348c97df44 | 105 | * @param __INSTANCE__ RNG Instance |
lypinator | 0:bb348c97df44 | 106 | * @param __REG__ Register to be written |
lypinator | 0:bb348c97df44 | 107 | * @param __VALUE__ Value to be written in the register |
lypinator | 0:bb348c97df44 | 108 | * @retval None |
lypinator | 0:bb348c97df44 | 109 | */ |
lypinator | 0:bb348c97df44 | 110 | #define LL_RNG_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) |
lypinator | 0:bb348c97df44 | 111 | |
lypinator | 0:bb348c97df44 | 112 | /** |
lypinator | 0:bb348c97df44 | 113 | * @brief Read a value in RNG register |
lypinator | 0:bb348c97df44 | 114 | * @param __INSTANCE__ RNG Instance |
lypinator | 0:bb348c97df44 | 115 | * @param __REG__ Register to be read |
lypinator | 0:bb348c97df44 | 116 | * @retval Register value |
lypinator | 0:bb348c97df44 | 117 | */ |
lypinator | 0:bb348c97df44 | 118 | #define LL_RNG_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) |
lypinator | 0:bb348c97df44 | 119 | /** |
lypinator | 0:bb348c97df44 | 120 | * @} |
lypinator | 0:bb348c97df44 | 121 | */ |
lypinator | 0:bb348c97df44 | 122 | |
lypinator | 0:bb348c97df44 | 123 | /** |
lypinator | 0:bb348c97df44 | 124 | * @} |
lypinator | 0:bb348c97df44 | 125 | */ |
lypinator | 0:bb348c97df44 | 126 | |
lypinator | 0:bb348c97df44 | 127 | |
lypinator | 0:bb348c97df44 | 128 | /* Exported functions --------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 129 | /** @defgroup RNG_LL_Exported_Functions RNG Exported Functions |
lypinator | 0:bb348c97df44 | 130 | * @{ |
lypinator | 0:bb348c97df44 | 131 | */ |
lypinator | 0:bb348c97df44 | 132 | /** @defgroup RNG_LL_EF_Configuration RNG Configuration functions |
lypinator | 0:bb348c97df44 | 133 | * @{ |
lypinator | 0:bb348c97df44 | 134 | */ |
lypinator | 0:bb348c97df44 | 135 | |
lypinator | 0:bb348c97df44 | 136 | /** |
lypinator | 0:bb348c97df44 | 137 | * @brief Enable Random Number Generation |
lypinator | 0:bb348c97df44 | 138 | * @rmtoll CR RNGEN LL_RNG_Enable |
lypinator | 0:bb348c97df44 | 139 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 140 | * @retval None |
lypinator | 0:bb348c97df44 | 141 | */ |
lypinator | 0:bb348c97df44 | 142 | __STATIC_INLINE void LL_RNG_Enable(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 143 | { |
lypinator | 0:bb348c97df44 | 144 | SET_BIT(RNGx->CR, RNG_CR_RNGEN); |
lypinator | 0:bb348c97df44 | 145 | } |
lypinator | 0:bb348c97df44 | 146 | |
lypinator | 0:bb348c97df44 | 147 | /** |
lypinator | 0:bb348c97df44 | 148 | * @brief Disable Random Number Generation |
lypinator | 0:bb348c97df44 | 149 | * @rmtoll CR RNGEN LL_RNG_Disable |
lypinator | 0:bb348c97df44 | 150 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 151 | * @retval None |
lypinator | 0:bb348c97df44 | 152 | */ |
lypinator | 0:bb348c97df44 | 153 | __STATIC_INLINE void LL_RNG_Disable(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 154 | { |
lypinator | 0:bb348c97df44 | 155 | CLEAR_BIT(RNGx->CR, RNG_CR_RNGEN); |
lypinator | 0:bb348c97df44 | 156 | } |
lypinator | 0:bb348c97df44 | 157 | |
lypinator | 0:bb348c97df44 | 158 | /** |
lypinator | 0:bb348c97df44 | 159 | * @brief Check if Random Number Generator is enabled |
lypinator | 0:bb348c97df44 | 160 | * @rmtoll CR RNGEN LL_RNG_IsEnabled |
lypinator | 0:bb348c97df44 | 161 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 162 | * @retval State of bit (1 or 0). |
lypinator | 0:bb348c97df44 | 163 | */ |
lypinator | 0:bb348c97df44 | 164 | __STATIC_INLINE uint32_t LL_RNG_IsEnabled(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 165 | { |
lypinator | 0:bb348c97df44 | 166 | return (READ_BIT(RNGx->CR, RNG_CR_RNGEN) == (RNG_CR_RNGEN)); |
lypinator | 0:bb348c97df44 | 167 | } |
lypinator | 0:bb348c97df44 | 168 | |
lypinator | 0:bb348c97df44 | 169 | /** |
lypinator | 0:bb348c97df44 | 170 | * @} |
lypinator | 0:bb348c97df44 | 171 | */ |
lypinator | 0:bb348c97df44 | 172 | |
lypinator | 0:bb348c97df44 | 173 | /** @defgroup RNG_LL_EF_FLAG_Management FLAG Management |
lypinator | 0:bb348c97df44 | 174 | * @{ |
lypinator | 0:bb348c97df44 | 175 | */ |
lypinator | 0:bb348c97df44 | 176 | |
lypinator | 0:bb348c97df44 | 177 | /** |
lypinator | 0:bb348c97df44 | 178 | * @brief Indicate if the RNG Data ready Flag is set or not |
lypinator | 0:bb348c97df44 | 179 | * @rmtoll SR DRDY LL_RNG_IsActiveFlag_DRDY |
lypinator | 0:bb348c97df44 | 180 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 181 | * @retval State of bit (1 or 0). |
lypinator | 0:bb348c97df44 | 182 | */ |
lypinator | 0:bb348c97df44 | 183 | __STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_DRDY(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 184 | { |
lypinator | 0:bb348c97df44 | 185 | return (READ_BIT(RNGx->SR, RNG_SR_DRDY) == (RNG_SR_DRDY)); |
lypinator | 0:bb348c97df44 | 186 | } |
lypinator | 0:bb348c97df44 | 187 | |
lypinator | 0:bb348c97df44 | 188 | /** |
lypinator | 0:bb348c97df44 | 189 | * @brief Indicate if the Clock Error Current Status Flag is set or not |
lypinator | 0:bb348c97df44 | 190 | * @rmtoll SR CECS LL_RNG_IsActiveFlag_CECS |
lypinator | 0:bb348c97df44 | 191 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 192 | * @retval State of bit (1 or 0). |
lypinator | 0:bb348c97df44 | 193 | */ |
lypinator | 0:bb348c97df44 | 194 | __STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_CECS(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 195 | { |
lypinator | 0:bb348c97df44 | 196 | return (READ_BIT(RNGx->SR, RNG_SR_CECS) == (RNG_SR_CECS)); |
lypinator | 0:bb348c97df44 | 197 | } |
lypinator | 0:bb348c97df44 | 198 | |
lypinator | 0:bb348c97df44 | 199 | /** |
lypinator | 0:bb348c97df44 | 200 | * @brief Indicate if the Seed Error Current Status Flag is set or not |
lypinator | 0:bb348c97df44 | 201 | * @rmtoll SR SECS LL_RNG_IsActiveFlag_SECS |
lypinator | 0:bb348c97df44 | 202 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 203 | * @retval State of bit (1 or 0). |
lypinator | 0:bb348c97df44 | 204 | */ |
lypinator | 0:bb348c97df44 | 205 | __STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_SECS(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 206 | { |
lypinator | 0:bb348c97df44 | 207 | return (READ_BIT(RNGx->SR, RNG_SR_SECS) == (RNG_SR_SECS)); |
lypinator | 0:bb348c97df44 | 208 | } |
lypinator | 0:bb348c97df44 | 209 | |
lypinator | 0:bb348c97df44 | 210 | /** |
lypinator | 0:bb348c97df44 | 211 | * @brief Indicate if the Clock Error Interrupt Status Flag is set or not |
lypinator | 0:bb348c97df44 | 212 | * @rmtoll SR CEIS LL_RNG_IsActiveFlag_CEIS |
lypinator | 0:bb348c97df44 | 213 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 214 | * @retval State of bit (1 or 0). |
lypinator | 0:bb348c97df44 | 215 | */ |
lypinator | 0:bb348c97df44 | 216 | __STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_CEIS(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 217 | { |
lypinator | 0:bb348c97df44 | 218 | return (READ_BIT(RNGx->SR, RNG_SR_CEIS) == (RNG_SR_CEIS)); |
lypinator | 0:bb348c97df44 | 219 | } |
lypinator | 0:bb348c97df44 | 220 | |
lypinator | 0:bb348c97df44 | 221 | /** |
lypinator | 0:bb348c97df44 | 222 | * @brief Indicate if the Seed Error Interrupt Status Flag is set or not |
lypinator | 0:bb348c97df44 | 223 | * @rmtoll SR SEIS LL_RNG_IsActiveFlag_SEIS |
lypinator | 0:bb348c97df44 | 224 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 225 | * @retval State of bit (1 or 0). |
lypinator | 0:bb348c97df44 | 226 | */ |
lypinator | 0:bb348c97df44 | 227 | __STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_SEIS(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 228 | { |
lypinator | 0:bb348c97df44 | 229 | return (READ_BIT(RNGx->SR, RNG_SR_SEIS) == (RNG_SR_SEIS)); |
lypinator | 0:bb348c97df44 | 230 | } |
lypinator | 0:bb348c97df44 | 231 | |
lypinator | 0:bb348c97df44 | 232 | /** |
lypinator | 0:bb348c97df44 | 233 | * @brief Clear Clock Error interrupt Status (CEIS) Flag |
lypinator | 0:bb348c97df44 | 234 | * @rmtoll SR CEIS LL_RNG_ClearFlag_CEIS |
lypinator | 0:bb348c97df44 | 235 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 236 | * @retval None |
lypinator | 0:bb348c97df44 | 237 | */ |
lypinator | 0:bb348c97df44 | 238 | __STATIC_INLINE void LL_RNG_ClearFlag_CEIS(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 239 | { |
lypinator | 0:bb348c97df44 | 240 | WRITE_REG(RNGx->SR, ~RNG_SR_CEIS); |
lypinator | 0:bb348c97df44 | 241 | } |
lypinator | 0:bb348c97df44 | 242 | |
lypinator | 0:bb348c97df44 | 243 | /** |
lypinator | 0:bb348c97df44 | 244 | * @brief Clear Seed Error interrupt Status (SEIS) Flag |
lypinator | 0:bb348c97df44 | 245 | * @rmtoll SR SEIS LL_RNG_ClearFlag_SEIS |
lypinator | 0:bb348c97df44 | 246 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 247 | * @retval None |
lypinator | 0:bb348c97df44 | 248 | */ |
lypinator | 0:bb348c97df44 | 249 | __STATIC_INLINE void LL_RNG_ClearFlag_SEIS(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 250 | { |
lypinator | 0:bb348c97df44 | 251 | WRITE_REG(RNGx->SR, ~RNG_SR_SEIS); |
lypinator | 0:bb348c97df44 | 252 | } |
lypinator | 0:bb348c97df44 | 253 | |
lypinator | 0:bb348c97df44 | 254 | /** |
lypinator | 0:bb348c97df44 | 255 | * @} |
lypinator | 0:bb348c97df44 | 256 | */ |
lypinator | 0:bb348c97df44 | 257 | |
lypinator | 0:bb348c97df44 | 258 | /** @defgroup RNG_LL_EF_IT_Management IT Management |
lypinator | 0:bb348c97df44 | 259 | * @{ |
lypinator | 0:bb348c97df44 | 260 | */ |
lypinator | 0:bb348c97df44 | 261 | |
lypinator | 0:bb348c97df44 | 262 | /** |
lypinator | 0:bb348c97df44 | 263 | * @brief Enable Random Number Generator Interrupt |
lypinator | 0:bb348c97df44 | 264 | * (applies for either Seed error, Clock Error or Data ready interrupts) |
lypinator | 0:bb348c97df44 | 265 | * @rmtoll CR IE LL_RNG_EnableIT |
lypinator | 0:bb348c97df44 | 266 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 267 | * @retval None |
lypinator | 0:bb348c97df44 | 268 | */ |
lypinator | 0:bb348c97df44 | 269 | __STATIC_INLINE void LL_RNG_EnableIT(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 270 | { |
lypinator | 0:bb348c97df44 | 271 | SET_BIT(RNGx->CR, RNG_CR_IE); |
lypinator | 0:bb348c97df44 | 272 | } |
lypinator | 0:bb348c97df44 | 273 | |
lypinator | 0:bb348c97df44 | 274 | /** |
lypinator | 0:bb348c97df44 | 275 | * @brief Disable Random Number Generator Interrupt |
lypinator | 0:bb348c97df44 | 276 | * (applies for either Seed error, Clock Error or Data ready interrupts) |
lypinator | 0:bb348c97df44 | 277 | * @rmtoll CR IE LL_RNG_DisableIT |
lypinator | 0:bb348c97df44 | 278 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 279 | * @retval None |
lypinator | 0:bb348c97df44 | 280 | */ |
lypinator | 0:bb348c97df44 | 281 | __STATIC_INLINE void LL_RNG_DisableIT(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 282 | { |
lypinator | 0:bb348c97df44 | 283 | CLEAR_BIT(RNGx->CR, RNG_CR_IE); |
lypinator | 0:bb348c97df44 | 284 | } |
lypinator | 0:bb348c97df44 | 285 | |
lypinator | 0:bb348c97df44 | 286 | /** |
lypinator | 0:bb348c97df44 | 287 | * @brief Check if Random Number Generator Interrupt is enabled |
lypinator | 0:bb348c97df44 | 288 | * (applies for either Seed error, Clock Error or Data ready interrupts) |
lypinator | 0:bb348c97df44 | 289 | * @rmtoll CR IE LL_RNG_IsEnabledIT |
lypinator | 0:bb348c97df44 | 290 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 291 | * @retval State of bit (1 or 0). |
lypinator | 0:bb348c97df44 | 292 | */ |
lypinator | 0:bb348c97df44 | 293 | __STATIC_INLINE uint32_t LL_RNG_IsEnabledIT(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 294 | { |
lypinator | 0:bb348c97df44 | 295 | return (READ_BIT(RNGx->CR, RNG_CR_IE) == (RNG_CR_IE)); |
lypinator | 0:bb348c97df44 | 296 | } |
lypinator | 0:bb348c97df44 | 297 | |
lypinator | 0:bb348c97df44 | 298 | /** |
lypinator | 0:bb348c97df44 | 299 | * @} |
lypinator | 0:bb348c97df44 | 300 | */ |
lypinator | 0:bb348c97df44 | 301 | |
lypinator | 0:bb348c97df44 | 302 | /** @defgroup RNG_LL_EF_Data_Management Data Management |
lypinator | 0:bb348c97df44 | 303 | * @{ |
lypinator | 0:bb348c97df44 | 304 | */ |
lypinator | 0:bb348c97df44 | 305 | |
lypinator | 0:bb348c97df44 | 306 | /** |
lypinator | 0:bb348c97df44 | 307 | * @brief Return32-bit Random Number value |
lypinator | 0:bb348c97df44 | 308 | * @rmtoll DR RNDATA LL_RNG_ReadRandData32 |
lypinator | 0:bb348c97df44 | 309 | * @param RNGx RNG Instance |
lypinator | 0:bb348c97df44 | 310 | * @retval Generated 32-bit random value |
lypinator | 0:bb348c97df44 | 311 | */ |
lypinator | 0:bb348c97df44 | 312 | __STATIC_INLINE uint32_t LL_RNG_ReadRandData32(RNG_TypeDef *RNGx) |
lypinator | 0:bb348c97df44 | 313 | { |
lypinator | 0:bb348c97df44 | 314 | return (uint32_t)(READ_REG(RNGx->DR)); |
lypinator | 0:bb348c97df44 | 315 | } |
lypinator | 0:bb348c97df44 | 316 | |
lypinator | 0:bb348c97df44 | 317 | /** |
lypinator | 0:bb348c97df44 | 318 | * @} |
lypinator | 0:bb348c97df44 | 319 | */ |
lypinator | 0:bb348c97df44 | 320 | |
lypinator | 0:bb348c97df44 | 321 | #if defined(USE_FULL_LL_DRIVER) |
lypinator | 0:bb348c97df44 | 322 | /** @defgroup RNG_LL_EF_Init Initialization and de-initialization functions |
lypinator | 0:bb348c97df44 | 323 | * @{ |
lypinator | 0:bb348c97df44 | 324 | */ |
lypinator | 0:bb348c97df44 | 325 | |
lypinator | 0:bb348c97df44 | 326 | ErrorStatus LL_RNG_DeInit(RNG_TypeDef *RNGx); |
lypinator | 0:bb348c97df44 | 327 | |
lypinator | 0:bb348c97df44 | 328 | /** |
lypinator | 0:bb348c97df44 | 329 | * @} |
lypinator | 0:bb348c97df44 | 330 | */ |
lypinator | 0:bb348c97df44 | 331 | #endif /* USE_FULL_LL_DRIVER */ |
lypinator | 0:bb348c97df44 | 332 | |
lypinator | 0:bb348c97df44 | 333 | /** |
lypinator | 0:bb348c97df44 | 334 | * @} |
lypinator | 0:bb348c97df44 | 335 | */ |
lypinator | 0:bb348c97df44 | 336 | |
lypinator | 0:bb348c97df44 | 337 | /** |
lypinator | 0:bb348c97df44 | 338 | * @} |
lypinator | 0:bb348c97df44 | 339 | */ |
lypinator | 0:bb348c97df44 | 340 | |
lypinator | 0:bb348c97df44 | 341 | #endif /* defined(RNG) */ |
lypinator | 0:bb348c97df44 | 342 | |
lypinator | 0:bb348c97df44 | 343 | /** |
lypinator | 0:bb348c97df44 | 344 | * @} |
lypinator | 0:bb348c97df44 | 345 | */ |
lypinator | 0:bb348c97df44 | 346 | |
lypinator | 0:bb348c97df44 | 347 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 348 | } |
lypinator | 0:bb348c97df44 | 349 | #endif |
lypinator | 0:bb348c97df44 | 350 | |
lypinator | 0:bb348c97df44 | 351 | #endif /* __STM32F4xx_LL_RNG_H */ |
lypinator | 0:bb348c97df44 | 352 | |
lypinator | 0:bb348c97df44 | 353 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |