|
cursada_mc2
Base de control de temperatura para EDU-CIAA-NXP
|
Include dependency graph for buttons_driver.c:Go to the source code of this file.
Data Structures | |
| struct | button_hw_t |
| struct | button_estado_t |
Macros | |
| #define | BUTTONS_CANTIDAD 4U |
| #define | BUTTONS_DEBOUNCE_MS 40U |
Functions | |
| static int8_t | button_indice_desde_tecla (uint8_t tecla) |
| static bool | button_esta_presionado (uint8_t indice) |
| 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. | |
Variables | |
| static const button_hw_t | button_hw_ [BUTTONS_CANTIDAD] |
| static volatile button_estado_t | button_estados_ [BUTTONS_CANTIDAD] |
| #define BUTTONS_CANTIDAD 4U |
Definition at line 17 of file buttons_driver.c.
| #define BUTTONS_DEBOUNCE_MS 40U |
Definition at line 18 of file buttons_driver.c.
|
static |
Definition at line 71 of file buttons_driver.c.
References button_hw_.
Referenced by buttons_process().
| 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().
|
static |
Definition at line 55 of file buttons_driver.c.
References TECLA1, TECLA2, TECLA3, and TECLA4.
Referenced by button_notify_irq().
| 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().
|
static |
Definition at line 48 of file buttons_driver.c.
Referenced by button_get_event(), button_notify_irq(), buttons_init(), and buttons_process().
|
static |
Definition at line 41 of file buttons_driver.c.
Referenced by button_esta_presionado(), button_get_event(), and buttons_init().