TB2026-YDS Firmware
Toggle main menu visibility
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
36
typedef
struct
{
37
uint8_t
prev
;
38
uint32_t
last_ms
[
INPUT_BTN_COUNT
];
39
uint32_t
count
[
INPUT_BTN_COUNT
];
40
}
input_debounce_t
;
41
57
int
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
event.h
Input event vocabulary shared by screens and the navigator.
INPUT_BTN_COUNT
#define INPUT_BTN_COUNT
Number of physical buttons handled (5 expander + A).
Definition
input_logic.h:29
input_logic_update
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
ui_event_t
A single UI input event, produced from button/encoder input.
Definition
event.h:19
input_debounce_t
Debounce/edge state. Zero-initialise before the first call (memset or {0}).
Definition
input_logic.h:36
input_debounce_t::prev
uint8_t prev
Definition
input_logic.h:37
input_debounce_t::count
uint32_t count[INPUT_BTN_COUNT]
Definition
input_logic.h:39
input_debounce_t::last_ms
uint32_t last_ms[INPUT_BTN_COUNT]
Definition
input_logic.h:38
components
services
input
input_logic.h
Generated by
1.17.0