-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add Wire
like interface api
#1
Comments
I think(...) that it's not very hard to replace these 'Wire' like functions:
With those respectively:
More a problem will be Wire like functions as:
And I think these Wire functions will need a lot of extra coding:
I would personally be happy if the first part and a |
Yes, it's true, it would be nice to have a wrapper for a drop in replacement of the wire library and its methods. When I started to develop But, jumping over this "I don't like" stuff and thinking on ;-) There are many overloads of the methods in the wire library. So, I think I/we would have to find a compromise which one should be made ported. For instance, you can write a single byte or as I did in Then, overall, I need to think a bit more on how these two concepts could be married :-) But nothing is impossible! |
Just to do something, I started to make a small library that melts your brzo library and the old Wire together. It creates a new class called Wire2 (because it cannot be named Wire). So in an Arduino code, you need to include this translating library and rename any Wire to Wire2. That was the easy (but not for me) step. Next, more difficult, step is to let my library do the same as the original Wire library by using your code. (Fingers crossed, I am not a programmer) |
@supersjimmie Thanks for your effort. That sound really great. [... setup and begin ...]
uint8_t buffer[10] = [0,0,1,1,1,2,3,3,4,5];
brzo_i2c_write(&buffer[4], 5, true);
[... end ...] That should send |
Not quite :-) In EDIT 2: I have moved this to a new issue, #2 . |
I would really like that. Maybe just expect a raw pointer (like memcpy) and dont do the (&data[0]) query in this library. Than one could just pass in a pointer that points to the start of the array you would like. |
I have included a section in the wiki on "How to migrate from Wire Library", see here |
It would be great if this library would be supported as a drop in replacement for the
Wire
library. There could be a thin wrapper around this lib to make integration into existing code simpler.The text was updated successfully, but these errors were encountered: