![]() |
OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
|
Everything related to hardware inputs and their events. More...
Functions | |
| void | addButton (InputGPIO pin, InputNumber inputNumber) |
| Add a button attached to a single pin to the hardware inputs. | |
| void | addRotaryEncoder (InputGPIO clkPin, InputGPIO dtPin, InputNumber cwInputNumber, InputNumber ccwInputNumber, bool useAlternateEncoding=false) |
| Add incremental rotary encoder inputs bound to specific input numbers. | |
| void | addButtonMatrix (const ButtonMatrix &matrix, bool negativeLogic=false) |
| Add a button matrix to the hardware inputs. | |
| void | addAnalogMultiplexerGroup (OutputGPIO selectorPin1, OutputGPIO selectorPin2, OutputGPIO selectorPin3, const AnalogMultiplexerGroup< Mux8Pin > &chips) |
| Add a group of 8-channel multiplexers to the hardware inputs. | |
| void | addAnalogMultiplexerGroup (OutputGPIO selectorPin1, OutputGPIO selectorPin2, OutputGPIO selectorPin3, OutputGPIO selectorPin4, const AnalogMultiplexerGroup< Mux16Pin > &chips) |
| Add a group of 16-channel multiplexers to the hardware inputs. | |
| void | addAnalogMultiplexerGroup (OutputGPIO selectorPin1, OutputGPIO selectorPin2, OutputGPIO selectorPin3, OutputGPIO selectorPin4, OutputGPIO selectorPin5, const AnalogMultiplexerGroup< Mux32Pin > &chips) |
| Add a group of 32-channel multiplexers to the hardware inputs. | |
| void | addMCP23017Expander (const MCP23017Expander &chip, uint8_t address, bool isFullAddress=false, I2CBus bus=I2CBus::PRIMARY) |
| Add a MCP23017 GPIO expander to the hardware inputs. | |
| void | addPCF8574Expander (const PCF8574Expander &chip, uint8_t address, bool isFullAddress=false, I2CBus bus=I2CBus::PRIMARY) |
| Add a PCF8574 GPIO expander to the hardware inputs. | |
| void | add74HC165NChain (OutputGPIO loadPin, OutputGPIO nextPin, InputGPIO inputPin, const ShiftRegisterChain &chain, InputNumber SER_inputNumber=UNSPECIFIED::VALUE, const bool negativeLogic=true) |
| Add a chain of 74HC165N PISO shift registers to the hardware inputs. | |
| void | addRotaryCodedSwitch (const RotaryCodedSwitch &spec, InputGPIO pin0, InputGPIO pin1, InputGPIO pin2, bool complementaryCode=true) |
| Add a binary coded rotary switch up to 8 positions. | |
| void | addRotaryCodedSwitch (const RotaryCodedSwitch &spec, InputGPIO pin0, InputGPIO pin1, InputGPIO pin2, InputGPIO pin3, bool complementaryCode=true) |
| Add a binary coded rotary switch up to 16 positions. | |
| void | addRotaryCodedSwitch (const RotaryCodedSwitch &spec, InputGPIO pin0, InputGPIO pin1, InputGPIO pin2, InputGPIO pin3, InputGPIO pin4, bool complementaryCode=true) |
| Add a binary coded rotary switch up to 32 positions. | |
| void | initializeI2C (GPIO sclPin, GPIO sdaPin, I2CBus bus=I2CBus::PRIMARY, bool enableInternalPullup=true) |
| Initialize an I2C bus to certain pins. | |
| void | setAnalogClutchPaddles (ADC_GPIO leftClutchPin, ADC_GPIO rightClutchPin) |
| Set two potentiometers as clutch paddles. Each one will work as an analog axis. | |
Everything related to hardware inputs and their events.
| void inputs::add74HC165NChain | ( | OutputGPIO | loadPin, |
| OutputGPIO | nextPin, | ||
| InputGPIO | inputPin, | ||
| const ShiftRegisterChain & | chain, | ||
| InputNumber | SER_inputNumber = UNSPECIFIED::VALUE, | ||
| const bool | negativeLogic = true ) |
Add a chain of 74HC165N PISO shift registers to the hardware inputs.
| loadPin | Pin attached to LOAD in the fist chip in the chain |
| nextPin | Pin attached to NEXT in the first chip in the chain |
| inputPin | Pin attached to INPUT in the fist chip in the chain |
| chain | Chain of specifications of input numbers |
| SER_inputNumber | Input number for the switch attached to the SER pin in the last chip. Set to UNSPECIFIED::VALUE to ignore. |
| negativeLogic | If true, all switches must be pulled down (the default), If false, all switches must be pulled up (positive logic). |
| void inputs::addAnalogMultiplexerGroup | ( | OutputGPIO | selectorPin1, |
| OutputGPIO | selectorPin2, | ||
| OutputGPIO | selectorPin3, | ||
| const AnalogMultiplexerGroup< Mux8Pin > & | chips ) |
Add a group of 8-channel multiplexers to the hardware inputs.
| selectorPin1 | Least-significant selector pin |
| selectorPin2 | Second selector pin |
| selectorPin3 | Third selector pin |
| chips | Array of chips sharing the given selector pins |
| void inputs::addAnalogMultiplexerGroup | ( | OutputGPIO | selectorPin1, |
| OutputGPIO | selectorPin2, | ||
| OutputGPIO | selectorPin3, | ||
| OutputGPIO | selectorPin4, | ||
| const AnalogMultiplexerGroup< Mux16Pin > & | chips ) |
Add a group of 16-channel multiplexers to the hardware inputs.
| selectorPin1 | Least-significant selector pin |
| selectorPin2 | Second selector pin |
| selectorPin3 | Third selector pin |
| selectorPin4 | Fourth selector pin |
| chips | Array of chips sharing the given selector pins |
| void inputs::addAnalogMultiplexerGroup | ( | OutputGPIO | selectorPin1, |
| OutputGPIO | selectorPin2, | ||
| OutputGPIO | selectorPin3, | ||
| OutputGPIO | selectorPin4, | ||
| OutputGPIO | selectorPin5, | ||
| const AnalogMultiplexerGroup< Mux32Pin > & | chips ) |
Add a group of 32-channel multiplexers to the hardware inputs.
| selectorPin1 | Least-significant selector pin |
| selectorPin2 | Second selector pin |
| selectorPin3 | Third selector pin |
| selectorPin4 | Fourth selector pin |
| selectorPin5 | Fifth selector pin |
| chips | Array of chips sharing the given selector pins |
| void inputs::addButton | ( | InputGPIO | pin, |
| InputNumber | inputNumber ) |
Add a button attached to a single pin to the hardware inputs.
| pin | GPIO attached to the button |
| inputNumber | Assigned input number |
| void inputs::addButtonMatrix | ( | const ButtonMatrix & | matrix, |
| bool | negativeLogic = false ) |
Add a button matrix to the hardware inputs.
| matrix | Specification of input numbers and GPIO pins |
| negativeLogic | If true, selector pins are enabled on HIGH. If false, selector pins are enabled on LOW. |
| void inputs::addMCP23017Expander | ( | const MCP23017Expander & | chip, |
| uint8_t | address, | ||
| bool | isFullAddress = false, | ||
| I2CBus | bus = I2CBus::PRIMARY ) |
Add a MCP23017 GPIO expander to the hardware inputs.
| chip | Specification of input numbers |
| address | Full (7-bit) or hardware (3-bit) I2C address |
| isFullAddress | If true, address is a full address, If false, address is a hardware address. |
| bus | I2C bus to which the chip is connected. If the secondary bus is used, manual initialization is required using inputs::initializeI2C() |
| void inputs::addPCF8574Expander | ( | const PCF8574Expander & | chip, |
| uint8_t | address, | ||
| bool | isFullAddress = false, | ||
| I2CBus | bus = I2CBus::PRIMARY ) |
Add a PCF8574 GPIO expander to the hardware inputs.
| chip | Specification of input numbers |
| address | Full (7-bit) or hardware (3-bit) I2C address |
| isFullAddress | If true, address is a full address, If false, address is a hardware address. |
| bus | I2C bus to which the chip is connected. If the secondary bus is used, manual initialization is required using inputs::initializeI2C() |
| void inputs::addRotaryCodedSwitch | ( | const RotaryCodedSwitch & | spec, |
| InputGPIO | pin0, | ||
| InputGPIO | pin1, | ||
| InputGPIO | pin2, | ||
| bool | complementaryCode = true ) |
Add a binary coded rotary switch up to 8 positions.
| spec | Specification of input numbers for each switch position |
| pin0 | Input pin for the least-significant bit |
| pin1 | Input pin |
| pin2 | Input pin for the most-significant bit |
| complementaryCode | Set to true if your rotary switch uses complementary binary code |
| void inputs::addRotaryCodedSwitch | ( | const RotaryCodedSwitch & | spec, |
| InputGPIO | pin0, | ||
| InputGPIO | pin1, | ||
| InputGPIO | pin2, | ||
| InputGPIO | pin3, | ||
| bool | complementaryCode = true ) |
Add a binary coded rotary switch up to 16 positions.
| spec | Specification of input numbers for each switch position |
| pin0 | Input pin for the least-significant bit |
| pin1 | Input pin |
| pin2 | Input pin |
| pin3 | Input pin for the most-significant bit |
| complementaryCode | Set to true if your rotary switch uses complementary binary code |
| void inputs::addRotaryCodedSwitch | ( | const RotaryCodedSwitch & | spec, |
| InputGPIO | pin0, | ||
| InputGPIO | pin1, | ||
| InputGPIO | pin2, | ||
| InputGPIO | pin3, | ||
| InputGPIO | pin4, | ||
| bool | complementaryCode = true ) |
Add a binary coded rotary switch up to 32 positions.
| spec | Specification of input numbers for each switch position |
| pin0 | Input pin for the least-significant bit |
| pin1 | Input pin |
| pin2 | Input pin |
| pin3 | Input pin |
| pin4 | Input pin for the most-significant bit |
| complementaryCode | Set to true if your rotary switch uses complementary binary code |
| void inputs::addRotaryEncoder | ( | InputGPIO | clkPin, |
| InputGPIO | dtPin, | ||
| InputNumber | cwInputNumber, | ||
| InputNumber | ccwInputNumber, | ||
| bool | useAlternateEncoding = false ) |
Add incremental rotary encoder inputs bound to specific input numbers.
| clkPin | GPIO attached to CLK or A | |
| dtPin | GPIO attached to DT or B | |
| [in] | cwInputNumber | A number for the "virtual button" of a clockwise rotation event. |
| [in] | ccwInputNumber | A number for the "virtual button" of a counter-clockwise rotation event. |
| [in] | useAlternateEncoding | Set to true in order to use the signal encoding of ALPS RKJX series of rotary encoders, and the alike. |
| void inputs::initializeI2C | ( | GPIO | sclPin, |
| GPIO | sdaPin, | ||
| I2CBus | bus = I2CBus::PRIMARY, | ||
| bool | enableInternalPullup = true ) |
Initialize an I2C bus to certain pins.
| sclPin | SCL or SCK pin |
| sdaPin | SDA pin |
| bus | I2C bus to initialize |
| enableInternalPullup | If true (default), the bus is pulled up using internal resistors. If false, external pullup resistors must be in place as the internal ones are not enabled. Otherwise, the bus won't work. |
Set two potentiometers as clutch paddles. Each one will work as an analog axis.
| leftClutchPin | ADC pin for the left clutch paddle |
| rightClutchPin | ADC pin for the right clutch paddle. Must differ from leftClutchPin. |