py32f002b_ll_crc.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /**
  2. ******************************************************************************
  3. * @file py32f002b_ll_crc.c
  4. * @author MCU Application Team
  5. * @brief CRC LL module driver.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by Puya under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. * @attention
  19. *
  20. * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
  21. * All rights reserved.</center></h2>
  22. *
  23. * This software component is licensed by ST under BSD 3-Clause license,
  24. * the "License"; You may not use this file except in compliance with the
  25. * License. You may obtain a copy of the License at:
  26. * opensource.org/licenses/BSD-3-Clause
  27. *
  28. ******************************************************************************
  29. */
  30. #if defined(USE_FULL_LL_DRIVER)
  31. /* Includes ------------------------------------------------------------------*/
  32. #include "py32f002b_ll_crc.h"
  33. #include "py32f002b_ll_bus.h"
  34. #ifdef USE_FULL_ASSERT
  35. #include "py32_assert.h"
  36. #else
  37. #define assert_param(expr) ((void)0U)
  38. #endif
  39. /** @addtogroup PY32F002B_LL_Driver
  40. * @{
  41. */
  42. #if defined (CRC)
  43. /** @addtogroup CRC_LL
  44. * @{
  45. */
  46. /* Private types -------------------------------------------------------------*/
  47. /* Private variables ---------------------------------------------------------*/
  48. /* Private constants ---------------------------------------------------------*/
  49. /* Private macros ------------------------------------------------------------*/
  50. /* Private function prototypes -----------------------------------------------*/
  51. /* Exported functions --------------------------------------------------------*/
  52. /** @addtogroup CRC_LL_Exported_Functions
  53. * @{
  54. */
  55. /** @addtogroup CRC_LL_EF_Init
  56. * @{
  57. */
  58. /**
  59. * @brief De-initialize CRC registers (Registers restored to their default values).
  60. * @param CRCx CRC Instance
  61. * @retval An ErrorStatus enumeration value:
  62. * - SUCCESS: CRC registers are de-initialized
  63. * - ERROR: CRC registers are not de-initialized
  64. */
  65. ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx)
  66. {
  67. ErrorStatus status = SUCCESS;
  68. /* Check the parameters */
  69. assert_param(IS_CRC_ALL_INSTANCE(CRCx));
  70. if (CRCx == CRC)
  71. {
  72. /* Reset the CRC calculation unit */
  73. LL_CRC_ResetCRCCalculationUnit(CRCx);
  74. /* Reset IDR register */
  75. LL_CRC_Write_IDR(CRCx, 0x00U);
  76. }
  77. else
  78. {
  79. status = ERROR;
  80. }
  81. return (status);
  82. }
  83. /**
  84. * @}
  85. */
  86. /**
  87. * @}
  88. */
  89. /**
  90. * @}
  91. */
  92. #endif /* defined (CRC) */
  93. /**
  94. * @}
  95. */
  96. #endif /* USE_FULL_LL_DRIVER */
  97. /************************ (C) COPYRIGHT Puya *****END OF FILE****/