mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Nov 03 10:30:07 2014 +0000
Revision:
381:5460fc57b6e4
Synchronized with git revision 02478cd1f27fc7b9643486472635eb515b2bca81

Full URL: https://github.com/mbedmicro/mbed/commit/02478cd1f27fc7b9643486472635eb515b2bca81/

Target: LPC1549 - Fix serial interrupt issues (issue report #616)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 381:5460fc57b6e4 1 /**
mbed_official 381:5460fc57b6e4 2 ******************************************************************************
mbed_official 381:5460fc57b6e4 3 * @file stm32f3xx_hal_crc.h
mbed_official 381:5460fc57b6e4 4 * @author MCD Application Team
mbed_official 381:5460fc57b6e4 5 * @version V1.1.0
mbed_official 381:5460fc57b6e4 6 * @date 12-Sept-2014
mbed_official 381:5460fc57b6e4 7 * @brief Header file of CRC HAL module.
mbed_official 381:5460fc57b6e4 8 ******************************************************************************
mbed_official 381:5460fc57b6e4 9 * @attention
mbed_official 381:5460fc57b6e4 10 *
mbed_official 381:5460fc57b6e4 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 381:5460fc57b6e4 12 *
mbed_official 381:5460fc57b6e4 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 381:5460fc57b6e4 14 * are permitted provided that the following conditions are met:
mbed_official 381:5460fc57b6e4 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 381:5460fc57b6e4 16 * this list of conditions and the following disclaimer.
mbed_official 381:5460fc57b6e4 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 381:5460fc57b6e4 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 381:5460fc57b6e4 19 * and/or other materials provided with the distribution.
mbed_official 381:5460fc57b6e4 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 381:5460fc57b6e4 21 * may be used to endorse or promote products derived from this software
mbed_official 381:5460fc57b6e4 22 * without specific prior written permission.
mbed_official 381:5460fc57b6e4 23 *
mbed_official 381:5460fc57b6e4 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 381:5460fc57b6e4 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 381:5460fc57b6e4 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 381:5460fc57b6e4 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 381:5460fc57b6e4 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 381:5460fc57b6e4 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 381:5460fc57b6e4 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 381:5460fc57b6e4 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 381:5460fc57b6e4 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 381:5460fc57b6e4 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 381:5460fc57b6e4 34 *
mbed_official 381:5460fc57b6e4 35 ******************************************************************************
mbed_official 381:5460fc57b6e4 36 */
mbed_official 381:5460fc57b6e4 37
mbed_official 381:5460fc57b6e4 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 381:5460fc57b6e4 39 #ifndef __STM32F3xx_HAL_CRC_H
mbed_official 381:5460fc57b6e4 40 #define __STM32F3xx_HAL_CRC_H
mbed_official 381:5460fc57b6e4 41
mbed_official 381:5460fc57b6e4 42 #ifdef __cplusplus
mbed_official 381:5460fc57b6e4 43 extern "C" {
mbed_official 381:5460fc57b6e4 44 #endif
mbed_official 381:5460fc57b6e4 45
mbed_official 381:5460fc57b6e4 46 /* Includes ------------------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 47 #include "stm32f3xx_hal_def.h"
mbed_official 381:5460fc57b6e4 48
mbed_official 381:5460fc57b6e4 49 /** @addtogroup STM32F3xx_HAL_Driver
mbed_official 381:5460fc57b6e4 50 * @{
mbed_official 381:5460fc57b6e4 51 */
mbed_official 381:5460fc57b6e4 52
mbed_official 381:5460fc57b6e4 53 /** @addtogroup CRC
mbed_official 381:5460fc57b6e4 54 * @{
mbed_official 381:5460fc57b6e4 55 */
mbed_official 381:5460fc57b6e4 56
mbed_official 381:5460fc57b6e4 57 /* Exported types ------------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 58 /** @defgroup CRC_Exported_Types CRC Exported Types
mbed_official 381:5460fc57b6e4 59 * @{
mbed_official 381:5460fc57b6e4 60 */
mbed_official 381:5460fc57b6e4 61
mbed_official 381:5460fc57b6e4 62 /**
mbed_official 381:5460fc57b6e4 63 * @brief CRC HAL State Structure definition
mbed_official 381:5460fc57b6e4 64 */
mbed_official 381:5460fc57b6e4 65 typedef enum
mbed_official 381:5460fc57b6e4 66 {
mbed_official 381:5460fc57b6e4 67 HAL_CRC_STATE_RESET = 0x00, /*!< CRC not yet initialized or disabled */
mbed_official 381:5460fc57b6e4 68 HAL_CRC_STATE_READY = 0x01, /*!< CRC initialized and ready for use */
mbed_official 381:5460fc57b6e4 69 HAL_CRC_STATE_BUSY = 0x02, /*!< CRC internal process is ongoing */
mbed_official 381:5460fc57b6e4 70 HAL_CRC_STATE_TIMEOUT = 0x03, /*!< CRC timeout state */
mbed_official 381:5460fc57b6e4 71 HAL_CRC_STATE_ERROR = 0x04 /*!< CRC error state */
mbed_official 381:5460fc57b6e4 72 }HAL_CRC_StateTypeDef;
mbed_official 381:5460fc57b6e4 73
mbed_official 381:5460fc57b6e4 74
mbed_official 381:5460fc57b6e4 75 /**
mbed_official 381:5460fc57b6e4 76 * @brief CRC Init Structure definition
mbed_official 381:5460fc57b6e4 77 */
mbed_official 381:5460fc57b6e4 78 typedef struct
mbed_official 381:5460fc57b6e4 79 {
mbed_official 381:5460fc57b6e4 80 uint8_t DefaultPolynomialUse; /*!< This parameter is a value of @ref CRC_Default_Polynomial and indicates if default polynomial is used.
mbed_official 381:5460fc57b6e4 81 If set to DEFAULT_POLYNOMIAL_ENABLE, resort to default
mbed_official 381:5460fc57b6e4 82 X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 +X^8 + X^7 + X^5 + X^4 + X^2+ X +1.
mbed_official 381:5460fc57b6e4 83 In that case, there is no need to set GeneratingPolynomial field.
mbed_official 381:5460fc57b6e4 84 If otherwise set to DEFAULT_POLYNOMIAL_DISABLE, GeneratingPolynomial and CRCLength fields must be set */
mbed_official 381:5460fc57b6e4 85
mbed_official 381:5460fc57b6e4 86 uint8_t DefaultInitValueUse; /*!< This parameter is a value of @ref CRC_Default_InitValue_Use and indicates if default init value is used.
mbed_official 381:5460fc57b6e4 87 If set to DEFAULT_INIT_VALUE_ENABLE, resort to default
mbed_official 381:5460fc57b6e4 88 0xFFFFFFFF value. In that case, there is no need to set InitValue field.
mbed_official 381:5460fc57b6e4 89 If otherwise set to DEFAULT_INIT_VALUE_DISABLE, InitValue field must be set */
mbed_official 381:5460fc57b6e4 90
mbed_official 381:5460fc57b6e4 91 uint32_t GeneratingPolynomial; /*!< Set CRC generating polynomial. 7, 8, 16 or 32-bit long value for a polynomial degree
mbed_official 381:5460fc57b6e4 92 respectively equal to 7, 8, 16 or 32. This field is written in normal representation,
mbed_official 381:5460fc57b6e4 93 e.g., for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1 is written 0x65.
mbed_official 381:5460fc57b6e4 94 No need to specify it if DefaultPolynomialUse is set to DEFAULT_POLYNOMIAL_ENABLE */
mbed_official 381:5460fc57b6e4 95
mbed_official 381:5460fc57b6e4 96 uint32_t CRCLength; /*!< This parameter is a value of @ref CRC_Polynomial_Size_Definitions and indicates CRC length.
mbed_official 381:5460fc57b6e4 97 Value can be either one of
mbed_official 381:5460fc57b6e4 98 CRC_POLYLENGTH_32B (32-bit CRC)
mbed_official 381:5460fc57b6e4 99 CRC_POLYLENGTH_16B (16-bit CRC)
mbed_official 381:5460fc57b6e4 100 CRC_POLYLENGTH_8B (8-bit CRC)
mbed_official 381:5460fc57b6e4 101 CRC_POLYLENGTH_7B (7-bit CRC) */
mbed_official 381:5460fc57b6e4 102
mbed_official 381:5460fc57b6e4 103 uint32_t InitValue; /*!< Init value to initiate CRC computation. No need to specify it if DefaultInitValueUse
mbed_official 381:5460fc57b6e4 104 is set to DEFAULT_INIT_VALUE_ENABLE */
mbed_official 381:5460fc57b6e4 105
mbed_official 381:5460fc57b6e4 106 uint32_t InputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Input_Data_Inversion and specifies input data inversion mode.
mbed_official 381:5460fc57b6e4 107 Can be either one of the following values
mbed_official 381:5460fc57b6e4 108 CRC_INPUTDATA_INVERSION_NONE no input data inversion
mbed_official 381:5460fc57b6e4 109 CRC_INPUTDATA_INVERSION_BYTE byte-wise inversion, 0x1A2B3C4D becomes 0x58D43CB2
mbed_official 381:5460fc57b6e4 110 CRC_INPUTDATA_INVERSION_HALFWORD halfword-wise inversion, 0x1A2B3C4D becomes 0xD458B23C
mbed_official 381:5460fc57b6e4 111 CRC_INPUTDATA_INVERSION_WORD word-wise inversion, 0x1A2B3C4D becomes 0xB23CD458 */
mbed_official 381:5460fc57b6e4 112
mbed_official 381:5460fc57b6e4 113 uint32_t OutputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Output_Data_Inversion and specifies output data (i.e. CRC) inversion mode.
mbed_official 381:5460fc57b6e4 114 Can be either
mbed_official 381:5460fc57b6e4 115 CRC_OUTPUTDATA_INVERSION_DISABLED no CRC inversion, or
mbed_official 381:5460fc57b6e4 116 CRC_OUTPUTDATA_INVERSION_ENABLED CRC 0x11223344 is converted into 0x22CC4488 */
mbed_official 381:5460fc57b6e4 117 }CRC_InitTypeDef;
mbed_official 381:5460fc57b6e4 118
mbed_official 381:5460fc57b6e4 119
mbed_official 381:5460fc57b6e4 120 /**
mbed_official 381:5460fc57b6e4 121 * @brief CRC Handle Structure definition
mbed_official 381:5460fc57b6e4 122 */
mbed_official 381:5460fc57b6e4 123 typedef struct
mbed_official 381:5460fc57b6e4 124 {
mbed_official 381:5460fc57b6e4 125 CRC_TypeDef *Instance; /*!< Register base address */
mbed_official 381:5460fc57b6e4 126
mbed_official 381:5460fc57b6e4 127 CRC_InitTypeDef Init; /*!< CRC configuration parameters */
mbed_official 381:5460fc57b6e4 128
mbed_official 381:5460fc57b6e4 129 HAL_LockTypeDef Lock; /*!< CRC Locking object */
mbed_official 381:5460fc57b6e4 130
mbed_official 381:5460fc57b6e4 131 __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */
mbed_official 381:5460fc57b6e4 132
mbed_official 381:5460fc57b6e4 133 uint32_t InputDataFormat; /*!< This parameter is a value of @ref CRC_Input_Buffer_Format and specifies input data format.
mbed_official 381:5460fc57b6e4 134 Can be either
mbed_official 381:5460fc57b6e4 135 CRC_INPUTDATA_FORMAT_BYTES input data is a stream of bytes (8-bit data)
mbed_official 381:5460fc57b6e4 136 CRC_INPUTDATA_FORMAT_HALFWORDS input data is a stream of half-words (16-bit data)
mbed_official 381:5460fc57b6e4 137 CRC_INPUTDATA_FORMAT_WORDS input data is a stream of words (32-bits data)
mbed_official 381:5460fc57b6e4 138 Note that constant CRC_INPUT_FORMAT_UNDEFINED is defined but an initialization error
mbed_official 381:5460fc57b6e4 139 must occur if InputBufferFormat is not one of the three values listed above */
mbed_official 381:5460fc57b6e4 140 }CRC_HandleTypeDef;
mbed_official 381:5460fc57b6e4 141
mbed_official 381:5460fc57b6e4 142 /**
mbed_official 381:5460fc57b6e4 143 * @}
mbed_official 381:5460fc57b6e4 144 */
mbed_official 381:5460fc57b6e4 145
mbed_official 381:5460fc57b6e4 146 /* Exported constants --------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 147 /** @defgroup CRC_Exported_Constants CRC Exported Constants
mbed_official 381:5460fc57b6e4 148 * @{
mbed_official 381:5460fc57b6e4 149 */
mbed_official 381:5460fc57b6e4 150
mbed_official 381:5460fc57b6e4 151 /** @defgroup CRC_Default_Polynomial_Value Default CRC generating polynomial
mbed_official 381:5460fc57b6e4 152 * @{
mbed_official 381:5460fc57b6e4 153 */
mbed_official 381:5460fc57b6e4 154 #define DEFAULT_CRC32_POLY 0x04C11DB7
mbed_official 381:5460fc57b6e4 155
mbed_official 381:5460fc57b6e4 156 /**
mbed_official 381:5460fc57b6e4 157 * @}
mbed_official 381:5460fc57b6e4 158 */
mbed_official 381:5460fc57b6e4 159
mbed_official 381:5460fc57b6e4 160 /** @defgroup CRC_Default_InitValue Default CRC computation initialization value
mbed_official 381:5460fc57b6e4 161 * @{
mbed_official 381:5460fc57b6e4 162 */
mbed_official 381:5460fc57b6e4 163 #define DEFAULT_CRC_INITVALUE 0xFFFFFFFF
mbed_official 381:5460fc57b6e4 164
mbed_official 381:5460fc57b6e4 165 /**
mbed_official 381:5460fc57b6e4 166 * @}
mbed_official 381:5460fc57b6e4 167 */
mbed_official 381:5460fc57b6e4 168
mbed_official 381:5460fc57b6e4 169 /** @defgroup CRC_Default_Polynomial Indicates whether or not default polynomial is used
mbed_official 381:5460fc57b6e4 170 * @{
mbed_official 381:5460fc57b6e4 171 */
mbed_official 381:5460fc57b6e4 172 #define DEFAULT_POLYNOMIAL_ENABLE ((uint8_t)0x00)
mbed_official 381:5460fc57b6e4 173 #define DEFAULT_POLYNOMIAL_DISABLE ((uint8_t)0x01)
mbed_official 381:5460fc57b6e4 174
mbed_official 381:5460fc57b6e4 175 #define IS_DEFAULT_POLYNOMIAL(DEFAULT) (((DEFAULT) == DEFAULT_POLYNOMIAL_ENABLE) || \
mbed_official 381:5460fc57b6e4 176 ((DEFAULT) == DEFAULT_POLYNOMIAL_DISABLE))
mbed_official 381:5460fc57b6e4 177
mbed_official 381:5460fc57b6e4 178 /**
mbed_official 381:5460fc57b6e4 179 * @}
mbed_official 381:5460fc57b6e4 180 */
mbed_official 381:5460fc57b6e4 181
mbed_official 381:5460fc57b6e4 182 /** @defgroup CRC_Default_InitValue_Use Indicates whether or not default init value is used
mbed_official 381:5460fc57b6e4 183 * @{
mbed_official 381:5460fc57b6e4 184 */
mbed_official 381:5460fc57b6e4 185 #define DEFAULT_INIT_VALUE_ENABLE ((uint8_t)0x00)
mbed_official 381:5460fc57b6e4 186 #define DEFAULT_INIT_VALUE_DISABLE ((uint8_t)0x01)
mbed_official 381:5460fc57b6e4 187
mbed_official 381:5460fc57b6e4 188 #define IS_DEFAULT_INIT_VALUE(VALUE) (((VALUE) == DEFAULT_INIT_VALUE_ENABLE) || \
mbed_official 381:5460fc57b6e4 189 ((VALUE) == DEFAULT_INIT_VALUE_DISABLE))
mbed_official 381:5460fc57b6e4 190
mbed_official 381:5460fc57b6e4 191 /**
mbed_official 381:5460fc57b6e4 192 * @}
mbed_official 381:5460fc57b6e4 193 */
mbed_official 381:5460fc57b6e4 194
mbed_official 381:5460fc57b6e4 195 /** @defgroup CRC_Polynomial_Sizes Polynomial sizes to configure the IP
mbed_official 381:5460fc57b6e4 196 * @{
mbed_official 381:5460fc57b6e4 197 */
mbed_official 381:5460fc57b6e4 198 #define CRC_POLYLENGTH_32B ((uint32_t)0x00000000)
mbed_official 381:5460fc57b6e4 199 #define CRC_POLYLENGTH_16B ((uint32_t)CRC_CR_POLYSIZE_0)
mbed_official 381:5460fc57b6e4 200 #define CRC_POLYLENGTH_8B ((uint32_t)CRC_CR_POLYSIZE_1)
mbed_official 381:5460fc57b6e4 201 #define CRC_POLYLENGTH_7B ((uint32_t)CRC_CR_POLYSIZE)
mbed_official 381:5460fc57b6e4 202 #define IS_CRC_POL_LENGTH(LENGTH) (((LENGTH) == CRC_POLYLENGTH_32B) || \
mbed_official 381:5460fc57b6e4 203 ((LENGTH) == CRC_POLYLENGTH_16B) || \
mbed_official 381:5460fc57b6e4 204 ((LENGTH) == CRC_POLYLENGTH_8B) || \
mbed_official 381:5460fc57b6e4 205 ((LENGTH) == CRC_POLYLENGTH_7B))
mbed_official 381:5460fc57b6e4 206 /**
mbed_official 381:5460fc57b6e4 207 * @}
mbed_official 381:5460fc57b6e4 208 */
mbed_official 381:5460fc57b6e4 209
mbed_official 381:5460fc57b6e4 210 /** @defgroup CRC_Polynomial_Size_Definitions CRC polynomial possible sizes actual definitions
mbed_official 381:5460fc57b6e4 211 * @{
mbed_official 381:5460fc57b6e4 212 */
mbed_official 381:5460fc57b6e4 213 #define HAL_CRC_LENGTH_32B 32
mbed_official 381:5460fc57b6e4 214 #define HAL_CRC_LENGTH_16B 16
mbed_official 381:5460fc57b6e4 215 #define HAL_CRC_LENGTH_8B 8
mbed_official 381:5460fc57b6e4 216 #define HAL_CRC_LENGTH_7B 7
mbed_official 381:5460fc57b6e4 217
mbed_official 381:5460fc57b6e4 218 /**
mbed_official 381:5460fc57b6e4 219 * @}
mbed_official 381:5460fc57b6e4 220 */
mbed_official 381:5460fc57b6e4 221
mbed_official 381:5460fc57b6e4 222 /** @defgroup CRC_Input_Buffer_Format Input Buffer Format
mbed_official 381:5460fc57b6e4 223 * @{
mbed_official 381:5460fc57b6e4 224 */
mbed_official 381:5460fc57b6e4 225 /* WARNING: CRC_INPUT_FORMAT_UNDEFINED is created for reference purposes but
mbed_official 381:5460fc57b6e4 226 * an error is triggered in HAL_CRC_Init() if InputDataFormat field is set
mbed_official 381:5460fc57b6e4 227 * to CRC_INPUT_FORMAT_UNDEFINED: the format MUST be defined by the user for
mbed_official 381:5460fc57b6e4 228 * the CRC APIs to provide a correct result */
mbed_official 381:5460fc57b6e4 229 #define CRC_INPUTDATA_FORMAT_UNDEFINED ((uint32_t)0x00000000)
mbed_official 381:5460fc57b6e4 230 #define CRC_INPUTDATA_FORMAT_BYTES ((uint32_t)0x00000001)
mbed_official 381:5460fc57b6e4 231 #define CRC_INPUTDATA_FORMAT_HALFWORDS ((uint32_t)0x00000002)
mbed_official 381:5460fc57b6e4 232 #define CRC_INPUTDATA_FORMAT_WORDS ((uint32_t)0x00000003)
mbed_official 381:5460fc57b6e4 233
mbed_official 381:5460fc57b6e4 234 #define IS_CRC_INPUTDATA_FORMAT(FORMAT) (((FORMAT) == CRC_INPUTDATA_FORMAT_BYTES) || \
mbed_official 381:5460fc57b6e4 235 ((FORMAT) == CRC_INPUTDATA_FORMAT_HALFWORDS) || \
mbed_official 381:5460fc57b6e4 236 ((FORMAT) == CRC_INPUTDATA_FORMAT_WORDS))
mbed_official 381:5460fc57b6e4 237 /**
mbed_official 381:5460fc57b6e4 238 * @}
mbed_official 381:5460fc57b6e4 239 */
mbed_official 381:5460fc57b6e4 240
mbed_official 381:5460fc57b6e4 241 /**
mbed_official 381:5460fc57b6e4 242 * @}
mbed_official 381:5460fc57b6e4 243 */
mbed_official 381:5460fc57b6e4 244
mbed_official 381:5460fc57b6e4 245 /* Exported macros -----------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 246
mbed_official 381:5460fc57b6e4 247 /** @defgroup CRC_Exported_Macros CRC Exported Macros
mbed_official 381:5460fc57b6e4 248 * @{
mbed_official 381:5460fc57b6e4 249 */
mbed_official 381:5460fc57b6e4 250
mbed_official 381:5460fc57b6e4 251 /** @brief Reset CRC handle state
mbed_official 381:5460fc57b6e4 252 * @param __HANDLE__: CRC handle.
mbed_official 381:5460fc57b6e4 253 * @retval None
mbed_official 381:5460fc57b6e4 254 */
mbed_official 381:5460fc57b6e4 255 #define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET)
mbed_official 381:5460fc57b6e4 256
mbed_official 381:5460fc57b6e4 257 /**
mbed_official 381:5460fc57b6e4 258 * @brief Reset CRC Data Register.
mbed_official 381:5460fc57b6e4 259 * @param __HANDLE__: CRC handle
mbed_official 381:5460fc57b6e4 260 * @retval None.
mbed_official 381:5460fc57b6e4 261 */
mbed_official 381:5460fc57b6e4 262 #define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET)
mbed_official 381:5460fc57b6e4 263
mbed_official 381:5460fc57b6e4 264 /**
mbed_official 381:5460fc57b6e4 265 * @brief Set CRC INIT non-default value
mbed_official 381:5460fc57b6e4 266 * @param __HANDLE__ : CRC handle
mbed_official 381:5460fc57b6e4 267 * @param __INIT__ : 32-bit initial value
mbed_official 381:5460fc57b6e4 268 * @retval None.
mbed_official 381:5460fc57b6e4 269 */
mbed_official 381:5460fc57b6e4 270 #define __HAL_CRC_INITIALCRCVALUE_CONFIG(__HANDLE__, __INIT__) ((__HANDLE__)->Instance->INIT = (__INIT__))
mbed_official 381:5460fc57b6e4 271
mbed_official 381:5460fc57b6e4 272 /**
mbed_official 381:5460fc57b6e4 273 * @}
mbed_official 381:5460fc57b6e4 274 */
mbed_official 381:5460fc57b6e4 275
mbed_official 381:5460fc57b6e4 276
mbed_official 381:5460fc57b6e4 277 /* Include CRC HAL Extended module */
mbed_official 381:5460fc57b6e4 278 #include "stm32f3xx_hal_crc_ex.h"
mbed_official 381:5460fc57b6e4 279
mbed_official 381:5460fc57b6e4 280 /* Exported functions --------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 281 /** @addtogroup CRC_Exported_Functions CRC Exported Functions
mbed_official 381:5460fc57b6e4 282 * @{
mbed_official 381:5460fc57b6e4 283 */
mbed_official 381:5460fc57b6e4 284
mbed_official 381:5460fc57b6e4 285 /** @addtogroup CRC_Exported_Functions_Group1 Initialization and de-initialization functions
mbed_official 381:5460fc57b6e4 286 * @brief Initialization and Configuration functions.
mbed_official 381:5460fc57b6e4 287 * @{
mbed_official 381:5460fc57b6e4 288 */
mbed_official 381:5460fc57b6e4 289 /* Initialization and de-initialization functions ****************************/
mbed_official 381:5460fc57b6e4 290 HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc);
mbed_official 381:5460fc57b6e4 291 HAL_StatusTypeDef HAL_CRC_DeInit (CRC_HandleTypeDef *hcrc);
mbed_official 381:5460fc57b6e4 292 void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc);
mbed_official 381:5460fc57b6e4 293 void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc);
mbed_official 381:5460fc57b6e4 294 /**
mbed_official 381:5460fc57b6e4 295 * @}
mbed_official 381:5460fc57b6e4 296 */
mbed_official 381:5460fc57b6e4 297
mbed_official 381:5460fc57b6e4 298 /** @addtogroup CRC_Exported_Functions_Group2 Peripheral Control functions
mbed_official 381:5460fc57b6e4 299 * @brief management functions.
mbed_official 381:5460fc57b6e4 300 * @{
mbed_official 381:5460fc57b6e4 301 */
mbed_official 381:5460fc57b6e4 302 /* Peripheral Control functions ***********************************************/
mbed_official 381:5460fc57b6e4 303 uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
mbed_official 381:5460fc57b6e4 304 uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
mbed_official 381:5460fc57b6e4 305 /**
mbed_official 381:5460fc57b6e4 306 * @}
mbed_official 381:5460fc57b6e4 307 */
mbed_official 381:5460fc57b6e4 308
mbed_official 381:5460fc57b6e4 309 /** @addtogroup CRC_Exported_Functions_Group3 Peripheral State functions
mbed_official 381:5460fc57b6e4 310 * @brief Peripheral State functions.
mbed_official 381:5460fc57b6e4 311 * @{
mbed_official 381:5460fc57b6e4 312 */
mbed_official 381:5460fc57b6e4 313 /* Peripheral State and Error functions ***************************************/
mbed_official 381:5460fc57b6e4 314 HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc);
mbed_official 381:5460fc57b6e4 315 /**
mbed_official 381:5460fc57b6e4 316 * @}
mbed_official 381:5460fc57b6e4 317 */
mbed_official 381:5460fc57b6e4 318
mbed_official 381:5460fc57b6e4 319 /**
mbed_official 381:5460fc57b6e4 320 * @}
mbed_official 381:5460fc57b6e4 321 */
mbed_official 381:5460fc57b6e4 322
mbed_official 381:5460fc57b6e4 323 /** @defgroup HAL_CRC_Alias_Exported_Functions CRC aliases for Exported Functions
mbed_official 381:5460fc57b6e4 324 * @{
mbed_official 381:5460fc57b6e4 325 */
mbed_official 381:5460fc57b6e4 326 /* Aliases for inter STM32 series compatibility */
mbed_official 381:5460fc57b6e4 327 #define HAL_CRC_Input_Data_Reverse HAL_CRCEx_Input_Data_Reverse
mbed_official 381:5460fc57b6e4 328 #define HAL_CRC_Output_Data_Reverse HAL_CRCEx_Output_Data_Reverse
mbed_official 381:5460fc57b6e4 329 /**
mbed_official 381:5460fc57b6e4 330 * @}
mbed_official 381:5460fc57b6e4 331 */
mbed_official 381:5460fc57b6e4 332
mbed_official 381:5460fc57b6e4 333 /**
mbed_official 381:5460fc57b6e4 334 * @}
mbed_official 381:5460fc57b6e4 335 */
mbed_official 381:5460fc57b6e4 336
mbed_official 381:5460fc57b6e4 337 /**
mbed_official 381:5460fc57b6e4 338 * @}
mbed_official 381:5460fc57b6e4 339 */
mbed_official 381:5460fc57b6e4 340
mbed_official 381:5460fc57b6e4 341 #ifdef __cplusplus
mbed_official 381:5460fc57b6e4 342 }
mbed_official 381:5460fc57b6e4 343 #endif
mbed_official 381:5460fc57b6e4 344
mbed_official 381:5460fc57b6e4 345 #endif /* __STM32F3xx_HAL_CRC_H */
mbed_official 381:5460fc57b6e4 346
mbed_official 381:5460fc57b6e4 347 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/