VisualTFT - FT813 switch between screens

General discussion on Visual TFT Software.
Post Reply
Author
Message
vojinilic
Posts: 14
Joined: 08 Jul 2011 18:54

VisualTFT - FT813 switch between screens

#1 Post by vojinilic » 21 Jan 2019 12:28

Dear MikroE,

can you please tell what is the purpose of the constant in the xx_driver.c file called:
const VTFT_DISPLAY_EFF_NONE = 0x00; // no effect when switching between screens
Are there any chance to display spinner between switch screen or something else?

Best,
Vojin

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: VisualTFT - FT813 switch between screens

#2 Post by stefan.filipovic » 22 Jan 2019 15:48

Hi Vojin,

You can use this part of the code to display spinner before screen switch.

Code: Select all

  FT800_Screen_BeginUpdate();
    FT800_DL_CmdClear(1, 1, 1);
    FT800_CP_CmdText_Const(FT800_Controller.Display.Width/2,
                           FT800_Controller.Display.Height/8,
                          _FT800_FONT_ROBOTO_SIZE_18,
                          _FT800_CP_DRAW_OPT_CENTER,
                          "Please wait ..." );
    FT800_CP_CmdSpinner(240, 136, 0, 0);
  FT800_Screen_EndUpdate();
  FT800_Screen_Show();

  Delay_ms(5000);
  DrawScreenO(&Calc_Demo, VTFT_DISPLAY_EFF_LIGHTS_OFF);
These constants should be used with DrawScreenO function as shown above.
There are comments whose explains the purpose of each constant.

Code: Select all

// Display effect constants
// Usage: DrawScreenO
const VTFT_DISPLAY_EFF_NONE         = 0x00; // no effect when switching between screens
const VTFT_DISPLAY_EFF_LIGHTS_FADE  = 0x04; // backlight: fade out before, fade in after drawing new screen
const VTFT_DISPLAY_EFF_LIGHTS_OFF   = 0x08; // backlight: turn off before, turn on after drawing new screen
// ~Display effect constants
Kind regards,
Stefan Filipović

vojinilic
Posts: 14
Joined: 08 Jul 2011 18:54

Re: VisualTFT - FT813 switch between screens

#3 Post by vojinilic » 23 Jan 2019 09:25

Dear Stefan,

thank you very much for your answer. You post helps me partially. I have a lot of of objects on screen which are store to uSD card. I have welcome screen and main screen. The idea is to draw Welcome screen and after 2 sec, to switch display to main screen. After 2 sec I start drawing main screen. When drawing is started, display turn off back light and start to load objects from uSD card to the RAM of the FT813. First drawing of the lasts 2-3sec. My idea was that user of the device dont watch dark screen between screen switching.
Can I store all objects to video RAM during displaying Welcome screen or maybe during spinner screen?

Best,
Vojin

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: VisualTFT - FT813 switch between screens

#4 Post by stefan.filipovic » 24 Jan 2019 19:15

Hi Vojin,

You can use DrawScreenO function to set the effects of the screen switching. If you don't want to see effects between screen switching, you can use the code below to switch the screen.

Code: Select all

DrawScreenO(&Calc_Demo, VTFT_LOAD_RES_ALL | VTFT_DISPLAY_EFF_NONE);
What objects do you want to store to the RAM? The spinner is the coprocessor's routine, and the coprocessor graphics object commands do not change hardware graphics state. That is, graphics state such as color and line width are not affected by any graphics object. You can read more about that in the FT8xx help file.

Kind regards,
Stefan Filipović

vojinilic
Posts: 14
Joined: 08 Jul 2011 18:54

Re: VisualTFT - FT813 switch between screens

#5 Post by vojinilic » 24 Jan 2019 22:36

Dear Stefan,

thank you very much for your answer. Can you please tell me also, are there any chance to change code in xx_driver.c:

Code: Select all

void DrawScreen(TScreen *aScreen) {
  if (aScreen != CurrentScreen)
    DrawScreenO(aScreen, VTFT_LOAD_RES_ALL | VTFT_DISPLAY_EFF_LIGHTS_FADE);
  else
    DrawScreenO(aScreen, VTFT_LOAD_RES_NONE);
}


Instead of that I'll rather use:

Code: Select all

void DrawScreen(TScreen *aScreen) {
  if (aScreen != CurrentScreen)
    DrawScreenO(aScreen, VTFT_LOAD_RES_ALL | VTFT_DISPLAY_EFF_NONE);
  else
    DrawScreenO(aScreen, VTFT_LOAD_RES_NONE);
}
I'm asking this, because every time I generate some GUI, automatic change in driver file overwrites my change.

Best,
Vojin

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: VisualTFT - FT813 switch between screens

#6 Post by stefan.filipovic » 25 Jan 2019 14:22

Hi Vojin,

It's not recommended to modify driver functions while you still have plans to use VisualTFT to modify graphics and generate new codes. However, you can copy-paste this modified function to the xx_events_code.c, but with another name, as shown below. Also, you will need to paste the prototype of this function in the xx_objects.h if you want to use it in the main file.

Code: Select all

void MyDrawScreen(TScreen *aScreen) {
  if (aScreen != CurrentScreen)
    DrawScreenO(aScreen, VTFT_LOAD_RES_ALL | VTFT_DISPLAY_EFF_NONE);
  else
    DrawScreenO(aScreen, VTFT_LOAD_RES_NONE);
}
Kind regards,
Stefan Filipović

Post Reply

Return to “Visual TFT General”