Fix compile error in GDISP
Fix compile error with wrongly named include file Revert lld_gdisp naming convention to gdisp_lld to fix problem and be consitant with all other low level drivers.
This commit is contained in:
parent
a178b91c4f
commit
9329b22086
19 changed files with 8453 additions and 8453 deletions
|
@ -81,28 +81,28 @@ static __inline void lld_lcdDelay(uint16_t us) {
|
|||
}
|
||||
|
||||
static __inline void lld_lcdWriteIndex(uint16_t index) {
|
||||
lld_gdisp_write_index(index);
|
||||
gdisp_lld_write_index(index);
|
||||
}
|
||||
|
||||
static __inline void lld_lcdWriteData(uint16_t data) {
|
||||
lld_gdisp_write_data(data);
|
||||
gdisp_lld_write_data(data);
|
||||
}
|
||||
|
||||
static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
|
||||
lld_gdisp_write_index(lcdReg);
|
||||
lld_gdisp_write_data(lcdRegValue);
|
||||
gdisp_lld_write_index(lcdReg);
|
||||
gdisp_lld_write_data(lcdRegValue);
|
||||
}
|
||||
|
||||
static __inline uint16_t lld_lcdReadData(void) {
|
||||
/* fix this! */
|
||||
//return lld_gdisp_read_data;
|
||||
//return gdisp_lld_read_data;
|
||||
return GDISP_RAM;
|
||||
}
|
||||
|
||||
static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
|
||||
volatile uint16_t dummy;
|
||||
|
||||
lld_gdisp_write_index(lcdReg);
|
||||
gdisp_lld_write_index(lcdReg);
|
||||
dummy = lld_lcdReadData();
|
||||
(void)dummy;
|
||||
|
||||
|
@ -143,14 +143,14 @@ static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
|
|||
buffer[i] = lld_lcdReadData();
|
||||
}
|
||||
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
/* Initialise your display */
|
||||
lld_gdisp_init_board();
|
||||
gdisp_lld_init_board();
|
||||
|
||||
/* Hardware reset */
|
||||
lld_gdisp_reset_pin(TRUE);
|
||||
gdisp_lld_reset_pin(TRUE);
|
||||
lld_lcdDelay(1000);
|
||||
lld_gdisp_reset_pin(FALSE);
|
||||
gdisp_lld_reset_pin(FALSE);
|
||||
lld_lcdDelay(1000);
|
||||
|
||||
DISPLAY_CODE = lld_lcdReadReg(0);
|
||||
|
@ -215,7 +215,7 @@ bool_t lld_gdisp_init(void) {
|
|||
lld_lcdWriteReg(0x0007, 0x0173); //display On
|
||||
|
||||
// Turn on the backlight
|
||||
lld_gdisp_backlight(GDISP_INITIAL_BACKLIGHT);
|
||||
gdisp_lld_backlight(GDISP_INITIAL_BACKLIGHT);
|
||||
|
||||
/* Initialise the GDISP structure */
|
||||
GDISP.Width = GDISP_SCREEN_WIDTH;
|
||||
|
@ -298,7 +298,7 @@ static __inline void lld_lcdResetViewPort(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
|
||||
#endif
|
||||
|
@ -307,7 +307,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
}
|
||||
|
||||
#if GDISP_HARDWARE_CLEARS || defined(__DOXYGEN__)
|
||||
void lld_gdisp_clear(color_t color) {
|
||||
void gdisp_lld_clear(color_t color) {
|
||||
unsigned i;
|
||||
|
||||
lld_lcdSetCursor(0, 0);
|
||||
|
@ -321,7 +321,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_FILLS || defined(__DOXYGEN__)
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_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 (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
|
||||
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
|
||||
|
@ -343,7 +343,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_BITFILLS || defined(__DOXYGEN__)
|
||||
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) {
|
||||
void gdisp_lld_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;
|
||||
unsigned lg;
|
||||
|
||||
|
@ -372,7 +372,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if (GDISP_NEED_PIXELREAD && GDISP_HARDWARE_PIXELREAD) || defined(__DOXYGEN__)
|
||||
color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t color;
|
||||
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
|
@ -392,7 +392,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if (GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL) || defined(__DOXYGEN__)
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_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)];
|
||||
coord_t row0, row1;
|
||||
unsigned i, gap, abslines;
|
||||
|
@ -445,7 +445,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if (GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL) || defined(__DOXYGEN__)
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
switch(what) {
|
||||
case GDISP_CONTROL_POWER:
|
||||
if(GDISP.Powermode == (gdisp_powermode_t)value)
|
||||
|
@ -457,7 +457,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
lld_lcdWriteReg(0x0011, 0x0000);
|
||||
lld_lcdWriteReg(0x0012, 0x0000);
|
||||
lld_lcdWriteReg(0x0013, 0x0000);
|
||||
lld_gdisp_backlight(0);
|
||||
gdisp_lld_backlight(0);
|
||||
break;
|
||||
|
||||
case powerOn:
|
||||
|
@ -476,9 +476,9 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
lld_lcdWriteReg(0x0029, 0x0009); /* VCM[4:0] for VCOMH */
|
||||
lld_lcdDelay(500);
|
||||
lld_lcdWriteReg(0x0007, 0x0173); /* 262K color and display ON */
|
||||
lld_gdisp_backlight(GDISP.Backlight);
|
||||
gdisp_lld_backlight(GDISP.Backlight);
|
||||
if(GDISP.Powermode != powerSleep || GDISP.Powermode != powerDeepSleep)
|
||||
lld_gdisp_init();
|
||||
gdisp_lld_init();
|
||||
break;
|
||||
|
||||
case powerSleep:
|
||||
|
@ -489,7 +489,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
|
||||
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
|
||||
lld_lcdWriteReg(0x0010, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
||||
lld_gdisp_backlight(0);
|
||||
gdisp_lld_backlight(0);
|
||||
break;
|
||||
|
||||
case powerDeepSleep:
|
||||
|
@ -500,7 +500,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
|
||||
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
|
||||
lld_lcdWriteReg(0x0010, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
||||
lld_gdisp_backlight(0);
|
||||
gdisp_lld_backlight(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -554,7 +554,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
|
||||
case GDISP_CONTROL_BACKLIGHT:
|
||||
if((unsigned)value > 100) value = (void *)100;
|
||||
lld_gdisp_backlight((unsigned)value);
|
||||
gdisp_lld_backlight((unsigned)value);
|
||||
GDISP.Backlight = (unsigned)value;
|
||||
break;
|
||||
|
||||
|
|
|
@ -29,28 +29,28 @@
|
|||
#ifndef GDISP_LLD_BOARD_H
|
||||
#define GDISP_LLD_BOARD_H
|
||||
|
||||
static __inline void lld_gdisp_init_board(void) {
|
||||
static __inline void gdisp_lld_init_board(void) {
|
||||
#error "ILI9320: You must implement the init_board routine for your board"
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_reset_pin(bool_t state) {
|
||||
static __inline void gdisp_lld_reset_pin(bool_t state) {
|
||||
#error "ILI9320: You must implement setpin_reset routine for your board"
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_write_index(uint16_t data) {
|
||||
static __inline void gdisp_lld_write_index(uint16_t data) {
|
||||
#error "ILI9320: You must implement write_index routine for your board"
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_write_data(uint16_t data) {
|
||||
static __inline void gdisp_lld_write_data(uint16_t data) {
|
||||
#error "ILI9320: You must implement write_data routine for your board"
|
||||
}
|
||||
|
||||
static __inline uint16_t lld_gdisp_read_data(void) {
|
||||
static __inline uint16_t gdisp_lld_read_data(void) {
|
||||
#error "ILI9320: You must implement read_data routine for your board"
|
||||
}
|
||||
|
||||
/* if not available, just ignore the argument and return */
|
||||
static __inline uint16_t lld_gdisp_backlight(uint8_t percentage) {
|
||||
static __inline uint16_t gdisp_lld_backlight(uint8_t percentage) {
|
||||
#error "ILI9320: You must implement set_backlight routine for your board"
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
|
||||
#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */
|
||||
|
||||
static __inline void lld_gdisp_init_board(void) {
|
||||
static __inline void gdisp_lld_init_board(void) {
|
||||
/* FSMC setup for F1 */
|
||||
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
|
||||
|
||||
|
@ -54,26 +54,26 @@ static __inline void lld_gdisp_init_board(void) {
|
|||
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_reset_pin(bool_t state) {
|
||||
static __inline void gdisp_lld_reset_pin(bool_t state) {
|
||||
if(state)
|
||||
palClearPad(GPIOE, GPIOE_TFT_RST);
|
||||
else
|
||||
palSetPad(GPIOE, GPIOE_TFT_RST);
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_write_index(uint16_t reg) {
|
||||
static __inline void gdisp_lld_write_index(uint16_t reg) {
|
||||
GDISP_REG = reg;
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_write_data(uint16_t data) {
|
||||
static __inline void gdisp_lld_write_data(uint16_t data) {
|
||||
GDISP_RAM = data;
|
||||
}
|
||||
|
||||
static __inline uint16_t lld_gdisp_read_data(void) {
|
||||
static __inline uint16_t gdisp_lld_read_data(void) {
|
||||
return GDISP_RAM;
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_backlight(uint8_t percent) {
|
||||
static __inline void gdisp_lld_backlight(uint8_t percent) {
|
||||
if(percent == 100)
|
||||
palClearPad(GPIOD, GPIOD_TFT_LIGHT);
|
||||
else
|
||||
|
|
|
@ -81,28 +81,28 @@ static __inline void lld_lcdDelay(uint16_t us) {
|
|||
}
|
||||
|
||||
static __inline void lld_lcdWriteIndex(uint16_t index) {
|
||||
lld_gdisp_write_index(index);
|
||||
gdisp_lld_write_index(index);
|
||||
}
|
||||
|
||||
static __inline void lld_lcdWriteData(uint16_t data) {
|
||||
lld_gdisp_write_data(data);
|
||||
gdisp_lld_write_data(data);
|
||||
}
|
||||
|
||||
static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
|
||||
lld_gdisp_write_index(lcdReg);
|
||||
lld_gdisp_write_data(lcdRegValue);
|
||||
gdisp_lld_write_index(lcdReg);
|
||||
gdisp_lld_write_data(lcdRegValue);
|
||||
}
|
||||
|
||||
static __inline uint16_t lld_lcdReadData(void) {
|
||||
/* fix this! */
|
||||
//return lld_gdisp_read_data;
|
||||
//return gdisp_lld_read_data;
|
||||
return GDISP_RAM;
|
||||
}
|
||||
|
||||
static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
|
||||
volatile uint16_t dummy;
|
||||
|
||||
lld_gdisp_write_index(lcdReg);
|
||||
gdisp_lld_write_index(lcdReg);
|
||||
dummy = lld_lcdReadData();
|
||||
(void)dummy;
|
||||
|
||||
|
@ -143,14 +143,14 @@ static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
|
|||
buffer[i] = lld_lcdReadData();
|
||||
}
|
||||
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
/* Initialise your display */
|
||||
lld_gdisp_init_board();
|
||||
gdisp_lld_init_board();
|
||||
|
||||
/* Hardware reset */
|
||||
lld_gdisp_reset_pin(TRUE);
|
||||
gdisp_lld_reset_pin(TRUE);
|
||||
lld_lcdDelay(1000);
|
||||
lld_gdisp_reset_pin(FALSE);
|
||||
gdisp_lld_reset_pin(FALSE);
|
||||
lld_lcdDelay(1000);
|
||||
|
||||
// chinese code starts here
|
||||
|
@ -210,7 +210,7 @@ bool_t lld_gdisp_init(void) {
|
|||
// chinese code ends here
|
||||
|
||||
// Turn on the backlight
|
||||
lld_gdisp_backlight(GDISP_INITIAL_BACKLIGHT);
|
||||
gdisp_lld_backlight(GDISP_INITIAL_BACKLIGHT);
|
||||
|
||||
/* Initialise the GDISP structure */
|
||||
GDISP.Width = GDISP_SCREEN_WIDTH;
|
||||
|
@ -302,7 +302,7 @@ static __inline void lld_lcdResetViewPort(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
|
||||
#endif
|
||||
|
@ -311,7 +311,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
}
|
||||
|
||||
#if GDISP_HARDWARE_CLEARS || defined(__DOXYGEN__)
|
||||
void lld_gdisp_clear(color_t color) {
|
||||
void gdisp_lld_clear(color_t color) {
|
||||
unsigned i;
|
||||
|
||||
lld_lcdSetCursor(0, 0);
|
||||
|
@ -325,7 +325,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_FILLS || defined(__DOXYGEN__)
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_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 (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
|
||||
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
|
||||
|
@ -347,7 +347,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if GDISP_HARDWARE_BITFILLS || defined(__DOXYGEN__)
|
||||
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) {
|
||||
void gdisp_lld_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;
|
||||
unsigned lg;
|
||||
|
||||
|
@ -376,7 +376,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if (GDISP_NEED_PIXELREAD && GDISP_HARDWARE_PIXELREAD) || defined(__DOXYGEN__)
|
||||
color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t color;
|
||||
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
|
@ -396,7 +396,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if (GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL) || defined(__DOXYGEN__)
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_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)];
|
||||
coord_t row0, row1;
|
||||
unsigned i, gap, abslines;
|
||||
|
@ -449,7 +449,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
#endif
|
||||
|
||||
#if (GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL) || defined(__DOXYGEN__)
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
switch(what) {
|
||||
case GDISP_CONTROL_POWER:
|
||||
if(GDISP.Powermode == (gdisp_powermode_t)value)
|
||||
|
@ -461,7 +461,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
lld_lcdWriteReg(0x0011, 0x0000);
|
||||
lld_lcdWriteReg(0x0012, 0x0000);
|
||||
lld_lcdWriteReg(0x0013, 0x0000);
|
||||
lld_gdisp_backlight(0);
|
||||
gdisp_lld_backlight(0);
|
||||
break;
|
||||
|
||||
case powerOn:
|
||||
|
@ -480,9 +480,9 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
lld_lcdWriteReg(0x0029, 0x0009); /* VCM[4:0] for VCOMH */
|
||||
lld_lcdDelay(500);
|
||||
lld_lcdWriteReg(0x0007, 0x0173); /* 262K color and display ON */
|
||||
lld_gdisp_backlight(GDISP.Backlight);
|
||||
gdisp_lld_backlight(GDISP.Backlight);
|
||||
if(GDISP.Powermode != powerSleep || GDISP.Powermode != powerDeepSleep)
|
||||
lld_gdisp_init();
|
||||
gdisp_lld_init();
|
||||
break;
|
||||
|
||||
case powerSleep:
|
||||
|
@ -493,7 +493,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
|
||||
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
|
||||
lld_lcdWriteReg(0x0010, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
||||
lld_gdisp_backlight(0);
|
||||
gdisp_lld_backlight(0);
|
||||
break;
|
||||
|
||||
case powerDeepSleep:
|
||||
|
@ -504,7 +504,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
|
||||
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
|
||||
lld_lcdWriteReg(0x0010, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
|
||||
lld_gdisp_backlight(0);
|
||||
gdisp_lld_backlight(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -564,7 +564,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
|
||||
case GDISP_CONTROL_BACKLIGHT:
|
||||
if((unsigned)value > 100) value = (void *)100;
|
||||
lld_gdisp_backlight((unsigned)value);
|
||||
gdisp_lld_backlight((unsigned)value);
|
||||
GDISP.Backlight = (unsigned)value;
|
||||
break;
|
||||
|
||||
|
|
|
@ -29,28 +29,28 @@
|
|||
#ifndef GDISP_LLD_BOARD_H
|
||||
#define GDISP_LLD_BOARD_H
|
||||
|
||||
static __inline void lld_gdisp_init_board(void) {
|
||||
static __inline void gdisp_lld_init_board(void) {
|
||||
#error "ILI9325: You must implement the init_board routine for your board"
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_reset_pin(bool_t state) {
|
||||
static __inline void gdisp_lld_reset_pin(bool_t state) {
|
||||
#error "ILI9325: You must implement setpin_reset routine for your board"
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_write_index(uint16_t data) {
|
||||
static __inline void gdisp_lld_write_index(uint16_t data) {
|
||||
#error "ILI9325: You must implement write_index routine for your board"
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_write_data(uint16_t data) {
|
||||
static __inline void gdisp_lld_write_data(uint16_t data) {
|
||||
#error "ILI9325: You must implement write_data routine for your board"
|
||||
}
|
||||
|
||||
static __inline uint16_t lld_gdisp_read_data(void) {
|
||||
static __inline uint16_t gdisp_lld_read_data(void) {
|
||||
#error "ILI9325: You must implement read_data routine for your board"
|
||||
}
|
||||
|
||||
/* if not available, just ignore the argument and return */
|
||||
static __inline uint16_t lld_gdisp_backlight(uint8_t percentage) {
|
||||
static __inline uint16_t gdisp_lld_backlight(uint8_t percentage) {
|
||||
#error "ILI9325: You must implement set_backlight routine for your board"
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
|
||||
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
|
||||
|
||||
static __inline void lld_gdisp_init_board(void) {
|
||||
static __inline void gdisp_lld_init_board(void) {
|
||||
/* FSMC setup for F1 */
|
||||
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
|
||||
|
||||
|
@ -68,26 +68,26 @@ static __inline void lld_gdisp_init_board(void) {
|
|||
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_reset_pin(bool_t state) {
|
||||
static __inline void gdisp_lld_reset_pin(bool_t state) {
|
||||
if(state)
|
||||
palClearPad(GPIOE, GPIOE_TFT_RST);
|
||||
else
|
||||
palSetPad(GPIOE, GPIOE_TFT_RST);
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_write_index(uint16_t reg) {
|
||||
static __inline void gdisp_lld_write_index(uint16_t reg) {
|
||||
GDISP_REG = reg;
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_write_data(uint16_t data) {
|
||||
static __inline void gdisp_lld_write_data(uint16_t data) {
|
||||
GDISP_RAM = data;
|
||||
}
|
||||
|
||||
static __inline uint16_t lld_gdisp_read_data(void) {
|
||||
static __inline uint16_t gdisp_lld_read_data(void) {
|
||||
return GDISP_RAM;
|
||||
}
|
||||
|
||||
static __inline void lld_gdisp_backlight(uint8_t percent) {
|
||||
static __inline void gdisp_lld_backlight(uint8_t percent) {
|
||||
percent=percent; // avoid a warning
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ static __inline void setviewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
/* Initialise your display */
|
||||
init_board();
|
||||
|
||||
|
@ -219,7 +219,7 @@ bool_t lld_gdisp_init(void) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
|
||||
#endif
|
||||
|
@ -241,7 +241,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
unsigned i, tuples;
|
||||
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
|
@ -276,7 +276,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
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) {
|
||||
void gdisp_lld_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;
|
||||
color_t c1, c2;
|
||||
#if GDISP_PACKED_PIXELS
|
||||
|
@ -386,7 +386,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
||||
/* NOT IMPLEMENTED */
|
||||
/* Some board hardware might support this in the future.
|
||||
* The Olimex board doesn't.
|
||||
|
@ -407,7 +407,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
/* NOT IMPLEMENTED */
|
||||
/* The hardware seems capable of doing this.
|
||||
* It is just really complex so we leave it out for now.
|
||||
|
@ -435,7 +435,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
/* The hardware is capable of supporting...
|
||||
* GDISP_CONTROL_POWER - not implemented yet
|
||||
* GDISP_CONTROL_ORIENTATION - not implemented yet
|
||||
|
@ -456,7 +456,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
// Code here
|
||||
/* You may need this ---
|
||||
* if (GDISP.Powermode != powerSleep)
|
||||
* lld_gdisp_init();
|
||||
* gdisp_lld_init();
|
||||
*/
|
||||
break;
|
||||
case powerSleep:
|
||||
|
|
|
@ -112,7 +112,7 @@ static __inline void setviewport(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
/* Initialise your display */
|
||||
init_board();
|
||||
|
||||
|
@ -174,7 +174,7 @@ bool_t lld_gdisp_init(void) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
|
||||
#endif
|
||||
|
@ -196,7 +196,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
unsigned i, tuples;
|
||||
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
|
@ -231,7 +231,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
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) {
|
||||
void gdisp_lld_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;
|
||||
color_t c1, c2;
|
||||
#if GDISP_PACKED_PIXELS
|
||||
|
@ -341,7 +341,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
||||
/* NOT IMPLEMENTED */
|
||||
/* Some board hardware might support this in the future.
|
||||
* The Olimex board doesn't.
|
||||
|
@ -362,7 +362,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
/* NOT IMPLEMENTED */
|
||||
/* The hardware seems capable of doing this.
|
||||
* It is just really complex so we leave it out for now.
|
||||
|
@ -390,7 +390,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
/* The hardware is capable of supporting...
|
||||
* GDISP_CONTROL_POWER - not implemented yet
|
||||
* GDISP_CONTROL_ORIENTATION - not implemented yet
|
||||
|
@ -411,7 +411,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
// Code here
|
||||
/* You may need this ---
|
||||
* if (GDISP.Powermode != powerSleep)
|
||||
* lld_gdisp_init();
|
||||
* gdisp_lld_init();
|
||||
*/
|
||||
break;
|
||||
case powerSleep:
|
||||
|
|
|
@ -150,7 +150,7 @@ static __inline void reset_viewport(void) {
|
|||
}
|
||||
}
|
||||
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
/* initialize the hardware */
|
||||
init_board();
|
||||
|
||||
|
@ -255,7 +255,7 @@ bool_t lld_gdisp_init(void) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
|
||||
#endif
|
||||
|
@ -277,7 +277,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_clear(color_t color) {
|
||||
void gdisp_lld_clear(color_t color) {
|
||||
unsigned i;
|
||||
|
||||
acquire_bus();
|
||||
|
@ -303,7 +303,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
unsigned i, area;
|
||||
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
|
@ -339,7 +339,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
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) {
|
||||
void gdisp_lld_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;
|
||||
unsigned lg;
|
||||
|
||||
|
@ -379,7 +379,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
||||
/* This routine is marked "DO NOT USE" in the original
|
||||
* GLCD driver. We just keep our GDISP_HARDWARE_READPIXEL
|
||||
* turned off for now.
|
||||
|
@ -418,7 +418,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_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.
|
||||
* For now we just leave the GDISP_HARDWARE_SCROLL off.
|
||||
*/
|
||||
|
@ -495,7 +495,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
switch(what) {
|
||||
case GDISP_CONTROL_POWER:
|
||||
if (GDISP.Powermode == (gdisp_powermode_t)value)
|
||||
|
@ -508,7 +508,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
/* Code here */
|
||||
/* You may need this ---
|
||||
if (GDISP.Powermode != powerSleep)
|
||||
lld_gdisp_init();
|
||||
gdisp_lld_init();
|
||||
*/
|
||||
/* break; */
|
||||
case powerSleep:
|
||||
|
|
|
@ -157,7 +157,7 @@ static __inline void reset_viewport(void) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
/* Initialise your display */
|
||||
init_board();
|
||||
|
||||
|
@ -243,7 +243,7 @@ bool_t lld_gdisp_init(void) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
|
||||
#endif
|
||||
|
@ -280,7 +280,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_clear(color_t color) {
|
||||
void gdisp_lld_clear(color_t color) {
|
||||
unsigned i;
|
||||
|
||||
acquire_bus();
|
||||
|
@ -305,7 +305,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
unsigned i, area;
|
||||
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
|
@ -341,7 +341,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
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) {
|
||||
void gdisp_lld_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;
|
||||
unsigned lg;
|
||||
|
||||
|
@ -380,7 +380,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t color;
|
||||
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
|
@ -413,7 +413,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_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)];
|
||||
coord_t row0, row1;
|
||||
unsigned i, gap, abslines, j;
|
||||
|
@ -489,7 +489,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
switch(what) {
|
||||
case GDISP_CONTROL_POWER:
|
||||
if (GDISP.Powermode == (gdisp_powermode_t)value)
|
||||
|
@ -508,7 +508,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
write_reg(0x0010, 0x0000); // leave sleep mode
|
||||
release_bus();
|
||||
if (GDISP.Powermode != powerSleep)
|
||||
lld_gdisp_init();
|
||||
gdisp_lld_init();
|
||||
break;
|
||||
case powerSleep:
|
||||
acquire_bus();
|
||||
|
|
|
@ -187,7 +187,7 @@ __inline void GDISP_LLD(readstream)(uint16_t *buffer, size_t size) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
/* Initialise the display */
|
||||
|
||||
#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
|
||||
*/
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
|
||||
#endif
|
||||
|
@ -381,7 +381,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_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 (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
|
||||
|
@ -430,7 +430,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
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) {
|
||||
void gdisp_lld_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 (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; srcx += GDISP.clipx0 - x; x = GDISP.clipx0; }
|
||||
|
@ -486,7 +486,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_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 (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
|
||||
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
|
||||
|
@ -535,7 +535,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
/* NOT IMPLEMENTED YET */
|
||||
switch(what) {
|
||||
case GDISP_CONTROL_POWER:
|
||||
|
@ -552,7 +552,7 @@ void lld_gdisp_draw_pixel(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);
|
||||
if (GDISP.Powermode != powerSleep)
|
||||
lld_gdisp_init();
|
||||
gdisp_lld_init();
|
||||
GDISP_LLD(writeindex)(SSD1963_SET_DISPLAY_ON);
|
||||
|
||||
break;
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
/* Initialise the GDISP structure */
|
||||
GDISP.Width = GDISP_SCREEN_WIDTH;
|
||||
GDISP.Height = GDISP_SCREEN_HEIGHT;
|
||||
|
@ -79,7 +79,7 @@ bool_t lld_gdisp_init(void) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
(void)x;
|
||||
(void)y;
|
||||
(void)color;
|
||||
|
@ -97,7 +97,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
||||
(void)x;
|
||||
(void)y;
|
||||
|
||||
|
@ -119,7 +119,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
(void)x;
|
||||
(void)y;
|
||||
(void)cx;
|
||||
|
|
|
@ -314,7 +314,7 @@ static DWORD WINAPI WindowThread(LPVOID lpParameter) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
bool_t lld_gdisp_init(void) {
|
||||
bool_t gdisp_lld_init(void) {
|
||||
RECT rect;
|
||||
|
||||
/* Set the window dimensions */
|
||||
|
@ -356,7 +356,7 @@ bool_t lld_gdisp_init(void) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) {
|
||||
HDC dc;
|
||||
#if WIN32_USE_MSG_REDRAW
|
||||
RECT rect;
|
||||
|
@ -422,7 +422,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) {
|
||||
void gdisp_lld_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) {
|
||||
POINT p;
|
||||
HPEN pen;
|
||||
HDC dc;
|
||||
|
@ -550,7 +550,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
HDC dc;
|
||||
RECT rect;
|
||||
HBRUSH hbr;
|
||||
|
@ -681,7 +681,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
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) {
|
||||
void gdisp_lld_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;
|
||||
RECT rect;
|
||||
#if GDISP_NEED_CONTROL
|
||||
|
@ -788,7 +788,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y) {
|
||||
color_t color;
|
||||
|
||||
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
|
||||
|
@ -834,7 +834,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
void gdisp_lld_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
|
||||
RECT rect, frect, srect;
|
||||
HBRUSH hbr;
|
||||
|
||||
|
@ -958,7 +958,7 @@ void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
switch(what) {
|
||||
case GDISP_CONTROL_ORIENTATION:
|
||||
if (GDISP.Orientation == (gdisp_orientation_t)value)
|
||||
|
|
|
@ -201,26 +201,26 @@ extern "C" {
|
|||
#else
|
||||
|
||||
/* The same as above but use the low level driver directly if no multi-thread support is needed */
|
||||
#define gdispInit(gdisp) lld_gdisp_init()
|
||||
#define gdispInit(gdisp) gdisp_lld_init()
|
||||
#define gdispIsBusy() FALSE
|
||||
#define gdispClear(color) lld_gdisp_clear(color)
|
||||
#define gdispDrawPixel(x, y, color) lld_gdisp_draw_pixel(x, y, color)
|
||||
#define gdispDrawLine(x0, y0, x1, y1, color) lld_gdisp_draw_line(x0, y0, x1, y1, color)
|
||||
#define gdispFillArea(x, y, cx, cy, color) lld_gdisp_fill_area(x, y, cx, cy, color)
|
||||
#define gdispBlitAreaEx(x, y, cx, cy, sx, sy, scx, buf) lld_gdisp_blit_area_ex(x, y, cx, cy, sx, sy, scx, buf)
|
||||
#define gdispSetClip(x, y, cx, cy) lld_gdisp_set_clip(x, y, cx, cy)
|
||||
#define gdispDrawCircle(x, y, radius, color) lld_gdisp_draw_circle(x, y, radius, color)
|
||||
#define gdispFillCircle(x, y, radius, color) lld_gdisp_fill_circle(x, y, radius, color)
|
||||
#define gdispDrawArc(x, y, radius, sangle, eangle, color) lld_gdisp_draw_arc(x, y, radius, sangle, eangle, color)
|
||||
#define gdispFillArc(x, y, radius, sangle, eangle, color) lld_gdisp_fill_arc(x, y, radius, sangle, eangle, color)
|
||||
#define gdispDrawEllipse(x, y, a, b, color) lld_gdisp_draw_ellipse(x, y, a, b, color)
|
||||
#define gdispFillEllipse(x, y, a, b, color) lld_gdisp_fill_ellipse(x, y, a, b, color)
|
||||
#define gdispDrawChar(x, y, c, font, color) lld_gdisp_draw_char(x, y, c, font, color)
|
||||
#define gdispFillChar(x, y, c, font, color, bgcolor) lld_gdisp_fill_char(x, y, c, font, color, bgcolor)
|
||||
#define gdispGetPixelColor(x, y) lld_gdisp_get_pixel_color(x, y)
|
||||
#define gdispVerticalScroll(x, y, cx, cy, lines, bgcolor) lld_gdisp_vertical_scroll(x, y, cx, cy, lines, bgcolor)
|
||||
#define gdispControl(what, value) lld_gdisp_control(what, value)
|
||||
#define gdispQuery(what) lld_gdisp_query(what)
|
||||
#define gdispClear(color) gdisp_lld_clear(color)
|
||||
#define gdispDrawPixel(x, y, color) gdisp_lld_draw_pixel(x, y, color)
|
||||
#define gdispDrawLine(x0, y0, x1, y1, color) gdisp_lld_draw_line(x0, y0, x1, y1, color)
|
||||
#define gdispFillArea(x, y, cx, cy, color) gdisp_lld_fill_area(x, y, cx, cy, color)
|
||||
#define gdispBlitAreaEx(x, y, cx, cy, sx, sy, scx, buf) gdisp_lld_blit_area_ex(x, y, cx, cy, sx, sy, scx, buf)
|
||||
#define gdispSetClip(x, y, cx, cy) gdisp_lld_set_clip(x, y, cx, cy)
|
||||
#define gdispDrawCircle(x, y, radius, color) gdisp_lld_draw_circle(x, y, radius, color)
|
||||
#define gdispFillCircle(x, y, radius, color) gdisp_lld_fill_circle(x, y, radius, color)
|
||||
#define gdispDrawArc(x, y, radius, sangle, eangle, color) gdisp_lld_draw_arc(x, y, radius, sangle, eangle, color)
|
||||
#define gdispFillArc(x, y, radius, sangle, eangle, color) gdisp_lld_fill_arc(x, y, radius, sangle, eangle, color)
|
||||
#define gdispDrawEllipse(x, y, a, b, color) gdisp_lld_draw_ellipse(x, y, a, b, color)
|
||||
#define gdispFillEllipse(x, y, a, b, color) gdisp_lld_fill_ellipse(x, y, a, b, color)
|
||||
#define gdispDrawChar(x, y, c, font, color) gdisp_lld_draw_char(x, y, c, font, color)
|
||||
#define gdispFillChar(x, y, c, font, color, bgcolor) gdisp_lld_fill_char(x, y, c, font, color, bgcolor)
|
||||
#define gdispGetPixelColor(x, y) gdisp_lld_get_pixel_color(x, y)
|
||||
#define gdispVerticalScroll(x, y, cx, cy, lines, bgcolor) gdisp_lld_vertical_scroll(x, y, cx, cy, lines, bgcolor)
|
||||
#define gdispControl(what, value) gdisp_lld_control(what, value)
|
||||
#define gdispQuery(what) gdisp_lld_query(what)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -52,13 +52,13 @@
|
|||
#endif
|
||||
|
||||
#if !GDISP_HARDWARE_CLEARS
|
||||
void lld_gdisp_clear(color_t color) {
|
||||
lld_gdisp_fill_area(0, 0, GDISP.Width, GDISP.Height, color);
|
||||
void gdisp_lld_clear(color_t color) {
|
||||
gdisp_lld_fill_area(0, 0, GDISP.Width, GDISP.Height, color);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !GDISP_HARDWARE_LINES
|
||||
void lld_gdisp_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) {
|
||||
void gdisp_lld_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) {
|
||||
int16_t dy, dx;
|
||||
int16_t addx, addy;
|
||||
int16_t P, diff, i;
|
||||
|
@ -67,16 +67,16 @@
|
|||
// speed improvement if vertical or horizontal
|
||||
if (x0 == x1) {
|
||||
if (y1 > y0)
|
||||
lld_gdisp_fill_area(x0, y0, 1, y1-y0+1, color);
|
||||
gdisp_lld_fill_area(x0, y0, 1, y1-y0+1, color);
|
||||
else
|
||||
lld_gdisp_fill_area(x0, y1, 1, y0-y1+1, color);
|
||||
gdisp_lld_fill_area(x0, y1, 1, y0-y1+1, color);
|
||||
return;
|
||||
}
|
||||
if (y0 == y1) {
|
||||
if (x1 > x0)
|
||||
lld_gdisp_fill_area(x0, y0, x1-x0+1, 1, color);
|
||||
gdisp_lld_fill_area(x0, y0, x1-x0+1, 1, color);
|
||||
else
|
||||
lld_gdisp_fill_area(x0, y1, x0-x1+1, 1, color);
|
||||
gdisp_lld_fill_area(x0, y1, x0-x1+1, 1, color);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -102,7 +102,7 @@
|
|||
diff = P - dx;
|
||||
|
||||
for(i=0; i<=dx; ++i) {
|
||||
lld_gdisp_draw_pixel(x0, y0, color);
|
||||
gdisp_lld_draw_pixel(x0, y0, color);
|
||||
if (P < 0) {
|
||||
P += dy;
|
||||
x0 += addx;
|
||||
|
@ -118,7 +118,7 @@
|
|||
diff = P - dy;
|
||||
|
||||
for(i=0; i<=dy; ++i) {
|
||||
lld_gdisp_draw_pixel(x0, y0, color);
|
||||
gdisp_lld_draw_pixel(x0, y0, color);
|
||||
if (P < 0) {
|
||||
P += dx;
|
||||
y0 += addy;
|
||||
|
@ -133,16 +133,16 @@
|
|||
#endif
|
||||
|
||||
#if !GDISP_HARDWARE_FILLS
|
||||
void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
void gdisp_lld_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
|
||||
#if GDISP_HARDWARE_SCROLL
|
||||
lld_gdisp_vertical_scroll(x, y, cx, cy, cy, color);
|
||||
gdisp_lld_vertical_scroll(x, y, cx, cy, cy, color);
|
||||
#elif GDISP_HARDWARE_LINES
|
||||
coord_t x1, y1;
|
||||
|
||||
x1 = x + cx - 1;
|
||||
y1 = y + cy;
|
||||
for(; y < y1; y++)
|
||||
lld_gdisp_draw_line(x, y, x1, y, color);
|
||||
gdisp_lld_draw_line(x, y, x1, y, color);
|
||||
#else
|
||||
coord_t x0, x1, y1;
|
||||
|
||||
|
@ -151,13 +151,13 @@
|
|||
y1 = y + cy;
|
||||
for(; y < y1; y++)
|
||||
for(x = x0; x < x1; x++)
|
||||
lld_gdisp_draw_pixel(x, y, color);
|
||||
gdisp_lld_draw_pixel(x, y, color);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !GDISP_HARDWARE_BITFILLS
|
||||
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) {
|
||||
void gdisp_lld_blit_area_ex(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
|
||||
coord_t x0, x1, y1;
|
||||
|
||||
x0 = x;
|
||||
|
@ -167,12 +167,12 @@
|
|||
srccx -= cx;
|
||||
for(; y < y1; y++, buffer += srccx)
|
||||
for(x=x0; x < x1; x++)
|
||||
lld_gdisp_draw_pixel(x, y, *buffer++);
|
||||
gdisp_lld_draw_pixel(x, y, *buffer++);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_CLIP && !GDISP_HARDWARE_CLIP
|
||||
void lld_gdisp_set_clip(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||
void gdisp_lld_set_clip(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||
#if GDISP_NEED_VALIDATION
|
||||
if (x >= GDISP.Width || y >= GDISP.Height || cx < 0 || cy < 0)
|
||||
return;
|
||||
|
@ -189,7 +189,7 @@
|
|||
#endif
|
||||
|
||||
#if GDISP_NEED_CIRCLE && !GDISP_HARDWARE_CIRCLES
|
||||
void lld_gdisp_draw_circle(coord_t x, coord_t y, coord_t radius, color_t color) {
|
||||
void gdisp_lld_draw_circle(coord_t x, coord_t y, coord_t radius, color_t color) {
|
||||
coord_t a, b, P;
|
||||
|
||||
a = 0;
|
||||
|
@ -197,14 +197,14 @@
|
|||
P = 1 - radius;
|
||||
|
||||
do {
|
||||
lld_gdisp_draw_pixel(x+a, y+b, color);
|
||||
lld_gdisp_draw_pixel(x+b, y+a, color);
|
||||
lld_gdisp_draw_pixel(x-a, y+b, color);
|
||||
lld_gdisp_draw_pixel(x-b, y+a, color);
|
||||
lld_gdisp_draw_pixel(x+b, y-a, color);
|
||||
lld_gdisp_draw_pixel(x+a, y-b, color);
|
||||
lld_gdisp_draw_pixel(x-a, y-b, color);
|
||||
lld_gdisp_draw_pixel(x-b, y-a, color);
|
||||
gdisp_lld_draw_pixel(x+a, y+b, color);
|
||||
gdisp_lld_draw_pixel(x+b, y+a, color);
|
||||
gdisp_lld_draw_pixel(x-a, y+b, color);
|
||||
gdisp_lld_draw_pixel(x-b, y+a, color);
|
||||
gdisp_lld_draw_pixel(x+b, y-a, color);
|
||||
gdisp_lld_draw_pixel(x+a, y-b, color);
|
||||
gdisp_lld_draw_pixel(x-a, y-b, color);
|
||||
gdisp_lld_draw_pixel(x-b, y-a, color);
|
||||
if (P < 0)
|
||||
P += 3 + 2*a++;
|
||||
else
|
||||
|
@ -214,7 +214,7 @@
|
|||
#endif
|
||||
|
||||
#if GDISP_NEED_CIRCLE && !GDISP_HARDWARE_CIRCLEFILLS
|
||||
void lld_gdisp_fill_circle(coord_t x, coord_t y, coord_t radius, color_t color) {
|
||||
void gdisp_lld_fill_circle(coord_t x, coord_t y, coord_t radius, color_t color) {
|
||||
coord_t a, b, P;
|
||||
|
||||
a = 0;
|
||||
|
@ -222,10 +222,10 @@
|
|||
P = 1 - radius;
|
||||
|
||||
do {
|
||||
lld_gdisp_draw_line(x-a, y+b, x+a, y+b, color);
|
||||
lld_gdisp_draw_line(x-a, y-b, x+a, y-b, color);
|
||||
lld_gdisp_draw_line(x-b, y+a, x+b, y+a, color);
|
||||
lld_gdisp_draw_line(x-b, y-a, x+b, y-a, color);
|
||||
gdisp_lld_draw_line(x-a, y+b, x+a, y+b, color);
|
||||
gdisp_lld_draw_line(x-a, y-b, x+a, y-b, color);
|
||||
gdisp_lld_draw_line(x-b, y+a, x+b, y+a, color);
|
||||
gdisp_lld_draw_line(x-b, y-a, x+b, y-a, color);
|
||||
if (P < 0)
|
||||
P += 3 + 2*a++;
|
||||
else
|
||||
|
@ -235,16 +235,16 @@
|
|||
#endif
|
||||
|
||||
#if GDISP_NEED_ELLIPSE && !GDISP_HARDWARE_ELLIPSES
|
||||
void lld_gdisp_draw_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
|
||||
void gdisp_lld_draw_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
|
||||
int dx = 0, dy = b; /* im I. Quadranten von links oben nach rechts unten */
|
||||
long a2 = a*a, b2 = b*b;
|
||||
long err = b2-(2*b-1)*a2, e2; /* Fehler im 1. Schritt */
|
||||
|
||||
do {
|
||||
lld_gdisp_draw_pixel(x+dx, y+dy, color); /* I. Quadrant */
|
||||
lld_gdisp_draw_pixel(x-dx, y+dy, color); /* II. Quadrant */
|
||||
lld_gdisp_draw_pixel(x-dx, y-dy, color); /* III. Quadrant */
|
||||
lld_gdisp_draw_pixel(x+dx, y-dy, color); /* IV. Quadrant */
|
||||
gdisp_lld_draw_pixel(x+dx, y+dy, color); /* I. Quadrant */
|
||||
gdisp_lld_draw_pixel(x-dx, y+dy, color); /* II. Quadrant */
|
||||
gdisp_lld_draw_pixel(x-dx, y-dy, color); /* III. Quadrant */
|
||||
gdisp_lld_draw_pixel(x+dx, y-dy, color); /* IV. Quadrant */
|
||||
|
||||
e2 = 2*err;
|
||||
if(e2 < (2*dx+1)*b2) {
|
||||
|
@ -258,21 +258,21 @@
|
|||
} while(dy >= 0);
|
||||
|
||||
while(dx++ < a) { /* fehlerhafter Abbruch bei flachen Ellipsen (b=1) */
|
||||
lld_gdisp_draw_pixel(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
|
||||
lld_gdisp_draw_pixel(x-dx, y, color);
|
||||
gdisp_lld_draw_pixel(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
|
||||
gdisp_lld_draw_pixel(x-dx, y, color);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ELLIPSE && !GDISP_HARDWARE_ELLIPSEFILLS
|
||||
void lld_gdisp_fill_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
|
||||
void gdisp_lld_fill_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
|
||||
int dx = 0, dy = b; /* im I. Quadranten von links oben nach rechts unten */
|
||||
long a2 = a*a, b2 = b*b;
|
||||
long err = b2-(2*b-1)*a2, e2; /* Fehler im 1. Schritt */
|
||||
|
||||
do {
|
||||
lld_gdisp_draw_line(x-dx,y+dy,x+dx,y+dy, color);
|
||||
lld_gdisp_draw_line(x-dx,y-dy,x+dx,y-dy, color);
|
||||
gdisp_lld_draw_line(x-dx,y+dy,x+dx,y+dy, color);
|
||||
gdisp_lld_draw_line(x-dx,y-dy,x+dx,y-dy, color);
|
||||
|
||||
e2 = 2*err;
|
||||
if(e2 < (2*dx+1)*b2) {
|
||||
|
@ -286,8 +286,8 @@
|
|||
} while(dy >= 0);
|
||||
|
||||
while(dx++ < a) { /* fehlerhafter Abbruch bei flachen Ellipsen (b=1) */
|
||||
lld_gdisp_draw_pixel(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
|
||||
lld_gdisp_draw_pixel(x-dx, y, color);
|
||||
gdisp_lld_draw_pixel(x+dx, y, color); /* -> Spitze der Ellipse vollenden */
|
||||
gdisp_lld_draw_pixel(x-dx, y, color);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -325,13 +325,13 @@
|
|||
|
||||
do {
|
||||
if(x-a <= x_maxI && x-a >= x_minI)
|
||||
lld_gdisp_draw_pixel(x-a, y-b, color);
|
||||
gdisp_lld_draw_pixel(x-a, y-b, color);
|
||||
if(x+a <= x_maxI && x+a >= x_minI)
|
||||
lld_gdisp_draw_pixel(x+a, y-b, color);
|
||||
gdisp_lld_draw_pixel(x+a, y-b, color);
|
||||
if(x-b <= x_maxI && x-b >= x_minI)
|
||||
lld_gdisp_draw_pixel(x-b, y-a, color);
|
||||
gdisp_lld_draw_pixel(x-b, y-a, color);
|
||||
if(x+b <= x_maxI && x+b >= x_minI)
|
||||
lld_gdisp_draw_pixel(x+b, y-a, color);
|
||||
gdisp_lld_draw_pixel(x+b, y-a, color);
|
||||
|
||||
if (P < 0) {
|
||||
P = P + 3 + 2*a;
|
||||
|
@ -359,13 +359,13 @@
|
|||
|
||||
do {
|
||||
if(x-a <= x_maxII && x-a >= x_minII)
|
||||
lld_gdisp_draw_pixel(x-a, y+b, color);
|
||||
gdisp_lld_draw_pixel(x-a, y+b, color);
|
||||
if(x+a <= x_maxII && x+a >= x_minII)
|
||||
lld_gdisp_draw_pixel(x+a, y+b, color);
|
||||
gdisp_lld_draw_pixel(x+a, y+b, color);
|
||||
if(x-b <= x_maxII && x-b >= x_minII)
|
||||
lld_gdisp_draw_pixel(x-b, y+a, color);
|
||||
gdisp_lld_draw_pixel(x-b, y+a, color);
|
||||
if(x+b <= x_maxII && x+b >= x_minII)
|
||||
lld_gdisp_draw_pixel(x+b, y+a, color);
|
||||
gdisp_lld_draw_pixel(x+b, y+a, color);
|
||||
|
||||
if (P < 0) {
|
||||
P = P + 3 + 2*a;
|
||||
|
@ -379,7 +379,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
void lld_gdisp_draw_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) {
|
||||
void gdisp_lld_draw_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) {
|
||||
if(endangle < startangle) {
|
||||
_draw_arc(x, y, startangle, 360, radius, color);
|
||||
_draw_arc(x, y, 0, endangle, radius, color);
|
||||
|
@ -419,13 +419,13 @@
|
|||
|
||||
do {
|
||||
if(x-a <= x_maxI && x-a >= x_minI)
|
||||
lld_gdisp_draw_line(x, y, x-a, y-b, color);
|
||||
gdisp_lld_draw_line(x, y, x-a, y-b, color);
|
||||
if(x+a <= x_maxI && x+a >= x_minI)
|
||||
lld_gdisp_draw_line(x, y, x+a, y-b, color);
|
||||
gdisp_lld_draw_line(x, y, x+a, y-b, color);
|
||||
if(x-b <= x_maxI && x-b >= x_minI)
|
||||
lld_gdisp_draw_line(x, y, x-b, y-a, color);
|
||||
gdisp_lld_draw_line(x, y, x-b, y-a, color);
|
||||
if(x+b <= x_maxI && x+b >= x_minI)
|
||||
lld_gdisp_draw_line(x, y, x+b, y-a, color);
|
||||
gdisp_lld_draw_line(x, y, x+b, y-a, color);
|
||||
|
||||
if (P < 0) {
|
||||
P = P + 3 + 2*a;
|
||||
|
@ -453,13 +453,13 @@
|
|||
|
||||
do {
|
||||
if(x-a <= x_maxII && x-a >= x_minII)
|
||||
lld_gdisp_draw_line(x, y, x-a, y+b, color);
|
||||
gdisp_lld_draw_line(x, y, x-a, y+b, color);
|
||||
if(x+a <= x_maxII && x+a >= x_minII)
|
||||
lld_gdisp_draw_line(x, y, x+a, y+b, color);
|
||||
gdisp_lld_draw_line(x, y, x+a, y+b, color);
|
||||
if(x-b <= x_maxII && x-b >= x_minII)
|
||||
lld_gdisp_draw_line(x, y, x-b, y+a, color);
|
||||
gdisp_lld_draw_line(x, y, x-b, y+a, color);
|
||||
if(x+b <= x_maxII && x+b >= x_minII)
|
||||
lld_gdisp_draw_line(x, y, x+b, y+a, color);
|
||||
gdisp_lld_draw_line(x, y, x+b, y+a, color);
|
||||
|
||||
if (P < 0) {
|
||||
P = P + 3 + 2*a;
|
||||
|
@ -473,7 +473,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
void lld_gdisp_fill_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) {
|
||||
void gdisp_lld_fill_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color) {
|
||||
if(endangle < startangle) {
|
||||
_fill_arc(x, y, startangle, 360, radius, color);
|
||||
_fill_arc(x, y, 0, endangle, radius, color);
|
||||
|
@ -488,7 +488,7 @@
|
|||
#endif
|
||||
|
||||
#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT
|
||||
void lld_gdisp_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color) {
|
||||
void gdisp_lld_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color) {
|
||||
const fontcolumn_t *ptr;
|
||||
fontcolumn_t column;
|
||||
coord_t width, height, xscale, yscale;
|
||||
|
@ -515,7 +515,7 @@
|
|||
if (column & 0x01) {
|
||||
for(xs=0; xs < xscale; xs++)
|
||||
for(ys=0; ys < yscale; ys++)
|
||||
lld_gdisp_draw_pixel(x+i+xs, y+j+ys, color);
|
||||
gdisp_lld_draw_pixel(x+i+xs, y+j+ys, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -523,7 +523,7 @@
|
|||
#endif
|
||||
|
||||
#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXTFILLS
|
||||
void lld_gdisp_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor) {
|
||||
void gdisp_lld_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor) {
|
||||
coord_t width, height;
|
||||
coord_t xscale, yscale;
|
||||
|
||||
|
@ -540,10 +540,10 @@
|
|||
#if GDISP_HARDWARE_TEXT || GDISP_SOFTWARE_TEXTFILLDRAW
|
||||
|
||||
/* Fill the area */
|
||||
lld_gdisp_fill_area(x, y, width, height, bgcolor);
|
||||
gdisp_lld_fill_area(x, y, width, height, bgcolor);
|
||||
|
||||
/* Draw the text */
|
||||
lld_gdisp_draw_char(x, y, c, font, color);
|
||||
gdisp_lld_draw_char(x, y, c, font, color);
|
||||
|
||||
/* Method 2: Create a single column bitmap and then blit it */
|
||||
#elif GDISP_HARDWARE_BITFILLS && GDISP_SOFTWARE_TEXTBLITCOLUMN
|
||||
|
@ -582,7 +582,7 @@
|
|||
}
|
||||
|
||||
for(xs=0; xs < xscale; xs++)
|
||||
lld_gdisp_blit_area_ex(x+i+xs, y, 1, height, 0, 0, 1, buf);
|
||||
gdisp_lld_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 */
|
||||
lld_gdisp_blit_area_ex(x, y, width, height, 0, 0, width, buf);
|
||||
gdisp_lld_blit_area_ex(x, y, width, height, 0, 0, width, buf);
|
||||
}
|
||||
|
||||
/* Method 4: Draw pixel by pixel */
|
||||
|
@ -648,11 +648,11 @@
|
|||
if (column & 0x01) {
|
||||
for(xs=0; xs < xscale; xs++)
|
||||
for(ys=0; ys < yscale; ys++)
|
||||
lld_gdisp_draw_pixel(x+i+xs, y+j+ys, color);
|
||||
gdisp_lld_draw_pixel(x+i+xs, y+j+ys, color);
|
||||
} else {
|
||||
for(xs=0; xs < xscale; xs++)
|
||||
for(ys=0; ys < yscale; ys++)
|
||||
lld_gdisp_draw_pixel(x+i+xs, y+j+ys, bgcolor);
|
||||
gdisp_lld_draw_pixel(x+i+xs, y+j+ys, bgcolor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -663,7 +663,7 @@
|
|||
|
||||
|
||||
#if GDISP_NEED_CONTROL && !GDISP_HARDWARE_CONTROL
|
||||
void lld_gdisp_control(unsigned what, void *value) {
|
||||
void gdisp_lld_control(unsigned what, void *value) {
|
||||
(void)what;
|
||||
(void)value;
|
||||
/* Ignore everything */
|
||||
|
@ -671,7 +671,7 @@
|
|||
#endif
|
||||
|
||||
#if !GDISP_HARDWARE_QUERY
|
||||
void *lld_gdisp_query(unsigned what) {
|
||||
void *gdisp_lld_query(unsigned what) {
|
||||
switch(what) {
|
||||
case GDISP_QUERY_WIDTH: return (void *)(unsigned)GDISP.Width;
|
||||
case GDISP_QUERY_HEIGHT: return (void *)(unsigned)GDISP.Height;
|
||||
|
@ -685,82 +685,82 @@ void *lld_gdisp_query(unsigned what) {
|
|||
#endif
|
||||
|
||||
#if GDISP_NEED_MSGAPI
|
||||
void lld_gdisp_msg_dispatch(gdisp_lld_msg_t *msg) {
|
||||
void gdisp_lld_msg_dispatch(gdisp_lld_msg_t *msg) {
|
||||
switch(msg->action) {
|
||||
case GDISP_LLD_MSG_NOP:
|
||||
break;
|
||||
case GDISP_LLD_MSG_INIT:
|
||||
lld_gdisp_init();
|
||||
gdisp_lld_init();
|
||||
break;
|
||||
case GDISP_LLD_MSG_CLEAR:
|
||||
lld_gdisp_clear(msg->clear.color);
|
||||
gdisp_lld_clear(msg->clear.color);
|
||||
break;
|
||||
case GDISP_LLD_MSG_DRAWPIXEL:
|
||||
lld_gdisp_draw_pixel(msg->drawpixel.x, msg->drawpixel.y, msg->drawpixel.color);
|
||||
gdisp_lld_draw_pixel(msg->drawpixel.x, msg->drawpixel.y, msg->drawpixel.color);
|
||||
break;
|
||||
case GDISP_LLD_MSG_FILLAREA:
|
||||
lld_gdisp_fill_area(msg->fillarea.x, msg->fillarea.y, msg->fillarea.cx, msg->fillarea.cy, msg->fillarea.color);
|
||||
gdisp_lld_fill_area(msg->fillarea.x, msg->fillarea.y, msg->fillarea.cx, msg->fillarea.cy, msg->fillarea.color);
|
||||
break;
|
||||
case GDISP_LLD_MSG_BLITAREA:
|
||||
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);
|
||||
gdisp_lld_blit_area_ex(msg->blitarea.x, msg->blitarea.y, msg->blitarea.cx, msg->blitarea.cy, msg->blitarea.srcx, msg->blitarea.srcy, msg->blitarea.srccx, msg->blitarea.buffer);
|
||||
break;
|
||||
case GDISP_LLD_MSG_DRAWLINE:
|
||||
lld_gdisp_draw_line(msg->drawline.x0, msg->drawline.y0, msg->drawline.x1, msg->drawline.y1, msg->drawline.color);
|
||||
gdisp_lld_draw_line(msg->drawline.x0, msg->drawline.y0, msg->drawline.x1, msg->drawline.y1, msg->drawline.color);
|
||||
break;
|
||||
#if GDISP_NEED_CLIP
|
||||
case GDISP_LLD_MSG_SETCLIP:
|
||||
lld_gdisp_set_clip(msg->setclip.x, msg->setclip.y, msg->setclip.cx, msg->setclip.cy);
|
||||
gdisp_lld_set_clip(msg->setclip.x, msg->setclip.y, msg->setclip.cx, msg->setclip.cy);
|
||||
break;
|
||||
#endif
|
||||
#if GDISP_NEED_CIRCLE
|
||||
case GDISP_LLD_MSG_DRAWCIRCLE:
|
||||
lld_gdisp_draw_circle(msg->drawcircle.x, msg->drawcircle.y, msg->drawcircle.radius, msg->drawcircle.color);
|
||||
gdisp_lld_draw_circle(msg->drawcircle.x, msg->drawcircle.y, msg->drawcircle.radius, msg->drawcircle.color);
|
||||
break;
|
||||
case GDISP_LLD_MSG_FILLCIRCLE:
|
||||
lld_gdisp_fill_circle(msg->fillcircle.x, msg->fillcircle.y, msg->fillcircle.radius, msg->fillcircle.color);
|
||||
gdisp_lld_fill_circle(msg->fillcircle.x, msg->fillcircle.y, msg->fillcircle.radius, msg->fillcircle.color);
|
||||
break;
|
||||
#endif
|
||||
#if GDISP_NEED_ELLIPSE
|
||||
case GDISP_LLD_MSG_DRAWELLIPSE:
|
||||
lld_gdisp_draw_ellipse(msg->drawellipse.x, msg->drawellipse.y, msg->drawellipse.a, msg->drawellipse.b, msg->drawellipse.color);
|
||||
gdisp_lld_draw_ellipse(msg->drawellipse.x, msg->drawellipse.y, msg->drawellipse.a, msg->drawellipse.b, msg->drawellipse.color);
|
||||
break;
|
||||
case GDISP_LLD_MSG_FILLELLIPSE:
|
||||
lld_gdisp_fill_ellipse(msg->fillellipse.x, msg->fillellipse.y, msg->fillellipse.a, msg->fillellipse.b, msg->fillellipse.color);
|
||||
gdisp_lld_fill_ellipse(msg->fillellipse.x, msg->fillellipse.y, msg->fillellipse.a, msg->fillellipse.b, msg->fillellipse.color);
|
||||
break;
|
||||
#endif
|
||||
#if GDISP_NEED_ARC
|
||||
case GDISP_LLD_MSG_DRAWARC:
|
||||
lld_gdisp_draw_circle(msg->drawarc.x, msg->drawarc.y, msg->drawarc.radius, msg->drawarc.startangle, msg->drawarc.endangle, msg->drawarc.color);
|
||||
gdisp_lld_draw_circle(msg->drawarc.x, msg->drawarc.y, msg->drawarc.radius, msg->drawarc.startangle, msg->drawarc.endangle, msg->drawarc.color);
|
||||
break;
|
||||
case GDISP_LLD_MSG_FILLARC:
|
||||
lld_gdisp_fill_circle(msg->fillarc.x, msg->fillarc.y, msg->fillarc.radius, msg->fillarc.startangle, msg->fillarc.endangle, msg->fillarc.color);
|
||||
gdisp_lld_fill_circle(msg->fillarc.x, msg->fillarc.y, msg->fillarc.radius, msg->fillarc.startangle, msg->fillarc.endangle, msg->fillarc.color);
|
||||
break;
|
||||
#endif
|
||||
#if GDISP_NEED_TEXT
|
||||
case GDISP_LLD_MSG_DRAWCHAR:
|
||||
lld_gdisp_draw_char(msg->drawchar.x, msg->drawchar.y, msg->drawchar.c, msg->drawchar.font, msg->drawchar.color);
|
||||
gdisp_lld_draw_char(msg->drawchar.x, msg->drawchar.y, msg->drawchar.c, msg->drawchar.font, msg->drawchar.color);
|
||||
break;
|
||||
case GDISP_LLD_MSG_FILLCHAR:
|
||||
lld_gdisp_fill_char(msg->fillchar.x, msg->fillchar.y, msg->fillchar.c, msg->fillchar.font, msg->fillchar.color, msg->fillchar.bgcolor);
|
||||
gdisp_lld_fill_char(msg->fillchar.x, msg->fillchar.y, msg->fillchar.c, msg->fillchar.font, msg->fillchar.color, msg->fillchar.bgcolor);
|
||||
break;
|
||||
#endif
|
||||
#if GDISP_NEED_PIXELREAD
|
||||
case GDISP_LLD_MSG_GETPIXELCOLOR:
|
||||
msg->getpixelcolor.result = lld_gdisp_get_pixel_color(msg->getpixelcolor.x, msg->getpixelcolor.y);
|
||||
msg->getpixelcolor.result = gdisp_lld_get_pixel_color(msg->getpixelcolor.x, msg->getpixelcolor.y);
|
||||
break;
|
||||
#endif
|
||||
#if GDISP_NEED_SCROLL
|
||||
case GDISP_LLD_MSG_VERTICALSCROLL:
|
||||
lld_gdisp_vertical_scroll(msg->verticalscroll.x, msg->verticalscroll.y, msg->verticalscroll.cx, msg->verticalscroll.cy, msg->verticalscroll.lines, msg->verticalscroll.bgcolor);
|
||||
gdisp_lld_vertical_scroll(msg->verticalscroll.x, msg->verticalscroll.y, msg->verticalscroll.cx, msg->verticalscroll.cy, msg->verticalscroll.lines, msg->verticalscroll.bgcolor);
|
||||
break;
|
||||
#endif
|
||||
#if GDISP_NEED_CONTROL
|
||||
case GDISP_LLD_MSG_CONTROL:
|
||||
lld_gdisp_control(msg->control.what, msg->control.value);
|
||||
gdisp_lld_control(msg->control.what, msg->control.value);
|
||||
break;
|
||||
#endif
|
||||
case GDISP_LLD_MSG_QUERY:
|
||||
msg->query.result = lld_gdisp_query(msg->query.what);
|
||||
msg->query.result = gdisp_lld_query(msg->query.what);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @file include/gdisp/lld/lld_gdisp.h
|
||||
* @file include/gdisp/lld/gdisp_lld.h
|
||||
* @brief GDISP Graphic Driver subsystem low level driver header.
|
||||
*
|
||||
* @addtogroup GDISP
|
||||
|
@ -463,69 +463,69 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/* Core functions */
|
||||
extern bool_t lld_gdisp_init(void);
|
||||
extern bool_t gdisp_lld_init(void);
|
||||
|
||||
/* Some of these functions will be implemented in software by the high level driver
|
||||
depending on the GDISP_HARDWARE_XXX macros defined in lld_gdisp_config.h.
|
||||
depending on the GDISP_HARDWARE_XXX macros defined in gdisp_lld_config.h.
|
||||
*/
|
||||
|
||||
/* Drawing functions */
|
||||
extern void lld_gdisp_clear(color_t color);
|
||||
extern void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color);
|
||||
extern void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
|
||||
extern void lld_gdisp_blit_area_ex(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer);
|
||||
extern void lld_gdisp_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
|
||||
extern void gdisp_lld_clear(color_t color);
|
||||
extern void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color);
|
||||
extern void gdisp_lld_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
|
||||
extern void gdisp_lld_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_draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
|
||||
|
||||
/* Circular Drawing Functions */
|
||||
#if GDISP_NEED_CIRCLE
|
||||
extern void lld_gdisp_draw_circle(coord_t x, coord_t y, coord_t radius, color_t color);
|
||||
extern void lld_gdisp_fill_circle(coord_t x, coord_t y, coord_t radius, color_t color);
|
||||
extern void gdisp_lld_draw_circle(coord_t x, coord_t y, coord_t radius, color_t color);
|
||||
extern void gdisp_lld_fill_circle(coord_t x, coord_t y, coord_t radius, color_t color);
|
||||
#endif
|
||||
|
||||
#if GDISP_NEED_ELLIPSE
|
||||
extern void lld_gdisp_draw_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
|
||||
extern void lld_gdisp_fill_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
|
||||
extern void gdisp_lld_draw_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
|
||||
extern void gdisp_lld_fill_ellipse(coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
|
||||
#endif
|
||||
|
||||
/* Arc Drawing Functions */
|
||||
#if GDISP_NEED_ARC
|
||||
extern void lld_gdisp_draw_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
|
||||
extern void lld_gdisp_fill_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
|
||||
extern void gdisp_lld_draw_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
|
||||
extern void gdisp_lld_fill_arc(coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
|
||||
#endif
|
||||
|
||||
/* Text Rendering Functions */
|
||||
#if GDISP_NEED_TEXT
|
||||
extern void lld_gdisp_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color);
|
||||
extern void lld_gdisp_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor);
|
||||
extern void gdisp_lld_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color);
|
||||
extern void gdisp_lld_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor);
|
||||
#endif
|
||||
|
||||
/* Pixel readback */
|
||||
#if GDISP_NEED_PIXELREAD
|
||||
extern color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y);
|
||||
extern color_t gdisp_lld_get_pixel_color(coord_t x, coord_t y);
|
||||
#endif
|
||||
|
||||
/* Scrolling Function - clears the area scrolled out */
|
||||
#if GDISP_NEED_SCROLL
|
||||
extern void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor);
|
||||
extern void gdisp_lld_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor);
|
||||
#endif
|
||||
|
||||
/* Set driver specific control */
|
||||
#if GDISP_NEED_CONTROL
|
||||
extern void lld_gdisp_control(unsigned what, void *value);
|
||||
extern void gdisp_lld_control(unsigned what, void *value);
|
||||
#endif
|
||||
|
||||
/* Query driver specific data */
|
||||
extern void *lld_gdisp_query(unsigned what);
|
||||
extern void *gdisp_lld_query(unsigned what);
|
||||
|
||||
/* Clipping Functions */
|
||||
#if GDISP_NEED_CLIP
|
||||
extern void lld_gdisp_set_clip(coord_t x, coord_t y, coord_t cx, coord_t cy);
|
||||
extern void gdisp_lld_set_clip(coord_t x, coord_t y, coord_t cx, coord_t cy);
|
||||
#endif
|
||||
|
||||
/* Messaging API */
|
||||
#if GDISP_NEED_MSGAPI
|
||||
#include "lld_gdisp_msgs.h"
|
||||
extern void lld_gdisp_msg_dispatch(lld_gdisp_msg_t *msg);
|
||||
#include "gdisp_lld_msgs.h"
|
||||
extern void gdisp_lld_msg_dispatch(gdisp_lld_msg_t *msg);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -140,14 +140,14 @@ typedef union gdisp_lld_msg {
|
|||
coord_t radius;
|
||||
coord_t startangle, endangle;
|
||||
color_t color;
|
||||
} drawcircle;
|
||||
} drawarc;
|
||||
struct gdisp_lld_msg_fillarc {
|
||||
gdisp_msgaction_t action; // GDISP_LLD_MSG_FILLARC
|
||||
coord_t x, y;
|
||||
coord_t radius;
|
||||
coord_t startangle, endangle;
|
||||
color_t color;
|
||||
} fillcircle;
|
||||
} fillarc;
|
||||
struct gdisp_lld_msg_drawchar {
|
||||
gdisp_msgaction_t action; // GDISP_LLD_MSG_DRAWCHAR
|
||||
coord_t x, y;
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
|
||||
/* OK - we need to obtain the mutex in case a synchronous operation is occurring */
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_msg_dispatch(pmsg);
|
||||
gdisp_lld_msg_dispatch(pmsg);
|
||||
chMtxUnlock();
|
||||
|
||||
/* Mark the message as free */
|
||||
|
@ -153,7 +153,7 @@
|
|||
|
||||
/* Initialise driver */
|
||||
chMtxLock(&gdispMutex);
|
||||
res = lld_gdisp_init();
|
||||
res = gdisp_lld_init();
|
||||
chMtxUnlock();
|
||||
|
||||
return res;
|
||||
|
@ -180,7 +180,7 @@
|
|||
|
||||
/* Initialise driver - synchronous */
|
||||
chMtxLock(&gdispMutex);
|
||||
res = lld_gdisp_init();
|
||||
res = gdisp_lld_init();
|
||||
chMtxUnlock();
|
||||
|
||||
return res;
|
||||
|
@ -216,7 +216,7 @@
|
|||
*/
|
||||
void gdispClear(color_t color) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_clear(color);
|
||||
gdisp_lld_clear(color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#elif GDISP_NEED_ASYNC
|
||||
|
@ -238,7 +238,7 @@
|
|||
*/
|
||||
void gdispDrawPixel(coord_t x, coord_t y, color_t color) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_draw_pixel(x, y, color);
|
||||
gdisp_lld_draw_pixel(x, y, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_draw_line(x0, y0, x1, y1, color);
|
||||
gdisp_lld_draw_line(x0, y0, x1, y1, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_fill_area(x, y, cx, cy, color);
|
||||
gdisp_lld_fill_area(x, y, cx, cy, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_blit_area_ex(x, y, cx, cy, srcx, srcy, srccx, buffer);
|
||||
gdisp_lld_blit_area_ex(x, y, cx, cy, srcx, srcy, srccx, buffer);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#elif GDISP_NEED_ASYNC
|
||||
|
@ -355,7 +355,7 @@
|
|||
*/
|
||||
void gdispSetClip(coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_set_clip(x, y, cx, cy);
|
||||
gdisp_lld_set_clip(x, y, cx, cy);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_draw_circle(x, y, radius, color);
|
||||
gdisp_lld_draw_circle(x, y, radius, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_fill_circle(x, y, radius, color);
|
||||
gdisp_lld_fill_circle(x, y, radius, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_draw_ellipse(x, y, a, b, color);
|
||||
gdisp_lld_draw_ellipse(x, y, a, b, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_fill_ellipse(x, y, a, b, color);
|
||||
gdisp_lld_fill_ellipse(x, y, a, b, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_draw_arc(x, y, radius, start, end, color);
|
||||
gdisp_lld_draw_arc(x, y, radius, start, end, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_fill_arc(x, y, radius, start, end, color);
|
||||
gdisp_lld_fill_arc(x, y, radius, start, end, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_draw_char(x, y, c, font, color);
|
||||
gdisp_lld_draw_char(x, y, c, font, color);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_fill_char(x, y, c, font, color, bgcolor);
|
||||
gdisp_lld_fill_char(x, y, c, font, color, bgcolor);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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 */
|
||||
chMtxLock(&gdispMutex);
|
||||
c = lld_gdisp_get_pixel_color(x, y);
|
||||
c = gdisp_lld_get_pixel_color(x, y);
|
||||
chMtxUnlock();
|
||||
|
||||
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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_vertical_scroll(x, y, cx, cy, lines, bgcolor);
|
||||
gdisp_lld_vertical_scroll(x, y, cx, cy, lines, bgcolor);
|
||||
chMtxUnlock();
|
||||
}
|
||||
#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) {
|
||||
chMtxLock(&gdispMutex);
|
||||
lld_gdisp_control(what, value);
|
||||
gdisp_lld_control(what, value);
|
||||
chMtxUnlock();
|
||||
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;
|
||||
|
||||
chMtxLock(&gdispMutex);
|
||||
res = lld_gdisp_query(what);
|
||||
res = gdisp_lld_query(what);
|
||||
chMtxUnlock();
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue