Example library created to show the possibilities of EPPL. Also the EPPL library was tested on this code.
The libraries are written for maximum configurability. In every library folder, there is [Library_name]_config_template.h file that you may use for the configuration.
Fallowing subsections describes shortly about the ideology of simple configuration of created libraries.
Alphanumeric LCD library supports many LCD configurations. All can be configured quite straightforward:
Software Pulse Width Modulation library supports any number of outputs and its active/non active state. The only limit is in currently supported number of pins in EPPL.
Everything there is configured just by one definition: SPWM_OUTPUTS_ALL
Currently only AVR8 microcontrollers are supported.
I also have tried there to create some standard convention to make libraries usage easier. There are some standard definitions for usage in your code.
I was trying to write all library header files to include all they needs. It means that you do not have to include anything more than just selected library header file.
One of the important strengths of EPPL ideology is that all IO pins are initialized in one call in very beginning of the code.
But how to reconcile it to write external library and initialize all ports in one place? I have done it by defining [Library_name]_PINCONFIG constant in the library header (ALCD_PINCONFIG, SPWM_PINCONFIG). It contains list of pin configuration. To use it, just put it into your eppl initialization instruction like below:
If library uses any pins in interrupt runtime, they becomes Hotpins. To make it easier to mark this pins I have defined in library constant [Library_name]_HOTPINS (see SPWM_HOTPINS).
This constant may be used in global or local hotpins declaration as fallows:
There are two types of libraries - one witch can support multithreaded style Hotpins definition and one that can only support global Hotpins definition.
ALCD library has its own source file where a lot of processing is done. There Hotpins are processed during compilation of that file, and cannot be changed when calling from different files. The only possibility for such a library to work in multithreaded program is to set Hotpins inside alcd_config.h file to cover all possibilities.
But if you wish to use ALCD in multithreaded application you have to understand that not only pins operations have to be protected. LCD has its own driver that holds some state. If LCD accessing is divided between treads, the whole access to LCD has to be protected.
In second hand SPWM library has every processing function inlined. Becouse of that, you can set EPPL_HOTPINS definition just right before