Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api] Create a common API for accessing device file data #35

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

salkinium
Copy link
Member

@salkinium salkinium commented Apr 30, 2020

This is the initial exploration of what a shared API for accessing device file data could look like.
The goal is to decouple the device file data from the underlying format, and to move common algorithms for computing implicit data out of the using library (here modm modules) into modm-devices and to create a proper documented and versioned Python API.

Note: This is all very experimental, even if the technical side of this (ie. moving code) is simple, everything around it (docs, versioning, hosting) is not.

TODO:

  • GPIO driver
  • Core driver
  • Dma driver
  • Common driver base class for all other basic classes, incl. features and instances access
  • Documentation of the whole API via docstrings
  • Hosting documentation on data.modm.io and local docs
  • Move DeviceFile Cache from modm to here
  • Explore how to do proper API versioning
  • Device file consistency checks
    • Every GPIO signal must have a driver and name key
    • GPIO signals must be unique

cc @rleh @chris-durand @strongly-typed @mikewolfram @dergraaf

@salkinium salkinium force-pushed the feature/data_api branch 3 times, most recently from 929073b to bd2e26e Compare May 1, 2020 16:26
@salkinium
Copy link
Member Author

I found data inconsistency due to the merge algorithm. Hmpf.

@mikewolfram
Copy link
Contributor

I found data inconsistency due to the merge algorithm. Hmpf.

This leads me to a question. I've found that some hardware, which has several instances on one STM32, the instances are named xxx1, xxx2 etc. But if there is a variant of the STM32 which has a single instance only, sometimes that instance is simply named xxx. Wouldn't it be better, to also name the single instance xxx1?

Example: F303K8 has a single CAN.

@salkinium
Copy link
Member Author

Define "better". If ST fails at properly enumerating their peripherals, it becomes difficult to fix this, because this naming is then used in all docs and also in the CMSIS headers (although not consistently 🙄).

I'm currently delegating formatting to the HAL library, which may decide to rename instance "" to "1". In general we try to use the datasheet definitions though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants