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

PCA9548A driver and I2C multiplexed master. #81

Merged
merged 3 commits into from
Dec 3, 2018

Conversation

strongly-typed
Copy link
Collaborator

@strongly-typed strongly-typed commented Sep 8, 2018

Fixes #80. Open for discussion.

@strongly-typed strongly-typed changed the title [WIP] PCA99548A driver and I2C multiplexed master. [WIP] PCA9548A driver and I2C multiplexed master. Sep 8, 2018
@salkinium
Copy link
Member

Ping?

@strongly-typed
Copy link
Collaborator Author

Ping?

Yes, it's done now and I politely ask for some review. Thanks to @chris-durand for help with the shorter template syntax!

@strongly-typed strongly-typed changed the title [WIP] PCA9548A driver and I2C multiplexed master. PCA9548A driver and I2C multiplexed master. Nov 27, 2018
examples/generic/i2c_multiplex/i2c_multiplex.cpp Outdated Show resolved Hide resolved
* Interface of an I2C Multiplexer.
*
* All I2C multiplexer driver should implement this interface.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put all classes in this file into the proper doxygen group, modm_i2c_multiplexer I believe. You can check the output via (cd modm/docs && doxygen doxyfile).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like so?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, sorry, the generator in :docs uses module naming, so it would be modm_architecture_i2c_multiplexer.

template < auto &object >
using Ch6 = I2cMultiplexerChannel< object, Channel::Ch6 >;
template < auto &object >
using Ch7 = I2cMultiplexerChannel< object, Channel::Ch7 >;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to automatically populate object with this? So you can do using Ch0 = object.Ch0;?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, probably @chris-durand comes up with a suggestion. I can live with that code.

modm::I2cMultiplexerChannel<multiplexer, channel>::start(modm::I2cTransaction *transaction, ConfigurationHandler handler)
{
// If call to multiplexer failed, return without doing the actual transaction
if (RF_CALL_BLOCKING(multiplexer.multiplexerDevice.setActiveChannel(static_cast<uint8_t>(channel))) == false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I need to introduce stackful fibers, so async doesn't modify the function signature.

@strongly-typed strongly-typed force-pushed the feature/pca9548a branch 2 times, most recently from 191dbb2 to b3936a9 Compare November 28, 2018 09:02
@strongly-typed
Copy link
Collaborator Author

@salkinium Everything good with that?

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@salkinium salkinium merged commit 77ae899 into modm-io:develop Dec 3, 2018
@strongly-typed strongly-typed deleted the feature/pca9548a branch December 4, 2018 14:19
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.

3 participants