Skip to content

Implement Wire #181

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

Closed
jgfoster opened this issue Oct 14, 2020 · 2 comments · Fixed by #189
Closed

Implement Wire #181

jgfoster opened this issue Oct 14, 2020 · 2 comments · Fixed by #189

Comments

@jgfoster
Copy link
Member

cpp/arduino/Wire.h has a number of // TODO comments. I'd like to complete the implementation and would appreciate guidance (or at least feedback on some ideas).

One extreme would be to pull in an existing implementation with the assumption that a "real" implementation would work by reading and writing pins (pins 20 & 21 on the Duo and Mega2560). With that, it is just like any other code that reads and writes pins.

A middle ground would be to write a new implementation that reads and write pins, but that seems like duplicate work.

The other extreme would be to mock the API at a higher level (and not set pins). Tests would not look at pins but would need to call a new testing API that could get and set values at a higher level than bits on a pin. This could be something added to Godmode or to Wire itself.

I propose a new high-level API (I would want it anyway) and that it be in Wire (I'd prefer not to further pollute Godmode). Thoughts?

@ianfixes
Copy link
Collaborator

This refers to https://www.arduino.cc/en/Reference/Wire

The TODO items correspond to where I'd put some sort of GODMODE hook, but I wasn't sure of how much to leverage existing structures for this or write new ones -- does it override what goes on with PinHistory, or interact with #145, etc.

@jgfoster
Copy link
Member Author

I expect there will have a PR on this in a couple days. Then we will have something concrete to discuss and critique.

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

Successfully merging a pull request may close this issue.

2 participants