Merge pull request #16 from Tectu/master

Merge Tectu Changes
ugfx_release_2.6
Andrew Hannam 2013-02-17 23:20:59 -08:00
commit a178b91c4f
36 changed files with 389 additions and 881 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -81,28 +81,28 @@ static __inline void lld_lcdDelay(uint16_t us) {
} }
static __inline void lld_lcdWriteIndex(uint16_t index) { static __inline void lld_lcdWriteIndex(uint16_t index) {
GDISP_LLD(write_index)(index); lld_gdisp_write_index(index);
} }
static __inline void lld_lcdWriteData(uint16_t data) { static __inline void lld_lcdWriteData(uint16_t data) {
GDISP_LLD(write_data)(data); lld_gdisp_write_data(data);
} }
static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) { static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
GDISP_LLD(write_index)(lcdReg); lld_gdisp_write_index(lcdReg);
GDISP_LLD(write_data)(lcdRegValue); lld_gdisp_write_data(lcdRegValue);
} }
static __inline uint16_t lld_lcdReadData(void) { static __inline uint16_t lld_lcdReadData(void) {
/* fix this! */ /* fix this! */
//return GDISP_LLD(read_data); //return lld_gdisp_read_data;
return GDISP_RAM; return GDISP_RAM;
} }
static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) { static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
volatile uint16_t dummy; volatile uint16_t dummy;
GDISP_LLD(write_index)(lcdReg); lld_gdisp_write_index(lcdReg);
dummy = lld_lcdReadData(); dummy = lld_lcdReadData();
(void)dummy; (void)dummy;
@ -143,14 +143,14 @@ static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
buffer[i] = lld_lcdReadData(); buffer[i] = lld_lcdReadData();
} }
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
/* Initialise your display */ /* Initialise your display */
GDISP_LLD(init_board)(); lld_gdisp_init_board();
/* Hardware reset */ /* Hardware reset */
GDISP_LLD(setpin_reset)(TRUE); lld_gdisp_reset_pin(TRUE);
lld_lcdDelay(1000); lld_lcdDelay(1000);
GDISP_LLD(setpin_reset)(FALSE); lld_gdisp_reset_pin(FALSE);
lld_lcdDelay(1000); lld_lcdDelay(1000);
DISPLAY_CODE = lld_lcdReadReg(0); DISPLAY_CODE = lld_lcdReadReg(0);
@ -215,7 +215,7 @@ bool_t GDISP_LLD(init)(void) {
lld_lcdWriteReg(0x0007, 0x0173); //display On lld_lcdWriteReg(0x0007, 0x0173); //display On
// Turn on the backlight // Turn on the backlight
GDISP_LLD(set_backlight)(GDISP_INITIAL_BACKLIGHT); lld_gdisp_backlight(GDISP_INITIAL_BACKLIGHT);
/* Initialise the GDISP structure */ /* Initialise the GDISP structure */
GDISP.Width = GDISP_SCREEN_WIDTH; GDISP.Width = GDISP_SCREEN_WIDTH;
@ -298,7 +298,7 @@ static __inline void lld_lcdResetViewPort(void) {
} }
} }
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return; if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
#endif #endif
@ -307,7 +307,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
} }
#if GDISP_HARDWARE_CLEARS || defined(__DOXYGEN__) #if GDISP_HARDWARE_CLEARS || defined(__DOXYGEN__)
void GDISP_LLD(clear)(color_t color) { void lld_gdisp_clear(color_t color) {
unsigned i; unsigned i;
lld_lcdSetCursor(0, 0); lld_lcdSetCursor(0, 0);
@ -321,7 +321,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if GDISP_HARDWARE_FILLS || defined(__DOXYGEN__) #if GDISP_HARDWARE_FILLS || defined(__DOXYGEN__)
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_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; } if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; } if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
@ -343,7 +343,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if GDISP_HARDWARE_BITFILLS || defined(__DOXYGEN__) #if GDISP_HARDWARE_BITFILLS || defined(__DOXYGEN__)
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 endx, endy; coord_t endx, endy;
unsigned lg; unsigned lg;
@ -372,7 +372,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if (GDISP_NEED_PIXELREAD && GDISP_HARDWARE_PIXELREAD) || defined(__DOXYGEN__) #if (GDISP_NEED_PIXELREAD && GDISP_HARDWARE_PIXELREAD) || defined(__DOXYGEN__)
color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
color_t color; color_t color;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@ -392,7 +392,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if (GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL) || defined(__DOXYGEN__) #if (GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL) || defined(__DOXYGEN__)
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)]; static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)];
coord_t row0, row1; coord_t row0, row1;
unsigned i, gap, abslines; unsigned i, gap, abslines;
@ -445,7 +445,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if (GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL) || defined(__DOXYGEN__) #if (GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL) || defined(__DOXYGEN__)
void GDISP_LLD(control)(unsigned what, void *value) { void lld_gdisp_control(unsigned what, void *value) {
switch(what) { switch(what) {
case GDISP_CONTROL_POWER: case GDISP_CONTROL_POWER:
if(GDISP.Powermode == (gdisp_powermode_t)value) if(GDISP.Powermode == (gdisp_powermode_t)value)
@ -457,7 +457,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0011, 0x0000); lld_lcdWriteReg(0x0011, 0x0000);
lld_lcdWriteReg(0x0012, 0x0000); lld_lcdWriteReg(0x0012, 0x0000);
lld_lcdWriteReg(0x0013, 0x0000); lld_lcdWriteReg(0x0013, 0x0000);
GDISP_LLD(set_backlight)(0); lld_gdisp_backlight(0);
break; break;
case powerOn: case powerOn:
@ -476,9 +476,9 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0029, 0x0009); /* VCM[4:0] for VCOMH */ lld_lcdWriteReg(0x0029, 0x0009); /* VCM[4:0] for VCOMH */
lld_lcdDelay(500); lld_lcdDelay(500);
lld_lcdWriteReg(0x0007, 0x0173); /* 262K color and display ON */ lld_lcdWriteReg(0x0007, 0x0173); /* 262K color and display ON */
GDISP_LLD(set_backlight)(GDISP.Backlight); lld_gdisp_backlight(GDISP.Backlight);
if(GDISP.Powermode != powerSleep || GDISP.Powermode != powerDeepSleep) if(GDISP.Powermode != powerSleep || GDISP.Powermode != powerDeepSleep)
GDISP_LLD(init)(); lld_gdisp_init();
break; break;
case powerSleep: case powerSleep:
@ -489,7 +489,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */ lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */ lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
lld_lcdWriteReg(0x0010, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ lld_lcdWriteReg(0x0010, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
GDISP_LLD(set_backlight)(0); lld_gdisp_backlight(0);
break; break;
case powerDeepSleep: case powerDeepSleep:
@ -500,7 +500,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */ lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */ lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
lld_lcdWriteReg(0x0010, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ lld_lcdWriteReg(0x0010, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
GDISP_LLD(set_backlight)(0); lld_gdisp_backlight(0);
break; break;
default: default:
@ -554,7 +554,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
case GDISP_CONTROL_BACKLIGHT: case GDISP_CONTROL_BACKLIGHT:
if((unsigned)value > 100) value = (void *)100; if((unsigned)value > 100) value = (void *)100;
GDISP_LLD(set_backlight)((unsigned)value); lld_gdisp_backlight((unsigned)value);
GDISP.Backlight = (unsigned)value; GDISP.Backlight = (unsigned)value;
break; break;

View File

@ -29,28 +29,28 @@
#ifndef GDISP_LLD_BOARD_H #ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H #define GDISP_LLD_BOARD_H
static __inline void GDISP_LLD(init_board)(void) { static __inline void lld_gdisp_init_board(void) {
#error "ILI9320: You must implement the init_board routine for your board" #error "ILI9320: You must implement the init_board routine for your board"
} }
static __inline void GDISP_LLD(setpin_reset)(bool_t state) { static __inline void lld_gdisp_reset_pin(bool_t state) {
#error "ILI9320: You must implement setpin_reset routine for your board" #error "ILI9320: You must implement setpin_reset routine for your board"
} }
static __inline void GDISP_LLD(write_index)(uint16_t data) { static __inline void lld_gdisp_write_index(uint16_t data) {
#error "ILI9320: You must implement write_index routine for your board" #error "ILI9320: You must implement write_index routine for your board"
} }
static __inline void GDISP_LLD(write_data)(uint16_t data) { static __inline void lld_gdisp_write_data(uint16_t data) {
#error "ILI9320: You must implement write_data routine for your board" #error "ILI9320: You must implement write_data routine for your board"
} }
static __inline uint16_t GDISP_LLD(read_data)(void) { static __inline uint16_t lld_gdisp_read_data(void) {
#error "ILI9320: You must implement read_data routine for your board" #error "ILI9320: You must implement read_data routine for your board"
} }
/* if not available, just ignore the argument and return */ /* if not available, just ignore the argument and return */
static __inline uint16_t GDISP_LLD(set_backlight)(uint8_t percentage) { static __inline uint16_t lld_gdisp_backlight(uint8_t percentage) {
#error "ILI9320: You must implement set_backlight routine for your board" #error "ILI9320: You must implement set_backlight routine for your board"
} }

View File

@ -32,7 +32,7 @@
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ #define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */ #define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */
static __inline void GDISP_LLD(init_board)(void) { static __inline void lld_gdisp_init_board(void) {
/* FSMC setup for F1 */ /* FSMC setup for F1 */
rccEnableAHB(RCC_AHBENR_FSMCEN, 0); rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
@ -54,26 +54,26 @@ static __inline void GDISP_LLD(init_board)(void) {
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN; FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
} }
static __inline void GDISP_LLD(setpin_reset)(bool_t state) { static __inline void lld_gdisp_reset_pin(bool_t state) {
if(state) if(state)
palClearPad(GPIOE, GPIOE_TFT_RST); palClearPad(GPIOE, GPIOE_TFT_RST);
else else
palSetPad(GPIOE, GPIOE_TFT_RST); palSetPad(GPIOE, GPIOE_TFT_RST);
} }
static __inline void GDISP_LLD(write_index)(uint16_t reg) { static __inline void lld_gdisp_write_index(uint16_t reg) {
GDISP_REG = reg; GDISP_REG = reg;
} }
static __inline void GDISP_LLD(write_data)(uint16_t data) { static __inline void lld_gdisp_write_data(uint16_t data) {
GDISP_RAM = data; GDISP_RAM = data;
} }
static __inline uint16_t GDISP_LLD(read_data)(void) { static __inline uint16_t lld_gdisp_read_data(void) {
return GDISP_RAM; return GDISP_RAM;
} }
static __inline void GDISP_LLD(set_backlight)(uint8_t percent) { static __inline void lld_gdisp_backlight(uint8_t percent) {
if(percent == 100) if(percent == 100)
palClearPad(GPIOD, GPIOD_TFT_LIGHT); palClearPad(GPIOD, GPIOD_TFT_LIGHT);
else else

View File

@ -36,7 +36,6 @@
/*===========================================================================*/ /*===========================================================================*/
#define GDISP_DRIVER_NAME "ILI9320" #define GDISP_DRIVER_NAME "ILI9320"
#define GDISP_LLD(x) gdisp_lld_##x##_ILI9320
#define GDISP_HARDWARE_CLEARS TRUE #define GDISP_HARDWARE_CLEARS TRUE
#define GDISP_HARDWARE_FILLS TRUE #define GDISP_HARDWARE_FILLS TRUE

View File

@ -81,28 +81,28 @@ static __inline void lld_lcdDelay(uint16_t us) {
} }
static __inline void lld_lcdWriteIndex(uint16_t index) { static __inline void lld_lcdWriteIndex(uint16_t index) {
GDISP_LLD(write_index)(index); lld_gdisp_write_index(index);
} }
static __inline void lld_lcdWriteData(uint16_t data) { static __inline void lld_lcdWriteData(uint16_t data) {
GDISP_LLD(write_data)(data); lld_gdisp_write_data(data);
} }
static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) { static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
GDISP_LLD(write_index)(lcdReg); lld_gdisp_write_index(lcdReg);
GDISP_LLD(write_data)(lcdRegValue); lld_gdisp_write_data(lcdRegValue);
} }
static __inline uint16_t lld_lcdReadData(void) { static __inline uint16_t lld_lcdReadData(void) {
/* fix this! */ /* fix this! */
//return GDISP_LLD(read_data); //return lld_gdisp_read_data;
return GDISP_RAM; return GDISP_RAM;
} }
static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) { static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
volatile uint16_t dummy; volatile uint16_t dummy;
GDISP_LLD(write_index)(lcdReg); lld_gdisp_write_index(lcdReg);
dummy = lld_lcdReadData(); dummy = lld_lcdReadData();
(void)dummy; (void)dummy;
@ -143,14 +143,14 @@ static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
buffer[i] = lld_lcdReadData(); buffer[i] = lld_lcdReadData();
} }
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
/* Initialise your display */ /* Initialise your display */
GDISP_LLD(init_board)(); lld_gdisp_init_board();
/* Hardware reset */ /* Hardware reset */
GDISP_LLD(setpin_reset)(TRUE); lld_gdisp_reset_pin(TRUE);
lld_lcdDelay(1000); lld_lcdDelay(1000);
GDISP_LLD(setpin_reset)(FALSE); lld_gdisp_reset_pin(FALSE);
lld_lcdDelay(1000); lld_lcdDelay(1000);
// chinese code starts here // chinese code starts here
@ -210,7 +210,7 @@ bool_t GDISP_LLD(init)(void) {
// chinese code ends here // chinese code ends here
// Turn on the backlight // Turn on the backlight
GDISP_LLD(set_backlight)(GDISP_INITIAL_BACKLIGHT); lld_gdisp_backlight(GDISP_INITIAL_BACKLIGHT);
/* Initialise the GDISP structure */ /* Initialise the GDISP structure */
GDISP.Width = GDISP_SCREEN_WIDTH; GDISP.Width = GDISP_SCREEN_WIDTH;
@ -302,7 +302,7 @@ static __inline void lld_lcdResetViewPort(void) {
} }
} }
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return; if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
#endif #endif
@ -311,7 +311,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
} }
#if GDISP_HARDWARE_CLEARS || defined(__DOXYGEN__) #if GDISP_HARDWARE_CLEARS || defined(__DOXYGEN__)
void GDISP_LLD(clear)(color_t color) { void lld_gdisp_clear(color_t color) {
unsigned i; unsigned i;
lld_lcdSetCursor(0, 0); lld_lcdSetCursor(0, 0);
@ -325,7 +325,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if GDISP_HARDWARE_FILLS || defined(__DOXYGEN__) #if GDISP_HARDWARE_FILLS || defined(__DOXYGEN__)
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_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; } if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; } if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
@ -347,7 +347,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if GDISP_HARDWARE_BITFILLS || defined(__DOXYGEN__) #if GDISP_HARDWARE_BITFILLS || defined(__DOXYGEN__)
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 endx, endy; coord_t endx, endy;
unsigned lg; unsigned lg;
@ -376,7 +376,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if (GDISP_NEED_PIXELREAD && GDISP_HARDWARE_PIXELREAD) || defined(__DOXYGEN__) #if (GDISP_NEED_PIXELREAD && GDISP_HARDWARE_PIXELREAD) || defined(__DOXYGEN__)
color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
color_t color; color_t color;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@ -396,7 +396,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if (GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL) || defined(__DOXYGEN__) #if (GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL) || defined(__DOXYGEN__)
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)]; static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)];
coord_t row0, row1; coord_t row0, row1;
unsigned i, gap, abslines; unsigned i, gap, abslines;
@ -449,7 +449,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif #endif
#if (GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL) || defined(__DOXYGEN__) #if (GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL) || defined(__DOXYGEN__)
void GDISP_LLD(control)(unsigned what, void *value) { void lld_gdisp_control(unsigned what, void *value) {
switch(what) { switch(what) {
case GDISP_CONTROL_POWER: case GDISP_CONTROL_POWER:
if(GDISP.Powermode == (gdisp_powermode_t)value) if(GDISP.Powermode == (gdisp_powermode_t)value)
@ -461,7 +461,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0011, 0x0000); lld_lcdWriteReg(0x0011, 0x0000);
lld_lcdWriteReg(0x0012, 0x0000); lld_lcdWriteReg(0x0012, 0x0000);
lld_lcdWriteReg(0x0013, 0x0000); lld_lcdWriteReg(0x0013, 0x0000);
GDISP_LLD(set_backlight)(0); lld_gdisp_backlight(0);
break; break;
case powerOn: case powerOn:
@ -480,9 +480,9 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0029, 0x0009); /* VCM[4:0] for VCOMH */ lld_lcdWriteReg(0x0029, 0x0009); /* VCM[4:0] for VCOMH */
lld_lcdDelay(500); lld_lcdDelay(500);
lld_lcdWriteReg(0x0007, 0x0173); /* 262K color and display ON */ lld_lcdWriteReg(0x0007, 0x0173); /* 262K color and display ON */
GDISP_LLD(set_backlight)(GDISP.Backlight); lld_gdisp_backlight(GDISP.Backlight);
if(GDISP.Powermode != powerSleep || GDISP.Powermode != powerDeepSleep) if(GDISP.Powermode != powerSleep || GDISP.Powermode != powerDeepSleep)
GDISP_LLD(init)(); lld_gdisp_init();
break; break;
case powerSleep: case powerSleep:
@ -493,7 +493,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */ lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */ lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
lld_lcdWriteReg(0x0010, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ lld_lcdWriteReg(0x0010, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
GDISP_LLD(set_backlight)(0); lld_gdisp_backlight(0);
break; break;
case powerDeepSleep: case powerDeepSleep:
@ -504,7 +504,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */ lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */ lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
lld_lcdWriteReg(0x0010, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ lld_lcdWriteReg(0x0010, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
GDISP_LLD(set_backlight)(0); lld_gdisp_backlight(0);
break; break;
default: default:
@ -564,7 +564,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
case GDISP_CONTROL_BACKLIGHT: case GDISP_CONTROL_BACKLIGHT:
if((unsigned)value > 100) value = (void *)100; if((unsigned)value > 100) value = (void *)100;
GDISP_LLD(set_backlight)((unsigned)value); lld_gdisp_backlight((unsigned)value);
GDISP.Backlight = (unsigned)value; GDISP.Backlight = (unsigned)value;
break; break;

View File

@ -29,28 +29,28 @@
#ifndef GDISP_LLD_BOARD_H #ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H #define GDISP_LLD_BOARD_H
static __inline void GDISP_LLD(init_board)(void) { static __inline void lld_gdisp_init_board(void) {
#error "ILI9325: You must implement the init_board routine for your board" #error "ILI9325: You must implement the init_board routine for your board"
} }
static __inline void GDISP_LLD(setpin_reset)(bool_t state) { static __inline void lld_gdisp_reset_pin(bool_t state) {
#error "ILI9325: You must implement setpin_reset routine for your board" #error "ILI9325: You must implement setpin_reset routine for your board"
} }
static __inline void GDISP_LLD(write_index)(uint16_t data) { static __inline void lld_gdisp_write_index(uint16_t data) {
#error "ILI9325: You must implement write_index routine for your board" #error "ILI9325: You must implement write_index routine for your board"
} }
static __inline void GDISP_LLD(write_data)(uint16_t data) { static __inline void lld_gdisp_write_data(uint16_t data) {
#error "ILI9325: You must implement write_data routine for your board" #error "ILI9325: You must implement write_data routine for your board"
} }
static __inline uint16_t GDISP_LLD(read_data)(void) { static __inline uint16_t lld_gdisp_read_data(void) {
#error "ILI9325: You must implement read_data routine for your board" #error "ILI9325: You must implement read_data routine for your board"
} }
/* if not available, just ignore the argument and return */ /* if not available, just ignore the argument and return */
static __inline uint16_t GDISP_LLD(set_backlight)(uint8_t percentage) { static __inline uint16_t lld_gdisp_backlight(uint8_t percentage) {
#error "ILI9325: You must implement set_backlight routine for your board" #error "ILI9325: You must implement set_backlight routine for your board"
} }

View File

@ -45,7 +45,7 @@
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ #define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */ #define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
static __inline void GDISP_LLD(init_board)(void) { static __inline void lld_gdisp_init_board(void) {
/* FSMC setup for F1 */ /* FSMC setup for F1 */
rccEnableAHB(RCC_AHBENR_FSMCEN, 0); rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
@ -68,26 +68,26 @@ static __inline void GDISP_LLD(init_board)(void) {
} }
static __inline void GDISP_LLD(setpin_reset)(bool_t state) { static __inline void lld_gdisp_reset_pin(bool_t state) {
if(state) if(state)
palClearPad(GPIOE, GPIOE_TFT_RST); palClearPad(GPIOE, GPIOE_TFT_RST);
else else
palSetPad(GPIOE, GPIOE_TFT_RST); palSetPad(GPIOE, GPIOE_TFT_RST);
} }
static __inline void GDISP_LLD(write_index)(uint16_t reg) { static __inline void lld_gdisp_write_index(uint16_t reg) {
GDISP_REG = reg; GDISP_REG = reg;
} }
static __inline void GDISP_LLD(write_data)(uint16_t data) { static __inline void lld_gdisp_write_data(uint16_t data) {
GDISP_RAM = data; GDISP_RAM = data;
} }
static __inline uint16_t GDISP_LLD(read_data)(void) { static __inline uint16_t lld_gdisp_read_data(void) {
return GDISP_RAM; return GDISP_RAM;
} }
static __inline void GDISP_LLD(set_backlight)(uint8_t percent) { static __inline void lld_gdisp_backlight(uint8_t percent) {
percent=percent; // avoid a warning percent=percent; // avoid a warning
} }

View File

@ -36,7 +36,6 @@
/*===========================================================================*/ /*===========================================================================*/
#define GDISP_DRIVER_NAME "ILI9325" #define GDISP_DRIVER_NAME "ILI9325"
#define GDISP_LLD(x) gdisp_lld_##x##_ILI9325
#define GDISP_HARDWARE_CLEARS TRUE #define GDISP_HARDWARE_CLEARS TRUE
#define GDISP_HARDWARE_FILLS TRUE #define GDISP_HARDWARE_FILLS TRUE

View File

@ -113,7 +113,7 @@ static __inline void setviewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
* *
* @notapi * @notapi
*/ */
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
/* Initialise your display */ /* Initialise your display */
init_board(); init_board();
@ -219,7 +219,7 @@ bool_t GDISP_LLD(init)(void) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return; if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
#endif #endif
@ -241,7 +241,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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) {
unsigned i, tuples; unsigned i, tuples;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@ -276,7 +276,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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 endx, endy, lg; coord_t endx, endy, lg;
color_t c1, c2; color_t c1, c2;
#if GDISP_PACKED_PIXELS #if GDISP_PACKED_PIXELS
@ -386,7 +386,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
/* NOT IMPLEMENTED */ /* NOT IMPLEMENTED */
/* Some board hardware might support this in the future. /* Some board hardware might support this in the future.
* The Olimex board doesn't. * The Olimex board doesn't.
@ -407,7 +407,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
/* NOT IMPLEMENTED */ /* NOT IMPLEMENTED */
/* The hardware seems capable of doing this. /* The hardware seems capable of doing this.
* It is just really complex so we leave it out for now. * It is just really complex so we leave it out for now.
@ -435,7 +435,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(control)(unsigned what, void *value) { void lld_gdisp_control(unsigned what, void *value) {
/* The hardware is capable of supporting... /* The hardware is capable of supporting...
* GDISP_CONTROL_POWER - not implemented yet * GDISP_CONTROL_POWER - not implemented yet
* GDISP_CONTROL_ORIENTATION - not implemented yet * GDISP_CONTROL_ORIENTATION - not implemented yet
@ -456,7 +456,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
// Code here // Code here
/* You may need this --- /* You may need this ---
* if (GDISP.Powermode != powerSleep) * if (GDISP.Powermode != powerSleep)
* GDISP_LLD(init)(); * lld_gdisp_init();
*/ */
break; break;
case powerSleep: case powerSleep:

View File

@ -36,7 +36,6 @@
/*===========================================================================*/ /*===========================================================================*/
#define GDISP_DRIVER_NAME "Nokia6610GE12" #define GDISP_DRIVER_NAME "Nokia6610GE12"
#define GDISP_LLD(x) gdisp_lld_##x##_Nokia6610GE12
#define GDISP_HARDWARE_FILLS TRUE #define GDISP_HARDWARE_FILLS TRUE
#define GDISP_HARDWARE_BITFILLS TRUE #define GDISP_HARDWARE_BITFILLS TRUE

View File

@ -112,7 +112,7 @@ static __inline void setviewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
* *
* @notapi * @notapi
*/ */
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
/* Initialise your display */ /* Initialise your display */
init_board(); init_board();
@ -174,7 +174,7 @@ bool_t GDISP_LLD(init)(void) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return; if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
#endif #endif
@ -196,7 +196,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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) {
unsigned i, tuples; unsigned i, tuples;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@ -231,7 +231,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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 endx, endy, lg; coord_t endx, endy, lg;
color_t c1, c2; color_t c1, c2;
#if GDISP_PACKED_PIXELS #if GDISP_PACKED_PIXELS
@ -341,7 +341,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
/* NOT IMPLEMENTED */ /* NOT IMPLEMENTED */
/* Some board hardware might support this in the future. /* Some board hardware might support this in the future.
* The Olimex board doesn't. * The Olimex board doesn't.
@ -362,7 +362,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
/* NOT IMPLEMENTED */ /* NOT IMPLEMENTED */
/* The hardware seems capable of doing this. /* The hardware seems capable of doing this.
* It is just really complex so we leave it out for now. * It is just really complex so we leave it out for now.
@ -390,7 +390,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(control)(unsigned what, void *value) { void lld_gdisp_control(unsigned what, void *value) {
/* The hardware is capable of supporting... /* The hardware is capable of supporting...
* GDISP_CONTROL_POWER - not implemented yet * GDISP_CONTROL_POWER - not implemented yet
* GDISP_CONTROL_ORIENTATION - not implemented yet * GDISP_CONTROL_ORIENTATION - not implemented yet
@ -411,7 +411,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
// Code here // Code here
/* You may need this --- /* You may need this ---
* if (GDISP.Powermode != powerSleep) * if (GDISP.Powermode != powerSleep)
* GDISP_LLD(init)(); * lld_gdisp_init();
*/ */
break; break;
case powerSleep: case powerSleep:

View File

@ -36,7 +36,6 @@
/*===========================================================================*/ /*===========================================================================*/
#define GDISP_DRIVER_NAME "Nokia6610GE8" #define GDISP_DRIVER_NAME "Nokia6610GE8"
#define GDISP_LLD(x) gdisp_lld_##x##_Nokia6610GE8
#define GDISP_HARDWARE_FILLS TRUE #define GDISP_HARDWARE_FILLS TRUE
#define GDISP_HARDWARE_BITFILLS TRUE #define GDISP_HARDWARE_BITFILLS TRUE

View File

@ -150,7 +150,7 @@ static __inline void reset_viewport(void) {
} }
} }
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
/* initialize the hardware */ /* initialize the hardware */
init_board(); init_board();
@ -255,7 +255,7 @@ bool_t GDISP_LLD(init)(void) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return; if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
#endif #endif
@ -277,7 +277,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(clear)(color_t color) { void lld_gdisp_clear(color_t color) {
unsigned i; unsigned i;
acquire_bus(); acquire_bus();
@ -303,7 +303,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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) {
unsigned i, area; unsigned i, area;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@ -339,7 +339,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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 endx, endy; coord_t endx, endy;
unsigned lg; unsigned lg;
@ -379,7 +379,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
/* This routine is marked "DO NOT USE" in the original /* This routine is marked "DO NOT USE" in the original
* GLCD driver. We just keep our GDISP_HARDWARE_READPIXEL * GLCD driver. We just keep our GDISP_HARDWARE_READPIXEL
* turned off for now. * turned off for now.
@ -418,7 +418,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
/* This is marked as "TODO: Test this" in the original GLCD driver. /* This is marked as "TODO: Test this" in the original GLCD driver.
* For now we just leave the GDISP_HARDWARE_SCROLL off. * For now we just leave the GDISP_HARDWARE_SCROLL off.
*/ */
@ -495,7 +495,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(control)(unsigned what, void *value) { void lld_gdisp_control(unsigned what, void *value) {
switch(what) { switch(what) {
case GDISP_CONTROL_POWER: case GDISP_CONTROL_POWER:
if (GDISP.Powermode == (gdisp_powermode_t)value) if (GDISP.Powermode == (gdisp_powermode_t)value)
@ -508,7 +508,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
/* Code here */ /* Code here */
/* You may need this --- /* You may need this ---
if (GDISP.Powermode != powerSleep) if (GDISP.Powermode != powerSleep)
GDISP_LLD(init(); lld_gdisp_init();
*/ */
/* break; */ /* break; */
case powerSleep: case powerSleep:

View File

@ -36,7 +36,6 @@
/*===========================================================================*/ /*===========================================================================*/
#define GDISP_DRIVER_NAME "S6D1121" #define GDISP_DRIVER_NAME "S6D1121"
#define GDISP_LLD(x) gdisp_lld_##x##_S6D1121
#define GDISP_HARDWARE_CLEARS TRUE #define GDISP_HARDWARE_CLEARS TRUE
#define GDISP_HARDWARE_FILLS TRUE #define GDISP_HARDWARE_FILLS TRUE

View File

@ -157,7 +157,7 @@ static __inline void reset_viewport(void) {
* *
* @notapi * @notapi
*/ */
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
/* Initialise your display */ /* Initialise your display */
init_board(); init_board();
@ -243,7 +243,7 @@ bool_t GDISP_LLD(init)(void) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return; if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
#endif #endif
@ -280,7 +280,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(clear)(color_t color) { void lld_gdisp_clear(color_t color) {
unsigned i; unsigned i;
acquire_bus(); acquire_bus();
@ -305,7 +305,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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) {
unsigned i, area; unsigned i, area;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@ -341,7 +341,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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 endx, endy; coord_t endx, endy;
unsigned lg; unsigned lg;
@ -380,7 +380,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
color_t color; color_t color;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@ -413,7 +413,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)]; static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)];
coord_t row0, row1; coord_t row0, row1;
unsigned i, gap, abslines, j; unsigned i, gap, abslines, j;
@ -489,7 +489,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(control)(unsigned what, void *value) { void lld_gdisp_control(unsigned what, void *value) {
switch(what) { switch(what) {
case GDISP_CONTROL_POWER: case GDISP_CONTROL_POWER:
if (GDISP.Powermode == (gdisp_powermode_t)value) if (GDISP.Powermode == (gdisp_powermode_t)value)
@ -508,7 +508,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
write_reg(0x0010, 0x0000); // leave sleep mode write_reg(0x0010, 0x0000); // leave sleep mode
release_bus(); release_bus();
if (GDISP.Powermode != powerSleep) if (GDISP.Powermode != powerSleep)
GDISP_LLD(init)(); lld_gdisp_init();
break; break;
case powerSleep: case powerSleep:
acquire_bus(); acquire_bus();

View File

@ -36,7 +36,6 @@
/*===========================================================================*/ /*===========================================================================*/
#define GDISP_DRIVER_NAME "SSD1289" #define GDISP_DRIVER_NAME "SSD1289"
#define GDISP_LLD(x) gdisp_lld_##x##_SSD1289
#define GDISP_HARDWARE_CLEARS TRUE #define GDISP_HARDWARE_CLEARS TRUE
#define GDISP_HARDWARE_FILLS TRUE #define GDISP_HARDWARE_FILLS TRUE

View File

@ -187,7 +187,7 @@ __inline void GDISP_LLD(readstream)(uint16_t *buffer, size_t size) {
* *
* @notapi * @notapi
*/ */
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
/* Initialise the display */ /* Initialise the display */
#if defined(GDISP_USE_FSMC) #if defined(GDISP_USE_FSMC)
@ -358,7 +358,7 @@ void GDISP_LLD(setwindow)(coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return; if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
#endif #endif
@ -381,7 +381,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; } if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
@ -430,7 +430,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; srcx += GDISP.clipx0 - x; x = GDISP.clipx0; } if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; srcx += GDISP.clipx0 - x; x = GDISP.clipx0; }
@ -486,7 +486,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; } if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; } if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
@ -535,7 +535,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(control)(unsigned what, void *value) { void lld_gdisp_control(unsigned what, void *value) {
/* NOT IMPLEMENTED YET */ /* NOT IMPLEMENTED YET */
switch(what) { switch(what) {
case GDISP_CONTROL_POWER: case GDISP_CONTROL_POWER:
@ -552,7 +552,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
GDISP_LLD(readreg)(0x0000); chThdSleepMicroseconds(5000); // 2x Dummy reads to wake up from deep sleep GDISP_LLD(readreg)(0x0000); chThdSleepMicroseconds(5000); // 2x Dummy reads to wake up from deep sleep
GDISP_LLD(readreg)(0x0000); chThdSleepMicroseconds(5000); GDISP_LLD(readreg)(0x0000); chThdSleepMicroseconds(5000);
if (GDISP.Powermode != powerSleep) if (GDISP.Powermode != powerSleep)
GDISP_LLD(init)(); lld_gdisp_init();
GDISP_LLD(writeindex)(SSD1963_SET_DISPLAY_ON); GDISP_LLD(writeindex)(SSD1963_SET_DISPLAY_ON);
break; break;

View File

@ -53,7 +53,7 @@
* *
* @notapi * @notapi
*/ */
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
/* Initialise the GDISP structure */ /* Initialise the GDISP structure */
GDISP.Width = GDISP_SCREEN_WIDTH; GDISP.Width = GDISP_SCREEN_WIDTH;
GDISP.Height = GDISP_SCREEN_HEIGHT; GDISP.Height = GDISP_SCREEN_HEIGHT;
@ -79,7 +79,7 @@ bool_t GDISP_LLD(init)(void) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
(void)x; (void)x;
(void)y; (void)y;
(void)color; (void)color;
@ -97,7 +97,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
(void)x; (void)x;
(void)y; (void)y;
@ -119,7 +119,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
(void)x; (void)x;
(void)y; (void)y;
(void)cx; (void)cx;

View File

@ -36,7 +36,6 @@
/*===========================================================================*/ /*===========================================================================*/
#define GDISP_DRIVER_NAME "TestStub" #define GDISP_DRIVER_NAME "TestStub"
#define GDISP_LLD(x) gdisp_lld_##x##_TestStub
#define GDISP_HARDWARE_SCROLL GDISP_NEED_SCROLL #define GDISP_HARDWARE_SCROLL GDISP_NEED_SCROLL
#define GDISP_HARDWARE_PIXELREAD GDISP_NEED_PIXELREAD #define GDISP_HARDWARE_PIXELREAD GDISP_NEED_PIXELREAD

View File

@ -1,271 +0,0 @@
/*
ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
ChibiOS/GFX is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/GFX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file drivers/gdisp/VMT/gdisp_lld.c
* @brief GDISP Graphics Driver subsystem low level driver source for VMT.
*
* @addtogroup GDISP
* @{
*/
#include "ch.h"
#include "hal.h"
#include "gfx.h"
#if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/
#define GDISP_LLD_NO_STRUCT
/* Include the emulation code for things we don't support */
#include "gdisp/lld/emulation.c"
/*===========================================================================*/
/* Driver local definitions. */
/*===========================================================================*/
#define GDISP_LLD1(x) GDISP_VMT_NAME1(gdisp_lld_##x##_)
#define GDISP_LLD2(x) GDISP_VMT_NAME2(gdisp_lld_##x##_)
/* Prototypes for lld driver functions */
bool_t GDISP_LLD1(init)(void);
void *GDISP_LLD1(query)(unsigned what);
void GDISP_LLD1(clear)(color_t color);
void GDISP_LLD1(drawpixel)(coord_t x, coord_t y, color_t color);
void GDISP_LLD1(fillarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
void GDISP_LLD1(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 GDISP_LLD1(drawline)(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
#if GDISP_NEED_CLIP
void GDISP_LLD1(setclip)(coord_t x, coord_t y, coord_t cx, coord_t cy);
#endif
#if GDISP_NEED_CIRCLE
void GDISP_LLD1(drawcircle)(coord_t x, coord_t y, coord_t radius, color_t color);
void GDISP_LLD1(fillcircle)(coord_t x, coord_t y, coord_t radius, color_t color);
#endif
#if GDISP_NEED_ELLIPSE
void GDISP_LLD1(drawellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
void GDISP_LLD1(fillellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
#endif
#if GDISP_NEED_ARC
void GDISP_LLD1(drawarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
void GDISP_LLD1(fillarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
#endif
#if GDISP_NEED_TEXT
void GDISP_LLD1(drawchar)(coord_t x, coord_t y, char c, font_t font, color_t color);
void GDISP_LLD1(fillchar)(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor);
#endif
#if GDISP_NEED_PIXELREAD
color_t GDISP_LLD1(getpixelcolor)(coord_t x, coord_t y);
#endif
#if GDISP_NEED_SCROLL
void GDISP_LLD1(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor);
#endif
#if GDISP_NEED_CONTROL
void GDISP_LLD1(control)(unsigned what, void *value);
#endif
bool_t GDISP_LLD2(init)(void);
void *GDISP_LLD2(query)(unsigned what);
void GDISP_LLD2(clear)(color_t color);
void GDISP_LLD2(drawpixel)(coord_t x, coord_t y, color_t color);
void GDISP_LLD2(fillarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
void GDISP_LLD2(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 GDISP_LLD2(drawline)(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
#if GDISP_NEED_CLIP
void GDISP_LLD2(setclip)(coord_t x, coord_t y, coord_t cx, coord_t cy);
#endif
#if GDISP_NEED_CIRCLE
void GDISP_LLD2(drawcircle)(coord_t x, coord_t y, coord_t radius, color_t color);
void GDISP_LLD2(fillcircle)(coord_t x, coord_t y, coord_t radius, color_t color);
#endif
#if GDISP_NEED_ELLIPSE
void GDISP_LLD2(drawellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
void GDISP_LLD2(fillellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
#endif
#if GDISP_NEED_ARC
void GDISP_LLD2(drawarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
void GDISP_LLD2(fillarc)(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
#endif
#if GDISP_NEED_TEXT
void GDISP_LLD2(drawchar)(coord_t x, coord_t y, char c, font_t font, color_t color);
void GDISP_LLD2(fillchar)(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor);
#endif
#if GDISP_NEED_PIXELREAD
color_t GDISP_LLD2(getpixelcolor)(coord_t x, coord_t y);
#endif
#if GDISP_NEED_SCROLL
void GDISP_LLD2(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor);
#endif
#if GDISP_NEED_CONTROL
void GDISP_LLD2(control)(unsigned what, void *value);
#endif
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
/* Our VMT table variables */
void *GDISP_LLD_VMT(query)(unsigned what);
void GDISP_LLD_VMT(clear)(color_t color);
void GDISP_LLD_VMT(drawpixel)(coord_t x, coord_t y, color_t color);
void GDISP_LLD_VMT(fillarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
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);
void GDISP_LLD_VMT(drawline)(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
#if GDISP_NEED_CIRCLE
void GDISP_LLD_VMT(drawcircle)(coord_t x, coord_t y, coord_t radius, color_t color);
void GDISP_LLD_VMT(fillcircle)(coord_t x, coord_t y, coord_t radius, color_t color);
#endif
#if GDISP_NEED_ELLIPSE
void GDISP_LLD_VMT(drawellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
void GDISP_LLD_VMT(fillellipse)(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
#endif
/* Text Rendering Functions */
#if GDISP_NEED_TEXT
void GDISP_LLD_VMT(drawchar)(coord_t x, coord_t y, char c, font_t font, color_t color);
void GDISP_LLD_VMT(fillchar)(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor);
#endif
/* Pixel readback */
#if GDISP_NEED_PIXELREAD
color_t GDISP_LLD_VMT(getpixelcolor)(coord_t x, coord_t y);
#endif
/* Scrolling Function - clears the area scrolled out */
#if GDISP_NEED_SCROLL
void GDISP_LLD_VMT(verticalscroll)(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
void GDISP_LLD_VMT(control)(unsigned what, void *value);
#endif
/* Clipping Functions */
#if GDISP_NEED_CLIP
void GDISP_LLD_VMT(setclip)(coord_t x, coord_t y, coord_t cx, coord_t cy);
#endif
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
bool_t gdisp_lld_init_VMT(void) {
if (GDISP_VMT_NAME1(gdisp_lld_init_)()) {
gdisp_lld_query_VMT = GDISP_VMT_NAME1(gdisp_lld_query_);
gdisp_lld_clear_VMT = GDISP_VMT_NAME1(gdisp_lld_clear_);
gdisp_lld_drawpixel_VMT = GDISP_VMT_NAME1(gdisp_lld_drawpixel_);
gdisp_lld_fillarea_VMT = GDISP_VMT_NAME1(gdisp_lld_fillarea_);
gdisp_lld_blitareaex_VMT = GDISP_VMT_NAME1(gdisp_lld_blitareaex_);
gdisp_lld_drawline_VMT = GDISP_VMT_NAME1(gdisp_lld_drawline_);
#if GDISP_NEED_CIRCLE
gdisp_lld_drawcircle_VMT = GDISP_VMT_NAME1(gdisp_lld_drawcircle_);
gdisp_lld_fillcircle_VMT = GDISP_VMT_NAME1(gdisp_lld_fillcircle_);
#endif
#if GDISP_NEED_ELLIPSE
gdisp_lld_drawellipse_VMT = GDISP_VMT_NAME1(gdisp_lld_drawellipse_);
gdisp_lld_fillellipse_VMT = GDISP_VMT_NAME1(gdisp_lld_fillellipse_);
#endif
#if GDISP_NEED_ARC
gdisp_lld_drawarc_VMT = GDISP_VMT_NAME1(gdisp_lld_drawarc_);
gdisp_lld_fillarc_VMT = GDISP_VMT_NAME1(gdisp_lld_fillarc_);
#endif
#if GDISP_NEED_TEXT
gdisp_lld_drawchar_VMT = GDISP_VMT_NAME1(gdisp_lld_drawchar_);
gdisp_lld_fillchar_VMT = GDISP_VMT_NAME1(gdisp_lld_fillchar_);
#endif
#if GDISP_NEED_PIXELREAD
gdisp_lld_getpixelcolor_VMT = GDISP_VMT_NAME1(gdisp_lld_pixelread_);
#endif
#if GDISP_NEED_SCROLL
gdisp_lld_verticalscroll_VMT = GDISP_VMT_NAME1(gdisp_lld_scroll_);
#endif
#if GDISP_NEED_CONTROL
gdisp_lld_control_VMT = GDISP_VMT_NAME1(gdisp_lld_control_);
#endif
#if GDISP_NEED_CLIP
gdisp_lld_setclip_VMT = GDISP_VMT_NAME1(gdisp_lld_setclip_);
#endif
return TRUE;
}
if (GDISP_VMT_NAME2(gdisp_lld_init_)()) {
gdisp_lld_query_VMT = GDISP_VMT_NAME2(gdisp_lld_query_);
gdisp_lld_clear_VMT = GDISP_VMT_NAME2(gdisp_lld_clear_);
gdisp_lld_drawpixel_VMT = GDISP_VMT_NAME2(gdisp_lld_drawpixel_);
gdisp_lld_fillarea_VMT = GDISP_VMT_NAME2(gdisp_lld_fillarea_);
gdisp_lld_blitareaex_VMT = GDISP_VMT_NAME2(gdisp_lld_blitareaex_);
gdisp_lld_drawline_VMT = GDISP_VMT_NAME2(gdisp_lld_drawline_);
#if GDISP_NEED_CIRCLE
gdisp_lld_drawcircle_VMT = GDISP_VMT_NAME2(gdisp_lld_drawcircle_);
gdisp_lld_fillcircle_VMT = GDISP_VMT_NAME2(gdisp_lld_fillcircle_);
#endif
#if GDISP_NEED_ELLIPSE
gdisp_lld_drawellipse_VMT = GDISP_VMT_NAME2(gdisp_lld_drawellipse_);
gdisp_lld_fillellipse_VMT = GDISP_VMT_NAME2(gdisp_lld_fillellipse_);
#endif
#if GDISP_NEED_ARC
gdisp_lld_drawarc_VMT = GDISP_VMT_NAME2(gdisp_lld_drawarc_);
gdisp_lld_fillarc_VMT = GDISP_VMT_NAME2(gdisp_lld_fillarc_);
#endif
#if GDISP_NEED_TEXT
gdisp_lld_drawchar_VMT = GDISP_VMT_NAME2(gdisp_lld_drawchar_);
gdisp_lld_fillchar_VMT = GDISP_VMT_NAME2(gdisp_lld_fillchar_);
#endif
#if GDISP_NEED_PIXELREAD
gdisp_lld_getpixelcolor_VMT = GDISP_VMT_NAME2(gdisp_lld_pixelread_);
#endif
#if GDISP_NEED_SCROLL
gdisp_lld_verticalscroll_VMT = GDISP_VMT_NAME2(gdisp_lld_scroll_);
#endif
#if GDISP_NEED_CONTROL
gdisp_lld_control_VMT = GDISP_VMT_NAME2(gdisp_lld_control_);
#endif
#if GDISP_NEED_CLIP
gdisp_lld_setclip_VMT = GDISP_VMT_NAME2(gdisp_lld_setclip_);
#endif
return TRUE;
}
return FALSE;
}
#endif /* GFX_USE_GDISP */
/** @} */

View File

@ -1,7 +0,0 @@
# List the required driver.
GFXSRC += $(GFXLIB)/drivers/gdisp/VMT/gdisp_lld.c \
$(GFXLIB)/drivers/gdisp/VMT/gdisp_lld_driver1.c \
$(GFXLIB)//drivers/gdisp/VMT/gdisp_lld_driver2.c
# Required include directories
GFXINC += $(GFXLIB)/drivers/gdisp/VMT

View File

@ -1,71 +0,0 @@
/*
ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
ChibiOS/GFX is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/GFX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file drivers/gdisp/VMT/gdisp_lld_config.h
* @brief GDISP Graphic Driver subsystem low level driver header template.
*
* @addtogroup GDISP
* @{
*/
#ifndef _GDISP_LLD_CONFIG_H
#define _GDISP_LLD_CONFIG_H
#if GFX_USE_GDISP
/*===========================================================================*/
/* Driver hardware support. */
/*===========================================================================*/
#define GDISP_DRIVER_NAME "VMT"
#define GDISP_LLD(x) gdisp_lld_##x##_VMT
#define GDISP_LLD_VMT(x) (*GDISP_LLD(x))
#define GDISP_HARDWARE_LINES TRUE
#define GDISP_HARDWARE_CLEARS TRUE
#define GDISP_HARDWARE_FILLS TRUE
#define GDISP_HARDWARE_BITFILLS TRUE
#define GDISP_HARDWARE_CIRCLES TRUE
#define GDISP_HARDWARE_CIRCLEFILLS TRUE
#define GDISP_HARDWARE_ELLIPSES TRUE
#define GDISP_HARDWARE_ELLIPSEFILLS TRUE
#define GDISP_HARDWARE_ARCS TRUE
#define GDISP_HARDWARE_ARCFILLS TRUE
#define GDISP_HARDWARE_TEXT TRUE
#define GDISP_HARDWARE_TEXTFILLS TRUE
#define GDISP_HARDWARE_SCROLL TRUE
#define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE
#define GDISP_HARDWARE_QUERY TRUE
#define GDISP_HARDWARE_CLIP TRUE
#define GDISP_SOFTWARE_TEXTFILLDRAW FALSE
#define GDISP_SOFTWARE_TEXTBLITCOLUMN FALSE
#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB565
#define GDISP_PACKED_PIXELS FALSE
#define GDISP_PACKED_LINES FALSE
#endif /* GFX_USE_GDISP */
#endif /* _GDISP_LLD_CONFIG_H */
/** @} */

View File

@ -1,52 +0,0 @@
/*
ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
ChibiOS/GFX is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/GFX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file drivers/gdisp/VMT/gdisp_lld_driver1.c
* @brief GDISP Graphics Driver subsystem low level driver source for VMT.
*
* @addtogroup GDISP
* @{
*/
#include "ch.h"
#include "hal.h"
#if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/
#define CONFIGFILE() <../GDISP_VMT_NAME1()/gdisp_lld_config.h>
#define DRIVERFILE() <../GDISP_VMT_NAME1()/gdisp_lld.c>
/* We don't need these in our VMT referenced driver */
#undef GDISP_NEED_MSGAPI
#define GDISP_NEED_MSGAPI FALSE
/* Include the specific config file we want */
#include CONFIGFILE()
/* Bring in our API */
#include "gfx.h"
/* Add the low level driver */
#include DRIVERFILE()
#endif /* GFX_USE_GDISP */
/** @} */

View File

@ -1,52 +0,0 @@
/*
ChibiOS/GFX - Copyright (C) 2012
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
ChibiOS/GFX is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/GFX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file drivers/gdisp/VMT/gdisp_lld_driver2.c
* @brief GDISP Graphics Driver subsystem low level driver source for VMT.
*
* @addtogroup GDISP
* @{
*/
#include "ch.h"
#include "hal.h"
#if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/
#define CONFIGFILE() <../GDISP_VMT_NAME2()/gdisp_lld_config.h>
#define DRIVERFILE() <../GDISP_VMT_NAME2()/gdisp_lld.c>
/* We don't need these in our VMT referenced driver */
#undef GDISP_NEED_MSGAPI
#define GDISP_NEED_MSGAPI FALSE
/* Include the specific config file we want */
#include CONFIGFILE()
/* Bring in our API */
#include "gfx.h"
/* Add the low level driver */
#include DRIVERFILE()
#endif /* GFX_USE_GDISP */
/** @} */

View File

@ -1,23 +0,0 @@
This driver enables you to have two underlying drivers handling different hardware.
A choice is made at run-time of which driver to call based on which driver succeeds
to initialise first (init returns TRUE).
To use this driver:
1. Add in your halconf.h:
a) #define GFX_USE_GDISP TRUE
b) Any optional high level driver defines (see gdisp.h) eg: GDISP_NEED_MULTITHREAD
c) Define these:
#define GDISP_VMT_NAME1(x) x##YourDriver1
#define GDISP_VMT_NAME2(x) x##YourDriver2
Note YourDriver1 & 2 are the basenames of the directories containing the driver.
Note that both drivers must be the same pixel format which is
GDISP_PIXELFORMAT_RGB565 by default. Alter gdispVMT/gdisp_lld_config.h if your
pixel format is different on both drivers.
d) Any driver specific defines. If both drivers use the same defines then they must
accept the same values for the define.
2. To your makefile add the following lines:
include $(CHIBIOS)/os/halext/halext.mk
include $(CHIBIOS)/os/halext/drivers/gdispVMT/gdisp_lld.mk

View File

@ -314,7 +314,7 @@ static DWORD WINAPI WindowThread(LPVOID lpParameter) {
* *
* @notapi * @notapi
*/ */
bool_t GDISP_LLD(init)(void) { bool_t lld_gdisp_init(void) {
RECT rect; RECT rect;
/* Set the window dimensions */ /* Set the window dimensions */
@ -356,7 +356,7 @@ bool_t GDISP_LLD(init)(void) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
HDC dc; HDC dc;
#if WIN32_USE_MSG_REDRAW #if WIN32_USE_MSG_REDRAW
RECT rect; RECT rect;
@ -422,7 +422,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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) {
POINT p; POINT p;
HPEN pen; HPEN pen;
HDC dc; HDC dc;
@ -550,7 +550,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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) {
HDC dc; HDC dc;
RECT rect; RECT rect;
HBRUSH hbr; HBRUSH hbr;
@ -681,7 +681,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
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) {
BITMAPV4HEADER bmpInfo; BITMAPV4HEADER bmpInfo;
RECT rect; RECT rect;
#if GDISP_NEED_CONTROL #if GDISP_NEED_CONTROL
@ -788,7 +788,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
color_t color; color_t color;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP #if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@ -834,7 +834,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
RECT rect, frect, srect; RECT rect, frect, srect;
HBRUSH hbr; HBRUSH hbr;
@ -958,7 +958,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
* *
* @notapi * @notapi
*/ */
void GDISP_LLD(control)(unsigned what, void *value) { void lld_gdisp_control(unsigned what, void *value) {
switch(what) { switch(what) {
case GDISP_CONTROL_ORIENTATION: case GDISP_CONTROL_ORIENTATION:
if (GDISP.Orientation == (gdisp_orientation_t)value) if (GDISP.Orientation == (gdisp_orientation_t)value)

View File

@ -36,7 +36,6 @@
/*===========================================================================*/ /*===========================================================================*/
#define GDISP_DRIVER_NAME "Win32" #define GDISP_DRIVER_NAME "Win32"
#define GDISP_LLD(x) gdisp_lld_##x##_Win32
#define GDISP_HARDWARE_LINES TRUE #define GDISP_HARDWARE_LINES TRUE
#define GDISP_HARDWARE_FILLS TRUE #define GDISP_HARDWARE_FILLS TRUE

View File

@ -1,105 +1,105 @@
/** /**
* This file has a different license to the rest of the GFX system. * This file has a different license to the rest of the GFX system.
* You can copy, modify and distribute this file as you see fit. * You can copy, modify and distribute this file as you see fit.
* You do not need to publish your source modifications to this file. * You do not need to publish your source modifications to this file.
* The only thing you are not permitted to do is to relicense it * The only thing you are not permitted to do is to relicense it
* under a different license. * under a different license.
*/ */
/** /**
* Copy this file into your project directory and rename it as gfxconf.h * Copy this file into your project directory and rename it as gfxconf.h
* Edit your copy to turn on the GFX features you want to use. * Edit your copy to turn on the GFX features you want to use.
*/ */
#ifndef _GFXCONF_H #ifndef _GFXCONF_H
#define _GFXCONF_H #define _GFXCONF_H
/* GFX subsystems to turn on */ /* GFX subsystems to turn on */
#define GFX_USE_GDISP FALSE #define GFX_USE_GDISP FALSE
#define GFX_USE_TDISP FALSE #define GFX_USE_TDISP FALSE
#define GFX_USE_GWIN FALSE #define GFX_USE_GWIN FALSE
#define GFX_USE_GEVENT FALSE #define GFX_USE_GEVENT FALSE
#define GFX_USE_GTIMER FALSE #define GFX_USE_GTIMER FALSE
#define GFX_USE_GINPUT FALSE #define GFX_USE_GINPUT FALSE
#define GFX_USE_GADC FALSE #define GFX_USE_GADC FALSE
#define GFX_USE_GAUDIN FALSE #define GFX_USE_GAUDIN FALSE
#define GFX_USE_GAUDOUT FALSE #define GFX_USE_GAUDOUT FALSE
#define GFX_USE_GMISC FALSE #define GFX_USE_GMISC FALSE
/* Features for the GDISP subsystem */ /* Features for the GDISP subsystem */
#define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_VALIDATION TRUE
#define GDISP_NEED_CLIP TRUE #define GDISP_NEED_CLIP TRUE
#define GDISP_NEED_TEXT TRUE #define GDISP_NEED_TEXT TRUE
#define GDISP_NEED_CIRCLE TRUE #define GDISP_NEED_CIRCLE TRUE
#define GDISP_NEED_ELLIPSE TRUE #define GDISP_NEED_ELLIPSE TRUE
#define GDISP_NEED_ARC FALSE #define GDISP_NEED_ARC FALSE
#define GDISP_NEED_SCROLL FALSE #define GDISP_NEED_SCROLL FALSE
#define GDISP_NEED_PIXELREAD FALSE #define GDISP_NEED_PIXELREAD FALSE
#define GDISP_NEED_CONTROL FALSE #define GDISP_NEED_CONTROL FALSE
#define GDISP_NEED_MULTITHREAD FALSE #define GDISP_NEED_MULTITHREAD FALSE
#define GDISP_NEED_ASYNC FALSE #define GDISP_NEED_ASYNC FALSE
#define GDISP_NEED_MSGAPI FALSE #define GDISP_NEED_MSGAPI FALSE
/* GDISP - builtin fonts */ /* GDISP - builtin fonts */
#define GDISP_OLD_FONT_DEFINITIONS FALSE #define GDISP_OLD_FONT_DEFINITIONS FALSE
#define GDISP_INCLUDE_FONT_SMALL TRUE #define GDISP_INCLUDE_FONT_SMALL TRUE
#define GDISP_INCLUDE_FONT_LARGER TRUE #define GDISP_INCLUDE_FONT_LARGER TRUE
#define GDISP_INCLUDE_FONT_UI1 TRUE #define GDISP_INCLUDE_FONT_UI1 TRUE
#define GDISP_INCLUDE_FONT_UI2 TRUE #define GDISP_INCLUDE_FONT_UI2 TRUE
#define GDISP_INCLUDE_FONT_LARGENUMBERS TRUE #define GDISP_INCLUDE_FONT_LARGENUMBERS TRUE
/* Features for the TDISP subsystem. */ /* Features for the TDISP subsystem. */
#define TDISP_NEED_MULTITHREAD FALSE #define TDISP_NEED_MULTITHREAD FALSE
/* Features for the GWIN subsystem. */ /* Features for the GWIN subsystem. */
#define GWIN_NEED_BUTTON FALSE #define GWIN_NEED_BUTTON FALSE
#define GWIN_NEED_CONSOLE FALSE #define GWIN_NEED_CONSOLE FALSE
#define GWIN_NEED_GRAPH FALSE #define GWIN_NEED_GRAPH FALSE
/* Features for the GEVENT subsystem. */ /* Features for the GEVENT subsystem. */
#define GEVENT_ASSERT_NO_RESOURCE FALSE #define GEVENT_ASSERT_NO_RESOURCE FALSE
/* Features for the GTIMER subsystem. */ /* Features for the GTIMER subsystem. */
/* NONE */ /* NONE */
/* Features for the GINPUT subsystem. */ /* Features for the GINPUT subsystem. */
#define GINPUT_NEED_MOUSE FALSE #define GINPUT_NEED_MOUSE FALSE
#define GINPUT_NEED_KEYBOARD FALSE #define GINPUT_NEED_KEYBOARD FALSE
#define GINPUT_NEED_TOGGLE FALSE #define GINPUT_NEED_TOGGLE FALSE
#define GINPUT_NEED_DIAL FALSE #define GINPUT_NEED_DIAL FALSE
/* Features for the GADC subsystem. */ /* Features for the GADC subsystem. */
/* NONE */ /* NONE */
/* Features for the GAUDIN subsystem. */ /* Features for the GAUDIN subsystem. */
/* NONE */ /* NONE */
/* Features for the GAUDOUT subsystem. */ /* Features for the GAUDOUT subsystem. */
/* NONE */ /* NONE */
/* Features for the GMISC subsystem. */ /* Features for the GMISC subsystem. */
#define GMISC_NEED_ARRAYOPS FALSE #define GMISC_NEED_ARRAYOPS FALSE
/* Optional Parameters for various subsystems */ /* Optional Parameters for various subsystems */
/* /*
#define GDISP_MAX_FONT_HEIGHT 16 #define GDISP_MAX_FONT_HEIGHT 16
#define GEVENT_MAXIMUM_SIZE 32 #define GEVENT_MAXIMUM_SIZE 32
#define GEVENT_MAX_SOURCE_LISTENERS 32 #define GEVENT_MAX_SOURCE_LISTENERS 32
#define GTIMER_THREAD_WORKAREA_SIZE 512 #define GTIMER_THREAD_WORKAREA_SIZE 512
#define GADC_MAX_LOWSPEED_DEVICES 4 #define GADC_MAX_LOWSPEED_DEVICES 4
*/ */
/* Optional Low Level Driver Definitions */ /* Optional Low Level Driver Definitions */
/* /*
#define GDISP_USE_CUSTOM_BOARD FALSE #define GDISP_USE_CUSTOM_BOARD FALSE
#define GDISP_SCREEN_WIDTH 320 #define GDISP_SCREEN_WIDTH 320
#define GDISP_SCREEN_HEIGHT 240 #define GDISP_SCREEN_HEIGHT 240
#define GDISP_USE_FSMC #define GDISP_USE_FSMC
#define GDISP_USE_GPIO #define GDISP_USE_GPIO
#define GDISP_VMT_NAME1(x) x##YourDriver1
#define GDISP_VMT_NAME2(x) x##YourDriver2 #define TDISP_COLUMNS 16
#define TDISP_COLUMNS 16 #define TDISP_ROWS 2
#define TDISP_ROWS 2 */
*/
#endif /* _GFXCONF_H */
#endif /* _GFXCONF_H */

View File

@ -201,26 +201,26 @@ extern "C" {
#else #else
/* The same as above but use the low level driver directly if no multi-thread support is needed */ /* 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 gdispIsBusy() FALSE
#define gdispClear(color) GDISP_LLD(clear)(color) #define gdispClear(color) lld_gdisp_clear(color)
#define gdispDrawPixel(x, y, color) GDISP_LLD(drawpixel)(x, y, color) #define gdispDrawPixel(x, y, color) lld_gdisp_draw_pixel(x, y, color)
#define gdispDrawLine(x0, y0, x1, y1, color) GDISP_LLD(drawline)(x0, y0, x1, y1, color) #define gdispDrawLine(x0, y0, x1, y1, color) lld_gdisp_draw_line(x0, y0, x1, y1, color)
#define gdispFillArea(x, y, cx, cy, color) GDISP_LLD(fillarea)(x, y, cx, cy, 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) GDISP_LLD(blitareaex)(x, y, cx, cy, sx, sy, scx, buf) #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) GDISP_LLD(setclip)(x, y, cx, cy) #define gdispSetClip(x, y, cx, cy) lld_gdisp_set_clip(x, y, cx, cy)
#define gdispDrawCircle(x, y, radius, color) GDISP_LLD(drawcircle)(x, y, radius, color) #define gdispDrawCircle(x, y, radius, color) lld_gdisp_draw_circle(x, y, radius, color)
#define gdispFillCircle(x, y, radius, color) GDISP_LLD(fillcircle)(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) GDISP_LLD(drawarc)(x, y, radius, sangle, eangle, 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) GDISP_LLD(fillarc)(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) GDISP_LLD(drawellipse)(x, y, a, b, color) #define gdispDrawEllipse(x, y, a, b, color) lld_gdisp_draw_ellipse(x, y, a, b, color)
#define gdispFillEllipse(x, y, a, b, color) GDISP_LLD(fillellipse)(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) GDISP_LLD(drawchar)(x, y, c, font, 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) GDISP_LLD(fillchar)(x, y, c, font, color, bgcolor) #define gdispFillChar(x, y, c, font, color, bgcolor) lld_gdisp_fill_char(x, y, c, font, color, bgcolor)
#define gdispGetPixelColor(x, y) GDISP_LLD(getpixelcolor)(x, y) #define gdispGetPixelColor(x, y) lld_gdisp_get_pixel_color(x, y)
#define gdispVerticalScroll(x, y, cx, cy, lines, bgcolor) GDISP_LLD(verticalscroll)(x, y, cx, cy, lines, bgcolor) #define gdispVerticalScroll(x, y, cx, cy, lines, bgcolor) lld_gdisp_vertical_scroll(x, y, cx, cy, lines, bgcolor)
#define gdispControl(what, value) GDISP_LLD(control)(what, value) #define gdispControl(what, value) lld_gdisp_control(what, value)
#define gdispQuery(what) GDISP_LLD(query)(what) #define gdispQuery(what) lld_gdisp_query(what)
#endif #endif

View File

@ -52,13 +52,13 @@
#endif #endif
#if !GDISP_HARDWARE_CLEARS #if !GDISP_HARDWARE_CLEARS
void GDISP_LLD(clear)(color_t color) { void lld_gdisp_clear(color_t color) {
GDISP_LLD(fillarea)(0, 0, GDISP.Width, GDISP.Height, color); lld_gdisp_fill_area(0, 0, GDISP.Width, GDISP.Height, color);
} }
#endif #endif
#if !GDISP_HARDWARE_LINES #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 dy, dx;
int16_t addx, addy; int16_t addx, addy;
int16_t P, diff, i; int16_t P, diff, i;
@ -67,16 +67,16 @@
// speed improvement if vertical or horizontal // speed improvement if vertical or horizontal
if (x0 == x1) { if (x0 == x1) {
if (y1 > y0) 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 else
GDISP_LLD(fillarea)(x0, y1, 1, y0-y1+1, color); lld_gdisp_fill_area(x0, y1, 1, y0-y1+1, color);
return; return;
} }
if (y0 == y1) { if (y0 == y1) {
if (x1 > x0) 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 else
GDISP_LLD(fillarea)(x0, y1, x0-x1+1, 1, color); lld_gdisp_fill_area(x0, y1, x0-x1+1, 1, color);
return; return;
} }
#endif #endif
@ -102,7 +102,7 @@
diff = P - dx; diff = P - dx;
for(i=0; i<=dx; ++i) { for(i=0; i<=dx; ++i) {
GDISP_LLD(drawpixel)(x0, y0, color); lld_gdisp_draw_pixel(x0, y0, color);
if (P < 0) { if (P < 0) {
P += dy; P += dy;
x0 += addx; x0 += addx;
@ -118,7 +118,7 @@
diff = P - dy; diff = P - dy;
for(i=0; i<=dy; ++i) { for(i=0; i<=dy; ++i) {
GDISP_LLD(drawpixel)(x0, y0, color); lld_gdisp_draw_pixel(x0, y0, color);
if (P < 0) { if (P < 0) {
P += dx; P += dx;
y0 += addy; y0 += addy;
@ -133,16 +133,16 @@
#endif #endif
#if !GDISP_HARDWARE_FILLS #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 #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 #elif GDISP_HARDWARE_LINES
coord_t x1, y1; coord_t x1, y1;
x1 = x + cx - 1; x1 = x + cx - 1;
y1 = y + cy; y1 = y + cy;
for(; y < y1; y++) for(; y < y1; y++)
GDISP_LLD(drawline)(x, y, x1, y, color); lld_gdisp_draw_line(x, y, x1, y, color);
#else #else
coord_t x0, x1, y1; coord_t x0, x1, y1;
@ -151,13 +151,13 @@
y1 = y + cy; y1 = y + cy;
for(; y < y1; y++) for(; y < y1; y++)
for(x = x0; x < x1; x++) for(x = x0; x < x1; x++)
GDISP_LLD(drawpixel)(x, y, color); lld_gdisp_draw_pixel(x, y, color);
#endif #endif
} }
#endif #endif
#if !GDISP_HARDWARE_BITFILLS #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; coord_t x0, x1, y1;
x0 = x; x0 = x;
@ -167,12 +167,12 @@
srccx -= cx; srccx -= cx;
for(; y < y1; y++, buffer += srccx) for(; y < y1; y++, buffer += srccx)
for(x=x0; x < x1; x++) for(x=x0; x < x1; x++)
GDISP_LLD(drawpixel)(x, y, *buffer++); lld_gdisp_draw_pixel(x, y, *buffer++);
} }
#endif #endif
#if GDISP_NEED_CLIP && !GDISP_HARDWARE_CLIP #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 GDISP_NEED_VALIDATION
if (x >= GDISP.Width || y >= GDISP.Height || cx < 0 || cy < 0) if (x >= GDISP.Width || y >= GDISP.Height || cx < 0 || cy < 0)
return; return;
@ -189,7 +189,7 @@
#endif #endif
#if GDISP_NEED_CIRCLE && !GDISP_HARDWARE_CIRCLES #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; coord_t a, b, P;
a = 0; a = 0;
@ -197,14 +197,14 @@
P = 1 - radius; P = 1 - radius;
do { do {
GDISP_LLD(drawpixel)(x+a, y+b, color); lld_gdisp_draw_pixel(x+a, y+b, color);
GDISP_LLD(drawpixel)(x+b, y+a, color); lld_gdisp_draw_pixel(x+b, y+a, color);
GDISP_LLD(drawpixel)(x-a, y+b, color); lld_gdisp_draw_pixel(x-a, y+b, color);
GDISP_LLD(drawpixel)(x-b, y+a, color); lld_gdisp_draw_pixel(x-b, y+a, color);
GDISP_LLD(drawpixel)(x+b, y-a, color); lld_gdisp_draw_pixel(x+b, y-a, color);
GDISP_LLD(drawpixel)(x+a, y-b, color); lld_gdisp_draw_pixel(x+a, y-b, color);
GDISP_LLD(drawpixel)(x-a, y-b, color); lld_gdisp_draw_pixel(x-a, y-b, color);
GDISP_LLD(drawpixel)(x-b, y-a, color); lld_gdisp_draw_pixel(x-b, y-a, color);
if (P < 0) if (P < 0)
P += 3 + 2*a++; P += 3 + 2*a++;
else else
@ -214,7 +214,7 @@
#endif #endif
#if GDISP_NEED_CIRCLE && !GDISP_HARDWARE_CIRCLEFILLS #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; coord_t a, b, P;
a = 0; a = 0;
@ -222,10 +222,10 @@
P = 1 - radius; P = 1 - radius;
do { do {
GDISP_LLD(drawline)(x-a, y+b, x+a, y+b, color); lld_gdisp_draw_line(x-a, y+b, x+a, y+b, color);
GDISP_LLD(drawline)(x-a, y-b, x+a, y-b, color); lld_gdisp_draw_line(x-a, y-b, x+a, y-b, color);
GDISP_LLD(drawline)(x-b, y+a, x+b, y+a, color); lld_gdisp_draw_line(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-b, y-a, x+b, y-a, color);
if (P < 0) if (P < 0)
P += 3 + 2*a++; P += 3 + 2*a++;
else else
@ -235,16 +235,16 @@
#endif #endif
#if GDISP_NEED_ELLIPSE && !GDISP_HARDWARE_ELLIPSES #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 */ int dx = 0, dy = b; /* im I. Quadranten von links oben nach rechts unten */
long a2 = a*a, b2 = b*b; long a2 = a*a, b2 = b*b;
long err = b2-(2*b-1)*a2, e2; /* Fehler im 1. Schritt */ long err = b2-(2*b-1)*a2, e2; /* Fehler im 1. Schritt */
do { do {
GDISP_LLD(drawpixel)(x+dx, y+dy, color); /* I. Quadrant */ lld_gdisp_draw_pixel(x+dx, y+dy, color); /* I. Quadrant */
GDISP_LLD(drawpixel)(x-dx, y+dy, color); /* II. Quadrant */ lld_gdisp_draw_pixel(x-dx, y+dy, color); /* II. Quadrant */
GDISP_LLD(drawpixel)(x-dx, y-dy, color); /* III. Quadrant */ lld_gdisp_draw_pixel(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); /* IV. Quadrant */
e2 = 2*err; e2 = 2*err;
if(e2 < (2*dx+1)*b2) { if(e2 < (2*dx+1)*b2) {
@ -258,21 +258,21 @@
} while(dy >= 0); } while(dy >= 0);
while(dx++ < a) { /* fehlerhafter Abbruch bei flachen Ellipsen (b=1) */ while(dx++ < a) { /* fehlerhafter Abbruch bei flachen Ellipsen (b=1) */
GDISP_LLD(drawpixel)(x+dx, y, color); /* -> Spitze der Ellipse vollenden */ lld_gdisp_draw_pixel(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
GDISP_LLD(drawpixel)(x-dx, y, color); lld_gdisp_draw_pixel(x-dx, y, color);
} }
} }
#endif #endif
#if GDISP_NEED_ELLIPSE && !GDISP_HARDWARE_ELLIPSEFILLS #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 */ int dx = 0, dy = b; /* im I. Quadranten von links oben nach rechts unten */
long a2 = a*a, b2 = b*b; long a2 = a*a, b2 = b*b;
long err = b2-(2*b-1)*a2, e2; /* Fehler im 1. Schritt */ long err = b2-(2*b-1)*a2, e2; /* Fehler im 1. Schritt */
do { do {
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);
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);
e2 = 2*err; e2 = 2*err;
if(e2 < (2*dx+1)*b2) { if(e2 < (2*dx+1)*b2) {
@ -286,8 +286,8 @@
} while(dy >= 0); } while(dy >= 0);
while(dx++ < a) { /* fehlerhafter Abbruch bei flachen Ellipsen (b=1) */ while(dx++ < a) { /* fehlerhafter Abbruch bei flachen Ellipsen (b=1) */
GDISP_LLD(drawpixel)(x+dx, y, color); /* -> Spitze der Ellipse vollenden */ lld_gdisp_draw_pixel(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
GDISP_LLD(drawpixel)(x-dx, y, color); lld_gdisp_draw_pixel(x-dx, y, color);
} }
} }
#endif #endif
@ -325,13 +325,13 @@
do { do {
if(x-a <= x_maxI && x-a >= x_minI) 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) 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) 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) 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) { if (P < 0) {
P = P + 3 + 2*a; P = P + 3 + 2*a;
@ -359,13 +359,13 @@
do { do {
if(x-a <= x_maxII && x-a >= x_minII) 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) 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) 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) 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) { if (P < 0) {
P = P + 3 + 2*a; 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) { if(endangle < startangle) {
_draw_arc(x, y, startangle, 360, radius, color); _draw_arc(x, y, startangle, 360, radius, color);
_draw_arc(x, y, 0, endangle, radius, color); _draw_arc(x, y, 0, endangle, radius, color);
@ -419,13 +419,13 @@
do { do {
if(x-a <= x_maxI && x-a >= x_minI) 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) 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) 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) 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) { if (P < 0) {
P = P + 3 + 2*a; P = P + 3 + 2*a;
@ -453,13 +453,13 @@
do { do {
if(x-a <= x_maxII && x-a >= x_minII) 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) 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) 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) 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) { if (P < 0) {
P = P + 3 + 2*a; 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) { if(endangle < startangle) {
_fill_arc(x, y, startangle, 360, radius, color); _fill_arc(x, y, startangle, 360, radius, color);
_fill_arc(x, y, 0, endangle, radius, color); _fill_arc(x, y, 0, endangle, radius, color);
@ -488,7 +488,7 @@
#endif #endif
#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT #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; const fontcolumn_t *ptr;
fontcolumn_t column; fontcolumn_t column;
coord_t width, height, xscale, yscale; coord_t width, height, xscale, yscale;
@ -515,7 +515,7 @@
if (column & 0x01) { if (column & 0x01) {
for(xs=0; xs < xscale; xs++) for(xs=0; xs < xscale; xs++)
for(ys=0; ys < yscale; ys++) 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 #endif
#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXTFILLS #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 width, height;
coord_t xscale, yscale; coord_t xscale, yscale;
@ -540,10 +540,10 @@
#if GDISP_HARDWARE_TEXT || GDISP_SOFTWARE_TEXTFILLDRAW #if GDISP_HARDWARE_TEXT || GDISP_SOFTWARE_TEXTFILLDRAW
/* Fill the area */ /* Fill the area */
GDISP_LLD(fillarea)(x, y, width, height, bgcolor); lld_gdisp_fill_area(x, y, width, height, bgcolor);
/* Draw the text */ /* 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 */ /* Method 2: Create a single column bitmap and then blit it */
#elif GDISP_HARDWARE_BITFILLS && GDISP_SOFTWARE_TEXTBLITCOLUMN #elif GDISP_HARDWARE_BITFILLS && GDISP_SOFTWARE_TEXTBLITCOLUMN
@ -582,7 +582,7 @@
} }
for(xs=0; xs < xscale; xs++) 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 */ /* [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 */ /* Method 4: Draw pixel by pixel */
@ -648,11 +648,11 @@
if (column & 0x01) { if (column & 0x01) {
for(xs=0; xs < xscale; xs++) for(xs=0; xs < xscale; xs++)
for(ys=0; ys < yscale; ys++) 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 { } else {
for(xs=0; xs < xscale; xs++) for(xs=0; xs < xscale; xs++)
for(ys=0; ys < yscale; ys++) 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 #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)what;
(void)value; (void)value;
/* Ignore everything */ /* Ignore everything */
@ -671,7 +671,7 @@
#endif #endif
#if !GDISP_HARDWARE_QUERY #if !GDISP_HARDWARE_QUERY
void *GDISP_LLD(query)(unsigned what) { void *lld_gdisp_query(unsigned what) {
switch(what) { switch(what) {
case GDISP_QUERY_WIDTH: return (void *)(unsigned)GDISP.Width; case GDISP_QUERY_WIDTH: return (void *)(unsigned)GDISP.Width;
case GDISP_QUERY_HEIGHT: return (void *)(unsigned)GDISP.Height; case GDISP_QUERY_HEIGHT: return (void *)(unsigned)GDISP.Height;
@ -685,82 +685,82 @@ void *GDISP_LLD(query)(unsigned what) {
#endif #endif
#if GDISP_NEED_MSGAPI #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) { switch(msg->action) {
case GDISP_LLD_MSG_NOP: case GDISP_LLD_MSG_NOP:
break; break;
case GDISP_LLD_MSG_INIT: case GDISP_LLD_MSG_INIT:
GDISP_LLD(init)(); lld_gdisp_init();
break; break;
case GDISP_LLD_MSG_CLEAR: case GDISP_LLD_MSG_CLEAR:
GDISP_LLD(clear)(msg->clear.color); lld_gdisp_clear(msg->clear.color);
break; break;
case GDISP_LLD_MSG_DRAWPIXEL: 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; break;
case GDISP_LLD_MSG_FILLAREA: 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; break;
case GDISP_LLD_MSG_BLITAREA: 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; break;
case GDISP_LLD_MSG_DRAWLINE: 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; break;
#if GDISP_NEED_CLIP #if GDISP_NEED_CLIP
case GDISP_LLD_MSG_SETCLIP: 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; break;
#endif #endif
#if GDISP_NEED_CIRCLE #if GDISP_NEED_CIRCLE
case GDISP_LLD_MSG_DRAWCIRCLE: 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; break;
case GDISP_LLD_MSG_FILLCIRCLE: 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; break;
#endif #endif
#if GDISP_NEED_ELLIPSE #if GDISP_NEED_ELLIPSE
case GDISP_LLD_MSG_DRAWELLIPSE: 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; break;
case GDISP_LLD_MSG_FILLELLIPSE: 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; break;
#endif #endif
#if GDISP_NEED_ARC #if GDISP_NEED_ARC
case GDISP_LLD_MSG_DRAWARC: 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; break;
case GDISP_LLD_MSG_FILLARC: 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; break;
#endif #endif
#if GDISP_NEED_TEXT #if GDISP_NEED_TEXT
case GDISP_LLD_MSG_DRAWCHAR: 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; break;
case GDISP_LLD_MSG_FILLCHAR: 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; break;
#endif #endif
#if GDISP_NEED_PIXELREAD #if GDISP_NEED_PIXELREAD
case GDISP_LLD_MSG_GETPIXELCOLOR: 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; break;
#endif #endif
#if GDISP_NEED_SCROLL #if GDISP_NEED_SCROLL
case GDISP_LLD_MSG_VERTICALSCROLL: 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; break;
#endif #endif
#if GDISP_NEED_CONTROL #if GDISP_NEED_CONTROL
case GDISP_LLD_MSG_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; break;
#endif #endif
case GDISP_LLD_MSG_QUERY: case GDISP_LLD_MSG_QUERY:
msg->query.result = GDISP_LLD(query)(msg->query.what); msg->query.result = lld_gdisp_query(msg->query.what);
break; break;
} }
} }

View File

@ -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. * @brief GDISP Graphic Driver subsystem low level driver header.
* *
* @addtogroup GDISP * @addtogroup GDISP
@ -366,7 +366,7 @@
#define RGB2COLOR(r,g,b) ((color_t)((((r) & 0xF8)<<8) | (((g) & 0xFC)<<3) | (((b) & 0xF8)>>3))) #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 HTML2COLOR(h) ((color_t)((((h) & 0xF80000)>>8) | (((h) & 0x00FC00)>>5) | (((h) & 0x0000F8)>>3)))
#define RED_OF(c) (((c) & 0xF800)>>8) #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) #define BLUE_OF(c) (((c)&0x001F)<<3)
#elif GDISP_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888 #elif GDISP_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888
@ -458,79 +458,74 @@ typedef enum powermode {powerOff, powerSleep, powerDeepSleep, powerOn} gdisp_pow
/* External declarations. */ /* External declarations. */
/*===========================================================================*/ /*===========================================================================*/
#ifndef GDISP_LLD_VMT
/* Special magic stuff for the VMT driver */
#define GDISP_LLD_VMT(x) GDISP_LLD(x)
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Core functions */ /* 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 /* 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 */ /* Drawing functions */
extern void GDISP_LLD_VMT(clear)(color_t color); extern void lld_gdisp_clear(color_t color);
extern void GDISP_LLD_VMT(drawpixel)(coord_t x, coord_t y, color_t color); extern void lld_gdisp_draw_pixel(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 lld_gdisp_fill_area(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 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 GDISP_LLD_VMT(drawline)(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color); extern void lld_gdisp_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
/* Circular Drawing Functions */ /* Circular Drawing Functions */
#if GDISP_NEED_CIRCLE #if GDISP_NEED_CIRCLE
extern void GDISP_LLD_VMT(drawcircle)(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 GDISP_LLD_VMT(fillcircle)(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 #endif
#if GDISP_NEED_ELLIPSE #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 lld_gdisp_draw_ellipse(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_fill_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
#endif #endif
/* Arc Drawing Functions */ /* Arc Drawing Functions */
#if GDISP_NEED_ARC #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 lld_gdisp_draw_arc(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_fill_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
#endif #endif
/* Text Rendering Functions */ /* Text Rendering Functions */
#if GDISP_NEED_TEXT #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 lld_gdisp_draw_char(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_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor);
#endif #endif
/* Pixel readback */ /* Pixel readback */
#if GDISP_NEED_PIXELREAD #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 #endif
/* Scrolling Function - clears the area scrolled out */ /* Scrolling Function - clears the area scrolled out */
#if GDISP_NEED_SCROLL #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 #endif
/* Set driver specific control */ /* Set driver specific control */
#if GDISP_NEED_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 #endif
/* Query driver specific data */ /* Query driver specific data */
extern void *GDISP_LLD_VMT(query)(unsigned what); extern void *lld_gdisp_query(unsigned what);
/* Clipping Functions */ /* Clipping Functions */
#if GDISP_NEED_CLIP #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 #endif
/* Messaging API */ /* Messaging API */
#if GDISP_NEED_MSGAPI #if GDISP_NEED_MSGAPI
#include "gdisp_lld_msgs.h" #include "lld_gdisp_msgs.h"
extern void GDISP_LLD(msgdispatch)(gdisp_lld_msg_t *msg); extern void lld_gdisp_msg_dispatch(lld_gdisp_msg_t *msg);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -229,13 +229,8 @@
*/ */
/* #define GDISP_USE_FSMC */ /* #define GDISP_USE_FSMC */
/* #define GDISP_USE_GPIO */ /* #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 */ #endif /* _GDISP_OPTIONS_H */
/** @} */ /** @} */

View File

@ -7,6 +7,8 @@ FEATURE: Added ILI9325 driver - Thanks to Chris van Dongen aka _Sjaak
FEATURE: Added TDISP module FEATURE: Added TDISP module
FIX: tdispGotoXY() renamed to tdispSetCursor() FIX: tdispGotoXY() renamed to tdispSetCursor()
FEATURE: Addition of GADC, GMISC, GAUDIN, GAUDOUT subsystems FEATURE: Addition of GADC, GMISC, GAUDIN, GAUDOUT subsystems
FIX: Removal of the GDISP_LLD() macro
DEPRECATE: Removal of the GDISP VMT
*** changes after 1.4 *** *** changes after 1.4 ***

View File

@ -95,7 +95,7 @@
/* OK - we need to obtain the mutex in case a synchronous operation is occurring */ /* OK - we need to obtain the mutex in case a synchronous operation is occurring */
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(msgdispatch)(pmsg); lld_gdisp_msg_dispatch(pmsg);
chMtxUnlock(); chMtxUnlock();
/* Mark the message as free */ /* Mark the message as free */
@ -153,7 +153,7 @@
/* Initialise driver */ /* Initialise driver */
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
res = GDISP_LLD(init)(); res = lld_gdisp_init();
chMtxUnlock(); chMtxUnlock();
return res; return res;
@ -180,7 +180,7 @@
/* Initialise driver - synchronous */ /* Initialise driver - synchronous */
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
res = GDISP_LLD(init)(); res = lld_gdisp_init();
chMtxUnlock(); chMtxUnlock();
return res; return res;
@ -216,7 +216,7 @@
*/ */
void gdispClear(color_t color) { void gdispClear(color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(clear)(color); lld_gdisp_clear(color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ASYNC #elif GDISP_NEED_ASYNC
@ -238,7 +238,7 @@
*/ */
void gdispDrawPixel(coord_t x, coord_t y, color_t color) { void gdispDrawPixel(coord_t x, coord_t y, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(drawpixel)(x, y, color); lld_gdisp_draw_pixel(x, y, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ASYNC #elif GDISP_NEED_ASYNC
@ -263,7 +263,7 @@
*/ */
void gdispDrawLine(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) { void gdispDrawLine(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(drawline)(x0, y0, x1, y1, color); lld_gdisp_draw_line(x0, y0, x1, y1, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ASYNC #elif GDISP_NEED_ASYNC
@ -290,7 +290,7 @@
*/ */
void gdispFillArea(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) { void gdispFillArea(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(fillarea)(x, y, cx, cy, color); lld_gdisp_fill_area(x, y, cx, cy, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ASYNC #elif GDISP_NEED_ASYNC
@ -326,7 +326,7 @@
*/ */
void gdispBlitAreaEx(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 gdispBlitAreaEx(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) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(blitareaex)(x, y, cx, cy, srcx, srcy, srccx, buffer); lld_gdisp_blit_area_ex(x, y, cx, cy, srcx, srcy, srccx, buffer);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ASYNC #elif GDISP_NEED_ASYNC
@ -355,7 +355,7 @@
*/ */
void gdispSetClip(coord_t x, coord_t y, coord_t cx, coord_t cy) { void gdispSetClip(coord_t x, coord_t y, coord_t cx, coord_t cy) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(setclip)(x, y, cx, cy); lld_gdisp_set_clip(x, y, cx, cy);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_CLIP && GDISP_NEED_ASYNC #elif GDISP_NEED_CLIP && GDISP_NEED_ASYNC
@ -381,7 +381,7 @@
*/ */
void gdispDrawCircle(coord_t x, coord_t y, coord_t radius, color_t color) { void gdispDrawCircle(coord_t x, coord_t y, coord_t radius, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(drawcircle)(x, y, radius, color); lld_gdisp_draw_circle(x, y, radius, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_CIRCLE && GDISP_NEED_ASYNC #elif GDISP_NEED_CIRCLE && GDISP_NEED_ASYNC
@ -407,7 +407,7 @@
*/ */
void gdispFillCircle(coord_t x, coord_t y, coord_t radius, color_t color) { void gdispFillCircle(coord_t x, coord_t y, coord_t radius, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(fillcircle)(x, y, radius, color); lld_gdisp_fill_circle(x, y, radius, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_CIRCLE && GDISP_NEED_ASYNC #elif GDISP_NEED_CIRCLE && GDISP_NEED_ASYNC
@ -433,7 +433,7 @@
*/ */
void gdispDrawEllipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) { void gdispDrawEllipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(drawellipse)(x, y, a, b, color); lld_gdisp_draw_ellipse(x, y, a, b, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ELLIPSE && GDISP_NEED_ASYNC #elif GDISP_NEED_ELLIPSE && GDISP_NEED_ASYNC
@ -460,7 +460,7 @@
*/ */
void gdispFillEllipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) { void gdispFillEllipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(fillellipse)(x, y, a, b, color); lld_gdisp_fill_ellipse(x, y, a, b, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ELLIPSE && GDISP_NEED_ASYNC #elif GDISP_NEED_ELLIPSE && GDISP_NEED_ASYNC
@ -489,7 +489,7 @@
*/ */
void gdispDrawArc(coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) { void gdispDrawArc(coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(drawarc)(x, y, radius, start, end, color); lld_gdisp_draw_arc(x, y, radius, start, end, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ARC && GDISP_NEED_ASYNC #elif GDISP_NEED_ARC && GDISP_NEED_ASYNC
@ -520,7 +520,7 @@
*/ */
void gdispFillArc(coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) { void gdispFillArc(coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(fillarc)(x, y, radius, start, end, color); lld_gdisp_fill_arc(x, y, radius, start, end, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_ARC && GDISP_NEED_ASYNC #elif GDISP_NEED_ARC && GDISP_NEED_ASYNC
@ -605,7 +605,7 @@ void gdispFillRoundedBox(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t r
*/ */
void gdispDrawChar(coord_t x, coord_t y, char c, font_t font, color_t color) { void gdispDrawChar(coord_t x, coord_t y, char c, font_t font, color_t color) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(drawchar)(x, y, c, font, color); lld_gdisp_draw_char(x, y, c, font, color);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_TEXT && GDISP_NEED_ASYNC #elif GDISP_NEED_TEXT && GDISP_NEED_ASYNC
@ -634,7 +634,7 @@ void gdispFillRoundedBox(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t r
*/ */
void gdispFillChar(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor) { void gdispFillChar(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(fillchar)(x, y, c, font, color, bgcolor); lld_gdisp_fill_char(x, y, c, font, color, bgcolor);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_TEXT && GDISP_NEED_ASYNC #elif GDISP_NEED_TEXT && GDISP_NEED_ASYNC
@ -664,7 +664,7 @@ void gdispFillRoundedBox(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t r
/* Always synchronous as it must return a value */ /* Always synchronous as it must return a value */
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
c = GDISP_LLD(getpixelcolor)(x, y); c = lld_gdisp_get_pixel_color(x, y);
chMtxUnlock(); chMtxUnlock();
return c; return c;
@ -687,7 +687,7 @@ void gdispFillRoundedBox(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t r
*/ */
void gdispVerticalScroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { void gdispVerticalScroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(verticalscroll)(x, y, cx, cy, lines, bgcolor); lld_gdisp_vertical_scroll(x, y, cx, cy, lines, bgcolor);
chMtxUnlock(); chMtxUnlock();
} }
#elif GDISP_NEED_SCROLL && GDISP_NEED_ASYNC #elif GDISP_NEED_SCROLL && GDISP_NEED_ASYNC
@ -717,7 +717,7 @@ void gdispFillRoundedBox(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t r
*/ */
void gdispControl(unsigned what, void *value) { void gdispControl(unsigned what, void *value) {
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
GDISP_LLD(control)(what, value); lld_gdisp_control(what, value);
chMtxUnlock(); chMtxUnlock();
chThdSleepMilliseconds(100); chThdSleepMilliseconds(100);
} }
@ -746,7 +746,7 @@ void gdispFillRoundedBox(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t r
void *res; void *res;
chMtxLock(&gdispMutex); chMtxLock(&gdispMutex);
res = GDISP_LLD(query)(what); res = lld_gdisp_query(what);
chMtxUnlock(); chMtxUnlock();
return res; return res;
} }

View File

@ -2,4 +2,4 @@ GFXSRC += $(GFXLIB)/src/gwin/gwin.c \
$(GFXLIB)/src/gwin/console.c \ $(GFXLIB)/src/gwin/console.c \
$(GFXLIB)/src/gwin/button.c \ $(GFXLIB)/src/gwin/button.c \
$(GFXLIB)/src/gwin/graph.c $(GFXLIB)/src/gwin/graph.c