rng.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. ******************************************************************************
  3. * @file rng.c
  4. * @brief This file provides code for the configuration
  5. * of the RNG instances.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under Ultimate Liberty license
  13. * SLA0044, the "License"; You may not use this file except in compliance with
  14. * the License. You may obtain a copy of the License at:
  15. * www.st.com/SLA0044
  16. *
  17. ******************************************************************************
  18. */
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "rng.h"
  21. /* USER CODE BEGIN 0 */
  22. /* USER CODE END 0 */
  23. RNG_HandleTypeDef hrng;
  24. /* RNG init function */
  25. void MX_RNG_Init(void) {
  26. /* USER CODE BEGIN RNG_Init 0 */
  27. /* USER CODE END RNG_Init 0 */
  28. /* USER CODE BEGIN RNG_Init 1 */
  29. /* USER CODE END RNG_Init 1 */
  30. hrng.Instance = RNG;
  31. hrng.Init.ClockErrorDetection = RNG_CED_ENABLE;
  32. if(HAL_RNG_Init(&hrng) != HAL_OK) {
  33. Error_Handler();
  34. }
  35. /* USER CODE BEGIN RNG_Init 2 */
  36. /* USER CODE END RNG_Init 2 */
  37. }
  38. void HAL_RNG_MspInit(RNG_HandleTypeDef* rngHandle) {
  39. if(rngHandle->Instance == RNG) {
  40. /* USER CODE BEGIN RNG_MspInit 0 */
  41. /* USER CODE END RNG_MspInit 0 */
  42. /* RNG clock enable */
  43. __HAL_RCC_RNG_CLK_ENABLE();
  44. /* USER CODE BEGIN RNG_MspInit 1 */
  45. /* USER CODE END RNG_MspInit 1 */
  46. }
  47. }
  48. void HAL_RNG_MspDeInit(RNG_HandleTypeDef* rngHandle) {
  49. if(rngHandle->Instance == RNG) {
  50. /* USER CODE BEGIN RNG_MspDeInit 0 */
  51. /* USER CODE END RNG_MspDeInit 0 */
  52. /* Peripheral clock disable */
  53. __HAL_RCC_RNG_CLK_DISABLE();
  54. /* USER CODE BEGIN RNG_MspDeInit 1 */
  55. /* USER CODE END RNG_MspDeInit 1 */
  56. }
  57. }
  58. /* USER CODE BEGIN 1 */
  59. /* USER CODE END 1 */
  60. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/