annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_rng.h @ 101:83feba2ad1c3 kittz

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