训练营PLSR题目
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.
 
 
 
 
 
 

112 lines
2.6 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_ll_rng.c
  4. * @author MCD Application Team
  5. * @brief RNG LL module driver.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2016 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. #if defined(USE_FULL_LL_DRIVER)
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "stm32f4xx_ll_rng.h"
  21. #include "stm32f4xx_ll_bus.h"
  22. #ifdef USE_FULL_ASSERT
  23. #include "stm32_assert.h"
  24. #else
  25. #define assert_param(expr) ((void)0U)
  26. #endif /* USE_FULL_ASSERT */
  27. /** @addtogroup STM32F4xx_LL_Driver
  28. * @{
  29. */
  30. #if defined (RNG)
  31. /** @addtogroup RNG_LL
  32. * @{
  33. */
  34. /* Private types -------------------------------------------------------------*/
  35. /* Private variables ---------------------------------------------------------*/
  36. /* Private constants ---------------------------------------------------------*/
  37. /* Private macros ------------------------------------------------------------*/
  38. /* Private function prototypes -----------------------------------------------*/
  39. /* Exported functions --------------------------------------------------------*/
  40. /** @addtogroup RNG_LL_Exported_Functions
  41. * @{
  42. */
  43. /** @addtogroup RNG_LL_EF_Init
  44. * @{
  45. */
  46. /**
  47. * @brief De-initialize RNG registers (Registers restored to their default values).
  48. * @param RNGx RNG Instance
  49. * @retval An ErrorStatus enumeration value:
  50. * - SUCCESS: RNG registers are de-initialized
  51. * - ERROR: not applicable
  52. */
  53. ErrorStatus LL_RNG_DeInit(RNG_TypeDef *RNGx)
  54. {
  55. ErrorStatus status = SUCCESS;
  56. /* Check the parameters */
  57. assert_param(IS_RNG_ALL_INSTANCE(RNGx));
  58. if (RNGx == RNG)
  59. {
  60. #if !defined(RCC_AHB2_SUPPORT)
  61. /* Enable RNG reset state */
  62. LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_RNG);
  63. /* Release RNG from reset state */
  64. LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_RNG);
  65. #else
  66. /* Enable RNG reset state */
  67. LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_RNG);
  68. /* Release RNG from reset state */
  69. LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_RNG);
  70. #endif /* !RCC_AHB2_SUPPORT */
  71. }
  72. else
  73. {
  74. status = ERROR;
  75. }
  76. return status;
  77. }
  78. /**
  79. * @}
  80. */
  81. /**
  82. * @}
  83. */
  84. /**
  85. * @}
  86. */
  87. #endif /* RNG */
  88. /**
  89. * @}
  90. */
  91. #endif /* USE_FULL_LL_DRIVER */