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

Helper structure for the charlieplexing implementation. More...

#include <Charlieplex.hxx>

Static Public Member Functions

static 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 44 of file Charlieplex.hxx.

Member Function Documentation

◆ num_bits()

static unsigned CharlieplexHelper< 3 >::num_bits ( )
inlinestatic
Returns
How many LEDs are we driving.

Definition at line 49 of file Charlieplex.hxx.

◆ pin_high()

static unsigned CharlieplexHelper< 3 >::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 56 of file Charlieplex.hxx.

◆ pin_low()

static unsigned CharlieplexHelper< 3 >::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 62 of file Charlieplex.hxx.

Member Data Documentation

◆ pinlist

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

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

Definition at line 68 of file Charlieplex.hxx.


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