muwerk mupplet Display Library
muwerk applets; mupplets: functional units that support specific hardware or reusable applications
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ustd::Ht162xDigits Class Reference

The HT162X Digits Display Class. More...

#include <ht162x_digits.h>

Inherits Print.

Public Member Functions

 Ht162xDigits (LcdType lcdType, uint8_t csPin, uint8_t wrPin, uint8_t dataPin, uint8_t lcdBacklightPin=-1, uint8_t pwmIndexEsp32=-1)
 
void begin ()
 
void setPowerSave (bool powersave)
 
void setIntensity (uint8_t intensity)
 
void setTestMode (bool testmode)
 
void setCursor (int16_t x, int16_t y)
 
void setCursorX (int16_t x)
 
void setCursorY (int16_t y)
 
void setTextWrap (bool w)
 
void fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint8_t pattern=B00000000)
 
bool printFormatted (int16_t x, int16_t y, int16_t w, int16_t align, String content)
 
void write ()
 
virtual void fillScreen (uint8_t pattern)
 
int16_t width () const
 
int16_t height () const
 
bool getTextWrap () const
 
int16_t getCursorX () const
 
int16_t getCursorY () const
 
uint8_t getCharLen (unsigned char c, bool firstChar=false)
 

Detailed Description

The HT162X Digits Display Class.

This class derived from Print class provides an implementation of a 7/16 segment digits display.

Constructor & Destructor Documentation

◆ Ht162xDigits()

ustd::Ht162xDigits::Ht162xDigits ( LcdType  lcdType,
uint8_t  csPin,
uint8_t  wrPin,
uint8_t  dataPin,
uint8_t  lcdBacklightPin = -1,
uint8_t  pwmIndexEsp32 = -1 
)
inline

Instantiates a DisplayDigitsHT162x mupplet

No hardware interaction is performed, until begin() is called.

Parameters
nameName of the lcd display, used to reference it by pub/sub messages
lcdTypeLcdType

Member Function Documentation

◆ begin()

void ustd::Ht162xDigits::begin ( )
inline

Start the digits display

◆ fillRect()

void ustd::Ht162xDigits::fillRect ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
uint8_t  pattern = B00000000 
)
inline

Fill a rectangle completely with one pattern.

Parameters
xTop left corner x coordinate
yTop left corner y coordinate
wWidth in digit positions
hHeight in digit positions
patternPattern to fill the area with

◆ fillScreen()

virtual void ustd::Ht162xDigits::fillScreen ( uint8_t  pattern)
inlinevirtual

Empty the frame buffer

Parameters
patternBinary (on or off) pattern to fill with

◆ getCharLen()

uint8_t ustd::Ht162xDigits::getCharLen ( unsigned char  c,
bool  firstChar = false 
)
inline

Calculates the length in digits of a char

Parameters
cThe ASCII character in question
firstCharSet to true, if this is the first chat of a sequence (default: false)

◆ getCursorX()

int16_t ustd::Ht162xDigits::getCursorX ( ) const
inline

Get text cursor X location

Returns
X coordinate in digit positions

◆ getCursorY()

int16_t ustd::Ht162xDigits::getCursorY ( ) const
inline

Get text cursor Y location

Returns
Y coordinate in digit positions

◆ getTextWrap()

bool ustd::Ht162xDigits::getTextWrap ( ) const
inline

Returns if too long text will be wrapped to the next line

Returns
Wrapping mode

◆ height()

int16_t ustd::Ht162xDigits::height ( ) const
inline

Get height of the display

Returns
Height in number of rows

◆ printFormatted()

bool ustd::Ht162xDigits::printFormatted ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  align,
String  content 
)
inline

Prints a text at a specified location with a specified formatting

This method prints a text at the specified location with the specified length using left, right or centered alignment. All parameters are checked for plasibility and will be adapted to the current display size.

Parameters
xTop left corner x coordinate
yTop left corner y coordinate
wWidth in digit positions
alignAlignment of the string to display: 0 = left, 1 = center, 2 = right
contentThe string to print
Returns
true if the string fits the defined space, false if output was truncated

◆ setCursor()

void ustd::Ht162xDigits::setCursor ( int16_t  x,
int16_t  y 
)
inline

Set text cursor location

Parameters
xX coordinate in digit positions
yY coordinate in digit positions

◆ setCursorX()

void ustd::Ht162xDigits::setCursorX ( int16_t  x)
inline

Set text cursor X location

Parameters
xX coordinate in digit positions

◆ setCursorY()

void ustd::Ht162xDigits::setCursorY ( int16_t  y)
inline

Set text cursor Y location

Parameters
yY coordinate in digit positions

◆ setIntensity()

void ustd::Ht162xDigits::setIntensity ( uint8_t  intensity)
inline

Set the brightness of the display

Parameters
intensityThe brightness of the display. (0..15)

◆ setPowerSave()

void ustd::Ht162xDigits::setPowerSave ( bool  powersave)
inline

Set the power saving mode for the display

Parameters
powersaveIf true the display goes into power-down mode. Set to false for normal operation.

◆ setTestMode()

void ustd::Ht162xDigits::setTestMode ( bool  testmode)
inline

Set the test mode for the display

Parameters
testmodeIf true the display goes into test mode. Set to false for normal operation.

◆ setTextWrap()

void ustd::Ht162xDigits::setTextWrap ( bool  w)
inline

Set whether text that is too long for the screen width should automatically wrap around to the next line (else clip right).

Parameters
wtrue for wrapping, false for clipping

◆ width()

int16_t ustd::Ht162xDigits::width ( ) const
inline

Get width of the display

Returns
Width in number of digits

◆ write()

void ustd::Ht162xDigits::write ( )
inline

Flushes the frame buffer to the display

In order to implement flicker free double buffering, no display function has any immediate effect on the display. All display operations are buffered into a frame buffer. By calling this method, the current content of the frame buffer is displayed.


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