Jump to content

Display reset


wctltya

Recommended Posts

When making a hard-reset of the display controller you have to re-initialize display controller which means that the internal initialization and post-initialization functions of the GDISP module need to be called (as well as the board_init()). This can only be done by calling gfxInit(). Therefore, you'd have to call gfxDeinit() first and then gfxInit() again. There's no way of buffering the existing GUI in between those operations.

This doesn't make much sense in general (none at all). Can you please explain your use case or why you think that you need that so we can try to help you finding the proper solution? This sounds like a very bad design.

Link to comment
Share on other sites

With a different display type (an old project) we have experienced display hangs (stop working) during EMC test (shooting it with high voltage). So, in such a case, usually there is an option to detect it and then ...

Initially I thought to use  gfxInit(). I'm just worrying about the allocated memory. If gfxDeinit() will release all allocated memory? 

Link to comment
Share on other sites

Well, the proper solution is to add proper shielding and taking other measures required to pass the EMC test without the device becoming unusable ;) 

Yes, gfxDeinit() will call the deinit() function of all modules, sub-modules and similar. It's the same thing as gfxInit() but in reverse. It can only clean-up the mess it created itself, so all the objects you allocated memory for yourself are not managed and you have to take care of those manually (you need an application wide deinit()).
Deinitialization is not very well tested because it's not really needed in situations where µGFX is being used in the first place. The need for deinitialization usually shows a bad design (again, not in general but in systems where µGFX is being used in the first place).

You can manually re-call the initialization function of the display driver but that's not supported from our side and vastly discouraged.

Link to comment
Share on other sites

There is another solution.

UGFX supports putting the display into power down. If the ppwer control is written correctly in the driver that could be used to do exactly what you are after.

In the application you would tell the display to power down and then to power up again. That would take care of the hardware reinitialisation. You would just then need to redraw the display.

Link to comment
Share on other sites

Actually, thinking about this, the proper solution is to create a custom gdisp_lld_control() command implementation that allows re-calling the driver initialization through gdispControl(). You can have a look at other existing drivers that use custom control commands such as the SSD1306 and the AlteraFramereader drivers. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...