![]() |
OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
|
8-LED driver based on the PCF8574 GPIO expander More...
#include <OutputHardware.hpp>
Public Member Functions | |
| PCF8574LedDriver (I2CBus bus, uint8_t address7bits) | |
| Construct a LED driver. | |
| void | setLed (uint8_t index, bool state) |
| Set the state of a single LED. | |
| void | shiftLeft () |
| Shift all lights to the left. | |
| void | shiftRight () |
| Shift all lights to the right. | |
| void | swap () |
| Invert the state of all LEDs. | |
| void | show () const |
| Show the required LEDs all at once. | |
| uint8_t | getState () const |
| Get the state of each LED. | |
| void | setState (uint8_t state) |
| Set the state of each LED all at once. | |
8-LED driver based on the PCF8574 GPIO expander
Definition at line 194 of file OutputHardware.hpp.
| PCF8574LedDriver::PCF8574LedDriver | ( | I2CBus | bus, |
| uint8_t | address7bits ) |
Construct a LED driver.
| bus | I2C bus where the chip is attached to. |
| address7bits | Full I2C address in 7-bit format. |
|
inline |
Definition at line 264 of file OutputHardware.hpp.
|
inline |
Get the state of each LED.
Definition at line 253 of file OutputHardware.hpp.
| void PCF8574LedDriver::setLed | ( | uint8_t | index, |
| bool | state ) |
Set the state of a single LED.
| index | LED index in the range [0,7]. P0 has index 0. |
| state | True to turn on, false to turn off. |
|
inline |
Set the state of each LED all at once.
| state | A bitmap. 1 means turn on. 0 means turn off. |
Definition at line 262 of file OutputHardware.hpp.
| void PCF8574LedDriver::shiftLeft | ( | ) |
Shift all lights to the left.
| void PCF8574LedDriver::shiftRight | ( | ) |
Shift all lights to the right.
|
inline |
Invert the state of all LEDs.
Definition at line 240 of file OutputHardware.hpp.