Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Mar 15 14:34:00 2016 +0000
Revision:
116:c0f6e94411f5
Parent:
115:87f2f5183dfb
Release 116 of the mbed library

Changes:
- new targets - NUCLEO_L073RZ
- fixes to IOTSS BEID platform
- LPC824, LPC1549 and LPC11U68 - fix PWMOut SCT bugs
- STM32F7 - Cube driver
- STM32F4 - add RTC LSI macro, defined as 0
- STM32F3 - fix multiple ADC clock initialization
- retarget - binary mode fix for GCC

Who changed what in which revision?

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