Mouse code for the MacroRat
mbed-dev/targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_rng.h@46:b156ef445742, 2017-06-03 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sat Jun 03 00:22:44 2017 +0000
- Revision:
- 46:b156ef445742
- Parent:
- 18:6a4db94011d3
Final code for internal battlebot competition.
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.h |
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 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 __STM32F2xx_HAL_RNG_H |
sahilmgandhi | 18:6a4db94011d3 | 40 | #define __STM32F2xx_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 | /* Includes ------------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 47 | #include "stm32f2xx_hal_def.h" |
sahilmgandhi | 18:6a4db94011d3 | 48 | |
sahilmgandhi | 18:6a4db94011d3 | 49 | /** @addtogroup STM32F2xx_HAL_Driver |
sahilmgandhi | 18:6a4db94011d3 | 50 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 51 | */ |
sahilmgandhi | 18:6a4db94011d3 | 52 | |
sahilmgandhi | 18:6a4db94011d3 | 53 | /** @defgroup RNG RNG |
sahilmgandhi | 18:6a4db94011d3 | 54 | * @brief RNG HAL module driver |
sahilmgandhi | 18:6a4db94011d3 | 55 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 56 | */ |
sahilmgandhi | 18:6a4db94011d3 | 57 | |
sahilmgandhi | 18:6a4db94011d3 | 58 | /* Exported types ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 59 | |
sahilmgandhi | 18:6a4db94011d3 | 60 | /** @defgroup RNG_Exported_Types RNG Exported Types |
sahilmgandhi | 18:6a4db94011d3 | 61 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 62 | */ |
sahilmgandhi | 18:6a4db94011d3 | 63 | |
sahilmgandhi | 18:6a4db94011d3 | 64 | /** @defgroup RNG_Exported_Types_Group1 RNG State Structure definition |
sahilmgandhi | 18:6a4db94011d3 | 65 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 66 | */ |
sahilmgandhi | 18:6a4db94011d3 | 67 | typedef enum |
sahilmgandhi | 18:6a4db94011d3 | 68 | { |
sahilmgandhi | 18:6a4db94011d3 | 69 | HAL_RNG_STATE_RESET = 0x00U, /*!< RNG not yet initialized or disabled */ |
sahilmgandhi | 18:6a4db94011d3 | 70 | HAL_RNG_STATE_READY = 0x01U, /*!< RNG initialized and ready for use */ |
sahilmgandhi | 18:6a4db94011d3 | 71 | HAL_RNG_STATE_BUSY = 0x02U, /*!< RNG internal process is ongoing */ |
sahilmgandhi | 18:6a4db94011d3 | 72 | HAL_RNG_STATE_TIMEOUT = 0x03U, /*!< RNG timeout state */ |
sahilmgandhi | 18:6a4db94011d3 | 73 | HAL_RNG_STATE_ERROR = 0x04U /*!< RNG error state */ |
sahilmgandhi | 18:6a4db94011d3 | 74 | |
sahilmgandhi | 18:6a4db94011d3 | 75 | }HAL_RNG_StateTypeDef; |
sahilmgandhi | 18:6a4db94011d3 | 76 | |
sahilmgandhi | 18:6a4db94011d3 | 77 | /** |
sahilmgandhi | 18:6a4db94011d3 | 78 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 79 | */ |
sahilmgandhi | 18:6a4db94011d3 | 80 | |
sahilmgandhi | 18:6a4db94011d3 | 81 | /** @defgroup RNG_Exported_Types_Group2 RNG Handle Structure definition |
sahilmgandhi | 18:6a4db94011d3 | 82 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 83 | */ |
sahilmgandhi | 18:6a4db94011d3 | 84 | typedef struct |
sahilmgandhi | 18:6a4db94011d3 | 85 | { |
sahilmgandhi | 18:6a4db94011d3 | 86 | RNG_TypeDef *Instance; /*!< Register base address */ |
sahilmgandhi | 18:6a4db94011d3 | 87 | |
sahilmgandhi | 18:6a4db94011d3 | 88 | HAL_LockTypeDef Lock; /*!< RNG locking object */ |
sahilmgandhi | 18:6a4db94011d3 | 89 | |
sahilmgandhi | 18:6a4db94011d3 | 90 | __IO HAL_RNG_StateTypeDef State; /*!< RNG communication state */ |
sahilmgandhi | 18:6a4db94011d3 | 91 | |
sahilmgandhi | 18:6a4db94011d3 | 92 | uint32_t RandomNumber; /*!< Last Generated RNG Data */ |
sahilmgandhi | 18:6a4db94011d3 | 93 | |
sahilmgandhi | 18:6a4db94011d3 | 94 | }RNG_HandleTypeDef; |
sahilmgandhi | 18:6a4db94011d3 | 95 | |
sahilmgandhi | 18:6a4db94011d3 | 96 | /** |
sahilmgandhi | 18:6a4db94011d3 | 97 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 98 | */ |
sahilmgandhi | 18:6a4db94011d3 | 99 | |
sahilmgandhi | 18:6a4db94011d3 | 100 | /** |
sahilmgandhi | 18:6a4db94011d3 | 101 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 102 | */ |
sahilmgandhi | 18:6a4db94011d3 | 103 | |
sahilmgandhi | 18:6a4db94011d3 | 104 | /* Exported constants --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 105 | |
sahilmgandhi | 18:6a4db94011d3 | 106 | /** @defgroup RNG_Exported_Constants RNG Exported Constants |
sahilmgandhi | 18:6a4db94011d3 | 107 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 108 | */ |
sahilmgandhi | 18:6a4db94011d3 | 109 | |
sahilmgandhi | 18:6a4db94011d3 | 110 | /** @defgroup RNG_Exported_Constants_Group1 RNG Interrupt definition |
sahilmgandhi | 18:6a4db94011d3 | 111 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 112 | */ |
sahilmgandhi | 18:6a4db94011d3 | 113 | #define RNG_IT_DRDY RNG_SR_DRDY /*!< Data Ready interrupt */ |
sahilmgandhi | 18:6a4db94011d3 | 114 | #define RNG_IT_CEI RNG_SR_CEIS /*!< Clock error interrupt */ |
sahilmgandhi | 18:6a4db94011d3 | 115 | #define RNG_IT_SEI RNG_SR_SEIS /*!< Seed error interrupt */ |
sahilmgandhi | 18:6a4db94011d3 | 116 | /** |
sahilmgandhi | 18:6a4db94011d3 | 117 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 118 | */ |
sahilmgandhi | 18:6a4db94011d3 | 119 | |
sahilmgandhi | 18:6a4db94011d3 | 120 | /** @defgroup RNG_Exported_Constants_Group2 RNG Flag definition |
sahilmgandhi | 18:6a4db94011d3 | 121 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 122 | */ |
sahilmgandhi | 18:6a4db94011d3 | 123 | #define RNG_FLAG_DRDY RNG_SR_DRDY /*!< Data ready */ |
sahilmgandhi | 18:6a4db94011d3 | 124 | #define RNG_FLAG_CECS RNG_SR_CECS /*!< Clock error current status */ |
sahilmgandhi | 18:6a4db94011d3 | 125 | #define RNG_FLAG_SECS RNG_SR_SECS /*!< Seed error current status */ |
sahilmgandhi | 18:6a4db94011d3 | 126 | |
sahilmgandhi | 18:6a4db94011d3 | 127 | /** |
sahilmgandhi | 18:6a4db94011d3 | 128 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 129 | */ |
sahilmgandhi | 18:6a4db94011d3 | 130 | |
sahilmgandhi | 18:6a4db94011d3 | 131 | /** |
sahilmgandhi | 18:6a4db94011d3 | 132 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 133 | */ |
sahilmgandhi | 18:6a4db94011d3 | 134 | |
sahilmgandhi | 18:6a4db94011d3 | 135 | /* Exported macros -----------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 136 | |
sahilmgandhi | 18:6a4db94011d3 | 137 | /** @defgroup RNG_Exported_Macros RNG Exported Macros |
sahilmgandhi | 18:6a4db94011d3 | 138 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 139 | */ |
sahilmgandhi | 18:6a4db94011d3 | 140 | |
sahilmgandhi | 18:6a4db94011d3 | 141 | /** @brief Reset RNG handle state |
sahilmgandhi | 18:6a4db94011d3 | 142 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 143 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 144 | */ |
sahilmgandhi | 18:6a4db94011d3 | 145 | #define __HAL_RNG_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RNG_STATE_RESET) |
sahilmgandhi | 18:6a4db94011d3 | 146 | |
sahilmgandhi | 18:6a4db94011d3 | 147 | /** |
sahilmgandhi | 18:6a4db94011d3 | 148 | * @brief Enables the RNG peripheral. |
sahilmgandhi | 18:6a4db94011d3 | 149 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 150 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 151 | */ |
sahilmgandhi | 18:6a4db94011d3 | 152 | #define __HAL_RNG_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= RNG_CR_RNGEN) |
sahilmgandhi | 18:6a4db94011d3 | 153 | |
sahilmgandhi | 18:6a4db94011d3 | 154 | /** |
sahilmgandhi | 18:6a4db94011d3 | 155 | * @brief Disables the RNG peripheral. |
sahilmgandhi | 18:6a4db94011d3 | 156 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 157 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 158 | */ |
sahilmgandhi | 18:6a4db94011d3 | 159 | #define __HAL_RNG_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~RNG_CR_RNGEN) |
sahilmgandhi | 18:6a4db94011d3 | 160 | |
sahilmgandhi | 18:6a4db94011d3 | 161 | /** |
sahilmgandhi | 18:6a4db94011d3 | 162 | * @brief Check the selected RNG flag status. |
sahilmgandhi | 18:6a4db94011d3 | 163 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 164 | * @param __FLAG__: RNG flag |
sahilmgandhi | 18:6a4db94011d3 | 165 | * This parameter can be one of the following values: |
sahilmgandhi | 18:6a4db94011d3 | 166 | * @arg RNG_FLAG_DRDY: Data ready |
sahilmgandhi | 18:6a4db94011d3 | 167 | * @arg RNG_FLAG_CECS: Clock error current status |
sahilmgandhi | 18:6a4db94011d3 | 168 | * @arg RNG_FLAG_SECS: Seed error current status |
sahilmgandhi | 18:6a4db94011d3 | 169 | * @retval The new state of __FLAG__ (SET or RESET). |
sahilmgandhi | 18:6a4db94011d3 | 170 | */ |
sahilmgandhi | 18:6a4db94011d3 | 171 | #define __HAL_RNG_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) |
sahilmgandhi | 18:6a4db94011d3 | 172 | |
sahilmgandhi | 18:6a4db94011d3 | 173 | /** |
sahilmgandhi | 18:6a4db94011d3 | 174 | * @brief Clears the selected RNG flag status. |
sahilmgandhi | 18:6a4db94011d3 | 175 | * @param __HANDLE__: RNG handle |
sahilmgandhi | 18:6a4db94011d3 | 176 | * @param __FLAG__: RNG flag to clear |
sahilmgandhi | 18:6a4db94011d3 | 177 | * @note WARNING: This is a dummy macro for HAL code alignment, |
sahilmgandhi | 18:6a4db94011d3 | 178 | * flags RNG_FLAG_DRDY, RNG_FLAG_CECS and RNG_FLAG_SECS are read-only. |
sahilmgandhi | 18:6a4db94011d3 | 179 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 180 | */ |
sahilmgandhi | 18:6a4db94011d3 | 181 | #define __HAL_RNG_CLEAR_FLAG(__HANDLE__, __FLAG__) /* dummy macro */ |
sahilmgandhi | 18:6a4db94011d3 | 182 | |
sahilmgandhi | 18:6a4db94011d3 | 183 | /** |
sahilmgandhi | 18:6a4db94011d3 | 184 | * @brief Enables the RNG interrupts. |
sahilmgandhi | 18:6a4db94011d3 | 185 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 186 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 187 | */ |
sahilmgandhi | 18:6a4db94011d3 | 188 | #define __HAL_RNG_ENABLE_IT(__HANDLE__) ((__HANDLE__)->Instance->CR |= RNG_CR_IE) |
sahilmgandhi | 18:6a4db94011d3 | 189 | |
sahilmgandhi | 18:6a4db94011d3 | 190 | /** |
sahilmgandhi | 18:6a4db94011d3 | 191 | * @brief Disables the RNG interrupts. |
sahilmgandhi | 18:6a4db94011d3 | 192 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 193 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 194 | */ |
sahilmgandhi | 18:6a4db94011d3 | 195 | #define __HAL_RNG_DISABLE_IT(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~RNG_CR_IE) |
sahilmgandhi | 18:6a4db94011d3 | 196 | |
sahilmgandhi | 18:6a4db94011d3 | 197 | /** |
sahilmgandhi | 18:6a4db94011d3 | 198 | * @brief Checks whether the specified RNG interrupt has occurred or not. |
sahilmgandhi | 18:6a4db94011d3 | 199 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 200 | * @param __INTERRUPT__: specifies the RNG interrupt status flag to check. |
sahilmgandhi | 18:6a4db94011d3 | 201 | * This parameter can be one of the following values: |
sahilmgandhi | 18:6a4db94011d3 | 202 | * @arg RNG_IT_DRDY: Data ready interrupt |
sahilmgandhi | 18:6a4db94011d3 | 203 | * @arg RNG_IT_CEI: Clock error interrupt |
sahilmgandhi | 18:6a4db94011d3 | 204 | * @arg RNG_IT_SEI: Seed error interrupt |
sahilmgandhi | 18:6a4db94011d3 | 205 | * @retval The new state of __INTERRUPT__ (SET or RESET). |
sahilmgandhi | 18:6a4db94011d3 | 206 | */ |
sahilmgandhi | 18:6a4db94011d3 | 207 | #define __HAL_RNG_GET_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->SR & (__INTERRUPT__)) == (__INTERRUPT__)) |
sahilmgandhi | 18:6a4db94011d3 | 208 | |
sahilmgandhi | 18:6a4db94011d3 | 209 | /** |
sahilmgandhi | 18:6a4db94011d3 | 210 | * @brief Clear the RNG interrupt status flags. |
sahilmgandhi | 18:6a4db94011d3 | 211 | * @param __HANDLE__: RNG Handle |
sahilmgandhi | 18:6a4db94011d3 | 212 | * @param __INTERRUPT__: specifies the RNG interrupt status flag to clear. |
sahilmgandhi | 18:6a4db94011d3 | 213 | * This parameter can be one of the following values: |
sahilmgandhi | 18:6a4db94011d3 | 214 | * @arg RNG_IT_CEI: Clock error interrupt |
sahilmgandhi | 18:6a4db94011d3 | 215 | * @arg RNG_IT_SEI: Seed error interrupt |
sahilmgandhi | 18:6a4db94011d3 | 216 | * @note RNG_IT_DRDY flag is read-only, reading RNG_DR register automatically clears RNG_IT_DRDY. |
sahilmgandhi | 18:6a4db94011d3 | 217 | * @retval None |
sahilmgandhi | 18:6a4db94011d3 | 218 | */ |
sahilmgandhi | 18:6a4db94011d3 | 219 | #define __HAL_RNG_CLEAR_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->SR) = ~(__INTERRUPT__)) |
sahilmgandhi | 18:6a4db94011d3 | 220 | |
sahilmgandhi | 18:6a4db94011d3 | 221 | /** |
sahilmgandhi | 18:6a4db94011d3 | 222 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 223 | */ |
sahilmgandhi | 18:6a4db94011d3 | 224 | |
sahilmgandhi | 18:6a4db94011d3 | 225 | /* Exported functions --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 226 | /** @defgroup RNG_Exported_Functions RNG Exported Functions |
sahilmgandhi | 18:6a4db94011d3 | 227 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 228 | */ |
sahilmgandhi | 18:6a4db94011d3 | 229 | |
sahilmgandhi | 18:6a4db94011d3 | 230 | /** @defgroup RNG_Exported_Functions_Group1 Initialization and de-initialization functions |
sahilmgandhi | 18:6a4db94011d3 | 231 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 232 | */ |
sahilmgandhi | 18:6a4db94011d3 | 233 | HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 234 | HAL_StatusTypeDef HAL_RNG_DeInit (RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 235 | void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 236 | void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 237 | |
sahilmgandhi | 18:6a4db94011d3 | 238 | /** |
sahilmgandhi | 18:6a4db94011d3 | 239 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 240 | */ |
sahilmgandhi | 18:6a4db94011d3 | 241 | |
sahilmgandhi | 18:6a4db94011d3 | 242 | /** @defgroup RNG_Exported_Functions_Group2 Peripheral Control functions |
sahilmgandhi | 18:6a4db94011d3 | 243 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 244 | */ |
sahilmgandhi | 18:6a4db94011d3 | 245 | uint32_t HAL_RNG_GetRandomNumber(RNG_HandleTypeDef *hrng); /* Obsolete, use HAL_RNG_GenerateRandomNumber() instead */ |
sahilmgandhi | 18:6a4db94011d3 | 246 | uint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng); /* Obsolete, use HAL_RNG_GenerateRandomNumber_IT() instead */ |
sahilmgandhi | 18:6a4db94011d3 | 247 | |
sahilmgandhi | 18:6a4db94011d3 | 248 | HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber(RNG_HandleTypeDef *hrng, uint32_t *random32bit); |
sahilmgandhi | 18:6a4db94011d3 | 249 | HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber_IT(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 250 | uint32_t HAL_RNG_ReadLastRandomNumber(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 251 | |
sahilmgandhi | 18:6a4db94011d3 | 252 | void HAL_RNG_IRQHandler(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 253 | void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 254 | void HAL_RNG_ReadyDataCallback(RNG_HandleTypeDef* hrng, uint32_t random32bit); |
sahilmgandhi | 18:6a4db94011d3 | 255 | |
sahilmgandhi | 18:6a4db94011d3 | 256 | /** |
sahilmgandhi | 18:6a4db94011d3 | 257 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 258 | */ |
sahilmgandhi | 18:6a4db94011d3 | 259 | |
sahilmgandhi | 18:6a4db94011d3 | 260 | /** @defgroup RNG_Exported_Functions_Group3 Peripheral State functions |
sahilmgandhi | 18:6a4db94011d3 | 261 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 262 | */ |
sahilmgandhi | 18:6a4db94011d3 | 263 | HAL_RNG_StateTypeDef HAL_RNG_GetState(RNG_HandleTypeDef *hrng); |
sahilmgandhi | 18:6a4db94011d3 | 264 | |
sahilmgandhi | 18:6a4db94011d3 | 265 | /** |
sahilmgandhi | 18:6a4db94011d3 | 266 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 267 | */ |
sahilmgandhi | 18:6a4db94011d3 | 268 | |
sahilmgandhi | 18:6a4db94011d3 | 269 | /** |
sahilmgandhi | 18:6a4db94011d3 | 270 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 271 | */ |
sahilmgandhi | 18:6a4db94011d3 | 272 | |
sahilmgandhi | 18:6a4db94011d3 | 273 | /* Private types -------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 274 | /** @defgroup RNG_Private_Types RNG Private Types |
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 | |
sahilmgandhi | 18:6a4db94011d3 | 282 | /* Private defines -----------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 283 | /** @defgroup RNG_Private_Defines RNG Private Defines |
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 | |
sahilmgandhi | 18:6a4db94011d3 | 291 | /* Private variables ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 292 | /** @defgroup RNG_Private_Variables RNG Private Variables |
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 | |
sahilmgandhi | 18:6a4db94011d3 | 300 | /* Private constants ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 301 | /** @defgroup RNG_Private_Constants RNG Private Constants |
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 | |
sahilmgandhi | 18:6a4db94011d3 | 309 | /* Private macros ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 310 | /** @defgroup RNG_Private_Macros RNG Private Macros |
sahilmgandhi | 18:6a4db94011d3 | 311 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 312 | */ |
sahilmgandhi | 18:6a4db94011d3 | 313 | #define IS_RNG_IT(IT) (((IT) == RNG_IT_CEI) || \ |
sahilmgandhi | 18:6a4db94011d3 | 314 | ((IT) == RNG_IT_SEI)) |
sahilmgandhi | 18:6a4db94011d3 | 315 | |
sahilmgandhi | 18:6a4db94011d3 | 316 | #define IS_RNG_FLAG(FLAG) (((FLAG) == RNG_FLAG_DRDY) || \ |
sahilmgandhi | 18:6a4db94011d3 | 317 | ((FLAG) == RNG_FLAG_CECS) || \ |
sahilmgandhi | 18:6a4db94011d3 | 318 | ((FLAG) == RNG_FLAG_SECS)) |
sahilmgandhi | 18:6a4db94011d3 | 319 | |
sahilmgandhi | 18:6a4db94011d3 | 320 | /** |
sahilmgandhi | 18:6a4db94011d3 | 321 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 322 | */ |
sahilmgandhi | 18:6a4db94011d3 | 323 | |
sahilmgandhi | 18:6a4db94011d3 | 324 | /* Private functions prototypes ----------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 325 | /** @defgroup RNG_Private_Functions_Prototypes RNG Private Functions Prototypes |
sahilmgandhi | 18:6a4db94011d3 | 326 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 327 | */ |
sahilmgandhi | 18:6a4db94011d3 | 328 | |
sahilmgandhi | 18:6a4db94011d3 | 329 | /** |
sahilmgandhi | 18:6a4db94011d3 | 330 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 331 | */ |
sahilmgandhi | 18:6a4db94011d3 | 332 | |
sahilmgandhi | 18:6a4db94011d3 | 333 | /* Private functions ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 334 | /** @defgroup RNG_Private_Functions RNG Private Functions |
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 | |
sahilmgandhi | 18:6a4db94011d3 | 342 | /** |
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 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 351 | } |
sahilmgandhi | 18:6a4db94011d3 | 352 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 353 | |
sahilmgandhi | 18:6a4db94011d3 | 354 | #endif /* __STM32F2xx_HAL_RNG_H */ |
sahilmgandhi | 18:6a4db94011d3 | 355 | |
sahilmgandhi | 18:6a4db94011d3 | 356 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |