mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_DISCO_F407VG/stm32f4xx_hal_def.h@133:d4dda5c437f0, 2014-03-24 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Mar 24 17:45:07 2014 +0000
- Revision:
- 133:d4dda5c437f0
- Child:
- 242:7074e42da0b2
Synchronized with git revision 47b961246bed973fe4cb8932781ffc8025b78a61
Full URL: https://github.com/mbedmicro/mbed/commit/47b961246bed973fe4cb8932781ffc8025b78a61/
[STM32F4-Discovery (STM32F407VG)] initial port
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 133:d4dda5c437f0 | 1 | /** |
mbed_official | 133:d4dda5c437f0 | 2 | ****************************************************************************** |
mbed_official | 133:d4dda5c437f0 | 3 | * @file stm32f4xx_hal_def.h |
mbed_official | 133:d4dda5c437f0 | 4 | * @author MCD Application Team |
mbed_official | 133:d4dda5c437f0 | 5 | * @version V1.0.0 |
mbed_official | 133:d4dda5c437f0 | 6 | * @date 18-February-2014 |
mbed_official | 133:d4dda5c437f0 | 7 | * @brief This file contains HAL common defines, enumeration, macros and |
mbed_official | 133:d4dda5c437f0 | 8 | * structures definitions. |
mbed_official | 133:d4dda5c437f0 | 9 | ****************************************************************************** |
mbed_official | 133:d4dda5c437f0 | 10 | * @attention |
mbed_official | 133:d4dda5c437f0 | 11 | * |
mbed_official | 133:d4dda5c437f0 | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 133:d4dda5c437f0 | 13 | * |
mbed_official | 133:d4dda5c437f0 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 133:d4dda5c437f0 | 15 | * are permitted provided that the following conditions are met: |
mbed_official | 133:d4dda5c437f0 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 133:d4dda5c437f0 | 17 | * this list of conditions and the following disclaimer. |
mbed_official | 133:d4dda5c437f0 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 133:d4dda5c437f0 | 19 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 133:d4dda5c437f0 | 20 | * and/or other materials provided with the distribution. |
mbed_official | 133:d4dda5c437f0 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 133:d4dda5c437f0 | 22 | * may be used to endorse or promote products derived from this software |
mbed_official | 133:d4dda5c437f0 | 23 | * without specific prior written permission. |
mbed_official | 133:d4dda5c437f0 | 24 | * |
mbed_official | 133:d4dda5c437f0 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 133:d4dda5c437f0 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 133:d4dda5c437f0 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 133:d4dda5c437f0 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 133:d4dda5c437f0 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 133:d4dda5c437f0 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 133:d4dda5c437f0 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 133:d4dda5c437f0 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 133:d4dda5c437f0 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 133:d4dda5c437f0 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 133:d4dda5c437f0 | 35 | * |
mbed_official | 133:d4dda5c437f0 | 36 | ****************************************************************************** |
mbed_official | 133:d4dda5c437f0 | 37 | */ |
mbed_official | 133:d4dda5c437f0 | 38 | |
mbed_official | 133:d4dda5c437f0 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 40 | #ifndef __STM32F4xx_HAL_DEF |
mbed_official | 133:d4dda5c437f0 | 41 | #define __STM32F4xx_HAL_DEF |
mbed_official | 133:d4dda5c437f0 | 42 | |
mbed_official | 133:d4dda5c437f0 | 43 | #ifdef __cplusplus |
mbed_official | 133:d4dda5c437f0 | 44 | extern "C" { |
mbed_official | 133:d4dda5c437f0 | 45 | #endif |
mbed_official | 133:d4dda5c437f0 | 46 | |
mbed_official | 133:d4dda5c437f0 | 47 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 48 | #include "stm32f4xx.h" |
mbed_official | 133:d4dda5c437f0 | 49 | |
mbed_official | 133:d4dda5c437f0 | 50 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 51 | |
mbed_official | 133:d4dda5c437f0 | 52 | /** |
mbed_official | 133:d4dda5c437f0 | 53 | * @brief HAL Status structures definition |
mbed_official | 133:d4dda5c437f0 | 54 | */ |
mbed_official | 133:d4dda5c437f0 | 55 | typedef enum |
mbed_official | 133:d4dda5c437f0 | 56 | { |
mbed_official | 133:d4dda5c437f0 | 57 | HAL_OK = 0x00, |
mbed_official | 133:d4dda5c437f0 | 58 | HAL_ERROR = 0x01, |
mbed_official | 133:d4dda5c437f0 | 59 | HAL_BUSY = 0x02, |
mbed_official | 133:d4dda5c437f0 | 60 | HAL_TIMEOUT = 0x03 |
mbed_official | 133:d4dda5c437f0 | 61 | } HAL_StatusTypeDef; |
mbed_official | 133:d4dda5c437f0 | 62 | |
mbed_official | 133:d4dda5c437f0 | 63 | /** |
mbed_official | 133:d4dda5c437f0 | 64 | * @brief HAL Lock structures definition |
mbed_official | 133:d4dda5c437f0 | 65 | */ |
mbed_official | 133:d4dda5c437f0 | 66 | typedef enum |
mbed_official | 133:d4dda5c437f0 | 67 | { |
mbed_official | 133:d4dda5c437f0 | 68 | HAL_UNLOCKED = 0x00, |
mbed_official | 133:d4dda5c437f0 | 69 | HAL_LOCKED = 0x01 |
mbed_official | 133:d4dda5c437f0 | 70 | } HAL_LockTypeDef; |
mbed_official | 133:d4dda5c437f0 | 71 | |
mbed_official | 133:d4dda5c437f0 | 72 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 73 | #ifndef NULL |
mbed_official | 133:d4dda5c437f0 | 74 | #define NULL (void *) 0 |
mbed_official | 133:d4dda5c437f0 | 75 | #endif |
mbed_official | 133:d4dda5c437f0 | 76 | |
mbed_official | 133:d4dda5c437f0 | 77 | #define HAL_MAX_DELAY 0xFFFFFFFF |
mbed_official | 133:d4dda5c437f0 | 78 | |
mbed_official | 133:d4dda5c437f0 | 79 | #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET) |
mbed_official | 133:d4dda5c437f0 | 80 | #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET) |
mbed_official | 133:d4dda5c437f0 | 81 | |
mbed_official | 133:d4dda5c437f0 | 82 | #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_) \ |
mbed_official | 133:d4dda5c437f0 | 83 | do{ \ |
mbed_official | 133:d4dda5c437f0 | 84 | (__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_); \ |
mbed_official | 133:d4dda5c437f0 | 85 | (__DMA_HANDLE_).Parent = (__HANDLE__); \ |
mbed_official | 133:d4dda5c437f0 | 86 | } while(0) |
mbed_official | 133:d4dda5c437f0 | 87 | |
mbed_official | 133:d4dda5c437f0 | 88 | #if (USE_RTOS == 1) |
mbed_official | 133:d4dda5c437f0 | 89 | /* Reserved for future use */ |
mbed_official | 133:d4dda5c437f0 | 90 | #else |
mbed_official | 133:d4dda5c437f0 | 91 | #define __HAL_LOCK(__HANDLE__) \ |
mbed_official | 133:d4dda5c437f0 | 92 | do{ \ |
mbed_official | 133:d4dda5c437f0 | 93 | if((__HANDLE__)->Lock == HAL_LOCKED) \ |
mbed_official | 133:d4dda5c437f0 | 94 | { \ |
mbed_official | 133:d4dda5c437f0 | 95 | return HAL_BUSY; \ |
mbed_official | 133:d4dda5c437f0 | 96 | } \ |
mbed_official | 133:d4dda5c437f0 | 97 | else \ |
mbed_official | 133:d4dda5c437f0 | 98 | { \ |
mbed_official | 133:d4dda5c437f0 | 99 | (__HANDLE__)->Lock = HAL_LOCKED; \ |
mbed_official | 133:d4dda5c437f0 | 100 | } \ |
mbed_official | 133:d4dda5c437f0 | 101 | }while (0) |
mbed_official | 133:d4dda5c437f0 | 102 | |
mbed_official | 133:d4dda5c437f0 | 103 | #define __HAL_UNLOCK(__HANDLE__) \ |
mbed_official | 133:d4dda5c437f0 | 104 | do{ \ |
mbed_official | 133:d4dda5c437f0 | 105 | (__HANDLE__)->Lock = HAL_UNLOCKED; \ |
mbed_official | 133:d4dda5c437f0 | 106 | }while (0) |
mbed_official | 133:d4dda5c437f0 | 107 | #endif /* USE_RTOS */ |
mbed_official | 133:d4dda5c437f0 | 108 | |
mbed_official | 133:d4dda5c437f0 | 109 | #if defined ( __GNUC__ ) |
mbed_official | 133:d4dda5c437f0 | 110 | #ifndef __weak |
mbed_official | 133:d4dda5c437f0 | 111 | #define __weak __attribute__((weak)) |
mbed_official | 133:d4dda5c437f0 | 112 | #endif /* __weak */ |
mbed_official | 133:d4dda5c437f0 | 113 | #ifndef __packed |
mbed_official | 133:d4dda5c437f0 | 114 | #define __packed __attribute__((__packed__)) |
mbed_official | 133:d4dda5c437f0 | 115 | #endif /* __packed */ |
mbed_official | 133:d4dda5c437f0 | 116 | #endif /* __GNUC__ */ |
mbed_official | 133:d4dda5c437f0 | 117 | |
mbed_official | 133:d4dda5c437f0 | 118 | |
mbed_official | 133:d4dda5c437f0 | 119 | /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */ |
mbed_official | 133:d4dda5c437f0 | 120 | #if defined (__GNUC__) /* GNU Compiler */ |
mbed_official | 133:d4dda5c437f0 | 121 | #ifndef __ALIGN_END |
mbed_official | 133:d4dda5c437f0 | 122 | #define __ALIGN_END __attribute__ ((aligned (4))) |
mbed_official | 133:d4dda5c437f0 | 123 | #endif /* __ALIGN_END */ |
mbed_official | 133:d4dda5c437f0 | 124 | #ifndef __ALIGN_BEGIN |
mbed_official | 133:d4dda5c437f0 | 125 | #define __ALIGN_BEGIN |
mbed_official | 133:d4dda5c437f0 | 126 | #endif /* __ALIGN_BEGIN */ |
mbed_official | 133:d4dda5c437f0 | 127 | #else |
mbed_official | 133:d4dda5c437f0 | 128 | #ifndef __ALIGN_END |
mbed_official | 133:d4dda5c437f0 | 129 | #define __ALIGN_END |
mbed_official | 133:d4dda5c437f0 | 130 | #endif /* __ALIGN_END */ |
mbed_official | 133:d4dda5c437f0 | 131 | #ifndef __ALIGN_BEGIN |
mbed_official | 133:d4dda5c437f0 | 132 | #if defined (__CC_ARM) /* ARM Compiler */ |
mbed_official | 133:d4dda5c437f0 | 133 | #define __ALIGN_BEGIN __align(4) |
mbed_official | 133:d4dda5c437f0 | 134 | #elif defined (__ICCARM__) /* IAR Compiler */ |
mbed_official | 133:d4dda5c437f0 | 135 | #define __ALIGN_BEGIN |
mbed_official | 133:d4dda5c437f0 | 136 | #elif defined (__TASKING__) /* TASKING Compiler */ |
mbed_official | 133:d4dda5c437f0 | 137 | #define __ALIGN_BEGIN __align(4) |
mbed_official | 133:d4dda5c437f0 | 138 | #endif /* __CC_ARM */ |
mbed_official | 133:d4dda5c437f0 | 139 | #endif /* __ALIGN_BEGIN */ |
mbed_official | 133:d4dda5c437f0 | 140 | #endif /* __GNUC__ */ |
mbed_official | 133:d4dda5c437f0 | 141 | |
mbed_official | 133:d4dda5c437f0 | 142 | #ifdef __cplusplus |
mbed_official | 133:d4dda5c437f0 | 143 | } |
mbed_official | 133:d4dda5c437f0 | 144 | #endif |
mbed_official | 133:d4dda5c437f0 | 145 | |
mbed_official | 133:d4dda5c437f0 | 146 | #endif /* ___STM32F4xx_HAL_DEF */ |
mbed_official | 133:d4dda5c437f0 | 147 | |
mbed_official | 133:d4dda5c437f0 | 148 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |