Library Functions.
More...
Library Functions.
| #define TM_EXTI_SoftwareInterrupt |
( |
|
GPIO_Line | ) |
(EXTI->SWIER |= (GPIO_Line)) |
Creates software interrupt for specific external GPIO line.
- Note
- This also works for others EXTI lines from 16 to 23
- Parameters
-
| GPIO_Line | GPIO line where you want software interrupt |
- Return values
-
- Note
- Defined as macro for faster execution
Attach external interrupt on specific GPIO pin.
- Note
- This function automatically enables the clock for GPIO peripheral and also sets pull resistors depending on trigger you use.
- Falling edge: pull up is enabled
- Rising edge: pull down is enabled
- Any edge: no pull activated
-
You can attach only one GPIOx to specific GPIO_PIN. In other words, GPIO_PIN_5 can not be attached to GPIOA and GPIOB at the same time. If you will try that, my function will return error to you, because you have to detach GPIO_Line first and attach back on other GPIO port.
- Parameters
-
| *GPIOx | GPIO port where you want EXTI interrupt line |
| GPIO_Line | GPIO pin where you want EXTI interrupt line. Use OR (|) operator if you want to attach interrupt on more than one GPIO pin at the same GPIOx at the same time. |
| trigger | Pin trigger source. This parameter can be a value of TM_EXTI_Trigger_t enumeration |
- Return values
-
| Attach | result:
- TM_EXTI_Result_Ok: Everything ok, interrupt attached
- TM_EXTI_Result_Error: An error occurred, interrupt was not attached
|
- Note
- If you use more than one GPIO_Pin with OR (|) operator at single call and if GPIO_Pin can't be attached because there is already one GPIO_Pin at this line, function will return error and other pins might not be initialized. If function return
- TM_EXTI_Result_Ok, then all pins are attached correctly.
| void TM_EXTI_DeInit |
( |
void |
| ) |
|
Clears all interrupts on EXTI line.
- Note
- It clears bits for external pins (bit 0 to bit 15) only! It has no effect for internally connected peripherals (like RTC) to EXTI line
- Parameters
-
- Return values
-
Detach GPIO pin from interrupt lines.
- Parameters
-
| GPIO_Line | GPIO line you want to disable. Valid GPIO is GPIO_Pin_0 to GPIO_Pin_15. Use OR (|) operator if you want to detach interrupt in more than one GPIO pin at the same GPIOx at the same time. |
- Return values
-
| Detaching | result:
- TM_EXTI_Result_Ok: Everything ok
- TM_EXTI_Result_Error: An error occurred
|
| void TM_EXTI_Handler |
( |
uint16_t |
GPIO_Pin | ) |
|
EXTI Global handler.
- Note
- This function is called from TM EXTI library each time any interrupt occurs on EXTI line.
-
With __weak parameter to prevent link errors if not defined by user.
- Parameters
-
| GPIO_Pin | GPIO Line where interrupt occurred so you can identify what to do |
- Return values
-