-
Notifications
You must be signed in to change notification settings - Fork 1
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
fixed i2c initialization #1
Conversation
@@ -51,6 +51,7 @@ inline int I2c::initI2C_RW(int bus, int address, int dummy) | |||
} | |||
cfg.address = i2cAddress; // this seems unused anyhow | |||
i2cAddress = address; | |||
i2cHandle.Init(cfg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! this is the main bit missing to get Trill to work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giuliomoro add this fix to open a PR for review to E-S?
thanks and apologies for missing the earlier notifications. @virvel your fix of course looks great (silly me). I wonder what happens when you instantiate more than one device. Is it going to behave OK? |
great! no worries :) not sure about additional devices. could you make a pull request of this to electro-smith/libDaisy? maybe that was not your intention in the first place, but it would be nice to have it there. :) |
@virvel Sure, I'd be happy to make a PR there if you can confirm this works. I haven't had a chance to test it myself. |
@giuliomoro It works using a single I2C device connected at least. I've been using the trill craft a lot with the daisy seed. :) I think @dromer has been using it successfully as well. |
@virvel not actively, mostly just did a couple tests since I have some Trill sensors that I'd like to use with libDaisy (hoping in combo with Heavy in the future). This initialization fix at least allowed to using it as a PoC, but I think it would still need some work to properly integrate with libDaisy. |
What more work do you think is needed? The library itself is fully featured, but I understand that the example could have a bit more meat in it. Is there some libDaisy convention that I am missing ? |
Shouldn't the device config and init not follow the libDaisy conventions for this class of peripheral device? https://github.com/electro-smith/libDaisy/blob/master/src/dev/tlv493d.h#L35-L71 |
Right, that's all done here https://github.com/giuliomoro/libDaisy/blob/64c08470c079693cd9e2ab59cf2b85a5cff4727c/src/dev/trill/I2c.h |
I rationalised the commits, rebased and it's now a PR electro-smith#657 |
I guess what I mean is that the interface with libDaisy should follow the common OOP approach, where the rest of the Trill implementation is more functional. Does that make sense? |
turns out things have changed upstream so the rebase fails CI ... let's have further discussion there. |
Added missing initialization of I2CHandle. Should be working now. :)