Mouse code for the MacroRat
mbed-dev/targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_rng.c@18:6a4db94011d3, 2017-05-14 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sun May 14 23:18:57 2017 +0000
- Revision:
- 18:6a4db94011d3
Publishing again
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /** |
sahilmgandhi | 18:6a4db94011d3 | 2 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 3 | * @file stm32f2xx_hal_rng.c |
sahilmgandhi | 18:6a4db94011d3 | 4 | * @author MCD Application Team |
sahilmgandhi | 18:6a4db94011d3 | 5 | * @version V1.1.3 |
sahilmgandhi | 18:6a4db94011d3 | 6 | * @date 29-June-2016 |
sahilmgandhi | 18:6a4db94011d3 | 7 | * @brief RNG HAL module driver. |
sahilmgandhi | 18:6a4db94011d3 | 8 | * This file provides firmware functions to manage the following |
sahilmgandhi | 18:6a4db94011d3 | 9 | * functionalities of the Random Number Generator (RNG) peripheral: |
sahilmgandhi | 18:6a4db94011d3 | 10 | * + Initialization/de-initialization functions |
sahilmgandhi | 18:6a4db94011d3 | 11 | * + Peripheral Control functions |
sahilmgandhi | 18:6a4db94011d3 | 12 | * + Peripheral State functions |
sahilmgandhi | 18:6a4db94011d3 | 13 | * |
sahilmgandhi | 18:6a4db94011d3 | 14 | @verbatim |
sahilmgandhi | 18:6a4db94011d3 | 15 | ============================================================================== |
sahilmgandhi | 18:6a4db94011d3 | 16 | ##### How to use this driver ##### |
sahilmgandhi | 18:6a4db94011d3 | 17 | ============================================================================== |
sahilmgandhi | 18:6a4db94011d3 | 18 | [..] |
sahilmgandhi | 18:6a4db94011d3 | 19 | The RNG HAL driver can be used as follows: |
sahilmgandhi | 18:6a4db94011d3 | 20 | |
sahilmgandhi | 18:6a4db94011d3 | 21 | (#) Enable the RNG controller clock using __HAL_RCC_RNG_CLK_ENABLE() macro |
sahilmgandhi | 18:6a4db94011d3 | 22 | in HAL_RNG_MspInit(). |
sahilmgandhi | 18:6a4db94011d3 | 23 | (#) Activate the RNG peripheral using HAL_RNG_Init() function. |
sahilmgandhi | 18:6a4db94011d3 | 24 | (#) Wait until the 32 bit Random Number Generator contains a valid |
sahilmgandhi | 18:6a4db94011d3 | 25 | random data using (polling/interrupt) mode. |
sahilmgandhi | 18:6a4db94011d3 | 26 | (#) Get the 32 bit random number using HAL_RNG_GenerateRandomNumber() function. |
sahilmgandhi | 18:6a4db94011d3 | 27 | |
sahilmgandhi | 18:6a4db94011d3 | 28 | @endverbatim |
sahilmgandhi | 18:6a4db94011d3 | 29 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 30 | * @attention |
sahilmgandhi | 18:6a4db94011d3 | 31 | * |
sahilmgandhi | 18:6a4db94011d3 | 32 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
sahilmgandhi | 18:6a4db94011d3 | 33 | * |
sahilmgandhi | 18:6a4db94011d3 | 34 | * Redistribution and use in source and binary forms, with or without modification, |
sahilmgandhi | 18:6a4db94011d3 | 35 | * are permitted provided that the following conditions are met: |
sahilmgandhi | 18:6a4db94011d3 | 36 | * 1. Redistributions of source code must retain the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 37 | * this list of conditions and the following disclaimer. |
sahilmgandhi | 18:6a4db94011d3 | 38 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 39 | * this list of conditions and the following disclaimer in the documentation |
sahilmgandhi | 18:6a4db94011d3 | 40 | * and/or other materials provided with the distribution. |
sahilmgandhi | 18:6a4db94011d3 | 41 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
sahilmgandhi | 18:6a4db94011d3 | 42 | * may be used to endorse or promote products derived from this software |
sahilmgandhi | 18:6a4db94011d3 | 43 | * without specific prior written permission. |
sahilmgandhi | 18:6a4db94011d3 | 44 | * |
sahilmgandhi | 18:6a4db94011d3 | 45 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
sahilmgandhi | 18:6a4db94011d3 | 46 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
sahilmgandhi | 18:6a4db94011d3 | 47 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
sahilmgandhi | 18:6a4db94011d3 | 48 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
sahilmgandhi | 18:6a4db94011d3 | 49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
sahilmgandhi | 18:6a4db94011d3 | 50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
sahilmgandhi | 18:6a4db94011d3 | 51 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
sahilmgandhi | 18:6a4db94011d3 | 52 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
sahilmgandhi | 18:6a4db94011d3 | 53 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
sahilmgandhi | 18:6a4db94011d3 | 54 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
sahilmgandhi | 18:6a4db94011d3 | 55 | * |
sahilmgandhi | 18:6a4db94011d3 | 56 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 57 | */ |
sahilmgandhi | 18:6a4db94011d3 | 58 | |
sahilmgandhi | 18:6a4db94011d3 | 59 | /* Includes ------------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 60 | #include "stm32f2xx_hal.h" |
sahilmgandhi | 18:6a4db94011d3 | 61 | |
sahilmgandhi | 18:6a4db94011d3 | 62 | /** @addtogroup STM32F2xx_HAL_Driver |
sahilmgandhi | 18:6a4db94011d3 | 63 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 64 | */ |
sahilmgandhi | 18:6a4db94011d3 | 65 | |
sahilmgandhi | 18:6a4db94011d3 | 66 | /** @addtogroup RNG |
sahilmgandhi | 18:6a4db94011d3 | 67 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 68 | */ |
sahilmgandhi | 18:6a4db94011d3 | 69 | |
sahilmgandhi | 18:6a4db94011d3 | 70 | #ifdef HAL_RNG_MODULE_ENABLED |
sahilmgandhi | 18:6a4db94011d3 | 71 | |
sahilmgandhi | 18:6a4db94011d3 | 72 | |
sahilmgandhi | 18:6a4db94011d3 | 73 | /* Private types -------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 74 | /* Private defines -----------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 75 | /* Private variables ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 76 | /* Private constants ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 77 | /** @addtogroup RNG_Private_Constants |
sahilmgandhi | 18:6a4db94011d3 | 78 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 79 | */ |
sahilmgandhi | 18:6a4db94011d3 | 80 | #define RNG_TIMEOUT_VALUE 2U |
sahilmgandhi | 18:6a4db94011d3 | 81 | /** |
sahilmgandhi | 18:6a4db94011d3 | 82 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 83 | */ |
sahilmgandhi | 18:6a4db94011d3 | 84 | /* Private macros ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 85 | /* Private functions prototypes ----------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 86 | /* Private functions ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 87 | /* Exported functions --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 88 | |
sahilmgandhi | 18:6a4db94011d3 | 89 | /** @addtogroup RNG_Exported_Functions |
sahilmgandhi | 18:6a4db94011d3 | 90 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 91 | */ |
sahilmgandhi | 18:6a4db94011d3 | 92 | |
sahilmgandhi | 18:6a4db94011d3 | 93 | /** @addtogroup RNG_Exported_Functions_Group1 |
sahilmgandhi | 18:6a4db94011d3 | 94 | * @brief Initialization and de-initialization functions |
sahilmgandhi | 18:6a4db94011d3 | 95 | * |
sahilmgandhi | 18:6a4db94011d3 | 96 | @verbatim |
sahilmgandhi | 18:6a4db94011d3 | 97 | =============================================================================== |
sahilmgandhi | 18:6a4db94011d3 | 98 | ##### Initialization and de-initialization functions ##### |
sahilmgandhi | 18:6a4db94011d3 | 99 | =============================================================================== |
sahilmgandhi | 18:6a4db94011d3 | 100 | [..] This section provides functions allowing to: |
sahilmgandhi | 18:6a4db94011d3 | 101 | (+) Initialize the RNG according to the specified parameters |
sahilmgandhi | 18:6a4db94011d3 | 102 | in the RNG_InitTypeDef and create the associated handle |
sahilmgandhi | 18:6a4db94011d3 | 103 | (+) DeInitialize the RNG peripheral |
sahilmgandhi | 18:6a4db94011d3 | 104 | (+) Initialize the RNG MSP |
sahilmgandhi | 18:6a4db94011d3 | 105 | (+) DeInitialize RNG MSP |
sahilmgandhi | 18:6a4db94011d3 | 106 | |
sahilmgandhi | 18:6a4db94011d3 | 107 | @endverbatim |
sahilmgandhi | 18:6a4db94011d3 | 108 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 109 | */ |
sahilmgandhi | 18:6a4db94011d3 | 110 | |
sahilmgandhi | 18:6a4db94011d3 | 111 | /** |
sahilmgandhi | 18:6a4db94011d3 | 112 | * @brief Initializes the RNG peripheral and creates the associated handle. |
sahilmgandhi | 18:6a4db94011d3 | 113 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 114 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 115 | * @retval HAL status |
sahilmgandhi | 18:6a4db94011d3 | 116 | */ |
sahilmgandhi | 18:6a4db94011d3 | 117 | HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 118 | { |
sahilmgandhi | 18:6a4db94011d3 | 119 | /* Check the RNG handle allocation */ |
sahilmgandhi | 18:6a4db94011d3 | 120 | if(hrng == NULL) |
sahilmgandhi | 18:6a4db94011d3 | 121 | { |
sahilmgandhi | 18:6a4db94011d3 | 122 | return HAL_ERROR; |
sahilmgandhi | 18:6a4db94011d3 | 123 | } |
sahilmgandhi | 18:6a4db94011d3 | 124 | |
sahilmgandhi | 18:6a4db94011d3 | 125 | __HAL_LOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 126 | |
sahilmgandhi | 18:6a4db94011d3 | 127 | if(hrng->State == HAL_RNG_STATE_RESET) |
sahilmgandhi | 18:6a4db94011d3 | 128 | { |
sahilmgandhi | 18:6a4db94011d3 | 129 | /* Allocate lock resource and initialize it */ |
sahilmgandhi | 18:6a4db94011d3 | 130 | hrng->Lock = HAL_UNLOCKED; |
sahilmgandhi | 18:6a4db94011d3 | 131 | /* Init the low level hardware */ |
sahilmgandhi | 18:6a4db94011d3 | 132 | HAL_RNG_MspInit(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 133 | } |
sahilmgandhi | 18:6a4db94011d3 | 134 | |
sahilmgandhi | 18:6a4db94011d3 | 135 | /* Change RNG peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 136 | hrng->State = HAL_RNG_STATE_BUSY; |
sahilmgandhi | 18:6a4db94011d3 | 137 | |
sahilmgandhi | 18:6a4db94011d3 | 138 | /* Enable the RNG Peripheral */ |
sahilmgandhi | 18:6a4db94011d3 | 139 | __HAL_RNG_ENABLE(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 140 | |
sahilmgandhi | 18:6a4db94011d3 | 141 | /* Initialize the RNG state */ |
sahilmgandhi | 18:6a4db94011d3 | 142 | hrng->State = HAL_RNG_STATE_READY; |
sahilmgandhi | 18:6a4db94011d3 | 143 | |
sahilmgandhi | 18:6a4db94011d3 | 144 | __HAL_UNLOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 145 | |
sahilmgandhi | 18:6a4db94011d3 | 146 | /* Return function status */ |
sahilmgandhi | 18:6a4db94011d3 | 147 | return HAL_OK; |
sahilmgandhi | 18:6a4db94011d3 | 148 | } |
sahilmgandhi | 18:6a4db94011d3 | 149 | |
sahilmgandhi | 18:6a4db94011d3 | 150 | /** |
sahilmgandhi | 18:6a4db94011d3 | 151 | * @brief DeInitializes the RNG peripheral. |
sahilmgandhi | 18:6a4db94011d3 | 152 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 153 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 154 | * @retval HAL status |
sahilmgandhi | 18:6a4db94011d3 | 155 | */ |
sahilmgandhi | 18:6a4db94011d3 | 156 | HAL_StatusTypeDef HAL_RNG_DeInit(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 157 | { |
sahilmgandhi | 18:6a4db94011d3 | 158 | /* Check the RNG handle allocation */ |
sahilmgandhi | 18:6a4db94011d3 | 159 | if(hrng == NULL) |
sahilmgandhi | 18:6a4db94011d3 | 160 | { |
sahilmgandhi | 18:6a4db94011d3 | 161 | return HAL_ERROR; |
sahilmgandhi | 18:6a4db94011d3 | 162 | } |
sahilmgandhi | 18:6a4db94011d3 | 163 | /* Disable the RNG Peripheral */ |
sahilmgandhi | 18:6a4db94011d3 | 164 | CLEAR_BIT(hrng->Instance->CR, RNG_CR_IE | RNG_CR_RNGEN); |
sahilmgandhi | 18:6a4db94011d3 | 165 | |
sahilmgandhi | 18:6a4db94011d3 | 166 | /* Clear RNG interrupt status flags */ |
sahilmgandhi | 18:6a4db94011d3 | 167 | CLEAR_BIT(hrng->Instance->SR, RNG_SR_CEIS | RNG_SR_SEIS); |
sahilmgandhi | 18:6a4db94011d3 | 168 | |
sahilmgandhi | 18:6a4db94011d3 | 169 | /* DeInit the low level hardware */ |
sahilmgandhi | 18:6a4db94011d3 | 170 | HAL_RNG_MspDeInit(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 171 | |
sahilmgandhi | 18:6a4db94011d3 | 172 | /* Update the RNG state */ |
sahilmgandhi | 18:6a4db94011d3 | 173 | hrng->State = HAL_RNG_STATE_RESET; |
sahilmgandhi | 18:6a4db94011d3 | 174 | |
sahilmgandhi | 18:6a4db94011d3 | 175 | /* Release Lock */ |
sahilmgandhi | 18:6a4db94011d3 | 176 | __HAL_UNLOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 177 | |
sahilmgandhi | 18:6a4db94011d3 | 178 | /* Return the function status */ |
sahilmgandhi | 18:6a4db94011d3 | 179 | return HAL_OK; |
sahilmgandhi | 18:6a4db94011d3 | 180 | } |
sahilmgandhi | 18:6a4db94011d3 | 181 | |
sahilmgandhi | 18:6a4db94011d3 | 182 | /** |
sahilmgandhi | 18:6a4db94011d3 | 183 | * @brief Initializes the RNG MSP. |
sahilmgandhi | 18:6a4db94011d3 | 184 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 185 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 186 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 187 | */ |
sahilmgandhi | 18:6a4db94011d3 | 188 | __weak void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 189 | { |
sahilmgandhi | 18:6a4db94011d3 | 190 | /* Prevent unused argument(s) compilation warning */ |
sahilmgandhi | 18:6a4db94011d3 | 191 | UNUSED(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 192 | /* NOTE : This function should not be modified. When the callback is needed, |
sahilmgandhi | 18:6a4db94011d3 | 193 | function HAL_RNG_MspInit must be implemented in the user file. |
sahilmgandhi | 18:6a4db94011d3 | 194 | */ |
sahilmgandhi | 18:6a4db94011d3 | 195 | } |
sahilmgandhi | 18:6a4db94011d3 | 196 | |
sahilmgandhi | 18:6a4db94011d3 | 197 | /** |
sahilmgandhi | 18:6a4db94011d3 | 198 | * @brief DeInitializes the RNG MSP. |
sahilmgandhi | 18:6a4db94011d3 | 199 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 200 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 201 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 202 | */ |
sahilmgandhi | 18:6a4db94011d3 | 203 | __weak void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 204 | { |
sahilmgandhi | 18:6a4db94011d3 | 205 | /* Prevent unused argument(s) compilation warning */ |
sahilmgandhi | 18:6a4db94011d3 | 206 | UNUSED(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 207 | /* NOTE : This function should not be modified. When the callback is needed, |
sahilmgandhi | 18:6a4db94011d3 | 208 | function HAL_RNG_MspDeInit must be implemented in the user file. |
sahilmgandhi | 18:6a4db94011d3 | 209 | */ |
sahilmgandhi | 18:6a4db94011d3 | 210 | } |
sahilmgandhi | 18:6a4db94011d3 | 211 | |
sahilmgandhi | 18:6a4db94011d3 | 212 | /** |
sahilmgandhi | 18:6a4db94011d3 | 213 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 214 | */ |
sahilmgandhi | 18:6a4db94011d3 | 215 | |
sahilmgandhi | 18:6a4db94011d3 | 216 | /** @addtogroup RNG_Exported_Functions_Group2 |
sahilmgandhi | 18:6a4db94011d3 | 217 | * @brief Peripheral Control functions |
sahilmgandhi | 18:6a4db94011d3 | 218 | * |
sahilmgandhi | 18:6a4db94011d3 | 219 | @verbatim |
sahilmgandhi | 18:6a4db94011d3 | 220 | =============================================================================== |
sahilmgandhi | 18:6a4db94011d3 | 221 | ##### Peripheral Control functions ##### |
sahilmgandhi | 18:6a4db94011d3 | 222 | =============================================================================== |
sahilmgandhi | 18:6a4db94011d3 | 223 | [..] This section provides functions allowing to: |
sahilmgandhi | 18:6a4db94011d3 | 224 | (+) Get the 32 bit Random number |
sahilmgandhi | 18:6a4db94011d3 | 225 | (+) Get the 32 bit Random number with interrupt enabled |
sahilmgandhi | 18:6a4db94011d3 | 226 | (+) Handle RNG interrupt request |
sahilmgandhi | 18:6a4db94011d3 | 227 | |
sahilmgandhi | 18:6a4db94011d3 | 228 | @endverbatim |
sahilmgandhi | 18:6a4db94011d3 | 229 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 230 | */ |
sahilmgandhi | 18:6a4db94011d3 | 231 | |
sahilmgandhi | 18:6a4db94011d3 | 232 | /** |
sahilmgandhi | 18:6a4db94011d3 | 233 | * @brief Generates a 32-bit random number. |
sahilmgandhi | 18:6a4db94011d3 | 234 | * @note Each time the random number data is read the RNG_FLAG_DRDY flag |
sahilmgandhi | 18:6a4db94011d3 | 235 | * is automatically cleared. |
sahilmgandhi | 18:6a4db94011d3 | 236 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 237 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 238 | * @param random32bit: pointer to generated random number variable if successful. |
sahilmgandhi | 18:6a4db94011d3 | 239 | * @retval HAL status |
sahilmgandhi | 18:6a4db94011d3 | 240 | */ |
sahilmgandhi | 18:6a4db94011d3 | 241 | |
sahilmgandhi | 18:6a4db94011d3 | 242 | HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber(RNG_HandleTypeDef *hrng, uint32_t *random32bit) |
sahilmgandhi | 18:6a4db94011d3 | 243 | { |
sahilmgandhi | 18:6a4db94011d3 | 244 | uint32_t tickstart = 0U; |
sahilmgandhi | 18:6a4db94011d3 | 245 | HAL_StatusTypeDef status = HAL_OK; |
sahilmgandhi | 18:6a4db94011d3 | 246 | |
sahilmgandhi | 18:6a4db94011d3 | 247 | /* Process Locked */ |
sahilmgandhi | 18:6a4db94011d3 | 248 | __HAL_LOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 249 | |
sahilmgandhi | 18:6a4db94011d3 | 250 | /* Check RNG peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 251 | if(hrng->State == HAL_RNG_STATE_READY) |
sahilmgandhi | 18:6a4db94011d3 | 252 | { |
sahilmgandhi | 18:6a4db94011d3 | 253 | /* Change RNG peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 254 | hrng->State = HAL_RNG_STATE_BUSY; |
sahilmgandhi | 18:6a4db94011d3 | 255 | |
sahilmgandhi | 18:6a4db94011d3 | 256 | /* Get tick */ |
sahilmgandhi | 18:6a4db94011d3 | 257 | tickstart = HAL_GetTick(); |
sahilmgandhi | 18:6a4db94011d3 | 258 | |
sahilmgandhi | 18:6a4db94011d3 | 259 | /* Check if data register contains valid random data */ |
sahilmgandhi | 18:6a4db94011d3 | 260 | while(__HAL_RNG_GET_FLAG(hrng, RNG_FLAG_DRDY) == RESET) |
sahilmgandhi | 18:6a4db94011d3 | 261 | { |
sahilmgandhi | 18:6a4db94011d3 | 262 | if((HAL_GetTick() - tickstart ) > RNG_TIMEOUT_VALUE) |
sahilmgandhi | 18:6a4db94011d3 | 263 | { |
sahilmgandhi | 18:6a4db94011d3 | 264 | hrng->State = HAL_RNG_STATE_ERROR; |
sahilmgandhi | 18:6a4db94011d3 | 265 | |
sahilmgandhi | 18:6a4db94011d3 | 266 | /* Process Unlocked */ |
sahilmgandhi | 18:6a4db94011d3 | 267 | __HAL_UNLOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 268 | |
sahilmgandhi | 18:6a4db94011d3 | 269 | return HAL_TIMEOUT; |
sahilmgandhi | 18:6a4db94011d3 | 270 | } |
sahilmgandhi | 18:6a4db94011d3 | 271 | } |
sahilmgandhi | 18:6a4db94011d3 | 272 | |
sahilmgandhi | 18:6a4db94011d3 | 273 | /* Get a 32bit Random number */ |
sahilmgandhi | 18:6a4db94011d3 | 274 | hrng->RandomNumber = hrng->Instance->DR; |
sahilmgandhi | 18:6a4db94011d3 | 275 | *random32bit = hrng->RandomNumber; |
sahilmgandhi | 18:6a4db94011d3 | 276 | |
sahilmgandhi | 18:6a4db94011d3 | 277 | hrng->State = HAL_RNG_STATE_READY; |
sahilmgandhi | 18:6a4db94011d3 | 278 | } |
sahilmgandhi | 18:6a4db94011d3 | 279 | else |
sahilmgandhi | 18:6a4db94011d3 | 280 | { |
sahilmgandhi | 18:6a4db94011d3 | 281 | status = HAL_ERROR; |
sahilmgandhi | 18:6a4db94011d3 | 282 | } |
sahilmgandhi | 18:6a4db94011d3 | 283 | |
sahilmgandhi | 18:6a4db94011d3 | 284 | /* Process Unlocked */ |
sahilmgandhi | 18:6a4db94011d3 | 285 | __HAL_UNLOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 286 | |
sahilmgandhi | 18:6a4db94011d3 | 287 | return status; |
sahilmgandhi | 18:6a4db94011d3 | 288 | } |
sahilmgandhi | 18:6a4db94011d3 | 289 | |
sahilmgandhi | 18:6a4db94011d3 | 290 | /** |
sahilmgandhi | 18:6a4db94011d3 | 291 | * @brief Generates a 32-bit random number in interrupt mode. |
sahilmgandhi | 18:6a4db94011d3 | 292 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 293 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 294 | * @retval HAL status |
sahilmgandhi | 18:6a4db94011d3 | 295 | */ |
sahilmgandhi | 18:6a4db94011d3 | 296 | HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber_IT(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 297 | { |
sahilmgandhi | 18:6a4db94011d3 | 298 | HAL_StatusTypeDef status = HAL_OK; |
sahilmgandhi | 18:6a4db94011d3 | 299 | |
sahilmgandhi | 18:6a4db94011d3 | 300 | /* Process Locked */ |
sahilmgandhi | 18:6a4db94011d3 | 301 | __HAL_LOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 302 | |
sahilmgandhi | 18:6a4db94011d3 | 303 | /* Check RNG peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 304 | if(hrng->State == HAL_RNG_STATE_READY) |
sahilmgandhi | 18:6a4db94011d3 | 305 | { |
sahilmgandhi | 18:6a4db94011d3 | 306 | /* Change RNG peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 307 | hrng->State = HAL_RNG_STATE_BUSY; |
sahilmgandhi | 18:6a4db94011d3 | 308 | |
sahilmgandhi | 18:6a4db94011d3 | 309 | /* Process Unlocked */ |
sahilmgandhi | 18:6a4db94011d3 | 310 | __HAL_UNLOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 311 | |
sahilmgandhi | 18:6a4db94011d3 | 312 | /* Enable the RNG Interrupts: Data Ready, Clock error, Seed error */ |
sahilmgandhi | 18:6a4db94011d3 | 313 | __HAL_RNG_ENABLE_IT(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 314 | } |
sahilmgandhi | 18:6a4db94011d3 | 315 | else |
sahilmgandhi | 18:6a4db94011d3 | 316 | { |
sahilmgandhi | 18:6a4db94011d3 | 317 | /* Process Unlocked */ |
sahilmgandhi | 18:6a4db94011d3 | 318 | __HAL_UNLOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 319 | |
sahilmgandhi | 18:6a4db94011d3 | 320 | status = HAL_ERROR; |
sahilmgandhi | 18:6a4db94011d3 | 321 | } |
sahilmgandhi | 18:6a4db94011d3 | 322 | |
sahilmgandhi | 18:6a4db94011d3 | 323 | return status; |
sahilmgandhi | 18:6a4db94011d3 | 324 | } |
sahilmgandhi | 18:6a4db94011d3 | 325 | |
sahilmgandhi | 18:6a4db94011d3 | 326 | /** |
sahilmgandhi | 18:6a4db94011d3 | 327 | * @brief Handles RNG interrupt request. |
sahilmgandhi | 18:6a4db94011d3 | 328 | * @note In the case of a clock error, the RNG is no more able to generate |
sahilmgandhi | 18:6a4db94011d3 | 329 | * random numbers because the PLL48CLK clock is not correct. User has |
sahilmgandhi | 18:6a4db94011d3 | 330 | * to check that the clock controller is correctly configured to provide |
sahilmgandhi | 18:6a4db94011d3 | 331 | * the RNG clock and clear the CEIS bit using __HAL_RNG_CLEAR_IT(). |
sahilmgandhi | 18:6a4db94011d3 | 332 | * The clock error has no impact on the previously generated |
sahilmgandhi | 18:6a4db94011d3 | 333 | * random numbers, and the RNG_DR register contents can be used. |
sahilmgandhi | 18:6a4db94011d3 | 334 | * @note In the case of a seed error, the generation of random numbers is |
sahilmgandhi | 18:6a4db94011d3 | 335 | * interrupted as long as the SECS bit is '1'. If a number is |
sahilmgandhi | 18:6a4db94011d3 | 336 | * available in the RNG_DR register, it must not be used because it may |
sahilmgandhi | 18:6a4db94011d3 | 337 | * not have enough entropy. In this case, it is recommended to clear the |
sahilmgandhi | 18:6a4db94011d3 | 338 | * SEIS bit using __HAL_RNG_CLEAR_IT(), then disable and enable |
sahilmgandhi | 18:6a4db94011d3 | 339 | * the RNG peripheral to reinitialize and restart the RNG. |
sahilmgandhi | 18:6a4db94011d3 | 340 | * @note User-written HAL_RNG_ErrorCallback() API is called once whether SEIS |
sahilmgandhi | 18:6a4db94011d3 | 341 | * or CEIS are set. |
sahilmgandhi | 18:6a4db94011d3 | 342 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 343 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 344 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 345 | |
sahilmgandhi | 18:6a4db94011d3 | 346 | */ |
sahilmgandhi | 18:6a4db94011d3 | 347 | void HAL_RNG_IRQHandler(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 348 | { |
sahilmgandhi | 18:6a4db94011d3 | 349 | /* RNG clock error interrupt occurred */ |
sahilmgandhi | 18:6a4db94011d3 | 350 | if((__HAL_RNG_GET_IT(hrng, RNG_IT_CEI) != RESET) || (__HAL_RNG_GET_IT(hrng, RNG_IT_SEI) != RESET)) |
sahilmgandhi | 18:6a4db94011d3 | 351 | { |
sahilmgandhi | 18:6a4db94011d3 | 352 | /* Change RNG peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 353 | hrng->State = HAL_RNG_STATE_ERROR; |
sahilmgandhi | 18:6a4db94011d3 | 354 | |
sahilmgandhi | 18:6a4db94011d3 | 355 | HAL_RNG_ErrorCallback(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 356 | |
sahilmgandhi | 18:6a4db94011d3 | 357 | /* Clear the clock error flag */ |
sahilmgandhi | 18:6a4db94011d3 | 358 | __HAL_RNG_CLEAR_IT(hrng, RNG_IT_CEI|RNG_IT_SEI); |
sahilmgandhi | 18:6a4db94011d3 | 359 | |
sahilmgandhi | 18:6a4db94011d3 | 360 | } |
sahilmgandhi | 18:6a4db94011d3 | 361 | |
sahilmgandhi | 18:6a4db94011d3 | 362 | /* Check RNG data ready interrupt occurred */ |
sahilmgandhi | 18:6a4db94011d3 | 363 | if(__HAL_RNG_GET_IT(hrng, RNG_IT_DRDY) != RESET) |
sahilmgandhi | 18:6a4db94011d3 | 364 | { |
sahilmgandhi | 18:6a4db94011d3 | 365 | /* Generate random number once, so disable the IT */ |
sahilmgandhi | 18:6a4db94011d3 | 366 | __HAL_RNG_DISABLE_IT(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 367 | |
sahilmgandhi | 18:6a4db94011d3 | 368 | /* Get the 32bit Random number (DRDY flag automatically cleared) */ |
sahilmgandhi | 18:6a4db94011d3 | 369 | hrng->RandomNumber = hrng->Instance->DR; |
sahilmgandhi | 18:6a4db94011d3 | 370 | |
sahilmgandhi | 18:6a4db94011d3 | 371 | if(hrng->State != HAL_RNG_STATE_ERROR) |
sahilmgandhi | 18:6a4db94011d3 | 372 | { |
sahilmgandhi | 18:6a4db94011d3 | 373 | /* Change RNG peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 374 | hrng->State = HAL_RNG_STATE_READY; |
sahilmgandhi | 18:6a4db94011d3 | 375 | |
sahilmgandhi | 18:6a4db94011d3 | 376 | /* Data Ready callback */ |
sahilmgandhi | 18:6a4db94011d3 | 377 | HAL_RNG_ReadyDataCallback(hrng, hrng->RandomNumber); |
sahilmgandhi | 18:6a4db94011d3 | 378 | } |
sahilmgandhi | 18:6a4db94011d3 | 379 | } |
sahilmgandhi | 18:6a4db94011d3 | 380 | } |
sahilmgandhi | 18:6a4db94011d3 | 381 | |
sahilmgandhi | 18:6a4db94011d3 | 382 | /** |
sahilmgandhi | 18:6a4db94011d3 | 383 | * @brief Returns generated random number in polling mode (Obsolete) |
sahilmgandhi | 18:6a4db94011d3 | 384 | * Use HAL_RNG_GenerateRandomNumber() API instead. |
sahilmgandhi | 18:6a4db94011d3 | 385 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 386 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 387 | * @retval Random value |
sahilmgandhi | 18:6a4db94011d3 | 388 | */ |
sahilmgandhi | 18:6a4db94011d3 | 389 | uint32_t HAL_RNG_GetRandomNumber(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 390 | { |
sahilmgandhi | 18:6a4db94011d3 | 391 | if(HAL_RNG_GenerateRandomNumber(hrng, &(hrng->RandomNumber)) == HAL_OK) |
sahilmgandhi | 18:6a4db94011d3 | 392 | { |
sahilmgandhi | 18:6a4db94011d3 | 393 | return hrng->RandomNumber; |
sahilmgandhi | 18:6a4db94011d3 | 394 | } |
sahilmgandhi | 18:6a4db94011d3 | 395 | else |
sahilmgandhi | 18:6a4db94011d3 | 396 | { |
sahilmgandhi | 18:6a4db94011d3 | 397 | return 0U; |
sahilmgandhi | 18:6a4db94011d3 | 398 | } |
sahilmgandhi | 18:6a4db94011d3 | 399 | } |
sahilmgandhi | 18:6a4db94011d3 | 400 | |
sahilmgandhi | 18:6a4db94011d3 | 401 | /** |
sahilmgandhi | 18:6a4db94011d3 | 402 | * @brief Returns a 32-bit random number with interrupt enabled (Obsolete), |
sahilmgandhi | 18:6a4db94011d3 | 403 | * Use HAL_RNG_GenerateRandomNumber_IT() API instead. |
sahilmgandhi | 18:6a4db94011d3 | 404 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 405 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 406 | * @retval 32-bit random number |
sahilmgandhi | 18:6a4db94011d3 | 407 | */ |
sahilmgandhi | 18:6a4db94011d3 | 408 | uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 409 | { |
sahilmgandhi | 18:6a4db94011d3 | 410 | uint32_t random32bit = 0U; |
sahilmgandhi | 18:6a4db94011d3 | 411 | |
sahilmgandhi | 18:6a4db94011d3 | 412 | /* Process locked */ |
sahilmgandhi | 18:6a4db94011d3 | 413 | __HAL_LOCK(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 414 | |
sahilmgandhi | 18:6a4db94011d3 | 415 | /* Change RNG peripheral state */ |
sahilmgandhi | 18:6a4db94011d3 | 416 | hrng->State = HAL_RNG_STATE_BUSY; |
sahilmgandhi | 18:6a4db94011d3 | 417 | |
sahilmgandhi | 18:6a4db94011d3 | 418 | /* Get a 32bit Random number */ |
sahilmgandhi | 18:6a4db94011d3 | 419 | random32bit = hrng->Instance->DR; |
sahilmgandhi | 18:6a4db94011d3 | 420 | |
sahilmgandhi | 18:6a4db94011d3 | 421 | /* Enable the RNG Interrupts: Data Ready, Clock error, Seed error */ |
sahilmgandhi | 18:6a4db94011d3 | 422 | __HAL_RNG_ENABLE_IT(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 423 | |
sahilmgandhi | 18:6a4db94011d3 | 424 | /* Return the 32 bit random number */ |
sahilmgandhi | 18:6a4db94011d3 | 425 | return random32bit; |
sahilmgandhi | 18:6a4db94011d3 | 426 | } |
sahilmgandhi | 18:6a4db94011d3 | 427 | |
sahilmgandhi | 18:6a4db94011d3 | 428 | /** |
sahilmgandhi | 18:6a4db94011d3 | 429 | * @brief Read latest generated random number. |
sahilmgandhi | 18:6a4db94011d3 | 430 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 431 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 432 | * @retval random value |
sahilmgandhi | 18:6a4db94011d3 | 433 | */ |
sahilmgandhi | 18:6a4db94011d3 | 434 | uint32_t HAL_RNG_ReadLastRandomNumber(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 435 | { |
sahilmgandhi | 18:6a4db94011d3 | 436 | return(hrng->RandomNumber); |
sahilmgandhi | 18:6a4db94011d3 | 437 | } |
sahilmgandhi | 18:6a4db94011d3 | 438 | |
sahilmgandhi | 18:6a4db94011d3 | 439 | /** |
sahilmgandhi | 18:6a4db94011d3 | 440 | * @brief Data Ready callback in non-blocking mode. |
sahilmgandhi | 18:6a4db94011d3 | 441 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 442 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 443 | * @param random32bit: generated random number. |
sahilmgandhi | 18:6a4db94011d3 | 444 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 445 | */ |
sahilmgandhi | 18:6a4db94011d3 | 446 | __weak void HAL_RNG_ReadyDataCallback(RNG_HandleTypeDef *hrng, uint32_t random32bit) |
sahilmgandhi | 18:6a4db94011d3 | 447 | { |
sahilmgandhi | 18:6a4db94011d3 | 448 | /* Prevent unused argument(s) compilation warning */ |
sahilmgandhi | 18:6a4db94011d3 | 449 | UNUSED(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 450 | UNUSED(random32bit); |
sahilmgandhi | 18:6a4db94011d3 | 451 | /* NOTE : This function should not be modified. When the callback is needed, |
sahilmgandhi | 18:6a4db94011d3 | 452 | function HAL_RNG_ReadyDataCallback must be implemented in the user file. |
sahilmgandhi | 18:6a4db94011d3 | 453 | */ |
sahilmgandhi | 18:6a4db94011d3 | 454 | } |
sahilmgandhi | 18:6a4db94011d3 | 455 | |
sahilmgandhi | 18:6a4db94011d3 | 456 | /** |
sahilmgandhi | 18:6a4db94011d3 | 457 | * @brief RNG error callbacks. |
sahilmgandhi | 18:6a4db94011d3 | 458 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 459 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 460 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 461 | */ |
sahilmgandhi | 18:6a4db94011d3 | 462 | __weak void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 463 | { |
sahilmgandhi | 18:6a4db94011d3 | 464 | /* Prevent unused argument(s) compilation warning */ |
sahilmgandhi | 18:6a4db94011d3 | 465 | UNUSED(hrng); |
sahilmgandhi | 18:6a4db94011d3 | 466 | /* NOTE : This function should not be modified. When the callback is needed, |
sahilmgandhi | 18:6a4db94011d3 | 467 | function HAL_RNG_ErrorCallback must be implemented in the user file. |
sahilmgandhi | 18:6a4db94011d3 | 468 | */ |
sahilmgandhi | 18:6a4db94011d3 | 469 | } |
sahilmgandhi | 18:6a4db94011d3 | 470 | /** |
sahilmgandhi | 18:6a4db94011d3 | 471 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 472 | */ |
sahilmgandhi | 18:6a4db94011d3 | 473 | |
sahilmgandhi | 18:6a4db94011d3 | 474 | |
sahilmgandhi | 18:6a4db94011d3 | 475 | /** @addtogroup RNG_Exported_Functions_Group3 |
sahilmgandhi | 18:6a4db94011d3 | 476 | * @brief Peripheral State functions |
sahilmgandhi | 18:6a4db94011d3 | 477 | * |
sahilmgandhi | 18:6a4db94011d3 | 478 | @verbatim |
sahilmgandhi | 18:6a4db94011d3 | 479 | =============================================================================== |
sahilmgandhi | 18:6a4db94011d3 | 480 | ##### Peripheral State functions ##### |
sahilmgandhi | 18:6a4db94011d3 | 481 | =============================================================================== |
sahilmgandhi | 18:6a4db94011d3 | 482 | [..] |
sahilmgandhi | 18:6a4db94011d3 | 483 | This subsection permits to get in run-time the status of the peripheral |
sahilmgandhi | 18:6a4db94011d3 | 484 | and the data flow. |
sahilmgandhi | 18:6a4db94011d3 | 485 | |
sahilmgandhi | 18:6a4db94011d3 | 486 | @endverbatim |
sahilmgandhi | 18:6a4db94011d3 | 487 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 488 | */ |
sahilmgandhi | 18:6a4db94011d3 | 489 | |
sahilmgandhi | 18:6a4db94011d3 | 490 | /** |
sahilmgandhi | 18:6a4db94011d3 | 491 | * @brief Returns the RNG state. |
sahilmgandhi | 18:6a4db94011d3 | 492 | * @param hrng: pointer to a RNG_HandleTypeDef structure that contains |
sahilmgandhi | 18:6a4db94011d3 | 493 | * the configuration information for RNG. |
sahilmgandhi | 18:6a4db94011d3 | 494 | * @retval HAL state |
sahilmgandhi | 18:6a4db94011d3 | 495 | */ |
sahilmgandhi | 18:6a4db94011d3 | 496 | HAL_RNG_StateTypeDef HAL_RNG_GetState(RNG_HandleTypeDef *hrng) |
sahilmgandhi | 18:6a4db94011d3 | 497 | { |
sahilmgandhi | 18:6a4db94011d3 | 498 | return hrng->State; |
sahilmgandhi | 18:6a4db94011d3 | 499 | } |
sahilmgandhi | 18:6a4db94011d3 | 500 | |
sahilmgandhi | 18:6a4db94011d3 | 501 | /** |
sahilmgandhi | 18:6a4db94011d3 | 502 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 503 | */ |
sahilmgandhi | 18:6a4db94011d3 | 504 | |
sahilmgandhi | 18:6a4db94011d3 | 505 | /** |
sahilmgandhi | 18:6a4db94011d3 | 506 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 507 | */ |
sahilmgandhi | 18:6a4db94011d3 | 508 | |
sahilmgandhi | 18:6a4db94011d3 | 509 | #endif /* HAL_RNG_MODULE_ENABLED */ |
sahilmgandhi | 18:6a4db94011d3 | 510 | /** |
sahilmgandhi | 18:6a4db94011d3 | 511 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 512 | */ |
sahilmgandhi | 18:6a4db94011d3 | 513 | |
sahilmgandhi | 18:6a4db94011d3 | 514 | /** |
sahilmgandhi | 18:6a4db94011d3 | 515 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 516 | */ |
sahilmgandhi | 18:6a4db94011d3 | 517 | |
sahilmgandhi | 18:6a4db94011d3 | 518 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |