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

Class for buttons attached to a MCP23017 GPIO expander. More...

#include <InputHardware.hpp>

Public Member Functions

 MCP23017ButtonsInput (const MCP23017Expander &inputNumbers, uint8_t address7Bits, I2CBus bus=I2CBus::PRIMARY)
 Construct a new MCP23017ButtonsInput object.
 
virtual void read (uint128_t &state) override
 Read the current state of the inputs (pressed or released)
 
- Public Member Functions inherited from I2CInput
 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

Additional Inherited Members

- Protected Attributes inherited from I2CInput
void * device = nullptr
 Slave device in the I2C API (must be type-casted)
 

Detailed Description

Class for buttons attached to a MCP23017 GPIO expander.

Definition at line 328 of file InputHardware.hpp.

Constructor & Destructor Documentation

◆ MCP23017ButtonsInput()

MCP23017ButtonsInput::MCP23017ButtonsInput ( const MCP23017Expander & inputNumbers,
uint8_t address7Bits,
I2CBus bus = I2CBus::PRIMARY )

Construct a new MCP23017ButtonsInput object.

Parameters
inputNumbersSpecification of inputs
address7BitsI2C address in 7 bits format
busBus where the chip is attached to

Member Function Documentation

◆ read()

virtual void MCP23017ButtonsInput::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.


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