TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle

External interrupts library for STM32F4 devices - http://stm32f4-discovery.com/2014/10/library-38-external-interrupts-for-stm32f4. More...

Modules

 TM_EXTI_Macros
 Library defines.
 
 TM_EXTI_Typedefs
 Library Typedefs.
 
 TM_EXTI_Functions
 Library Functions.
 

Detailed Description

External interrupts library for STM32F4 devices - http://stm32f4-discovery.com/2014/10/library-38-external-interrupts-for-stm32f4.

This library allows you to easy enable external interrupt on specific pin.

You only need to specify GPIOx, pin and interrupt trigger you want to use and you are ready to use. There are predefined function names that you use to handle this interrupts.

There are 16 external interrupts possible, GPIO lines 0 to 15. Each GPIO_PIN_x from all GPIOx is connected to one line. In other words, PC0, PA0, PB0, PJ0,... are all connected to line 0, and so on. But you can use only one pin for one line at a time. So only PA0 at one time, or PD0 or PC0, but one a time.

You can still use more lines at the same time. So let's say PA0 is line0 and PC13 is line13. This 2 interrupts can be used simultaneouly without problems.

Handling interrupts

Next step is handling interrupts. There are 16 interrupt lines, but only 7 interrupt handlers. Lines0 to 4 have each own handler, then lines 5 to 9 have one common and lines 10 to 15 have one common.

I write these functions in my library and use my own to handle specific line for you for easly. Sometimes there is need for use default handler names in your own, but 2 functions with same name can not be used, so I made some settings.

If you open defines.h file and add any of lines below, you will disable handler line for interrupts. By default, all handlers for lines are enabled. Disabled then with adding lines below in defines.h file:

//Disable EXTI0_IRQHandler function
#define TM_EXTI_DISABLE_DEFAULT_HANDLER_0
//Disable EXTI1_IRQHandler function
#define TM_EXTI_DISABLE_DEFAULT_HANDLER_1
//Disable EXTI2_IRQHandler function
#define TM_EXTI_DISABLE_DEFAULT_HANDLER_2
//Disable EXTI3_IRQHandler function
#define TM_EXTI_DISABLE_DEFAULT_HANDLER_3
//Disable EXTI4_IRQHandler function
#define TM_EXTI_DISABLE_DEFAULT_HANDLER_4
//Disable EXTI9_5_IRQHandler function
#define TM_EXTI_DISABLE_DEFAULT_HANDLER_9_5
//Disable EXTI15_10_IRQHandler function
#define TM_EXTI_DISABLE_DEFAULT_HANDLER_15_10

If you need higher priority for external interrupts in NVIC, add lines below in defines.h file and edit them

//Set custom NVIC priority
#define EXTI_NVIC_PRIORITY  0x0A
Changelog
 Version 1.4
  - June 22, 2015
  - Added support for clearing all external interrupt with DeInit function
  
 Version 1.3
  - March 23 2015 - Totally independent from HAL / SPD drivers
  - Library can be used with any drivers or totally itself
  - Now only one function handler TM_EXTI_Handler for all lines. No separate handlers anymore.
  
 Version 1.2
  - March 10, 2015
  - TM GPIO Library supported

 Version 1.1
  - March 08, 2015
  - Added function TM_EXTI_Handler, which is called anytime EXTI interrupt occur,
       no matter on which GPIO_Pin. GPIO_Pin_x is passed as argument where x is 0 to 15

 Version 1.0
  - First release
Dependencies
 - STM32F4xx
 - MISC
 - defines.h
 - attributes.h
 - TM GPIO