Elijah Orr / mbed-renbed

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Jan 13 09:48:29 2016 +0000
Revision:
112:6f327212ef96
Release 112 of the mbed library

Changes:
- new platforms - STM32 B96B F446, MOTE_L152RC
- nrf51 - fix serial init bug (character sent)
- stm all devices - fix RTC clocking in the init
- stm f0 - SystemInit clock fix, for SetVector()
- RawSerial - fix for microlib (vsnprintf with size 0)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 112:6f327212ef96 1 /**
Kojto 112:6f327212ef96 2 ******************************************************************************
Kojto 112:6f327212ef96 3 * @file stm32f4xx_hal_hash.h
Kojto 112:6f327212ef96 4 * @author MCD Application Team
Kojto 112:6f327212ef96 5 * @version V1.4.1
Kojto 112:6f327212ef96 6 * @date 09-October-2015
Kojto 112:6f327212ef96 7 * @brief Header file of HASH HAL module.
Kojto 112:6f327212ef96 8 ******************************************************************************
Kojto 112:6f327212ef96 9 * @attention
Kojto 112:6f327212ef96 10 *
Kojto 112:6f327212ef96 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 112:6f327212ef96 12 *
Kojto 112:6f327212ef96 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 112:6f327212ef96 14 * are permitted provided that the following conditions are met:
Kojto 112:6f327212ef96 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 112:6f327212ef96 16 * this list of conditions and the following disclaimer.
Kojto 112:6f327212ef96 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 112:6f327212ef96 18 * this list of conditions and the following disclaimer in the documentation
Kojto 112:6f327212ef96 19 * and/or other materials provided with the distribution.
Kojto 112:6f327212ef96 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 112:6f327212ef96 21 * may be used to endorse or promote products derived from this software
Kojto 112:6f327212ef96 22 * without specific prior written permission.
Kojto 112:6f327212ef96 23 *
Kojto 112:6f327212ef96 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 112:6f327212ef96 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 112:6f327212ef96 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 112:6f327212ef96 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 112:6f327212ef96 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 112:6f327212ef96 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 112:6f327212ef96 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 112:6f327212ef96 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 112:6f327212ef96 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 112:6f327212ef96 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 112:6f327212ef96 34 *
Kojto 112:6f327212ef96 35 ******************************************************************************
Kojto 112:6f327212ef96 36 */
Kojto 112:6f327212ef96 37
Kojto 112:6f327212ef96 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 112:6f327212ef96 39 #ifndef __STM32F4xx_HAL_HASH_H
Kojto 112:6f327212ef96 40 #define __STM32F4xx_HAL_HASH_H
Kojto 112:6f327212ef96 41
Kojto 112:6f327212ef96 42 #ifdef __cplusplus
Kojto 112:6f327212ef96 43 extern "C" {
Kojto 112:6f327212ef96 44 #endif
Kojto 112:6f327212ef96 45
Kojto 112:6f327212ef96 46 #if defined(STM32F415xx) || defined(STM32F417xx) || defined(STM32F437xx) || defined(STM32F439xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 47
Kojto 112:6f327212ef96 48 /* Includes ------------------------------------------------------------------*/
Kojto 112:6f327212ef96 49 #include "stm32f4xx_hal_def.h"
Kojto 112:6f327212ef96 50
Kojto 112:6f327212ef96 51 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 112:6f327212ef96 52 * @{
Kojto 112:6f327212ef96 53 */
Kojto 112:6f327212ef96 54
Kojto 112:6f327212ef96 55 /** @addtogroup HASH
Kojto 112:6f327212ef96 56 * @brief HASH HAL module driver
Kojto 112:6f327212ef96 57 * @{
Kojto 112:6f327212ef96 58 */
Kojto 112:6f327212ef96 59
Kojto 112:6f327212ef96 60 /* Exported types ------------------------------------------------------------*/
Kojto 112:6f327212ef96 61 /** @defgroup HASH_Exported_Types HASH Exported Types
Kojto 112:6f327212ef96 62 * @{
Kojto 112:6f327212ef96 63 */
Kojto 112:6f327212ef96 64
Kojto 112:6f327212ef96 65 /** @defgroup HASH_Exported_Types_Group1 HASH Configuration Structure definition
Kojto 112:6f327212ef96 66 * @{
Kojto 112:6f327212ef96 67 */
Kojto 112:6f327212ef96 68
Kojto 112:6f327212ef96 69 typedef struct
Kojto 112:6f327212ef96 70 {
Kojto 112:6f327212ef96 71 uint32_t DataType; /*!< 32-bit data, 16-bit data, 8-bit data or 1-bit string.
Kojto 112:6f327212ef96 72 This parameter can be a value of @ref HASH DataType */
Kojto 112:6f327212ef96 73
Kojto 112:6f327212ef96 74 uint32_t KeySize; /*!< The key size is used only in HMAC operation */
Kojto 112:6f327212ef96 75
Kojto 112:6f327212ef96 76 uint8_t* pKey; /*!< The key is used only in HMAC operation */
Kojto 112:6f327212ef96 77 }HASH_InitTypeDef;
Kojto 112:6f327212ef96 78
Kojto 112:6f327212ef96 79 /**
Kojto 112:6f327212ef96 80 * @}
Kojto 112:6f327212ef96 81 */
Kojto 112:6f327212ef96 82
Kojto 112:6f327212ef96 83 /** @defgroup HASH_Exported_Types_Group2 HASH State structures definition
Kojto 112:6f327212ef96 84 * @{
Kojto 112:6f327212ef96 85 */
Kojto 112:6f327212ef96 86
Kojto 112:6f327212ef96 87 typedef enum
Kojto 112:6f327212ef96 88 {
Kojto 112:6f327212ef96 89 HAL_HASH_STATE_RESET = 0x00, /*!< HASH not yet initialized or disabled */
Kojto 112:6f327212ef96 90 HAL_HASH_STATE_READY = 0x01, /*!< HASH initialized and ready for use */
Kojto 112:6f327212ef96 91 HAL_HASH_STATE_BUSY = 0x02, /*!< HASH internal process is ongoing */
Kojto 112:6f327212ef96 92 HAL_HASH_STATE_TIMEOUT = 0x03, /*!< HASH timeout state */
Kojto 112:6f327212ef96 93 HAL_HASH_STATE_ERROR = 0x04 /*!< HASH error state */
Kojto 112:6f327212ef96 94 }HAL_HASH_STATETypeDef;
Kojto 112:6f327212ef96 95
Kojto 112:6f327212ef96 96 /**
Kojto 112:6f327212ef96 97 * @}
Kojto 112:6f327212ef96 98 */
Kojto 112:6f327212ef96 99
Kojto 112:6f327212ef96 100 /** @defgroup HASH_Exported_Types_Group3 HASH phase structures definition
Kojto 112:6f327212ef96 101 * @{
Kojto 112:6f327212ef96 102 */
Kojto 112:6f327212ef96 103
Kojto 112:6f327212ef96 104 typedef enum
Kojto 112:6f327212ef96 105 {
Kojto 112:6f327212ef96 106 HAL_HASH_PHASE_READY = 0x01, /*!< HASH peripheral is ready for initialization */
Kojto 112:6f327212ef96 107 HAL_HASH_PHASE_PROCESS = 0x02, /*!< HASH peripheral is in processing phase */
Kojto 112:6f327212ef96 108 }HAL_HASHPhaseTypeDef;
Kojto 112:6f327212ef96 109
Kojto 112:6f327212ef96 110 /**
Kojto 112:6f327212ef96 111 * @}
Kojto 112:6f327212ef96 112 */
Kojto 112:6f327212ef96 113
Kojto 112:6f327212ef96 114 /** @defgroup HASH_Exported_Types_Group4 HASH Handle structures definition
Kojto 112:6f327212ef96 115 * @{
Kojto 112:6f327212ef96 116 */
Kojto 112:6f327212ef96 117
Kojto 112:6f327212ef96 118 typedef struct
Kojto 112:6f327212ef96 119 {
Kojto 112:6f327212ef96 120 HASH_InitTypeDef Init; /*!< HASH required parameters */
Kojto 112:6f327212ef96 121
Kojto 112:6f327212ef96 122 uint8_t *pHashInBuffPtr; /*!< Pointer to input buffer */
Kojto 112:6f327212ef96 123
Kojto 112:6f327212ef96 124 uint8_t *pHashOutBuffPtr; /*!< Pointer to input buffer */
Kojto 112:6f327212ef96 125
Kojto 112:6f327212ef96 126 __IO uint32_t HashBuffSize; /*!< Size of buffer to be processed */
Kojto 112:6f327212ef96 127
Kojto 112:6f327212ef96 128 __IO uint32_t HashInCount; /*!< Counter of inputed data */
Kojto 112:6f327212ef96 129
Kojto 112:6f327212ef96 130 __IO uint32_t HashITCounter; /*!< Counter of issued interrupts */
Kojto 112:6f327212ef96 131
Kojto 112:6f327212ef96 132 HAL_StatusTypeDef Status; /*!< HASH peripheral status */
Kojto 112:6f327212ef96 133
Kojto 112:6f327212ef96 134 HAL_HASHPhaseTypeDef Phase; /*!< HASH peripheral phase */
Kojto 112:6f327212ef96 135
Kojto 112:6f327212ef96 136 DMA_HandleTypeDef *hdmain; /*!< HASH In DMA handle parameters */
Kojto 112:6f327212ef96 137
Kojto 112:6f327212ef96 138 HAL_LockTypeDef Lock; /*!< HASH locking object */
Kojto 112:6f327212ef96 139
Kojto 112:6f327212ef96 140 __IO HAL_HASH_STATETypeDef State; /*!< HASH peripheral state */
Kojto 112:6f327212ef96 141 } HASH_HandleTypeDef;
Kojto 112:6f327212ef96 142
Kojto 112:6f327212ef96 143 /**
Kojto 112:6f327212ef96 144 * @}
Kojto 112:6f327212ef96 145 */
Kojto 112:6f327212ef96 146
Kojto 112:6f327212ef96 147
Kojto 112:6f327212ef96 148 /**
Kojto 112:6f327212ef96 149 * @}
Kojto 112:6f327212ef96 150 */
Kojto 112:6f327212ef96 151
Kojto 112:6f327212ef96 152 /* Exported constants --------------------------------------------------------*/
Kojto 112:6f327212ef96 153 /** @defgroup HASH_Exported_Constants HASH Exported Constants
Kojto 112:6f327212ef96 154 * @{
Kojto 112:6f327212ef96 155 */
Kojto 112:6f327212ef96 156
Kojto 112:6f327212ef96 157 /** @defgroup HASH_Exported_Constants_Group1 HASH Algorithm Selection
Kojto 112:6f327212ef96 158 * @{
Kojto 112:6f327212ef96 159 */
Kojto 112:6f327212ef96 160 #define HASH_ALGOSELECTION_SHA1 ((uint32_t)0x0000) /*!< HASH function is SHA1 */
Kojto 112:6f327212ef96 161 #define HASH_ALGOSELECTION_SHA224 HASH_CR_ALGO_1 /*!< HASH function is SHA224 */
Kojto 112:6f327212ef96 162 #define HASH_ALGOSELECTION_SHA256 HASH_CR_ALGO /*!< HASH function is SHA256 */
Kojto 112:6f327212ef96 163 #define HASH_ALGOSELECTION_MD5 HASH_CR_ALGO_0 /*!< HASH function is MD5 */
Kojto 112:6f327212ef96 164 /**
Kojto 112:6f327212ef96 165 * @}
Kojto 112:6f327212ef96 166 */
Kojto 112:6f327212ef96 167
Kojto 112:6f327212ef96 168 /** @defgroup HASH_Exported_Constants_Group2 HASH Algorithm Mode
Kojto 112:6f327212ef96 169 * @{
Kojto 112:6f327212ef96 170 */
Kojto 112:6f327212ef96 171 #define HASH_ALGOMODE_HASH ((uint32_t)0x00000000) /*!< Algorithm is HASH */
Kojto 112:6f327212ef96 172 #define HASH_ALGOMODE_HMAC HASH_CR_MODE /*!< Algorithm is HMAC */
Kojto 112:6f327212ef96 173 /**
Kojto 112:6f327212ef96 174 * @}
Kojto 112:6f327212ef96 175 */
Kojto 112:6f327212ef96 176
Kojto 112:6f327212ef96 177 /** @defgroup HASH_Exported_Constants_Group3 HASH DataType
Kojto 112:6f327212ef96 178 * @{
Kojto 112:6f327212ef96 179 */
Kojto 112:6f327212ef96 180 #define HASH_DATATYPE_32B ((uint32_t)0x0000) /*!< 32-bit data. No swapping */
Kojto 112:6f327212ef96 181 #define HASH_DATATYPE_16B HASH_CR_DATATYPE_0 /*!< 16-bit data. Each half word is swapped */
Kojto 112:6f327212ef96 182 #define HASH_DATATYPE_8B HASH_CR_DATATYPE_1 /*!< 8-bit data. All bytes are swapped */
Kojto 112:6f327212ef96 183 #define HASH_DATATYPE_1B HASH_CR_DATATYPE /*!< 1-bit data. In the word all bits are swapped */
Kojto 112:6f327212ef96 184 /**
Kojto 112:6f327212ef96 185 * @}
Kojto 112:6f327212ef96 186 */
Kojto 112:6f327212ef96 187
Kojto 112:6f327212ef96 188 /** @defgroup HASH_Exported_Constants_Group4 HASH HMAC Long key
Kojto 112:6f327212ef96 189 * @brief HASH HMAC Long key used only for HMAC mode
Kojto 112:6f327212ef96 190 * @{
Kojto 112:6f327212ef96 191 */
Kojto 112:6f327212ef96 192 #define HASH_HMAC_KEYTYPE_SHORTKEY ((uint32_t)0x00000000) /*!< HMAC Key is <= 64 bytes */
Kojto 112:6f327212ef96 193 #define HASH_HMAC_KEYTYPE_LONGKEY HASH_CR_LKEY /*!< HMAC Key is > 64 bytes */
Kojto 112:6f327212ef96 194 /**
Kojto 112:6f327212ef96 195 * @}
Kojto 112:6f327212ef96 196 */
Kojto 112:6f327212ef96 197
Kojto 112:6f327212ef96 198 /** @defgroup HASH_Exported_Constants_Group5 HASH Flags definition
Kojto 112:6f327212ef96 199 * @{
Kojto 112:6f327212ef96 200 */
Kojto 112:6f327212ef96 201 #define HASH_FLAG_DINIS HASH_SR_DINIS /*!< 16 locations are free in the DIN : A new block can be entered into the input buffer */
Kojto 112:6f327212ef96 202 #define HASH_FLAG_DCIS HASH_SR_DCIS /*!< Digest calculation complete */
Kojto 112:6f327212ef96 203 #define HASH_FLAG_DMAS HASH_SR_DMAS /*!< DMA interface is enabled (DMAE=1) or a transfer is ongoing */
Kojto 112:6f327212ef96 204 #define HASH_FLAG_BUSY HASH_SR_BUSY /*!< The hash core is Busy : processing a block of data */
Kojto 112:6f327212ef96 205 #define HASH_FLAG_DINNE HASH_CR_DINNE /*!< DIN not empty : The input buffer contains at least one word of data */
Kojto 112:6f327212ef96 206 /**
Kojto 112:6f327212ef96 207 * @}
Kojto 112:6f327212ef96 208 */
Kojto 112:6f327212ef96 209
Kojto 112:6f327212ef96 210 /** @defgroup HASH_Exported_Constants_Group6 HASH Interrupts definition
Kojto 112:6f327212ef96 211 * @{
Kojto 112:6f327212ef96 212 */
Kojto 112:6f327212ef96 213 #define HASH_IT_DINI HASH_IMR_DINIE /*!< A new block can be entered into the input buffer (DIN) */
Kojto 112:6f327212ef96 214 #define HASH_IT_DCI HASH_IMR_DCIE /*!< Digest calculation complete */
Kojto 112:6f327212ef96 215 /**
Kojto 112:6f327212ef96 216 * @}
Kojto 112:6f327212ef96 217 */
Kojto 112:6f327212ef96 218
Kojto 112:6f327212ef96 219 /**
Kojto 112:6f327212ef96 220 * @}
Kojto 112:6f327212ef96 221 */
Kojto 112:6f327212ef96 222
Kojto 112:6f327212ef96 223 /* Exported macro ------------------------------------------------------------*/
Kojto 112:6f327212ef96 224 /** @defgroup HASH_Exported_Macros HASH Exported Macros
Kojto 112:6f327212ef96 225 * @{
Kojto 112:6f327212ef96 226 */
Kojto 112:6f327212ef96 227
Kojto 112:6f327212ef96 228 /** @brief Reset HASH handle state
Kojto 112:6f327212ef96 229 * @param __HANDLE__: specifies the HASH handle.
Kojto 112:6f327212ef96 230 * @retval None
Kojto 112:6f327212ef96 231 */
Kojto 112:6f327212ef96 232 #define __HAL_HASH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_HASH_STATE_RESET)
Kojto 112:6f327212ef96 233
Kojto 112:6f327212ef96 234 /** @brief Check whether the specified HASH flag is set or not.
Kojto 112:6f327212ef96 235 * @param __FLAG__: specifies the flag to check.
Kojto 112:6f327212ef96 236 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 237 * @arg HASH_FLAG_DINIS: A new block can be entered into the input buffer.
Kojto 112:6f327212ef96 238 * @arg HASH_FLAG_DCIS: Digest calculation complete
Kojto 112:6f327212ef96 239 * @arg HASH_FLAG_DMAS: DMA interface is enabled (DMAE=1) or a transfer is ongoing
Kojto 112:6f327212ef96 240 * @arg HASH_FLAG_BUSY: The hash core is Busy : processing a block of data
Kojto 112:6f327212ef96 241 * @arg HASH_FLAG_DINNE: DIN not empty : The input buffer contains at least one word of data
Kojto 112:6f327212ef96 242 * @retval The new state of __FLAG__ (TRUE or FALSE).
Kojto 112:6f327212ef96 243 */
Kojto 112:6f327212ef96 244 #define __HAL_HASH_GET_FLAG(__FLAG__) (((__FLAG__) > 8U) ? ((HASH->CR & (__FLAG__)) == (__FLAG__)) :\
Kojto 112:6f327212ef96 245 ((HASH->SR & (__FLAG__)) == (__FLAG__)))
Kojto 112:6f327212ef96 246
Kojto 112:6f327212ef96 247 /**
Kojto 112:6f327212ef96 248 * @brief Enable the multiple DMA mode.
Kojto 112:6f327212ef96 249 * This feature is available only in STM32F429x and STM32F439x devices.
Kojto 112:6f327212ef96 250 * @retval None
Kojto 112:6f327212ef96 251 */
Kojto 112:6f327212ef96 252 #define __HAL_HASH_SET_MDMAT() HASH->CR |= HASH_CR_MDMAT
Kojto 112:6f327212ef96 253
Kojto 112:6f327212ef96 254 /**
Kojto 112:6f327212ef96 255 * @brief Disable the multiple DMA mode.
Kojto 112:6f327212ef96 256 * @retval None
Kojto 112:6f327212ef96 257 */
Kojto 112:6f327212ef96 258 #define __HAL_HASH_RESET_MDMAT() HASH->CR &= (uint32_t)(~HASH_CR_MDMAT)
Kojto 112:6f327212ef96 259
Kojto 112:6f327212ef96 260 /**
Kojto 112:6f327212ef96 261 * @brief Start the digest computation
Kojto 112:6f327212ef96 262 * @retval None
Kojto 112:6f327212ef96 263 */
Kojto 112:6f327212ef96 264 #define __HAL_HASH_START_DIGEST() HASH->STR |= HASH_STR_DCAL
Kojto 112:6f327212ef96 265
Kojto 112:6f327212ef96 266 /**
Kojto 112:6f327212ef96 267 * @brief Set the number of valid bits in last word written in Data register
Kojto 112:6f327212ef96 268 * @param SIZE: size in byte of last data written in Data register.
Kojto 112:6f327212ef96 269 * @retval None
Kojto 112:6f327212ef96 270 */
Kojto 112:6f327212ef96 271 #define __HAL_HASH_SET_NBVALIDBITS(SIZE) do{HASH->STR &= ~(HASH_STR_NBLW);\
Kojto 112:6f327212ef96 272 HASH->STR |= 8 * ((SIZE) % 4);\
Kojto 112:6f327212ef96 273 }while(0)
Kojto 112:6f327212ef96 274
Kojto 112:6f327212ef96 275 /**
Kojto 112:6f327212ef96 276 * @}
Kojto 112:6f327212ef96 277 */
Kojto 112:6f327212ef96 278
Kojto 112:6f327212ef96 279 /* Include HASH HAL Extension module */
Kojto 112:6f327212ef96 280 #include "stm32f4xx_hal_hash_ex.h"
Kojto 112:6f327212ef96 281 /* Exported functions --------------------------------------------------------*/
Kojto 112:6f327212ef96 282
Kojto 112:6f327212ef96 283 /** @defgroup HASH_Exported_Functions HASH Exported Functions
Kojto 112:6f327212ef96 284 * @{
Kojto 112:6f327212ef96 285 */
Kojto 112:6f327212ef96 286
Kojto 112:6f327212ef96 287 /** @addtogroup HASH_Exported_Functions_Group1
Kojto 112:6f327212ef96 288 * @{
Kojto 112:6f327212ef96 289 */
Kojto 112:6f327212ef96 290 HAL_StatusTypeDef HAL_HASH_Init(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 291 HAL_StatusTypeDef HAL_HASH_DeInit(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 292 /**
Kojto 112:6f327212ef96 293 * @}
Kojto 112:6f327212ef96 294 */
Kojto 112:6f327212ef96 295
Kojto 112:6f327212ef96 296 /** @addtogroup HASH_Exported_Functions_Group2
Kojto 112:6f327212ef96 297 * @{
Kojto 112:6f327212ef96 298 */
Kojto 112:6f327212ef96 299 HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 112:6f327212ef96 300 HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 112:6f327212ef96 301 HAL_StatusTypeDef HAL_HASH_MD5_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 112:6f327212ef96 302 HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 112:6f327212ef96 303 /**
Kojto 112:6f327212ef96 304 * @}
Kojto 112:6f327212ef96 305 */
Kojto 112:6f327212ef96 306
Kojto 112:6f327212ef96 307 /** @addtogroup HASH_Exported_Functions_Group3
Kojto 112:6f327212ef96 308 * @{
Kojto 112:6f327212ef96 309 */
Kojto 112:6f327212ef96 310 HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 112:6f327212ef96 311 HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 112:6f327212ef96 312 /**
Kojto 112:6f327212ef96 313 * @}
Kojto 112:6f327212ef96 314 */
Kojto 112:6f327212ef96 315
Kojto 112:6f327212ef96 316 /** @addtogroup HASH_Exported_Functions_Group4
Kojto 112:6f327212ef96 317 * @{
Kojto 112:6f327212ef96 318 */
Kojto 112:6f327212ef96 319 HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
Kojto 112:6f327212ef96 320 HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
Kojto 112:6f327212ef96 321 /**
Kojto 112:6f327212ef96 322 * @}
Kojto 112:6f327212ef96 323 */
Kojto 112:6f327212ef96 324
Kojto 112:6f327212ef96 325 /** @addtogroup HASH_Exported_Functions_Group5
Kojto 112:6f327212ef96 326 * @{
Kojto 112:6f327212ef96 327 */
Kojto 112:6f327212ef96 328 HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 112:6f327212ef96 329 HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 112:6f327212ef96 330 HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 112:6f327212ef96 331 HAL_StatusTypeDef HAL_HASH_MD5_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 112:6f327212ef96 332 /**
Kojto 112:6f327212ef96 333 * @}
Kojto 112:6f327212ef96 334 */
Kojto 112:6f327212ef96 335
Kojto 112:6f327212ef96 336 /** @addtogroup HASH_Exported_Functions_Group6
Kojto 112:6f327212ef96 337 * @{
Kojto 112:6f327212ef96 338 */
Kojto 112:6f327212ef96 339 HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 112:6f327212ef96 340 HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 112:6f327212ef96 341 /**
Kojto 112:6f327212ef96 342 * @}
Kojto 112:6f327212ef96 343 */
Kojto 112:6f327212ef96 344
Kojto 112:6f327212ef96 345 /** @addtogroup HASH_Exported_Functions_Group7
Kojto 112:6f327212ef96 346 * @{
Kojto 112:6f327212ef96 347 */
Kojto 112:6f327212ef96 348 void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 349 /**
Kojto 112:6f327212ef96 350 * @}
Kojto 112:6f327212ef96 351 */
Kojto 112:6f327212ef96 352
Kojto 112:6f327212ef96 353 /** @addtogroup HASH_Exported_Functions_Group8
Kojto 112:6f327212ef96 354 * @{
Kojto 112:6f327212ef96 355 */
Kojto 112:6f327212ef96 356 HAL_HASH_STATETypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 357 void HAL_HASH_MspInit(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 358 void HAL_HASH_MspDeInit(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 359 void HAL_HASH_InCpltCallback(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 360 void HAL_HASH_DgstCpltCallback(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 361 void HAL_HASH_ErrorCallback(HASH_HandleTypeDef *hhash);
Kojto 112:6f327212ef96 362 /**
Kojto 112:6f327212ef96 363 * @}
Kojto 112:6f327212ef96 364 */
Kojto 112:6f327212ef96 365
Kojto 112:6f327212ef96 366 /**
Kojto 112:6f327212ef96 367 * @}
Kojto 112:6f327212ef96 368 */
Kojto 112:6f327212ef96 369
Kojto 112:6f327212ef96 370 /* Private types -------------------------------------------------------------*/
Kojto 112:6f327212ef96 371 /** @defgroup HASH_Private_Types HASH Private Types
Kojto 112:6f327212ef96 372 * @{
Kojto 112:6f327212ef96 373 */
Kojto 112:6f327212ef96 374
Kojto 112:6f327212ef96 375 /**
Kojto 112:6f327212ef96 376 * @}
Kojto 112:6f327212ef96 377 */
Kojto 112:6f327212ef96 378
Kojto 112:6f327212ef96 379 /* Private variables ---------------------------------------------------------*/
Kojto 112:6f327212ef96 380 /** @defgroup HASH_Private_Variables HASH Private Variables
Kojto 112:6f327212ef96 381 * @{
Kojto 112:6f327212ef96 382 */
Kojto 112:6f327212ef96 383
Kojto 112:6f327212ef96 384 /**
Kojto 112:6f327212ef96 385 * @}
Kojto 112:6f327212ef96 386 */
Kojto 112:6f327212ef96 387
Kojto 112:6f327212ef96 388 /* Private constants ---------------------------------------------------------*/
Kojto 112:6f327212ef96 389 /** @defgroup HASH_Private_Constants HASH Private Constants
Kojto 112:6f327212ef96 390 * @{
Kojto 112:6f327212ef96 391 */
Kojto 112:6f327212ef96 392
Kojto 112:6f327212ef96 393 /**
Kojto 112:6f327212ef96 394 * @}
Kojto 112:6f327212ef96 395 */
Kojto 112:6f327212ef96 396
Kojto 112:6f327212ef96 397 /* Private macros ------------------------------------------------------------*/
Kojto 112:6f327212ef96 398 /** @defgroup HASH_Private_Macros HASH Private Macros
Kojto 112:6f327212ef96 399 * @{
Kojto 112:6f327212ef96 400 */
Kojto 112:6f327212ef96 401 #define IS_HASH_ALGOSELECTION(__ALGOSELECTION__) (((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA1) || \
Kojto 112:6f327212ef96 402 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA224) || \
Kojto 112:6f327212ef96 403 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA256) || \
Kojto 112:6f327212ef96 404 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_MD5))
Kojto 112:6f327212ef96 405
Kojto 112:6f327212ef96 406
Kojto 112:6f327212ef96 407 #define IS_HASH_ALGOMODE(__ALGOMODE__) (((__ALGOMODE__) == HASH_ALGOMODE_HASH) || \
Kojto 112:6f327212ef96 408 ((__ALGOMODE__) == HASH_ALGOMODE_HMAC))
Kojto 112:6f327212ef96 409
Kojto 112:6f327212ef96 410
Kojto 112:6f327212ef96 411 #define IS_HASH_DATATYPE(__DATATYPE__) (((__DATATYPE__) == HASH_DATATYPE_32B)|| \
Kojto 112:6f327212ef96 412 ((__DATATYPE__) == HASH_DATATYPE_16B)|| \
Kojto 112:6f327212ef96 413 ((__DATATYPE__) == HASH_DATATYPE_8B) || \
Kojto 112:6f327212ef96 414 ((__DATATYPE__) == HASH_DATATYPE_1B))
Kojto 112:6f327212ef96 415
Kojto 112:6f327212ef96 416
Kojto 112:6f327212ef96 417 #define IS_HASH_HMAC_KEYTYPE(__KEYTYPE__) (((__KEYTYPE__) == HASH_HMAC_KEYTYPE_SHORTKEY) || \
Kojto 112:6f327212ef96 418 ((__KEYTYPE__) == HASH_HMAC_KEYTYPE_LONGKEY))
Kojto 112:6f327212ef96 419
Kojto 112:6f327212ef96 420 #define IS_HASH_SHA1_BUFFER_SIZE(__SIZE__) ((((__SIZE__)%4) != 0)? 0U: 1U)
Kojto 112:6f327212ef96 421
Kojto 112:6f327212ef96 422 /**
Kojto 112:6f327212ef96 423 * @}
Kojto 112:6f327212ef96 424 */
Kojto 112:6f327212ef96 425
Kojto 112:6f327212ef96 426 /* Private functions ---------------------------------------------------------*/
Kojto 112:6f327212ef96 427 /** @defgroup HASH_Private_Functions HASH Private Functions
Kojto 112:6f327212ef96 428 * @{
Kojto 112:6f327212ef96 429 */
Kojto 112:6f327212ef96 430
Kojto 112:6f327212ef96 431 /**
Kojto 112:6f327212ef96 432 * @}
Kojto 112:6f327212ef96 433 */
Kojto 112:6f327212ef96 434
Kojto 112:6f327212ef96 435 #endif /* STM32F415xx || STM32F417xx || STM32F437xx || STM32F439xx || STM32F479xx */
Kojto 112:6f327212ef96 436 /**
Kojto 112:6f327212ef96 437 * @}
Kojto 112:6f327212ef96 438 */
Kojto 112:6f327212ef96 439
Kojto 112:6f327212ef96 440 /**
Kojto 112:6f327212ef96 441 * @}
Kojto 112:6f327212ef96 442 */
Kojto 112:6f327212ef96 443
Kojto 112:6f327212ef96 444 #ifdef __cplusplus
Kojto 112:6f327212ef96 445 }
Kojto 112:6f327212ef96 446 #endif
Kojto 112:6f327212ef96 447
Kojto 112:6f327212ef96 448
Kojto 112:6f327212ef96 449 #endif /* __STM32F4xx_HAL_HASH_H */
Kojto 112:6f327212ef96 450
Kojto 112:6f327212ef96 451 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/