STM8L15x Standard Peripherals Drivers
|
stm8l15x_wfe.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm8l15x_wfe.h 00004 * @author MCD Application Team 00005 * @version V1.5.0 00006 * @date 13-May-2011 00007 * @brief This file contains all the functions prototypes for the WFE firmware 00008 * library. 00009 ****************************************************************************** 00010 * @attention 00011 * 00012 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 00013 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 00014 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 00015 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 00016 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 00017 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 00018 * 00019 * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2> 00020 ****************************************************************************** 00021 */ 00022 00023 /* Define to prevent recursive inclusion -------------------------------------*/ 00024 #ifndef __STM8L15x_WFE_H 00025 #define __STM8L15x_WFE_H 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm8l15x.h" 00029 00030 /** @addtogroup STM8L15x_StdPeriph_Driver 00031 * @{ 00032 */ 00033 00034 /** @addtogroup WFE 00035 * @{ 00036 */ 00037 /* Exported types ------------------------------------------------------------*/ 00038 00039 /** @defgroup WFE_Exported_Types 00040 * @{ 00041 */ 00042 /** @defgroup WFE_Sources 00043 * @brief Signal Sources to generate wake_up events 00044 @verbatim 00045 Elements values convention: 0xXXYY 00046 X = SRx registers index 00047 XX = 01 : CR1 00048 XX = 02 : CR2 00049 XX = 03 : CR3 00050 XX = 04 : CR4 00051 YY = flag mask in the dedicated register(XX register) 00052 @endverbatim 00053 * @{ 00054 */ 00055 typedef enum { 00056 WFE_Source_TIM2_EV0 = (uint16_t)0x0101, /*!< TIM2 Update/Trigger and Break interrupt */ 00057 WFE_Source_TIM2_EV1 = (uint16_t)0x0102, /*!< TIM2 Capture/Compare interrupt */ 00058 WFE_Source_TIM1_EV0 = (uint16_t)0x0104, /*!< TIM1 Update/Trigger and Break interrupt */ 00059 WFE_Source_TIM1_EV1 = (uint16_t)0x0108, /*!< TIM1 Capture/Compare interrupt */ 00060 WFE_Source_EXTI_EV0 = (uint16_t)0x0110, /*!< I/O port interrupt from Pins 0 */ 00061 WFE_Source_EXTI_EV1 = (uint16_t)0x0120, /*!< I/O port interrupt from Pins 1 */ 00062 WFE_Source_EXTI_EV2 = (uint16_t)0x0140, /*!< I/O port interrupt from Pins 2 */ 00063 WFE_Source_EXTI_EV3 = (uint16_t)0x0180, /*!< I/O port interrupt from Pins 3 */ 00064 WFE_Source_EXTI_EV4 = (uint16_t)0x0201, /*!< I/O port interrupt from Pins 4 */ 00065 WFE_Source_EXTI_EV5 = (uint16_t)0x0202, /*!< I/O port interrupt from Pins 5 */ 00066 WFE_Source_EXTI_EV6 = (uint16_t)0x0204, /*!< I/O port interrupt from Pins 6 */ 00067 WFE_Source_EXTI_EV7 = (uint16_t)0x0208, /*!< I/O port interrupt from Pins 7 */ 00068 WFE_Source_EXTI_EVB_G = (uint16_t)0x0210, /*!< I/O port interrupt from port B and G */ 00069 WFE_Source_EXTI_EVD_H = (uint16_t)0x0220, /*!< I/O port interrupt from Port D and H */ 00070 WFE_Source_EXTI_EVE_F = (uint16_t)0x0240, /*!< I/O port interrupt from Port E and F */ 00071 WFE_Source_ADC1_COMP_EV = (uint16_t)0x0280, /*!< ADC1, COMP1 and COMP2 interrupts */ 00072 WFE_Source_TIM3_EV0 = (uint16_t)0x0301, /*!< TIM3 Update/Trigger and Break interrupt */ 00073 WFE_Source_TIM3_EV1 = (uint16_t)0x0302, /*!< TIM3 Capture/Compare interrupt */ 00074 WFE_Source_TIM4_EV = (uint16_t)0x0304, /*!< TIM4 Update and Trigger interrupt */ 00075 WFE_Source_SPI1_EV = (uint16_t)0x0308, /*!< SPI1 Rx and Tx interrupt */ 00076 WFE_Source_I2C1_EV = (uint16_t)0x0310, /*!< I2C1 Rx and Tx interrupt */ 00077 WFE_Source_USART1_EV = (uint16_t)0x0320, /*!< USART1 Rx and Tx interrupt */ 00078 WFE_Source_DMA1CH01_EV = (uint16_t)0x0340, /*!< DMA1 channel 0 and 1 interrupt */ 00079 WFE_Source_DMA1CH23_EV = (uint16_t)0x0380, /*!< DMA1 channel 2 and 3 interrupt */ 00080 WFE_Source_RTC_CSS_EV = (uint16_t)0x0401, /*!< RTC or CSS on LSE event */ 00081 WFE_Source_SPI2_EV = (uint16_t)0x0402, /*!< SPI2 Rx and Tx interrupt */ 00082 WFE_Source_USART2_EV = (uint16_t)0x0404, /*!< USART2 Rx and Tx interrupt */ 00083 WFE_Source_USART3_EV = (uint16_t)0x0408, /*!< USART3 Rx and Tx interrupt */ 00084 WFE_Source_TIM5_EV0 = (uint16_t)0x0410, /*!< TIM5 Update/Trigger and Break interrupt */ 00085 WFE_Source_TIM5_EV1 = (uint16_t)0x0420, /*!< TIM5 Capture/Compare interrupt */ 00086 WFE_Source_AES_EV = (uint16_t)0x0440 /*!< AES interrupt */ 00087 } WFE_Source_TypeDef; 00088 00089 #define IS_WFE_SOURCE(Source) (((Source) == WFE_Source_TIM2_EV0) || \ 00090 ((Source) == WFE_Source_TIM2_EV1) || \ 00091 ((Source) == WFE_Source_TIM1_EV0) || \ 00092 ((Source) == WFE_Source_TIM1_EV1) || \ 00093 ((Source) == WFE_Source_EXTI_EV0) || \ 00094 ((Source) == WFE_Source_EXTI_EV1) || \ 00095 ((Source) == WFE_Source_EXTI_EV2) || \ 00096 ((Source) == WFE_Source_EXTI_EV3) || \ 00097 ((Source) == WFE_Source_EXTI_EV4) || \ 00098 ((Source) == WFE_Source_EXTI_EV5) || \ 00099 ((Source) == WFE_Source_EXTI_EV6) || \ 00100 ((Source) == WFE_Source_EXTI_EV7) || \ 00101 ((Source) == WFE_Source_EXTI_EVB_G) || \ 00102 ((Source) == WFE_Source_EXTI_EVD_H) || \ 00103 ((Source) == WFE_Source_EXTI_EVE_F) || \ 00104 ((Source) == WFE_Source_ADC1_COMP_EV) || \ 00105 ((Source) == WFE_Source_TIM3_EV0) || \ 00106 ((Source) == WFE_Source_TIM3_EV1) || \ 00107 ((Source) == WFE_Source_TIM4_EV) || \ 00108 ((Source) == WFE_Source_SPI1_EV) || \ 00109 ((Source) == WFE_Source_I2C1_EV) || \ 00110 ((Source) == WFE_Source_USART1_EV) || \ 00111 ((Source) == WFE_Source_DMA1CH01_EV) || \ 00112 ((Source) == WFE_Source_AES_EV) || \ 00113 ((Source) == WFE_Source_TIM5_EV1) || \ 00114 ((Source) == WFE_Source_TIM5_EV0) || \ 00115 ((Source) == WFE_Source_USART3_EV) || \ 00116 ((Source) == WFE_Source_USART2_EV) || \ 00117 ((Source) == WFE_Source_SPI2_EV) || \ 00118 ((Source) == WFE_Source_RTC_CSS_EV) || \ 00119 ((Source) == WFE_Source_DMA1CH23_EV)) 00120 00121 /** 00122 * @} 00123 */ 00124 00125 /** 00126 * @} 00127 */ 00128 /* Exported constants --------------------------------------------------------*/ 00129 /* Exported macros -----------------------------------------------------------*/ 00130 /* Exported functions ------------------------------------------------------- */ 00131 /* Function used to set the WFE configuration to the default reset state ******/ 00132 void WFE_DeInit(void); 00133 00134 /* WFE Source configuration and management functions **************************/ 00135 void WFE_WakeUpSourceEventCmd(WFE_Source_TypeDef WFE_Source, FunctionalState NewState); 00136 FunctionalState WFE_GetWakeUpSourceEventStatus(WFE_Source_TypeDef WFE_Source); 00137 00138 #endif /* __STM8L15x_WFE_H */ 00139 00140 /** 00141 * @} 00142 */ 00143 00144 /** 00145 * @} 00146 */ 00147 00148 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/