Handle buttons & encoders in View, not Model
This commit is contained in:
24
Core/Inc/STWButtonController.hpp
Normal file
24
Core/Inc/STWButtonController.hpp
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef __INC_STW_BUTTON_CONTROLLER_HPP
|
||||
#define __INC_STW_BUTTON_CONTROLLER_HPP
|
||||
|
||||
#include "platform/driver/button/ButtonController.hpp"
|
||||
#include <stdint.h>
|
||||
|
||||
constexpr uint8_t KEY_BTN1 = 1;
|
||||
constexpr uint8_t KEY_BTN2 = 2;
|
||||
constexpr uint8_t KEY_BTN3 = 3;
|
||||
constexpr uint8_t KEY_BTN4 = 4;
|
||||
constexpr uint8_t KEY_BTN5 = 5;
|
||||
constexpr uint8_t KEY_BTN6 = 6;
|
||||
constexpr uint8_t KEY_ENC1_CW = 21;
|
||||
constexpr uint8_t KEY_ENC1_CCW = 22;
|
||||
constexpr uint8_t KEY_ENC2_CW = 23;
|
||||
constexpr uint8_t KEY_ENC2_CCW = 24;
|
||||
|
||||
class STWButtonController : public touchgfx::ButtonController {
|
||||
public:
|
||||
virtual void init();
|
||||
virtual bool sample(uint8_t &key);
|
||||
};
|
||||
|
||||
#endif // __INC_STW_BUTTON_CONTROLLER_HPP
|
||||
Reference in New Issue
Block a user