mm_pal (Memory Map Protocol Abstraction Layer)
Python package for providing an runtime access to embedded devices based on a memory map type interface.
Description
This package consists of base classes to build interfaces and a mock device used for testing and as an example of implementation.
Device connection such as serial and parsers such as json are used to get
standard output.
Concept
Embedded devices are generally constrained and communication with
runtime parameters can take up lots of resources. Since many users of
microcontroller are familiar with the concept of a memory map or
register map the Memory Map
Manager can be
used as and lightweight way of coordinating a single memory map for
documentation, C structures, and python interface. The mm_pal provides
the building blocks for a custom interface. All common functions related
to connecting to the device, parsing output of the registers, and
reading/writing to the registers are handled and only application
specific functionality needs to be implemented. This can make
development easier, especially when the registers are changing
frequently.
Architecture
┏━━━━━━━━━━━┓ ┏━━━━━━━━━┓
┃ developer ┃ ┃ script ┃
┗━━━━━▲━━━━━┛ ┗━━━━▲━━━━┛
┃ ┃
┏━━━━┸━━━━┓ ┏━━━━━┸━━━━━┓
┃ my_cli ◄━━━━━━━┫ my_app_if ┃
┗━━━━▲━━━━┛ ┗━━━━━▲━━━━━┛
┃ ┌────────┐ ┃
┃ │ mm_pal │ ┃
┌─────╂────┴────────┴────╂────────┐
│┏━━━━┸━━━┓ ┏━━━┸━━━┓ │
│┃ mm_cmd ◄━━━━━━━━━━┫ mm_if ┃ │
│┗━━━━━━━━┛ ┗━━━▲━━━┛ │
│ ┃ │
│ ┏━━━━━━━┸━━━━━━━┓│
│ ┃ serial_driver ┃│
│ ┗━━━━━━━▲━━━━━━━┛│
└────────────────────────╂────────┘
┃
┏━━━━━━━━━━▼━━━━━━━━━━┓
┃ my_embedded_device ┃
┗━━━━━━━━━━━━━━━━━━━━━┛
Installing package
To install mm_pal use pip:
pip install mm_pal --user
Note: only use python 3 which may require pip3
To install from sources:
./setup.py install --force --user
Note: setuptools package should be installed.
Using the package
This package is meant to be built upon. An example implementation is done with the mock_if and the mock_cli.
The mm_cmd is based on the cmd2 module is probably worth reading the documenation.
Useful commands
To regenerate documentation use:
sphinx-apidoc -f -o docs/source/ mm_pal mock_pal; make html -C docs/
Testing
To test the package with pytest must be installed installed and updated.
Using ./setup.py test or tox will perform tests on the
source package.
Special thanks to riotctrl as it served as a great example.
Metadata
Release files for mm-pal 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mm_pal-1.2.1.tar.gz | 25.4 kB | Without provenance | Details for mm_pal-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mm_pal-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for mm_pal-1.2.1-py3-none-any.whl |
Total release size: 53.0 kB
Release files / mm_pal-1.2.1.tar.gz
| Download URL | mm_pal-1.2.1.tar.gz |
|---|---|
| Size | 25.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
537e917b5377d18e08c4f94e0be8cf741f70c6c4d20ea0c52611c9122a03f59e
|
|
BLAKE2b-256 checksum How to use checksums |
9b271f01b345f637c50e930eb1fb137565ca92ae9843d571933479c300907a0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.2
|
Release files / mm_pal-1.2.1-py3-none-any.whl
| Download URL | mm_pal-1.2.1-py3-none-any.whl |
|---|---|
| Size | 27.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6bcf70b9d32393ba717bccc0ae03aec7c49eabca13686bdbedb73c7abff9e8a
|
|
BLAKE2b-256 checksum How to use checksums |
6270d6b514f71a426ddc324008118f91ae2611109023cfc9ab2086c9ed1f4e1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.2
|
Security for mm-pal 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.