stm32f1xx_ll_crc.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. ******************************************************************************
  3. * @file stm32f1xx_ll_crc.c
  4. * @author MCD Application Team
  5. * @brief CRC 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 "stm32f1xx_ll_crc.h"
  21. #include "stm32f1xx_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 STM32F1xx_LL_Driver
  28. * @{
  29. */
  30. #if defined (CRC)
  31. /** @addtogroup CRC_LL
  32. * @{
  33. */
  34. /* Private types -------------------------------------------------------------*/
  35. /* Private variables ---------------------------------------------------------*/
  36. /* Private constants ---------------------------------------------------------*/
  37. /* Private macros ------------------------------------------------------------*/
  38. /* Private function prototypes -----------------------------------------------*/
  39. /* Exported functions --------------------------------------------------------*/
  40. /** @addtogroup CRC_LL_Exported_Functions
  41. * @{
  42. */
  43. /** @addtogroup CRC_LL_EF_Init
  44. * @{
  45. */
  46. /**
  47. * @brief De-initialize CRC registers (Registers restored to their default values).
  48. * @param CRCx CRC Instance
  49. * @retval An ErrorStatus enumeration value:
  50. * - SUCCESS: CRC registers are de-initialized
  51. * - ERROR: CRC registers are not de-initialized
  52. */
  53. ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx)
  54. {
  55. ErrorStatus status = SUCCESS;
  56. /* Check the parameters */
  57. assert_param(IS_CRC_ALL_INSTANCE(CRCx));
  58. if (CRCx == CRC)
  59. {
  60. /* Reset the CRC calculation unit */
  61. LL_CRC_ResetCRCCalculationUnit(CRCx);
  62. /* Reset IDR register */
  63. LL_CRC_Write_IDR(CRCx, 0x00U);
  64. }
  65. else
  66. {
  67. status = ERROR;
  68. }
  69. return (status);
  70. }
  71. /**
  72. * @}
  73. */
  74. /**
  75. * @}
  76. */
  77. /**
  78. * @}
  79. */
  80. #endif /* defined (CRC) */
  81. /**
  82. * @}
  83. */
  84. #endif /* USE_FULL_LL_DRIVER */