Merge pull request #255 from adafruit/add-i2c-output-components

Add I2C Output Component Type and Related Components
This commit is contained in:
Brent Rubell 2025-06-18 12:35:09 -04:00 committed by GitHub
commit cad8fcd64a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 197 additions and 3 deletions

View file

@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
componentType: [pin, i2c, servo, ds18x20, pwm, pixel, uart]
componentType: [pin, i2c, i2c_output, servo, ds18x20, pwm, pixel, uart]
name: Validate ${{ matrix.componentType }} Component Definition Files
steps:
@ -84,10 +84,10 @@ jobs:
EXIT_VALUE=0
# external contributors can modify some files
EXTERNAL_REGEX="^components\/(pin|i2c|servo|ds18x20|pwm|pixel|uart)\/.*\/(definition\.json|image\.(png|jpe?g|gif))$"
EXTERNAL_REGEX="^components\/(pin|i2c|servo|ds18x20|pwm|pixel|uart|i2c_output)\/.*\/(definition\.json|image\.(png|jpe?g|gif))$"
# folks with write access to the repo (Adafruit team) can change more sensitive files
INTERNAL_REGEX="^(\.github\/.*|components\/(sensors.json|(pin|i2c|servo|ds18x20|pwm|pixel|uart)\/(schema.json|.*\/(definition\.json|image\.(png|jpe?g|gif)))))$"
INTERNAL_REGEX="^(\.github\/.*|components\/(sensors.json|(pin|i2c|servo|ds18x20|pwm|pixel|uart|i2c_output)\/(schema.json|.*\/(definition\.json|image\.(png|jpe?g|gif)))))$"
# apply the appropriate regex based on permissions of the user
if [[ $CAN_WRITE_TO_REPO ]]; then

View file

@ -0,0 +1,12 @@
{
"displayName": "7-Segment LED Matrix",
"published": true,
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/878",
"documentationURL": "https://learn.adafruit.com/adafruit-led-backpack/0-dot-56-seven-segment-backpack",
"description": "7-Segment LED Matrix with I2C Backpack",
"i2cAddresses": [ "0x70", "0x71", "0x72", "0x73", "0x74", "0x75", "0x76", "0x77" ],
"outputType": "7SEG",
"ledBackpackAlignment": "RIGHT",
"ledBackpackBrightness": 8
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View file

@ -0,0 +1,12 @@
{
"displayName": "16x2 Character Display",
"published": true,
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/1447",
"documentationURL": "https://learn.adafruit.com/i2c-spi-lcd-backpack",
"description": "Standard 16x2 HD44780 character display with I2C backpack",
"i2cAddresses": [ "0x20", "0x21", "0x22", "0x23", "0x24", "0x25", "0x26", "0x27" ],
"outputType": "CHARLCD",
"charLcdColumns": 16,
"charLcdRows": 2
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -0,0 +1,12 @@
{
"displayName": "20x4 Character Display",
"published": true,
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/198",
"documentationURL": "https://learn.adafruit.com/i2c-spi-lcd-backpack",
"description": "Standard 20x4 HD44780 character display with I2C backpack",
"i2cAddresses": [ "0x20", "0x21", "0x22", "0x23", "0x24", "0x25", "0x26", "0x27" ],
"outputType": "CHARLCD",
"charLcdColumns": 20,
"charLcdRows": 4
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -0,0 +1,13 @@
{
"displayName": "128x32 OLED (Default)",
"published": true,
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/4440",
"documentationURL": "https://learn.adafruit.com/monochrome-oled-breakouts",
"description": "Monochrome 128x32 OLED graphic display with the default font size.",
"i2cAddresses": [ "0x3C" ],
"outputType": "OLED",
"oledWidth": 128,
"oledHeight": 32,
"textSize": "SZ_DEFAULT"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View file

@ -0,0 +1,13 @@
{
"displayName": "128x32 OLED (Large Font)",
"published": true,
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/4440",
"documentationURL": "https://learn.adafruit.com/monochrome-oled-breakouts",
"description": "Monochrome 128x32 I2C OLED Display with a larger font size",
"i2cAddresses": [ "0x3C" ],
"outputType": "OLED",
"oledWidth": 128,
"oledHeight": 32,
"textSize": "SZ_LARGE"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View file

@ -0,0 +1,13 @@
{
"displayName": "128x64 OLED (Default)",
"published": true,
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/938",
"documentationURL": "https://learn.adafruit.com/monochrome-oled-breakouts",
"description": "Monochrome 128x64 I2C OLED Display with the default font size.",
"i2cAddresses": [ "0x3D" ],
"outputType": "OLED",
"oledWidth": 128,
"oledHeight": 64,
"textSize": "SZ_DEFAULT"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View file

@ -0,0 +1,13 @@
{
"displayName": "128x64 OLED (Large Font)",
"published": true,
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/938",
"documentationURL": "https://learn.adafruit.com/monochrome-oled-breakouts",
"description": "Monochrome 128x64 I2C OLED Display with a larger font size.",
"i2cAddresses": [ "0x3D" ],
"outputType": "OLED",
"oledWidth": 128,
"oledHeight": 64,
"textSize": "SZ_LARGE"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View file

@ -0,0 +1,12 @@
{
"displayName": "Quad Alphanum. Display",
"published": true,
"vendor": "Adafruit",
"productURL": "https://www.adafruit.com/product/1911",
"documentationURL": "https://learn.adafruit.com/adafruit-led-backpack/0-54-alphanumeric",
"description": "Quad Alphanumeric Display 0.54\" Digits w/ I2C Backpack - STEMMA QT / Qwiic",
"i2cAddresses": [ "0x70", "0x71", "0x72", "0x73", "0x74", "0x75", "0x76", "0x77" ],
"outputType": "ALPHANUM",
"ledBackpackAlignment": "RIGHT",
"ledBackpackBrightness": 8
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View file

@ -0,0 +1,94 @@
{
"title": "I2C Output Component Definition",
"description": "I2C Output component for use in Adafruit IO",
"type": "object",
"required": [ "displayName", "vendor", "outputType", "i2cAddresses"],
"additionalProperties": false,
"properties": {
"displayName": {
"description": "The human-friendly name of this component.",
"type": "string",
"minLength": 3,
"maxLength": 24
},
"published": {
"description": "If True, this component is supported by the current firmware version and will be displayed to all users. Otherwise, it is hidden behind a developer toggle so that contributors can still work on it against the production site.",
"type": "boolean"
},
"description": {
"description": "A brief description describing this component's capabilities.",
"type": "string",
"minLength": 3,
"maxLength": 255
},
"productURL": {
"description": "Link to this component's homepage.",
"type": "string",
"format": "uri"
},
"documentationURL": {
"description": "Link to this component's documentation.",
"type": "string",
"format": "uri"
},
"vendor": {
"description": "Name of the company that makes this component.",
"type": "string",
"minLength": 3,
"maxLength": 24
},
"i2cAddresses": {
"description": "List of supported I2C addresses for this component.",
"type": "array",
"items": {
"type": "string",
"pattern": "^0x[0-9A-Fa-f]{2}$"
}
},
"outputType": {
"description": "The type of i2c output component. Corresponds to `I2cOutputAdd` in i2c.proto",
"type": "string",
"pattern": "^(CHARLCD|7SEG|ALPHANUM|OLED)$"
},
"charLcdColumns": {
"description": "The number of columns for a character LCD. Corresponds to `CharLCDConfig` in i2c.proto.",
"type": "number",
"minimum": 0,
"maximum": 128
},
"charLcdRows": {
"description": "The number of rows for a character LCD. Corresponds to `CharLCDConfig` in i2c.proto.",
"type": "number",
"minimum": 0,
"maximum": 16
},
"ledBackpackAlignment": {
"description": "The alignment for the LED backpack. Corresponds to `LedBackpackConfig` in i2c.proto. Defaults to RIGHT.",
"type": "string",
"pattern": "^(LEFT|RIGHT)$"
},
"ledBackpackBrightness": {
"description": "The brightness of a LED backpack. Corresponds to `CharLCDConfig` in i2c.proto.",
"type": "number",
"minimum": 0,
"maximum": 15
},
"oledWidth": {
"description": "The width of an OLED display, in pixels.",
"type": "number",
"minimum": 0,
"maximum": 128
},
"oledHeight": {
"description": "The height of an OLED display, in pixels.",
"type": "number",
"minimum": 0,
"maximum": 64
},
"textSize": {
"description": "The font magnification size for a OLED display. Corresponds to `SSD1306TextSize` in i2c.proto.",
"type": "string",
"pattern": "^(SZ_DEFAULT|SZ_LARGE)$"
}
}
}