inport from local

Dependents:   Hobbyking_Cheetah_0511

Committer:
NYX
Date:
Mon Mar 16 06:35:48 2020 +0000
Revision:
0:85b3fd62ea1a
reinport to mbed;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NYX 0:85b3fd62ea1a 1 /**
NYX 0:85b3fd62ea1a 2 ******************************************************************************
NYX 0:85b3fd62ea1a 3 * @file stm32f4xx_hal_crc.c
NYX 0:85b3fd62ea1a 4 * @author MCD Application Team
NYX 0:85b3fd62ea1a 5 * @version V1.7.1
NYX 0:85b3fd62ea1a 6 * @date 14-April-2017
NYX 0:85b3fd62ea1a 7 * @brief CRC HAL module driver.
NYX 0:85b3fd62ea1a 8 * This file provides firmware functions to manage the following
NYX 0:85b3fd62ea1a 9 * functionalities of the Cyclic Redundancy Check (CRC) peripheral:
NYX 0:85b3fd62ea1a 10 * + Initialization and de-initialization functions
NYX 0:85b3fd62ea1a 11 * + Peripheral Control functions
NYX 0:85b3fd62ea1a 12 * + Peripheral State functions
NYX 0:85b3fd62ea1a 13 *
NYX 0:85b3fd62ea1a 14 @verbatim
NYX 0:85b3fd62ea1a 15 ==============================================================================
NYX 0:85b3fd62ea1a 16 ##### How to use this driver #####
NYX 0:85b3fd62ea1a 17 ==============================================================================
NYX 0:85b3fd62ea1a 18 [..]
NYX 0:85b3fd62ea1a 19 The CRC HAL driver can be used as follows:
NYX 0:85b3fd62ea1a 20
NYX 0:85b3fd62ea1a 21 (#) Enable CRC AHB clock using __HAL_RCC_CRC_CLK_ENABLE();
NYX 0:85b3fd62ea1a 22
NYX 0:85b3fd62ea1a 23 (#) Use HAL_CRC_Accumulate() function to compute the CRC value of
NYX 0:85b3fd62ea1a 24 a 32-bit data buffer using combination of the previous CRC value
NYX 0:85b3fd62ea1a 25 and the new one.
NYX 0:85b3fd62ea1a 26
NYX 0:85b3fd62ea1a 27 (#) Use HAL_CRC_Calculate() function to compute the CRC Value of
NYX 0:85b3fd62ea1a 28 a new 32-bit data buffer. This function resets the CRC computation
NYX 0:85b3fd62ea1a 29 unit before starting the computation to avoid getting wrong CRC values.
NYX 0:85b3fd62ea1a 30
NYX 0:85b3fd62ea1a 31 @endverbatim
NYX 0:85b3fd62ea1a 32 ******************************************************************************
NYX 0:85b3fd62ea1a 33 * @attention
NYX 0:85b3fd62ea1a 34 *
NYX 0:85b3fd62ea1a 35 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
NYX 0:85b3fd62ea1a 36 *
NYX 0:85b3fd62ea1a 37 * Redistribution and use in source and binary forms, with or without modification,
NYX 0:85b3fd62ea1a 38 * are permitted provided that the following conditions are met:
NYX 0:85b3fd62ea1a 39 * 1. Redistributions of source code must retain the above copyright notice,
NYX 0:85b3fd62ea1a 40 * this list of conditions and the following disclaimer.
NYX 0:85b3fd62ea1a 41 * 2. Redistributions in binary form must reproduce the above copyright notice,
NYX 0:85b3fd62ea1a 42 * this list of conditions and the following disclaimer in the documentation
NYX 0:85b3fd62ea1a 43 * and/or other materials provided with the distribution.
NYX 0:85b3fd62ea1a 44 * 3. Neither the name of STMicroelectronics nor the names of its contributors
NYX 0:85b3fd62ea1a 45 * may be used to endorse or promote products derived from this software
NYX 0:85b3fd62ea1a 46 * without specific prior written permission.
NYX 0:85b3fd62ea1a 47 *
NYX 0:85b3fd62ea1a 48 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
NYX 0:85b3fd62ea1a 49 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
NYX 0:85b3fd62ea1a 50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
NYX 0:85b3fd62ea1a 51 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
NYX 0:85b3fd62ea1a 52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
NYX 0:85b3fd62ea1a 53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
NYX 0:85b3fd62ea1a 54 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
NYX 0:85b3fd62ea1a 55 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
NYX 0:85b3fd62ea1a 56 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
NYX 0:85b3fd62ea1a 57 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NYX 0:85b3fd62ea1a 58 *
NYX 0:85b3fd62ea1a 59 ******************************************************************************
NYX 0:85b3fd62ea1a 60 */
NYX 0:85b3fd62ea1a 61
NYX 0:85b3fd62ea1a 62 /* Includes ------------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 63 #include "stm32f4xx_hal.h"
NYX 0:85b3fd62ea1a 64
NYX 0:85b3fd62ea1a 65 /** @addtogroup STM32F4xx_HAL_Driver
NYX 0:85b3fd62ea1a 66 * @{
NYX 0:85b3fd62ea1a 67 */
NYX 0:85b3fd62ea1a 68
NYX 0:85b3fd62ea1a 69 /** @addtogroup CRC
NYX 0:85b3fd62ea1a 70 * @{
NYX 0:85b3fd62ea1a 71 */
NYX 0:85b3fd62ea1a 72
NYX 0:85b3fd62ea1a 73 #ifdef HAL_CRC_MODULE_ENABLED
NYX 0:85b3fd62ea1a 74
NYX 0:85b3fd62ea1a 75 /* Private typedef -----------------------------------------------------------*/
NYX 0:85b3fd62ea1a 76 /* Private define ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 77 /* Private macro -------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 78 /* Private variables ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 79 /* Private function prototypes -----------------------------------------------*/
NYX 0:85b3fd62ea1a 80 /* Private functions ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 81 /* Exported functions --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 82
NYX 0:85b3fd62ea1a 83 /** @addtogroup CRC_Exported_Functions
NYX 0:85b3fd62ea1a 84 * @{
NYX 0:85b3fd62ea1a 85 */
NYX 0:85b3fd62ea1a 86
NYX 0:85b3fd62ea1a 87 /** @addtogroup CRC_Exported_Functions_Group1
NYX 0:85b3fd62ea1a 88 * @brief Initialization and de-initialization functions
NYX 0:85b3fd62ea1a 89 *
NYX 0:85b3fd62ea1a 90 @verbatim
NYX 0:85b3fd62ea1a 91 ==============================================================================
NYX 0:85b3fd62ea1a 92 ##### Initialization and de-initialization functions #####
NYX 0:85b3fd62ea1a 93 ==============================================================================
NYX 0:85b3fd62ea1a 94 [..] This section provides functions allowing to:
NYX 0:85b3fd62ea1a 95 (+) Initialize the CRC according to the specified parameters
NYX 0:85b3fd62ea1a 96 in the CRC_InitTypeDef and create the associated handle
NYX 0:85b3fd62ea1a 97 (+) DeInitialize the CRC peripheral
NYX 0:85b3fd62ea1a 98 (+) Initialize the CRC MSP
NYX 0:85b3fd62ea1a 99 (+) DeInitialize CRC MSP
NYX 0:85b3fd62ea1a 100
NYX 0:85b3fd62ea1a 101 @endverbatim
NYX 0:85b3fd62ea1a 102 * @{
NYX 0:85b3fd62ea1a 103 */
NYX 0:85b3fd62ea1a 104
NYX 0:85b3fd62ea1a 105 /**
NYX 0:85b3fd62ea1a 106 * @brief Initializes the CRC according to the specified
NYX 0:85b3fd62ea1a 107 * parameters in the CRC_InitTypeDef and creates the associated handle.
NYX 0:85b3fd62ea1a 108 * @param hcrc: pointer to a CRC_HandleTypeDef structure that contains
NYX 0:85b3fd62ea1a 109 * the configuration information for CRC
NYX 0:85b3fd62ea1a 110 * @retval HAL status
NYX 0:85b3fd62ea1a 111 */
NYX 0:85b3fd62ea1a 112 HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc)
NYX 0:85b3fd62ea1a 113 {
NYX 0:85b3fd62ea1a 114 /* Check the CRC handle allocation */
NYX 0:85b3fd62ea1a 115 if(hcrc == NULL)
NYX 0:85b3fd62ea1a 116 {
NYX 0:85b3fd62ea1a 117 return HAL_ERROR;
NYX 0:85b3fd62ea1a 118 }
NYX 0:85b3fd62ea1a 119
NYX 0:85b3fd62ea1a 120 /* Check the parameters */
NYX 0:85b3fd62ea1a 121 assert_param(IS_CRC_ALL_INSTANCE(hcrc->Instance));
NYX 0:85b3fd62ea1a 122
NYX 0:85b3fd62ea1a 123 if(hcrc->State == HAL_CRC_STATE_RESET)
NYX 0:85b3fd62ea1a 124 {
NYX 0:85b3fd62ea1a 125 /* Allocate lock resource and initialize it */
NYX 0:85b3fd62ea1a 126 hcrc->Lock = HAL_UNLOCKED;
NYX 0:85b3fd62ea1a 127 /* Init the low level hardware */
NYX 0:85b3fd62ea1a 128 HAL_CRC_MspInit(hcrc);
NYX 0:85b3fd62ea1a 129 }
NYX 0:85b3fd62ea1a 130
NYX 0:85b3fd62ea1a 131 /* Change CRC peripheral state */
NYX 0:85b3fd62ea1a 132 hcrc->State = HAL_CRC_STATE_BUSY;
NYX 0:85b3fd62ea1a 133
NYX 0:85b3fd62ea1a 134 /* Change CRC peripheral state */
NYX 0:85b3fd62ea1a 135 hcrc->State = HAL_CRC_STATE_READY;
NYX 0:85b3fd62ea1a 136
NYX 0:85b3fd62ea1a 137 /* Return function status */
NYX 0:85b3fd62ea1a 138 return HAL_OK;
NYX 0:85b3fd62ea1a 139 }
NYX 0:85b3fd62ea1a 140
NYX 0:85b3fd62ea1a 141 /**
NYX 0:85b3fd62ea1a 142 * @brief DeInitializes the CRC peripheral.
NYX 0:85b3fd62ea1a 143 * @param hcrc: pointer to a CRC_HandleTypeDef structure that contains
NYX 0:85b3fd62ea1a 144 * the configuration information for CRC
NYX 0:85b3fd62ea1a 145 * @retval HAL status
NYX 0:85b3fd62ea1a 146 */
NYX 0:85b3fd62ea1a 147 HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc)
NYX 0:85b3fd62ea1a 148 {
NYX 0:85b3fd62ea1a 149 /* Check the CRC handle allocation */
NYX 0:85b3fd62ea1a 150 if(hcrc == NULL)
NYX 0:85b3fd62ea1a 151 {
NYX 0:85b3fd62ea1a 152 return HAL_ERROR;
NYX 0:85b3fd62ea1a 153 }
NYX 0:85b3fd62ea1a 154
NYX 0:85b3fd62ea1a 155 /* Check the parameters */
NYX 0:85b3fd62ea1a 156 assert_param(IS_CRC_ALL_INSTANCE(hcrc->Instance));
NYX 0:85b3fd62ea1a 157
NYX 0:85b3fd62ea1a 158 /* Change CRC peripheral state */
NYX 0:85b3fd62ea1a 159 hcrc->State = HAL_CRC_STATE_BUSY;
NYX 0:85b3fd62ea1a 160
NYX 0:85b3fd62ea1a 161 /* DeInit the low level hardware */
NYX 0:85b3fd62ea1a 162 HAL_CRC_MspDeInit(hcrc);
NYX 0:85b3fd62ea1a 163
NYX 0:85b3fd62ea1a 164 /* Change CRC peripheral state */
NYX 0:85b3fd62ea1a 165 hcrc->State = HAL_CRC_STATE_RESET;
NYX 0:85b3fd62ea1a 166
NYX 0:85b3fd62ea1a 167 /* Release Lock */
NYX 0:85b3fd62ea1a 168 __HAL_UNLOCK(hcrc);
NYX 0:85b3fd62ea1a 169
NYX 0:85b3fd62ea1a 170 /* Return function status */
NYX 0:85b3fd62ea1a 171 return HAL_OK;
NYX 0:85b3fd62ea1a 172 }
NYX 0:85b3fd62ea1a 173
NYX 0:85b3fd62ea1a 174 /**
NYX 0:85b3fd62ea1a 175 * @brief Initializes the CRC MSP.
NYX 0:85b3fd62ea1a 176 * @param hcrc: pointer to a CRC_HandleTypeDef structure that contains
NYX 0:85b3fd62ea1a 177 * the configuration information for CRC
NYX 0:85b3fd62ea1a 178 * @retval None
NYX 0:85b3fd62ea1a 179 */
NYX 0:85b3fd62ea1a 180 __weak void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc)
NYX 0:85b3fd62ea1a 181 {
NYX 0:85b3fd62ea1a 182 /* Prevent unused argument(s) compilation warning */
NYX 0:85b3fd62ea1a 183 UNUSED(hcrc);
NYX 0:85b3fd62ea1a 184 /* NOTE : This function Should not be modified, when the callback is needed,
NYX 0:85b3fd62ea1a 185 the HAL_CRC_MspInit could be implemented in the user file
NYX 0:85b3fd62ea1a 186 */
NYX 0:85b3fd62ea1a 187 }
NYX 0:85b3fd62ea1a 188
NYX 0:85b3fd62ea1a 189 /**
NYX 0:85b3fd62ea1a 190 * @brief DeInitializes the CRC MSP.
NYX 0:85b3fd62ea1a 191 * @param hcrc: pointer to a CRC_HandleTypeDef structure that contains
NYX 0:85b3fd62ea1a 192 * the configuration information for CRC
NYX 0:85b3fd62ea1a 193 * @retval None
NYX 0:85b3fd62ea1a 194 */
NYX 0:85b3fd62ea1a 195 __weak void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc)
NYX 0:85b3fd62ea1a 196 {
NYX 0:85b3fd62ea1a 197 /* Prevent unused argument(s) compilation warning */
NYX 0:85b3fd62ea1a 198 UNUSED(hcrc);
NYX 0:85b3fd62ea1a 199 /* NOTE : This function Should not be modified, when the callback is needed,
NYX 0:85b3fd62ea1a 200 the HAL_CRC_MspDeInit could be implemented in the user file
NYX 0:85b3fd62ea1a 201 */
NYX 0:85b3fd62ea1a 202 }
NYX 0:85b3fd62ea1a 203
NYX 0:85b3fd62ea1a 204 /**
NYX 0:85b3fd62ea1a 205 * @}
NYX 0:85b3fd62ea1a 206 */
NYX 0:85b3fd62ea1a 207
NYX 0:85b3fd62ea1a 208 /** @addtogroup CRC_Exported_Functions_Group2
NYX 0:85b3fd62ea1a 209 * @brief Peripheral Control functions
NYX 0:85b3fd62ea1a 210 *
NYX 0:85b3fd62ea1a 211 @verbatim
NYX 0:85b3fd62ea1a 212 ==============================================================================
NYX 0:85b3fd62ea1a 213 ##### Peripheral Control functions #####
NYX 0:85b3fd62ea1a 214 ==============================================================================
NYX 0:85b3fd62ea1a 215 [..] This section provides functions allowing to:
NYX 0:85b3fd62ea1a 216 (+) Compute the 32-bit CRC value of 32-bit data buffer,
NYX 0:85b3fd62ea1a 217 using combination of the previous CRC value and the new one.
NYX 0:85b3fd62ea1a 218 (+) Compute the 32-bit CRC value of 32-bit data buffer,
NYX 0:85b3fd62ea1a 219 independently of the previous CRC value.
NYX 0:85b3fd62ea1a 220
NYX 0:85b3fd62ea1a 221 @endverbatim
NYX 0:85b3fd62ea1a 222 * @{
NYX 0:85b3fd62ea1a 223 */
NYX 0:85b3fd62ea1a 224
NYX 0:85b3fd62ea1a 225 /**
NYX 0:85b3fd62ea1a 226 * @brief Computes the 32-bit CRC of 32-bit data buffer using combination
NYX 0:85b3fd62ea1a 227 * of the previous CRC value and the new one.
NYX 0:85b3fd62ea1a 228 * @param hcrc: pointer to a CRC_HandleTypeDef structure that contains
NYX 0:85b3fd62ea1a 229 * the configuration information for CRC
NYX 0:85b3fd62ea1a 230 * @param pBuffer: pointer to the buffer containing the data to be computed
NYX 0:85b3fd62ea1a 231 * @param BufferLength: length of the buffer to be computed
NYX 0:85b3fd62ea1a 232 * @retval 32-bit CRC
NYX 0:85b3fd62ea1a 233 */
NYX 0:85b3fd62ea1a 234 uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
NYX 0:85b3fd62ea1a 235 {
NYX 0:85b3fd62ea1a 236 uint32_t index = 0U;
NYX 0:85b3fd62ea1a 237
NYX 0:85b3fd62ea1a 238 /* Process Locked */
NYX 0:85b3fd62ea1a 239 __HAL_LOCK(hcrc);
NYX 0:85b3fd62ea1a 240
NYX 0:85b3fd62ea1a 241 /* Change CRC peripheral state */
NYX 0:85b3fd62ea1a 242 hcrc->State = HAL_CRC_STATE_BUSY;
NYX 0:85b3fd62ea1a 243
NYX 0:85b3fd62ea1a 244 /* Enter Data to the CRC calculator */
NYX 0:85b3fd62ea1a 245 for(index = 0U; index < BufferLength; index++)
NYX 0:85b3fd62ea1a 246 {
NYX 0:85b3fd62ea1a 247 hcrc->Instance->DR = pBuffer[index];
NYX 0:85b3fd62ea1a 248 }
NYX 0:85b3fd62ea1a 249
NYX 0:85b3fd62ea1a 250 /* Change CRC peripheral state */
NYX 0:85b3fd62ea1a 251 hcrc->State = HAL_CRC_STATE_READY;
NYX 0:85b3fd62ea1a 252
NYX 0:85b3fd62ea1a 253 /* Process Unlocked */
NYX 0:85b3fd62ea1a 254 __HAL_UNLOCK(hcrc);
NYX 0:85b3fd62ea1a 255
NYX 0:85b3fd62ea1a 256 /* Return the CRC computed value */
NYX 0:85b3fd62ea1a 257 return hcrc->Instance->DR;
NYX 0:85b3fd62ea1a 258 }
NYX 0:85b3fd62ea1a 259
NYX 0:85b3fd62ea1a 260 /**
NYX 0:85b3fd62ea1a 261 * @brief Computes the 32-bit CRC of 32-bit data buffer independently
NYX 0:85b3fd62ea1a 262 * of the previous CRC value.
NYX 0:85b3fd62ea1a 263 * @param hcrc: pointer to a CRC_HandleTypeDef structure that contains
NYX 0:85b3fd62ea1a 264 * the configuration information for CRC
NYX 0:85b3fd62ea1a 265 * @param pBuffer: Pointer to the buffer containing the data to be computed
NYX 0:85b3fd62ea1a 266 * @param BufferLength: Length of the buffer to be computed
NYX 0:85b3fd62ea1a 267 * @retval 32-bit CRC
NYX 0:85b3fd62ea1a 268 */
NYX 0:85b3fd62ea1a 269 uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
NYX 0:85b3fd62ea1a 270 {
NYX 0:85b3fd62ea1a 271 uint32_t index = 0U;
NYX 0:85b3fd62ea1a 272
NYX 0:85b3fd62ea1a 273 /* Process Locked */
NYX 0:85b3fd62ea1a 274 __HAL_LOCK(hcrc);
NYX 0:85b3fd62ea1a 275
NYX 0:85b3fd62ea1a 276 /* Change CRC peripheral state */
NYX 0:85b3fd62ea1a 277 hcrc->State = HAL_CRC_STATE_BUSY;
NYX 0:85b3fd62ea1a 278
NYX 0:85b3fd62ea1a 279 /* Reset CRC Calculation Unit */
NYX 0:85b3fd62ea1a 280 __HAL_CRC_DR_RESET(hcrc);
NYX 0:85b3fd62ea1a 281
NYX 0:85b3fd62ea1a 282 /* Enter Data to the CRC calculator */
NYX 0:85b3fd62ea1a 283 for(index = 0U; index < BufferLength; index++)
NYX 0:85b3fd62ea1a 284 {
NYX 0:85b3fd62ea1a 285 hcrc->Instance->DR = pBuffer[index];
NYX 0:85b3fd62ea1a 286 }
NYX 0:85b3fd62ea1a 287
NYX 0:85b3fd62ea1a 288 /* Change CRC peripheral state */
NYX 0:85b3fd62ea1a 289 hcrc->State = HAL_CRC_STATE_READY;
NYX 0:85b3fd62ea1a 290
NYX 0:85b3fd62ea1a 291 /* Process Unlocked */
NYX 0:85b3fd62ea1a 292 __HAL_UNLOCK(hcrc);
NYX 0:85b3fd62ea1a 293
NYX 0:85b3fd62ea1a 294 /* Return the CRC computed value */
NYX 0:85b3fd62ea1a 295 return hcrc->Instance->DR;
NYX 0:85b3fd62ea1a 296 }
NYX 0:85b3fd62ea1a 297
NYX 0:85b3fd62ea1a 298 /**
NYX 0:85b3fd62ea1a 299 * @}
NYX 0:85b3fd62ea1a 300 */
NYX 0:85b3fd62ea1a 301
NYX 0:85b3fd62ea1a 302
NYX 0:85b3fd62ea1a 303 /** @addtogroup CRC_Exported_Functions_Group3
NYX 0:85b3fd62ea1a 304 * @brief Peripheral State functions
NYX 0:85b3fd62ea1a 305 *
NYX 0:85b3fd62ea1a 306 @verbatim
NYX 0:85b3fd62ea1a 307 ==============================================================================
NYX 0:85b3fd62ea1a 308 ##### Peripheral State functions #####
NYX 0:85b3fd62ea1a 309 ==============================================================================
NYX 0:85b3fd62ea1a 310 [..]
NYX 0:85b3fd62ea1a 311 This subsection permits to get in run-time the status of the peripheral
NYX 0:85b3fd62ea1a 312 and the data flow.
NYX 0:85b3fd62ea1a 313
NYX 0:85b3fd62ea1a 314 @endverbatim
NYX 0:85b3fd62ea1a 315 * @{
NYX 0:85b3fd62ea1a 316 */
NYX 0:85b3fd62ea1a 317
NYX 0:85b3fd62ea1a 318 /**
NYX 0:85b3fd62ea1a 319 * @brief Returns the CRC state.
NYX 0:85b3fd62ea1a 320 * @param hcrc: pointer to a CRC_HandleTypeDef structure that contains
NYX 0:85b3fd62ea1a 321 * the configuration information for CRC
NYX 0:85b3fd62ea1a 322 * @retval HAL state
NYX 0:85b3fd62ea1a 323 */
NYX 0:85b3fd62ea1a 324 HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc)
NYX 0:85b3fd62ea1a 325 {
NYX 0:85b3fd62ea1a 326 return hcrc->State;
NYX 0:85b3fd62ea1a 327 }
NYX 0:85b3fd62ea1a 328
NYX 0:85b3fd62ea1a 329 /**
NYX 0:85b3fd62ea1a 330 * @}
NYX 0:85b3fd62ea1a 331 */
NYX 0:85b3fd62ea1a 332
NYX 0:85b3fd62ea1a 333 /**
NYX 0:85b3fd62ea1a 334 * @}
NYX 0:85b3fd62ea1a 335 */
NYX 0:85b3fd62ea1a 336
NYX 0:85b3fd62ea1a 337 #endif /* HAL_CRC_MODULE_ENABLED */
NYX 0:85b3fd62ea1a 338 /**
NYX 0:85b3fd62ea1a 339 * @}
NYX 0:85b3fd62ea1a 340 */
NYX 0:85b3fd62ea1a 341
NYX 0:85b3fd62ea1a 342 /**
NYX 0:85b3fd62ea1a 343 * @}
NYX 0:85b3fd62ea1a 344 */
NYX 0:85b3fd62ea1a 345
NYX 0:85b3fd62ea1a 346 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/