Difference between revisions of "Getting Started"
(→Examples) |
(→Integrate µGFX) |
||
Line 23: | Line 23: | ||
Understanding the architecture of the µGFX library is rather important. See [[Architecture]]. | Understanding the architecture of the µGFX library is rather important. See [[Architecture]]. | ||
− | == Integrate | + | == Integrate uGFX == |
After you have successfully obtained a copy of µGFX, you have to include it into your current project. The follow section will describe how uGFX can be integrated into an existing Makefile project or how it can be easily used with an IDE. | After you have successfully obtained a copy of µGFX, you have to include it into your current project. The follow section will describe how uGFX can be integrated into an existing Makefile project or how it can be easily used with an IDE. | ||
Revision as of 19:34, 8 December 2015
This article is a generic guide on how to get started with µGFX. It explains how a copy of the µGFX library can be obtained and where to begin reading the documentation in order to understand how the library is supposed to be used. There are a couple of other articles that explain how µGFX can be integrated into existing projects and how it can be used together with IDEs. You can find the list of these articles in the Using µGFX on... and Using IDEs sections on the main page.
Contents
Downloading
There are two ways to get a copy of µGFX: A stable release and the latest version from the git repository. We currently strongly recommend to use the git repository. Before you start, please make sure that your application and the use of µGFX meets the license of this project. Please contact us should you have any questions regarding licensing. If you're using µGFX for free please considering making a small donation to support our efforts.
We understand that integrating µGFX into your project might be the most difficult part for most users. Please do not hesitate to ask for help should you face any issues.
Stable release
A copy of a stable release of µGFX can be downloaded from the download section.
Repository
Please note that the following guide has been written for unix-like systems using the terminal. For Windows you may use a graphical git client such as SourceTree. Please have a look at the GIT Instructions to learn more.
µGFX is developed through a git repository hosted at bitbucket.org.
cd /path/to/your/project/resources git clone https://bitbucket.org/Tectu/ugfx ugfx
Architecture
Understanding the architecture of the µGFX library is rather important. See Architecture.
Integrate uGFX
After you have successfully obtained a copy of µGFX, you have to include it into your current project. The follow section will describe how uGFX can be integrated into an existing Makefile project or how it can be easily used with an IDE.
Makefiles
The uGFX library comes with a built-in Makefile system (which is not mandatory to be used, see Single File Inclusion below). If your IDE / Project allows to use external, existing Makefiles, we highly recommend using this method of adding uGFX to your project.
Step-by-Step guide:
- Set the GFXLIB variable to the path pointing to the µGFX library root directory
- Include the main µGFX Makefile (/ugfx/gfx.mk)
- Add GFXSRC to the sources variable/list
- Add GFXINC to the include paths variable/list
- Include additional Makefiles of the µGFX library to include board files, drivers, ...
Single File Inclusion
If your IDE or project doesn't allow using Makefiles there's another very easy way to include the uGFX library in your project. All that needs to be done is adding the /src/gfx_mk.c file to the sources and adding the µGFX library root directory to the compiler include path.
Step-by-Step guide:
- Add /src/gfx_mk.c to the sources in the files tree of your project
- Add the path to the µGFX library root directory to the compiler include path
- Add the source and header files of each driver that you want to be using the same way
Examples
You can find a variety of different guides explaining how to integrate uGFX into an existing project on the main page.
Board files
Certain modules of µGFX such as the display and touchscreen drivers require a file which builds the interface to your actual hardware. This board file tells µGFX how to talk to your hardware.
The documentation of every module shows how to create these board files.
See board file.
Configuration
The entire configuration of µGFX happens in a file called gfxconf.h which you have to create. A template that can be copied can be found in /gfxconf.example.h. The configuration is crucial so please make sure that you at least scrolled once through the configuration article.
Demos
The /demos directory contains a variety of different demos, reaching from single feature (per module sorted) demos up to complete application demos. These demos can be compiled easily by adding the corresponding demo.mk file to your Makefile. For example:
include $(GFXLIB)/demos/modules/gwin/widgets/demo.mk
Note: When including a demo Makefile, you have to make sure that you don't compile any other sources with it (eg. exclude your own main.c form the compilation process).
Support
There are two ways to get support for your µGFX related problems:
- Free public support by the community through the discussion forum
- A support agreement / contract
Please do not hesitate to contact us if you're interested in a support agreement.