aboutsummaryrefslogtreecommitdiffstats
path: root/include/gdisp
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2013-02-17 23:20:59 -0800
committerAndrew Hannam <andrewh@inmarket.com.au>2013-02-17 23:20:59 -0800
commita178b91c4f609479f02635594ad2032b357dd7d7 (patch)
tree441303789039af288ec1b333386d79c63905c273 /include/gdisp
parent1985906bea97a015d6e035ebb3f91b6e4f94aff1 (diff)
parentd41120ee2dc37f7feee7dde40abbb4dae430f7d3 (diff)
downloaduGFX-a178b91c4f609479f02635594ad2032b357dd7d7.tar.gz
uGFX-a178b91c4f609479f02635594ad2032b357dd7d7.tar.bz2
uGFX-a178b91c4f609479f02635594ad2032b357dd7d7.zip
Merge pull request #16 from Tectu/master
Merge Tectu Changes
Diffstat (limited to 'include/gdisp')
-rw-r--r--include/gdisp/gdisp.h38
-rw-r--r--include/gdisp/lld/emulation.c182
-rw-r--r--include/gdisp/lld/gdisp_lld.h53
-rw-r--r--include/gdisp/options.h7
4 files changed, 135 insertions, 145 deletions
diff --git a/include/gdisp/gdisp.h b/include/gdisp/gdisp.h
index da6d859f..b2e6df53 100644
--- a/include/gdisp/gdisp.h
+++ b/include/gdisp/gdisp.h
@@ -201,26 +201,26 @@ extern "C" {
#else
/* The same as above but use the low level driver directly if no multi-thread support is needed */
- #define gdispInit(gdisp) GDISP_LLD(init)()
+ #define gdispInit(gdisp) lld_gdisp_init()
#define gdispIsBusy() FALSE
- #define gdispClear(color) GDISP_LLD(clear)(color)
- #define gdispDrawPixel(x, y, color) GDISP_LLD(drawpixel)(x, y, color)
- #define gdispDrawLine(x0, y0, x1, y1, color) GDISP_LLD(drawline)(x0, y0, x1, y1, color)
- #define gdispFillArea(x, y, cx, cy, color) GDISP_LLD(fillarea)(x, y, cx, cy, color)
- #define gdispBlitAreaEx(x, y, cx, cy, sx, sy, scx, buf) GDISP_LLD(blitareaex)(x, y, cx, cy, sx, sy, scx, buf)
- #define gdispSetClip(x, y, cx, cy) GDISP_LLD(setclip)(x, y, cx, cy)
- #define gdispDrawCircle(x, y, radius, color) GDISP_LLD(drawcircle)(x, y, radius, color)
- #define gdispFillCircle(x, y, radius, color) GDISP_LLD(fillcircle)(x, y, radius, color)
- #define gdispDrawArc(x, y, radius, sangle, eangle, color) GDISP_LLD(drawarc)(x, y, radius, sangle, eangle, color)
- #define gdispFillArc(x, y, radius, sangle, eangle, color) GDISP_LLD(fillarc)(x, y, radius, sangle, eangle, color)
- #define gdispDrawEllipse(x, y, a, b, color) GDISP_LLD(drawellipse)(x, y, a, b, color)
- #define gdispFillEllipse(x, y, a, b, color) GDISP_LLD(fillellipse)(x, y, a, b, color)
- #define gdispDrawChar(x, y, c, font, color) GDISP_LLD(drawchar)(x, y, c, font, color)
- #define gdispFillChar(x, y, c, font, color, bgcolor) GDISP_LLD(fillchar)(x, y, c, font, color, bgcolor)
- #define gdispGetPixelColor(x, y) GDISP_LLD(getpixelcolor)(x, y)
- #define gdispVerticalScroll(x, y, cx, cy, lines, bgcolor) GDISP_LLD(verticalscroll)(x, y, cx, cy, lines, bgcolor)
- #define gdispControl(what, value) GDISP_LLD(control)(what, value)
- #define gdispQuery(what) GDISP_LLD(query)(what)
+ #define gdispClear(color) lld_gdisp_clear(color)
+ #define gdispDrawPixel(x, y, color) lld_gdisp_draw_pixel(x, y, color)
+ #define gdispDrawLine(x0, y0, x1, y1, color) lld_gdisp_draw_line(x0, y0, x1, y1, color)
+ #define gdispFillArea(x, y, cx, cy, color) lld_gdisp_fill_area(x, y, cx, cy, color)
+ #define gdispBlitAreaEx(x, y, cx, cy, sx, sy, scx, buf) lld_gdisp_blit_area_ex(x, y, cx, cy, sx, sy, scx, buf)
+ #define gdispSetClip(x, y, cx, cy) lld_gdisp_set_clip(x, y, cx, cy)
+ #define gdispDrawCircle(x, y, radius, color) lld_gdisp_draw_circle(x, y, radius, color)
+ #define gdispFillCircle(x, y, radius, color) lld_gdisp_fill_circle(x, y, radius, color)
+ #define gdispDrawArc(x, y, radius, sangle, eangle, color) lld_gdisp_draw_arc(x, y, radius, sangle, eangle, color)
+ #define gdispFillArc(x, y, radius, sangle, eangle, color) lld_gdisp_fill_arc(x, y, radius, sangle, eangle, color)
+ #define gdispDrawEllipse(x, y, a, b, color) lld_gdisp_draw_ellipse(x, y, a, b, color)
+ #define gdispFillEllipse(x, y, a, b, color) lld_gdisp_fill_ellipse(x, y, a, b, color)
+ #define gdispDrawChar(x, y, c, font, color) lld_gdisp_draw_char(x, y, c, font, color)
+ #define gdispFillChar(x, y, c, font, color, bgcolor) lld_gdisp_fill_char(x, y, c, font, color, bgcolor)
+ #define gdispGetPixelColor(x, y) lld_gdisp_get_pixel_color(x, y)
+ #define gdispVerticalScroll(x, y, cx, cy, lines, bgcolor) lld_gdisp_vertical_scroll(x, y, cx, cy, lines, bgcolor)
+ #define gdispControl(what, value) lld_gdisp_control(what, value)
+ #define gdispQuery(what) lld_gdisp_query(what)
#endif
diff --git a/include/gdisp/lld/emulation.c b/include/gdisp/lld/emulation.c
index a514458c..86301ed5 100644
--- a/include/gdisp/lld/emulation.c
+++ b/include/gdisp/lld/emulation.c
@@ -52,13 +52,13 @@
#endif
#if !GDISP_HARDWARE_CLEARS
- void GDISP_LLD(clear)(color_t color) {
- GDISP_LLD(fillarea)(0, 0, GDISP.Width, GDISP.Height, color);
+ void lld_gdisp_clear(color_t color) {
+ lld_gdisp_fill_area(0, 0, GDISP.Width, GDISP.Height, color);
}
#endif
#if !GDISP_HARDWARE_LINES
- void GDISP_LLD(drawline)(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) {
+ void lld_gdisp_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) {
int16_t dy, dx;
int16_t addx, addy;
int16_t P, diff, i;
@@ -67,16 +67,16 @@
// speed improvement if vertical or horizontal
if (x0 == x1) {
if (y1 > y0)
- GDISP_LLD(fillarea)(x0, y0, 1, y1-y0+1, color);
+ lld_gdisp_fill_area(x0, y0, 1, y1-y0+1, color);
else
- GDISP_LLD(fillarea)(x0, y1, 1, y0-y1+1, color);
+ lld_gdisp_fill_area(x0, y1, 1, y0-y1+1, color);
return;
}
if (y0 == y1) {
if (x1 > x0)
- GDISP_LLD(fillarea)(x0, y0, x1-x0+1, 1, color);
+ lld_gdisp_fill_area(x0, y0, x1-x0+1, 1, color);
else
- GDISP_LLD(fillarea)(x0, y1, x0-x1+1, 1, color);
+ lld_gdisp_fill_area(x0, y1, x0-x1+1, 1, color);
return;
}
#endif
@@ -102,7 +102,7 @@
diff = P - dx;
for(i=0; i<=dx; ++i) {
- GDISP_LLD(drawpixel)(x0, y0, color);
+ lld_gdisp_draw_pixel(x0, y0, color);
if (P < 0) {
P += dy;
x0 += addx;
@@ -118,7 +118,7 @@
diff = P - dy;
for(i=0; i<=dy; ++i) {
- GDISP_LLD(drawpixel)(x0, y0, color);
+ lld_gdisp_draw_pixel(x0, y0, color);
if (P < 0) {
P += dx;
y0 += addy;
@@ -133,16 +133,16 @@
#endif
#if !GDISP_HARDWARE_FILLS
- void GDISP_LLD(fillarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
+ void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
#if GDISP_HARDWARE_SCROLL
- GDISP_LLD(verticalscroll)(x, y, cx, cy, cy, color);
+ lld_gdisp_vertical_scroll(x, y, cx, cy, cy, color);
#elif GDISP_HARDWARE_LINES
coord_t x1, y1;
x1 = x + cx - 1;
y1 = y + cy;
for(; y < y1; y++)
- GDISP_LLD(drawline)(x, y, x1, y, color);
+ lld_gdisp_draw_line(x, y, x1, y, color);
#else
coord_t x0, x1, y1;
@@ -151,13 +151,13 @@
y1 = y + cy;
for(; y < y1; y++)
for(x = x0; x < x1; x++)
- GDISP_LLD(drawpixel)(x, y, color);
+ lld_gdisp_draw_pixel(x, y, color);
#endif
}
#endif
#if !GDISP_HARDWARE_BITFILLS
- void GDISP_LLD(blitareaex)(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
+ void lld_gdisp_blit_area_ex(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
coord_t x0, x1, y1;
x0 = x;
@@ -167,12 +167,12 @@
srccx -= cx;
for(; y < y1; y++, buffer += srccx)
for(x=x0; x < x1; x++)
- GDISP_LLD(drawpixel)(x, y, *buffer++);
+ lld_gdisp_draw_pixel(x, y, *buffer++);
}
#endif
#if GDISP_NEED_CLIP && !GDISP_HARDWARE_CLIP
- void GDISP_LLD(setclip)(coord_t x, coord_t y, coord_t cx, coord_t cy) {
+ void lld_gdisp_set_clip(coord_t x, coord_t y, coord_t cx, coord_t cy) {
#if GDISP_NEED_VALIDATION
if (x >= GDISP.Width || y >= GDISP.Height || cx < 0 || cy < 0)
return;
@@ -189,7 +189,7 @@
#endif
#if GDISP_NEED_CIRCLE && !GDISP_HARDWARE_CIRCLES
- void GDISP_LLD(drawcircle)(coord_t x, coord_t y, coord_t radius, color_t color) {
+ void lld_gdisp_draw_circle(coord_t x, coord_t y, coord_t radius, color_t color) {
coord_t a, b, P;
a = 0;
@@ -197,14 +197,14 @@
P = 1 - radius;
do {
- GDISP_LLD(drawpixel)(x+a, y+b, color);
- GDISP_LLD(drawpixel)(x+b, y+a, color);
- GDISP_LLD(drawpixel)(x-a, y+b, color);
- GDISP_LLD(drawpixel)(x-b, y+a, color);
- GDISP_LLD(drawpixel)(x+b, y-a, color);
- GDISP_LLD(drawpixel)(x+a, y-b, color);
- GDISP_LLD(drawpixel)(x-a, y-b, color);
- GDISP_LLD(drawpixel)(x-b, y-a, color);
+ lld_gdisp_draw_pixel(x+a, y+b, color);
+ lld_gdisp_draw_pixel(x+b, y+a, color);
+ lld_gdisp_draw_pixel(x-a, y+b, color);
+ lld_gdisp_draw_pixel(x-b, y+a, color);
+ lld_gdisp_draw_pixel(x+b, y-a, color);
+ lld_gdisp_draw_pixel(x+a, y-b, color);
+ lld_gdisp_draw_pixel(x-a, y-b, color);
+ lld_gdisp_draw_pixel(x-b, y-a, color);
if (P < 0)
P += 3 + 2*a++;
else
@@ -214,7 +214,7 @@
#endif
#if GDISP_NEED_CIRCLE && !GDISP_HARDWARE_CIRCLEFILLS
- void GDISP_LLD(fillcircle)(coord_t x, coord_t y, coord_t radius, color_t color) {
+ void lld_gdisp_fill_circle(coord_t x, coord_t y, coord_t radius, color_t color) {
coord_t a, b, P;
a = 0;
@@ -222,10 +222,10 @@
P = 1 - radius;
do {
- GDISP_LLD(drawline)(x-a, y+b, x+a, y+b, color);
- GDISP_LLD(drawline)(x-a, y-b, x+a, y-b, color);
- GDISP_LLD(drawline)(x-b, y+a, x+b, y+a, color);
- GDISP_LLD(drawline)(x-b, y-a, x+b, y-a, color);
+ lld_gdisp_draw_line(x-a, y+b, x+a, y+b, color);
+ lld_gdisp_draw_line(x-a, y-b, x+a, y-b, color);
+ lld_gdisp_draw_line(x-b, y+a, x+b, y+a, color);
+ lld_gdisp_draw_line(x-b, y-a, x+b, y-a, color);
if (P < 0)
P += 3 + 2*a++;
else
@@ -235,16 +235,16 @@
#endif
#if GDISP_NEED_ELLIPSE && !GDISP_HARDWARE_ELLIPSES
- void GDISP_LLD(drawellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
+ void lld_gdisp_draw_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
int dx = 0, dy = b; /* im I. Quadranten von links oben nach rechts unten */
long a2 = a*a, b2 = b*b;
long err = b2-(2*b-1)*a2, e2; /* Fehler im 1. Schritt */
do {
- GDISP_LLD(drawpixel)(x+dx, y+dy, color); /* I. Quadrant */
- GDISP_LLD(drawpixel)(x-dx, y+dy, color); /* II. Quadrant */
- GDISP_LLD(drawpixel)(x-dx, y-dy, color); /* III. Quadrant */
- GDISP_LLD(drawpixel)(x+dx, y-dy, color); /* IV. Quadrant */
+ lld_gdisp_draw_pixel(x+dx, y+dy, color); /* I. Quadrant */
+ lld_gdisp_draw_pixel(x-dx, y+dy, color); /* II. Quadrant */
+ lld_gdisp_draw_pixel(x-dx, y-dy, color); /* III. Quadrant */
+ lld_gdisp_draw_pixel(x+dx, y-dy, color); /* IV. Quadrant */
e2 = 2*err;
if(e2 < (2*dx+1)*b2) {
@@ -258,21 +258,21 @@
} while(dy >= 0);
while(dx++ < a) { /* fehlerhafter Abbruch bei flachen Ellipsen (b=1) */
- GDISP_LLD(drawpixel)(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
- GDISP_LLD(drawpixel)(x-dx, y, color);
+ lld_gdisp_draw_pixel(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
+ lld_gdisp_draw_pixel(x-dx, y, color);
}
}
#endif
#if GDISP_NEED_ELLIPSE && !GDISP_HARDWARE_ELLIPSEFILLS
- void GDISP_LLD(fillellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
+ void lld_gdisp_fill_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
int dx = 0, dy = b; /* im I. Quadranten von links oben nach rechts unten */
long a2 = a*a, b2 = b*b;
long err = b2-(2*b-1)*a2, e2; /* Fehler im 1. Schritt */
do {
- GDISP_LLD(drawline)(x-dx,y+dy,x+dx,y+dy, color);
- GDISP_LLD(drawline)(x-dx,y-dy,x+dx,y-dy, color);
+ lld_gdisp_draw_line(x-dx,y+dy,x+dx,y+dy, color);
+ lld_gdisp_draw_line(x-dx,y-dy,x+dx,y-dy, color);
e2 = 2*err;
if(e2 < (2*dx+1)*b2) {
@@ -286,8 +286,8 @@
} while(dy >= 0);
while(dx++ < a) { /* fehlerhafter Abbruch bei flachen Ellipsen (b=1) */
- GDISP_LLD(drawpixel)(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
- GDISP_LLD(drawpixel)(x-dx, y, color);
+ lld_gdisp_draw_pixel(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
+ lld_gdisp_draw_pixel(x-dx, y, color);
}
}
#endif
@@ -325,13 +325,13 @@
do {
if(x-a <= x_maxI && x-a >= x_minI)
- GDISP_LLD(drawpixel)(x-a, y-b, color);
+ lld_gdisp_draw_pixel(x-a, y-b, color);
if(x+a <= x_maxI && x+a >= x_minI)
- GDISP_LLD(drawpixel)(x+a, y-b, color);
+ lld_gdisp_draw_pixel(x+a, y-b, color);
if(x-b <= x_maxI && x-b >= x_minI)
- GDISP_LLD(drawpixel)(x-b, y-a, color);
+ lld_gdisp_draw_pixel(x-b, y-a, color);
if(x+b <= x_maxI && x+b >= x_minI)
- GDISP_LLD(drawpixel)(x+b, y-a, color);
+ lld_gdisp_draw_pixel(x+b, y-a, color);
if (P < 0) {
P = P + 3 + 2*a;
@@ -359,13 +359,13 @@
do {
if(x-a <= x_maxII && x-a >= x_minII)
- GDISP_LLD(drawpixel)(x-a, y+b, color);
+ lld_gdisp_draw_pixel(x-a, y+b, color);
if(x+a <= x_maxII && x+a >= x_minII)
- GDISP_LLD(drawpixel)(x+a, y+b, color);
+ lld_gdisp_draw_pixel(x+a, y+b, color);
if(x-b <= x_maxII && x-b >= x_minII)
- GDISP_LLD(drawpixel)(x-b, y+a, color);
+ lld_gdisp_draw_pixel(x-b, y+a, color);
if(x+b <= x_maxII && x+b >= x_minII)
- GDISP_LLD(drawpixel)(x+b, y+a, color);
+ lld_gdisp_draw_pixel(x+b, y+a, color);
if (P < 0) {
P = P + 3 + 2*a;
@@ -379,7 +379,7 @@
}
}
- void GDISP_LLD(drawarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) {
+ void lld_gdisp_draw_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) {
if(endangle < startangle) {
_draw_arc(x, y, startangle, 360, radius, color);
_draw_arc(x, y, 0, endangle, radius, color);
@@ -419,13 +419,13 @@
do {
if(x-a <= x_maxI && x-a >= x_minI)
- GDISP_LLD(drawline)(x, y, x-a, y-b, color);
+ lld_gdisp_draw_line(x, y, x-a, y-b, color);
if(x+a <= x_maxI && x+a >= x_minI)
- GDISP_LLD(drawline)(x, y, x+a, y-b, color);
+ lld_gdisp_draw_line(x, y, x+a, y-b, color);
if(x-b <= x_maxI && x-b >= x_minI)
- GDISP_LLD(drawline)(x, y, x-b, y-a, color);
+ lld_gdisp_draw_line(x, y, x-b, y-a, color);
if(x+b <= x_maxI && x+b >= x_minI)
- GDISP_LLD(drawline)(x, y, x+b, y-a, color);
+ lld_gdisp_draw_line(x, y, x+b, y-a, color);
if (P < 0) {
P = P + 3 + 2*a;
@@ -453,13 +453,13 @@
do {
if(x-a <= x_maxII && x-a >= x_minII)
- GDISP_LLD(drawline)(x, y, x-a, y+b, color);
+ lld_gdisp_draw_line(x, y, x-a, y+b, color);
if(x+a <= x_maxII && x+a >= x_minII)
- GDISP_LLD(drawline)(x, y, x+a, y+b, color);
+ lld_gdisp_draw_line(x, y, x+a, y+b, color);
if(x-b <= x_maxII && x-b >= x_minII)
- GDISP_LLD(drawline)(x, y, x-b, y+a, color);
+ lld_gdisp_draw_line(x, y, x-b, y+a, color);
if(x+b <= x_maxII && x+b >= x_minII)
- GDISP_LLD(drawline)(x, y, x+b, y+a, color);
+ lld_gdisp_draw_line(x, y, x+b, y+a, color);
if (P < 0) {
P = P + 3 + 2*a;
@@ -473,7 +473,7 @@
}
}
- void GDISP_LLD(fillarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) {
+ void lld_gdisp_fill_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) {
if(endangle < startangle) {
_fill_arc(x, y, startangle, 360, radius, color);
_fill_arc(x, y, 0, endangle, radius, color);
@@ -488,7 +488,7 @@
#endif
#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT
- void GDISP_LLD(drawchar)(coord_t x, coord_t y, char c, font_t font, color_t color) {
+ void lld_gdisp_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color) {
const fontcolumn_t *ptr;
fontcolumn_t column;
coord_t width, height, xscale, yscale;
@@ -515,7 +515,7 @@
if (column & 0x01) {
for(xs=0; xs < xscale; xs++)
for(ys=0; ys < yscale; ys++)
- GDISP_LLD(drawpixel)(x+i+xs, y+j+ys, color);
+ lld_gdisp_draw_pixel(x+i+xs, y+j+ys, color);
}
}
}
@@ -523,7 +523,7 @@
#endif
#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXTFILLS
- void GDISP_LLD(fillchar)(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor) {
+ void lld_gdisp_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor) {
coord_t width, height;
coord_t xscale, yscale;
@@ -540,10 +540,10 @@
#if GDISP_HARDWARE_TEXT || GDISP_SOFTWARE_TEXTFILLDRAW
/* Fill the area */
- GDISP_LLD(fillarea)(x, y, width, height, bgcolor);
+ lld_gdisp_fill_area(x, y, width, height, bgcolor);
/* Draw the text */
- GDISP_LLD(drawchar)(x, y, c, font, color);
+ lld_gdisp_draw_char(x, y, c, font, color);
/* Method 2: Create a single column bitmap and then blit it */
#elif GDISP_HARDWARE_BITFILLS && GDISP_SOFTWARE_TEXTBLITCOLUMN
@@ -582,7 +582,7 @@
}
for(xs=0; xs < xscale; xs++)
- GDISP_LLD(blitareaex)(x+i+xs, y, 1, height, 0, 0, 1, buf);
+ lld_gdisp_blit_area_ex(x+i+xs, y, 1, height, 0, 0, 1, buf);
}
}
@@ -626,7 +626,7 @@
}
/* [Patch by Badger] Write all in one stroke */
- GDISP_LLD(blitareaex)(x, y, width, height, 0, 0, width, buf);
+ lld_gdisp_blit_area_ex(x, y, width, height, 0, 0, width, buf);
}
/* Method 4: Draw pixel by pixel */
@@ -648,11 +648,11 @@
if (column & 0x01) {
for(xs=0; xs < xscale; xs++)
for(ys=0; ys < yscale; ys++)
- GDISP_LLD(drawpixel)(x+i+xs, y+j+ys, color);
+ lld_gdisp_draw_pixel(x+i+xs, y+j+ys, color);
} else {
for(xs=0; xs < xscale; xs++)
for(ys=0; ys < yscale; ys++)
- GDISP_LLD(drawpixel)(x+i+xs, y+j+ys, bgcolor);
+ lld_gdisp_draw_pixel(x+i+xs, y+j+ys, bgcolor);
}
}
}
@@ -663,7 +663,7 @@
#if GDISP_NEED_CONTROL && !GDISP_HARDWARE_CONTROL
- void GDISP_LLD(control)(unsigned what, void *value) {
+ void lld_gdisp_control(unsigned what, void *value) {
(void)what;
(void)value;
/* Ignore everything */
@@ -671,7 +671,7 @@
#endif
#if !GDISP_HARDWARE_QUERY
-void *GDISP_LLD(query)(unsigned what) {
+void *lld_gdisp_query(unsigned what) {
switch(what) {
case GDISP_QUERY_WIDTH: return (void *)(unsigned)GDISP.Width;
case GDISP_QUERY_HEIGHT: return (void *)(unsigned)GDISP.Height;
@@ -685,82 +685,82 @@ void *GDISP_LLD(query)(unsigned what) {
#endif
#if GDISP_NEED_MSGAPI
- void GDISP_LLD(msgdispatch)(gdisp_lld_msg_t *msg) {
+ void lld_gdisp_msg_dispatch(gdisp_lld_msg_t *msg) {
switch(msg->action) {
case GDISP_LLD_MSG_NOP:
break;
case GDISP_LLD_MSG_INIT:
- GDISP_LLD(init)();
+ lld_gdisp_init();
break;
case GDISP_LLD_MSG_CLEAR:
- GDISP_LLD(clear)(msg->clear.color);
+ lld_gdisp_clear(msg->clear.color);
break;
case GDISP_LLD_MSG_DRAWPIXEL:
- GDISP_LLD(drawpixel)(msg->drawpixel.x, msg->drawpixel.y, msg->drawpixel.color);
+ lld_gdisp_draw_pixel(msg->drawpixel.x, msg->drawpixel.y, msg->drawpixel.color);
break;
case GDISP_LLD_MSG_FILLAREA:
- GDISP_LLD(fillarea)(msg->fillarea.x, msg->fillarea.y, msg->fillarea.cx, msg->fillarea.cy, msg->fillarea.color);
+ lld_gdisp_fill_area(msg->fillarea.x, msg->fillarea.y, msg->fillarea.cx, msg->fillarea.cy, msg->fillarea.color);
break;
case GDISP_LLD_MSG_BLITAREA:
- GDISP_LLD(blitareaex)(msg->blitarea.x, msg->blitarea.y, msg->blitarea.cx, msg->blitarea.cy, msg->blitarea.srcx, msg->blitarea.srcy, msg->blitarea.srccx, msg->blitarea.buffer);
+ lld_gdisp_blit_area_ex(msg->blitarea.x, msg->blitarea.y, msg->blitarea.cx, msg->blitarea.cy, msg->blitarea.srcx, msg->blitarea.srcy, msg->blitarea.srccx, msg->blitarea.buffer);
break;
case GDISP_LLD_MSG_DRAWLINE:
- GDISP_LLD(drawline)(msg->drawline.x0, msg->drawline.y0, msg->drawline.x1, msg->drawline.y1, msg->drawline.color);
+ lld_gdisp_draw_line(msg->drawline.x0, msg->drawline.y0, msg->drawline.x1, msg->drawline.y1, msg->drawline.color);
break;
#if GDISP_NEED_CLIP
case GDISP_LLD_MSG_SETCLIP:
- GDISP_LLD(setclip)(msg->setclip.x, msg->setclip.y, msg->setclip.cx, msg->setclip.cy);
+ lld_gdisp_set_clip(msg->setclip.x, msg->setclip.y, msg->setclip.cx, msg->setclip.cy);
break;
#endif
#if GDISP_NEED_CIRCLE
case GDISP_LLD_MSG_DRAWCIRCLE:
- GDISP_LLD(drawcircle)(msg->drawcircle.x, msg->drawcircle.y, msg->drawcircle.radius, msg->drawcircle.color);
+ lld_gdisp_draw_circle(msg->drawcircle.x, msg->drawcircle.y, msg->drawcircle.radius, msg->drawcircle.color);
break;
case GDISP_LLD_MSG_FILLCIRCLE:
- GDISP_LLD(fillcircle)(msg->fillcircle.x, msg->fillcircle.y, msg->fillcircle.radius, msg->fillcircle.color);
+ lld_gdisp_fill_circle(msg->fillcircle.x, msg->fillcircle.y, msg->fillcircle.radius, msg->fillcircle.color);
break;
#endif
#if GDISP_NEED_ELLIPSE
case GDISP_LLD_MSG_DRAWELLIPSE:
- GDISP_LLD(drawellipse)(msg->drawellipse.x, msg->drawellipse.y, msg->drawellipse.a, msg->drawellipse.b, msg->drawellipse.color);
+ lld_gdisp_draw_ellipse(msg->drawellipse.x, msg->drawellipse.y, msg->drawellipse.a, msg->drawellipse.b, msg->drawellipse.color);
break;
case GDISP_LLD_MSG_FILLELLIPSE:
- GDISP_LLD(fillellipse)(msg->fillellipse.x, msg->fillellipse.y, msg->fillellipse.a, msg->fillellipse.b, msg->fillellipse.color);
+ lld_gdisp_fill_ellipse(msg->fillellipse.x, msg->fillellipse.y, msg->fillellipse.a, msg->fillellipse.b, msg->fillellipse.color);
break;
#endif
#if GDISP_NEED_ARC
case GDISP_LLD_MSG_DRAWARC:
- GDISP_LLD(drawcircle)(msg->drawarc.x, msg->drawarc.y, msg->drawarc.radius, msg->drawarc.startangle, msg->drawarc.endangle, msg->drawarc.color);
+ lld_gdisp_draw_circle(msg->drawarc.x, msg->drawarc.y, msg->drawarc.radius, msg->drawarc.startangle, msg->drawarc.endangle, msg->drawarc.color);
break;
case GDISP_LLD_MSG_FILLARC:
- GDISP_LLD(fillcircle)(msg->fillarc.x, msg->fillarc.y, msg->fillarc.radius, msg->fillarc.startangle, msg->fillarc.endangle, msg->fillarc.color);
+ lld_gdisp_fill_circle(msg->fillarc.x, msg->fillarc.y, msg->fillarc.radius, msg->fillarc.startangle, msg->fillarc.endangle, msg->fillarc.color);
break;
#endif
#if GDISP_NEED_TEXT
case GDISP_LLD_MSG_DRAWCHAR:
- GDISP_LLD(drawchar)(msg->drawchar.x, msg->drawchar.y, msg->drawchar.c, msg->drawchar.font, msg->drawchar.color);
+ lld_gdisp_draw_char(msg->drawchar.x, msg->drawchar.y, msg->drawchar.c, msg->drawchar.font, msg->drawchar.color);
break;
case GDISP_LLD_MSG_FILLCHAR:
- GDISP_LLD(fillchar)(msg->fillchar.x, msg->fillchar.y, msg->fillchar.c, msg->fillchar.font, msg->fillchar.color, msg->fillchar.bgcolor);
+ lld_gdisp_fill_char(msg->fillchar.x, msg->fillchar.y, msg->fillchar.c, msg->fillchar.font, msg->fillchar.color, msg->fillchar.bgcolor);
break;
#endif
#if GDISP_NEED_PIXELREAD
case GDISP_LLD_MSG_GETPIXELCOLOR:
- msg->getpixelcolor.result = GDISP_LLD(getpixelcolor)(msg->getpixelcolor.x, msg->getpixelcolor.y);
+ msg->getpixelcolor.result = lld_gdisp_get_pixel_color(msg->getpixelcolor.x, msg->getpixelcolor.y);
break;
#endif
#if GDISP_NEED_SCROLL
case GDISP_LLD_MSG_VERTICALSCROLL:
- GDISP_LLD(verticalscroll)(msg->verticalscroll.x, msg->verticalscroll.y, msg->verticalscroll.cx, msg->verticalscroll.cy, msg->verticalscroll.lines, msg->verticalscroll.bgcolor);
+ lld_gdisp_vertical_scroll(msg->verticalscroll.x, msg->verticalscroll.y, msg->verticalscroll.cx, msg->verticalscroll.cy, msg->verticalscroll.lines, msg->verticalscroll.bgcolor);
break;
#endif
#if GDISP_NEED_CONTROL
case GDISP_LLD_MSG_CONTROL:
- GDISP_LLD(control)(msg->control.what, msg->control.value);
+ lld_gdisp_control(msg->control.what, msg->control.value);
break;
#endif
case GDISP_LLD_MSG_QUERY:
- msg->query.result = GDISP_LLD(query)(msg->query.what);
+ msg->query.result = lld_gdisp_query(msg->query.what);
break;
}
}
diff --git a/include/gdisp/lld/gdisp_lld.h b/include/gdisp/lld/gdisp_lld.h
index 76b698bc..da1b29c6 100644
--- a/include/gdisp/lld/gdisp_lld.h
+++ b/include/gdisp/lld/gdisp_lld.h
@@ -19,7 +19,7 @@
*/
/**
- * @file include/gdisp/lld/gdisp_lld.h
+ * @file include/gdisp/lld/lld_gdisp.h
* @brief GDISP Graphic Driver subsystem low level driver header.
*
* @addtogroup GDISP
@@ -366,7 +366,7 @@
#define RGB2COLOR(r,g,b) ((color_t)((((r) & 0xF8)<<8) | (((g) & 0xFC)<<3) | (((b) & 0xF8)>>3)))
#define HTML2COLOR(h) ((color_t)((((h) & 0xF80000)>>8) | (((h) & 0x00FC00)>>5) | (((h) & 0x0000F8)>>3)))
#define RED_OF(c) (((c) & 0xF800)>>8)
- #define GREEN_OF(c) (((c)&0x007E)>>3)
+ #define GREEN_OF(c) (((c)&0x07E0)>>3)
#define BLUE_OF(c) (((c)&0x001F)<<3)
#elif GDISP_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888
@@ -458,79 +458,74 @@ typedef enum powermode {powerOff, powerSleep, powerDeepSleep, powerOn} gdisp_pow
/* External declarations. */
/*===========================================================================*/
-#ifndef GDISP_LLD_VMT
- /* Special magic stuff for the VMT driver */
- #define GDISP_LLD_VMT(x) GDISP_LLD(x)
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
/* Core functions */
- extern bool_t GDISP_LLD(init)(void);
+ extern bool_t lld_gdisp_init(void);
/* Some of these functions will be implemented in software by the high level driver
- depending on the GDISP_HARDWARE_XXX macros defined in gdisp_lld_config.h.
+ depending on the GDISP_HARDWARE_XXX macros defined in lld_gdisp_config.h.
*/
/* Drawing functions */
- extern void GDISP_LLD_VMT(clear)(color_t color);
- extern void GDISP_LLD_VMT(drawpixel)(coord_t x, coord_t y, color_t color);
- extern void GDISP_LLD_VMT(fillarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
- extern void GDISP_LLD_VMT(blitareaex)(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer);
- extern void GDISP_LLD_VMT(drawline)(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
+ extern void lld_gdisp_clear(color_t color);
+ extern void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color);
+ extern void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
+ extern void lld_gdisp_blit_area_ex(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer);
+ extern void lld_gdisp_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
/* Circular Drawing Functions */
#if GDISP_NEED_CIRCLE
- extern void GDISP_LLD_VMT(drawcircle)(coord_t x, coord_t y, coord_t radius, color_t color);
- extern void GDISP_LLD_VMT(fillcircle)(coord_t x, coord_t y, coord_t radius, color_t color);
+ extern void lld_gdisp_draw_circle(coord_t x, coord_t y, coord_t radius, color_t color);
+ extern void lld_gdisp_fill_circle(coord_t x, coord_t y, coord_t radius, color_t color);
#endif
#if GDISP_NEED_ELLIPSE
- extern void GDISP_LLD_VMT(drawellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
- extern void GDISP_LLD_VMT(fillellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
+ extern void lld_gdisp_draw_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
+ extern void lld_gdisp_fill_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
#endif
/* Arc Drawing Functions */
#if GDISP_NEED_ARC
- extern void GDISP_LLD_VMT(drawarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
- extern void GDISP_LLD_VMT(fillarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
+ extern void lld_gdisp_draw_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
+ extern void lld_gdisp_fill_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
#endif
/* Text Rendering Functions */
#if GDISP_NEED_TEXT
- extern void GDISP_LLD_VMT(drawchar)(coord_t x, coord_t y, char c, font_t font, color_t color);
- extern void GDISP_LLD_VMT(fillchar)(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor);
+ extern void lld_gdisp_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color);
+ extern void lld_gdisp_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor);
#endif
/* Pixel readback */
#if GDISP_NEED_PIXELREAD
- extern color_t GDISP_LLD_VMT(getpixelcolor)(coord_t x, coord_t y);
+ extern color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y);
#endif
/* Scrolling Function - clears the area scrolled out */
#if GDISP_NEED_SCROLL
- extern void GDISP_LLD_VMT(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor);
+ extern void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor);
#endif
/* Set driver specific control */
#if GDISP_NEED_CONTROL
- extern void GDISP_LLD_VMT(control)(unsigned what, void *value);
+ extern void lld_gdisp_control(unsigned what, void *value);
#endif
/* Query driver specific data */
- extern void *GDISP_LLD_VMT(query)(unsigned what);
+ extern void *lld_gdisp_query(unsigned what);
/* Clipping Functions */
#if GDISP_NEED_CLIP
- extern void GDISP_LLD_VMT(setclip)(coord_t x, coord_t y, coord_t cx, coord_t cy);
+ extern void lld_gdisp_set_clip(coord_t x, coord_t y, coord_t cx, coord_t cy);
#endif
/* Messaging API */
#if GDISP_NEED_MSGAPI
- #include "gdisp_lld_msgs.h"
- extern void GDISP_LLD(msgdispatch)(gdisp_lld_msg_t *msg);
+ #include "lld_gdisp_msgs.h"
+ extern void lld_gdisp_msg_dispatch(lld_gdisp_msg_t *msg);
#endif
#ifdef __cplusplus
diff --git a/include/gdisp/options.h b/include/gdisp/options.h
index 2fedd34d..ae33ec19 100644
--- a/include/gdisp/options.h
+++ b/include/gdisp/options.h
@@ -229,13 +229,8 @@
*/
/* #define GDISP_USE_FSMC */
/* #define GDISP_USE_GPIO */
- /**
- * @brief Define which two drivers will be used by the VMT layer.
- * @details Only required by the VMT driver.
- */
- /* #define GDISP_VMT_NAME1(x) x##YourDriver1 */
- /* #define GDISP_VMT_NAME2(x) x##YourDriver2 */
/** @} */
#endif /* _GDISP_OPTIONS_H */
/** @} */
+