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