-
Notifications
You must be signed in to change notification settings - Fork 52
[API v2]: Add support for I2C Output Components #749
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
base: migrate-api-v2
Are you sure you want to change the base?
Conversation
… i2c model and controller bridge
@tyeth This pull request is ready for review at your convenience. |
void WriteValue(int32_t value) { | ||
char message[LED_MAX_CHARS + 1]; | ||
snprintf(message, sizeof(message), "%ld", value); | ||
WriteMessage(message); | ||
} |
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.
I guess this could be base classed, but I see now each wants it's own length of floats so unless that get's specified too it can't be in the base unlike integer (although most people would accept 3significant figures).
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.
It's defined within https://github.com/adafruit/Adafruit_Wippersnapper_Arduino/pull/749/files#diff-c724b4fcb9880bb228afb12673a0b6c0db2fada900f120f5467d7a5cc4210a16R66
but I see what you're saying - move this code into the drvOutBase
class. Even for floats, the WriteMessage
will deal with the truncation/length in the loop where it writes the characters.
https://github.com/adafruit/Adafruit_LED_Backpack.git | ||
https://github.com/adafruit/Adafruit_LiquidCrystal.git |
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.
I believe these are actually in the platformIO registry:
https://registry.platformio.org/libraries/adafruit/Adafruit%20LED%20Backpack%20Library
This pull request enhances core I2C functionality by adding support for I2C output devices.
The following I2C Output Devices are supported by this pull request:
Pull Request Notes
I2cFactoryOutput
for creating I2C output drivers, including support for devices like LED backpacks and character LCDs (src/components/i2c/controller.cpp
).Handle_I2cDeviceOutputWrite
to process I2C output write messages, supporting operations like writing to LED backpacks or character LCDs (src/components/i2c/controller.cpp
).CreateI2cOutputDrv
function to create i2c output drivers from the factory (src/components/i2c/controller.cpp
).RemoveDriver()
,Handle_I2cDeviceAddOrReplace()
to include i2c output drivers.src/components/i2c/drivers/drvOutputBase.h
)src/components/i2c/drivers/drvOutput7Seg.h
,src/components/i2c/drivers/drvQuadAlphaNum.h
,src/components/i2c/drivers/drvOutCharLcd.h
)Addresses #742