TB2026-YDS Firmware
Loading...
Searching...
No Matches
input_logic.h
Go to the documentation of this file.
1
15#pragma once
16
17#include "event.h"
18#include <stdint.h>
19#include <stdbool.h>
20
27
29#define INPUT_BTN_COUNT 6
30
33#define INPUT_DEBOUNCE_MS 30
34
36typedef struct {
37 uint8_t prev;
41
57int input_logic_update(input_debounce_t *st, uint8_t exp_port, bool a_pressed,
58 uint32_t now_ms, ui_event_t *out, int out_cap);
59
Input event vocabulary shared by screens and the navigator.
#define INPUT_BTN_COUNT
Number of physical buttons handled (5 expander + A).
Definition input_logic.h:29
int input_logic_update(input_debounce_t *st, uint8_t exp_port, bool a_pressed, uint32_t now_ms, ui_event_t *out, int out_cap)
Fold one button sample into the debounce state, emitting just-pressed UI events.
Definition input_logic.c:31
ui_event_t
A single UI input event, produced from button/encoder input.
Definition event.h:19
Debounce/edge state. Zero-initialise before the first call (memset or {0}).
Definition input_logic.h:36
uint8_t prev
Definition input_logic.h:37
uint32_t count[INPUT_BTN_COUNT]
Definition input_logic.h:39
uint32_t last_ms[INPUT_BTN_COUNT]
Definition input_logic.h:38