Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / lib / main / STM32F3 / Drivers / STM32F3xx_HAL_Driver / Src / stm32f3xx_ll_crc.c
blob82b7925932e7673062b73d7f99bd69f804b5834d
1 /**
2 ******************************************************************************
3 * @file stm32f3xx_ll_crc.c
4 * @author MCD Application Team
5 * @brief CRC LL module driver.
6 ******************************************************************************
7 * @attention
9 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 ******************************************************************************
35 #if defined(USE_FULL_LL_DRIVER)
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f3xx_ll_crc.h"
40 #ifdef USE_FULL_ASSERT
41 #include "stm32_assert.h"
42 #else
43 #define assert_param(expr) ((void)0U)
44 #endif
46 /** @addtogroup STM32F3xx_LL_Driver
47 * @{
50 #if defined (CRC)
52 /** @addtogroup CRC_LL
53 * @{
56 /* Private types -------------------------------------------------------------*/
57 /* Private variables ---------------------------------------------------------*/
58 /* Private constants ---------------------------------------------------------*/
59 /* Private macros ------------------------------------------------------------*/
60 /* Private function prototypes -----------------------------------------------*/
62 /* Exported functions --------------------------------------------------------*/
63 /** @addtogroup CRC_LL_Exported_Functions
64 * @{
67 /** @addtogroup CRC_LL_EF_Init
68 * @{
71 /**
72 * @brief De-initialize CRC registers (Registers restored to their default values).
73 * @param CRCx CRC Instance
74 * @retval An ErrorStatus enumeration value:
75 * - SUCCESS: CRC registers are de-initialized
76 * - ERROR: CRC registers are not de-initialized
78 ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx)
80 ErrorStatus status = SUCCESS;
82 /* Check the parameters */
83 assert_param(IS_CRC_ALL_INSTANCE(CRCx));
85 if (CRCx == CRC)
87 /* Set programmable polynomial size in CR register to reset value (32 bits)*/
88 LL_CRC_SetPolynomialSize(CRCx, LL_CRC_POLYLENGTH_32B);
90 /* Set programmable polynomial in POL register to reset value */
91 LL_CRC_SetPolynomialCoef(CRCx, LL_CRC_DEFAULT_CRC32_POLY);
93 /* Set INIT register to reset value */
94 LL_CRC_SetInitialData(CRCx, LL_CRC_DEFAULT_CRC_INITVALUE);
96 /* Set Reversibility options on I/O data values in CR register to reset value */
97 LL_CRC_SetInputDataReverseMode(CRCx, LL_CRC_INDATA_REVERSE_NONE);
98 LL_CRC_SetOutputDataReverseMode(CRCx, LL_CRC_OUTDATA_REVERSE_NONE);
100 /* Reset the CRC calculation unit */
101 LL_CRC_ResetCRCCalculationUnit(CRCx);
103 /* Reset IDR register */
104 LL_CRC_Write_IDR(CRCx, 0x00U);
106 else
108 status = ERROR;
111 return (status);
115 * @}
119 * @}
123 * @}
126 #endif /* defined (CRC) */
129 * @}
132 #endif /* USE_FULL_LL_DRIVER */
134 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/