SRD Standelone programmation box: BROADSEIS SRD Programmation Box, Standelone RFID programmation firmware

| SRD Standelone programmation box 2.0 (16/11/15 10:00:00) Documentation of the SRD standelone programmation box

- Main Page
- Data Structures
- Files

All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
BROADSEIS SRD Programmation Box, Standelone RFID programmation firmware

# About the file architecture :

Peripheral interface drivers and object interface drivers are composed of an association of an headerfile (.h) and a source file (.c). The source file contains the code functions allowing to manage and use the peripherals. The header file provides an interface to the functions defined in the source file. For generic peripheral drivers, these files are associated with a common headerfile (xxxx_common.h) that regroup the common defines.

The program is organized around four groups of files : the driver files and the application files.

- DSP (Device Support Package) : regroup all drivers used to control micro-controller internal peripherals as the UART modules or the I2C modules.
- BSP (Board Support Package) : regroup all drivers used to interface micro-controller with the embedded peripehrals as the battery monitoring chip or the EEPROM memory.
- Application : regroup all object files used to control the device operation.
- Tools : regroup all files and drivers used as "tools" as the 7 or 16 segments decoder or the string manipulation functions.

# About the compiler and IDE :

This firmware is developed with Kinetis Design Studio (revision 2.0.0) and build with GNU arm-none-eabi-gcc compiler/linker/assembler/croos compiler for ARM processors (Included in KDS 2.0.0).
The device behavior is not guaranteed with other compiler/IDE revision.

# About program architecture :

The program is designed in two phases. The first phase allows to initialize peripherals and hardware system. The second phase, starting after, is a scheduler which manage the application.

## Initialization

The main application follow the flowchart described below.

Critical Initialization : Initialize critical peripherals as the watchdog, the system clock and the real time counter.
Setup : initialize and configure all non-critical peripherals as the uart modules, I2C modules and all boards peripheral as the EEPROM memory and the battery manager.
Start scheduling : start the scheduled tasks.
Task 1s : execute the 1s periodic task as the battery monitoring and the USB connection state.
Background task : Execute the background task. It's in this task that the main management processes are executed.

## Background task

The background process is described in the next flowchart :

USB manager : function used to decode and deal commands received on the USB when the device is connected to a host PC.
Button manager : function used to manage buttons and trig the RFID communication processes according the buttons combination.
RFID manager : function used to control the RFID communication. It's this function that execute the read and write operation in the SRD memory.
Low Power manager : this is the low power manager. This function check the state of all over manager and enable/disable the power of some peripherals according the state of the other manager.