Jump to content
zaher

What is the purpose of acquire_bus(), release_bus() functions?

Recommended Posts

Hello everyone!

I'm almost done adding uGFX to an existing project and now all I need to do to get up and running is to finish the driver glue functions for my LCD. Fortunately, when  I came here first time few years ago, the SSD1322 was not supported. Now that has changed and the driver is part of the official repository. 

Well, I did not try it yet, but out of curiosity and just to make sure everything works out from first time, what is the purpose of the following functions:

acquire_bus(GDisplay* g), release_bus(GDisplay* g), post_init_board(GDisplay* g)

 

And why most of these functions, including the write data/command ones, take a pointer of GDisplay type as a parameter? What it does exactly? 

 

Thank you!

 

Zaher

Share this post


Link to post
Share on other sites

The display controller is physically connected to your microcontroller/system via some kind of bus. For example parallel or SPI. The acquire_bus() and release_bus() functions are called by the driver itself (which is independent from what interface/bus is being used) before and after making a bus transaction. These functions allow you to acquire the bus before talking on it and releasing it once you're done.

In case of a simple SPI interface this is where you want to set your CS pin level accordingly. More complex systems might need to call OS functions to acquire/request bus access and stuff like that.

The GDisplay structure represents the actual display. You can have a look at the documentation to figure out what information is contained. Usually you're interested in this when dealing with multiple displays or requiring the private board file area.

Share this post


Link to post
Share on other sites

More information...

Aquire_bus and release_bus give you an opportunity to use a shared bus.

Post_init is called once the controller has been initialised. Many controllers need to be initialised at a slower bus speed. Post_unit gives you the opportunity to increase the bus speed after the controller is initialised.

Share this post


Link to post
Share on other sites

Thank you guys for the prompt follow up. I guess I'm all set now. I did not touch those functions, and now the display shows the following when initialized:

Photo.thumb.png.21a189e7f06bcc2dc3a1728d889db210.png

I believe the aforementioned functions are more relevant when a parallel bus is used (FSMC). Since I'm using the SPI and everything was done earlier, I guess I'm good to go.

By the way, how to remove this splash screen or it is necessary everytime the system starts up?

Thank you again!

Share this post


Link to post
Share on other sites
12 minutes ago, zaher said:

By the way, how to remove this splash screen or it is necessary everytime the system starts up?

Have a look at GDISP_NEED_STARTUP_LOGO in the configuration file.

By the way: It seems that your display (pages) are swapped. Left and right are swapped.

Share this post


Link to post
Share on other sites
Quote

By the way: It seems that your display (pages) are swapped. Left and right are swapped.

Oh yeah, I was thinking why uG on the right and Fx on the left! Where I need to look at to solve this issue?

Share this post


Link to post
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

×