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

Redesign SWM API #76

Closed
5 tasks done
hannobraun opened this issue May 4, 2018 · 3 comments
Closed
5 tasks done

Redesign SWM API #76

hannobraun opened this issue May 4, 2018 · 3 comments

Comments

@hannobraun
Copy link
Member

hannobraun commented May 4, 2018

I'm unhappy with some aspects of the swm module's design:

  • The distribution of responsibility between hand-written and generated code: Handle generated code consistenly #48
  • The number of traits for fixed and movable functions. Once Handle generated code consistenly #48 has been implemented, I believe we can reduce this to one trait for fixed and one trait for movable functions.
  • The relationship of AdcChannel/InputFunction/OutputFunction to the traits for fixed and movable functions. There are so many traits, and a lot of complexity when using them in function signatures. I don't have a clear vision here, yet, only the vague feeling that there must be a better way.
  • The public API for the SWM lives in the gpio module, which is weird at best, confusing at worst. Once Handle generated code consistenly #48 is implemented, it can be moved to the new FixedFunction/MovableFunction types.
  • The gpio and swm modules are entangled with each other. I think it would be less complex, if swm owned Pin and related types, and gpio was restricted to GPIO APIs.
@hannobraun
Copy link
Member Author

Updated the original comment. Some items have been completed.

@hannobraun
Copy link
Member Author

Updated original comment. Thanks to #90 and #91, the API has been radically simplified. There are only 2 methods total now (down from 8): One for assigning functions, one for unassigning them.

@hannobraun
Copy link
Member Author

Updated original comment. #92 moved the function assignment API to the swm module. I also added another item about the entanglement between the gpio and swm modules.

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

No branches or pull requests

1 participant