Back to home page

LXR

 
 

    


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

0001 /**
0002   ******************************************************************************
0003   * @file    stm32h7xx_ll_crc.c
0004   * @author  MCD Application Team
0005   * @brief   CRC 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_crc.h"
0022 #include "stm32h7xx_ll_bus.h"
0023 
0024 #ifdef  USE_FULL_ASSERT
0025 #include "stm32_assert.h"
0026 #else
0027 #define assert_param(expr) ((void)0U)
0028 #endif /* USE_FULL_ASSERT */
0029 
0030 /** @addtogroup STM32H7xx_LL_Driver
0031   * @{
0032   */
0033 
0034 #if defined (CRC)
0035 
0036 /** @addtogroup CRC_LL
0037   * @{
0038   */
0039 
0040 /* Private types -------------------------------------------------------------*/
0041 /* Private variables ---------------------------------------------------------*/
0042 /* Private constants ---------------------------------------------------------*/
0043 /* Private macros ------------------------------------------------------------*/
0044 /* Private function prototypes -----------------------------------------------*/
0045 
0046 /* Exported functions --------------------------------------------------------*/
0047 /** @addtogroup CRC_LL_Exported_Functions
0048   * @{
0049   */
0050 
0051 /** @addtogroup CRC_LL_EF_Init
0052   * @{
0053   */
0054 
0055 /**
0056   * @brief  De-initialize CRC registers (Registers restored to their default values).
0057   * @param  CRCx CRC Instance
0058   * @retval An ErrorStatus enumeration value:
0059   *          - SUCCESS: CRC registers are de-initialized
0060   *          - ERROR: CRC registers are not de-initialized
0061   */
0062 ErrorStatus LL_CRC_DeInit(const CRC_TypeDef *CRCx)
0063 {
0064   ErrorStatus status = SUCCESS;
0065 
0066   /* Check the parameters */
0067   assert_param(IS_CRC_ALL_INSTANCE(CRCx));
0068 
0069   if (CRCx == CRC)
0070   {
0071 #if defined(LL_AHB4_GRP1_PERIPH_CRC)
0072     /* Force CRC reset */
0073     LL_AHB4_GRP1_ForceReset(LL_AHB4_GRP1_PERIPH_CRC);
0074 
0075     /* Release CRC reset */
0076     LL_AHB4_GRP1_ReleaseReset(LL_AHB4_GRP1_PERIPH_CRC);
0077 #else
0078     /* Force CRC reset */
0079     LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC);
0080 
0081     /* Release CRC reset */
0082     LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC);
0083 #endif /*LL_AHB4_GRP1_PERIPH_CRC)*/
0084   }
0085   else
0086   {
0087     status = ERROR;
0088   }
0089 
0090   return (status);
0091 }
0092 
0093 /**
0094   * @}
0095   */
0096 
0097 /**
0098   * @}
0099   */
0100 
0101 /**
0102   * @}
0103   */
0104 
0105 #endif /* defined (CRC) */
0106 
0107 /**
0108   * @}
0109   */
0110 
0111 #endif /* USE_FULL_LL_DRIVER */