Library Architecture - Infineon/radar-bgt60 GitHub Wiki
The BGT60 library follows the architecture pattern shown in the diagram below:
The monolithic core library can be universally integrated across any low level peripheral drivers, embedded operating systems, and middleware of each software framework.
The reusability and interoperability is achieved by defining a Platform Abstraction Layer (PAL) interface which is implemented by each framework for its specific hardware abstraction layer and operating system resources APIs.
Additionally, the core library API is accommodated and adapted to the particularities of each software framework. The framework API wrappers intend to harmonize the core library API with that of the software development framework in which it is integrated, making it easier for the user already familiarized with the development framework.
The support for the multiple hardware platforms is then provided by each development framework.
The specific BGT60 library modules are depicted more specifically below:
In the next sections, the information of the main architecture modules for the BGT60 library is extended.
Core Library
The core library contains all the library logic and high level functionalities of the sensor peripheral. The core library remains C++ agnostic by interacting with the specific platform (and framework) through a Platform Abstraction Layer interface. No other dependencies than standard C/C++ modules and the PAL are found in these sources.
The code sources can be found under "src/corelib". The core library API provides access to the very basic functionalities of the BGT60 for now. But it will be extended in the near future. Find more information about the core library in the BGT60 API section of this documentation.
Platform Abstraction Layer (PAL) Interface
The Platform Abstraction Layer interface is implemented via abstract C++ classes declaring all the necessary platform resources and functionalities that need to be provided by the specific framework-platform implementation.
The simple Bgt60 class specifies in its PAL modules a GPIO and Timer class. Their implementation is located in the "src/pal" folder.
The PAL interface functions, behavior descriptions and implementation details, can be found in the PAL Interface section.
Framework PAL
The PAL interface is defined for each embedded software framework through its low level peripheral drivers and operating system resources APIs. The GPIO and Timer interface abstract classes are inherited and defined in this layer.
The "src/framework/sample_framework/pal" folder contains the PAL implementation for the particular framework.
Find more information about the supported software development frameworks in the Software Frameworks section.
Framework API Wrapper
The idea behind this layer is to adapt the library in order to comply with the programming conventions of the integrated programming framework or ecosystem.
Operating system libraries, low level driver of hardware peripherals (digital inputs/outputs, PWM, analog conversion, etc.) or other middleware resources are implemented for each development framework following certain patterns for functions, parameters, and primitive types.
At these level, certain platform functionalities required by the BGT60 can be already defined and adapted to the API available resources: function prototypes, framework core libraries, low level driver HAL, programming patterns, and even framework feel and look aspects.
The framework's wrapper API files are located in the "src/framework/sample_framework/wrapper" folders.
Find more information about each software development framework API in the section Software Frameworks.
Predefined Hardware Platforms
Given a particular hardware platform and development software framework, most the resources and its configuration can be already determined by default. This part of the framework API just defines some pre-configured instances for common and officially supported evaluation kits.
These instances are available in the "src/framework/sample_framework/wrapper/zzz-platf-xxx.hpp/cpp" source files.
Check out the supported platforms in the Hardware Platforms section.