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