Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:09

0001 /**
0002   ******************************************************************************
0003   * @file    stm32h7xx_ll_cordic.c
0004   * @author  MCD Application Team
0005   * @brief   CORDIC LL module driver.
0006   ******************************************************************************
0007   * @attention
0008   *
0009   * Copyright (c) 2017 STMicroelectronics.
0010   * All rights reserved.
0011   *
0012   * This software is licensed under terms that can be found in the LICENSE file
0013   * in the root directory of this software component.
0014   * If no LICENSE file comes with this software, it is provided AS-IS.
0015   *
0016   ******************************************************************************
0017   */
0018 #if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
0019 
0020 /* Includes ------------------------------------------------------------------*/
0021 #include "stm32h7xx_ll_cordic.h"
0022 #include "stm32h7xx_ll_bus.h"
0023 #ifdef  USE_FULL_ASSERT
0024 #include "stm32_assert.h"
0025 #else
0026 #define assert_param(expr) ((void)0U)
0027 #endif /* USE_FULL_ASSERT */
0028 
0029 /** @addtogroup STM32H7xx_LL_Driver
0030   * @{
0031   */
0032 
0033 #if defined(CORDIC)
0034 
0035 /** @addtogroup CORDIC_LL
0036   * @{
0037   */
0038 
0039 /* Private types -------------------------------------------------------------*/
0040 /* Private variables ---------------------------------------------------------*/
0041 /* Private constants ---------------------------------------------------------*/
0042 /* Private macros ------------------------------------------------------------*/
0043 /* Private function prototypes -----------------------------------------------*/
0044 
0045 /* Exported functions --------------------------------------------------------*/
0046 /** @addtogroup CORDIC_LL_Exported_Functions
0047   * @{
0048   */
0049 
0050 /** @addtogroup CORDIC_LL_EF_Init
0051   * @{
0052   */
0053 
0054 /**
0055   * @brief  De-Initialize CORDIC peripheral registers to their default reset values.
0056   * @param  CORDICx CORDIC Instance
0057   * @retval An ErrorStatus enumeration value:
0058   *          - SUCCESS: CORDIC registers are de-initialized
0059   *          - ERROR: CORDIC registers are not de-initialized
0060   */
0061 ErrorStatus LL_CORDIC_DeInit(const CORDIC_TypeDef *CORDICx)
0062 {
0063   ErrorStatus status = SUCCESS;
0064 
0065   /* Check the parameters */
0066   assert_param(IS_CORDIC_ALL_INSTANCE(CORDICx));
0067 
0068   if (CORDICx == CORDIC)
0069   {
0070     /* Force CORDIC reset */
0071     LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_CORDIC);
0072 
0073     /* Release CORDIC reset */
0074     LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_CORDIC);
0075   }
0076   else
0077   {
0078     status = ERROR;
0079   }
0080 
0081   return (status);
0082 }
0083 
0084 /**
0085   * @}
0086   */
0087 
0088 /**
0089   * @}
0090   */
0091 
0092 /**
0093   * @}
0094   */
0095 
0096 #endif /* defined(CORDIC) */
0097 
0098 /**
0099   * @}
0100   */
0101 
0102 #endif /* USE_FULL_LL_DRIVER */