Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
CharlieplexHelper< 4 > Struct Reference

Helper structure for the charlieplexing implementation. More...

#include <Charlieplex.hxx>

Static Public Member Functions

static constexpr unsigned num_bits ()
 
static unsigned pin_high (unsigned bit)
 Which pin to drive high for a given LED.
 
static unsigned pin_low (unsigned bit)
 Which pin to drive low for a given LED.
 

Static Public Attributes

static const uint8_t pinlist []
 Flattened list of pars of output pin numbers to use for a given LED.
 

Detailed Description

Helper structure for the charlieplexing implementation.

Definition at line 78 of file Charlieplex.hxx.

Member Function Documentation

◆ num_bits()

static constexpr unsigned CharlieplexHelper< 4 >::num_bits ( )
inlinestaticconstexpr
Returns
How many LEDs are we driving.

Definition at line 83 of file Charlieplex.hxx.

◆ pin_high()

static unsigned CharlieplexHelper< 4 >::pin_high ( unsigned  bit)
inlinestatic

Which pin to drive high for a given LED.

Parameters
bitis the number of the LED, from 0..num_bits()-1.
Returns
index of the GPIO to drive high.

Definition at line 90 of file Charlieplex.hxx.

◆ pin_low()

static unsigned CharlieplexHelper< 4 >::pin_low ( unsigned  bit)
inlinestatic

Which pin to drive low for a given LED.

Parameters
bitis the number of the LED, from 0..num_bits()-1.
Returns
index of the GPIO to drive low.

Definition at line 96 of file Charlieplex.hxx.

Member Data Documentation

◆ pinlist

const uint8_t CharlieplexHelper< 4 >::pinlist
static
Initial value:
= {
3, 0,
2, 0,
1, 0,
3, 1,
3, 2,
2, 1,
2, 3,
1, 2,
0, 2,
0, 3,
0, 1,
1, 3,
}

Flattened list of pars of output pin numbers to use for a given LED.

Definition at line 102 of file Charlieplex.hxx.


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