Intro
=====

Biwak provides full support for all periphery of an Controller. This is an
Problem when you need an small footprint because ISRs are included to the
binaries (together with the functions of the call tree of the ISR). There is no
reliable way to drop the ISRs at application level.

Arena will just be some headers and scripts helping you defining
   * Bords (set of available periphery)
   * Applications (neccessary periphery)

Applications should be independant from boards. Example:
Board A defines:
   2 Uarts, 2 SPI busses, 5 GPIOs, 1I2C

Application B defines:
   1 Uart (Debug), 1 Button @ GPIO1, 1 Graphic Display @ SPI-Bus 1, CS @ GPIO 2

The application should work on every boartd that supports the neccessary
peiphery. But the application should not directly know about the board. The
targeted board is defined by CMake define.

There are scripts generating a linker file that drops all unneeded ISRs.


Enumerations
============

The header files will create enums that acutually name the peiphery correctly,
e.g. (eOutputMotor, eLedStatus, eButtonIncrease, eButtonDecrease).


Example
=======

Booter: Support for UART (Debug + Data), Flash (No ISR), Button, (maybe can)


Configuration Flow
==================

App:     define everything you want(need); e.g. "ARENA_WANT_GDISPLAY 1";
         "ARENA_GDISPLAY_1_CLASS CGraphicDisplayNh"

Board:   Specify everything depending on App; e.g. "ARENA_SPI_1 eSpi2, ..."

Platform: create everything depending on Board

Order of header inclusion is managed in "<arena/config.h>".

Problems
========

board A has 1 real LEDs and defines them. Other board B has 4 real LEDs.
Application wants 3 LEDs and 1 output. So it has to map 2 LED on board B to
outputs.

#ifdef ARENA_BOARD_LED_2
   #define ARENA_APP_LED_2 ARENA_BOARD_LED_2
   #define GPIO_OFFSET_1   0
#else
   #define ARENA_APP_LED_2 ARENA_BOARD_OUT1
   #define GPIO_OFFSET_1   1
#endif

#ifdef ARENA_BOARD_LED_3
   #define ARENA_APP_LED_3 ARENA_BOARD_LED_3
   #define GPIO_OFFSET_2   ( GPIO_OFFSET_1 )
#else
   #define ARENA_APP_LED_3 ARENA_BOARD_OUT2
   #define GPIO_OFFSET_2   ( GPIO_OFFSET_1 + 1 )
#endif

Boards
======

ARENA_BOARD
[options="header"]
|===
|ARENA_BOARD       | MCU_PLATFORM | MCU_BOARD |MCU_REV
|st_nucleo_f0      | stm32        |           |
|st_nucleo_f1      |              |           |
|st_nucleo_f3      |              |           |
|st_discovery_f4   |              |           |
|st_discovery_l100 |              |           |
|steifomat         |              |           |
|fob               |              |           |
|mcpprog           |              |           |
|canbridge         |              |           |
|irclock           |              |           |
|bigmaster         |              |           |
|temprec           |              |           |
|qt                | linux        | ""        | x86
|===



#---fin-----------------------------------------------------------------------
