TB2026-YDS Firmware
Loading...
Searching...
No Matches
input.c File Reference

Input service: ISR-notified task reads buttons over I2C/GPIO, debounces, queues events. More...

#include "input.h"
#include "input_logic.h"
#include "gpio_expander.h"
#include "driver/gpio.h"
#include "esp_timer.h"
#include "diag.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"

Macros

#define INPUT_TASK_PRIO   5 /* UI/maintenance band, below the audio task (22) */
#define INPUT_TASK_STACK   3072
#define INPUT_QUEUE_LEN   8 /* far more than a human can outrun; events drop if ever full */

Functions

esp_err_t input_init (void)
 Bring up the input service: queue, both ISRs, the input task, and A's wake-ready pin.
bool input_get_event (ui_event_t *out, TickType_t ticks_to_wait)
 Block until the next input event (the UI task's read side of the queue).
uint32_t input_idle_ms (void)
 Milliseconds since the last button event was emitted.
void input_get_diag (input_diag_t *out)
 Read the current button state and per-button press counts.

Detailed Description

Input service: ISR-notified task reads buttons over I2C/GPIO, debounces, queues events.

Note
Développé avec l'assistance de Claude Opus 4.8 (Anthropic), sous la direction de Y. Dos Santos : spécification, revue et validation sur cible par l'auteur.

Macro Definition Documentation

◆ INPUT_QUEUE_LEN

#define INPUT_QUEUE_LEN   8 /* far more than a human can outrun; events drop if ever full */

◆ INPUT_TASK_PRIO

#define INPUT_TASK_PRIO   5 /* UI/maintenance band, below the audio task (22) */

◆ INPUT_TASK_STACK

#define INPUT_TASK_STACK   3072