Increment eeprom version
[betaflight.git] / lib / main / STM32F1 / Drivers / STM32F1xx_HAL_Driver / Inc / stm32f1xx_ll_crc.h
blob1ab918d9ac5fc99681a4b9296243718974c1ed1f
1 /**
2 ******************************************************************************
3 * @file stm32f1xx_ll_crc.h
4 * @author MCD Application Team
5 * @version V1.1.1
6 * @date 12-May-2017
7 * @brief Header file of CRC LL module.
8 ******************************************************************************
9 * @attention
11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F1xx_LL_CRC_H
40 #define __STM32F1xx_LL_CRC_H
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f1xx.h"
49 /** @addtogroup STM32F1xx_LL_Driver
50 * @{
53 #if defined(CRC)
55 /** @defgroup CRC_LL CRC
56 * @{
59 /* Private types -------------------------------------------------------------*/
60 /* Private variables ---------------------------------------------------------*/
61 /* Private constants ---------------------------------------------------------*/
62 /* Private macros ------------------------------------------------------------*/
64 /* Exported types ------------------------------------------------------------*/
65 /* Exported constants --------------------------------------------------------*/
67 /* Exported macro ------------------------------------------------------------*/
68 /** @defgroup CRC_LL_Exported_Macros CRC Exported Macros
69 * @{
72 /** @defgroup CRC_LL_EM_WRITE_READ Common Write and read registers Macros
73 * @{
76 /**
77 * @brief Write a value in CRC register
78 * @param __INSTANCE__ CRC Instance
79 * @param __REG__ Register to be written
80 * @param __VALUE__ Value to be written in the register
81 * @retval None
83 #define LL_CRC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
85 /**
86 * @brief Read a value in CRC register
87 * @param __INSTANCE__ CRC Instance
88 * @param __REG__ Register to be read
89 * @retval Register value
91 #define LL_CRC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
92 /**
93 * @}
96 /**
97 * @}
101 /* Exported functions --------------------------------------------------------*/
102 /** @defgroup CRC_LL_Exported_Functions CRC Exported Functions
103 * @{
106 /** @defgroup CRC_LL_EF_Configuration CRC Configuration functions
107 * @{
111 * @brief Reset the CRC calculation unit.
112 * @rmtoll CR RESET LL_CRC_ResetCRCCalculationUnit
113 * @param CRCx CRC Instance
114 * @retval None
116 __STATIC_INLINE void LL_CRC_ResetCRCCalculationUnit(CRC_TypeDef *CRCx)
118 WRITE_REG(CRCx->CR, CRC_CR_RESET);
122 * @}
125 /** @defgroup CRC_LL_EF_Data_Management Data_Management
126 * @{
130 * @brief Write given 32-bit data to the CRC calculator
131 * @rmtoll DR DR LL_CRC_FeedData32
132 * @param CRCx CRC Instance
133 * @param InData value to be provided to CRC calculator between between Min_Data=0 and Max_Data=0xFFFFFFFF
134 * @retval None
136 __STATIC_INLINE void LL_CRC_FeedData32(CRC_TypeDef *CRCx, uint32_t InData)
138 WRITE_REG(CRCx->DR, InData);
142 * @brief Return current CRC calculation result. 32 bits value is returned.
143 * @rmtoll DR DR LL_CRC_ReadData32
144 * @param CRCx CRC Instance
145 * @retval Current CRC calculation result as stored in CRC_DR register (32 bits).
147 __STATIC_INLINE uint32_t LL_CRC_ReadData32(CRC_TypeDef *CRCx)
149 return (uint32_t)(READ_REG(CRCx->DR));
153 * @brief Return data stored in the Independent Data(IDR) register.
154 * @note This register can be used as a temporary storage location for one byte.
155 * @rmtoll IDR IDR LL_CRC_Read_IDR
156 * @param CRCx CRC Instance
157 * @retval Value stored in CRC_IDR register (General-purpose 8-bit data register).
159 __STATIC_INLINE uint32_t LL_CRC_Read_IDR(CRC_TypeDef *CRCx)
161 return (uint32_t)(READ_REG(CRCx->IDR));
165 * @brief Store data in the Independent Data(IDR) register.
166 * @note This register can be used as a temporary storage location for one byte.
167 * @rmtoll IDR IDR LL_CRC_Write_IDR
168 * @param CRCx CRC Instance
169 * @param InData value to be stored in CRC_IDR register (8-bit) between between Min_Data=0 and Max_Data=0xFF
170 * @retval None
172 __STATIC_INLINE void LL_CRC_Write_IDR(CRC_TypeDef *CRCx, uint32_t InData)
174 *((uint8_t __IO *)(&CRCx->IDR)) = (uint8_t) InData;
177 * @}
180 #if defined(USE_FULL_LL_DRIVER)
181 /** @defgroup CRC_LL_EF_Init Initialization and de-initialization functions
182 * @{
185 ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx);
188 * @}
190 #endif /* USE_FULL_LL_DRIVER */
193 * @}
197 * @}
200 #endif /* defined(CRC) */
203 * @}
206 #ifdef __cplusplus
208 #endif
210 #endif /* __STM32F1xx_LL_CRC_H */
212 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/