|
Open Model Railroad Network (OpenMRN)
|
Variant of the Charlieplex class that allows intensity to be set for each individual pin.
More...
#include <Charlieplex.hxx>
Public Member Functions | |
| WeightedCharlieplex (const Gpio *const pins[helper::num_bits()]) | |
| Constructor. | |
| void | tick () |
| Switches to the next output configuration of the charlieplexing pins. | |
| unsigned * | payload () |
| uint8_t * | desired_intensity () |
Private Attributes | |
| const Gpio *const * | pins_ |
| array of all GPIO pins to use | |
| unsigned | nextBit_ |
| LED that comes next. | |
| unsigned | bits_ |
| Desired output state of LEDs. | |
| uint8_t | desiredIntensity_ [helper::num_bits()] |
| Partial lighting of each output. | |
| uninitialized< Fixed16 > | actualIntensity_ [helper::num_bits()] |
| How much we actually lit a given pin. | |
Static Private Attributes | |
| static constexpr Fixed16 | EWMA_RATIO {0, 0xF000} |
| static constexpr Fixed16 | EWMA_SUM {16, 0} |
Variant of the Charlieplex class that allows intensity to be set for each individual pin.
Definition at line 192 of file Charlieplex.hxx.
|
inline |
Constructor.
| pins | an array of Gpio object pointers defining the output pins to use. This array may be in flash (.rodata). |
Definition at line 200 of file Charlieplex.hxx.
|
inline |
Definition at line 262 of file Charlieplex.hxx.
|
inline |
Definition at line 255 of file Charlieplex.hxx.
|
inline |
Switches to the next output configuration of the charlieplexing pins.
Call this repeatedly, for example from a hardware timer interrupt.
Definition at line 218 of file Charlieplex.hxx.
|
private |
How much we actually lit a given pin.
Definition at line 275 of file Charlieplex.hxx.
|
private |
Desired output state of LEDs.
Definition at line 273 of file Charlieplex.hxx.
|
private |
Partial lighting of each output.
Definition at line 274 of file Charlieplex.hxx.
|
staticconstexprprivate |
Definition at line 268 of file Charlieplex.hxx.
|
staticconstexprprivate |
Definition at line 269 of file Charlieplex.hxx.
|
private |
LED that comes next.
Definition at line 272 of file Charlieplex.hxx.
|
private |
array of all GPIO pins to use
Definition at line 271 of file Charlieplex.hxx.