Firmware  0.0.0
Loading...
Searching...
No Matches
Architecture

The entire software stack is divided into three layers. At the top are the interfaces, which represent the connections to the outside world. In the middle, various services run as middlewares that take care of processing the data and generate various output signals from it. And underneath that there are drivers that use these signals to control the hardware outputs. A more detailed version of the upcoming diagram can be found at the bottom of the page ( not mobile friendly).

Architecture overview

Interfaces

The interface layer contains modules that are used to receive and transmit data. They initialize various communication peripherals such as USB and WiFi and manage the data transfer via them. The received data is processed and then forwarded to the corresponding services in the middleware layer.

Middlewares

The modules in the middleware layer contain services that connect the interfaces with the outputs in the driver layer. An example of this is the mdu::Service, which can accept a WebSocket connection from the http::sta::Server and then processes commands for an update of the decoder software. The service then starts the corresponding MDU task in the driver layer, which then generates the necessary signals on the track. The communication is bidirectional, received feedback is sent back to the server via service. In more complex situations, middleware services may also communicate directly with each other. An example of this is the communication between the dcc::Service and the z21::Service.

Drivers

In the driver layer there are modules that contain some form of IO. For the most part, these are modules that generate signals controlled by middleware services. Other modules initialize various hardware peripherals such as the ADC or WiFi.

Storage

Although these modules do not necessarily represent a layer, they are still a separate part of the architecture and manage the different flash memory partitions. Currently this only involves the nvs module which stores settings or locomotives in a key-value pair system. All modules are considered global and can be accessed from all other layers.

Diagram

Architecture diagram
Note
This diagram contains links. Clicking on a module takes you to the corresponding API Reference.
Previous Next
Configuration Control Flow