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_hash.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 HASH 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_HASH_H
Kojto 107:4f6c30876dfa 40 #define __STM32F7xx_HAL_HASH_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 #if defined(STM32F756xx)
Kojto 107:4f6c30876dfa 47 /* Includes ------------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 48 #include "stm32f7xx_hal_def.h"
Kojto 107:4f6c30876dfa 49
Kojto 107:4f6c30876dfa 50 /** @addtogroup STM32F7xx_HAL_Driver
Kojto 107:4f6c30876dfa 51 * @{
Kojto 107:4f6c30876dfa 52 */
Kojto 107:4f6c30876dfa 53
Kojto 107:4f6c30876dfa 54 /** @addtogroup HASH
Kojto 107:4f6c30876dfa 55 * @brief HASH HAL module driver
Kojto 107:4f6c30876dfa 56 * @{
Kojto 107:4f6c30876dfa 57 */
Kojto 107:4f6c30876dfa 58
Kojto 107:4f6c30876dfa 59 /* Exported types ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 60 /** @defgroup HASH_Exported_Types HASH Exported Types
Kojto 107:4f6c30876dfa 61 * @{
Kojto 107:4f6c30876dfa 62 */
Kojto 107:4f6c30876dfa 63
Kojto 107:4f6c30876dfa 64 /** @defgroup HASH_Exported_Types_Group1 HASH Configuration Structure definition
Kojto 107:4f6c30876dfa 65 * @{
Kojto 107:4f6c30876dfa 66 */
Kojto 107:4f6c30876dfa 67
Kojto 107:4f6c30876dfa 68 typedef struct
Kojto 107:4f6c30876dfa 69 {
Kojto 107:4f6c30876dfa 70 uint32_t DataType; /*!< 32-bit data, 16-bit data, 8-bit data or 1-bit string.
Kojto 107:4f6c30876dfa 71 This parameter can be a value of @ref HASH_Data_Type */
Kojto 107:4f6c30876dfa 72
Kojto 107:4f6c30876dfa 73 uint32_t KeySize; /*!< The key size is used only in HMAC operation */
Kojto 107:4f6c30876dfa 74
Kojto 107:4f6c30876dfa 75 uint8_t* pKey; /*!< The key is used only in HMAC operation */
Kojto 107:4f6c30876dfa 76 }HASH_InitTypeDef;
Kojto 107:4f6c30876dfa 77
Kojto 107:4f6c30876dfa 78 /**
Kojto 107:4f6c30876dfa 79 * @}
Kojto 107:4f6c30876dfa 80 */
Kojto 107:4f6c30876dfa 81
Kojto 107:4f6c30876dfa 82 /** @defgroup HASH_Exported_Types_Group2 HASH State structures definition
Kojto 107:4f6c30876dfa 83 * @{
Kojto 107:4f6c30876dfa 84 */
Kojto 107:4f6c30876dfa 85
Kojto 107:4f6c30876dfa 86 typedef enum
Kojto 107:4f6c30876dfa 87 {
Kojto 107:4f6c30876dfa 88 HAL_HASH_STATE_RESET = 0x00, /*!< HASH not yet initialized or disabled */
Kojto 107:4f6c30876dfa 89 HAL_HASH_STATE_READY = 0x01, /*!< HASH initialized and ready for use */
Kojto 107:4f6c30876dfa 90 HAL_HASH_STATE_BUSY = 0x02, /*!< HASH internal process is ongoing */
Kojto 107:4f6c30876dfa 91 HAL_HASH_STATE_TIMEOUT = 0x03, /*!< HASH timeout state */
Kojto 107:4f6c30876dfa 92 HAL_HASH_STATE_ERROR = 0x04 /*!< HASH error state */
Kojto 116:c0f6e94411f5 93 }HAL_HASH_StateTypeDef;
Kojto 107:4f6c30876dfa 94
Kojto 107:4f6c30876dfa 95 /**
Kojto 107:4f6c30876dfa 96 * @}
Kojto 107:4f6c30876dfa 97 */
Kojto 107:4f6c30876dfa 98
Kojto 107:4f6c30876dfa 99 /** @defgroup HASH_Exported_Types_Group3 HASH phase structures definition
Kojto 107:4f6c30876dfa 100 * @{
Kojto 107:4f6c30876dfa 101 */
Kojto 107:4f6c30876dfa 102
Kojto 107:4f6c30876dfa 103 typedef enum
Kojto 107:4f6c30876dfa 104 {
Kojto 107:4f6c30876dfa 105 HAL_HASH_PHASE_READY = 0x01, /*!< HASH peripheral is ready for initialization */
Kojto 107:4f6c30876dfa 106 HAL_HASH_PHASE_PROCESS = 0x02, /*!< HASH peripheral is in processing phase */
Kojto 107:4f6c30876dfa 107 }HAL_HASHPhaseTypeDef;
Kojto 107:4f6c30876dfa 108
Kojto 107:4f6c30876dfa 109 /**
Kojto 107:4f6c30876dfa 110 * @}
Kojto 107:4f6c30876dfa 111 */
Kojto 107:4f6c30876dfa 112
Kojto 107:4f6c30876dfa 113 /** @defgroup HASH_Exported_Types_Group4 HASH Handle structures definition
Kojto 107:4f6c30876dfa 114 * @{
Kojto 107:4f6c30876dfa 115 */
Kojto 107:4f6c30876dfa 116
Kojto 107:4f6c30876dfa 117 typedef struct
Kojto 107:4f6c30876dfa 118 {
Kojto 107:4f6c30876dfa 119 HASH_InitTypeDef Init; /*!< HASH required parameters */
Kojto 107:4f6c30876dfa 120
Kojto 107:4f6c30876dfa 121 uint8_t *pHashInBuffPtr; /*!< Pointer to input buffer */
Kojto 107:4f6c30876dfa 122
Kojto 107:4f6c30876dfa 123 uint8_t *pHashOutBuffPtr; /*!< Pointer to input buffer */
Kojto 107:4f6c30876dfa 124
Kojto 107:4f6c30876dfa 125 __IO uint32_t HashBuffSize; /*!< Size of buffer to be processed */
Kojto 107:4f6c30876dfa 126
Kojto 107:4f6c30876dfa 127 __IO uint32_t HashInCount; /*!< Counter of inputed data */
Kojto 107:4f6c30876dfa 128
Kojto 107:4f6c30876dfa 129 __IO uint32_t HashITCounter; /*!< Counter of issued interrupts */
Kojto 107:4f6c30876dfa 130
Kojto 107:4f6c30876dfa 131 HAL_StatusTypeDef Status; /*!< HASH peripheral status */
Kojto 107:4f6c30876dfa 132
Kojto 116:c0f6e94411f5 133 HAL_HASH_PhaseTypeDef Phase; /*!< HASH peripheral phase */
Kojto 107:4f6c30876dfa 134
Kojto 107:4f6c30876dfa 135 DMA_HandleTypeDef *hdmain; /*!< HASH In DMA handle parameters */
Kojto 107:4f6c30876dfa 136
Kojto 107:4f6c30876dfa 137 HAL_LockTypeDef Lock; /*!< HASH locking object */
Kojto 107:4f6c30876dfa 138
Kojto 116:c0f6e94411f5 139 __IO HAL_HASH_StateTypeDef State; /*!< HASH peripheral state */
Kojto 107:4f6c30876dfa 140 } HASH_HandleTypeDef;
Kojto 107:4f6c30876dfa 141
Kojto 107:4f6c30876dfa 142 /**
Kojto 107:4f6c30876dfa 143 * @}
Kojto 107:4f6c30876dfa 144 */
Kojto 107:4f6c30876dfa 145
Kojto 107:4f6c30876dfa 146
Kojto 107:4f6c30876dfa 147 /**
Kojto 107:4f6c30876dfa 148 * @}
Kojto 107:4f6c30876dfa 149 */
Kojto 107:4f6c30876dfa 150
Kojto 107:4f6c30876dfa 151 /* Exported constants --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 152 /** @defgroup HASH_Exported_Constants HASH Exported Constants
Kojto 107:4f6c30876dfa 153 * @{
Kojto 107:4f6c30876dfa 154 */
Kojto 107:4f6c30876dfa 155
Kojto 107:4f6c30876dfa 156 /** @defgroup HASH_Exported_Constants_Group1 HASH Algorithm Selection
Kojto 107:4f6c30876dfa 157 * @{
Kojto 107:4f6c30876dfa 158 */
Kojto 107:4f6c30876dfa 159 #define HASH_ALGOSELECTION_SHA1 ((uint32_t)0x0000) /*!< HASH function is SHA1 */
Kojto 107:4f6c30876dfa 160 #define HASH_ALGOSELECTION_SHA224 HASH_CR_ALGO_1 /*!< HASH function is SHA224 */
Kojto 107:4f6c30876dfa 161 #define HASH_ALGOSELECTION_SHA256 HASH_CR_ALGO /*!< HASH function is SHA256 */
Kojto 107:4f6c30876dfa 162 #define HASH_ALGOSELECTION_MD5 HASH_CR_ALGO_0 /*!< HASH function is MD5 */
Kojto 107:4f6c30876dfa 163 /**
Kojto 107:4f6c30876dfa 164 * @}
Kojto 107:4f6c30876dfa 165 */
Kojto 107:4f6c30876dfa 166
Kojto 107:4f6c30876dfa 167 /** @defgroup HASH_Exported_Constants_Group2 HASH Algorithm Mode
Kojto 107:4f6c30876dfa 168 * @{
Kojto 107:4f6c30876dfa 169 */
Kojto 107:4f6c30876dfa 170 #define HASH_ALGOMODE_HASH ((uint32_t)0x00000000) /*!< Algorithm is HASH */
Kojto 107:4f6c30876dfa 171 #define HASH_ALGOMODE_HMAC HASH_CR_MODE /*!< Algorithm is HMAC */
Kojto 107:4f6c30876dfa 172 /**
Kojto 107:4f6c30876dfa 173 * @}
Kojto 107:4f6c30876dfa 174 */
Kojto 107:4f6c30876dfa 175
Kojto 107:4f6c30876dfa 176 /** @defgroup HASH_Data_Type HASH Data Type
Kojto 107:4f6c30876dfa 177 * @{
Kojto 107:4f6c30876dfa 178 */
Kojto 107:4f6c30876dfa 179 #define HASH_DATATYPE_32B ((uint32_t)0x0000) /*!< 32-bit data. No swapping */
Kojto 107:4f6c30876dfa 180 #define HASH_DATATYPE_16B HASH_CR_DATATYPE_0 /*!< 16-bit data. Each half word is swapped */
Kojto 107:4f6c30876dfa 181 #define HASH_DATATYPE_8B HASH_CR_DATATYPE_1 /*!< 8-bit data. All bytes are swapped */
Kojto 107:4f6c30876dfa 182 #define HASH_DATATYPE_1B HASH_CR_DATATYPE /*!< 1-bit data. In the word all bits are swapped */
Kojto 107:4f6c30876dfa 183 /**
Kojto 107:4f6c30876dfa 184 * @}
Kojto 107:4f6c30876dfa 185 */
Kojto 107:4f6c30876dfa 186
Kojto 107:4f6c30876dfa 187 /** @defgroup HASH_Exported_Constants_Group4 HASH HMAC Long key
Kojto 107:4f6c30876dfa 188 * @brief HASH HMAC Long key used only for HMAC mode
Kojto 107:4f6c30876dfa 189 * @{
Kojto 107:4f6c30876dfa 190 */
Kojto 107:4f6c30876dfa 191 #define HASH_HMAC_KEYTYPE_SHORTKEY ((uint32_t)0x00000000) /*!< HMAC Key is <= 64 bytes */
Kojto 107:4f6c30876dfa 192 #define HASH_HMAC_KEYTYPE_LONGKEY HASH_CR_LKEY /*!< HMAC Key is > 64 bytes */
Kojto 107:4f6c30876dfa 193 /**
Kojto 107:4f6c30876dfa 194 * @}
Kojto 107:4f6c30876dfa 195 */
Kojto 107:4f6c30876dfa 196
Kojto 107:4f6c30876dfa 197 /** @defgroup HASH_Exported_Constants_Group5 HASH Flags definition
Kojto 107:4f6c30876dfa 198 * @{
Kojto 107:4f6c30876dfa 199 */
Kojto 107:4f6c30876dfa 200 #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 107:4f6c30876dfa 201 #define HASH_FLAG_DCIS HASH_SR_DCIS /*!< Digest calculation complete */
Kojto 107:4f6c30876dfa 202 #define HASH_FLAG_DMAS HASH_SR_DMAS /*!< DMA interface is enabled (DMAE=1) or a transfer is ongoing */
Kojto 107:4f6c30876dfa 203 #define HASH_FLAG_BUSY HASH_SR_BUSY /*!< The hash core is Busy : processing a block of data */
Kojto 107:4f6c30876dfa 204 #define HASH_FLAG_DINNE HASH_CR_DINNE /*!< DIN not empty : The input buffer contains at least one word of data */
Kojto 107:4f6c30876dfa 205 /**
Kojto 107:4f6c30876dfa 206 * @}
Kojto 107:4f6c30876dfa 207 */
Kojto 107:4f6c30876dfa 208
Kojto 107:4f6c30876dfa 209 /** @defgroup HASH_Exported_Constants_Group6 HASH Interrupts definition
Kojto 107:4f6c30876dfa 210 * @{
Kojto 107:4f6c30876dfa 211 */
Kojto 107:4f6c30876dfa 212 #define HASH_IT_DINI HASH_IMR_DINIE /*!< A new block can be entered into the input buffer (DIN) */
Kojto 107:4f6c30876dfa 213 #define HASH_IT_DCI HASH_IMR_DCIE /*!< Digest calculation complete */
Kojto 107:4f6c30876dfa 214 /**
Kojto 107:4f6c30876dfa 215 * @}
Kojto 107:4f6c30876dfa 216 */
Kojto 107:4f6c30876dfa 217
Kojto 107:4f6c30876dfa 218 /**
Kojto 107:4f6c30876dfa 219 * @}
Kojto 107:4f6c30876dfa 220 */
Kojto 107:4f6c30876dfa 221
Kojto 107:4f6c30876dfa 222 /* Exported macro ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 223 /** @defgroup HASH_Exported_Macros HASH Exported Macros
Kojto 107:4f6c30876dfa 224 * @{
Kojto 107:4f6c30876dfa 225 */
Kojto 107:4f6c30876dfa 226
Kojto 107:4f6c30876dfa 227 /** @brief Reset HASH handle state
Kojto 107:4f6c30876dfa 228 * @param __HANDLE__: specifies the HASH handle.
Kojto 107:4f6c30876dfa 229 * @retval None
Kojto 107:4f6c30876dfa 230 */
Kojto 107:4f6c30876dfa 231 #define __HAL_HASH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_HASH_STATE_RESET)
Kojto 107:4f6c30876dfa 232
Kojto 107:4f6c30876dfa 233 /** @brief Check whether the specified HASH flag is set or not.
Kojto 107:4f6c30876dfa 234 * @param __FLAG__: specifies the flag to check.
Kojto 107:4f6c30876dfa 235 * This parameter can be one of the following values:
Kojto 107:4f6c30876dfa 236 * @arg HASH_FLAG_DINIS: A new block can be entered into the input buffer.
Kojto 107:4f6c30876dfa 237 * @arg HASH_FLAG_DCIS: Digest calculation complete
Kojto 107:4f6c30876dfa 238 * @arg HASH_FLAG_DMAS: DMA interface is enabled (DMAE=1) or a transfer is ongoing
Kojto 107:4f6c30876dfa 239 * @arg HASH_FLAG_BUSY: The hash core is Busy : processing a block of data
Kojto 107:4f6c30876dfa 240 * @arg HASH_FLAG_DINNE: DIN not empty : The input buffer contains at least one word of data
Kojto 107:4f6c30876dfa 241 * @retval The new state of __FLAG__ (TRUE or FALSE).
Kojto 107:4f6c30876dfa 242 */
Kojto 107:4f6c30876dfa 243 #define __HAL_HASH_GET_FLAG(__FLAG__) (((__FLAG__) > 8U) ? ((HASH->CR & (__FLAG__)) == (__FLAG__)) :\
Kojto 107:4f6c30876dfa 244 ((HASH->SR & (__FLAG__)) == (__FLAG__)))
Kojto 107:4f6c30876dfa 245
Kojto 107:4f6c30876dfa 246 /**
Kojto 107:4f6c30876dfa 247 * @brief Enable the multiple DMA mode.
Kojto 107:4f6c30876dfa 248 * This feature is available only in STM32F429x and STM32F439x devices.
Kojto 107:4f6c30876dfa 249 * @retval None
Kojto 107:4f6c30876dfa 250 */
Kojto 107:4f6c30876dfa 251 #define __HAL_HASH_SET_MDMAT() HASH->CR |= HASH_CR_MDMAT
Kojto 107:4f6c30876dfa 252
Kojto 107:4f6c30876dfa 253 /**
Kojto 107:4f6c30876dfa 254 * @brief Disable the multiple DMA mode.
Kojto 107:4f6c30876dfa 255 * @retval None
Kojto 107:4f6c30876dfa 256 */
Kojto 107:4f6c30876dfa 257 #define __HAL_HASH_RESET_MDMAT() HASH->CR &= (uint32_t)(~HASH_CR_MDMAT)
Kojto 107:4f6c30876dfa 258
Kojto 107:4f6c30876dfa 259 /**
Kojto 107:4f6c30876dfa 260 * @brief Start the digest computation
Kojto 107:4f6c30876dfa 261 * @retval None
Kojto 107:4f6c30876dfa 262 */
Kojto 107:4f6c30876dfa 263 #define __HAL_HASH_START_DIGEST() HASH->STR |= HASH_STR_DCAL
Kojto 107:4f6c30876dfa 264
Kojto 107:4f6c30876dfa 265 /**
Kojto 107:4f6c30876dfa 266 * @brief Set the number of valid bits in last word written in Data register
Kojto 107:4f6c30876dfa 267 * @param SIZE: size in byte of last data written in Data register.
Kojto 107:4f6c30876dfa 268 * @retval None
Kojto 107:4f6c30876dfa 269 */
Kojto 107:4f6c30876dfa 270 #define __HAL_HASH_SET_NBVALIDBITS(SIZE) do{HASH->STR &= ~(HASH_STR_NBW);\
Kojto 107:4f6c30876dfa 271 HASH->STR |= 8 * ((SIZE) % 4);\
Kojto 107:4f6c30876dfa 272 }while(0)
Kojto 107:4f6c30876dfa 273
Kojto 107:4f6c30876dfa 274 /**
Kojto 107:4f6c30876dfa 275 * @}
Kojto 107:4f6c30876dfa 276 */
Kojto 107:4f6c30876dfa 277
Kojto 107:4f6c30876dfa 278 /* Include HASH HAL Extension module */
Kojto 107:4f6c30876dfa 279 #include "stm32f7xx_hal_hash_ex.h"
Kojto 107:4f6c30876dfa 280 /* Exported functions --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 281
Kojto 107:4f6c30876dfa 282 /** @defgroup HASH_Exported_Functions HASH Exported Functions
Kojto 107:4f6c30876dfa 283 * @{
Kojto 107:4f6c30876dfa 284 */
Kojto 107:4f6c30876dfa 285
Kojto 107:4f6c30876dfa 286 /** @addtogroup HASH_Exported_Functions_Group1
Kojto 107:4f6c30876dfa 287 * @{
Kojto 107:4f6c30876dfa 288 */
Kojto 107:4f6c30876dfa 289 HAL_StatusTypeDef HAL_HASH_Init(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 290 HAL_StatusTypeDef HAL_HASH_DeInit(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 291 /**
Kojto 107:4f6c30876dfa 292 * @}
Kojto 107:4f6c30876dfa 293 */
Kojto 107:4f6c30876dfa 294
Kojto 107:4f6c30876dfa 295 /** @addtogroup HASH_Exported_Functions_Group2
Kojto 107:4f6c30876dfa 296 * @{
Kojto 107:4f6c30876dfa 297 */
Kojto 107:4f6c30876dfa 298 HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 107:4f6c30876dfa 299 HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 107:4f6c30876dfa 300 HAL_StatusTypeDef HAL_HASH_MD5_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 107:4f6c30876dfa 301 HAL_StatusTypeDef HAL_HASH_SHA1_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 107:4f6c30876dfa 302 /**
Kojto 107:4f6c30876dfa 303 * @}
Kojto 107:4f6c30876dfa 304 */
Kojto 107:4f6c30876dfa 305
Kojto 107:4f6c30876dfa 306 /** @addtogroup HASH_Exported_Functions_Group3
Kojto 107:4f6c30876dfa 307 * @{
Kojto 107:4f6c30876dfa 308 */
Kojto 107:4f6c30876dfa 309 HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 107:4f6c30876dfa 310 HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 107:4f6c30876dfa 311 /**
Kojto 107:4f6c30876dfa 312 * @}
Kojto 107:4f6c30876dfa 313 */
Kojto 107:4f6c30876dfa 314
Kojto 107:4f6c30876dfa 315 /** @addtogroup HASH_Exported_Functions_Group4
Kojto 107:4f6c30876dfa 316 * @{
Kojto 107:4f6c30876dfa 317 */
Kojto 107:4f6c30876dfa 318 HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
Kojto 107:4f6c30876dfa 319 HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
Kojto 107:4f6c30876dfa 320 /**
Kojto 107:4f6c30876dfa 321 * @}
Kojto 107:4f6c30876dfa 322 */
Kojto 107:4f6c30876dfa 323
Kojto 107:4f6c30876dfa 324 /** @addtogroup HASH_Exported_Functions_Group5
Kojto 107:4f6c30876dfa 325 * @{
Kojto 107:4f6c30876dfa 326 */
Kojto 107:4f6c30876dfa 327 HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 107:4f6c30876dfa 328 HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 107:4f6c30876dfa 329 HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 107:4f6c30876dfa 330 HAL_StatusTypeDef HAL_HASH_MD5_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
Kojto 107:4f6c30876dfa 331 /**
Kojto 107:4f6c30876dfa 332 * @}
Kojto 107:4f6c30876dfa 333 */
Kojto 107:4f6c30876dfa 334
Kojto 107:4f6c30876dfa 335 /** @addtogroup HASH_Exported_Functions_Group6
Kojto 107:4f6c30876dfa 336 * @{
Kojto 107:4f6c30876dfa 337 */
Kojto 107:4f6c30876dfa 338 HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 107:4f6c30876dfa 339 HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
Kojto 107:4f6c30876dfa 340 /**
Kojto 107:4f6c30876dfa 341 * @}
Kojto 107:4f6c30876dfa 342 */
Kojto 107:4f6c30876dfa 343
Kojto 107:4f6c30876dfa 344 /** @addtogroup HASH_Exported_Functions_Group7
Kojto 107:4f6c30876dfa 345 * @{
Kojto 107:4f6c30876dfa 346 */
Kojto 107:4f6c30876dfa 347 void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 348 /**
Kojto 107:4f6c30876dfa 349 * @}
Kojto 107:4f6c30876dfa 350 */
Kojto 107:4f6c30876dfa 351
Kojto 107:4f6c30876dfa 352 /** @addtogroup HASH_Exported_Functions_Group8
Kojto 107:4f6c30876dfa 353 * @{
Kojto 107:4f6c30876dfa 354 */
Kojto 116:c0f6e94411f5 355 HAL_HASH_StateTypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 356 void HAL_HASH_MspInit(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 357 void HAL_HASH_MspDeInit(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 358 void HAL_HASH_InCpltCallback(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 359 void HAL_HASH_DgstCpltCallback(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 360 void HAL_HASH_ErrorCallback(HASH_HandleTypeDef *hhash);
Kojto 107:4f6c30876dfa 361 /**
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 types -------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 370 /** @defgroup HASH_Private_Types HASH Private Types
Kojto 107:4f6c30876dfa 371 * @{
Kojto 107:4f6c30876dfa 372 */
Kojto 107:4f6c30876dfa 373
Kojto 107:4f6c30876dfa 374 /**
Kojto 107:4f6c30876dfa 375 * @}
Kojto 107:4f6c30876dfa 376 */
Kojto 107:4f6c30876dfa 377
Kojto 107:4f6c30876dfa 378 /* Private variables ---------------------------------------------------------*/
Kojto 107:4f6c30876dfa 379 /** @defgroup HASH_Private_Variables HASH Private Variables
Kojto 107:4f6c30876dfa 380 * @{
Kojto 107:4f6c30876dfa 381 */
Kojto 107:4f6c30876dfa 382
Kojto 107:4f6c30876dfa 383 /**
Kojto 107:4f6c30876dfa 384 * @}
Kojto 107:4f6c30876dfa 385 */
Kojto 107:4f6c30876dfa 386
Kojto 107:4f6c30876dfa 387 /* Private constants ---------------------------------------------------------*/
Kojto 107:4f6c30876dfa 388 /** @defgroup HASH_Private_Constants HASH Private Constants
Kojto 107:4f6c30876dfa 389 * @{
Kojto 107:4f6c30876dfa 390 */
Kojto 107:4f6c30876dfa 391
Kojto 107:4f6c30876dfa 392 /**
Kojto 107:4f6c30876dfa 393 * @}
Kojto 107:4f6c30876dfa 394 */
Kojto 107:4f6c30876dfa 395
Kojto 107:4f6c30876dfa 396 /* Private macros ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 397 /** @defgroup HASH_Private_Macros HASH Private Macros
Kojto 107:4f6c30876dfa 398 * @{
Kojto 107:4f6c30876dfa 399 */
Kojto 107:4f6c30876dfa 400 #define IS_HASH_ALGOSELECTION(__ALGOSELECTION__) (((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA1) || \
Kojto 107:4f6c30876dfa 401 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA224) || \
Kojto 107:4f6c30876dfa 402 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_SHA256) || \
Kojto 107:4f6c30876dfa 403 ((__ALGOSELECTION__) == HASH_ALGOSELECTION_MD5))
Kojto 107:4f6c30876dfa 404
Kojto 107:4f6c30876dfa 405
Kojto 107:4f6c30876dfa 406 #define IS_HASH_ALGOMODE(__ALGOMODE__) (((__ALGOMODE__) == HASH_ALGOMODE_HASH) || \
Kojto 107:4f6c30876dfa 407 ((__ALGOMODE__) == HASH_ALGOMODE_HMAC))
Kojto 107:4f6c30876dfa 408
Kojto 107:4f6c30876dfa 409
Kojto 107:4f6c30876dfa 410 #define IS_HASH_DATATYPE(__DATATYPE__) (((__DATATYPE__) == HASH_DATATYPE_32B)|| \
Kojto 107:4f6c30876dfa 411 ((__DATATYPE__) == HASH_DATATYPE_16B)|| \
Kojto 107:4f6c30876dfa 412 ((__DATATYPE__) == HASH_DATATYPE_8B) || \
Kojto 107:4f6c30876dfa 413 ((__DATATYPE__) == HASH_DATATYPE_1B))
Kojto 107:4f6c30876dfa 414
Kojto 107:4f6c30876dfa 415
Kojto 107:4f6c30876dfa 416 #define IS_HASH_HMAC_KEYTYPE(__KEYTYPE__) (((__KEYTYPE__) == HASH_HMAC_KEYTYPE_SHORTKEY) || \
Kojto 107:4f6c30876dfa 417 ((__KEYTYPE__) == HASH_HMAC_KEYTYPE_LONGKEY))
Kojto 107:4f6c30876dfa 418
Kojto 107:4f6c30876dfa 419 #define IS_HASH_SHA1_BUFFER_SIZE(__SIZE__) ((((__SIZE__)%4) != 0)? 0U: 1U)
Kojto 107:4f6c30876dfa 420
Kojto 107:4f6c30876dfa 421
Kojto 107:4f6c30876dfa 422 /**
Kojto 107:4f6c30876dfa 423 * @}
Kojto 107:4f6c30876dfa 424 */
Kojto 107:4f6c30876dfa 425
Kojto 107:4f6c30876dfa 426 /* Private functions ---------------------------------------------------------*/
Kojto 107:4f6c30876dfa 427 /** @defgroup HASH_Private_Functions HASH Private Functions
Kojto 107:4f6c30876dfa 428 * @{
Kojto 107:4f6c30876dfa 429 */
Kojto 107:4f6c30876dfa 430
Kojto 107:4f6c30876dfa 431 /**
Kojto 107:4f6c30876dfa 432 * @}
Kojto 107:4f6c30876dfa 433 */
Kojto 107:4f6c30876dfa 434
Kojto 107:4f6c30876dfa 435 /**
Kojto 107:4f6c30876dfa 436 * @}
Kojto 107:4f6c30876dfa 437 */
Kojto 107:4f6c30876dfa 438 #endif /* STM32F756xx */
Kojto 107:4f6c30876dfa 439 /**
Kojto 107:4f6c30876dfa 440 * @}
Kojto 107:4f6c30876dfa 441 */
Kojto 107:4f6c30876dfa 442
Kojto 107:4f6c30876dfa 443 #ifdef __cplusplus
Kojto 107:4f6c30876dfa 444 }
Kojto 107:4f6c30876dfa 445 #endif
Kojto 107:4f6c30876dfa 446
Kojto 107:4f6c30876dfa 447
Kojto 107:4f6c30876dfa 448 #endif /* __STM32F7xx_HAL_HASH_H */
Kojto 107:4f6c30876dfa 449
Kojto 107:4f6c30876dfa 450 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/