AGirs
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
LedLcdManager Class Reference

#include <LedLcdManager.h>

Public Types

enum  LedState { on , off , blink , invalid }
 

Public Member Functions

void setupPhysicalLeds (pin_t led1=invalidPin, pin_t led2=invalidPin, pin_t led3=invalidPin, pin_t led4=invalidPin, pin_t led5=invalidPin, pin_t led6=invalidPin, pin_t led7=invalidPin, pin_t led8=invalidPin)
 

Static Public Member Functions

static void setup (int8_t i2cAddress, uint8_t columns=defaultLcdColumns, uint8_t rows=defaultLcdRows, const pin_t physicalLeds[maxLeds]=NULL, const led_t logicalLeds[maxLeds]=NULL, const bool shouldTimeOut[maxLeds]=NULL)
 Sets up the instance, to be called before using the instance. More...
 
static void setup (int8_t i2cAddress, uint8_t columns, uint8_t rows, pin_t pled1, pin_t pled2=invalidLed, pin_t pled3=invalidPin, pin_t pled4=invalidPin, pin_t pled5=invalidPin, pin_t pled6=invalidPin, pin_t pled7=invalidPin, pin_t pled8=invalidPin)
 
static void lcdPrint (const char *str, bool clear=true, int x=invalidLine, int y=invalidLine)
 
static void lcdPrint (String &string, bool clear=true, int x=invalidLine, int y=invalidLine)
 
static void lcdPrint (const __FlashStringHelper *pstr, bool clear=true, int x=0, int y=invalidLine)
 
static void lcdSetCursor (uint8_t x=0, uint8_t y=0)
 
static void allOff (bool force)
 
static milliseconds_t getBlinkTime ()
 
static void setBlinkTime (milliseconds_t value)
 
static void updateTurnOffTime ()
 
static void checkTurnoff ()
 Turn off if it is due. More...
 
static void selfTest (const char *text)
 
static void selfTest (const __FlashStringHelper *text)
 
static bool setPhysicalLed (led_t physicalLed, LedState state)
 
static bool setLogicLed (led_t logicLed, LedState state)
 
static bool setLogicLed (led_t logicLed, const char *state)
 
static LedState onOffBlinkParse (const char *value)
 
static void setupShouldTimeout (led_t logicLed, bool state)
 
static bool setupLogicLed (led_t loginLed, led_t physicalLed)
 
static bool setupLogicLeds (const led_t array[maxLeds])
 
static void setupLedGroundPins ()
 

Static Public Attributes

static constexpr int maxLeds = 8
 
static constexpr int defaultLcdRows = 2
 
static constexpr int defaultLcdColumns = 16
 
static constexpr int invalidLine = -1
 
static constexpr int defaultBlinkTime = 2000
 
static constexpr int selftestTimeWithoutLCD = 200
 
static constexpr int selftestTimeWithLCD = 2000
 
static constexpr led_t invalidLed = 255U
 

Detailed Description

Definition at line 11 of file LedLcdManager.h.

Member Enumeration Documentation

◆ LedState

Enumerator
on 
off 
blink 
invalid 

Definition at line 22 of file LedLcdManager.h.

Member Function Documentation

◆ allOff()

void LedLcdManager::allOff ( bool  force)
static

Definition at line 152 of file LedLcdManager.cpp.

◆ checkTurnoff()

void LedLcdManager::checkTurnoff ( )
static

Turn off if it is due.

This has to be called periodically by the user.

Definition at line 147 of file LedLcdManager.cpp.

◆ getBlinkTime()

static milliseconds_t LedLcdManager::getBlinkTime ( )
inlinestatic

Definition at line 111 of file LedLcdManager.h.

◆ lcdPrint() [1/3]

static void LedLcdManager::lcdPrint ( const __FlashStringHelper *  pstr,
bool  clear = true,
int  x = 0,
int  y = invalidLine 
)
static

◆ lcdPrint() [2/3]

static void LedLcdManager::lcdPrint ( const char *  str,
bool  clear = true,
int  x = invalidLine,
int  y = invalidLine 
)
static

◆ lcdPrint() [3/3]

static void LedLcdManager::lcdPrint ( String &  string,
bool  clear = true,
int  x = invalidLine,
int  y = invalidLine 
)
inlinestatic

Definition at line 94 of file LedLcdManager.h.

◆ lcdSetCursor()

static void LedLcdManager::lcdSetCursor ( uint8_t  x = 0,
uint8_t  y = 0 
)
inlinestatic

Definition at line 100 of file LedLcdManager.h.

◆ onOffBlinkParse()

LedLcdManager::LedState LedLcdManager::onOffBlinkParse ( const char *  value)
static

Definition at line 52 of file LedLcdManager.cpp.

◆ selfTest() [1/2]

void LedLcdManager::selfTest ( const __FlashStringHelper *  text)
static

Definition at line 135 of file LedLcdManager.cpp.

◆ selfTest() [2/2]

void LedLcdManager::selfTest ( const char *  text)
static

Definition at line 123 of file LedLcdManager.cpp.

◆ setBlinkTime()

static void LedLcdManager::setBlinkTime ( milliseconds_t  value)
inlinestatic

Definition at line 115 of file LedLcdManager.h.

◆ setLogicLed() [1/2]

static bool LedLcdManager::setLogicLed ( led_t  logicLed,
const char *  state 
)
inlinestatic

Definition at line 132 of file LedLcdManager.h.

◆ setLogicLed() [2/2]

bool LedLcdManager::setLogicLed ( led_t  logicLed,
LedState  state 
)
static

Definition at line 60 of file LedLcdManager.cpp.

◆ setPhysicalLed()

bool LedLcdManager::setPhysicalLed ( led_t  physicalLed,
LedState  state 
)
static

Definition at line 41 of file LedLcdManager.cpp.

◆ setup() [1/2]

static void LedLcdManager::setup ( int8_t  i2cAddress,
uint8_t  columns,
uint8_t  rows,
pin_t  pled1,
pin_t  pled2 = invalidLed,
pin_t  pled3 = invalidPin,
pin_t  pled4 = invalidPin,
pin_t  pled5 = invalidPin,
pin_t  pled6 = invalidPin,
pin_t  pled7 = invalidPin,
pin_t  pled8 = invalidPin 
)
static

◆ setup() [2/2]

static void LedLcdManager::setup ( int8_t  i2cAddress,
uint8_t  columns = defaultLcdColumns,
uint8_t  rows = defaultLcdRows,
const pin_t  physicalLeds[maxLeds] = NULL,
const led_t  logicalLeds[maxLeds] = NULL,
const bool  shouldTimeOut[maxLeds] = NULL 
)
static

Sets up the instance, to be called before using the instance.


◆ setupLedGroundPins()

static void LedLcdManager::setupLedGroundPins ( )
inlinestatic

Definition at line 144 of file LedLcdManager.h.

◆ setupLogicLed()

bool LedLcdManager::setupLogicLed ( led_t  loginLed,
led_t  physicalLed 
)
static

Definition at line 74 of file LedLcdManager.cpp.

◆ setupLogicLeds()

bool LedLcdManager::setupLogicLeds ( const led_t  array[maxLeds])
static

Definition at line 82 of file LedLcdManager.cpp.

◆ setupPhysicalLeds()

void LedLcdManager::setupPhysicalLeds ( pin_t  led1 = invalidPin,
pin_t  led2 = invalidPin,
pin_t  led3 = invalidPin,
pin_t  led4 = invalidPin,
pin_t  led5 = invalidPin,
pin_t  led6 = invalidPin,
pin_t  led7 = invalidPin,
pin_t  led8 = invalidPin 
)

◆ setupShouldTimeout()

void LedLcdManager::setupShouldTimeout ( led_t  logicLed,
bool  state 
)
static

Definition at line 101 of file LedLcdManager.cpp.

◆ updateTurnOffTime()

void LedLcdManager::updateTurnOffTime ( )
static

Definition at line 119 of file LedLcdManager.cpp.

Member Data Documentation

◆ defaultBlinkTime

constexpr int LedLcdManager::defaultBlinkTime = 2000
staticconstexpr

Definition at line 18 of file LedLcdManager.h.

◆ defaultLcdColumns

constexpr int LedLcdManager::defaultLcdColumns = 16
staticconstexpr

Definition at line 15 of file LedLcdManager.h.

◆ defaultLcdRows

constexpr int LedLcdManager::defaultLcdRows = 2
staticconstexpr

Definition at line 14 of file LedLcdManager.h.

◆ invalidLed

constexpr led_t LedLcdManager::invalidLed = 255U
staticconstexpr

Definition at line 29 of file LedLcdManager.h.

◆ invalidLine

constexpr int LedLcdManager::invalidLine = -1
staticconstexpr

Definition at line 16 of file LedLcdManager.h.

◆ maxLeds

constexpr int LedLcdManager::maxLeds = 8
staticconstexpr

Definition at line 13 of file LedLcdManager.h.

◆ selftestTimeWithLCD

constexpr int LedLcdManager::selftestTimeWithLCD = 2000
staticconstexpr

Definition at line 20 of file LedLcdManager.h.

◆ selftestTimeWithoutLCD

constexpr int LedLcdManager::selftestTimeWithoutLCD = 200
staticconstexpr

Definition at line 19 of file LedLcdManager.h.


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