Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
src
core
buttons.h
Go to the documentation of this file.
1
#pragma once
2
#include <stdint.h>
3
4
namespace
Buttons
{
5
enum class
Pull
: uint8_t {
None
,
Up
,
Down
};
6
enum 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
16
void
begin
(
int
topPin,
int
bottomPin,
Pull
topPull,
Pull
bottomPull,
17
bool
topActiveLow,
bool
bottomActiveLow);
18
void
tick
();
19
Event
takeEvent
();
20
bool
hasPendingEvents
();
21
const
char
*
name
(
Event
event);
22
}
Buttons
Definition
buttons.h:4
Buttons::tick
void tick()
Buttons::Event
Event
Definition
buttons.h:6
Buttons::Event::Action
@ Action
Buttons::Event::Next
@ Next
Buttons::Event::ActionLong
@ ActionLong
Buttons::Event::Home
@ Home
Buttons::Event::ActionAlt
@ ActionAlt
Buttons::Event::Previous
@ Previous
Buttons::begin
void begin(int topPin, int bottomPin, Pull topPull, Pull bottomPull, bool topActiveLow, bool bottomActiveLow)
Buttons::Pull
Pull
Definition
buttons.h:5
Buttons::Pull::Down
@ Down
Buttons::Pull::Up
@ Up
Buttons::Pull::None
@ None
Buttons::hasPendingEvents
bool hasPendingEvents()
Buttons::name
const char * name(Event event)
Buttons::takeEvent
Event takeEvent()
Generated by
1.9.8