Jump to content

miogui

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, I've played with the pixmap driver. I've got just one question about this.. Does the gdispDeletePixmap un-allocate the memory ? Regards Miogui
  2. Ok, I've just look the demo, but if the Pixmap do that , I will have a try ... One point that could be ehanced is the GdsipImageDraw_BMP with a cx,cy, sx,sy lower than the img-Width and img-Height: This routine read the entire priv->buf and "blit" only the area needed, I'm looking to speed up that we a small trick ..
  3. Thanks, Pixmap look cool.. and look like what I want to achieve, but basicaly it don't use BMP picture .. I've managed to duplicate the gdispimagecache, This new function will help to cache the aera needed instead the whole part.... GDsipImageDraw will be able to display the cached area, and if the cache fails work exactly as now (access and decode the picture, and just display the aera needed by sx,sy,cx,cy) thanks for the info
  4. Thank you, I'm also working on an additional gdisp_image function to be able to cache a small area of a Background image. This will speed up the refresh of my background picture if only a small area need to be updated. Regards Guillaume
  5. and then, If you just have to write the following: g->frame_buffer (represent which frame Gdisp will write) g->frame_display (represent which frame the LCD will display) with: gdispSetFrameBuffer(NB FRAME);gdispSetFrame(NB FRAME); for example : // Set the Display to show the frame 0 gdispSetFrame(0); // Write ON-SCREEN frame buffer gdispSetFrameBuffer(0); gdispClear(Black); gdispFillArea(30, 30, 300, 150, Red); gdispFillArea(50, 50, 200, 100, Blue); // Write OFF-SCREEN frame buffer gdispSetFrameBuffer(1); gdispClear(Black); gdispFillArea(80, 80, 150, 50, Yellow); gdispFillArea(200, 130, 100, 100, Green); // Switch the Display to show the OFF-SCREEN frame gdispSetFrame(1); Maybe this could be an entrie for your competition http://ugfx.org/competitions/competition-widget-drawing ??
  6. Hi inmarket & tectu Thanks to your reply, I'm now able to write in the off-screen buffer and refresh the screen on this aera. This help me to use a picture as background.. here is the diff I made to be able to do this index 5c20d3d..f0c52c5 --- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c +++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c @@ -13,6 +13,7 @@ #include "drivers/gdisp/SSD1963/gdisp_lld_config.h" #include "src/gdisp/driver.h" + #define CALC_PERIOD(w,b,f,p) (p+b+w+f) #define CALC_FPR(w,h,hb,hf,hp,vb,vf,vp,fps) ((fps * CALC_PERIOD(w,hb,hf,hp) * CALC_PERIOD(h,vb,vf,vp) * 1048576 @@ -46,7 +47,7 @@ typedef struct LCD_Parameters { #define LCD_PANEL_TYPE_SERIAL_RGB_DUMMY_MODE (((1<<5) | (1<<6)) << 8) // Serial RGB+dummy } LCD_Parameters; -#include "board_SSD1963.h" +#include "gdisp_lld_board_st_stm32f4_discovery.h" /*===========================================================================*/ /* Driver local definitions. */ @@ -81,8 +82,8 @@ static inline void set_viewport(GDisplay* g) { write_data16(g, g->p.x); write_data16(g, g->p.x+g->p.cx-1); write_index(g, SSD1963_SET_PAGE_ADDRESS); - write_data16(g, g->p.y); - write_data16(g, g->p.y+g->p.cy-1); + write_data16(g, g->frame_buffer*GDISP_SCREEN_HEIGHT+g->p.y); + write_data16(g, g->frame_buffer*GDISP_SCREEN_HEIGHT+g->p.y+g->p.cy-1); write_index(g, SSD1963_WRITE_MEMORY_START); break; case GDISP_ROTATE_90: @@ -142,6 +143,12 @@ static inline void set_backlight(GDisplay *g, uint8_t percent) { write_data(g, 0x0F); // Brightness prescaler - active when Trans } + + + + + + /*===========================================================================*/ /* Driver exported functions. */ /*===========================================================================*/ @@ -230,6 +237,19 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { write_data(g, 0x00); #endif + /*write scroll aera*/ + write_index(g,SSD1963_SET_SCROLL_AREA); //set PWM for BackLight + write_data(g,( 0 >> 8) & 0xFF); //top + write_data(g,( 0 >> 0) & 0xFF); + write_data(g,( 272 >> 8) & 0xFF); //scroll + write_data(g,( 272 >> 0) & 0xFF); + write_data(g,( 0 >> 8) & 0xFF); //bottom + write_data(g,( 0 >> 0) & 0xFF); + + write_index(g,SSD1963_SET_SCROLL_START); + write_data(g,( 0 >> 8) & 0xFF); + write_data(g,( 0 >> 0) & 0xFF); + /* Tear effect indicator ON. This is used to tell the host MCU when the driver is not refreshing the panel write_reg(g, SSD1963_SET_TEAR_ON, 0x00); @@ -239,6 +259,8 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { /* Turn on the back-light */ set_backlight(g, GDISP_INITIAL_BACKLIGHT); + + // Finish Init post_init_board(g); @@ -246,6 +268,8 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { release_bus(g); /* Initialise the GDISP structure */ + g->frame_display = 0; + g->frame_buffer = 0; g->g.Width = lcdp->width; g->g.Height = lcdp->height; g->g.Orientation = GDISP_ROTATE_0; @@ -268,6 +292,8 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { } #endif + + #if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL LLDSPEC void gdisp_lld_control(GDisplay *g) { switch(g->p.x) { @@ -363,6 +389,23 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { g->g.Backlight = (unsigned)g->p.ptr; return; + case GDISP_CONTROL_FRAME: + if (g->frame_display == (unsigned)g->p.ptr) + return; + else + { + acquire_bus(g); + write_index(g,SSD1963_SET_SCROLL_START); + write_data(g,( ((unsigned)g->p.ptr * GDISP_SCREEN_HEIGHT) >> 8) & 0xFF); + write_data(g,( ((unsigned)g->p.ptr * GDISP_SCREEN_HEIGHT) >> 0) & 0xFF); + release_bus(g); + g->frame_display = (unsigned)g->p.ptr; + } + return; + + case GDISP_CONTROL_FRAME_BUFFER: + g->frame_buffer = (unsigned)g->p.ptr; + return; //case GDISP_CONTROL_CONTRAST: - see DDS1963_SET_POST_PROC command - contrast, brightness, saturati default: return; index 8d22135..42b4524 --- a/src/gdisp/driver.h +++ b/src/gdisp/driver.h @@ -237,6 +237,9 @@ struct GDisplay { uint8_t Contrast; } g; + uint8_t frame_display; + uint8_t frame_buffer; + void * priv; // A private area just for void * board; // A private area just for index f952e41..6321be0 --- a/src/gdisp/sys_defs.h +++ b/src/gdisp/sys_defs.h @@ -105,6 +105,8 @@ extern GDisplay *GDISP; #define GDISP_CONTROL_ORIENTATION 1 #define GDISP_CONTROL_BACKLIGHT 2 #define GDISP_CONTROL_CONTRAST 3 +#define GDISP_CONTROL_FRAME 4 +#define GDISP_CONTROL_FRAME_BUFFER 5 #define GDISP_CONTROL_LLD 1000 /*===========================================================================*/ @@ -1067,6 +1069,12 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co #define gdispGSetOrientation(g, newOrientation) gdispGControl((g), GDISP_CONTROL_ORIENTATION, (void #define gdispSetOrientation(newOrientation) gdispGControl(GDISP, GDISP_CONTROL_ORIENTATION, (vo +#define gdispGSetFrame(g, newFrame) gdispGControl((g), GDISP_CONTROL_FRAME, (void *)(unsigned)( +#define gdispSetFrame(newFrame) gdispGControl(GDISP, GDISP_CONTROL_FRAME, (void *)( + +#define gdispGSetFrameBuffer(g, newFrame) gdispGControl((g), GDISP_CONTROL_FRAME_BUFFER, (voi +#define gdispSetFrameBuffer(newFrame) gdispGControl(GDISP, GDISP_CONTROL_FRAME_BUFFER, (v + /** * @brief Set the display backlight. * @note Ignored if not supported by the display.
  7. Hi, Thank you. I came exactly to the same conclusion: working on the off-screen frame-buffer. I will have a look on this. Regards Miogui
  8. Hi, I'm working on a project on Chibios/ugfx with a STM32F407 and an SSD1961. I've got a background picture (BMP) for the entire screen, and I try to update a String on this. for the moment, on update I do the following : - gdispGImageDraw on the area where the String is supposed to be . - gdispGDrawString with the new string. But this is not perfect... Is there a way to allocate a small buffer for the area that need to be redraw, write image and text, and then send it to the screen ? thanks Guillaume
×
×
  • Create New...