Open FFBoard
Open source force feedback firmware
SelectableInputs Class Reference

#include <SelectableInputs.h>

Inheritance diagram for SelectableInputs:
CANInputMain FFBHIDMain FFBHIDExt FFBJoystick FFBWheel

Public Member Functions

 SelectableInputs (const ClassChooser< ButtonSource > &btn_chooser, const ClassChooser< AnalogSource > &analog_chooser)
 
virtual ~SelectableInputs ()
 
virtual void setBtnTypes (uint16_t btntypes)
 
virtual void addBtnType (uint16_t id)
 
virtual void clearBtnTypes ()
 
virtual void setAinTypes (uint16_t aintypes)
 
virtual void addAinType (uint16_t id)
 
virtual void clearAinTypes ()
 
virtual uint8_t getButtonValues (uint64_t &values)
 
virtual std::vector< int32_t > * getAnalogValues ()
 

Protected Attributes

std::vector< std::unique_ptr< ButtonSource > > btns
 
std::vector< std::unique_ptr< AnalogSource > > analog_inputs
 
cpp_freertos::BinarySemaphore sourcesSem = cpp_freertos::BinarySemaphore(true)
 
uint16_t btnsources = 0
 
uint16_t ainsources = 0
 
std::vector< int32_t > analogsources_buf
 
ClassChooser< ButtonSourcebtn_chooser
 
ClassChooser< AnalogSourceanalog_chooser
 

Detailed Description

Helper class with common functions to manage input sources

Definition at line 17 of file SelectableInputs.h.

Constructor & Destructor Documentation

◆ SelectableInputs()

SelectableInputs::SelectableInputs ( const ClassChooser< ButtonSource > &  btn_chooser,
const ClassChooser< AnalogSource > &  analog_chooser 
)

Definition at line 10 of file SelectableInputs.cpp.

◆ ~SelectableInputs()

SelectableInputs::~SelectableInputs ( )
virtual

Definition at line 16 of file SelectableInputs.cpp.

Member Function Documentation

◆ addAinType()

void SelectableInputs::addAinType ( uint16_t  id)
virtual

Definition at line 75 of file SelectableInputs.cpp.

◆ addBtnType()

void SelectableInputs::addBtnType ( uint16_t  id)
virtual

Definition at line 43 of file SelectableInputs.cpp.

◆ clearAinTypes()

void SelectableInputs::clearAinTypes ( )
virtual

Definition at line 55 of file SelectableInputs.cpp.

◆ clearBtnTypes()

void SelectableInputs::clearBtnTypes ( )
virtual

Definition at line 22 of file SelectableInputs.cpp.

◆ getAnalogValues()

std::vector< int32_t > * SelectableInputs::getAnalogValues ( )
virtual

Gets analog values from all analog sources

Definition at line 105 of file SelectableInputs.cpp.

◆ getButtonValues()

uint8_t SelectableInputs::getButtonValues ( uint64_t &  values)
virtual

Gets button values from all button sources

Definition at line 89 of file SelectableInputs.cpp.

◆ setAinTypes()

void SelectableInputs::setAinTypes ( uint16_t  aintypes)
virtual

Definition at line 61 of file SelectableInputs.cpp.

◆ setBtnTypes()

void SelectableInputs::setBtnTypes ( uint16_t  btntypes)
virtual

Definition at line 28 of file SelectableInputs.cpp.

Member Data Documentation

◆ ainsources

uint16_t SelectableInputs::ainsources = 0
protected

Definition at line 41 of file SelectableInputs.h.

◆ analog_chooser

ClassChooser<AnalogSource> SelectableInputs::analog_chooser
protected

Definition at line 46 of file SelectableInputs.h.

◆ analog_inputs

std::vector<std::unique_ptr<AnalogSource> > SelectableInputs::analog_inputs
protected

Definition at line 36 of file SelectableInputs.h.

◆ analogsources_buf

std::vector<int32_t> SelectableInputs::analogsources_buf
protected

Definition at line 43 of file SelectableInputs.h.

◆ btn_chooser

ClassChooser<ButtonSource> SelectableInputs::btn_chooser
protected

Definition at line 45 of file SelectableInputs.h.

◆ btns

std::vector<std::unique_ptr<ButtonSource> > SelectableInputs::btns
protected

Definition at line 35 of file SelectableInputs.h.

◆ btnsources

uint16_t SelectableInputs::btnsources = 0
protected

Definition at line 40 of file SelectableInputs.h.

◆ sourcesSem

cpp_freertos::BinarySemaphore SelectableInputs::sourcesSem = cpp_freertos::BinarySemaphore(true)
protected

Definition at line 38 of file SelectableInputs.h.


The documentation for this class was generated from the following files: