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