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

State of switches connected to PISO shift registers. More...

#include <InputHardware.hpp>

Public Member Functions

 ShiftRegistersInput (OutputGPIO loadPin, OutputGPIO nextPin, InputGPIO inputPin, const ShiftRegisterChain &chain, InputNumber SER_inputNumber=UNSPECIFIED::VALUE, const bool loadHighOrLow=false, const bool nextHighToLowOrLowToHigh=false, const bool negativeLogic=true)
 Construct a new Shift Registers Input object.
 
virtual void read (uint128_t &state) override
 Read the current state of the inputs (pressed or released)
 
- Public Member Functions inherited from DigitalInput

Detailed Description

State of switches connected to PISO shift registers.

Definition at line 359 of file InputHardware.hpp.

Constructor & Destructor Documentation

◆ ShiftRegistersInput()

ShiftRegistersInput::ShiftRegistersInput ( OutputGPIO loadPin,
OutputGPIO nextPin,
InputGPIO inputPin,
const ShiftRegisterChain & chain,
InputNumber SER_inputNumber = UNSPECIFIED::VALUE,
const bool loadHighOrLow = false,
const bool nextHighToLowOrLowToHigh = false,
const bool negativeLogic = true )

Construct a new Shift Registers Input object.

Parameters
loadPinGPIO number of the load pin
nextPinGPIO number of the next/clock pin
inputPinGPIO number of the serial output pin
chainChain of PISO shift registers
SER_inputNumberInput number assigned to the SER pin in the last chip of the chain.
loadHighOrLowIf true, parallel inputs are loaded when loadPinis HIGH. If false, parallel inputs are loaded when loadPinis LOW.
nextHighToLowOrLowToHighIf true, next bit is selected when an high-to-low pulse is detected at nextPin. If false, next bit is selected when a low-to-high pulse is detected.
negativeLogicIf true, all switches must be pulled down (the default), If false, all switches must be pulled up (positive logic).

Member Function Documentation

◆ read()

virtual void ShiftRegistersInput::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: