rng.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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) 2020 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. {
  27. hrng.Instance = RNG;
  28. if (HAL_RNG_Init(&hrng) != HAL_OK)
  29. {
  30. Error_Handler();
  31. }
  32. }
  33. void HAL_RNG_MspInit(RNG_HandleTypeDef* rngHandle)
  34. {
  35. if(rngHandle->Instance==RNG)
  36. {
  37. /* USER CODE BEGIN RNG_MspInit 0 */
  38. /* USER CODE END RNG_MspInit 0 */
  39. /* RNG clock enable */
  40. __HAL_RCC_RNG_CLK_ENABLE();
  41. /* USER CODE BEGIN RNG_MspInit 1 */
  42. /* USER CODE END RNG_MspInit 1 */
  43. }
  44. }
  45. void HAL_RNG_MspDeInit(RNG_HandleTypeDef* rngHandle)
  46. {
  47. if(rngHandle->Instance==RNG)
  48. {
  49. /* USER CODE BEGIN RNG_MspDeInit 0 */
  50. /* USER CODE END RNG_MspDeInit 0 */
  51. /* Peripheral clock disable */
  52. __HAL_RCC_RNG_CLK_DISABLE();
  53. /* USER CODE BEGIN RNG_MspDeInit 1 */
  54. /* USER CODE END RNG_MspDeInit 1 */
  55. }
  56. }
  57. /* USER CODE BEGIN 1 */
  58. /* USER CODE END 1 */
  59. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/