STM32F439xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f4xx_ll_crc.h 00004 * @author MCD Application Team 00005 * @brief Header file of CRC LL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> 00010 * 00011 * Redistribution and use in source and binary forms, with or without modification, 00012 * are permitted provided that the following conditions are met: 00013 * 1. Redistributions of source code must retain the above copyright notice, 00014 * this list of conditions and the following disclaimer. 00015 * 2. Redistributions in binary form must reproduce the above copyright notice, 00016 * this list of conditions and the following disclaimer in the documentation 00017 * and/or other materials provided with the distribution. 00018 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00019 * may be used to endorse or promote products derived from this software 00020 * without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00023 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00024 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00025 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00026 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00027 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00028 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00030 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00031 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 * 00033 ****************************************************************************** 00034 */ 00035 00036 /* Define to prevent recursive inclusion -------------------------------------*/ 00037 #ifndef __STM32F4xx_LL_CRC_H 00038 #define __STM32F4xx_LL_CRC_H 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 /* Includes ------------------------------------------------------------------*/ 00045 #include "stm32f4xx.h" 00046 00047 /** @addtogroup STM32F4xx_LL_Driver 00048 * @{ 00049 */ 00050 00051 #if defined(CRC) 00052 00053 /** @defgroup CRC_LL CRC 00054 * @{ 00055 */ 00056 00057 /* Private types -------------------------------------------------------------*/ 00058 /* Private variables ---------------------------------------------------------*/ 00059 /* Private constants ---------------------------------------------------------*/ 00060 /* Private macros ------------------------------------------------------------*/ 00061 00062 /* Exported types ------------------------------------------------------------*/ 00063 /* Exported constants --------------------------------------------------------*/ 00064 00065 /* Exported macro ------------------------------------------------------------*/ 00066 /** @defgroup CRC_LL_Exported_Macros CRC Exported Macros 00067 * @{ 00068 */ 00069 00070 /** @defgroup CRC_LL_EM_WRITE_READ Common Write and read registers Macros 00071 * @{ 00072 */ 00073 00074 /** 00075 * @brief Write a value in CRC register 00076 * @param __INSTANCE__ CRC Instance 00077 * @param __REG__ Register to be written 00078 * @param __VALUE__ Value to be written in the register 00079 * @retval None 00080 */ 00081 #define LL_CRC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) 00082 00083 /** 00084 * @brief Read a value in CRC register 00085 * @param __INSTANCE__ CRC Instance 00086 * @param __REG__ Register to be read 00087 * @retval Register value 00088 */ 00089 #define LL_CRC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) 00090 /** 00091 * @} 00092 */ 00093 00094 /** 00095 * @} 00096 */ 00097 00098 00099 /* Exported functions --------------------------------------------------------*/ 00100 /** @defgroup CRC_LL_Exported_Functions CRC Exported Functions 00101 * @{ 00102 */ 00103 00104 /** @defgroup CRC_LL_EF_Configuration CRC Configuration functions 00105 * @{ 00106 */ 00107 00108 /** 00109 * @brief Reset the CRC calculation unit. 00110 * @rmtoll CR RESET LL_CRC_ResetCRCCalculationUnit 00111 * @param CRCx CRC Instance 00112 * @retval None 00113 */ 00114 __STATIC_INLINE void LL_CRC_ResetCRCCalculationUnit(CRC_TypeDef *CRCx) 00115 { 00116 WRITE_REG(CRCx->CR, CRC_CR_RESET); 00117 } 00118 00119 /** 00120 * @} 00121 */ 00122 00123 /** @defgroup CRC_LL_EF_Data_Management Data_Management 00124 * @{ 00125 */ 00126 00127 /** 00128 * @brief Write given 32-bit data to the CRC calculator 00129 * @rmtoll DR DR LL_CRC_FeedData32 00130 * @param CRCx CRC Instance 00131 * @param InData value to be provided to CRC calculator between between Min_Data=0 and Max_Data=0xFFFFFFFF 00132 * @retval None 00133 */ 00134 __STATIC_INLINE void LL_CRC_FeedData32(CRC_TypeDef *CRCx, uint32_t InData) 00135 { 00136 WRITE_REG(CRCx->DR, InData); 00137 } 00138 00139 /** 00140 * @brief Return current CRC calculation result. 32 bits value is returned. 00141 * @rmtoll DR DR LL_CRC_ReadData32 00142 * @param CRCx CRC Instance 00143 * @retval Current CRC calculation result as stored in CRC_DR register (32 bits). 00144 */ 00145 __STATIC_INLINE uint32_t LL_CRC_ReadData32(CRC_TypeDef *CRCx) 00146 { 00147 return (uint32_t)(READ_REG(CRCx->DR)); 00148 } 00149 00150 /** 00151 * @brief Return data stored in the Independent Data(IDR) register. 00152 * @note This register can be used as a temporary storage location for one byte. 00153 * @rmtoll IDR IDR LL_CRC_Read_IDR 00154 * @param CRCx CRC Instance 00155 * @retval Value stored in CRC_IDR register (General-purpose 8-bit data register). 00156 */ 00157 __STATIC_INLINE uint32_t LL_CRC_Read_IDR(CRC_TypeDef *CRCx) 00158 { 00159 return (uint32_t)(READ_REG(CRCx->IDR)); 00160 } 00161 00162 /** 00163 * @brief Store data in the Independent Data(IDR) register. 00164 * @note This register can be used as a temporary storage location for one byte. 00165 * @rmtoll IDR IDR LL_CRC_Write_IDR 00166 * @param CRCx CRC Instance 00167 * @param InData value to be stored in CRC_IDR register (8-bit) between between Min_Data=0 and Max_Data=0xFF 00168 * @retval None 00169 */ 00170 __STATIC_INLINE void LL_CRC_Write_IDR(CRC_TypeDef *CRCx, uint32_t InData) 00171 { 00172 *((uint8_t __IO *)(&CRCx->IDR)) = (uint8_t) InData; 00173 } 00174 /** 00175 * @} 00176 */ 00177 00178 #if defined(USE_FULL_LL_DRIVER) 00179 /** @defgroup CRC_LL_EF_Init Initialization and de-initialization functions 00180 * @{ 00181 */ 00182 00183 ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx); 00184 00185 /** 00186 * @} 00187 */ 00188 #endif /* USE_FULL_LL_DRIVER */ 00189 00190 /** 00191 * @} 00192 */ 00193 00194 /** 00195 * @} 00196 */ 00197 00198 #endif /* defined(CRC) */ 00199 00200 /** 00201 * @} 00202 */ 00203 00204 #ifdef __cplusplus 00205 } 00206 #endif 00207 00208 #endif /* __STM32F4xx_LL_CRC_H */ 00209 00210 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/