Skip to content

Commit

Permalink
Updated for 1.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzjuniel committed Jan 25, 2024
1 parent 109610a commit 70d438a
Show file tree
Hide file tree
Showing 11 changed files with 1,148 additions and 251 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
_archived/
*.zip
exclude/
compare/
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ The GFX4dESP32 library is provided by 4D Systems for use with gen4-ESP32-XX prod

Note however that some functionalities might not be supported by a certain product types, depending on its specifications. For instance, non-touch variants have no access to all touch-related functions. For more information on the specifications of a product, refer to its datasheet.

To install the library, please refer to the instructions in **Workshop4 ESP32 Development Manual**
To install the library, please refer to the instructions in [Workshop4 ESP32 Development Manual](https://resources.4dsystems.com.au/manuals/workshop4/esp32/#install-via-library-manager)

It is recommended to use Workshop4 IDE to get the most of out the library functions.

**Note**: Workshop4 is a **Windows-only** application.
### Notes

1. Workshop4 is a **Windows-only** application.
2. This is tested against Arduino ESP32 Core version 2.0.13. It might also work with 2.0.14 or higher but if any issues occur, it is recommend to try to set the boards package version to 2.0.13. If the issue persists, please don't hesitate to [write an issue](https://github.com/4dsystems/GFX4dESP32/issues/new) or contact us directly.
75 changes: 71 additions & 4 deletions extras/gfx4dESP32.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ void gfx.PutPixel(x, y, colour), void; // Write 1 pixel at co-ordinates x, y and
// Notes : Write 1 pixel at co-ordinates x, y and colour.
//

void gfx.PutPixelAlpha(x, y, colour, alpha), void; // Draws a pixel to the current frame buffer with color parameter switch
// Syntax : gfx.PutPixelAlpha(x, y, colour);
// Usage : gfx.PutPixelAlpha(10, 10, GCI_IMAGE + 3, 255);
// : gfx.PutPixelAlpha(10, 10, FRAMEBUFFER_IMAGE + 3, 127);
// : gfx.PutPixelAlpha(10, 10, RED, 127);
// Notes : Draws a pixel to the current frame buffer with color parameter switch.
// : 'colour' can be a 16bit color or a GCI image or a FrameBuffer
// : ex. gfx.PutPixelAlpha(10, 10, GCI_IMAGE + 3, 255) draws a pixel at 10, 10
// : from GCI image index 3 and full alpha level. x and y are relative to objects x and y.
// : ex. gfx.PutPixelAlpha(10, 10, FRAMEBUFFER_IMAGE + 3, 127) draws a pixel at 10, 100
// : from GCI image index 3 with half alpha at the same x and y position.
// : ex. gfx.PutPixelAlpha(10, 10, RED, 127) draws a RED pixel at 10, 10
// : with half alpha at the same x and y position.
//


int16_t gfx.getHeight(), word; // Returns the height of the display in pixels.
// Syntax : gfx.getHeight();
// Usage : gfx.getHeight();
Expand Down Expand Up @@ -255,7 +271,16 @@ void gfx.Cls([colour]), void; // Clears the screen with the specified colour or
void gfx.begin(), void; // Initialize the screen
// Syntax : gfx.begin();
// Usage : gfx.begin();
// Notes : Initialize the screen
// Notes : Initialize global variables, orientation and clears the screen
// : uSD is mounted at this stage and called separately.
// : begin(); // start with default settings
// : begin(IPS_DISPLAY); // use ips display
// : begin(18); // set display clock to 18Mhz
// : begin(false); // start without backlight on
// : begin(IPS_DISPLAY, 18); // start with ips at 18Mhz
// : begin(IPS_DISPLAY, true); // start with ips and backlight on
// : begin(20, false); // start at 20Mhz and backlight off
// : begin(IPS_DISPLAY, 40, false); // start with ips at 40Mhz and backlight off
//

void gfx.ScrollEnable(mode), void; // Enable or disable auto scrolling
Expand Down Expand Up @@ -321,6 +346,18 @@ void gfx.Arc(x, y, r, quadrants, colour), void; // Draw a 90-degree Arc with cen
// : Support function for outline rounded rectangles and circles
//

void gfx.RectangleFilledX(x1, y1, x2, y2, colour), void; // Draws a rectangle to the current frame buffer with color parameter switch
// Syntax : gfx.RectangleFilledX(x1, y1, x2, y2, colour);
// Usage : gfx.RectangleFilledX(10, 10, 100, 100, GCI_IMAGE + 3);
// : gfx.RectangleFilledX(10, 10, 100, 100, FRAMEBUFFER_IMAGE + 3);
// Notes : Draws a filled rectangle having a diagonal with endpoints at (x1, y1) and (x2, y2) with colour 'colour'.
// : 'colour' can be a 16bit color or a GCI image or a FrameBuffer
// : ex. gfx.RectangleFilledX(10, 10, 100, 100, GCI_IMAGE + 3) draws a rectangle at 10, 10
// : from GCI image index 3. x and y are relative to objects x and y.
// : ex. gfx.RectangleFilledX(10, 10, 100, 100, FRAMEBUFFER_IMAGE + 3) draws a rectangle at 10, 10
// : from framebuffer 3 at the same x and y position.
//

void gfx.RectangleFilled(x1, y1, x2, y2, colour), void; // Draws a filled rectangle having a diagonal with endpoints at (x1, y1) and (x2, y2) with colour 'colour'.
// Syntax : gfx.RectangleFilled(x1, y1, x2, y2, colour);
// Usage : gfx.RectangleFilled(10, 20, 110, 170, RED);
Expand Down Expand Up @@ -624,12 +661,36 @@ void gfx.HlineD(y, x1, x2, colour), void; // Draw fast horizontal line from (x1,
// Notes : Draw fast horizontal line from (x1, y) to (x2, y) - 4DGL compatible function
//

void gfx.HlineX(x, y, w, colour), void; // Draws a horizontal line to the current frame buffer with color parameter switch.
// Syntax : gfx.HlineX(x, y, h, colour);
// Usage : gfx.HlineX(10, 10, 100, GCI_IMAGE + 3);
// : gfx.HlineX(10, 10, 100, FRAMEBUFFER_IMAGE + 3);
// Notes : Draws a horizontal line to the current frame buffer with color parameter switch.
// : 'colour' can be a 16bit color or a GCI image or a FrameBuffer
// : ex. gfx.HlineX(10, 10, 100, GCI_IMAGE + 3) draws a horizontal line at 10, 10 and a length of 100 pixels
// : from GCI image index 3. x and y are relative to objects x and y.
// : ex. gfx.HlineX(10, 10, 100, FRAMEBUFFER_IMAGE + 3) draws a horizontal line at 10, 10 and a length of 100 pixels
// : from GCI image index 3 at the same x and y position.
//

void gfx.VlineD(x, y1, y2, colour), void; // Draw fast vertical line from (x1, y) to (x2, y)
// Syntax : gfx.VlineD(x, y1, y2, colour);
// Usage : gfx.VlineD(x, y1, y2, colour);
// Notes : Draw fast vertical line from (x, y1) to (x, y1) - 4DGL compatible function
//

void gfx.VlineX(x, y, w, colour), void; // Draws a vertical line to the current frame buffer with color parameter switch.
// Syntax : gfx.VlineX(x, y, w, colour);
// Usage : gfx.VlineX(10, 10, 100, GCI_IMAGE + 3);
// : gfx.VlineX(10, 10, 100, FRAMEBUFFER_IMAGE + 3);
// Notes : Draws a vertical line to the current frame buffer with color parameter switch.
// : 'colour' can be a 16bit color or a GCI image or a FrameBuffer
// : ex. gfx.VlineX(10, 10, 100, GCI_IMAGE + 3) draws a vertical line at 10, 10 and a length of 100 pixels
// : from GCI image index 3. x and y are relative to objects x and y.
// : ex. gfx.VlineX(10, 10, 100, FRAMEBUFFER_IMAGE + 3) draws a vertical line at 10, 10 and a length of 100 pixels
// : from GCI image index 3 at the same x and y position.
//

void gfx.gradientShape(vert, ow, xPos, yPos, w, h, r1, r2, r3, r4, darken, colour, sr1, gl1, colorD, sr3, gl3, gtb), void; // Draw a shaped color gradient using the supplied parameters
// Syntax : gfx.gradientShape(vert, ow, xPos, yPos, w, h, r1, r2, r3, r4, darken, colour, sr1, gl1, colorD, sr3, gl3, gtb);
// Usage : gfx.gradientShape(vert, ow, xPos, yPos, w, h, r1, r2, r3, r4, darken, colour, sr1, gl1, colorD, sr3, gl3, gtb);
Expand Down Expand Up @@ -847,6 +908,12 @@ void gfx.DrawToframebuffer(fbnum), void; // Set the frame buffer for drawing fun
// : If frame buffer 0 is set (default) all drawing functions will appear immediately on the display.
//

void gfx.GetFrameBuffer(), uint8_t; // Get the number of the current frame buffer in use.
// Syntax : gfx.GetFrameBuffer();
// Usage : gfx.GetFrameBuffer();
// Notes : Returns current frame buffer number.
//

void gfx.SpriteAreaSet(x, y, x1, y1), void; // Sets the area of the screen that sprites will be displayed in.
// Syntax : gfx.SpriteAreaSet(x, y, x1, y1);
// Usage : gfx.SpriteAreaSet(x, y, x1, y1);
Expand Down Expand Up @@ -1021,7 +1088,7 @@ int gfx.imageGetWord(img, controlIndex), 1; // Queries the current selected para
// Syntax : gfx.imageGetWord(img, controlIndex);
// Usage : gfx.imageGetWord(img, controlIndex);
// Notes : Queries the current selected parameter of the GCI widget
// : Parameters can be IMAGE_XPOS, IMAGE_YPOS, IMAGE_WIDTH or IMAGE_HEIGHT
// : Parameters can be IMAGE_XPOS, IMAGE_YPOS, IMAGE_WIDTH, IMAGE_HEIGHT or IMAGE_INDEX
//

void gfx.imageSetWord(img, controlIndex, val1 [, val2]), void; // Sets the selected parameter(s) of the GCI widget
Expand All @@ -1030,8 +1097,8 @@ void gfx.imageSetWord(img, controlIndex, val1 [, val2]), void; // Sets the selec
// Usage : gfx.imageSetWord(img, IMAGE_XYPOS, val1, val2);
// : gfx.imageSetWord(img, controlIndex, val1);
// Notes : Sets the selected parameter(s) of the GCI widget
// : Parameters can be IMAGE_XPOS, IMAGE_YPOS, or IMAGE_XYPOS
// : WHen using IMAGE_XYPOS, two values are required
// : Parameters can be IMAGE_XPOS, IMAGE_YPOS, IMAGE_XYPOS or IMAGE_INDEX
// : When using IMAGE_XYPOS, two values are required
//

int16_t gfx.getImageValue(ui), 1; // Returns the current value of a GCI widget
Expand Down
35 changes: 34 additions & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,14 @@ Clipping KEYWORD2
ClipWindow KEYWORD2
Cls KEYWORD2
Contrast KEYWORD2
CopyFrameBufferLine KEYWORD2
CopyImageLine KEYWORD2
DecodeKeypad KEYWORD2
DeleteButton KEYWORD2
DeleteButtonBG KEYWORD2
DigitalRead KEYWORD2
DigitalWrite KEYWORD2
DisplayControl KEYWORD2
Download KEYWORD2
DownloadFile KEYWORD2
drawBitmap KEYWORD2
Expand All @@ -85,6 +88,7 @@ FontHeight KEYWORD2
FontStyle KEYWORD2
GetCommand KEYWORD2
getFontData KEYWORD2
GetFrameBuffer KEYWORD2
getHeight KEYWORD2
getImageValue KEYWORD2
getNumberofObjects KEYWORD2
Expand All @@ -102,6 +106,7 @@ getY KEYWORD2
gradientShape KEYWORD2
GradTriangleFilled KEYWORD2
Hline KEYWORD2
HlineX KEYWORD2
Grad KEYWORD2
touch_GetInvertMode KEYWORD2
imageAutoKnob KEYWORD2
Expand Down Expand Up @@ -135,13 +140,17 @@ putch KEYWORD2
putchXY KEYWORD2
PutColor KEYWORD2
PutPixel KEYWORD2
PutPixelAlpha KEYWORD2
putstr KEYWORD2
putstrXY KEYWORD2
ReadCommand KEYWORD2
ReadImagePixel KEYWORD2
ReadLine KEYWORD2
ReadPixel KEYWORD2
ReadPixelFromFrameBuffer KEYWORD2
Rectangle KEYWORD2
RectangleFilled KEYWORD2
RectangleFilledX KEYWORD2
ResetKeypad KEYWORD2
RGBto565 KEYWORD2
RoundRect KEYWORD2
Expand Down Expand Up @@ -221,6 +230,7 @@ UserImageHideBG KEYWORD2
UserImages KEYWORD2
UserImagesDR KEYWORD2
Vline KEYWORD2
VlineX KEYWORD2
WrGRAMs KEYWORD2
write KEYWORD2
WriteLine KEYWORD2
Expand Down Expand Up @@ -477,4 +487,27 @@ DISPLAY_TOUCH_TYPE LITERAL1
DISP_TOUCH_NONE LITERAL1
DISP_TOUCH_CTP LITERAL1
DISP_TOUCH_RTP LITERAL1
NO_TRANSPARENCY LITERAL1
NO_TRANSPARENCY LITERAL1
GEN4_I2C_SDA LITERAL1
GEN4_I2C_SCL LITERAL1
GEN4_SPI_DISPLAY LITERAL1
GEN4_RGB_DISPLAY LITERAL1
DISP_CTRL_RE_INIT LITERAL1
DISP_CTRL_RESET LITERAL1
DISP_CTRL_NEW LITERAL1
DISP_CTRL_INIT LITERAL1
DISP_CTRL_STOP LITERAL1
DISP_CTRL_START_TX LITERAL1
DISP_CTRL_DEL LITERAL1
DISP_CTRL_START LITERAL1
DISP_CTRL_FLUSH LITERAL1
DISP_CTRL_RESTART_TX LITERAL1
DISP_CTRL_RESET_ON_VSYNC LITERAL1
DISP_CTRL_SET_CLOCK LITERAL1
DISP_CTRL_FILL_BOUNCE_BUFFER LITERAL1
GCI_IMAGE LITERAL1
FRAMEBUFFER_IMAGE LITERAL1
BEGIN_WITH_BACKLIGHT_ON LITERAL1
BEGIN_WITH_BACKLIGHT_OFF LITERAL1


2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=GFX4dESP32
version=1.0.0
version=1.0.1
author=4D Systems Pty Ltd
maintainer=4D Systems Pty Ltd <[email protected]>
sentence=Graphics Library for the gen4-ESP32 displays by 4D Systems
Expand Down
Loading

0 comments on commit 70d438a

Please sign in to comment.