1 /* USER CODE BEGIN Header */ 2 /** 3 ****************************************************************************** 4 * @file hw_rng.h 5 * @author GPM WBL Application Team 6 * @brief This file contains all the functions prototypes for the RNG MANAGER. 7 ****************************************************************************** 8 * @attention 9 * 10 * Copyright (c) 2024 STMicroelectronics. 11 * All rights reserved. 12 * 13 * This software is licensed under terms that can be found in the LICENSE file 14 * in the root directory of this software component. 15 * If no LICENSE file comes with this software, it is provided AS-IS. 16 * 17 ****************************************************************************** 18 */ 19 /* USER CODE END Header */ 20 21 /* Define to prevent recursive inclusion -------------------------------------*/ 22 #ifndef HW_RNG_H 23 #define HW_RNG_H 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 /* Includes ------------------------------------------------------------------*/ 30 #include "stdint.h" 31 32 /** @addtogroup HW_RNG_Peripheral RNG MANAGER 33 * @{ 34 */ 35 36 /** @defgroup HW_RNG_Exported_Types Exported Types 37 * @{ 38 */ 39 40 /* Enumerated values used to report the RNG result status after a process */ 41 typedef enum 42 { 43 HW_RNG_SUCCESS = 0, 44 HW_RNG_ERROR, 45 HW_RNG_ERROR_TIMEOUT 46 } HW_RNG_ResultStatus; 47 48 /** 49 * @} 50 */ 51 52 /** @defgroup HW_RNG_Exported_Constants Exported Constants 53 * @{ 54 */ 55 /** 56 * @} 57 */ 58 59 /** @defgroup HW_RNG_Exported_Macros Exported Macros 60 * @{ 61 */ 62 /** 63 * @} 64 */ 65 66 /** @defgroup HW_RNG_Exported_Functions Exported Functions 67 * @{ 68 */ 69 HW_RNG_ResultStatus HW_RNG_Init(void); 70 71 HW_RNG_ResultStatus HW_RNG_Deinit(void); 72 73 HW_RNG_ResultStatus HW_RNG_GetRandom16(uint16_t* num); 74 75 HW_RNG_ResultStatus HW_RNG_GetRandom32(uint32_t* num); 76 77 /** 78 * @} 79 */ 80 81 /** 82 * @} 83 */ 84 85 /** 86 * @} 87 */ 88 89 #ifdef __cplusplus 90 } 91 #endif 92 93 #endif /* HW_RNG_H */ 94