Skip to content

Commit 22918d3

Browse files
authored
Merge pull request #202 from adafruit/display-proto-remove-fix
Display proto remove - specify interface configs
2 parents b0becfd + 60f5bb3 commit 22918d3

3 files changed

Lines changed: 32 additions & 24 deletions

File tree

proto/wippersnapper/display.proto

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ message DisplayProperties {
8585
* EpdSpiConfig contains the configuration for SPI-based EPD displays.
8686
* Includes the SPI device config plus display-specific pins.
8787
*/
88-
message EpdSpiConfig {
89-
ws.spi.Config spi = 1; /** SPI bus, doesnt carry additional pin config. */
88+
message EpdSpiDescriptor {
89+
ws.spi.Descriptor spi = 1; /** SPI bus, doesnt carry additional pin config. */
9090
string pin_dc = 2; /** Pin for data/command */
9191
string pin_rst = 3; /** Pin for reset */
9292
string pin_sram_cs = 4; /** Pin for SRAM chip select (if required by the EPD). */
@@ -123,14 +123,14 @@ message CharLcdConfig {
123123
* TftSpiConfig contains the configuration for SPI TFT displays.
124124
* Includes the SPI device config plus display-specific pins.
125125
*/
126-
message TftSpiConfig {
127-
ws.spi.Config spi = 1; /** SPI bus */
126+
message TftSpiDescriptor {
127+
ws.spi.Descriptor spi = 1; /** SPI bus */
128128
string pin_dc = 2; /** Pin for data/command */
129129
string pin_rst = 3; /** Pin for reset */
130130
}
131131

132132
/** TTL RGB666 pin configuration for parallel RGB displays. */
133-
message TtlRgb666PinConfig {
133+
message TtlRgb666PinDescriptor {
134134
string pin_r0 = 1; /** Pin for R0 */
135135
string pin_r1 = 2; /** Pin for R1 */
136136
string pin_r2 = 3; /** Pin for R2 */
@@ -143,7 +143,7 @@ message TtlRgb666PinConfig {
143143
}
144144

145145
/** Intel 8080 8-bit parallel pin configuration for displays. */
146-
message I8080PinConfig {
146+
message I8080PinDescriptor {
147147
string pin_d0 = 1; /** Pin for D0 */
148148
string pin_d1 = 2; /** Pin for D1 */
149149
string pin_d2 = 3; /** Pin for D2 */
@@ -161,7 +161,7 @@ message I8080PinConfig {
161161
* DsiInterfaceConfig contains the minimal configuration for MIPI DSI displays.
162162
* DSI clock and data lanes are dedicated differential pads on the SoC, not GPIOs.
163163
*/
164-
message DsiInterfaceConfig {
164+
message DsiInterfaceDescriptor {
165165
uint32 bus = 1; /** DSI bus index (0 if only one DSI peripheral). */
166166
string pin_rst = 2; /** GPIO pin for display panel reset. */
167167
}
@@ -204,25 +204,25 @@ message BacklightConfig {
204204
displays/epd/ssd1680/250x122/mono/ [2.13" e-ink featherwing which has a panel variant with the same driver and no distinguishing features rev2024]
205205
*/
206206
message Add {
207-
string name = 1; /** Component name for the display. */
208-
DisplayClass type = 2; /** The type of display */
209-
string driver = 3; /** Driver name (e.g., "UC8179", "SSD1306", "HT16K33") */
210-
string panel = 4; /** Panel identifier for same driver with different configs */
207+
string name = 1; /** Component name for the display. */
208+
DisplayClass type = 2; /** The type of display */
209+
string driver = 3; /** Driver name (e.g., "UC8179", "SSD1306", "HT16K33") */
210+
string panel = 4; /** Panel identifier for same driver with different configs */
211211
oneof interface_type {
212-
EpdSpiConfig spi_epd = 5; /** SPI configuration for EPD. */
213-
TftSpiConfig spi_tft = 6; /** SPI configuration for TFT. */
214-
ws.i2c.Descriptor i2c = 7; /** I2C configuration for OLED/LED/LCD displays. */
215-
TtlRgb666PinConfig ttl_rgb666 = 8; /** RGB666 configuration for Qualia. */
216-
I8080PinConfig i8080 = 9; /** i8080 8-bit parallel for T-DisplayS3/Memento. */
217-
DsiInterfaceConfig dsi = 10; /** DSI configuration for MIPI DSI displays (e.g., ESP32-P4). */
212+
EpdSpiDescriptor spi_epd = 5; /** SPI configuration for EPD. */
213+
TftSpiDescriptor spi_tft = 6; /** SPI configuration for TFT. */
214+
ws.i2c.Descriptor i2c = 7; /** I2C configuration for OLED/LED/LCD displays. */
215+
TtlRgb666PinDescriptor ttl_rgb666 = 8; /** RGB666 configuration for Qualia. */
216+
I8080PinDescriptor i8080 = 9; /** i8080 8-bit parallel for T-DisplayS3/Memento. */
217+
DsiInterfaceDescriptor dsi = 10; /** DSI configuration for MIPI DSI displays (e.g., ESP32-P4). */
218218
}
219219
oneof config {
220-
EPDConfig config_epd = 11; /** Configuration for EPD. */
221-
LedBackpackConfig config_led = 14; /** Configuration for LED Backpack. */
222-
CharLcdConfig config_char_lcd = 15; /** Configuration for Character LCD. */
223-
DisplayProperties config_display = 18; /** Configuration for Generic display (w/h/r/txtSz). */
220+
EPDConfig config_epd = 11; /** Configuration for EPD. */
221+
LedBackpackConfig config_led = 14; /** Configuration for LED Backpack. */
222+
CharLcdConfig config_char_lcd = 15; /** Configuration for Character LCD. */
223+
DisplayProperties config_display = 18; /** Configuration for Generic display (w/h/r/txtSz). */
224224
}
225-
Write write = 19; /** Optional initial write for a display, used during check-in. */
225+
Write write = 19; /** Optional initial write for a display, used during check-in. */
226226
BacklightConfig backlight = 20; /** Optional backlight configuration (shared across display types). */
227227
}
228228

@@ -231,6 +231,14 @@ message Add {
231231
*/
232232
message Remove {
233233
string name = 1; /** Component name for the display. */
234+
oneof descriptor {
235+
EpdSpiDescriptor spi_epd = 2; /** SPI configuration for EPD. */
236+
TftSpiDescriptor spi_tft = 3; /** SPI configuration for TFT. */
237+
ws.i2c.Descriptor i2c = 4; /** I2C configuration for OLED/LED/LCD displays. */
238+
TtlRgb666PinDescriptor ttl_rgb666 = 5; /** RGB666 configuration for Qualia. */
239+
I8080PinDescriptor i8080 = 6; /** i8080 8-bit parallel for T-DisplayS3/Memento. */
240+
DsiInterfaceDescriptor dsi = 7; /** DSI configuration for MIPI DSI displays (e.g., ESP32-P4). */
241+
}
234242
}
235243

236244
/**

proto/wippersnapper/error.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ message ComponentError {
8989
string pin = 2; // digital, analog, pwm, servo, pixel, ds18x20, pixel
9090
i2c.Descriptor i2c = 3; // i2c, gps, display, expander
9191
uart.Descriptor uart = 4; // uart
92-
spi.Config spi = 5; // SPI displays
92+
spi.Descriptor spi = 5; // SPI displays
9393
}
9494
}

proto/wippersnapper/spi.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ syntax = "proto3";
77
package ws.spi;
88

99
/** SPI device configuration — bus selection and pin assignments. */
10-
message Config {
10+
message Descriptor {
1111
int32 bus = 1; /** SPI bus number */
1212
string pin_mosi = 2; /** Pin for MOSI */
1313
string pin_sck = 3; /** Pin for SCK */

0 commit comments

Comments
 (0)