Table of Contents | ||
---|---|---|
|
Intro
This document aims to provide guidelines and standards with respect the ZeroPilot’s architecture. The goal is to have EFS members on the same page, making the project easier to both work with and build upon.
...
Since the EFS team simultaneously has members both on and offsite, ZeroPilot supports two builds, one hardware dependent and another hardware agnostic. To achieve this, we interface our higher level software with STM32 firmware through a driver suite that allows for dependency injection.
Drawio | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Rule | Rationale |
---|---|
Managers must not include hardware specific functions. | As common files, managers need to be hardware agnostic. They cannot directly include code designed for specialized hardware (RTOS facilities, serial communication drivers). |
Managers must not instantiate their own drivers. | Managers need to implement all their driver interactions with driver interfaces. Driver interfaces will point to a driver instance that is passed in via the manager constructor. |
Managers must not directly read fields from each other. | Managers will interact with each other via CMSIS Memory Queue drivers. This promotes thread safety, and keeps hardware specific flow control features (mutexes and semaphores) out of managers. |
Driver Standards
This sections outlines the requirements that must be followed when designing solutions for ZeroPilot’s managers:
Rule | Rationale |
---|---|
Drivers must have an abstract interface that cannot be instantiated. | Interfaces will be used by managers to achieve dependency injection. Interfaces themselves have no substance, and thus should not be instantiable. |
Drivers must include both a real and a mock implementation. | This two implementation design allows for the two build architecture, providing the foundation for both hardware and testing builds. |
DAQ drivers are preferably implemented with DMA. | Direct Memory Access is preferred for Data Acquisition related drivers, especially those which operate at high frequency, as it offloads work from the CPU. |