OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
Loading...
Searching...
No Matches
DigitalButton Class Reference

Single button. More...

#include <InputHardware.hpp>

Public Member Functions

 DigitalButton (InputGPIO pinNumber, InputNumber buttonNumber)
 Construct a new Digital Button object.
 
virtual void read (uint128_t &state) override
 Read the current state of the inputs (pressed or released)
 
- Public Member Functions inherited from DigitalInput

Protected Attributes

InputGPIO pinNumber
 Configured input pin.
 
uint8_t inputNumber
 Input bitmap.
 

Detailed Description

Single button.

Definition at line 60 of file InputHardware.hpp.

Constructor & Destructor Documentation

◆ DigitalButton()

DigitalButton::DigitalButton ( InputGPIO pinNumber,
InputNumber buttonNumber )

Construct a new Digital Button object.

Parameters
[in]pinNumberGPIO pin where the button is attached to
[in]buttonNumberAssigned number for this button

Member Function Documentation

◆ read()

virtual void DigitalButton::read ( uint128_t & state)
overridevirtual

Read the current state of the inputs (pressed or released)

Warning
This function must not set or clear any bit outside of the input bitmask in the return value.
Parameters
[in,out]stateAt call, state of all inputs as recorded in the previous iteration. Whether the current state is unknown, state must be kept untouched. At return, new state of the inputs.

Implements DigitalInput.

Member Data Documentation

◆ inputNumber

uint8_t DigitalButton::inputNumber
protected

Input bitmap.

Definition at line 66 of file InputHardware.hpp.

◆ pinNumber

InputGPIO DigitalButton::pinNumber
protected

Configured input pin.

Definition at line 64 of file InputHardware.hpp.


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