Open FFBoard
Open source force feedback firmware
ButtonSource.h
Go to the documentation of this file.
1/*
2 * ButtonSource.h
3 *
4 * Created on: 09.02.2020
5 * Author: Yannick
6 */
7
8#ifndef BUTTONSOURCE_H_
9#define BUTTONSOURCE_H_
10
11#include "cppmain.h"
12#include "ChoosableClass.h"
13#include "PersistentStorage.h"
14#include "vector"
15
20public:
22 virtual ~ButtonSource();
27 virtual uint8_t readButtons(uint64_t* buf) = 0;
28 virtual uint16_t getBtnNum(); // Amount of readable buttons
29
30 const virtual ClassIdentifier getInfo() = 0;
32 static bool isCreatable() {return true;};
34
35 static const std::vector<class_entry<ButtonSource> > all_buttonsources;
36
37protected:
38 uint16_t btnnum = 0; // Amount of active buttons (valid bitfield length) to report
39};
40
41#endif /* BUTTONSOURCE_H_ */
ClassType
Definition: ClassIDs.h:12
virtual const ClassType getClassType()
returns the used classchooser selection id of this instance
Definition: ButtonSource.h:33
virtual const ClassIdentifier getInfo()=0
static bool isCreatable()
Definition: ButtonSource.h:32
uint16_t btnnum
Definition: ButtonSource.h:38
virtual uint16_t getBtnNum()
static const std::vector< class_entry< ButtonSource > > all_buttonsources
Definition: ButtonSource.h:33
static ClassIdentifier info
Definition: ButtonSource.h:31
virtual uint8_t readButtons(uint64_t *buf)=0
virtual ~ButtonSource()