Jump to content

uGFX + FreeRTOS FAT API


Rafael Zingler

Recommended Posts

Hi,

I´m using a custom board, running FreeRTOS. The uGFX has been ported to this board without any problems, using FreeRTOS as the OS in the gfxconf.h file. So, it was already possible to draw some objects, like lines, circles, printing strings, and so on.

Now, I´m trying to draw images on the display, and have enabled the GFILE_NEED_FATFS in the configuration file. However, the compiling process returns errors, saying the disk access functions (disk_initialize, disk_ioctl, etc) were undefined. 

Is there an easy way, perhaps a step-by-step tutorial, to use the uGFX image resources calling the FreeRTOS FAT-SL API functions? I imagined an adapter layer, who calls the FreeRTOS FAT functions and is called by the uGFX library functions.

 

Thanks.

Edited by Rafael Zingler
Link to comment
Share on other sites

Hello Rafael and welcome to the community!

The "adapter layer" that you imagined is called the GFILE module. The GFILE module provides a uniform high-level API for any kind of file system interaction. Just like other elements of the library the GFILE module provides a porting interface which you can find in /src/gfile/gfile_fs.h. There is no step-by-step guide on how to implement a port for a new file system because these things tend to be very specific. However, the existing ports and documentation should allow you to write a port for the FreeRTOS FAT library without any troubles. If you have any questions we are of course happy to help wherever we can. To get started, we recommend having a look at the existing ports in the /src/gfile/ directory.
Like the other driver interfaces of the uGFX library the GFILE driver interface is based on a VMT. If you are unfamiliar with this technique you can have a look at the Creating A Widget article as it is explained there.

Once you have the GFILE module up and running you can use the high-level API functions of other modules such as GDISP and GWIN to easily load and display images and other files.

I hope that helps. Please don't hesitate to ask if you have any other :) 

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...