001
targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_ll_rng.c@0:13413ea9a877, 2022-06-12 (annotated)
- Committer:
- ganlikun
- Date:
- Sun Jun 12 14:02:44 2022 +0000
- Revision:
- 0:13413ea9a877
00
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ganlikun | 0:13413ea9a877 | 1 | /** |
ganlikun | 0:13413ea9a877 | 2 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 3 | * @file stm32f4xx_ll_rng.c |
ganlikun | 0:13413ea9a877 | 4 | * @author MCD Application Team |
ganlikun | 0:13413ea9a877 | 5 | * @version V1.7.1 |
ganlikun | 0:13413ea9a877 | 6 | * @date 14-April-2017 |
ganlikun | 0:13413ea9a877 | 7 | * @brief RNG LL module driver. |
ganlikun | 0:13413ea9a877 | 8 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 9 | * @attention |
ganlikun | 0:13413ea9a877 | 10 | * |
ganlikun | 0:13413ea9a877 | 11 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
ganlikun | 0:13413ea9a877 | 12 | * |
ganlikun | 0:13413ea9a877 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
ganlikun | 0:13413ea9a877 | 14 | * are permitted provided that the following conditions are met: |
ganlikun | 0:13413ea9a877 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
ganlikun | 0:13413ea9a877 | 16 | * this list of conditions and the following disclaimer. |
ganlikun | 0:13413ea9a877 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
ganlikun | 0:13413ea9a877 | 18 | * this list of conditions and the following disclaimer in the documentation |
ganlikun | 0:13413ea9a877 | 19 | * and/or other materials provided with the distribution. |
ganlikun | 0:13413ea9a877 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
ganlikun | 0:13413ea9a877 | 21 | * may be used to endorse or promote products derived from this software |
ganlikun | 0:13413ea9a877 | 22 | * without specific prior written permission. |
ganlikun | 0:13413ea9a877 | 23 | * |
ganlikun | 0:13413ea9a877 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
ganlikun | 0:13413ea9a877 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
ganlikun | 0:13413ea9a877 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
ganlikun | 0:13413ea9a877 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
ganlikun | 0:13413ea9a877 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
ganlikun | 0:13413ea9a877 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
ganlikun | 0:13413ea9a877 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
ganlikun | 0:13413ea9a877 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
ganlikun | 0:13413ea9a877 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
ganlikun | 0:13413ea9a877 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
ganlikun | 0:13413ea9a877 | 34 | * |
ganlikun | 0:13413ea9a877 | 35 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 36 | */ |
ganlikun | 0:13413ea9a877 | 37 | #if defined(USE_FULL_LL_DRIVER) |
ganlikun | 0:13413ea9a877 | 38 | |
ganlikun | 0:13413ea9a877 | 39 | /* Includes ------------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 40 | #include "stm32f4xx_ll_rng.h" |
ganlikun | 0:13413ea9a877 | 41 | #include "stm32f4xx_ll_bus.h" |
ganlikun | 0:13413ea9a877 | 42 | |
ganlikun | 0:13413ea9a877 | 43 | #ifdef USE_FULL_ASSERT |
ganlikun | 0:13413ea9a877 | 44 | #include "stm32_assert.h" |
ganlikun | 0:13413ea9a877 | 45 | #else |
ganlikun | 0:13413ea9a877 | 46 | #define assert_param(expr) ((void)0U) |
ganlikun | 0:13413ea9a877 | 47 | #endif |
ganlikun | 0:13413ea9a877 | 48 | |
ganlikun | 0:13413ea9a877 | 49 | /** @addtogroup STM32F4xx_LL_Driver |
ganlikun | 0:13413ea9a877 | 50 | * @{ |
ganlikun | 0:13413ea9a877 | 51 | */ |
ganlikun | 0:13413ea9a877 | 52 | |
ganlikun | 0:13413ea9a877 | 53 | #if defined (RNG) |
ganlikun | 0:13413ea9a877 | 54 | |
ganlikun | 0:13413ea9a877 | 55 | /** @addtogroup RNG_LL |
ganlikun | 0:13413ea9a877 | 56 | * @{ |
ganlikun | 0:13413ea9a877 | 57 | */ |
ganlikun | 0:13413ea9a877 | 58 | |
ganlikun | 0:13413ea9a877 | 59 | /* Private types -------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 60 | /* Private variables ---------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 61 | /* Private constants ---------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 62 | /* Private macros ------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 63 | /* Private function prototypes -----------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 64 | |
ganlikun | 0:13413ea9a877 | 65 | /* Exported functions --------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 66 | /** @addtogroup RNG_LL_Exported_Functions |
ganlikun | 0:13413ea9a877 | 67 | * @{ |
ganlikun | 0:13413ea9a877 | 68 | */ |
ganlikun | 0:13413ea9a877 | 69 | |
ganlikun | 0:13413ea9a877 | 70 | /** @addtogroup RNG_LL_EF_Init |
ganlikun | 0:13413ea9a877 | 71 | * @{ |
ganlikun | 0:13413ea9a877 | 72 | */ |
ganlikun | 0:13413ea9a877 | 73 | |
ganlikun | 0:13413ea9a877 | 74 | /** |
ganlikun | 0:13413ea9a877 | 75 | * @brief De-initialize RNG registers (Registers restored to their default values). |
ganlikun | 0:13413ea9a877 | 76 | * @param RNGx RNG Instance |
ganlikun | 0:13413ea9a877 | 77 | * @retval An ErrorStatus enumeration value: |
ganlikun | 0:13413ea9a877 | 78 | * - SUCCESS: RNG registers are de-initialized |
ganlikun | 0:13413ea9a877 | 79 | * - ERROR: not applicable |
ganlikun | 0:13413ea9a877 | 80 | */ |
ganlikun | 0:13413ea9a877 | 81 | ErrorStatus LL_RNG_DeInit(RNG_TypeDef *RNGx) |
ganlikun | 0:13413ea9a877 | 82 | { |
ganlikun | 0:13413ea9a877 | 83 | /* Check the parameters */ |
ganlikun | 0:13413ea9a877 | 84 | assert_param(IS_RNG_ALL_INSTANCE(RNGx)); |
ganlikun | 0:13413ea9a877 | 85 | |
ganlikun | 0:13413ea9a877 | 86 | #if !defined (RCC_AHB2_SUPPORT) |
ganlikun | 0:13413ea9a877 | 87 | /* Enable RNG reset state */ |
ganlikun | 0:13413ea9a877 | 88 | LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_RNG); |
ganlikun | 0:13413ea9a877 | 89 | |
ganlikun | 0:13413ea9a877 | 90 | /* Release RNG from reset state */ |
ganlikun | 0:13413ea9a877 | 91 | LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_RNG); |
ganlikun | 0:13413ea9a877 | 92 | #else |
ganlikun | 0:13413ea9a877 | 93 | /* Enable RNG reset state */ |
ganlikun | 0:13413ea9a877 | 94 | LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_RNG); |
ganlikun | 0:13413ea9a877 | 95 | |
ganlikun | 0:13413ea9a877 | 96 | /* Release RNG from reset state */ |
ganlikun | 0:13413ea9a877 | 97 | LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_RNG); |
ganlikun | 0:13413ea9a877 | 98 | #endif |
ganlikun | 0:13413ea9a877 | 99 | |
ganlikun | 0:13413ea9a877 | 100 | return (SUCCESS); |
ganlikun | 0:13413ea9a877 | 101 | } |
ganlikun | 0:13413ea9a877 | 102 | |
ganlikun | 0:13413ea9a877 | 103 | /** |
ganlikun | 0:13413ea9a877 | 104 | * @} |
ganlikun | 0:13413ea9a877 | 105 | */ |
ganlikun | 0:13413ea9a877 | 106 | |
ganlikun | 0:13413ea9a877 | 107 | /** |
ganlikun | 0:13413ea9a877 | 108 | * @} |
ganlikun | 0:13413ea9a877 | 109 | */ |
ganlikun | 0:13413ea9a877 | 110 | |
ganlikun | 0:13413ea9a877 | 111 | /** |
ganlikun | 0:13413ea9a877 | 112 | * @} |
ganlikun | 0:13413ea9a877 | 113 | */ |
ganlikun | 0:13413ea9a877 | 114 | |
ganlikun | 0:13413ea9a877 | 115 | #endif /* defined (RNG) */ |
ganlikun | 0:13413ea9a877 | 116 | |
ganlikun | 0:13413ea9a877 | 117 | /** |
ganlikun | 0:13413ea9a877 | 118 | * @} |
ganlikun | 0:13413ea9a877 | 119 | */ |
ganlikun | 0:13413ea9a877 | 120 | |
ganlikun | 0:13413ea9a877 | 121 | #endif /* USE_FULL_LL_DRIVER */ |
ganlikun | 0:13413ea9a877 | 122 | |
ganlikun | 0:13413ea9a877 | 123 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
ganlikun | 0:13413ea9a877 | 124 | |
ganlikun | 0:13413ea9a877 | 125 |