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