STM8S/A Standard Peripherals Firmware Library: stm8s_exti.h Source File

STM8S/A

stm8s_exti.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm8s_exti.h
00004   * @author  MCD Application Team
00005   * @version V2.2.0
00006   * @date    30-September-2014
00007   * @brief   This file contains all functions prototype and macros for the EXTI peripheral.
00008    ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
00012   *
00013   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
00014   * You may not use this file except in compliance with the License.
00015   * You may obtain a copy of the License at:
00016   *
00017   *        http://www.st.com/software_license_agreement_liberty_v2
00018   *
00019   * Unless required by applicable law or agreed to in writing, software 
00020   * distributed under the License is distributed on an "AS IS" BASIS, 
00021   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00022   * See the License for the specific language governing permissions and
00023   * limitations under the License.
00024   *
00025   ******************************************************************************
00026   */
00027 
00028 /* Define to prevent recursive inclusion -------------------------------------*/
00029 #ifndef __STM8S_EXTI_H__
00030 #define __STM8S_EXTI_H__
00031 
00032 /* Includes ------------------------------------------------------------------*/
00033 #include "stm8s.h"
00034 
00035 /* Exported types ------------------------------------------------------------*/
00036 
00037 /** @addtogroup EXTI_Exported_Types
00038   * @{
00039   */
00040 
00041 /**
00042   * @brief  EXTI Sensitivity values for PORTA to PORTE
00043   */
00044 typedef enum {
00045   EXTI_SENSITIVITY_FALL_LOW  = (uint8_t)0x00, /*!< Interrupt on Falling edge and Low level */
00046   EXTI_SENSITIVITY_RISE_ONLY = (uint8_t)0x01, /*!< Interrupt on Rising edge only */
00047   EXTI_SENSITIVITY_FALL_ONLY = (uint8_t)0x02, /*!< Interrupt on Falling edge only */
00048   EXTI_SENSITIVITY_RISE_FALL = (uint8_t)0x03  /*!< Interrupt on Rising and Falling edges */
00049 } EXTI_Sensitivity_TypeDef;
00050 
00051 /**
00052   * @brief  EXTI Sensitivity values for TLI
00053   */
00054 typedef enum {
00055   EXTI_TLISENSITIVITY_FALL_ONLY = (uint8_t)0x00, /*!< Top Level Interrupt on Falling edge only */
00056   EXTI_TLISENSITIVITY_RISE_ONLY = (uint8_t)0x04  /*!< Top Level Interrupt on Rising edge only */
00057 } EXTI_TLISensitivity_TypeDef;
00058 
00059 /**
00060   * @brief  EXTI PortNum possible values
00061   */
00062 typedef enum {
00063   EXTI_PORT_GPIOA = (uint8_t)0x00, /*!< GPIO Port A */
00064   EXTI_PORT_GPIOB = (uint8_t)0x01, /*!< GPIO Port B */
00065   EXTI_PORT_GPIOC = (uint8_t)0x02, /*!< GPIO Port C */
00066   EXTI_PORT_GPIOD = (uint8_t)0x03, /*!< GPIO Port D */
00067   EXTI_PORT_GPIOE = (uint8_t)0x04  /*!< GPIO Port E */
00068 } EXTI_Port_TypeDef;
00069 
00070 /**
00071   * @}
00072   */
00073 
00074 /* Private macros ------------------------------------------------------------*/
00075 
00076 /** @addtogroup EXTI_Private_Macros
00077   * @{
00078   */
00079 
00080 /**
00081   * @brief  Macro used by the assert function in order to check the different sensitivity values for PORTA to PORTE.
00082   */
00083 #define IS_EXTI_SENSITIVITY_OK(SensitivityValue) \
00084   (((SensitivityValue) == EXTI_SENSITIVITY_FALL_LOW) || \
00085    ((SensitivityValue) == EXTI_SENSITIVITY_RISE_ONLY) || \
00086    ((SensitivityValue) == EXTI_SENSITIVITY_FALL_ONLY) || \
00087    ((SensitivityValue) == EXTI_SENSITIVITY_RISE_FALL))
00088 
00089 /**
00090   * @brief  Macro used by the assert function in order to check the different sensitivity values for TLI.
00091   */
00092 #define IS_EXTI_TLISENSITIVITY_OK(SensitivityValue) \
00093   (((SensitivityValue) == EXTI_TLISENSITIVITY_FALL_ONLY) || \
00094    ((SensitivityValue) == EXTI_TLISENSITIVITY_RISE_ONLY))
00095 
00096 /**
00097   * @brief  Macro used by the assert function in order to check the different Port values
00098   */
00099 #define IS_EXTI_PORT_OK(PORT) \
00100   (((PORT) == EXTI_PORT_GPIOA) ||\
00101    ((PORT) == EXTI_PORT_GPIOB) ||\
00102    ((PORT) == EXTI_PORT_GPIOC) ||\
00103    ((PORT) == EXTI_PORT_GPIOD) ||\
00104    ((PORT) == EXTI_PORT_GPIOE))
00105 
00106 /**
00107   * @brief  Macro used by the assert function in order to check the different values of the EXTI PinMask
00108   */
00109 #define IS_EXTI_PINMASK_OK(PinMask) ((((PinMask) & (uint8_t)0x00) == (uint8_t)0x00) && ((PinMask) != (uint8_t)0x00))
00110 
00111 /**
00112   * @}
00113   */
00114 
00115 /* Exported functions ------------------------------------------------------- */
00116 
00117 /** @addtogroup EXTI_Exported_Functions
00118   * @{
00119   */
00120 
00121 void EXTI_DeInit(void);
00122 void EXTI_SetExtIntSensitivity(EXTI_Port_TypeDef Port, EXTI_Sensitivity_TypeDef SensitivityValue);
00123 void EXTI_SetTLISensitivity(EXTI_TLISensitivity_TypeDef SensitivityValue);
00124 EXTI_Sensitivity_TypeDef EXTI_GetExtIntSensitivity(EXTI_Port_TypeDef Port);
00125 EXTI_TLISensitivity_TypeDef EXTI_GetTLISensitivity(void);
00126 
00127 /**
00128   * @}
00129   */
00130 
00131 #endif /* __STM8S_EXTI_H__ */
00132 
00133 
00134 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com