How cedrichirschi/mlnlib works
Main Components
• HAL Library Core: This includes the components located under the directory "mlnlib/mln", which contain header files for each peripheral (e.g., mln_adc.h, mln_dac.h, mln_gpio.h, etc.). These represent the core abstraction layer modules.
• Device-specific Drivers: These can be found under "mlnlib/devices" (e.g., mcp4822.h, mcp3421.h, etc.) and represent externally interfaced devices that build on top of or complement the HAL functionalities.
• Testing and Sample Application: The "mlnlib/main.cpp" file serves as an example or testing environment to demonstrate how the libraries interact.
• Documentation: While not part of the runtime system, the "docs" folder (with auto-generated Doxygen files) shows how the project is structured and documented, which can also be reflected in your architecture to emphasize design clarity.
• Build & Configuration Tools: Items like the Doxyfile and project solution files (mlnlib.atsln, mlnlib.cppproj) indicate the project’s environment and build configuration.
Relationships and Interactions
• Core HAL to Device Drivers: Indicate that the external device drivers (like MCP4822) are implemented on top of or interact with the core HAL routines.
• Integration with the Compiler/Build Process: Note that the libraries are intended to be compiled with avr-g++ and require specific compile flags (e.g., defining F_CPU). This can be represented with an “Environment/Build” block.
• Testing/Example Application: Include a component for the test application in main.cpp which integrates and exercises the HAL functions.
Architectural Patterns and Design Principles
• Modularity: Each peripheral’s functionality is encapsulated in its own module (or set of header files). Emphasize how separation of concerns allows the different parts of the HAL to be used individually or in combination.
• Dependency Management: Highlight that there are partial dependencies among modules (for instance, ADC depends on GPIO), so it’s important to show directional dependencies.
Elements
• Use clear component labels such as “MLN_ADC,” “MLN_GPIO,” “MLN_DAC,” etc.
• A separate section representing the testing/application environment (main.cpp) and the build configuration (project files, F_CPU definition).
• Optionally, a component that represents the build/documentation process to indicate integration with Doxygen and build files (Doxyfile, project solution files).