meh

Fork of mbed by mbed official

Committer:
emilmont
Date:
Fri Feb 14 14:36:43 2014 +0000
Revision:
77:869cf507173a
Child:
81:7d30d6019079
Release 77 of the mbed library

Main changes:
* Add target NUCLEO_F030R8
* Add target NUCLEO_F401RE
* Add target NUCLEO_F103RB
* Add target NUCLEO_L152RE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 77:869cf507173a 1 /**
emilmont 77:869cf507173a 2 ******************************************************************************
emilmont 77:869cf507173a 3 * @file stm32f4xx_hal_def.h
emilmont 77:869cf507173a 4 * @author MCD Application Team
emilmont 77:869cf507173a 5 * @version V1.0.0RC2
emilmont 77:869cf507173a 6 * @date 04-February-2014
emilmont 77:869cf507173a 7 * @brief This file contains HAL common defines, enumeration, macros and
emilmont 77:869cf507173a 8 * structures definitions.
emilmont 77:869cf507173a 9 ******************************************************************************
emilmont 77:869cf507173a 10 * @attention
emilmont 77:869cf507173a 11 *
emilmont 77:869cf507173a 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
emilmont 77:869cf507173a 13 *
emilmont 77:869cf507173a 14 * Redistribution and use in source and binary forms, with or without modification,
emilmont 77:869cf507173a 15 * are permitted provided that the following conditions are met:
emilmont 77:869cf507173a 16 * 1. Redistributions of source code must retain the above copyright notice,
emilmont 77:869cf507173a 17 * this list of conditions and the following disclaimer.
emilmont 77:869cf507173a 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
emilmont 77:869cf507173a 19 * this list of conditions and the following disclaimer in the documentation
emilmont 77:869cf507173a 20 * and/or other materials provided with the distribution.
emilmont 77:869cf507173a 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
emilmont 77:869cf507173a 22 * may be used to endorse or promote products derived from this software
emilmont 77:869cf507173a 23 * without specific prior written permission.
emilmont 77:869cf507173a 24 *
emilmont 77:869cf507173a 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
emilmont 77:869cf507173a 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
emilmont 77:869cf507173a 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
emilmont 77:869cf507173a 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
emilmont 77:869cf507173a 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
emilmont 77:869cf507173a 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
emilmont 77:869cf507173a 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
emilmont 77:869cf507173a 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
emilmont 77:869cf507173a 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
emilmont 77:869cf507173a 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
emilmont 77:869cf507173a 35 *
emilmont 77:869cf507173a 36 ******************************************************************************
emilmont 77:869cf507173a 37 */
emilmont 77:869cf507173a 38
emilmont 77:869cf507173a 39 /* Define to prevent recursive inclusion -------------------------------------*/
emilmont 77:869cf507173a 40 #ifndef __STM32F4xx_HAL_DEF
emilmont 77:869cf507173a 41 #define __STM32F4xx_HAL_DEF
emilmont 77:869cf507173a 42
emilmont 77:869cf507173a 43 #ifdef __cplusplus
emilmont 77:869cf507173a 44 extern "C" {
emilmont 77:869cf507173a 45 #endif
emilmont 77:869cf507173a 46
emilmont 77:869cf507173a 47 /* Includes ------------------------------------------------------------------*/
emilmont 77:869cf507173a 48 #include "stm32f4xx.h"
emilmont 77:869cf507173a 49
emilmont 77:869cf507173a 50 /* Exported types ------------------------------------------------------------*/
emilmont 77:869cf507173a 51
emilmont 77:869cf507173a 52 /**
emilmont 77:869cf507173a 53 * @brief HAL Status structures definition
emilmont 77:869cf507173a 54 */
emilmont 77:869cf507173a 55 typedef enum
emilmont 77:869cf507173a 56 {
emilmont 77:869cf507173a 57 HAL_OK = 0x00,
emilmont 77:869cf507173a 58 HAL_ERROR = 0x01,
emilmont 77:869cf507173a 59 HAL_BUSY = 0x02,
emilmont 77:869cf507173a 60 HAL_TIMEOUT = 0x03
emilmont 77:869cf507173a 61 } HAL_StatusTypeDef;
emilmont 77:869cf507173a 62
emilmont 77:869cf507173a 63 /**
emilmont 77:869cf507173a 64 * @brief HAL Lock structures definition
emilmont 77:869cf507173a 65 */
emilmont 77:869cf507173a 66 typedef enum
emilmont 77:869cf507173a 67 {
emilmont 77:869cf507173a 68 HAL_UNLOCKED = 0x00,
emilmont 77:869cf507173a 69 HAL_LOCKED = 0x01
emilmont 77:869cf507173a 70 } HAL_LockTypeDef;
emilmont 77:869cf507173a 71
emilmont 77:869cf507173a 72 /* Exported macro ------------------------------------------------------------*/
emilmont 77:869cf507173a 73 #ifndef NULL
emilmont 77:869cf507173a 74 #define NULL (void *) 0
emilmont 77:869cf507173a 75 #endif
emilmont 77:869cf507173a 76
emilmont 77:869cf507173a 77 #define HAL_MAX_DELAY 0xFFFFFFFF
emilmont 77:869cf507173a 78
emilmont 77:869cf507173a 79 #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET)
emilmont 77:869cf507173a 80 #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET)
emilmont 77:869cf507173a 81
emilmont 77:869cf507173a 82 #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_) \
emilmont 77:869cf507173a 83 do{ \
emilmont 77:869cf507173a 84 (__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_); \
emilmont 77:869cf507173a 85 (__DMA_HANDLE_).Parent = (__HANDLE__); \
emilmont 77:869cf507173a 86 } while(0)
emilmont 77:869cf507173a 87
emilmont 77:869cf507173a 88 #if (USE_RTOS == 1)
emilmont 77:869cf507173a 89 /* Reserved for future use */
emilmont 77:869cf507173a 90 #else
emilmont 77:869cf507173a 91 #define __HAL_LOCK(__HANDLE__) \
emilmont 77:869cf507173a 92 do{ \
emilmont 77:869cf507173a 93 if((__HANDLE__)->Lock == HAL_LOCKED) \
emilmont 77:869cf507173a 94 { \
emilmont 77:869cf507173a 95 return HAL_BUSY; \
emilmont 77:869cf507173a 96 } \
emilmont 77:869cf507173a 97 else \
emilmont 77:869cf507173a 98 { \
emilmont 77:869cf507173a 99 (__HANDLE__)->Lock = HAL_LOCKED; \
emilmont 77:869cf507173a 100 } \
emilmont 77:869cf507173a 101 }while (0)
emilmont 77:869cf507173a 102
emilmont 77:869cf507173a 103 #define __HAL_UNLOCK(__HANDLE__) \
emilmont 77:869cf507173a 104 do{ \
emilmont 77:869cf507173a 105 (__HANDLE__)->Lock = HAL_UNLOCKED; \
emilmont 77:869cf507173a 106 }while (0)
emilmont 77:869cf507173a 107 #endif /* USE_RTOS */
emilmont 77:869cf507173a 108
emilmont 77:869cf507173a 109 #if defined ( __GNUC__ )
emilmont 77:869cf507173a 110 #ifndef __weak
emilmont 77:869cf507173a 111 #define __weak __attribute__((weak))
emilmont 77:869cf507173a 112 #endif /* __weak */
emilmont 77:869cf507173a 113 #ifndef __packed
emilmont 77:869cf507173a 114 #define __packed __attribute__((__packed__))
emilmont 77:869cf507173a 115 #endif /* __packed */
emilmont 77:869cf507173a 116 #endif /* __GNUC__ */
emilmont 77:869cf507173a 117
emilmont 77:869cf507173a 118
emilmont 77:869cf507173a 119 #ifdef __cplusplus
emilmont 77:869cf507173a 120 }
emilmont 77:869cf507173a 121 #endif
emilmont 77:869cf507173a 122
emilmont 77:869cf507173a 123 #endif /* ___STM32F4xx_HAL_DEF */
emilmont 77:869cf507173a 124
emilmont 77:869cf507173a 125 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/