You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.9 KiB

2 years ago
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file rng.c
  5. * @brief This file provides code for the configuration
  6. * of the RNG instances.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2023 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. /* Includes ------------------------------------------------------------------*/
  21. #include "rng.h"
  22. /* USER CODE BEGIN 0 */
  23. /* USER CODE END 0 */
  24. RNG_HandleTypeDef hrng;
  25. /* RNG init function */
  26. void MX_RNG_Init(void)
  27. {
  28. /* USER CODE BEGIN RNG_Init 0 */
  29. /* USER CODE END RNG_Init 0 */
  30. /* USER CODE BEGIN RNG_Init 1 */
  31. /* USER CODE END RNG_Init 1 */
  32. hrng.Instance = RNG;
  33. if (HAL_RNG_Init(&hrng) != HAL_OK)
  34. {
  35. Error_Handler();
  36. }
  37. /* USER CODE BEGIN RNG_Init 2 */
  38. /* USER CODE END RNG_Init 2 */
  39. }
  40. void HAL_RNG_MspInit(RNG_HandleTypeDef* rngHandle)
  41. {
  42. if(rngHandle->Instance==RNG)
  43. {
  44. /* USER CODE BEGIN RNG_MspInit 0 */
  45. /* USER CODE END RNG_MspInit 0 */
  46. /* RNG clock enable */
  47. __HAL_RCC_RNG_CLK_ENABLE();
  48. /* USER CODE BEGIN RNG_MspInit 1 */
  49. /* USER CODE END RNG_MspInit 1 */
  50. }
  51. }
  52. void HAL_RNG_MspDeInit(RNG_HandleTypeDef* rngHandle)
  53. {
  54. if(rngHandle->Instance==RNG)
  55. {
  56. /* USER CODE BEGIN RNG_MspDeInit 0 */
  57. /* USER CODE END RNG_MspDeInit 0 */
  58. /* Peripheral clock disable */
  59. __HAL_RCC_RNG_CLK_DISABLE();
  60. /* USER CODE BEGIN RNG_MspDeInit 1 */
  61. /* USER CODE END RNG_MspDeInit 1 */
  62. }
  63. }
  64. /* USER CODE BEGIN 1 */
  65. /* USER CODE END 1 */