基质喷涂
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

3 weeks 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) 2025 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. #include "bsp.h"
  24. /* USER CODE END 0 */
  25. RNG_HandleTypeDef hrng;
  26. /* RNG init function */
  27. void MX_RNG_Init(void)
  28. {
  29. /* USER CODE BEGIN RNG_Init 0 */
  30. /* USER CODE END RNG_Init 0 */
  31. /* USER CODE BEGIN RNG_Init 1 */
  32. /* USER CODE END RNG_Init 1 */
  33. hrng.Instance = RNG;
  34. if (HAL_RNG_Init(&hrng) != HAL_OK)
  35. {
  36. Error_Handler();
  37. }
  38. /* USER CODE BEGIN RNG_Init 2 */
  39. /* USER CODE END RNG_Init 2 */
  40. }
  41. void HAL_RNG_MspInit(RNG_HandleTypeDef* rngHandle)
  42. {
  43. if(rngHandle->Instance==RNG)
  44. {
  45. /* USER CODE BEGIN RNG_MspInit 0 */
  46. /* USER CODE END RNG_MspInit 0 */
  47. /* RNG clock enable */
  48. __HAL_RCC_RNG_CLK_ENABLE();
  49. /* USER CODE BEGIN RNG_MspInit 1 */
  50. /* USER CODE END RNG_MspInit 1 */
  51. }
  52. }
  53. void HAL_RNG_MspDeInit(RNG_HandleTypeDef* rngHandle)
  54. {
  55. if(rngHandle->Instance==RNG)
  56. {
  57. /* USER CODE BEGIN RNG_MspDeInit 0 */
  58. /* USER CODE END RNG_MspDeInit 0 */
  59. /* Peripheral clock disable */
  60. __HAL_RCC_RNG_CLK_DISABLE();
  61. /* USER CODE BEGIN RNG_MspDeInit 1 */
  62. /* USER CODE END RNG_MspDeInit 1 */
  63. }
  64. }
  65. /* USER CODE BEGIN 1 */
  66. /* USER CODE END 1 */