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