Skip to content

Commit

Permalink
Added Support
Browse files Browse the repository at this point in the history
Added support for 16bit, 32bit, 64bit signed and unsigned LED Digits, instead of just 64bit signed
  • Loading branch information
4D Systems committed Sep 13, 2021
1 parent 6a2cf07 commit 6308dbd
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 10 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=GFX4d
version=1.0.5
version=1.0.6
author=4D Systems Pty Ltd
maintainer=4D Systems Pty Ltd <[email protected]>
sentence=Graphics Library for the gen4-IoD by 4D Systems
Expand Down
53 changes: 47 additions & 6 deletions src/GFX4d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* 4D Systems GFX4d Library *
* *
* Date: 16th August 2021 *
* Date: 12th September 2021 *
* *
* Description: Provides Graphics, Touch Control and SD Card functions *
* for 4D Systems Gen4 IoD range of intelligent displays. *
Expand Down Expand Up @@ -1074,13 +1074,34 @@ void GFX4d::UserImage(uint16_t ui, int altx, int alty)
}

void GFX4d::LedDigitsDisplaySigned(int16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks)
{
LedDigitsDisplaySigned((int64_t)newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, 0x7fff , 0x7fff);
}

void GFX4d::LedDigitsDisplaySigned(int32_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks)
{
LedDigitsDisplaySigned((int64_t)newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, 0x7fff , 0x7fff);
}

void GFX4d::LedDigitsDisplaySigned(int64_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks)
{
LedDigitsDisplaySigned(newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, 0x7fff , 0x7fff);
}

void GFX4d::LedDigitsDisplaySigned(int16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty)
{
int16_t i, m, lstb, nv, digita[7];
LedDigitsDisplaySigned((int64_t) newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, altx, alty);
}

void GFX4d::LedDigitsDisplaySigned(int32_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty)
{
LedDigitsDisplaySigned((int64_t) newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, altx, alty);
}

void GFX4d::LedDigitsDisplaySigned(int64_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty)
{
int16_t i, lstb, digita[21];
int64_t m, nv;
int leftpos = 0;
nv = newval ;
lstb = 1 ;
Expand Down Expand Up @@ -1116,15 +1137,35 @@ void GFX4d::LedDigitsDisplaySigned(int16_t newval, uint16_t index, int16_t Digit
}
}

void GFX4d::LedDigitsDisplay(int16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks)
void GFX4d::LedDigitsDisplay(uint16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks)
{
LedDigitsDisplay((uint64_t)newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, 0x7fff , 0x7fff);
}

void GFX4d::LedDigitsDisplay(uint32_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks)
{
LedDigitsDisplay((uint64_t)newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, 0x7fff , 0x7fff);
}

void GFX4d::LedDigitsDisplay(uint64_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks)
{
LedDigitsDisplay(newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, 0x7fff , 0x7fff);
}

void GFX4d::LedDigitsDisplay(int16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty)
void GFX4d::LedDigitsDisplay(uint16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty)
{
LedDigitsDisplay((uint64_t) newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, altx, alty);
}

void GFX4d::LedDigitsDisplay(uint32_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty)
{
LedDigitsDisplay((uint64_t) newval, index, Digits, MinDigits, WidthDigit, LeadingBlanks, altx, alty);
}

void GFX4d::LedDigitsDisplay(uint64_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty)
{
int16_t i, k, lb;
int32_t l;
int16_t i, lb;
uint64_t l, k;
l = 1;
for (i = 1; i < Digits; i++)
l *= 10;
Expand Down
14 changes: 11 additions & 3 deletions src/GFX4d.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
4D Systems GFX4d Library
* *
Date: 16th August 2021
Date: 12th September 2021
* *
Description: Provides Graphics, Touch Control and SD Card functions
for 4D Systems Gen4 IoD range of intelligent displays.
Expand Down Expand Up @@ -921,10 +921,18 @@ class GFX4d : public Print
UserImages(uint16_t uis, int16_t frame, int offset, int16_t altx, int16_t alty),
UserImages(uint16_t uisnb, int16_t framenb, int16_t newx, int16_t newy),
UserImagesDR(uint16_t uino, int frames, int16_t uxpos, int16_t uypos, int16_t uwidth, int16_t uheight),
LedDigitsDisplay(int16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks),
LedDigitsDisplay(int16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty),
LedDigitsDisplay(uint16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks),
LedDigitsDisplay(uint32_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks),
LedDigitsDisplay(uint64_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks),
LedDigitsDisplay(uint16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty),
LedDigitsDisplay(uint32_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty),
LedDigitsDisplay(uint64_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty),
LedDigitsDisplaySigned(int16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks),
LedDigitsDisplaySigned(int32_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks),
LedDigitsDisplaySigned(int64_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks),
LedDigitsDisplaySigned(int16_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty),
LedDigitsDisplaySigned(int32_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty),
LedDigitsDisplaySigned(int64_t newval, uint16_t index, int16_t Digits, int16_t MinDigits, int16_t WidthDigit, int16_t LeadingBlanks, int16_t altx, int16_t alty),
DrawWidget(uint32_t Index, int16_t uix, int16_t uiy, int16_t uiw, int16_t uih, uint16_t frame, int16_t bar, bool images, uint8_t cdv),
DrawImage(uint32_t Index, int16_t uix, int16_t uiy),
UserCharacter(uint32_t *data, uint8_t ucsize, int16_t ucx, int16_t ucy, uint16_t color, uint16_t bgcolor),
Expand Down

0 comments on commit 6308dbd

Please sign in to comment.