hsc26-artemis2/firmware/app/ui/btn.h
true fe169b64f6 basic button handler routines added, hard buttons tested
touch sensors were also preliminary tested but not all have been analyzed yet.
2026-05-08 20:07:06 -07:00

44 lines
765 B
C

/*
* btn.h
*
* Created on: Oct 13, 2024
* Author: true
*/
#ifndef USER_UI_BTN_H_
#define USER_UI_BTN_H_
#include <stdint.h>
#define HB_COUNT 3 // total hard buttons in system
#define TS_COUNT 7 // total touch sensors in system
#define BTN_COUNT (HB_COUNT + TS_COUNT) // total buttons in system
#define DEBOUNCE 12
#define HOLD_COUNTS 600 // how long until a push-and-hold is detected
typedef struct BtnSub {
uint16_t hold; // initial hold
uint16_t repeat; // repeated hold
void (*cb_push)(uint8_t);
void (*cb_hold)(uint8_t);
void (*cb_release)(uint8_t);
} BtnSub;
extern BtnSub btn[BTN_COUNT];
void btn_process();
#endif /* USER_UI_BTN_H_ */