A C++ template library for embedded applications
Designed and maintained by
Aster Consulting Ltd
Join the ETL community

Setup

This page describes the steps needed to integrate the ETL with your project.

The ETL requires no special installation. Just copy or clone the GitHub project into an appropriate directory.

For additional information pertaining to compilers, see this page.

The ETL does not depend on the STL, but can use the algorithms and definitions from it if the project does.
This is controlled by the ETL_NO_STL macro. If this macro is defined in the profile then the ETL will use its own reverse
engineered versions.
Do not directly rely on these definitions for your code, the ETL defines only those parts that are necessary to support itself.

User defined files

The user must create a file named etl_profile.h which then includes a compiler profile header.
The file should also define any ETL configuration macros. See here for further information.
This header is included from ETL's platform.h

An example would be:-

#ifndef __ETL_PROFILE_H__
#define __ETL_PROFILE_H__

#define ETL_THROW_EXCEPTIONS
#define ETL_VERBOSE_ERRORS
#define ETL_CHECK_PUSH_POP

#ifdef _MSC_VER
  #include "etl/profiles/msvc.h"
#else
  #include "etl/profiles/gcc.h"
#endif

There are several profiles available in the ETL's profiles/ directory. They may either be used 'as is' or as a base for a
project specific variant.

The profiles currently available are:
arduino_arm.h      Arduino ARM targets. No OS.
armv5.h            ARM compiler version 5.x. No OS.
armv5_no_stl.h     ARM compiler version 5.x. No OS. No use of STL.
armv6.h            ARM compiler version 6.x. No OS.
armv6_no_stl.      ARM compiler version 6.x. No OS. No use of STL.
cpp03.h            Generic C++03. Generic target. No OS.
cpp03_no_stl.h     Generic C++03. Generic target. No OS. No use of STL.
cpp11.h            Generic C++11. Generic target. No OS.
cpp11_no_stl.h     Generic C++11. Generic target. No OS. No use of STL.
cpp14.h            Generic C++14. Generic target. No OS.
cpp14_no_stl       Generic C++14. Generic target. No OS. No use of STL.
gcc_generic.h      GCC generic settings. Generic target. No OS.
gcc_linux_x86.h    GCC for Linux on X86 target
gcc_windows_x86.h  GCC for Windows on X86 target
msvc_x86.h         Microsoft Visual Studio  for Windows on X86 target
ticc.h             Texas Instruments Code Composer. Generic target. No OS.

Additional include directories

The compiler will normally expect paths to additional include directories to be specified
A path to etl/include would normally be set allowing header files to be specified as follows:-
#include "etl/vector.h"
#include "etl/fsm.h"

A path to the user generated etl_profile.h must be defined.

Arduino

The Arduino programming platform is not supplied with an implementation of the STL. The ETL requires some parts of
the STL to compile and therefore one must be acquired. A suitable implementation may be downloaded from the
Arduino library resource; It is called ArduinoSTL.
Add #include <ArduinoSTL.h> to the start of every file that uses the ETL.
Remember to add the directory to the include path.
NOTE: From version 11 onwards the directory layout no longer follows that specified by the Arduino library system.
Arduino users should use version 10.21.2

C Library
Although the ETL is based on C++ there is a small offshoot that is intended for C delevopers. At the present time it is
limited to a timer callback framework. To use the ECL (Embedded C Library) you must define a header named
ecl_user.h. This header will supply the definitions require to support the library on the target OS.
For an example of what must go in this header, see the version supplied for the unit tests. test/ecl_user.h