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
19
class
ButtonSource
:
public
ChoosableClass
,
public
PersistentStorage
{
20
public
:
21
ButtonSource
();
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;
31
static
ClassIdentifier
info
;
32
static
bool
isCreatable
() {
return
true
;};
33
virtual
const
ClassType
getClassType
() {
return
ClassType::Buttonsource
;};
34
35
static
const
std::vector<class_entry<ButtonSource> >
all_buttonsources
;
36
37
protected
:
38
uint16_t
btnnum
= 0;
// Amount of active buttons (valid bitfield length) to report
39
};
40
41
#endif
/* BUTTONSOURCE_H_ */
ChoosableClass.h
ClassType
ClassType
Definition:
ClassIDs.h:12
ClassType::Buttonsource
@ Buttonsource
PersistentStorage.h
ButtonSource
Definition:
ButtonSource.h:19
ButtonSource::getClassType
virtual const ClassType getClassType()
returns the used classchooser selection id of this instance
Definition:
ButtonSource.h:33
ButtonSource::getInfo
virtual const ClassIdentifier getInfo()=0
ButtonSource::isCreatable
static bool isCreatable()
Definition:
ButtonSource.h:32
ButtonSource::btnnum
uint16_t btnnum
Definition:
ButtonSource.h:38
ButtonSource::ButtonSource
ButtonSource()
Definition:
ButtonSource.cpp:17
ButtonSource::getBtnNum
virtual uint16_t getBtnNum()
Definition:
ButtonSource.cpp:26
ButtonSource::all_buttonsources
static const std::vector< class_entry< ButtonSource > > all_buttonsources
Definition:
ButtonSource.h:33
ButtonSource::info
static ClassIdentifier info
Definition:
ButtonSource.h:31
ButtonSource::readButtons
virtual uint8_t readButtons(uint64_t *buf)=0
ButtonSource::~ButtonSource
virtual ~ButtonSource()
Definition:
ButtonSource.cpp:21
ChoosableClass
Definition:
ChoosableClass.h:24
PersistentStorage
Definition:
PersistentStorage.h:14
cppmain.h
ClassIdentifier
Definition:
ChoosableClass.h:15
Firmware
FFBoard
Inc
ButtonSource.h
Generated by
1.9.2