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

Base class for switches/buttons attached to an I2C GPIO expander. More...

#include <InputHardware.hpp>

Public Member Functions

 I2CInput (uint8_t address7Bits, I2CBus bus=I2CBus::PRIMARY, uint8_t max_speed_mult=1)
 Construct a new I2CButtonsInput object.
 
- Public Member Functions inherited from DigitalInput
virtual uint64_t read (uint64_t lastState)=0
 Read the current state of the inputs (pressed or released)
 

Protected Attributes

void * device = nullptr
 Slave device in the I2C API (must be type-casted)
 

Additional Inherited Members

- Public Attributes inherited from DigitalInput
uint64_t mask = ~0ULL
 Input mask. For read-only.
 
- Protected Member Functions inherited from DigitalInput
void addToMask (uint64_t bitmap)
 Add an input bitmap to the current mask.
 

Detailed Description

Base class for switches/buttons attached to an I2C GPIO expander.

Note
All buttons must work in negative logic (pulled up)

Definition at line 316 of file InputHardware.hpp.

Constructor & Destructor Documentation

◆ I2CInput()

I2CInput::I2CInput ( uint8_t address7Bits,
I2CBus bus = I2CBus::PRIMARY,
uint8_t max_speed_mult = 1 )

Construct a new I2CButtonsInput object.

Parameters
address7BitsI2C address in 7 bits format
busBus where the chip is attached to
max_speed_multBus speed multiplier in the range from 1 to 4

Member Data Documentation

◆ device

void* I2CInput::device = nullptr
protected

Slave device in the I2C API (must be type-casted)

Definition at line 320 of file InputHardware.hpp.


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