+++ /dev/null
-/**\r
- ******************************************************************************\r
- * @file stm32l4xx_hal_def.h\r
- * @author MCD Application Team\r
- * @brief This file contains HAL common defines, enumeration, macros and\r
- * structures definitions.\r
- ******************************************************************************\r
- * @attention\r
- *\r
- * <h2><center>© Copyright (c) 2017 STMicroelectronics.\r
- * All rights reserved.</center></h2>\r
- *\r
- * This software component is licensed by ST under BSD 3-Clause license,\r
- * the "License"; You may not use this file except in compliance with the\r
- * License. You may obtain a copy of the License at:\r
- * opensource.org/licenses/BSD-3-Clause\r
- *\r
- ******************************************************************************\r
- */\r
-\r
-/* Define to prevent recursive inclusion -------------------------------------*/\r
-#ifndef STM32L4xx_HAL_DEF_H\r
-#define STM32L4xx_HAL_DEF_H\r
-\r
-#ifdef __cplusplus\r
- extern "C" {\r
-#endif\r
-\r
-/* Includes ------------------------------------------------------------------*/\r
-#include "stm32l4xx.h"\r
-#include "Legacy/stm32_hal_legacy.h" /* Aliases file for old names compatibility */\r
-#include <stddef.h>\r
-\r
-/* Exported types ------------------------------------------------------------*/\r
-\r
-/**\r
- * @brief HAL Status structures definition\r
- */\r
-typedef enum\r
-{\r
- HAL_OK = 0x00,\r
- HAL_ERROR = 0x01,\r
- HAL_BUSY = 0x02,\r
- HAL_TIMEOUT = 0x03\r
-} HAL_StatusTypeDef;\r
-\r
-/**\r
- * @brief HAL Lock structures definition\r
- */\r
-typedef enum\r
-{\r
- HAL_UNLOCKED = 0x00,\r
- HAL_LOCKED = 0x01\r
-} HAL_LockTypeDef;\r
-\r
-/* Exported macros -----------------------------------------------------------*/\r
-\r
-#define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */\r
-\r
-#define HAL_MAX_DELAY 0xFFFFFFFFU\r
-\r
-#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == (BIT))\r
-#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U)\r
-\r
-#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \\r
- do{ \\r
- (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \\r
- (__DMA_HANDLE__).Parent = (__HANDLE__); \\r
- } while(0)\r
-\r
-/** @brief Reset the Handle's State field.\r
- * @param __HANDLE__: specifies the Peripheral Handle.\r
- * @note This macro can be used for the following purpose:\r
- * - When the Handle is declared as local variable; before passing it as parameter\r
- * to HAL_PPP_Init() for the first time, it is mandatory to use this macro\r
- * to set to 0 the Handle's "State" field.\r
- * Otherwise, "State" field may have any random value and the first time the function\r
- * HAL_PPP_Init() is called, the low level hardware initialization will be missed\r
- * (i.e. HAL_PPP_MspInit() will not be executed).\r
- * - When there is a need to reconfigure the low level hardware: instead of calling\r
- * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init().\r
- * In this later function, when the Handle's "State" field is set to 0, it will execute the function\r
- * HAL_PPP_MspInit() which will reconfigure the low level hardware.\r
- * @retval None\r
- */\r
-#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0)\r
-\r
-#if (USE_RTOS == 1)\r
- /* Reserved for future use */\r
- #error " USE_RTOS should be 0 in the current HAL release "\r
-#else\r
- #define __HAL_LOCK(__HANDLE__) \\r
- do{ \\r
- if((__HANDLE__)->Lock == HAL_LOCKED) \\r
- { \\r
- return HAL_BUSY; \\r
- } \\r
- else \\r
- { \\r
- (__HANDLE__)->Lock = HAL_LOCKED; \\r
- } \\r
- }while (0)\r
-\r
- #define __HAL_UNLOCK(__HANDLE__) \\r
- do{ \\r
- (__HANDLE__)->Lock = HAL_UNLOCKED; \\r
- }while (0)\r
-#endif /* USE_RTOS */\r
-\r
-#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */\r
- #ifndef __weak\r
- #define __weak __attribute__((weak))\r
- #endif /* __weak */\r
- #ifndef __packed\r
- #define __packed __attribute__((__packed__))\r
- #endif /* __packed */\r
-#endif /* __GNUC__ */\r
-\r
-\r
-/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */\r
-#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */\r
- #ifndef __ALIGN_END\r
- #define __ALIGN_END __attribute__ ((aligned (4)))\r
- #endif /* __ALIGN_END */\r
- #ifndef __ALIGN_BEGIN\r
- #define __ALIGN_BEGIN\r
- #endif /* __ALIGN_BEGIN */\r
-#else\r
- #ifndef __ALIGN_END\r
- #define __ALIGN_END\r
- #endif /* __ALIGN_END */\r
- #ifndef __ALIGN_BEGIN\r
- #if defined (__CC_ARM) /* ARM Compiler */\r
- #define __ALIGN_BEGIN __align(4)\r
- #elif defined (__ICCARM__) /* IAR Compiler */\r
- #define __ALIGN_BEGIN\r
- #endif /* __CC_ARM */\r
- #endif /* __ALIGN_BEGIN */\r
-#endif /* __GNUC__ */\r
-\r
-/**\r
- * @brief __RAM_FUNC definition\r
- */\r
-#if defined ( __CC_ARM )\r
-/* ARM Compiler\r
- ------------\r
- RAM functions are defined using the toolchain options.\r
- Functions that are executed in RAM should reside in a separate source module.\r
- Using the 'Options for File' dialog you can simply change the 'Code / Const'\r
- area of a module to a memory space in physical RAM.\r
- Available memory areas are declared in the 'Target' tab of the 'Options for Target'\r
- dialog.\r
-*/\r
-#define __RAM_FUNC HAL_StatusTypeDef\r
-\r
-#elif defined ( __ICCARM__ )\r
-/* ICCARM Compiler\r
- ---------------\r
- RAM functions are defined using a specific toolchain keyword "__ramfunc".\r
-*/\r
-#define __RAM_FUNC __ramfunc HAL_StatusTypeDef\r
-\r
-#elif defined ( __GNUC__ )\r
-/* GNU Compiler\r
- ------------\r
- RAM functions are defined using a specific toolchain attribute\r
- "__attribute__((section(".RamFunc")))".\r
-*/\r
-#define __RAM_FUNC HAL_StatusTypeDef __attribute__((section(".RamFunc")))\r
-\r
-#endif\r
-\r
-/**\r
- * @brief __NOINLINE definition\r
- */\r
-#if defined ( __CC_ARM ) || defined ( __GNUC__ )\r
-/* ARM & GNUCompiler\r
- ----------------\r
-*/\r
-#define __NOINLINE __attribute__ ( (noinline) )\r
-\r
-#elif defined ( __ICCARM__ )\r
-/* ICCARM Compiler\r
- ---------------\r
-*/\r
-#define __NOINLINE _Pragma("optimize = no_inline")\r
-\r
-#endif\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /* STM32L4xx_HAL_DEF_H */\r
-\r
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r