SPKT

Dependencies:   F746_GUI SD_PlayerSkeleton F746_SAI_IO

Committer:
phungductung
Date:
Tue Jun 04 21:37:21 2019 +0000
Revision:
0:8ede47d38d10
SPKT

Who changed what in which revision?

UserRevisionLine numberNew contents of line
phungductung 0:8ede47d38d10 1 /**
phungductung 0:8ede47d38d10 2 ******************************************************************************
phungductung 0:8ede47d38d10 3 * @file stm32f7xx_hal_def.h
phungductung 0:8ede47d38d10 4 * @author MCD Application Team
phungductung 0:8ede47d38d10 5 * @version V1.0.4
phungductung 0:8ede47d38d10 6 * @date 09-December-2015
phungductung 0:8ede47d38d10 7 * @brief This file contains HAL common defines, enumeration, macros and
phungductung 0:8ede47d38d10 8 * structures definitions.
phungductung 0:8ede47d38d10 9 ******************************************************************************
phungductung 0:8ede47d38d10 10 * @attention
phungductung 0:8ede47d38d10 11 *
phungductung 0:8ede47d38d10 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
phungductung 0:8ede47d38d10 13 *
phungductung 0:8ede47d38d10 14 * Redistribution and use in source and binary forms, with or without modification,
phungductung 0:8ede47d38d10 15 * are permitted provided that the following conditions are met:
phungductung 0:8ede47d38d10 16 * 1. Redistributions of source code must retain the above copyright notice,
phungductung 0:8ede47d38d10 17 * this list of conditions and the following disclaimer.
phungductung 0:8ede47d38d10 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
phungductung 0:8ede47d38d10 19 * this list of conditions and the following disclaimer in the documentation
phungductung 0:8ede47d38d10 20 * and/or other materials provided with the distribution.
phungductung 0:8ede47d38d10 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
phungductung 0:8ede47d38d10 22 * may be used to endorse or promote products derived from this software
phungductung 0:8ede47d38d10 23 * without specific prior written permission.
phungductung 0:8ede47d38d10 24 *
phungductung 0:8ede47d38d10 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
phungductung 0:8ede47d38d10 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
phungductung 0:8ede47d38d10 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
phungductung 0:8ede47d38d10 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
phungductung 0:8ede47d38d10 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
phungductung 0:8ede47d38d10 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
phungductung 0:8ede47d38d10 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
phungductung 0:8ede47d38d10 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
phungductung 0:8ede47d38d10 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
phungductung 0:8ede47d38d10 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
phungductung 0:8ede47d38d10 35 *
phungductung 0:8ede47d38d10 36 ******************************************************************************
phungductung 0:8ede47d38d10 37 */
phungductung 0:8ede47d38d10 38
phungductung 0:8ede47d38d10 39 /* Define to prevent recursive inclusion -------------------------------------*/
phungductung 0:8ede47d38d10 40 #ifndef __STM32F7xx_HAL_DEF
phungductung 0:8ede47d38d10 41 #define __STM32F7xx_HAL_DEF
phungductung 0:8ede47d38d10 42
phungductung 0:8ede47d38d10 43 #ifdef __cplusplus
phungductung 0:8ede47d38d10 44 extern "C" {
phungductung 0:8ede47d38d10 45 #endif
phungductung 0:8ede47d38d10 46
phungductung 0:8ede47d38d10 47 /* Includes ------------------------------------------------------------------*/
phungductung 0:8ede47d38d10 48 #include "stm32f7xx.h"
phungductung 0:8ede47d38d10 49 #include "stm32_hal_legacy.h"
phungductung 0:8ede47d38d10 50 #include <stdio.h>
phungductung 0:8ede47d38d10 51 /* Exported types ------------------------------------------------------------*/
phungductung 0:8ede47d38d10 52
phungductung 0:8ede47d38d10 53 /**
phungductung 0:8ede47d38d10 54 * @brief HAL Status structures definition
phungductung 0:8ede47d38d10 55 */
phungductung 0:8ede47d38d10 56 typedef enum
phungductung 0:8ede47d38d10 57 {
phungductung 0:8ede47d38d10 58 HAL_OK = 0x00,
phungductung 0:8ede47d38d10 59 HAL_ERROR = 0x01,
phungductung 0:8ede47d38d10 60 HAL_BUSY = 0x02,
phungductung 0:8ede47d38d10 61 HAL_TIMEOUT = 0x03
phungductung 0:8ede47d38d10 62 } HAL_StatusTypeDef;
phungductung 0:8ede47d38d10 63
phungductung 0:8ede47d38d10 64 /**
phungductung 0:8ede47d38d10 65 * @brief HAL Lock structures definition
phungductung 0:8ede47d38d10 66 */
phungductung 0:8ede47d38d10 67 typedef enum
phungductung 0:8ede47d38d10 68 {
phungductung 0:8ede47d38d10 69 HAL_UNLOCKED = 0x00,
phungductung 0:8ede47d38d10 70 HAL_LOCKED = 0x01
phungductung 0:8ede47d38d10 71 } HAL_LockTypeDef;
phungductung 0:8ede47d38d10 72
phungductung 0:8ede47d38d10 73 /* Exported macro ------------------------------------------------------------*/
phungductung 0:8ede47d38d10 74 #define HAL_MAX_DELAY 0xFFFFFFFF
phungductung 0:8ede47d38d10 75
phungductung 0:8ede47d38d10 76 #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET)
phungductung 0:8ede47d38d10 77 #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET)
phungductung 0:8ede47d38d10 78
phungductung 0:8ede47d38d10 79 #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
phungductung 0:8ede47d38d10 80 do{ \
phungductung 0:8ede47d38d10 81 (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
phungductung 0:8ede47d38d10 82 (__DMA_HANDLE__).Parent = (__HANDLE__); \
phungductung 0:8ede47d38d10 83 } while(0)
phungductung 0:8ede47d38d10 84
phungductung 0:8ede47d38d10 85 #define UNUSED(x) ((void)(x))
phungductung 0:8ede47d38d10 86
phungductung 0:8ede47d38d10 87 /** @brief Reset the Handle's State field.
phungductung 0:8ede47d38d10 88 * @param __HANDLE__: specifies the Peripheral Handle.
phungductung 0:8ede47d38d10 89 * @note This macro can be used for the following purpose:
phungductung 0:8ede47d38d10 90 * - When the Handle is declared as local variable; before passing it as parameter
phungductung 0:8ede47d38d10 91 * to HAL_PPP_Init() for the first time, it is mandatory to use this macro
phungductung 0:8ede47d38d10 92 * to set to 0 the Handle's "State" field.
phungductung 0:8ede47d38d10 93 * Otherwise, "State" field may have any random value and the first time the function
phungductung 0:8ede47d38d10 94 * HAL_PPP_Init() is called, the low level hardware initialization will be missed
phungductung 0:8ede47d38d10 95 * (i.e. HAL_PPP_MspInit() will not be executed).
phungductung 0:8ede47d38d10 96 * - When there is a need to reconfigure the low level hardware: instead of calling
phungductung 0:8ede47d38d10 97 * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init().
phungductung 0:8ede47d38d10 98 * In this later function, when the Handle's "State" field is set to 0, it will execute the function
phungductung 0:8ede47d38d10 99 * HAL_PPP_MspInit() which will reconfigure the low level hardware.
phungductung 0:8ede47d38d10 100 * @retval None
phungductung 0:8ede47d38d10 101 */
phungductung 0:8ede47d38d10 102 #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0)
phungductung 0:8ede47d38d10 103
phungductung 0:8ede47d38d10 104 #if (USE_RTOS == 1)
phungductung 0:8ede47d38d10 105 /* Reserved for future use */
phungductung 0:8ede47d38d10 106 #error "USE_RTOS should be 0 in the current HAL release"
phungductung 0:8ede47d38d10 107 #else
phungductung 0:8ede47d38d10 108 #define __HAL_LOCK(__HANDLE__) \
phungductung 0:8ede47d38d10 109 do{ \
phungductung 0:8ede47d38d10 110 if((__HANDLE__)->Lock == HAL_LOCKED) \
phungductung 0:8ede47d38d10 111 { \
phungductung 0:8ede47d38d10 112 return HAL_BUSY; \
phungductung 0:8ede47d38d10 113 } \
phungductung 0:8ede47d38d10 114 else \
phungductung 0:8ede47d38d10 115 { \
phungductung 0:8ede47d38d10 116 (__HANDLE__)->Lock = HAL_LOCKED; \
phungductung 0:8ede47d38d10 117 } \
phungductung 0:8ede47d38d10 118 }while (0)
phungductung 0:8ede47d38d10 119
phungductung 0:8ede47d38d10 120 #define __HAL_UNLOCK(__HANDLE__) \
phungductung 0:8ede47d38d10 121 do{ \
phungductung 0:8ede47d38d10 122 (__HANDLE__)->Lock = HAL_UNLOCKED; \
phungductung 0:8ede47d38d10 123 }while (0)
phungductung 0:8ede47d38d10 124 #endif /* USE_RTOS */
phungductung 0:8ede47d38d10 125
phungductung 0:8ede47d38d10 126 #if defined ( __GNUC__ )
phungductung 0:8ede47d38d10 127 #ifndef __weak
phungductung 0:8ede47d38d10 128 #define __weak __attribute__((weak))
phungductung 0:8ede47d38d10 129 #endif /* __weak */
phungductung 0:8ede47d38d10 130 #ifndef __packed
phungductung 0:8ede47d38d10 131 #define __packed __attribute__((__packed__))
phungductung 0:8ede47d38d10 132 #endif /* __packed */
phungductung 0:8ede47d38d10 133 #endif /* __GNUC__ */
phungductung 0:8ede47d38d10 134
phungductung 0:8ede47d38d10 135
phungductung 0:8ede47d38d10 136 /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
phungductung 0:8ede47d38d10 137 #if defined (__GNUC__) /* GNU Compiler */
phungductung 0:8ede47d38d10 138 #ifndef __ALIGN_END
phungductung 0:8ede47d38d10 139 #define __ALIGN_END __attribute__ ((aligned (4)))
phungductung 0:8ede47d38d10 140 #endif /* __ALIGN_END */
phungductung 0:8ede47d38d10 141 #ifndef __ALIGN_BEGIN
phungductung 0:8ede47d38d10 142 #define __ALIGN_BEGIN
phungductung 0:8ede47d38d10 143 #endif /* __ALIGN_BEGIN */
phungductung 0:8ede47d38d10 144 #else
phungductung 0:8ede47d38d10 145 #ifndef __ALIGN_END
phungductung 0:8ede47d38d10 146 #define __ALIGN_END
phungductung 0:8ede47d38d10 147 #endif /* __ALIGN_END */
phungductung 0:8ede47d38d10 148 #ifndef __ALIGN_BEGIN
phungductung 0:8ede47d38d10 149 #if defined (__CC_ARM) /* ARM Compiler */
phungductung 0:8ede47d38d10 150 #define __ALIGN_BEGIN __align(4)
phungductung 0:8ede47d38d10 151 #elif defined (__ICCARM__) /* IAR Compiler */
phungductung 0:8ede47d38d10 152 #define __ALIGN_BEGIN
phungductung 0:8ede47d38d10 153 #endif /* __CC_ARM */
phungductung 0:8ede47d38d10 154 #endif /* __ALIGN_BEGIN */
phungductung 0:8ede47d38d10 155 #endif /* __GNUC__ */
phungductung 0:8ede47d38d10 156
phungductung 0:8ede47d38d10 157
phungductung 0:8ede47d38d10 158 /**
phungductung 0:8ede47d38d10 159 * @brief __RAM_FUNC definition
phungductung 0:8ede47d38d10 160 */
phungductung 0:8ede47d38d10 161 #if defined ( __CC_ARM )
phungductung 0:8ede47d38d10 162 /* ARM Compiler
phungductung 0:8ede47d38d10 163 ------------
phungductung 0:8ede47d38d10 164 RAM functions are defined using the toolchain options.
phungductung 0:8ede47d38d10 165 Functions that are executed in RAM should reside in a separate source module.
phungductung 0:8ede47d38d10 166 Using the 'Options for File' dialog you can simply change the 'Code / Const'
phungductung 0:8ede47d38d10 167 area of a module to a memory space in physical RAM.
phungductung 0:8ede47d38d10 168 Available memory areas are declared in the 'Target' tab of the 'Options for Target'
phungductung 0:8ede47d38d10 169 dialog.
phungductung 0:8ede47d38d10 170 */
phungductung 0:8ede47d38d10 171 #define __RAM_FUNC HAL_StatusTypeDef
phungductung 0:8ede47d38d10 172
phungductung 0:8ede47d38d10 173 #elif defined ( __ICCARM__ )
phungductung 0:8ede47d38d10 174 /* ICCARM Compiler
phungductung 0:8ede47d38d10 175 ---------------
phungductung 0:8ede47d38d10 176 RAM functions are defined using a specific toolchain keyword "__ramfunc".
phungductung 0:8ede47d38d10 177 */
phungductung 0:8ede47d38d10 178 #define __RAM_FUNC __ramfunc HAL_StatusTypeDef
phungductung 0:8ede47d38d10 179
phungductung 0:8ede47d38d10 180 #elif defined ( __GNUC__ )
phungductung 0:8ede47d38d10 181 /* GNU Compiler
phungductung 0:8ede47d38d10 182 ------------
phungductung 0:8ede47d38d10 183 RAM functions are defined using a specific toolchain attribute
phungductung 0:8ede47d38d10 184 "__attribute__((section(".RamFunc")))".
phungductung 0:8ede47d38d10 185 */
phungductung 0:8ede47d38d10 186 #define __RAM_FUNC HAL_StatusTypeDef __attribute__((section(".RamFunc")))
phungductung 0:8ede47d38d10 187
phungductung 0:8ede47d38d10 188 #endif
phungductung 0:8ede47d38d10 189
phungductung 0:8ede47d38d10 190 /**
phungductung 0:8ede47d38d10 191 * @brief __NOINLINE definition
phungductung 0:8ede47d38d10 192 */
phungductung 0:8ede47d38d10 193 #if defined ( __CC_ARM ) || defined ( __GNUC__ )
phungductung 0:8ede47d38d10 194 /* ARM & GNUCompiler
phungductung 0:8ede47d38d10 195 ----------------
phungductung 0:8ede47d38d10 196 */
phungductung 0:8ede47d38d10 197 #define __NOINLINE __attribute__ ( (noinline) )
phungductung 0:8ede47d38d10 198
phungductung 0:8ede47d38d10 199 #elif defined ( __ICCARM__ )
phungductung 0:8ede47d38d10 200 /* ICCARM Compiler
phungductung 0:8ede47d38d10 201 ---------------
phungductung 0:8ede47d38d10 202 */
phungductung 0:8ede47d38d10 203 #define __NOINLINE _Pragma("optimize = no_inline")
phungductung 0:8ede47d38d10 204
phungductung 0:8ede47d38d10 205 #endif
phungductung 0:8ede47d38d10 206
phungductung 0:8ede47d38d10 207 #ifdef __cplusplus
phungductung 0:8ede47d38d10 208 }
phungductung 0:8ede47d38d10 209 #endif
phungductung 0:8ede47d38d10 210
phungductung 0:8ede47d38d10 211 #endif /* ___STM32F7xx_HAL_DEF */
phungductung 0:8ede47d38d10 212
phungductung 0:8ede47d38d10 213 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/