C code generator that unifies interfaces for memory maps
Project description
memory_map_manager
The Memory Map Manager (MMM) generates code and documentation for embedded device parameters intended for external interfaces.
Motivation
Embedded systems typically run on constrained systems, providing some sort of access to more powerful machines. A number of parameters can be read (such as a temperature from a sensor) or written (such as the intended state of a light). These amount of parameters and complexity can grow and change over the development cycle of the device. Every parameter needs to not only be available in the embedded device but also all the external interfaces as well. If this information is not coordinated it can lead to human error and extra development time. There are solutions available that helps with that, however, they typically don't operate under the asymmetric nature of embedded vs host computer capabilities or end of being very complex requiring large stacks in order to use.
Solution
The MMM generates simple C code that allows both named parameter access via typedef structs and byte offset access. Decoding of these parameters are done on the host, taking advantage of asymmetric computational resources of host vs. device. The embedded device only needs to expose a way to read or write an offset and size.
Installation
As this is a "console application" one can use a venv
or pipx
instead of pip.
Stable versions can be installed with:
pip install memory-map-manager
Generating with the MMM
Installing the package comes with a console command mmm-gen
.
usage: mmm-gen [-h] [--cfg-path CFG_PATH] [--clean]
[--loglevel {debug,info,warning,error,fatal,critical}]
optional arguments:
-h, --help show this help message and exit
--cfg-path CFG_PATH, -p CFG_PATH
the path to the memory map manager configuration importer.
--clean, -C clean the generated directories before generation. be careful!
--loglevel {debug,info,warning,error,fatal,critical}
python logger log level, defaults to "info"
There are a number of examples available coming with the generation configurations and the map configurations.
To run the minimal example run:
mmm-gen -p examples/minimal/main.yaml
This generates C files, csv files, and the configuration outputs.
Writing a Custom Map
Along with the examples of maps there are schemas available that document the capabilities.
There are two files that are needed:
- a generation configuration that
specifies generation information such as input configuration files and output directories. The default file is assumed to be
main.yaml
- a map configuration that specifies the parameters in the map.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file memory_map_manager-2.0.1.tar.gz
.
File metadata
- Download URL: memory_map_manager-2.0.1.tar.gz
- Upload date:
- Size: 59.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.27.1 setuptools/62.1.0 requests-toolbelt/0.8.0 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 288b339ed5b52a45dedccd7722bb20c25850f22c8b13e4c316ca99d844362d01 |
|
MD5 | b8bf398374532d20426740e23e16daaa |
|
BLAKE2b-256 | 2eefcd24102f7dae05264a8aa2285ea6e0b0d9331b263c752b8c793f5dc759b8 |