2022-09-21 11:20:12 +03:00

51 lines
1.1 KiB
C++

/*
* EventHandler.h
*
* Created on: Sep 21, 2022
* Author: tylen
*
* Purpose of this class is to store and pass
* the events of the current mode to further process.
*
* Current goal is to make it to operate on interrupts
* caused by button presses.
*
*/
#ifndef EVENTHANDLER_H_
#define EVENTHANDLER_H_
#include "DigitalIoPin.h"
#include "Counter.h"
/** A structure to hold button pointers
*
* Main four buttons that operate the
* whole program. The structure should be
* initialized in main with correct values and
* passed to main EvenHandler object constructor.
*
* */
typedef struct _EVENT_HANDL{
DigitalIoPin * _button_control_up;
DigitalIoPin * _button_control_down;
DigitalIoPin * _button_control_toggle_mode;
DigitalIoPin * _button_control_toggle_active;
} EVENT_HANDL;
class EventHandler {
public:
EventHandler(EVENT_HANDL btns);
virtual ~EventHandler();
int getSetPresuure(); // Get currently set pressure 0-100%
int getSetSpeed(); //Get currently set FanSpeed 0-100%
private:
EVENT_HANDL internal = {0,0,0,0};
bool mode;
Counter * bar_pressure;
Counter * bar_speed;
};
#endif /* EVENTHANDLER_H_ */