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