uMuxOutputLib
https://github.com/Naguissa/uMuxOutputLib
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
uMuxOutputLib Class Reference

Really tiny library to control multiplexed outputs. More...

Collaboration diagram for uMuxOutputLib:
Collaboration graph
[legend]

Public Member Functions

 uMuxOutputLib (uint8_t, uint8_t, int *, int *, unsigned int=70)
 Constructor.
 
void setPinAbsolute (uint16_t, bool)
 Sets a pin in linear method.
 
void setPinMuxPin (uint8_t, uint8_t, bool)
 Sets a pin by its pin and mux number.
 
bool getPinAbsolute (uint16_t)
 Gets stored status in linear method.
 
bool getPinMuxPin (uint8_t, uint8_t)
 Gets stored status by its pin and mux number.
 
void attachInterrupt ()
 Attach Timer interrupt.
 

Static Public Member Functions

static void interrupt (void)
 Main public interrupt loop.
 

Public Attributes

bool activeMuxValue = false
 

Static Public Attributes

static uMuxOutputLib_instance = NULL
 

Detailed Description

Really tiny library to control multiplexed outputs.

It cycles among multiplexed outputs using a timer to control all pins.

Library depends on uTimerLib library, https://github.com/Naguissa/uTimerLib

Constructor & Destructor Documentation

◆ uMuxOutputLib()

uMuxOutputLib::uMuxOutputLib ( uint8_t  npins,
uint8_t  nmuxes,
int *  pins,
int *  muxes,
unsigned int  freq = 70 
)

Constructor.

Parameters
npinsNumber of pins
nmuxesNumber of muxes
pinsarray of pins for outputs
muxesarray of pins for muxes
freqOptional. Refresh frequency (for all pins, will be multiplied by nmuxes to calculate end result)

Member Function Documentation

◆ attachInterrupt()

void uMuxOutputLib::attachInterrupt ( )

Attach Timer interrupt.

Needed for usual operation, but you can call loop manually instead

◆ getPinAbsolute()

bool uMuxOutputLib::getPinAbsolute ( uint16_t  position)

Gets stored status in linear method.

Absolute position is calculated as: mux * npins + pin

Parameters
positionPosition of the bit on linear fashion
Returns
Current value of that pin

◆ getPinMuxPin()

bool uMuxOutputLib::getPinMuxPin ( uint8_t  pin,
uint8_t  mux 
)

Gets stored status by its pin and mux number.

Note that positions starts at 0.

Parameters
pinPin position on passed pins array (starting at 0)
muxMux position on passed muxes array (starting at 0)
Returns
Current value of that pin

◆ interrupt()

void uMuxOutputLib::interrupt ( void  )
static

Main public interrupt loop.

Calls private loop

◆ setPinAbsolute()

void uMuxOutputLib::setPinAbsolute ( uint16_t  position,
bool  value 
)

Sets a pin in linear method.

Absolute position is calculated as: mux * npins + pin

Parameters
positionPosition of the bit on linear fashion
valueValue to be set

◆ setPinMuxPin()

void uMuxOutputLib::setPinMuxPin ( uint8_t  pin,
uint8_t  mux,
bool  value 
)

Sets a pin by its pin and mux number.

Note that positions starts at 0.

Parameters
pinPin position on passed pins array (starting at 0)
muxMux position on passed muxes array (starting at 0)
valueValue to be set

The documentation for this class was generated from the following files: