-
Notifications
You must be signed in to change notification settings - Fork 174
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
cap1xxx - add support to specify alternate i2c address (#111) #114
cap1xxx - add support to specify alternate i2c address (#111) #114
Conversation
/** | ||
* Create a new Cap1xxx controller. | ||
* | ||
* @param i2cName I2C port name where the controller is attached. Cannot be null. | ||
* @param i2cAddress 7-bit I2C address for the attached controller. Cannot be null. |
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.
int values cannot be null, I'd remove that phrase from the end.
* framework. | ||
* | ||
* @param i2cName I2C port name where the controller is attached. Cannot be null. | ||
* @param i2cAddress 7-bit I2C address for the attached controller. Cannot be null. |
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.
int values cannot be null, I'd remove that phrase from the end.
* @throws IOException | ||
*/ | ||
public Cap1xxx(String i2cName, String alertName, Configuration chip, Handler handler) throws IOException { | ||
this(i2cName, I2C_ADDRESS, alertName, chip, handler); |
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.
This is a good change, but if we expose the I2C address as a parameter let's rename the constant to DEFAULT_I2C_ADDRESS
to match our other drivers (example)
@@ -192,7 +192,7 @@ public Cap1xxx(Context context, String i2cName, String alertName, Configuration | |||
} | |||
|
|||
/** | |||
* Create a new Cap1xxx controller. | |||
* Create a new Cap12xx controller with the default I2C address. |
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.
Rename to Cap1xxx
I believe all requested changes are made @devunwired |
The cap1xxx range support multiple i2c addresses which are used across our various boards- GFX HAT, Display-o-tron HAT, Drum HAT, Piano HAT, etc- this patch adds support for specifying an i2c address
See #111 for details.