Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
buttons.h
Go to the documentation of this file.
1#pragma once
2#include <stdint.h>
3
4namespace Buttons {
5enum class Pull : uint8_t { None, Up, Down };
6enum class Event : uint8_t {
7 None = 0,
8 Next, // Top single click: Next screen
9 Previous, // Top double click: Previous screen
10 Home, // Top long press: Clock / Home screen
11 Action, // Bottom single click: Context action (e.g. +1 Month, select)
12 ActionAlt, // Bottom double click: Context alt action (e.g. reset month, toggle done)
13 ActionLong // Bottom long press: Context trigger (e.g. WiFi sync)
14};
15
16void begin(int topPin, int bottomPin, Pull topPull, Pull bottomPull,
17 bool topActiveLow, bool bottomActiveLow);
18void tick();
21const char* name(Event event);
22}
Definition buttons.h:4
void tick()
Event
Definition buttons.h:6
void begin(int topPin, int bottomPin, Pull topPull, Pull bottomPull, bool topActiveLow, bool bottomActiveLow)
Pull
Definition buttons.h:5
bool hasPendingEvents()
const char * name(Event event)
Event takeEvent()