Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Nov 25 13:21:40 2015 +0000
Revision:
110:165afa46840b
Parent:
106:ba1f97679dad
Release 110  of the mbed library

Changes:
- new platforms - STM32F410R, DISCO_F429ZI, DISCO_F469NI
- Nucleo L476 - gcc and uvision template
- k22,k64f targets - ADC channels A addition
- EFM32 - bugfixes in sleep, serial and spi
- Delta DFCM NNN40 - pinnames update

Who changed what in which revision?

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