13#include "rotary_encoder.h"
19#define CENTRAL_SWITCH_GPIO 6
20#define ENCODER_CLK_GPIO 26
21#define ENCODER_DT_GPIO 21
23Probe pr_D1 = Probe(1);
24Probe pr_D4 = Probe(4);
25Probe pr_D5 = Probe(5);
27StructSwitchButtonConfig cfg_central_switch{
28 .debounce_delay_us = 5000,
29 .long_release_delay_us = 1000000,
30 .long_push_delay_us = 1000000,
33StructSwitchButtonConfig cfg_encoder_clk{
34 .debounce_delay_us = 5000};
36void shared_irq_call_back(uint gpio, uint32_t event_mask);
37RotaryEncoder encoder = RotaryEncoder(ENCODER_CLK_GPIO, ENCODER_DT_GPIO,
38 shared_irq_call_back, cfg_encoder_clk);
40SwitchButton central_switch = SwitchButton(CENTRAL_SWITCH_GPIO, cfg_central_switch);
42void shared_irq_call_back(uint gpio, uint32_t event_mask)
47 case ENCODER_CLK_GPIO:
48 encoder.interrupt_service_routine(event_mask);
52 printf(
"unknown IRQ\n");
91 ControlEvent event = central_switch.process_sample_event();
void process_control_event(ControlEvent _event)
void update_status(ControlledObjectStatus _new_status)
void add_managed_model(UIModelObject *_new_model)
ControlEvent
The list of predefined event that a Controller can send to the controlled object, leaving it the resp...