Mouse code for the MacroRat
mbed-dev/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_rng.h@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 stm32f4xx_hal_rng.h |
sahilmgandhi | 18:6a4db94011d3 | 4 | * @author MCD Application Team |
sahilmgandhi | 18:6a4db94011d3 | 5 | * @version V1.5.0 |
sahilmgandhi | 18:6a4db94011d3 | 6 | * @date 06-May-2016 |
sahilmgandhi | 18:6a4db94011d3 | 7 | * @brief Header file of RNG HAL module. |
sahilmgandhi | 18:6a4db94011d3 | 8 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 9 | * @attention |
sahilmgandhi | 18:6a4db94011d3 | 10 | * |
sahilmgandhi | 18:6a4db94011d3 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
sahilmgandhi | 18:6a4db94011d3 | 12 | * |
sahilmgandhi | 18:6a4db94011d3 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
sahilmgandhi | 18:6a4db94011d3 | 14 | * are permitted provided that the following conditions are met: |
sahilmgandhi | 18:6a4db94011d3 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 16 | * this list of conditions and the following disclaimer. |
sahilmgandhi | 18:6a4db94011d3 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 18 | * this list of conditions and the following disclaimer in the documentation |
sahilmgandhi | 18:6a4db94011d3 | 19 | * and/or other materials provided with the distribution. |
sahilmgandhi | 18:6a4db94011d3 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
sahilmgandhi | 18:6a4db94011d3 | 21 | * may be used to endorse or promote products derived from this software |
sahilmgandhi | 18:6a4db94011d3 | 22 | * without specific prior written permission. |
sahilmgandhi | 18:6a4db94011d3 | 23 | * |
sahilmgandhi | 18:6a4db94011d3 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
sahilmgandhi | 18:6a4db94011d3 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
sahilmgandhi | 18:6a4db94011d3 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
sahilmgandhi | 18:6a4db94011d3 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
sahilmgandhi | 18:6a4db94011d3 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
sahilmgandhi | 18:6a4db94011d3 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
sahilmgandhi | 18:6a4db94011d3 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
sahilmgandhi | 18:6a4db94011d3 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
sahilmgandhi | 18:6a4db94011d3 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
sahilmgandhi | 18:6a4db94011d3 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
sahilmgandhi | 18:6a4db94011d3 | 34 | * |
sahilmgandhi | 18:6a4db94011d3 | 35 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 36 | */ |
sahilmgandhi | 18:6a4db94011d3 | 37 | |
sahilmgandhi | 18:6a4db94011d3 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 39 | #ifndef __STM32F4xx_HAL_RNG_H |
sahilmgandhi | 18:6a4db94011d3 | 40 | #define __STM32F4xx_HAL_RNG_H |
sahilmgandhi | 18:6a4db94011d3 | 41 | |
sahilmgandhi | 18:6a4db94011d3 | 42 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 43 | extern "C" { |
sahilmgandhi | 18:6a4db94011d3 | 44 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 45 | |
sahilmgandhi | 18:6a4db94011d3 | 46 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ |
sahilmgandhi | 18:6a4db94011d3 | 47 | defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ |
sahilmgandhi | 18:6a4db94011d3 | 48 | defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F469xx) ||\ |
sahilmgandhi | 18:6a4db94011d3 | 49 | defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) ||\ |
sahilmgandhi | 18:6a4db94011d3 | 50 | defined(STM32F412Cx) |
sahilmgandhi | 18:6a4db94011d3 | 51 | |
sahilmgandhi | 18:6a4db94011d3 | 52 | /* Includes ------------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 53 | #include "stm32f4xx_hal_def.h" |
sahilmgandhi | 18:6a4db94011d3 | 54 | |
sahilmgandhi | 18:6a4db94011d3 | 55 | /** @addtogroup STM32F4xx_HAL_Driver |
sahilmgandhi | 18:6a4db94011d3 | 56 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 57 | */ |
sahilmgandhi | 18:6a4db94011d3 | 58 | |
sahilmgandhi | 18:6a4db94011d3 | 59 | /** @defgroup RNG RNG |
sahilmgandhi | 18:6a4db94011d3 | 60 | * @brief RNG HAL module driver |
sahilmgandhi | 18:6a4db94011d3 | 61 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 62 | */ |
sahilmgandhi | 18:6a4db94011d3 | 63 | |
sahilmgandhi | 18:6a4db94011d3 | 64 | /* Exported types ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 65 | |
sahilmgandhi | 18:6a4db94011d3 | 66 | /** @defgroup RNG_Exported_Types RNG Exported Types |
sahilmgandhi | 18:6a4db94011d3 | 67 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 68 | */ |
sahilmgandhi | 18:6a4db94011d3 | 69 | |
sahilmgandhi | 18:6a4db94011d3 | 70 | /** @defgroup RNG_Exported_Types_Group1 RNG State Structure definition |
sahilmgandhi | 18:6a4db94011d3 | 71 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 72 | */ |
sahilmgandhi | 18:6a4db94011d3 | 73 | typedef enum |
sahilmgandhi | 18:6a4db94011d3 | 74 | { |
sahilmgandhi | 18:6a4db94011d3 | 75 | HAL_RNG_STATE_RESET = 0x00U, /*!< RNG not yet initialized or disabled */ |
sahilmgandhi | 18:6a4db94011d3 | 76 | HAL_RNG_STATE_READY = 0x01U, /*!< RNG initialized and ready for use */ |
sahilmgandhi | 18:6a4db94011d3 | 77 | HAL_RNG_STATE_BUSY = 0x02U, /*!< RNG internal process is ongoing */ |
sahilmgandhi | 18:6a4db94011d3 | 78 | HAL_RNG_STATE_TIMEOUT = 0x03U, /*!< RNG timeout state */ |
sahilmgandhi | 18:6a4db94011d3 | 79 | HAL_RNG_STATE_ERROR = 0x04U /*!< RNG error state */ |
sahilmgandhi | 18:6a4db94011d3 | 80 | |
sahilmgandhi | 18:6a4db94011d3 | 81 | }HAL_RNG_StateTypeDef; |
sahilmgandhi | 18:6a4db94011d3 | 82 | |
sahilmgandhi | 18:6a4db94011d3 | 83 | /** |
sahilmgandhi | 18:6a4db94011d3 | 84 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 85 | */ |
sahilmgandhi | 18:6a4db94011d3 | 86 | |
sahilmgandhi | 18:6a4db94011d3 | 87 | /** @defgroup RNG_Exported_Types_Group2 RNG Handle Structure definition |
sahilmgandhi | 18:6a4db94011d3 | 88 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 89 | */ |
sahilmgandhi | 18:6a4db94011d3 | 90 | typedef struct |
sahilmgandhi | 18:6a4db94011d3 | 91 | { |
sahilmgandhi | 18:6a4db94011d3 | 92 | RNG_TypeDef *Instance; /*!< Register base address */ |
sahilmgandhi | 18:6a4db94011d3 | 93 | |
sahilmgandhi | 18:6a4db94011d3 | 94 | HAL_LockTypeDef Lock; /*!< RNG locking object */ |
sahilmgandhi | 18:6a4db94011d3 | 95 | |
sahilmgandhi | 18:6a4db94011d3 | 96 | __IO HAL_RNG_StateTypeDef State; /*!< RNG communication state */ |
sahilmgandhi | 18:6a4db94011d3 | 97 | |
sahilmgandhi | 18:6a4db94011d3 | 98 | uint32_t RandomNumber; /*!< Last Generated RNG Data */ |
sahilmgandhi | 18:6a4db94011d3 | 99 | |
sahilmgandhi | 18:6a4db94011d3 | 100 | }RNG_HandleTypeDef; |
sahilmgandhi | 18:6a4db94011d3 | 101 | |
sahilmgandhi | 18:6a4db94011d3 | 102 | /** |
sahilmgandhi | 18:6a4db94011d3 | 103 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 104 | */ |
sahilmgandhi | 18:6a4db94011d3 | 105 | |
sahilmgandhi | 18:6a4db94011d3 | 106 | /** |
sahilmgandhi | 18:6a4db94011d3 | 107 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 108 | */ |
sahilmgandhi | 18:6a4db94011d3 | 109 | |
sahilmgandhi | 18:6a4db94011d3 | 110 | /* Exported constants --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 111 | |
sahilmgandhi | 18:6a4db94011d3 | 112 | /** @defgroup RNG_Exported_Constants RNG Exported Constants |
sahilmgandhi | 18:6a4db94011d3 | 113 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 114 | */ |
sahilmgandhi | 18:6a4db94011d3 | 115 | |
sahilmgandhi | 18:6a4db94011d3 | 116 | /** @defgroup RNG_Exported_Constants_Group1 RNG Interrupt definition |
sahilmgandhi | 18:6a4db94011d3 | 117 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 118 | */ |
sahilmgandhi | 18:6a4db94011d3 | 119 | #define RNG_IT_DRDY RNG_SR_DRDY /*!< Data Ready interrupt */ |
sahilmgandhi | 18:6a4db94011d3 | 120 | #define RNG_IT_CEI RNG_SR_CEIS /*!< Clock error interrupt */ |
sahilmgandhi | 18:6a4db94011d3 | 121 | #define RNG_IT_SEI RNG_SR_SEIS /*!< Seed error interrupt */ |
sahilmgandhi | 18:6a4db94011d3 | 122 | /** |
sahilmgandhi | 18:6a4db94011d3 | 123 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 124 | */ |
sahilmgandhi | 18:6a4db94011d3 | 125 | |
sahilmgandhi | 18:6a4db94011d3 | 126 | /** @defgroup RNG_Exported_Constants_Group2 RNG Flag definition |
sahilmgandhi | 18:6a4db94011d3 | 127 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 128 | */ |
sahilmgandhi | 18:6a4db94011d3 | 129 | #define RNG_FLAG_DRDY RNG_SR_DRDY /*!< Data ready */ |
sahilmgandhi | 18:6a4db94011d3 | 130 | #define RNG_FLAG_CECS RNG_SR_CECS /*!< Clock error current status */ |
sahilmgandhi | 18:6a4db94011d3 | 131 | #define RNG_FLAG_SECS RNG_SR_SECS /*!< Seed error current status */ |
sahilmgandhi | 18:6a4db94011d3 | 132 | |
sahilmgandhi | 18:6a4db94011d3 | 133 | /** |
sahilmgandhi | 18:6a4db94011d3 | 134 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 135 | */ |
sahilmgandhi | 18:6a4db94011d3 | 136 | |
sahilmgandhi | 18:6a4db94011d3 | 137 | /** |
sahilmgandhi | 18:6a4db94011d3 | 138 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 139 | */ |
sahilmgandhi | 18:6a4db94011d3 | 140 | |
sahilmgandhi | 18:6a4db94011d3 | 141 | /* Exported macros -----------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 142 | |
sahilmgandhi | 18:6a4db94011d3 | 143 | /** @defgroup RNG_Exported_Macros RNG Exported Macros |
sahilmgandhi | 18:6a4db94011d3 | 144 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 145 | */ |
sahilmgandhi | 18:6a4db94011d3 | 146 | |
sahilmgandhi | 18:6a4db94011d3 | 147 | /** @brief Reset RNG handle state |
sahilmgandhi | 18:6a4db94011d3 | 148 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 149 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 150 | */ |
sahilmgandhi | 18:6a4db94011d3 | 151 | #define __HAL_RNG_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RNG_STATE_RESET) |
sahilmgandhi | 18:6a4db94011d3 | 152 | |
sahilmgandhi | 18:6a4db94011d3 | 153 | /** |
sahilmgandhi | 18:6a4db94011d3 | 154 | * @brief Enables the RNG peripheral. |
sahilmgandhi | 18:6a4db94011d3 | 155 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 156 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 157 | */ |
sahilmgandhi | 18:6a4db94011d3 | 158 | #define __HAL_RNG_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= RNG_CR_RNGEN) |
sahilmgandhi | 18:6a4db94011d3 | 159 | |
sahilmgandhi | 18:6a4db94011d3 | 160 | /** |
sahilmgandhi | 18:6a4db94011d3 | 161 | * @brief Disables the RNG peripheral. |
sahilmgandhi | 18:6a4db94011d3 | 162 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 163 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 164 | */ |
sahilmgandhi | 18:6a4db94011d3 | 165 | #define __HAL_RNG_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~RNG_CR_RNGEN) |
sahilmgandhi | 18:6a4db94011d3 | 166 | |
sahilmgandhi | 18:6a4db94011d3 | 167 | /** |
sahilmgandhi | 18:6a4db94011d3 | 168 | * @brief Check the selected RNG flag status. |
sahilmgandhi | 18:6a4db94011d3 | 169 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 170 | * @param __FLAG__: RNG flag |
sahilmgandhi | 18:6a4db94011d3 | 171 | * This parameter can be one of the following values: |
sahilmgandhi | 18:6a4db94011d3 | 172 | * @arg RNG_FLAG_DRDY: Data ready |
sahilmgandhi | 18:6a4db94011d3 | 173 | * @arg RNG_FLAG_CECS: Clock error current status |
sahilmgandhi | 18:6a4db94011d3 | 174 | * @arg RNG_FLAG_SECS: Seed error current status |
sahilmgandhi | 18:6a4db94011d3 | 175 | * @retval The new state of __FLAG__ (SET or RESET). |
sahilmgandhi | 18:6a4db94011d3 | 176 | */ |
sahilmgandhi | 18:6a4db94011d3 | 177 | #define __HAL_RNG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) |
sahilmgandhi | 18:6a4db94011d3 | 178 | |
sahilmgandhi | 18:6a4db94011d3 | 179 | /** |
sahilmgandhi | 18:6a4db94011d3 | 180 | * @brief Clears the selected RNG flag status. |
sahilmgandhi | 18:6a4db94011d3 | 181 | * @param __HANDLE__: RNG handle |
sahilmgandhi | 18:6a4db94011d3 | 182 | * @param __FLAG__: RNG flag to clear |
sahilmgandhi | 18:6a4db94011d3 | 183 | * @note WARNING: This is a dummy macro for HAL code alignment, |
sahilmgandhi | 18:6a4db94011d3 | 184 | * flags RNG_FLAG_DRDY, RNG_FLAG_CECS and RNG_FLAG_SECS are read-only. |
sahilmgandhi | 18:6a4db94011d3 | 185 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 186 | */ |
sahilmgandhi | 18:6a4db94011d3 | 187 | #define __HAL_RNG_CLEAR_FLAG(__HANDLE__, __FLAG__) /* dummy macro */ |
sahilmgandhi | 18:6a4db94011d3 | 188 | |
sahilmgandhi | 18:6a4db94011d3 | 189 | |
sahilmgandhi | 18:6a4db94011d3 | 190 | |
sahilmgandhi | 18:6a4db94011d3 | 191 | /** |
sahilmgandhi | 18:6a4db94011d3 | 192 | * @brief Enables the RNG interrupts. |
sahilmgandhi | 18:6a4db94011d3 | 193 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 194 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 195 | */ |
sahilmgandhi | 18:6a4db94011d3 | 196 | #define __HAL_RNG_ENABLE_IT(__HANDLE__) ((__HANDLE__)->Instance->CR |= RNG_CR_IE) |
sahilmgandhi | 18:6a4db94011d3 | 197 | |
sahilmgandhi | 18:6a4db94011d3 | 198 | /** |
sahilmgandhi | 18:6a4db94011d3 | 199 | * @brief Disables the RNG interrupts. |
sahilmgandhi | 18:6a4db94011d3 | 200 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 201 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 202 | */ |
sahilmgandhi | 18:6a4db94011d3 | 203 | #define __HAL_RNG_DISABLE_IT(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~RNG_CR_IE) |
sahilmgandhi | 18:6a4db94011d3 | 204 | |
sahilmgandhi | 18:6a4db94011d3 | 205 | /** |
sahilmgandhi | 18:6a4db94011d3 | 206 | * @brief Checks whether the specified RNG interrupt has occurred or not. |
sahilmgandhi | 18:6a4db94011d3 | 207 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 208 | * @param __INTERRUPT__: specifies the RNG interrupt status flag to check. |
sahilmgandhi | 18:6a4db94011d3 | 209 | * This parameter can be one of the following values: |
sahilmgandhi | 18:6a4db94011d3 | 210 | * @arg RNG_IT_DRDY: Data ready interrupt |
sahilmgandhi | 18:6a4db94011d3 | 211 | * @arg RNG_IT_CEI: Clock error interrupt |
sahilmgandhi | 18:6a4db94011d3 | 212 | * @arg RNG_IT_SEI: Seed error interrupt |
sahilmgandhi | 18:6a4db94011d3 | 213 | * @retval The new state of __INTERRUPT__ (SET or RESET). |
sahilmgandhi | 18:6a4db94011d3 | 214 | */ |
sahilmgandhi | 18:6a4db94011d3 | 215 | #define __HAL_RNG_GET_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->SR & (__INTERRUPT__)) == (__INTERRUPT__)) |
sahilmgandhi | 18:6a4db94011d3 | 216 | |
sahilmgandhi | 18:6a4db94011d3 | 217 | /** |
sahilmgandhi | 18:6a4db94011d3 | 218 | * @brief Clear the RNG interrupt status flags. |
sahilmgandhi | 18:6a4db94011d3 | 219 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 220 | * @param __INTERRUPT__: specifies the RNG interrupt status flag to clear. |
sahilmgandhi | 18:6a4db94011d3 | 221 | * This parameter can be one of the following values: |
sahilmgandhi | 18:6a4db94011d3 | 222 | * @arg RNG_IT_CEI: Clock error interrupt |
sahilmgandhi | 18:6a4db94011d3 | 223 | * @arg RNG_IT_SEI: Seed error interrupt |
sahilmgandhi | 18:6a4db94011d3 | 224 | * @note RNG_IT_DRDY flag is read-only, reading RNG_DR register automatically clears RNG_IT_DRDY. |
sahilmgandhi | 18:6a4db94011d3 | 225 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 226 | */ |
sahilmgandhi | 18:6a4db94011d3 | 227 | #define __HAL_RNG_CLEAR_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->SR) = ~(__INTERRUPT__)) |
sahilmgandhi | 18:6a4db94011d3 | 228 | |
sahilmgandhi | 18:6a4db94011d3 | 229 | /** |
sahilmgandhi | 18:6a4db94011d3 | 230 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 231 | */ |
sahilmgandhi | 18:6a4db94011d3 | 232 | |
sahilmgandhi | 18:6a4db94011d3 | 233 | /* Exported functions --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 234 | /** @defgroup RNG_Exported_Functions RNG Exported Functions |
sahilmgandhi | 18:6a4db94011d3 | 235 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 236 | */ |
sahilmgandhi | 18:6a4db94011d3 | 237 | |
sahilmgandhi | 18:6a4db94011d3 | 238 | /** @defgroup RNG_Exported_Functions_Group1 Initialization and de-initialization functions |
sahilmgandhi | 18:6a4db94011d3 | 239 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 240 | */ |
sahilmgandhi | 18:6a4db94011d3 | 241 | HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 242 | HAL_StatusTypeDef HAL_RNG_DeInit (RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 243 | void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 244 | void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 245 | |
sahilmgandhi | 18:6a4db94011d3 | 246 | /** |
sahilmgandhi | 18:6a4db94011d3 | 247 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 248 | */ |
sahilmgandhi | 18:6a4db94011d3 | 249 | |
sahilmgandhi | 18:6a4db94011d3 | 250 | /** @defgroup RNG_Exported_Functions_Group2 Peripheral Control functions |
sahilmgandhi | 18:6a4db94011d3 | 251 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 252 | */ |
sahilmgandhi | 18:6a4db94011d3 | 253 | uint32_t HAL_RNG_GetRandomNumber(RNG_HandleTypeDef *hrng); /* Obsolete, use HAL_RNG_GenerateRandomNumber() instead */ |
sahilmgandhi | 18:6a4db94011d3 | 254 | uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng); /* Obsolete, use HAL_RNG_GenerateRandomNumber_IT() instead */ |
sahilmgandhi | 18:6a4db94011d3 | 255 | |
sahilmgandhi | 18:6a4db94011d3 | 256 | HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber(RNG_HandleTypeDef *hrng, uint32_t *random32bit); |
sahilmgandhi | 18:6a4db94011d3 | 257 | HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber_IT(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 258 | uint32_t HAL_RNG_ReadLastRandomNumber(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 259 | |
sahilmgandhi | 18:6a4db94011d3 | 260 | void HAL_RNG_IRQHandler(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 261 | void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 262 | void HAL_RNG_ReadyDataCallback(RNG_HandleTypeDef* hrng, uint32_t random32bit); |
sahilmgandhi | 18:6a4db94011d3 | 263 | |
sahilmgandhi | 18:6a4db94011d3 | 264 | /** |
sahilmgandhi | 18:6a4db94011d3 | 265 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 266 | */ |
sahilmgandhi | 18:6a4db94011d3 | 267 | |
sahilmgandhi | 18:6a4db94011d3 | 268 | /** @defgroup RNG_Exported_Functions_Group3 Peripheral State functions |
sahilmgandhi | 18:6a4db94011d3 | 269 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 270 | */ |
sahilmgandhi | 18:6a4db94011d3 | 271 | HAL_RNG_StateTypeDef HAL_RNG_GetState(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 272 | |
sahilmgandhi | 18:6a4db94011d3 | 273 | /** |
sahilmgandhi | 18:6a4db94011d3 | 274 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 275 | */ |
sahilmgandhi | 18:6a4db94011d3 | 276 | |
sahilmgandhi | 18:6a4db94011d3 | 277 | /** |
sahilmgandhi | 18:6a4db94011d3 | 278 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 279 | */ |
sahilmgandhi | 18:6a4db94011d3 | 280 | |
sahilmgandhi | 18:6a4db94011d3 | 281 | /* Private types -------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 282 | /** @defgroup RNG_Private_Types RNG Private Types |
sahilmgandhi | 18:6a4db94011d3 | 283 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 284 | */ |
sahilmgandhi | 18:6a4db94011d3 | 285 | |
sahilmgandhi | 18:6a4db94011d3 | 286 | /** |
sahilmgandhi | 18:6a4db94011d3 | 287 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 288 | */ |
sahilmgandhi | 18:6a4db94011d3 | 289 | |
sahilmgandhi | 18:6a4db94011d3 | 290 | /* Private defines -----------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 291 | /** @defgroup RNG_Private_Defines RNG Private Defines |
sahilmgandhi | 18:6a4db94011d3 | 292 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 293 | */ |
sahilmgandhi | 18:6a4db94011d3 | 294 | |
sahilmgandhi | 18:6a4db94011d3 | 295 | /** |
sahilmgandhi | 18:6a4db94011d3 | 296 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 297 | */ |
sahilmgandhi | 18:6a4db94011d3 | 298 | |
sahilmgandhi | 18:6a4db94011d3 | 299 | /* Private variables ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 300 | /** @defgroup RNG_Private_Variables RNG Private Variables |
sahilmgandhi | 18:6a4db94011d3 | 301 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 302 | */ |
sahilmgandhi | 18:6a4db94011d3 | 303 | |
sahilmgandhi | 18:6a4db94011d3 | 304 | /** |
sahilmgandhi | 18:6a4db94011d3 | 305 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 306 | */ |
sahilmgandhi | 18:6a4db94011d3 | 307 | |
sahilmgandhi | 18:6a4db94011d3 | 308 | /* Private constants ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 309 | /** @defgroup RNG_Private_Constants RNG Private Constants |
sahilmgandhi | 18:6a4db94011d3 | 310 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 311 | */ |
sahilmgandhi | 18:6a4db94011d3 | 312 | |
sahilmgandhi | 18:6a4db94011d3 | 313 | /** |
sahilmgandhi | 18:6a4db94011d3 | 314 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 315 | */ |
sahilmgandhi | 18:6a4db94011d3 | 316 | |
sahilmgandhi | 18:6a4db94011d3 | 317 | /* Private macros ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 318 | /** @defgroup RNG_Private_Macros RNG Private Macros |
sahilmgandhi | 18:6a4db94011d3 | 319 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 320 | */ |
sahilmgandhi | 18:6a4db94011d3 | 321 | #define IS_RNG_IT(IT) (((IT) == RNG_IT_CEI) || \ |
sahilmgandhi | 18:6a4db94011d3 | 322 | ((IT) == RNG_IT_SEI)) |
sahilmgandhi | 18:6a4db94011d3 | 323 | |
sahilmgandhi | 18:6a4db94011d3 | 324 | #define IS_RNG_FLAG(FLAG) (((FLAG) == RNG_FLAG_DRDY) || \ |
sahilmgandhi | 18:6a4db94011d3 | 325 | ((FLAG) == RNG_FLAG_CECS) || \ |
sahilmgandhi | 18:6a4db94011d3 | 326 | ((FLAG) == RNG_FLAG_SECS)) |
sahilmgandhi | 18:6a4db94011d3 | 327 | |
sahilmgandhi | 18:6a4db94011d3 | 328 | /** |
sahilmgandhi | 18:6a4db94011d3 | 329 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 330 | */ |
sahilmgandhi | 18:6a4db94011d3 | 331 | |
sahilmgandhi | 18:6a4db94011d3 | 332 | /* Private functions prototypes ----------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 333 | /** @defgroup RNG_Private_Functions_Prototypes RNG Private Functions Prototypes |
sahilmgandhi | 18:6a4db94011d3 | 334 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 335 | */ |
sahilmgandhi | 18:6a4db94011d3 | 336 | |
sahilmgandhi | 18:6a4db94011d3 | 337 | /** |
sahilmgandhi | 18:6a4db94011d3 | 338 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 339 | */ |
sahilmgandhi | 18:6a4db94011d3 | 340 | |
sahilmgandhi | 18:6a4db94011d3 | 341 | /* Private functions ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 342 | /** @defgroup RNG_Private_Functions RNG Private Functions |
sahilmgandhi | 18:6a4db94011d3 | 343 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 344 | */ |
sahilmgandhi | 18:6a4db94011d3 | 345 | |
sahilmgandhi | 18:6a4db94011d3 | 346 | /** |
sahilmgandhi | 18:6a4db94011d3 | 347 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 348 | */ |
sahilmgandhi | 18:6a4db94011d3 | 349 | |
sahilmgandhi | 18:6a4db94011d3 | 350 | /** |
sahilmgandhi | 18:6a4db94011d3 | 351 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 352 | */ |
sahilmgandhi | 18:6a4db94011d3 | 353 | |
sahilmgandhi | 18:6a4db94011d3 | 354 | /** |
sahilmgandhi | 18:6a4db94011d3 | 355 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 356 | */ |
sahilmgandhi | 18:6a4db94011d3 | 357 | |
sahilmgandhi | 18:6a4db94011d3 | 358 | #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ |
sahilmgandhi | 18:6a4db94011d3 | 359 | STM32F429xx || STM32F439xx || STM32F410xx || STM32F469xx || STM32F479xx || STM32F412Zx ||\ |
sahilmgandhi | 18:6a4db94011d3 | 360 | STM32F412Vx || STM32F412Rx || STM32F412Cx */ |
sahilmgandhi | 18:6a4db94011d3 | 361 | |
sahilmgandhi | 18:6a4db94011d3 | 362 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 363 | } |
sahilmgandhi | 18:6a4db94011d3 | 364 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 365 | |
sahilmgandhi | 18:6a4db94011d3 | 366 | |
sahilmgandhi | 18:6a4db94011d3 | 367 | #endif /* __STM32F4xx_HAL_RNG_H */ |
sahilmgandhi | 18:6a4db94011d3 | 368 | |
sahilmgandhi | 18:6a4db94011d3 | 369 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |