From 53b931ac0a6895c2fc3ee554225732e9150f1f48 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 14 May 2025 12:38:29 -0400 Subject: [PATCH 01/10] Update I2C.proto for i2c output components --- proto/wippersnapper/i2c/v1/i2c.proto | 92 ++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index c89b841..135c584 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -93,6 +93,8 @@ message I2CDeviceInitRequest { uint32 i2c_device_address = 3; /** The 7-bit I2C address of the device on the bus. */ string i2c_device_name = 4[(nanopb).max_size = 15]; /** The I2C device's name, MUST MATCH the name on the JSON definition file on https://github.com/adafruit/Wippersnapper_Components. */ repeated I2CDeviceSensorProperties i2c_device_properties = 5[(nanopb).max_count = 15]; /** Properties of each sensor on the I2C device. */ + bool is_output_device = 6; /** True if the I2C device is an i2c output device, False otherwise (default). */ + I2cOutputAdd i2c_output_add = 7; /** The configuration for an I2C output device. */ } /** @@ -205,3 +207,93 @@ message I2CDeviceEvent { uint32 sensor_address = 1; /** The 7-bit I2C address of the I2C device. */ repeated SensorEvent sensor_event = 2[(nanopb).max_count = 15]; /** A, optionally repeated, SensorEvent from a sensor. */ } + +/** +* I2cDeviceOutputWrite represents a request to write to an I2C output device. +* NOTE: This message is similar to the I2CDeviceOutputWrite message on +* the api-v2 branch but NOT identical. +*/ +message I2CDeviceOutputWrite { + uint32 i2c_device_address = 1; /** The 7-bit I2C address of the device on the bus. */ + string i2c_device_name = 2[(nanopb).max_size = 15]; /** The I2C device's name, MUST MATCH the name on the JSON definition file on https://github.com/adafruit/Wippersnapper_Components. */ + oneof output_msg { + LedBackpackWrite write_led_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ + CharLCDWrite write_char_lcd = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ + } +} + +///*** I2C Output Device Messages (from i2c_output.proto in api v2) ***/// + +/** +* LedBackpackBlinkRate represents supported, OPTIONAL, +* blink rates for LED backpack displays +*/ +enum LedBackpackBlinkRate { + LED_BACKPACK_BLINK_RATE_UNSPECIFIED = 0; /** No blinking. **/ + LED_BACKPACK_BLINK_RATE_OFF = 1; /** No blinking. **/ + LED_BACKPACK_BLINK_RATE_2HZ = 2; /** 2 Hz blink rate. **/ + LED_BACKPACK_BLINK_RATE_1HZ = 3; /** 1 Hz blink rate. **/ + LED_BACKPACK_BLINK_RATE_HALFHZ = 4; /** 0.5 Hz blink rate. **/ +} + +/** +* LedBackpackAlignment represents all text alignment +* options for LED backpack displays +*/ +enum LedBackpackAlignment { + LED_BACKPACK_ALIGNMENT_UNSPECIFIED = 0; /** Unspecified alignment option. **/ + LED_BACKPACK_ALIGNMENT_LEFT = 1; /** (Default) Left-aligned. **/ + LED_BACKPACK_ALIGNMENT_RIGHT = 2; /** Right-aligned. **/ +} + +/** +* LedBackpackConfig represents the configuration for a LED backpack display. +*/ +message LedBackpackConfig { + int32 brightness = 1; /** Desired brightness of the LED backpack, from 0 (off) to 15 (full brightness). **/ + LedBackpackAlignment alignment = 2; /** Desired text alignment for the LED backpack. **/ +} + +/** +* CharLCDConfig represents the configuration for a character LCD display. +*/ +message CharLCDConfig { + uint32 rows = 1; /** Number of rows for the character LCD. **/ + uint32 columns = 2; /** Number of columns for the character LCD. **/ + string backlight_color = 3 [(nanopb).max_size = 15]; /** Optional Backlight color for the character LCD, in Hex. **/ +} + +/** +* I2cOutputAdd represents a request from the broker to add an I2C output device to a device. +*/ +message I2cOutputAdd { + oneof config { + LedBackpackConfig led_backpack_config = 1; /** Configuration for LED backpack. **/ + CharLCDConfig char_lcd_config = 2; /** Configuration for character LCD. **/ + } +} + +/** +* LedBackpackWrite represents a request from the broker to write a message to a LED backpack. +*/ +message LedBackpackWrite { + oneof message { + string text = 1 [(nanopb).max_size = 8]; /** Text to write to the LED backpack. **/ + int32 number_int = 2; /** Number to write to the LED backpack. **/ + float number_float = 3; /** Float to write to the LED backpack. **/ + } + bool adjust_brightness = 4; /** Optionally used to enable the brightness tag. **/ + int32 brightness = 5; /** Optionally adjusts the brightness from 0 (off) to 15 (full brightness). **/ + LedBackpackBlinkRate blink_rate = 6; /** Optionally sets the blink rate for the LED backpack. **/ + bool enable_scroll_marquee = 7; /** Optionally enables automatic text scrolling **/ + float scroll_marquee_speed = 8; /** Speed for the scrolling marquee. **/ +} + +/** +* CharLCDWrite represents a request from the broker to write to a character LCD. +*/ +message CharLCDWrite { + string message = 1 [(nanopb).max_size = 128]; /** Message to write to the character LCD. **/ + string backlight_color = 2 [(nanopb).max_size = 16]; /** Optional Backlight color for the character LCD, in Hex. **/ + bool enable_scroll = 3; /** Optional Enable automatic scrolling for the character LCD. **/ +} \ No newline at end of file From f27a0dadf0a37dde2a17ed10f4737ac3c1e212da Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 14 May 2025 12:41:59 -0400 Subject: [PATCH 02/10] Link OutPutWrite in I2CRequest signal msg --- proto/wippersnapper/signal/v1/signal.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/proto/wippersnapper/signal/v1/signal.proto b/proto/wippersnapper/signal/v1/signal.proto index 5f23754..305e848 100644 --- a/proto/wippersnapper/signal/v1/signal.proto +++ b/proto/wippersnapper/signal/v1/signal.proto @@ -73,6 +73,7 @@ message I2CRequest { wippersnapper.i2c.v1.I2CDeviceDeinitRequest req_i2c_device_deinit = 5; wippersnapper.i2c.v1.I2CDeviceUpdateRequest req_i2c_device_update = 6; wippersnapper.i2c.v1.I2CDeviceInitRequests req_i2c_device_init_requests = 7; + wippersnapper.i2c.v1.I2CDeviceOutputWrite req_i2c_device_out_write = 8; } } From 383122376eb3b2a8813a7eb9f5723ad4228f0a59 Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 16 May 2025 11:27:44 -0400 Subject: [PATCH 03/10] Add SSD1306 messaging --- proto/wippersnapper/i2c/v1/i2c.proto | 31 +++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index 135c584..c4c1746 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 Brent Rubell for Adafruit Industries +// SPDX-FileCopyrightText: 2021-2025 Brent Rubell for Adafruit Industries // SPDX-License-Identifier: MIT syntax = "proto3"; @@ -219,6 +219,7 @@ message I2CDeviceOutputWrite { oneof output_msg { LedBackpackWrite write_led_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ CharLCDWrite write_char_lcd = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ + Ssd1306Write write_ssd1306 = 5; /** Optional - If the I2C device is a SSD1306 OLED display, fill this field. **/ } } @@ -246,6 +247,16 @@ enum LedBackpackAlignment { LED_BACKPACK_ALIGNMENT_RIGHT = 2; /** Right-aligned. **/ } +/** +* Desired SSD1306 text 'magnification' size. +*/ +enum Ssd1306TextSize { + SSD_1_3_0_6_TEXT_SIZE_UNSPECIFIED = 0; /** Unspecified text size. **/ + SSD_1_3_0_6_TEXT_SIZE_1 = 1; /** Default text size. 6x8. **/ + SSD_1_3_0_6_TEXT_SIZE_2 = 2; /** Text size 2. 12x16. **/ + SSD_1_3_0_6_TEXT_SIZE_3 = 3; /** Text size 3. 18x24. **/ +} + /** * LedBackpackConfig represents the configuration for a LED backpack display. */ @@ -263,6 +274,15 @@ message CharLCDConfig { string backlight_color = 3 [(nanopb).max_size = 15]; /** Optional Backlight color for the character LCD, in Hex. **/ } +/** +* Ssd1306Config represents the configuration for a SSD1306 OLED display. +*/ +message Ssd1306Config { + uint32 width = 1; /** Width of the display. **/ + uint32 height = 2; /** Height of the display. **/ + Ssd1306TextSize text_size = 3; /** Desired text 'magnification' size. **/ +} + /** * I2cOutputAdd represents a request from the broker to add an I2C output device to a device. */ @@ -270,6 +290,7 @@ message I2cOutputAdd { oneof config { LedBackpackConfig led_backpack_config = 1; /** Configuration for LED backpack. **/ CharLCDConfig char_lcd_config = 2; /** Configuration for character LCD. **/ + Ssd1306Config ssd1306_config = 3; /** Configuration for SSD1306 OLED display. **/ } } @@ -296,4 +317,12 @@ message CharLCDWrite { string message = 1 [(nanopb).max_size = 128]; /** Message to write to the character LCD. **/ string backlight_color = 2 [(nanopb).max_size = 16]; /** Optional Backlight color for the character LCD, in Hex. **/ bool enable_scroll = 3; /** Optional Enable automatic scrolling for the character LCD. **/ +} + +/** +* Ssd1306Write represents a request from the broker to +* write to a SSD1306 OLED display. +*/ +message Ssd1306Write { + string message = 1 [(nanopb).max_size = 128]; /** Message to write to a SSD1306 OLED display. **/ } \ No newline at end of file From 947b77d50ca581669308cd5760d6eda461517cdd Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 16 May 2025 11:33:47 -0400 Subject: [PATCH 04/10] Fix enum prefix --- proto/wippersnapper/i2c/v1/i2c.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index c4c1746..295f8bc 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -251,10 +251,10 @@ enum LedBackpackAlignment { * Desired SSD1306 text 'magnification' size. */ enum Ssd1306TextSize { - SSD_1_3_0_6_TEXT_SIZE_UNSPECIFIED = 0; /** Unspecified text size. **/ - SSD_1_3_0_6_TEXT_SIZE_1 = 1; /** Default text size. 6x8. **/ - SSD_1_3_0_6_TEXT_SIZE_2 = 2; /** Text size 2. 12x16. **/ - SSD_1_3_0_6_TEXT_SIZE_3 = 3; /** Text size 3. 18x24. **/ + SSD1306_TEXT_SIZE_UNSPECIFIED = 0; /** Unspecified text size. **/ + SSD1306_TEXT_SIZE_1 = 1; /** Default text size. 6x8. **/ + SSD1306_TEXT_SIZE_2 = 2; /** Text size 2. 12x16. **/ + SSD1306_TEXT_SIZE_3 = 3; /** Text size 3. 18x24. **/ } /** From b7791a1befb87441bb5325b4e74b08e9d57b650e Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 16 May 2025 13:45:35 -0400 Subject: [PATCH 05/10] Address Loren review chat --- proto/wippersnapper/i2c/v1/i2c.proto | 38 +++++----------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index 295f8bc..23102eb 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -218,25 +218,13 @@ message I2CDeviceOutputWrite { string i2c_device_name = 2[(nanopb).max_size = 15]; /** The I2C device's name, MUST MATCH the name on the JSON definition file on https://github.com/adafruit/Wippersnapper_Components. */ oneof output_msg { LedBackpackWrite write_led_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ - CharLCDWrite write_char_lcd = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ + CharLcdWrite write_char_lcd = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ Ssd1306Write write_ssd1306 = 5; /** Optional - If the I2C device is a SSD1306 OLED display, fill this field. **/ } } ///*** I2C Output Device Messages (from i2c_output.proto in api v2) ***/// -/** -* LedBackpackBlinkRate represents supported, OPTIONAL, -* blink rates for LED backpack displays -*/ -enum LedBackpackBlinkRate { - LED_BACKPACK_BLINK_RATE_UNSPECIFIED = 0; /** No blinking. **/ - LED_BACKPACK_BLINK_RATE_OFF = 1; /** No blinking. **/ - LED_BACKPACK_BLINK_RATE_2HZ = 2; /** 2 Hz blink rate. **/ - LED_BACKPACK_BLINK_RATE_1HZ = 3; /** 1 Hz blink rate. **/ - LED_BACKPACK_BLINK_RATE_HALFHZ = 4; /** 0.5 Hz blink rate. **/ -} - /** * LedBackpackAlignment represents all text alignment * options for LED backpack displays @@ -266,12 +254,11 @@ message LedBackpackConfig { } /** -* CharLCDConfig represents the configuration for a character LCD display. +* CharLcdConfig represents the configuration for a character LCD display. */ -message CharLCDConfig { +message CharLcdConfig { uint32 rows = 1; /** Number of rows for the character LCD. **/ uint32 columns = 2; /** Number of columns for the character LCD. **/ - string backlight_color = 3 [(nanopb).max_size = 15]; /** Optional Backlight color for the character LCD, in Hex. **/ } /** @@ -289,7 +276,7 @@ message Ssd1306Config { message I2cOutputAdd { oneof config { LedBackpackConfig led_backpack_config = 1; /** Configuration for LED backpack. **/ - CharLCDConfig char_lcd_config = 2; /** Configuration for character LCD. **/ + CharLcdConfig char_lcd_config = 2; /** Configuration for character LCD. **/ Ssd1306Config ssd1306_config = 3; /** Configuration for SSD1306 OLED display. **/ } } @@ -298,25 +285,14 @@ message I2cOutputAdd { * LedBackpackWrite represents a request from the broker to write a message to a LED backpack. */ message LedBackpackWrite { - oneof message { - string text = 1 [(nanopb).max_size = 8]; /** Text to write to the LED backpack. **/ - int32 number_int = 2; /** Number to write to the LED backpack. **/ - float number_float = 3; /** Float to write to the LED backpack. **/ - } - bool adjust_brightness = 4; /** Optionally used to enable the brightness tag. **/ - int32 brightness = 5; /** Optionally adjusts the brightness from 0 (off) to 15 (full brightness). **/ - LedBackpackBlinkRate blink_rate = 6; /** Optionally sets the blink rate for the LED backpack. **/ - bool enable_scroll_marquee = 7; /** Optionally enables automatic text scrolling **/ - float scroll_marquee_speed = 8; /** Speed for the scrolling marquee. **/ + string message = 1 [(nanopb).max_size = 5]; /** Message to write to the LED backpack. **/ } /** -* CharLCDWrite represents a request from the broker to write to a character LCD. +* CharLcdWrite represents a request from the broker to write to a character LCD. */ -message CharLCDWrite { +message CharLcdWrite { string message = 1 [(nanopb).max_size = 128]; /** Message to write to the character LCD. **/ - string backlight_color = 2 [(nanopb).max_size = 16]; /** Optional Backlight color for the character LCD, in Hex. **/ - bool enable_scroll = 3; /** Optional Enable automatic scrolling for the character LCD. **/ } /** From 6c842d81bf332dfc0fbfef4d2045c2d934e467f3 Mon Sep 17 00:00:00 2001 From: brentru Date: Fri, 16 May 2025 14:08:07 -0400 Subject: [PATCH 06/10] Add enable_backlight for ladyada review --- proto/wippersnapper/i2c/v1/i2c.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index 23102eb..26c8007 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -293,6 +293,7 @@ message LedBackpackWrite { */ message CharLcdWrite { string message = 1 [(nanopb).max_size = 128]; /** Message to write to the character LCD. **/ + bool enable_backlight = 2; /** Optional field to enable/disable the backlight. Should be its own feed (0 is off, 1 is on).**/ } /** From 57b2bc668b489326ade23b009053748ce1001f1f Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 19 May 2025 12:18:58 -0400 Subject: [PATCH 07/10] Consistent naming scheme for v1 --- proto/wippersnapper/i2c/v1/i2c.proto | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index 26c8007..8373b2e 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -93,8 +93,8 @@ message I2CDeviceInitRequest { uint32 i2c_device_address = 3; /** The 7-bit I2C address of the device on the bus. */ string i2c_device_name = 4[(nanopb).max_size = 15]; /** The I2C device's name, MUST MATCH the name on the JSON definition file on https://github.com/adafruit/Wippersnapper_Components. */ repeated I2CDeviceSensorProperties i2c_device_properties = 5[(nanopb).max_count = 15]; /** Properties of each sensor on the I2C device. */ - bool is_output_device = 6; /** True if the I2C device is an i2c output device, False otherwise (default). */ - I2cOutputAdd i2c_output_add = 7; /** The configuration for an I2C output device. */ + bool is_output_device = 6; /** True if the I2C device is an I2C output device, False otherwise (default). */ + I2COutputAdd i2c_output_add = 7; /** The configuration for an I2C output device. */ } /** @@ -209,7 +209,7 @@ message I2CDeviceEvent { } /** -* I2cDeviceOutputWrite represents a request to write to an I2C output device. +* I2CDeviceOutputWrite represents a request to write to an I2C output device. * NOTE: This message is similar to the I2CDeviceOutputWrite message on * the api-v2 branch but NOT identical. */ @@ -217,19 +217,19 @@ message I2CDeviceOutputWrite { uint32 i2c_device_address = 1; /** The 7-bit I2C address of the device on the bus. */ string i2c_device_name = 2[(nanopb).max_size = 15]; /** The I2C device's name, MUST MATCH the name on the JSON definition file on https://github.com/adafruit/Wippersnapper_Components. */ oneof output_msg { - LedBackpackWrite write_led_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ - CharLcdWrite write_char_lcd = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ - Ssd1306Write write_ssd1306 = 5; /** Optional - If the I2C device is a SSD1306 OLED display, fill this field. **/ + LEDBackpackWrite write_LED_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ + CharLCDWrite write_char_LCD = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ + SSD1306Write write_SSD1306 = 5; /** Optional - If the I2C device is a SSD1306 OLED display, fill this field. **/ } } ///*** I2C Output Device Messages (from i2c_output.proto in api v2) ***/// /** -* LedBackpackAlignment represents all text alignment +* LEDBackpackAlignment represents all text alignment * options for LED backpack displays */ -enum LedBackpackAlignment { +enum LEDBackpackAlignment { LED_BACKPACK_ALIGNMENT_UNSPECIFIED = 0; /** Unspecified alignment option. **/ LED_BACKPACK_ALIGNMENT_LEFT = 1; /** (Default) Left-aligned. **/ LED_BACKPACK_ALIGNMENT_RIGHT = 2; /** Right-aligned. **/ @@ -238,7 +238,7 @@ enum LedBackpackAlignment { /** * Desired SSD1306 text 'magnification' size. */ -enum Ssd1306TextSize { +enum SSD1306TextSize { SSD1306_TEXT_SIZE_UNSPECIFIED = 0; /** Unspecified text size. **/ SSD1306_TEXT_SIZE_1 = 1; /** Default text size. 6x8. **/ SSD1306_TEXT_SIZE_2 = 2; /** Text size 2. 12x16. **/ @@ -246,60 +246,60 @@ enum Ssd1306TextSize { } /** -* LedBackpackConfig represents the configuration for a LED backpack display. +* LEDBackpackConfig represents the configuration for a LED backpack display. */ -message LedBackpackConfig { +message LEDBackpackConfig { int32 brightness = 1; /** Desired brightness of the LED backpack, from 0 (off) to 15 (full brightness). **/ - LedBackpackAlignment alignment = 2; /** Desired text alignment for the LED backpack. **/ + LEDBackpackAlignment alignment = 2; /** Desired text alignment for the LED backpack. **/ } /** -* CharLcdConfig represents the configuration for a character LCD display. +* CharLCDConfig represents the configuration for a character LCD display. */ -message CharLcdConfig { +message CharLCDConfig { uint32 rows = 1; /** Number of rows for the character LCD. **/ uint32 columns = 2; /** Number of columns for the character LCD. **/ } /** -* Ssd1306Config represents the configuration for a SSD1306 OLED display. +* SSD1306Config represents the configuration for a SSD1306 OLED display. */ -message Ssd1306Config { +message SSD1306Config { uint32 width = 1; /** Width of the display. **/ uint32 height = 2; /** Height of the display. **/ - Ssd1306TextSize text_size = 3; /** Desired text 'magnification' size. **/ + SSD1306TextSize text_size = 3; /** Desired text 'magnification' size. **/ } /** -* I2cOutputAdd represents a request from the broker to add an I2C output device to a device. +* I2COutputAdd represents a request from the broker to add an I2C output device to a device. */ -message I2cOutputAdd { +message I2COutputAdd { oneof config { - LedBackpackConfig led_backpack_config = 1; /** Configuration for LED backpack. **/ - CharLcdConfig char_lcd_config = 2; /** Configuration for character LCD. **/ - Ssd1306Config ssd1306_config = 3; /** Configuration for SSD1306 OLED display. **/ + LEDBackpackConfig LED_backpack_config = 1; /** Configuration for LED backpack. **/ + CharLCDConfig char_LCD_config = 2; /** Configuration for character LCD. **/ + SSD1306Config SSD1306_config = 3; /** Configuration for SSD1306 OLED display. **/ } } /** -* LedBackpackWrite represents a request from the broker to write a message to a LED backpack. +* LEDBackpackWrite represents a request from the broker to write a message to a LED backpack. */ -message LedBackpackWrite { +message LEDBackpackWrite { string message = 1 [(nanopb).max_size = 5]; /** Message to write to the LED backpack. **/ } /** -* CharLcdWrite represents a request from the broker to write to a character LCD. +* CharLCDWrite represents a request from the broker to write to a character LCD. */ -message CharLcdWrite { +message CharLCDWrite { string message = 1 [(nanopb).max_size = 128]; /** Message to write to the character LCD. **/ bool enable_backlight = 2; /** Optional field to enable/disable the backlight. Should be its own feed (0 is off, 1 is on).**/ } /** -* Ssd1306Write represents a request from the broker to +* SSD1306Write represents a request from the broker to * write to a SSD1306 OLED display. */ -message Ssd1306Write { +message SSD1306Write { string message = 1 [(nanopb).max_size = 128]; /** Message to write to a SSD1306 OLED display. **/ } \ No newline at end of file From a1a0ab631d076f7a60a7229735e40bac3208330d Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 19 May 2025 12:20:25 -0400 Subject: [PATCH 08/10] rm overzealous find/replace in fields --- proto/wippersnapper/i2c/v1/i2c.proto | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index 8373b2e..a820e96 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -217,9 +217,9 @@ message I2CDeviceOutputWrite { uint32 i2c_device_address = 1; /** The 7-bit I2C address of the device on the bus. */ string i2c_device_name = 2[(nanopb).max_size = 15]; /** The I2C device's name, MUST MATCH the name on the JSON definition file on https://github.com/adafruit/Wippersnapper_Components. */ oneof output_msg { - LEDBackpackWrite write_LED_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ - CharLCDWrite write_char_LCD = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ - SSD1306Write write_SSD1306 = 5; /** Optional - If the I2C device is a SSD1306 OLED display, fill this field. **/ + LEDBackpackWrite write_ed_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ + CharLCDWrite write_char_lcd = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ + SSD1306Write write_ssd1306 = 5; /** Optional - If the I2C device is a SSD1306 OLED display, fill this field. **/ } } @@ -275,9 +275,9 @@ message SSD1306Config { */ message I2COutputAdd { oneof config { - LEDBackpackConfig LED_backpack_config = 1; /** Configuration for LED backpack. **/ - CharLCDConfig char_LCD_config = 2; /** Configuration for character LCD. **/ - SSD1306Config SSD1306_config = 3; /** Configuration for SSD1306 OLED display. **/ + LEDBackpackConfig led_backpack_config = 1; /** Configuration for LED backpack. **/ + CharLCDConfig char_lcd_config = 2; /** Configuration for character LCD. **/ + SSD1306Config ssd1306_config = 3; /** Configuration for SSD1306 OLED display. **/ } } From 8e89fdf2a0af8f666bd58d34797ecdaae5a3f506 Mon Sep 17 00:00:00 2001 From: brentru Date: Mon, 19 May 2025 15:14:37 -0400 Subject: [PATCH 09/10] Fix Typo'd --- proto/wippersnapper/i2c/v1/i2c.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index a820e96..81013d0 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -217,7 +217,7 @@ message I2CDeviceOutputWrite { uint32 i2c_device_address = 1; /** The 7-bit I2C address of the device on the bus. */ string i2c_device_name = 2[(nanopb).max_size = 15]; /** The I2C device's name, MUST MATCH the name on the JSON definition file on https://github.com/adafruit/Wippersnapper_Components. */ oneof output_msg { - LEDBackpackWrite write_ed_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ + LEDBackpackWrite write_led_backpack = 3; /** Optional - If the I2C device is a LED backpack, fill this field. **/ CharLCDWrite write_char_lcd = 4; /** Optional - If the I2C device is a character LCD, fill this field. **/ SSD1306Write write_ssd1306 = 5; /** Optional - If the I2C device is a SSD1306 OLED display, fill this field. **/ } From a4d0d2f35139a988be281f6559527c677afc5af9 Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 20 May 2025 11:25:14 -0400 Subject: [PATCH 10/10] only 2x text size options for ssd1306 --- proto/wippersnapper/i2c/v1/i2c.proto | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/proto/wippersnapper/i2c/v1/i2c.proto b/proto/wippersnapper/i2c/v1/i2c.proto index 81013d0..7b1cdc1 100644 --- a/proto/wippersnapper/i2c/v1/i2c.proto +++ b/proto/wippersnapper/i2c/v1/i2c.proto @@ -240,9 +240,8 @@ enum LEDBackpackAlignment { */ enum SSD1306TextSize { SSD1306_TEXT_SIZE_UNSPECIFIED = 0; /** Unspecified text size. **/ - SSD1306_TEXT_SIZE_1 = 1; /** Default text size. 6x8. **/ - SSD1306_TEXT_SIZE_2 = 2; /** Text size 2. 12x16. **/ - SSD1306_TEXT_SIZE_3 = 3; /** Text size 3. 18x24. **/ + SSD1306_TEXT_SIZE_1 = 1; /** Default text size, 6x8px. **/ + SSD1306_TEXT_SIZE_2 = 2; /** Larger text size option, 12x16px. **/ } /**