diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 35c22617..20e7cde5 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - componentType: [pin, i2c, i2c_output, servo, ds18x20, pwm, pixel, uart, display] + componentType: [pin, i2c, i2c_output, servo, ds18x20, pwm, pixel, uart, display, expanders] 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|i2c_output|display)\/.*\/(definition\.json|image\.(png|jpe?g|gif))$" + EXTERNAL_REGEX="^components\/(pin|i2c|servo|ds18x20|pwm|pixel|uart|i2c_output|display|expanders)\/.*\/(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|i2c_output|display)\/(schema.json|.*\/(definition\.json|image\.(png|jpe?g|gif)))))$" + INTERNAL_REGEX="^(\.github\/.*|components\/(sensors.json|(pin|i2c|servo|ds18x20|pwm|pixel|uart|i2c_output|display|expanders)\/(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 diff --git a/components/expanders/ads1015/definition.json b/components/expanders/ads1015/definition.json new file mode 100644 index 00000000..4181edcc --- /dev/null +++ b/components/expanders/ads1015/definition.json @@ -0,0 +1,15 @@ +{ + "displayName": "ADS1015", + "description": "12-Bit ADC - 4 Channel.", + "published": true, + "vendor": "Adafruit Industries", + "productURL": "https://www.adafruit.com/product/1083", + "documentationURL": "https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/", + "i2cAddresses": ["0x48", "0x49", "0x4A", "0x4B"], + "pins": [ + {"displayName": "A0", "name": "0", "hasGPIO": false, "hasADC": true}, + {"displayName": "A1", "name": "1", "hasGPIO": false, "hasADC": true}, + {"displayName": "A2", "name": "2", "hasGPIO": false, "hasADC": true}, + {"displayName": "A3", "name": "3", "hasGPIO": false, "hasADC": true} + ] +} diff --git a/components/expanders/ads1115/definition.json b/components/expanders/ads1115/definition.json new file mode 100644 index 00000000..fba9f782 --- /dev/null +++ b/components/expanders/ads1115/definition.json @@ -0,0 +1,15 @@ +{ + "displayName": "ADS1115", + "description": "16-bit ADC - 4 Channel.", + "published": true, + "vendor": "Adafruit Industries", + "productURL": "https://www.adafruit.com/product/1085", + "documentationURL": "https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/", + "i2cAddresses": ["0x48", "0x49", "0x4A", "0x4B"], + "pins": [ + {"displayName": "A0", "name": "0", "hasGPIO": false, "hasADC": true}, + {"displayName": "A1", "name": "1", "hasGPIO": false, "hasADC": true}, + {"displayName": "A2", "name": "2", "hasGPIO": false, "hasADC": true}, + {"displayName": "A3", "name": "3", "hasGPIO": false, "hasADC": true} + ] +} \ No newline at end of file diff --git a/components/expanders/ads7128/definition.json b/components/expanders/ads7128/definition.json new file mode 100644 index 00000000..7fcc825c --- /dev/null +++ b/components/expanders/ads7128/definition.json @@ -0,0 +1,19 @@ +{ + "displayName": "ADS7128", + "description": "8-channel GPIO expander with 12-bit ADC.", + "published": false, + "vendor": "Texas Instruments", + "productURL": "https://www.ti.com/product/ADS7128", + "documentationURL": "https://www.ti.com/lit/gpn/ADS7128", + "i2cAddresses": ["0x10", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "0x17"], + "pins": [ + {"displayName": "AIN0", "name": "0", "hasGPIO": true, "hasADC": true}, + {"displayName": "AIN1", "name": "1", "hasGPIO": true, "hasADC": true}, + {"displayName": "AIN2", "name": "2", "hasGPIO": true, "hasADC": true}, + {"displayName": "AIN3", "name": "3", "hasGPIO": true, "hasADC": true}, + {"displayName": "AIN4", "name": "4", "hasGPIO": true, "hasADC": true}, + {"displayName": "AIN5", "name": "5", "hasGPIO": true, "hasADC": true}, + {"displayName": "AIN6", "name": "6", "hasGPIO": true, "hasADC": true}, + {"displayName": "AIN7", "name": "7", "hasGPIO": true, "hasADC": true} + ] +} diff --git a/components/expanders/aw9523/definition.json b/components/expanders/aw9523/definition.json new file mode 100644 index 00000000..b399c60e --- /dev/null +++ b/components/expanders/aw9523/definition.json @@ -0,0 +1,27 @@ +{ + "displayName": "AW9523", + "description": "16-pin GPIO expander and constant-current LED driver.", + "published": false, + "vendor": "Awinic", + "productURL": "https://www.adafruit.com/product/4886", + "documentationURL": "https://cdn-shop.adafruit.com/product-files/4886/AW9523%20English%20Datasheet.pdf", + "i2cAddresses": ["0x58", "0x59", "0x5A", "0x5B"], + "pins": [ + {"displayName": "0", "name": "0", "hasGPIO": true, "hasPWM": true}, + {"displayName": "1", "name": "1", "hasGPIO": true, "hasPWM": true}, + {"displayName": "2", "name": "2", "hasGPIO": true, "hasPWM": true}, + {"displayName": "3", "name": "3", "hasGPIO": true, "hasPWM": true}, + {"displayName": "4", "name": "4", "hasGPIO": true, "hasPWM": true}, + {"displayName": "5", "name": "5", "hasGPIO": true, "hasPWM": true}, + {"displayName": "6", "name": "6", "hasGPIO": true, "hasPWM": true}, + {"displayName": "7", "name": "7", "hasGPIO": true, "hasPWM": true}, + {"displayName": "8", "name": "8", "hasGPIO": true, "hasPWM": true}, + {"displayName": "9", "name": "9", "hasGPIO": true, "hasPWM": true}, + {"displayName": "10", "name": "10", "hasGPIO": true, "hasPWM": true}, + {"displayName": "11", "name": "11", "hasGPIO": true, "hasPWM": true}, + {"displayName": "12", "name": "12", "hasGPIO": true, "hasPWM": true}, + {"displayName": "13", "name": "13", "hasGPIO": true, "hasPWM": true}, + {"displayName": "14", "name": "14", "hasGPIO": true, "hasPWM": true}, + {"displayName": "15", "name": "15", "hasGPIO": true, "hasPWM": true} + ] +} diff --git a/components/expanders/mcp23017/definition.json b/components/expanders/mcp23017/definition.json new file mode 100644 index 00000000..e4ba8ad6 --- /dev/null +++ b/components/expanders/mcp23017/definition.json @@ -0,0 +1,27 @@ +{ + "displayName": "MCP23017", + "description": "16-pin GPIO expander", + "published": true, + "vendor": "Microchip Technology", + "productURL": "https://www.adafruit.com/product/5346", + "documentationURL": "https://learn.adafruit.com/adafruit-mcp23017-i2c-gpio-expander", + "i2cAddresses": ["0x20", "0x21", "0x22", "0x23", "0x24", "0x25", "0x26", "0x27"], + "pins": [ + {"displayName": "A0", "name": "0", "hasGPIO": true, "hasPullup": true}, + {"displayName": "A1", "name": "1", "hasGPIO": true, "hasPullup": true}, + {"displayName": "A2", "name": "2", "hasGPIO": true, "hasPullup": true}, + {"displayName": "A3", "name": "3", "hasGPIO": true, "hasPullup": true}, + {"displayName": "A4", "name": "4", "hasGPIO": true, "hasPullup": true}, + {"displayName": "A5", "name": "5", "hasGPIO": true, "hasPullup": true}, + {"displayName": "A6", "name": "6", "hasGPIO": true, "hasPullup": true}, + {"displayName": "A7", "name": "7", "hasGPIO": true, "hasPullup": true}, + {"displayName": "B0", "name": "8", "hasGPIO": true, "hasPullup": true}, + {"displayName": "B1", "name": "9", "hasGPIO": true, "hasPullup": true}, + {"displayName": "B2", "name": "10", "hasGPIO": true, "hasPullup": true}, + {"displayName": "B3", "name": "11", "hasGPIO": true, "hasPullup": true}, + {"displayName": "B4", "name": "12", "hasGPIO": true, "hasPullup": true}, + {"displayName": "B5", "name": "13", "hasGPIO": true, "hasPullup": true}, + {"displayName": "B6", "name": "14", "hasGPIO": true, "hasPullup": true}, + {"displayName": "B7", "name": "15", "hasGPIO": true, "hasPullup": true} + ] +} diff --git a/components/expanders/pcf8574/definition.json b/components/expanders/pcf8574/definition.json new file mode 100644 index 00000000..2249e812 --- /dev/null +++ b/components/expanders/pcf8574/definition.json @@ -0,0 +1,19 @@ +{ + "displayName": "PCF8574", + "description": "8-pin I2C GPIO expander.", + "published": false, + "vendor": "Texas Instruments", + "productURL": "https://www.adafruit.com/product/5545", + "documentationURL": "https://learn.adafruit.com/adafruit-pcf8574", + "i2cAddresses": ["0x20", "0x21", "0x22", "0x23", "0x24", "0x25", "0x26", "0x27"], + "pins": [ + {"displayName": "P0", "name": "0", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P1", "name": "1", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P2", "name": "2", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P3", "name": "3", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P4", "name": "4", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P5", "name": "5", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P6", "name": "6", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P7", "name": "7", "hasGPIO": true, "hasPullup": true} + ] +} diff --git a/components/expanders/pcf8575/definition.json b/components/expanders/pcf8575/definition.json new file mode 100644 index 00000000..144a60d3 --- /dev/null +++ b/components/expanders/pcf8575/definition.json @@ -0,0 +1,27 @@ +{ + "displayName": "PCF8575", + "description": "16-pin I2C GPIO expander.", + "published": false, + "vendor": "Texas Instruments", + "productURL": "https://www.adafruit.com/product/5611", + "documentationURL": "https://learn.adafruit.com/adafruit-pcf8575", + "i2cAddresses": ["0x20", "0x21", "0x22", "0x23", "0x24", "0x25", "0x26", "0x27"], + "pins": [ + {"displayName": "P0", "name": "0", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P1", "name": "1", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P2", "name": "2", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P3", "name": "3", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P4", "name": "4", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P5", "name": "5", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P6", "name": "6", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P7", "name": "7", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P8", "name": "8", "hasGPIO": true, "hasPullup": true}, + {"displayName": "P9", "name": "9", "hasGPIO": true, "hasPullup": true}, + {"displayName": "10", "name": "10", "hasGPIO": true, "hasPullup": true}, + {"displayName": "11", "name": "11", "hasGPIO": true, "hasPullup": true}, + {"displayName": "12", "name": "12", "hasGPIO": true, "hasPullup": true}, + {"displayName": "13", "name": "13", "hasGPIO": true, "hasPullup": true}, + {"displayName": "14", "name": "14", "hasGPIO": true, "hasPullup": true}, + {"displayName": "15", "name": "15", "hasGPIO": true, "hasPullup": true} + ] +} diff --git a/components/expanders/schema.json b/components/expanders/schema.json new file mode 100644 index 00000000..9b878b43 --- /dev/null +++ b/components/expanders/schema.json @@ -0,0 +1,104 @@ +{ + "title": "Expander Component Definition", + "description": "A GPIO/Peripheral Expander component for use in Adafruit IO", + "type": "object", + "$defs": { + "expanderPin": { + "type": "object", + "description": "A single pin exposed by a GPIO/peripheral expander.", + "required": ["displayName", "name"], + "additionalProperties": false, + "properties": { + "displayName": { + "description": "The human-readable label for this pin, shown in the Adafruit IO UI.", + "type": "string", + "pattern": "^[A-Za-z0-9_][A-Za-z0-9_ \\-\\[\\]()]*$" + }, + "name": { + "description": "The pin identifier passed to firmware (e.g. expander->pinMode(name, OUTPUT)).", + "type": "string", + "pattern": "^[A-Za-z0-9_]+$" + }, + "hasGPIO": { + "description": "If true, this pin supports digital GPIO.", + "type": "boolean" + }, + "direction": { + "description": "For pins that have a fixed direction, the pin's direction. Leave blank if it supports both.", + "type": "string", + "enum": ["INPUT", "OUTPUT"] + }, + "hasPullup": { + "description": "If true, this pin supports an internal pull-up resistor (only valid if hasGPIO is true).", + "type": "boolean" + }, + "hasPulldown": { + "description": "If true, this pin supports an internal pull-down resistor (only valid if hasGPIO is true).", + "type": "boolean" + }, + "hasPWM": { + "description": "If true, this pin supports PWM / analog output (e.g. LED constant-current drive).", + "type": "boolean" + }, + "hasADC": { + "description": "If true, this pin supports analog-to-digital conversion (analog input).", + "type": "boolean" + } + }, + "anyOf": [ + { "required": ["hasGPIO"] }, + { "required": ["hasPWM"] }, + { "required": ["hasADC"] } + ] + } + }, + "required": ["displayName", "vendor", "description", "documentationURL", "productURL", "i2cAddresses", "pins"], + "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. If false, 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 I2C addresses (as hex string, like \"0x38\") this component can appear on.", + "type": "array", + "items": { + "type": "string" + } + }, + "pins": { + "description": "List of pins exposed by this expander.", + "type": "array", + "items": { "$ref": "#/$defs/expanderPin" }, + "minItems": 1 + } + } +} diff --git a/components/expanders/seesaw_attiny1616/definition.json b/components/expanders/seesaw_attiny1616/definition.json new file mode 100644 index 00000000..8cb2b3fc --- /dev/null +++ b/components/expanders/seesaw_attiny1616/definition.json @@ -0,0 +1,23 @@ +{ + "displayName": "ATtiny1616 with Seesaw", + "description": "ATtiny1616 Breakout with seesaw.", + "published": false, + "vendor": "Adafruit", + "productURL": "https://www.adafruit.com/product/5690", + "documentationURL": "https://learn.adafruit.com/adafruit-attiny817-seesaw", + "i2cAddresses": ["0x49", "0x4A", "0x4B", "0x4C"], + "pins": [ + {"displayName": "0", "name": "0", "hasGPIO": true, "hasPullup": true, "hasADC": true, "hasPWM": true}, + {"displayName": "1", "name": "1", "hasGPIO": true, "hasPullup": true, "hasADC": true, "hasPWM": true}, + {"displayName": "2", "name": "2", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "3", "name": "3", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "4", "name": "4", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "5", "name": "5", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "6", "name": "6", "hasGPIO": true, "hasPullup": true}, + {"displayName": "7", "name": "7", "hasGPIO": true, "hasPullup": true, "hasPWM": true}, + {"displayName": "11", "name": "11", "hasGPIO": true, "hasPullup": true, "hasPWM": true}, + {"displayName": "14", "name": "14", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "15", "name": "15", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "16", "name": "16", "hasGPIO": true, "hasPullup": true, "hasADC": true, "hasPWM": true} + ] +} diff --git a/components/expanders/seesaw_attiny816/definition.json b/components/expanders/seesaw_attiny816/definition.json new file mode 100644 index 00000000..d8a518cf --- /dev/null +++ b/components/expanders/seesaw_attiny816/definition.json @@ -0,0 +1,22 @@ +{ + "displayName": "ATtiny816 with Seesaw", + "description": "ATtiny816 Breakout with seesaw.", + "published": false, + "vendor": "Adafruit", + "productURL": "https://www.adafruit.com/product/5681", + "documentationURL": "https://learn.adafruit.com/adafruit-attiny817-seesaw", + "i2cAddresses": ["0x49", "0x4A", "0x4B", "0x4C"], + "pins": [ + {"displayName": "0", "name": "0", "hasGPIO": true, "hasPullup": true, "hasADC": true, "hasPWM": true}, + {"displayName": "1", "name": "1", "hasGPIO": true, "hasPullup": true, "hasADC": true, "hasPWM": true}, + {"displayName": "2", "name": "2", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "3", "name": "3", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "4", "name": "4", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "5", "name": "5", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "7", "name": "7", "hasGPIO": true, "hasPullup": true, "hasPWM": true}, + {"displayName": "11", "name": "11", "hasGPIO": true, "hasPullup": true, "hasPWM": true}, + {"displayName": "14", "name": "14", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "15", "name": "15", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "16", "name": "16", "hasGPIO": true, "hasPullup": true, "hasADC": true, "hasPWM": true} + ] +} diff --git a/components/expanders/seesaw_attiny817/definition.json b/components/expanders/seesaw_attiny817/definition.json new file mode 100644 index 00000000..971669cc --- /dev/null +++ b/components/expanders/seesaw_attiny817/definition.json @@ -0,0 +1,26 @@ +{ + "displayName": "ATtiny817 with Seesaw", + "description": "ATtiny817 Breakout with seesaw.", + "published": false, + "vendor": "Adafruit", + "productURL": "https://www.adafruit.com/product/5233", + "documentationURL": "https://learn.adafruit.com/adafruit-attiny817-seesaw", + "i2cAddresses": ["0x49", "0x4A", "0x4B", "0x4C"], + "pins": [ + {"displayName": "0", "name": "0", "hasGPIO": true, "hasPullup": true, "hasADC": true, "hasPWM": true}, + {"displayName": "1", "name": "1", "hasGPIO": true, "hasPullup": true, "hasADC": true, "hasPWM": true}, + {"displayName": "2", "name": "2", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "3", "name": "3", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "5", "name": "5", "hasGPIO": true, "hasPullup": true, "direction": "OUTPUT"}, + {"displayName": "6", "name": "6", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "7", "name": "7", "hasGPIO": true, "hasPullup": true, "hasADC": true}, + {"displayName": "8", "name": "8", "hasGPIO": true, "hasPullup": true}, + {"displayName": "9", "name": "9", "hasGPIO": true, "hasPullup": true, "hasPWM": true}, + {"displayName": "12", "name": "12", "hasGPIO": true, "hasPullup": true, "hasPWM": true}, + {"displayName": "13", "name": "13", "hasGPIO": true, "hasPullup": true, "hasPWM": true}, + {"displayName": "14", "name": "14", "hasGPIO": true, "hasPullup": true}, + {"displayName": "18", "name": "18", "hasGPIO": true, "hasADC": true}, + {"displayName": "19", "name": "19", "hasGPIO": true, "hasADC": true}, + {"displayName": "20", "name": "20", "hasADC": true} + ] +} diff --git a/components/expanders/tca8418/definition.json b/components/expanders/tca8418/definition.json new file mode 100644 index 00000000..69d8f509 --- /dev/null +++ b/components/expanders/tca8418/definition.json @@ -0,0 +1,29 @@ +{ + "displayName": "TCA8418", + "description": "18-pin I2C GPIO expander and keyboard matrix.", + "published": false, + "vendor": "Texas Instruments", + "productURL": "https://www.adafruit.com/product/4918", + "documentationURL": "https://learn.adafruit.com/adafruit-tca8418-keypad-matrix-and-gpio-expander-breakout", + "i2cAddresses": ["0x34"], + "pins": [ + {"displayName": "C0", "name": "8", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C1", "name": "9", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C2", "name": "10", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C3", "name": "11", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C4", "name": "12", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C5", "name": "13", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C6", "name": "14", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C7", "name": "15", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C8", "name": "16", "hasGPIO": true, "hasPullup": true}, + {"displayName": "C9", "name": "17", "hasGPIO": true, "hasPullup": true}, + {"displayName": "R0", "name": "0", "hasGPIO": true, "hasPullup": true}, + {"displayName": "R1", "name": "1", "hasGPIO": true, "hasPullup": true}, + {"displayName": "R2", "name": "2", "hasGPIO": true, "hasPullup": true}, + {"displayName": "R3", "name": "3", "hasGPIO": true, "hasPullup": true}, + {"displayName": "R4", "name": "4", "hasGPIO": true, "hasPullup": true}, + {"displayName": "R5", "name": "5", "hasGPIO": true, "hasPullup": true}, + {"displayName": "R6", "name": "6", "hasGPIO": true, "hasPullup": true}, + {"displayName": "R7", "name": "7", "hasGPIO": true, "hasPullup": true} + ] +}