mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Parent:
394:83f921546702
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

Full URL: https://github.com/mbedmicro/mbed/commit/d5b4d2ab9c47edb4dc5776e7177b0c2263459081/

Initial version of drivers for SAMR21

Who changed what in which revision?

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