Skip to content

support for alternate or multiple i2c buses #30

@bperrybap

Description

@bperrybap

The i/o classes that use i2c (currently hd44780_I2Cexp and hd44780_I2Clcd) are hardcoded to use an i2c wire library object named Wire
While this can be worked around using a macro as shown in issue #29
not only is that work around "ugly" but it is not optimal since does not allow assigning a bus object on a per lcd object instance.
i.e. all lcd objects must use the same Wire library object which means that they must all be on the same bus.
The solution is to pass the i/o class a Wire library object information when the constructor is declared & defined.
While a simple solution would be to simply pass in a pointer to the desired Wire library object, this is cannot be implemented in a portable way given that not all Wire libraries use the same class name for their Wire object.
There are various ways to handle this, most revolve around making the classes templated classes.
Where things get messy is that some of the more user friendly ways to handle it require much newer version of the compiler tools to use newer capabilities of the C++ standard.
I will have to balance ease of use, with backward compatibility capabilities, and tool set availability to try to ensure the widest amount of portability across not only versions of the Arduino IDE but also across the 3rd party hardware board package addons.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions