inport from local

Dependents:   Hobbyking_Cheetah_0511

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

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NYX 0:85b3fd62ea1a 1 /**
NYX 0:85b3fd62ea1a 2 ******************************************************************************
NYX 0:85b3fd62ea1a 3 * @file stm32f4xx_hal_crc.h
NYX 0:85b3fd62ea1a 4 * @author MCD Application Team
NYX 0:85b3fd62ea1a 5 * @version V1.7.1
NYX 0:85b3fd62ea1a 6 * @date 14-April-2017
NYX 0:85b3fd62ea1a 7 * @brief Header file of CRC HAL module.
NYX 0:85b3fd62ea1a 8 ******************************************************************************
NYX 0:85b3fd62ea1a 9 * @attention
NYX 0:85b3fd62ea1a 10 *
NYX 0:85b3fd62ea1a 11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
NYX 0:85b3fd62ea1a 12 *
NYX 0:85b3fd62ea1a 13 * Redistribution and use in source and binary forms, with or without modification,
NYX 0:85b3fd62ea1a 14 * are permitted provided that the following conditions are met:
NYX 0:85b3fd62ea1a 15 * 1. Redistributions of source code must retain the above copyright notice,
NYX 0:85b3fd62ea1a 16 * this list of conditions and the following disclaimer.
NYX 0:85b3fd62ea1a 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
NYX 0:85b3fd62ea1a 18 * this list of conditions and the following disclaimer in the documentation
NYX 0:85b3fd62ea1a 19 * and/or other materials provided with the distribution.
NYX 0:85b3fd62ea1a 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
NYX 0:85b3fd62ea1a 21 * may be used to endorse or promote products derived from this software
NYX 0:85b3fd62ea1a 22 * without specific prior written permission.
NYX 0:85b3fd62ea1a 23 *
NYX 0:85b3fd62ea1a 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
NYX 0:85b3fd62ea1a 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
NYX 0:85b3fd62ea1a 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
NYX 0:85b3fd62ea1a 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
NYX 0:85b3fd62ea1a 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
NYX 0:85b3fd62ea1a 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
NYX 0:85b3fd62ea1a 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
NYX 0:85b3fd62ea1a 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
NYX 0:85b3fd62ea1a 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
NYX 0:85b3fd62ea1a 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NYX 0:85b3fd62ea1a 34 *
NYX 0:85b3fd62ea1a 35 ******************************************************************************
NYX 0:85b3fd62ea1a 36 */
NYX 0:85b3fd62ea1a 37
NYX 0:85b3fd62ea1a 38 /* Define to prevent recursive inclusion -------------------------------------*/
NYX 0:85b3fd62ea1a 39 #ifndef __STM32F4xx_HAL_CRC_H
NYX 0:85b3fd62ea1a 40 #define __STM32F4xx_HAL_CRC_H
NYX 0:85b3fd62ea1a 41
NYX 0:85b3fd62ea1a 42 #ifdef __cplusplus
NYX 0:85b3fd62ea1a 43 extern "C" {
NYX 0:85b3fd62ea1a 44 #endif
NYX 0:85b3fd62ea1a 45
NYX 0:85b3fd62ea1a 46 /* Includes ------------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 47 #include "stm32f4xx_hal_def.h"
NYX 0:85b3fd62ea1a 48
NYX 0:85b3fd62ea1a 49 /** @addtogroup STM32F4xx_HAL_Driver
NYX 0:85b3fd62ea1a 50 * @{
NYX 0:85b3fd62ea1a 51 */
NYX 0:85b3fd62ea1a 52
NYX 0:85b3fd62ea1a 53 /** @defgroup CRC CRC
NYX 0:85b3fd62ea1a 54 * @brief CRC HAL module driver
NYX 0:85b3fd62ea1a 55 * @{
NYX 0:85b3fd62ea1a 56 */
NYX 0:85b3fd62ea1a 57
NYX 0:85b3fd62ea1a 58 /* Exported types ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 59 /** @defgroup CRC_Exported_Types CRC Exported Types
NYX 0:85b3fd62ea1a 60 * @{
NYX 0:85b3fd62ea1a 61 */
NYX 0:85b3fd62ea1a 62
NYX 0:85b3fd62ea1a 63 /** @defgroup CRC_Exported_Types_Group1 CRC State Structure definition
NYX 0:85b3fd62ea1a 64 * @{
NYX 0:85b3fd62ea1a 65 */
NYX 0:85b3fd62ea1a 66 typedef enum
NYX 0:85b3fd62ea1a 67 {
NYX 0:85b3fd62ea1a 68 HAL_CRC_STATE_RESET = 0x00U, /*!< CRC not yet initialized or disabled */
NYX 0:85b3fd62ea1a 69 HAL_CRC_STATE_READY = 0x01U, /*!< CRC initialized and ready for use */
NYX 0:85b3fd62ea1a 70 HAL_CRC_STATE_BUSY = 0x02U, /*!< CRC internal process is ongoing */
NYX 0:85b3fd62ea1a 71 HAL_CRC_STATE_TIMEOUT = 0x03U, /*!< CRC timeout state */
NYX 0:85b3fd62ea1a 72 HAL_CRC_STATE_ERROR = 0x04U /*!< CRC error state */
NYX 0:85b3fd62ea1a 73
NYX 0:85b3fd62ea1a 74 }HAL_CRC_StateTypeDef;
NYX 0:85b3fd62ea1a 75 /**
NYX 0:85b3fd62ea1a 76 * @}
NYX 0:85b3fd62ea1a 77 */
NYX 0:85b3fd62ea1a 78
NYX 0:85b3fd62ea1a 79 /** @defgroup CRC_Exported_Types_Group2 CRC Handle Structure definition
NYX 0:85b3fd62ea1a 80 * @{
NYX 0:85b3fd62ea1a 81 */
NYX 0:85b3fd62ea1a 82 typedef struct
NYX 0:85b3fd62ea1a 83 {
NYX 0:85b3fd62ea1a 84 CRC_TypeDef *Instance; /*!< Register base address */
NYX 0:85b3fd62ea1a 85
NYX 0:85b3fd62ea1a 86 HAL_LockTypeDef Lock; /*!< CRC locking object */
NYX 0:85b3fd62ea1a 87
NYX 0:85b3fd62ea1a 88 __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */
NYX 0:85b3fd62ea1a 89
NYX 0:85b3fd62ea1a 90 }CRC_HandleTypeDef;
NYX 0:85b3fd62ea1a 91 /**
NYX 0:85b3fd62ea1a 92 * @}
NYX 0:85b3fd62ea1a 93 */
NYX 0:85b3fd62ea1a 94
NYX 0:85b3fd62ea1a 95 /**
NYX 0:85b3fd62ea1a 96 * @}
NYX 0:85b3fd62ea1a 97 */
NYX 0:85b3fd62ea1a 98
NYX 0:85b3fd62ea1a 99 /* Exported constants --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 100 /* Exported macro ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 101 /** @defgroup CRC_Exported_Macros CRC Exported Macros
NYX 0:85b3fd62ea1a 102 * @{
NYX 0:85b3fd62ea1a 103 */
NYX 0:85b3fd62ea1a 104
NYX 0:85b3fd62ea1a 105 /** @brief Resets CRC handle state
NYX 0:85b3fd62ea1a 106 * @param __HANDLE__: CRC handle
NYX 0:85b3fd62ea1a 107 * @retval None
NYX 0:85b3fd62ea1a 108 */
NYX 0:85b3fd62ea1a 109 #define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET)
NYX 0:85b3fd62ea1a 110
NYX 0:85b3fd62ea1a 111 /**
NYX 0:85b3fd62ea1a 112 * @brief Resets CRC Data Register.
NYX 0:85b3fd62ea1a 113 * @param __HANDLE__: CRC handle
NYX 0:85b3fd62ea1a 114 * @retval None
NYX 0:85b3fd62ea1a 115 */
NYX 0:85b3fd62ea1a 116 #define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET)
NYX 0:85b3fd62ea1a 117
NYX 0:85b3fd62ea1a 118 /**
NYX 0:85b3fd62ea1a 119 * @brief Stores a 8-bit data in the Independent Data(ID) register.
NYX 0:85b3fd62ea1a 120 * @param __HANDLE__: CRC handle
NYX 0:85b3fd62ea1a 121 * @param __VALUE__: 8-bit value to be stored in the ID register
NYX 0:85b3fd62ea1a 122 * @retval None
NYX 0:85b3fd62ea1a 123 */
NYX 0:85b3fd62ea1a 124 #define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (WRITE_REG((__HANDLE__)->Instance->IDR, (__VALUE__)))
NYX 0:85b3fd62ea1a 125
NYX 0:85b3fd62ea1a 126 /**
NYX 0:85b3fd62ea1a 127 * @brief Returns the 8-bit data stored in the Independent Data(ID) register.
NYX 0:85b3fd62ea1a 128 * @param __HANDLE__: CRC handle
NYX 0:85b3fd62ea1a 129 * @retval 8-bit value of the ID register
NYX 0:85b3fd62ea1a 130 */
NYX 0:85b3fd62ea1a 131 #define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR)
NYX 0:85b3fd62ea1a 132 /**
NYX 0:85b3fd62ea1a 133 * @}
NYX 0:85b3fd62ea1a 134 */
NYX 0:85b3fd62ea1a 135
NYX 0:85b3fd62ea1a 136 /* Exported functions --------------------------------------------------------*/
NYX 0:85b3fd62ea1a 137 /** @defgroup CRC_Exported_Functions CRC Exported Functions
NYX 0:85b3fd62ea1a 138 * @{
NYX 0:85b3fd62ea1a 139 */
NYX 0:85b3fd62ea1a 140
NYX 0:85b3fd62ea1a 141 /** @defgroup CRC_Exported_Functions_Group1 Initialization and de-initialization functions
NYX 0:85b3fd62ea1a 142 * @{
NYX 0:85b3fd62ea1a 143 */
NYX 0:85b3fd62ea1a 144 HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc);
NYX 0:85b3fd62ea1a 145 HAL_StatusTypeDef HAL_CRC_DeInit (CRC_HandleTypeDef *hcrc);
NYX 0:85b3fd62ea1a 146 void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc);
NYX 0:85b3fd62ea1a 147 void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc);
NYX 0:85b3fd62ea1a 148 /**
NYX 0:85b3fd62ea1a 149 * @}
NYX 0:85b3fd62ea1a 150 */
NYX 0:85b3fd62ea1a 151
NYX 0:85b3fd62ea1a 152 /** @defgroup CRC_Exported_Functions_Group2 Peripheral Control functions
NYX 0:85b3fd62ea1a 153 * @{
NYX 0:85b3fd62ea1a 154 */
NYX 0:85b3fd62ea1a 155 uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
NYX 0:85b3fd62ea1a 156 uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
NYX 0:85b3fd62ea1a 157 /**
NYX 0:85b3fd62ea1a 158 * @}
NYX 0:85b3fd62ea1a 159 */
NYX 0:85b3fd62ea1a 160
NYX 0:85b3fd62ea1a 161 /** @defgroup CRC_Exported_Functions_Group3 Peripheral State functions
NYX 0:85b3fd62ea1a 162 * @{
NYX 0:85b3fd62ea1a 163 */
NYX 0:85b3fd62ea1a 164 HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc);
NYX 0:85b3fd62ea1a 165 /**
NYX 0:85b3fd62ea1a 166 * @}
NYX 0:85b3fd62ea1a 167 */
NYX 0:85b3fd62ea1a 168
NYX 0:85b3fd62ea1a 169 /**
NYX 0:85b3fd62ea1a 170 * @}
NYX 0:85b3fd62ea1a 171 */
NYX 0:85b3fd62ea1a 172 /* Private types -------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 173 /** @defgroup CRC_Private_Types CRC Private Types
NYX 0:85b3fd62ea1a 174 * @{
NYX 0:85b3fd62ea1a 175 */
NYX 0:85b3fd62ea1a 176
NYX 0:85b3fd62ea1a 177 /**
NYX 0:85b3fd62ea1a 178 * @}
NYX 0:85b3fd62ea1a 179 */
NYX 0:85b3fd62ea1a 180
NYX 0:85b3fd62ea1a 181 /* Private defines -----------------------------------------------------------*/
NYX 0:85b3fd62ea1a 182 /** @defgroup CRC_Private_Defines CRC Private Defines
NYX 0:85b3fd62ea1a 183 * @{
NYX 0:85b3fd62ea1a 184 */
NYX 0:85b3fd62ea1a 185
NYX 0:85b3fd62ea1a 186 /**
NYX 0:85b3fd62ea1a 187 * @}
NYX 0:85b3fd62ea1a 188 */
NYX 0:85b3fd62ea1a 189
NYX 0:85b3fd62ea1a 190 /* Private variables ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 191 /** @defgroup CRC_Private_Variables CRC Private Variables
NYX 0:85b3fd62ea1a 192 * @{
NYX 0:85b3fd62ea1a 193 */
NYX 0:85b3fd62ea1a 194
NYX 0:85b3fd62ea1a 195 /**
NYX 0:85b3fd62ea1a 196 * @}
NYX 0:85b3fd62ea1a 197 */
NYX 0:85b3fd62ea1a 198
NYX 0:85b3fd62ea1a 199 /* Private constants ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 200 /** @defgroup CRC_Private_Constants CRC Private Constants
NYX 0:85b3fd62ea1a 201 * @{
NYX 0:85b3fd62ea1a 202 */
NYX 0:85b3fd62ea1a 203
NYX 0:85b3fd62ea1a 204 /**
NYX 0:85b3fd62ea1a 205 * @}
NYX 0:85b3fd62ea1a 206 */
NYX 0:85b3fd62ea1a 207
NYX 0:85b3fd62ea1a 208 /* Private macros ------------------------------------------------------------*/
NYX 0:85b3fd62ea1a 209 /** @defgroup CRC_Private_Macros CRC Private Macros
NYX 0:85b3fd62ea1a 210 * @{
NYX 0:85b3fd62ea1a 211 */
NYX 0:85b3fd62ea1a 212
NYX 0:85b3fd62ea1a 213 /**
NYX 0:85b3fd62ea1a 214 * @}
NYX 0:85b3fd62ea1a 215 */
NYX 0:85b3fd62ea1a 216
NYX 0:85b3fd62ea1a 217 /* Private functions prototypes ----------------------------------------------*/
NYX 0:85b3fd62ea1a 218 /** @defgroup CRC_Private_Functions_Prototypes CRC Private Functions Prototypes
NYX 0:85b3fd62ea1a 219 * @{
NYX 0:85b3fd62ea1a 220 */
NYX 0:85b3fd62ea1a 221
NYX 0:85b3fd62ea1a 222 /**
NYX 0:85b3fd62ea1a 223 * @}
NYX 0:85b3fd62ea1a 224 */
NYX 0:85b3fd62ea1a 225
NYX 0:85b3fd62ea1a 226 /* Private functions ---------------------------------------------------------*/
NYX 0:85b3fd62ea1a 227 /** @defgroup CRC_Private_Functions CRC Private Functions
NYX 0:85b3fd62ea1a 228 * @{
NYX 0:85b3fd62ea1a 229 */
NYX 0:85b3fd62ea1a 230
NYX 0:85b3fd62ea1a 231 /**
NYX 0:85b3fd62ea1a 232 * @}
NYX 0:85b3fd62ea1a 233 */
NYX 0:85b3fd62ea1a 234
NYX 0:85b3fd62ea1a 235 /**
NYX 0:85b3fd62ea1a 236 * @}
NYX 0:85b3fd62ea1a 237 */
NYX 0:85b3fd62ea1a 238
NYX 0:85b3fd62ea1a 239 /**
NYX 0:85b3fd62ea1a 240 * @}
NYX 0:85b3fd62ea1a 241 */
NYX 0:85b3fd62ea1a 242
NYX 0:85b3fd62ea1a 243 #ifdef __cplusplus
NYX 0:85b3fd62ea1a 244 }
NYX 0:85b3fd62ea1a 245 #endif
NYX 0:85b3fd62ea1a 246
NYX 0:85b3fd62ea1a 247 #endif /* __STM32F4xx_HAL_CRC_H */
NYX 0:85b3fd62ea1a 248
NYX 0:85b3fd62ea1a 249 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/