|
cursada_mc2
Base de control de temperatura para EDU-CIAA-NXP
|
Interfaz del driver de pulsadores discretos. More...
#include "chip.h"
Include dependency graph for buttons_driver.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | TECLA1 1 |
| Identificador de la tecla 1. | |
| #define | TECLA2 2 |
| Identificador de la tecla 2. | |
| #define | TECLA3 3 |
| Identificador de la tecla 3. | |
| #define | TECLA4 4 |
| Identificador de la tecla 4. | |
| #define | PININT0_IRQ_HANDLER GPIO0_IRQHandler |
| Alias del handler de interrupcion del pulsador 1. | |
| #define | PININT1_IRQ_HANDLER GPIO1_IRQHandler |
| Alias del handler de interrupcion del pulsador 2. | |
| #define | PININT2_IRQ_HANDLER GPIO2_IRQHandler |
| Alias del handler de interrupcion del pulsador 3. | |
| #define | PININT3_IRQ_HANDLER GPIO3_IRQHandler |
| Alias del handler de interrupcion del pulsador 4. | |
Functions | |
| void | buttons_init (void) |
| Inicializa los pines asociados a los cuatro pulsadores. | |
| void | button_notify_irq (uint8_t button_id) |
| Notifica al driver que una tecla genero una interrupcion externa. | |
| void | buttons_process (uint32_t delta_ms) |
| Procesa el debounce y actualiza los eventos latcheados de teclas. | |
| uint8_t | button_get_event (void) |
| Devuelve y consume el siguiente evento de tecla confirmado. | |
| #define PININT0_IRQ_HANDLER | ( | void | ) | GPIO0_IRQHandler |
Definition at line 21 of file buttons_driver.h.
| #define PININT1_IRQ_HANDLER | ( | void | ) | GPIO1_IRQHandler |
Definition at line 23 of file buttons_driver.h.
| #define PININT2_IRQ_HANDLER | ( | void | ) | GPIO2_IRQHandler |
Definition at line 25 of file buttons_driver.h.
| #define PININT3_IRQ_HANDLER | ( | void | ) | GPIO3_IRQHandler |
Definition at line 27 of file buttons_driver.h.
| #define TECLA1 1 |
Definition at line 12 of file buttons_driver.h.
| #define TECLA2 2 |
Definition at line 14 of file buttons_driver.h.
| #define TECLA3 3 |
Definition at line 16 of file buttons_driver.h.
| #define TECLA4 4 |
Definition at line 18 of file buttons_driver.h.
| uint8_t button_get_event | ( | void | ) |
TECLA1..TECLA4 si hay un evento pendiente, o 0 si no hay eventos para consumir. Definition at line 163 of file buttons_driver.c.
References button_estados_, button_hw_, BUTTONS_CANTIDAD, button_estado_t::evento_pendiente, and button_hw_t::tecla.
Referenced by hmi_process().
| void button_notify_irq | ( | uint8_t | button_id | ) |
Esta funcion debe llamarse desde el handler asociado a la tecla correspondiente.
| button_id | Identificador de la tecla que disparo la IRQ. |
Definition at line 107 of file buttons_driver.c.
References button_estados_, and button_indice_desde_tecla().
Referenced by PININT0_IRQ_HANDLER(), PININT1_IRQ_HANDLER(), PININT2_IRQ_HANDLER(), and PININT3_IRQ_HANDLER().
| void buttons_init | ( | void | ) |
Definition at line 76 of file buttons_driver.c.
References button_estado_t::armado, button_estados_, button_hw_, BUTTONS_CANTIDAD, button_estado_t::debounce_acumulado_ms, button_estado_t::evento_pendiente, and button_estado_t::irq_pendiente.
Referenced by app_init().
| void buttons_process | ( | uint32_t | delta_ms | ) |
Debe llamarse de manera periodica desde el lazo principal.
| delta_ms | Tiempo transcurrido desde la ultima llamada, en milisegundos. |
Definition at line 120 of file buttons_driver.c.
References button_estado_t::armado, button_esta_presionado(), button_estados_, BUTTONS_CANTIDAD, BUTTONS_DEBOUNCE_MS, button_estado_t::debounce_acumulado_ms, button_estado_t::evento_pendiente, and button_estado_t::irq_pendiente.
Referenced by app_step_20ms().