|
STM32G474xx HAL用户手册
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32g4xx_ul_hrtim.c 00004 * @author MCD Application Team 00005 * @brief HRTIM LL module driver. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * Copyright (c) 2019 STMicroelectronics. 00010 * All rights reserved. 00011 * 00012 * This software is licensed under terms that can be found in the LICENSE file 00013 * in the root directory of this software component. 00014 * If no LICENSE file comes with this software, it is provided AS-IS. 00015 * 00016 ****************************************************************************** 00017 */ 00018 #if defined(USE_FULL_LL_DRIVER) 00019 00020 /* Includes ------------------------------------------------------------------*/ 00021 #include "stm32g4xx_ul_hrtim.h" 00022 #include "stm32g4xx_ul_bus.h" 00023 00024 #ifdef USE_FULL_ASSERT 00025 #include "stm32_assert.h" 00026 #else 00027 #define assert_param(expr) ((void)0U) 00028 #endif 00029 00030 /** @addtogroup STM32G4xx_LL_Driver 00031 * @{ 00032 */ 00033 00034 #if defined (HRTIM1) 00035 00036 /** @addtogroup HRTIM_LL 00037 * @{ 00038 */ 00039 00040 /* Private types -------------------------------------------------------------*/ 00041 /* Private variables ---------------------------------------------------------*/ 00042 /* Private constants ---------------------------------------------------------*/ 00043 /* Private macros ------------------------------------------------------------*/ 00044 /* Private function prototypes -----------------------------------------------*/ 00045 /* Exported functions --------------------------------------------------------*/ 00046 /** @addtogroup HRTIM_LL_Exported_Functions 00047 * @{ 00048 */ 00049 /** 00050 * @brief Set HRTIM instance registers to their reset values. 00051 * @param HRTIMx High Resolution Timer instance 00052 * @retval ErrorStatus enumeration value: 00053 * - SUCCESS: HRTIMx registers are de-initialized 00054 * - ERROR: invalid HRTIMx instance 00055 */ 00056 ErrorStatus LL_HRTIM_DeInit(const HRTIM_TypeDef *HRTIMx) 00057 { 00058 ErrorStatus status = SUCCESS; 00059 00060 /* Check the parameters */ 00061 assert_param(IS_ULL_All_INSTANCE(HRTIMx)); 00062 00063 if (HRTIMx == HRTIM1) 00064 { 00065 /* Force HRTIM reset */ 00066 LL_APB2_UDP1_ForcesReset(LL_APB2_GRP1_PERIPH_URTIM1); 00067 00068 /* Release HRTIM reset */ 00069 LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_URTIM1); 00070 } 00071 else 00072 { 00073 status = ERROR; 00074 } 00075 00076 return status; 00077 } 00078 /** 00079 * @} 00080 */ 00081 00082 /** 00083 * @} 00084 */ 00085 00086 #endif /* HRTIM1 */ 00087 00088 /** 00089 * @} 00090 */ 00091 00092 #endif /* USE_FULL_LL_DRIVER */
1.7.6.1