C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
ky040.h
Go to the documentation of this file.
1
11
12#pragma once
13
15#include "sw/ui_core/ui_core.h"
16
17
25class KY040 : public UIController
26{
27private:
29 SwitchButton central_switch;
31 RotaryEncoder encoder;
32
33public:
44 KY040(uint central_switch_gpio,
45 uint encoder_clk_gpio,
46 uint encoder_dt_gpio,
47 gpio_irq_callback_t call_back = nullptr,
48 struct_ConfigSwitchButton sw_conf = {},
49 struct_ConfigSwitchButton clk_conf = {});
50 ~KY040();
56 void process_encoder_IRQ(uint32_t event_mask);
69};
70
void update_UI_control_event_processor(control_event_processor_t event_processor)
the update control event processor function used to hide encoder from KY040 user
Definition ky040.cpp:29
KY040(uint central_switch_gpio, uint encoder_clk_gpio, uint encoder_dt_gpio, gpio_irq_callback_t call_back=nullptr, struct_ConfigSwitchButton sw_conf={}, struct_ConfigSwitchButton clk_conf={})
Construct a new KY040 object.
Definition ky040.cpp:3
UIControlEvent process_central_switch_event()
the function used to mask the central switch button from KY040 user
Definition ky040.cpp:24
void process_encoder_IRQ(uint32_t event_mask)
the call back function used to hide encoder from KY040 user
Definition ky040.cpp:19
The RotaryEncoder is a device used to control a value the can be incremented/decremented by the user....
Definition rotary_encoder.h:33
SwitchButton status is sampled periodically by software.
Definition switch_button.h:106
UIController()
create a UIController object
Definition ui_core.cpp:178
void(* control_event_processor_t)(UIControlEvent event)
this is a function pointer used as rotary encoder constructor paramater
Definition rotary_encoder.h:17
These are the values used to configure a switch button (0) debounce_delay_us (1) long_release_delay_u...
Definition switch_button.h:63
UIControlEvent
The list of predefined events that a button, or more generally an User Interface Controller,...
Definition ui_control_event.h:18