STM8L15x Standard Peripherals Drivers: Interrupt sensitivity of GPIO ports/pins configuration

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Interrupt sensitivity of GPIO ports/pins configuration

Interrupt sensitivity of GPIO ports/pins configuration. More...

Functions

void EXTI_DeInit (void)
 Deinitializes the EXTI registers to their default reset value.
EXTI_Trigger_TypeDef EXTI_GetPinSensitivity (EXTI_Pin_TypeDef EXTI_Pin)
 Gets the external interrupt sensitivity of the selected pin.
EXTI_Trigger_TypeDef EXTI_GetPortSensitivity (EXTI_Port_TypeDef EXTI_Port)
 Gets the external interrupt sensitivity of the selected port.
void EXTI_SelectPort (EXTI_Port_TypeDef EXTI_Port)
 Selects the port interrupt selection.
void EXTI_SetHalfPortSelection (EXTI_HalfPort_TypeDef EXTI_HalfPort, FunctionalState NewState)
 Configures the half port interrupt selection.
void EXTI_SetPinSensitivity (EXTI_Pin_TypeDef EXTI_Pin, EXTI_Trigger_TypeDef EXTI_Trigger)
 Sets the external interrupt sensitivity of the selected pin.
void EXTI_SetPortSensitivity (EXTI_Port_TypeDef EXTI_Port, EXTI_Trigger_TypeDef EXTI_Trigger)
 Sets the external interrupt sensitivity of the selected port.

Detailed Description

Interrupt sensitivity of GPIO ports/pins configuration.

 ===============================================================================
                         EXTI configuration functions
 ===============================================================================  
  
       ===================================================================      
                        EXTI Driver: how to configure EXTI
       =================================================================== 
       To use a GPIO pin as an interrupt source, follow theses steps:
       
         1. Configure the GPIO pin in input mode with interrupt enabled using
            GPIO_Init()
          
         2. Configure the GPIO pin sensitivity (falling, rising...) using 
            EXTI_SetPinSensitivity()
          
         3. Enable global interrupts using enableInterrupts()
       
         4. In the IRQ handler corresponding to the GPIO pin, clear the interrupt
            pending bit using EXTI_ClearITPendingBit()

       To use a GPIO port as an interrupt source, follows theses steps:  
            
         1. Configure the GPIO pins of the same port in input mode with interrupt
            enabled using GPIO_Init()
          
         2. Configure the GPIO port sensitivity (falling, rising...) using 
            EXTI_SetPortSensitivity()
          
         3. Select the GPIO port and the corresponding half port using  
            EXTI_SelectPort() then EXTI_SetHalfPortSelection()
        
         4. Enable global interrupts using enableInterrupts()
       
         5. In the IRQ handler corresponding to the GPIO port, clear the interrupt
            pending bit using EXTI_ClearITPendingBit()


Function Documentation

void EXTI_DeInit ( void  )

Deinitializes the EXTI registers to their default reset value.

Parameters:
None
Return values:
None

Definition at line 117 of file stm8l15x_exti.c.

References EXTI, EXTI_CONF1_RESET_VALUE, EXTI_CONF2_RESET_VALUE, EXTI_CR1_RESET_VALUE, EXTI_CR2_RESET_VALUE, EXTI_CR3_RESET_VALUE, and EXTI_CR4_RESET_VALUE.

EXTI_Trigger_TypeDef EXTI_GetPinSensitivity ( EXTI_Pin_TypeDef  EXTI_Pin)

Gets the external interrupt sensitivity of the selected pin.

Parameters:
EXTI_Pin: The pin number to access. This parameter can be one of the following values:
  • EXTI_Pin_0: GPIO Pin 0
  • EXTI_Pin_1: GPIO Pin 1
  • EXTI_Pin_2: GPIO Pin 2
  • EXTI_Pin_3: GPIO Pin 3
  • EXTI_Pin_4: GPIO Pin 4
  • EXTI_Pin_5: GPIO Pin 5
  • EXTI_Pin_6: GPIO Pin 6
  • EXTI_Pin_7: GPIO Pin 7
Return values:
Theexternal interrupt sensitivity of the selected port.

Definition at line 370 of file stm8l15x_exti.c.

References EXTI, EXTI_CR1_P0IS, EXTI_CR1_P1IS, EXTI_CR1_P2IS, EXTI_CR1_P3IS, EXTI_CR2_P4IS, EXTI_CR2_P5IS, EXTI_CR2_P6IS, EXTI_CR2_P7IS, EXTI_Pin_0, EXTI_Pin_1, EXTI_Pin_2, EXTI_Pin_3, EXTI_Pin_4, EXTI_Pin_5, EXTI_Pin_6, EXTI_Pin_7, and IS_EXTI_PINNUM.

EXTI_Trigger_TypeDef EXTI_GetPortSensitivity ( EXTI_Port_TypeDef  EXTI_Port)

Gets the external interrupt sensitivity of the selected port.

Parameters:
EXTI_Port: The port number to access. This parameter can be one of the following values:
  • EXTI_Port_B: GPIO Port B
  • EXTI_Port_D: GPIO Port D
  • EXTI_Port_E: GPIO Port E
  • EXTI_Port_F: GPIO Port F
  • EXTI_Port_G: GPIO Port G
  • EXTI_Port_H: GPIO Port H
Return values:
Theexternal interrupt sensitivity of the selected port.

Definition at line 421 of file stm8l15x_exti.c.

References EXTI, and IS_EXTI_PORT.

void EXTI_SelectPort ( EXTI_Port_TypeDef  EXTI_Port)

Selects the port interrupt selection.

Parameters:
EXTI_Port: The port number to access. This parameter can be one of the following values:
  • EXTI_Port_B: GPIO Port B
  • EXTI_Port_D: GPIO Port D
  • EXTI_Port_E: GPIO Port E
  • EXTI_Port_F: GPIO Port F
  • EXTI_Port_G: GPIO Port G
  • EXTI_Port_H: GPIO Port H
Return values:
None

Definition at line 213 of file stm8l15x_exti.c.

References EXTI, EXTI_CONF1_PFES, EXTI_CONF2_PGBS, EXTI_CONF2_PHDS, EXTI_Port_B, EXTI_Port_D, EXTI_Port_E, EXTI_Port_F, EXTI_Port_G, and IS_EXTI_PORT.

void EXTI_SetHalfPortSelection ( EXTI_HalfPort_TypeDef  EXTI_HalfPort,
FunctionalState  NewState 
)

Configures the half port interrupt selection.

Note:
This function should be called once the port sensitivity configured, otherwise it will not have any effect on the port external interrupt.
This function should be called after EXTI_SelectPort() function which selects the port to be used otherwise ports are selected by default
Parameters:
EXTI_HalfPort: The port part to access (MSB or LSB). This parameter can be one of the following values:
  • EXTI_HalfPort_B_LSB: Interrupt selector PB(3:0)
  • EXTI_HalfPort_B_MSB: Interrupt selector PB(7:4)
  • EXTI_HalfPort_D_LSB: Interrupt selector PD(3:0)
  • EXTI_HalfPort_D_MSB: Interrupt selector PD(7:4)
  • EXTI_HalfPort_E_LSB: Interrupt selector PE(3:0)
  • EXTI_HalfPort_E_MSB: Interrupt selector PE(7:4)
  • EXTI_HalfPort_F_LSB: Interrupt selector PF(3:0)
  • EXTI_HalfPort_F_MSB: Interrupt selector PF(7:4)
  • EXTI_HalfPort_G_LSB: Interrupt selector PG(3:0)
  • EXTI_HalfPort_G_MSB: Interrupt selector PG(7:4)
  • EXTI_HalfPort_H_LSB: Interrupt selector PH(3:0)
  • EXTI_HalfPort_H_MSB: Interrupt selector PH(7:4)
NewState: The external interrupt new state. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 274 of file stm8l15x_exti.c.

References DISABLE, EXTI, IS_EXTI_HALFPORT, and IS_FUNCTIONAL_STATE.

void EXTI_SetPinSensitivity ( EXTI_Pin_TypeDef  EXTI_Pin,
EXTI_Trigger_TypeDef  EXTI_Trigger 
)

Sets the external interrupt sensitivity of the selected pin.

Note:
Global interrupts must be disabled before calling this function.
The modification of external interrupt sensitivity is only possible when he interrupts are disabled.
The normal behavior is to disable the interrupts before calling this function, and re-enable them after.
Parameters:
EXTI_Pin: The pin to configure. This parameter can be one of the following values:
  • EXTI_Pin_0: GPIO Pin 0
  • EXTI_Pin_1: GPIO Pin 1
  • EXTI_Pin_2: GPIO Pin 2
  • EXTI_Pin_3: GPIO Pin 3
  • EXTI_Pin_4: GPIO Pin 4
  • EXTI_Pin_5: GPIO Pin 5
  • EXTI_Pin_6: GPIO Pin 6
  • EXTI_Pin_7: GPIO Pin 7
EXTI_Trigger: The external interrupt sensitivity value to set. This parameter can be one of the following values:
  • EXTI_Trigger_Falling_Low: Interrupt on Falling edge and Low level
  • EXTI_Trigger_Rising: Interrupt on Rising edge only
  • EXTI_Trigger_Falling: Interrupt on Falling edge only
  • EXTI_Trigger_Rising_Falling: Interrupt on Rising and Falling edges
Return values:
None

Definition at line 154 of file stm8l15x_exti.c.

References EXTI, EXTI_CR1_P0IS, EXTI_CR1_P1IS, EXTI_CR1_P2IS, EXTI_CR1_P3IS, EXTI_CR2_P4IS, EXTI_CR2_P5IS, EXTI_CR2_P6IS, EXTI_CR2_P7IS, EXTI_Pin_0, EXTI_Pin_1, EXTI_Pin_2, EXTI_Pin_3, EXTI_Pin_4, EXTI_Pin_5, EXTI_Pin_6, EXTI_Pin_7, IS_EXTI_PINNUM, and IS_EXTI_TRIGGER.

void EXTI_SetPortSensitivity ( EXTI_Port_TypeDef  EXTI_Port,
EXTI_Trigger_TypeDef  EXTI_Trigger 
)

Sets the external interrupt sensitivity of the selected port.

Note:
Global interrupts must be disabled before calling this function.
The modification of external interrupt sensitivity is only possible when the interrupts are disabled.
The normal behavior is to disable the interrupts before calling this function, and re-enable them after.
Parameters:
EXTI_Port: The port number to access. This parameter can be one of the following values:
  • EXTI_Port_B: GPIO Port B
  • EXTI_Port_D: GPIO Port D
  • EXTI_Port_E: GPIO Port E
  • EXTI_Port_F: GPIO Port F
  • EXTI_Port_G: GPIO Port G
  • EXTI_Port_H: GPIO Port H
EXTI_Trigger: The external interrupt sensitivity value to set. This parameter can be one of the following values:
  • EXTI_Trigger_Falling_Low: Interrupt on Falling edge and Low level
  • EXTI_Trigger_Rising: Interrupt on Rising edge only
  • EXTI_Trigger_Falling: Interrupt on Falling edge only
  • EXTI_Trigger_Rising_Falling: Interrupt on Rising and Falling edges
Return values:
None

Definition at line 332 of file stm8l15x_exti.c.

References EXTI, IS_EXTI_PORT, and IS_EXTI_TRIGGER.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com