From 8092304fec7ec8dba7b32610864cd4a729f7787c Mon Sep 17 00:00:00 2001 From: AsLY4 <18554279+AsLY4@users.noreply.github.com> Date: Sun, 30 Aug 2026 11:52:15 +0000 Subject: [PATCH 1/3] structs: reconcile with Firmware vendored copy (restore parity) The Firmware repo's vendored opendisplay_structs.h had advanced past this canonical source: OD_IC_TYPE_ESP32=9, OD_MANUFACTURER_SOLDERED=5, FastEPD wording for the 3000+ PanelIC range, and the FastEPD native parallel entries OD_PANEL_IC_INKPLATE5V2_1280X720=3002 / OD_PANEL_IC_INKPLATE10_1200X825=3003. Restore byte parity by adopting the shipped content and regenerating the py/js/d.ts/swift mirrors. Local reconciliation only (workspace decision 20260830-PanelIcEnumCanonicalPath); upstreaming is a separate decision. --- src/opendisplay_structs.d.ts | 6 +++++- src/opendisplay_structs.h | 16 ++++++++++------ src/opendisplay_structs.js | 30 ++++++++++++++++-------------- src/opendisplay_structs.py | 15 +++++++++------ src/opendisplay_structs.swift | 25 ++++++++++++++++--------- 5 files changed, 56 insertions(+), 36 deletions(-) diff --git a/src/opendisplay_structs.d.ts b/src/opendisplay_structs.d.ts index 84fad54..a661d1e 100644 --- a/src/opendisplay_structs.d.ts +++ b/src/opendisplay_structs.d.ts @@ -1,6 +1,6 @@ // @generated by tools/gen_js_structs.py -- DO NOT EDIT BY HAND. // Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.0) -// Source SHA-256: 238ada72ffc12ea242428547884d141f94e048cb6d6e01ceeb937dbdea50cfe7 +// Source SHA-256: 0efe652cca093f2add8a8d7a897ead8e8d3403582192d52584e2682decac1603 // Regenerate: tools/gen_js_structs.py --write (CI drift gate: --check) // // TypeScript declarations for opendisplay_structs.js. Value enums are frozen @@ -65,6 +65,7 @@ export declare const ICType: Readonly<{ OD_IC_TYPE_EFR32BG22C222F352GM40: 6; OD_IC_TYPE_NRF54L15: 7; OD_IC_TYPE_NRF54LM20: 8; + OD_IC_TYPE_ESP32: 9; }>; export declare const ManufacturerId: Readonly<{ @@ -73,6 +74,7 @@ export declare const ManufacturerId: Readonly<{ OD_MANUFACTURER_WAVESHARE: 2; OD_MANUFACTURER_SOL: 3; OD_MANUFACTURER_OPENDISPLAY: 4; + OD_MANUFACTURER_SOLDERED: 5; }>; export declare const PowerMode: Readonly<{ @@ -234,6 +236,8 @@ export declare const PanelIC: Readonly<{ OD_PANEL_IC_SSD1619_022_LITE_BWR: 1030; OD_PANEL_IC_ED103TC2_1872X1404: 3000; OD_PANEL_IC_ED103TC2_1872X1404_4GRAY: 3001; + OD_PANEL_IC_INKPLATE5V2_1280X720: 3002; + OD_PANEL_IC_INKPLATE10_1200X825: 3003; }>; export declare const LedType: Readonly<{ diff --git a/src/opendisplay_structs.h b/src/opendisplay_structs.h index 4293bfb..7cc80c0 100644 --- a/src/opendisplay_structs.h +++ b/src/opendisplay_structs.h @@ -389,7 +389,8 @@ enum ICType { OD_IC_TYPE_NRF52811 = 5, /**< @doc "nRF52811-based boards" */ OD_IC_TYPE_EFR32BG22C222F352GM40 = 6, /**< @doc "Silicon Labs EFR32BG22 boards" */ OD_IC_TYPE_NRF54L15 = 7, /**< @doc "Seeed XIAO nRF54L15 (Zephyr)" */ - OD_IC_TYPE_NRF54LM20 = 8 /**< @doc "Seeed XIAO nRF54LM20A (Zephyr)" */ + OD_IC_TYPE_NRF54LM20 = 8, /**< @doc "Seeed XIAO nRF54LM20A (Zephyr)" */ + OD_IC_TYPE_ESP32 = 9 /**< @doc "Classic ESP32-based boards" */ }; /** @enum ManufacturerId @width 2 @doc "Device manufacturer (ManufacturerData.manufacturer_id). @@ -400,7 +401,8 @@ enum ManufacturerId { OD_MANUFACTURER_SEEED = 1, /**< @doc "Seeed Studio" */ OD_MANUFACTURER_WAVESHARE = 2, /**< @doc "Waveshare Electronics" */ OD_MANUFACTURER_SOL = 3, /**< @doc "SOL" */ - OD_MANUFACTURER_OPENDISPLAY = 4 /**< @doc "OpenDisplay (free giveaways only)" */ + OD_MANUFACTURER_OPENDISPLAY = 4, /**< @doc "OpenDisplay (free giveaways only)" */ + OD_MANUFACTURER_SOLDERED = 5 /**< @doc "Soldered Electronics" */ }; /* SystemConfig.communication_modes @bits CommunicationModes (bits 3-7 reserved). */ @@ -557,7 +559,7 @@ enum ColorScheme { /** @enum PanelIC @width 2 * @external bb_epaper (0-76 names track bb_epaper EP* panel identifiers); the * 1000-1030 range comes from the M3 / EPD-nRF5 driver line; 3000+ from the - * Seeed_GFX / OpenDisplay runtime. Wire values are OpenDisplay-OWNED; each + * FastEPD IT8951 / OpenDisplay runtime. Wire values are OpenDisplay-OWNED; each * firmware maps value -> its bb_epaper EP* constant via a repo-local * opendisplay_epd_map.c (NOT part of this header; bb_epaper never dictates the * wire values). @doc "display controller / panel type (DisplayConfig.panel_ic_type). @@ -670,8 +672,10 @@ enum PanelIC { OD_PANEL_IC_SSD1619_013_BWR = 1028, /**< @doc "SSD1619 1.3\" 144x200 B/W/R" */ OD_PANEL_IC_SSD1619_022_LITE_BW = 1029, /**< @doc "SSD1619 M3 Lite 2.2\" 250x128 B/W" */ OD_PANEL_IC_SSD1619_022_LITE_BWR = 1030, /**< @doc "SSD1619 M3 Lite 2.2\" 250x128 B/W/R" */ - OD_PANEL_IC_ED103TC2_1872X1404 = 3000, /**< @doc "E Ink ED103TC2 + IT8951 (Seeed 10.3\", 1872x1404, 1bpp; Seeed_GFX/OpenDisplay runtime, values 3000+)" */ - OD_PANEL_IC_ED103TC2_1872X1404_4GRAY = 3001 /**< @doc "same panel as 3000; 4bpp (16-level)" */ + OD_PANEL_IC_ED103TC2_1872X1404 = 3000, /**< @doc "E Ink ED103TC2 + IT8951 (10.3\", 1872x1404, 1bpp; FastEPD IT8951 path, values 3000+)" */ + OD_PANEL_IC_ED103TC2_1872X1404_4GRAY = 3001, /**< @doc "same panel as 3000; 4bpp (16-level gray via FastEPD)" */ + OD_PANEL_IC_INKPLATE5V2_1280X720 = 3002, /**< @doc "Soldered Inkplate 5 V2 (ED050WROW, 1280x720, 1bpp; FastEPD native parallel path)" */ + OD_PANEL_IC_INKPLATE10_1200X825 = 3003 /**< @doc "Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path)" */ }; /* DisplayConfig.transmission_modes @bits TransmissionModes (bits 5-6 reserved -- @@ -700,7 +704,7 @@ struct DisplayConfig { uint8_t rotation; /**< @enum Rotation @doc "physical rotation." */ uint8_t reset_pin; /**< @doc "panel reset GPIO; 0xFF = none." @default 0xFF */ uint8_t busy_pin; /**< @doc "panel busy-status GPIO; 0xFF = none." @default 0xFF */ - uint8_t dc_pin; /**< @doc "data/command select; doubles as SPI MISO on OpenDisplay-runtime IT8951 / Seeed ED103 panels." */ + uint8_t dc_pin; /**< @doc "data/command select; doubles as SPI MISO on OpenDisplay-runtime IT8951 / ED103 panels." */ uint8_t cs_pin; /**< @doc "SPI chip-select; 0xFF = none." @default 0xFF */ uint8_t data_pin; /**< @doc "data-out pin (SPI MOSI / data line)." */ uint8_t partial_update_support; /**< @enum PartialUpdateSupport @doc "partial-update capability." */ diff --git a/src/opendisplay_structs.js b/src/opendisplay_structs.js index 7d98a03..072706d 100644 --- a/src/opendisplay_structs.js +++ b/src/opendisplay_structs.js @@ -1,6 +1,6 @@ // @generated by tools/gen_js_structs.py -- DO NOT EDIT BY HAND. // Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.0) -// Source SHA-256: 238ada72ffc12ea242428547884d141f94e048cb6d6e01ceeb937dbdea50cfe7 +// Source SHA-256: 0efe652cca093f2add8a8d7a897ead8e8d3403582192d52584e2682decac1603 // Regenerate: tools/gen_js_structs.py --write (CI drift gate: --check) // // OpenDisplay BLE payload structs, enums, and bitfields. Every layout describes bytes @@ -176,6 +176,8 @@ export const ICType = Object.freeze({ OD_IC_TYPE_NRF54L15: 7, /** Seeed XIAO nRF54LM20A (Zephyr) */ OD_IC_TYPE_NRF54LM20: 8, + /** Classic ESP32-based boards */ + OD_IC_TYPE_ESP32: 9, }); /** @@ -194,6 +196,8 @@ export const ManufacturerId = Object.freeze({ OD_MANUFACTURER_SOL: 3, /** OpenDisplay (free giveaways only) */ OD_MANUFACTURER_OPENDISPLAY: 4, + /** Soldered Electronics */ + OD_MANUFACTURER_SOLDERED: 5, }); /** Power source (PowerOption.power_mode). (on-wire width: 1 byte) */ @@ -306,10 +310,10 @@ export const ColorScheme = Object.freeze({ * values are named here; the full list lives in config.yaml. (on-wire width: 2 bytes) */ // @external bb_epaper (0-76 names track bb_epaper EP* panel identifiers); the 1000-1030 -// range comes from the M3 / EPD-nRF5 driver line; 3000+ from the Seeed_GFX / OpenDisplay -// runtime. Wire values are OpenDisplay-OWNED; each firmware maps value -> its bb_epaper EP* -// constant via a repo-local opendisplay_epd_map.c (NOT part of this header; bb_epaper never -// dictates the wire values). +// range comes from the M3 / EPD-nRF5 driver line; 3000+ from the FastEPD IT8951 / +// OpenDisplay runtime. Wire values are OpenDisplay-OWNED; each firmware maps value -> its +// bb_epaper EP* constant via a repo-local opendisplay_epd_map.c (NOT part of this header; +// bb_epaper never dictates the wire values). export const PanelIC = Object.freeze({ /** undefined / unknown panel */ OD_PANEL_IC_EP_PANEL_UNDEFINED: 0, @@ -528,13 +532,14 @@ export const PanelIC = Object.freeze({ OD_PANEL_IC_SSD1619_022_LITE_BW: 1029, /** SSD1619 M3 Lite 2.2" 250x128 B/W/R */ OD_PANEL_IC_SSD1619_022_LITE_BWR: 1030, - /** - * E Ink ED103TC2 + IT8951 (Seeed 10.3", 1872x1404, 1bpp; Seeed_GFX/OpenDisplay runtime, - * values 3000+) - */ + /** E Ink ED103TC2 + IT8951 (10.3", 1872x1404, 1bpp; FastEPD IT8951 path, values 3000+) */ OD_PANEL_IC_ED103TC2_1872X1404: 3000, - /** same panel as 3000; 4bpp (16-level) */ + /** same panel as 3000; 4bpp (16-level gray via FastEPD) */ OD_PANEL_IC_ED103TC2_1872X1404_4GRAY: 3001, + /** Soldered Inkplate 5 V2 (ED050WROW, 1280x720, 1bpp; FastEPD native parallel path) */ + OD_PANEL_IC_INKPLATE5V2_1280X720: 3002, + /** Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path) */ + OD_PANEL_IC_INKPLATE10_1200X825: 3003, }); /** LED wiring type (LedConfig.led_type). (on-wire width: 1 byte) */ @@ -976,10 +981,7 @@ export class DisplayConfig extends _PackedStruct { reset_pin = 0; /** panel busy-status GPIO; 0xFF = none. [default 0xFF] */ busy_pin = 0; - /** - * data/command select; doubles as SPI MISO on OpenDisplay-runtime IT8951 / Seeed ED103 - * panels. - */ + /** data/command select; doubles as SPI MISO on OpenDisplay-runtime IT8951 / ED103 panels. */ dc_pin = 0; /** SPI chip-select; 0xFF = none. [default 0xFF] */ cs_pin = 0; diff --git a/src/opendisplay_structs.py b/src/opendisplay_structs.py index bcf076e..b829061 100644 --- a/src/opendisplay_structs.py +++ b/src/opendisplay_structs.py @@ -1,6 +1,6 @@ # @generated by tools/gen_python_structs.py -- DO NOT EDIT BY HAND. # Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.0) -# Source SHA-256: 238ada72ffc12ea242428547884d141f94e048cb6d6e01ceeb937dbdea50cfe7 +# Source SHA-256: 0efe652cca093f2add8a8d7a897ead8e8d3403582192d52584e2682decac1603 # Regenerate: tools/gen_python_structs.py --write (CI drift gate: --check) """OpenDisplay BLE payload structs, enums, and bitfields. @@ -122,6 +122,7 @@ class ICType(IntEnum): OD_IC_TYPE_EFR32BG22C222F352GM40 = 6 # Silicon Labs EFR32BG22 boards OD_IC_TYPE_NRF54L15 = 7 # Seeed XIAO nRF54L15 (Zephyr) OD_IC_TYPE_NRF54LM20 = 8 # Seeed XIAO nRF54LM20A (Zephyr) + OD_IC_TYPE_ESP32 = 9 # Classic ESP32-based boards class ManufacturerId(IntEnum): @@ -135,6 +136,7 @@ class ManufacturerId(IntEnum): OD_MANUFACTURER_WAVESHARE = 2 # Waveshare Electronics OD_MANUFACTURER_SOL = 3 # SOL OD_MANUFACTURER_OPENDISPLAY = 4 # OpenDisplay (free giveaways only) + OD_MANUFACTURER_SOLDERED = 5 # Soldered Electronics class PowerMode(IntEnum): @@ -211,7 +213,7 @@ class PanelIC(IntEnum): """display controller / panel type (DisplayConfig.panel_ic_type). Only representative values are named here; the full list lives in config.yaml. (on-wire width: 2 bytes) """ - # @external bb_epaper (0-76 names track bb_epaper EP* panel identifiers); the 1000-1030 range comes from the M3 / EPD-nRF5 driver line; 3000+ from the Seeed_GFX / OpenDisplay runtime. Wire values are OpenDisplay-OWNED; each firmware maps value -> its bb_epaper EP* constant via a repo-local opendisplay_epd_map.c (NOT part of this header; bb_epaper never dictates the wire values). + # @external bb_epaper (0-76 names track bb_epaper EP* panel identifiers); the 1000-1030 range comes from the M3 / EPD-nRF5 driver line; 3000+ from the FastEPD IT8951 / OpenDisplay runtime. Wire values are OpenDisplay-OWNED; each firmware maps value -> its bb_epaper EP* constant via a repo-local opendisplay_epd_map.c (NOT part of this header; bb_epaper never dictates the wire values). OD_PANEL_IC_EP_PANEL_UNDEFINED = 0 # undefined / unknown panel OD_PANEL_IC_EP42_400X300 = 1 # WFT0420CZ15 4.2" B/W @@ -320,8 +322,10 @@ class PanelIC(IntEnum): OD_PANEL_IC_SSD1619_013_BWR = 1028 # SSD1619 1.3" 144x200 B/W/R OD_PANEL_IC_SSD1619_022_LITE_BW = 1029 # SSD1619 M3 Lite 2.2" 250x128 B/W OD_PANEL_IC_SSD1619_022_LITE_BWR = 1030 # SSD1619 M3 Lite 2.2" 250x128 B/W/R - OD_PANEL_IC_ED103TC2_1872X1404 = 3000 # E Ink ED103TC2 + IT8951 (Seeed 10.3", 1872x1404, 1bpp; Seeed_GFX/OpenDisplay runtime, values 3000+) - OD_PANEL_IC_ED103TC2_1872X1404_4GRAY = 3001 # same panel as 3000; 4bpp (16-level) + OD_PANEL_IC_ED103TC2_1872X1404 = 3000 # E Ink ED103TC2 + IT8951 (10.3", 1872x1404, 1bpp; FastEPD IT8951 path, values 3000+) + OD_PANEL_IC_ED103TC2_1872X1404_4GRAY = 3001 # same panel as 3000; 4bpp (16-level gray via FastEPD) + OD_PANEL_IC_INKPLATE5V2_1280X720 = 3002 # Soldered Inkplate 5 V2 (ED050WROW, 1280x720, 1bpp; FastEPD native parallel path) + OD_PANEL_IC_INKPLATE10_1200X825 = 3003 # Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path) class LedType(IntEnum): @@ -748,8 +752,7 @@ class DisplayConfig(_PackedStruct): reset_pin: int = 0 # panel busy-status GPIO; 0xFF = none. [default 0xFF] busy_pin: int = 0 - # data/command select; doubles as SPI MISO on OpenDisplay-runtime IT8951 / Seeed ED103 - # panels. + # data/command select; doubles as SPI MISO on OpenDisplay-runtime IT8951 / ED103 panels. dc_pin: int = 0 # SPI chip-select; 0xFF = none. [default 0xFF] cs_pin: int = 0 diff --git a/src/opendisplay_structs.swift b/src/opendisplay_structs.swift index faa09a3..5dc9f73 100644 --- a/src/opendisplay_structs.swift +++ b/src/opendisplay_structs.swift @@ -1,6 +1,6 @@ // @generated by tools/gen_swift_structs.py -- DO NOT EDIT BY HAND. // Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.0) -// Source SHA-256: 238ada72ffc12ea242428547884d141f94e048cb6d6e01ceeb937dbdea50cfe7 +// Source SHA-256: 0efe652cca093f2add8a8d7a897ead8e8d3403582192d52584e2682decac1603 // Regenerate: tools/gen_swift_structs.py --write (CI drift gate: --check) // // OpenDisplay BLE payload structs, enums, and bitfields. @@ -150,6 +150,8 @@ public enum ICType: UInt16, CaseIterable { case nrf54l15 = 7 /// Seeed XIAO nRF54LM20A (Zephyr) case nrf54lm20 = 8 + /// Classic ESP32-based boards + case esp32 = 9 } /// Device manufacturer (ManufacturerData.manufacturer_id). Board-name tables (board_type) @@ -168,6 +170,8 @@ public enum ManufacturerId: UInt16, CaseIterable { case sol = 3 /// OpenDisplay (free giveaways only) case opendisplay = 4 + /// Soldered Electronics + case soldered = 5 } /// Power source (PowerOption.power_mode). (on-wire width: 1 byte) @@ -282,10 +286,10 @@ public enum ColorScheme: UInt8, CaseIterable { /// Unknown wire values decode to nil via Swift's synthesized init?(rawValue:) (never a /// trap), so a rogue byte cannot crash the parser. /// @external bb_epaper (0-76 names track bb_epaper EP* panel identifiers); the 1000-1030 -/// range comes from the M3 / EPD-nRF5 driver line; 3000+ from the Seeed_GFX / OpenDisplay -/// runtime. Wire values are OpenDisplay-OWNED; each firmware maps value -> its bb_epaper -/// EP* constant via a repo-local opendisplay_epd_map.c (NOT part of this header; bb_epaper -/// never dictates the wire values). +/// range comes from the M3 / EPD-nRF5 driver line; 3000+ from the FastEPD IT8951 / +/// OpenDisplay runtime. Wire values are OpenDisplay-OWNED; each firmware maps value -> its +/// bb_epaper EP* constant via a repo-local opendisplay_epd_map.c (NOT part of this header; +/// bb_epaper never dictates the wire values). public enum PanelIC: UInt16, CaseIterable { /// undefined / unknown panel case epPanelUndefined = 0 @@ -502,11 +506,14 @@ public enum PanelIC: UInt16, CaseIterable { case ssd1619022LiteBw = 1029 /// SSD1619 M3 Lite 2.2" 250x128 B/W/R case ssd1619022LiteBwr = 1030 - /// E Ink ED103TC2 + IT8951 (Seeed 10.3", 1872x1404, 1bpp; Seeed_GFX/OpenDisplay - /// runtime, values 3000+) + /// E Ink ED103TC2 + IT8951 (10.3", 1872x1404, 1bpp; FastEPD IT8951 path, values 3000+) case ed103tc21872x1404 = 3000 - /// same panel as 3000; 4bpp (16-level) + /// same panel as 3000; 4bpp (16-level gray via FastEPD) case ed103tc21872x14044gray = 3001 + /// Soldered Inkplate 5 V2 (ED050WROW, 1280x720, 1bpp; FastEPD native parallel path) + case inkplate5v21280x720 = 3002 + /// Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path) + case inkplate101200x825 = 3003 } /// LED wiring type (LedConfig.led_type). (on-wire width: 1 byte) @@ -1153,7 +1160,7 @@ public struct DisplayConfig: ODPackedStruct { public var resetPin: UInt8 /// panel busy-status GPIO; 0xFF = none. [default 0xFF] public var busyPin: UInt8 - /// data/command select; doubles as SPI MISO on OpenDisplay-runtime IT8951 / Seeed ED103 + /// data/command select; doubles as SPI MISO on OpenDisplay-runtime IT8951 / ED103 /// panels. public var dcPin: UInt8 /// SPI chip-select; 0xFF = none. [default 0xFF] From 2ba6c7cc087f0e8bc33e46320561d269ffc8fec0 Mon Sep 17 00:00:00 2001 From: AsLY4 <18554279+AsLY4@users.noreply.github.com> Date: Sun, 30 Aug 2026 17:36:24 +0000 Subject: [PATCH 2/3] structs: add OD_PANEL_IC_M5PAPERS3_960X540 = 3004 (M5Stack PaperS3) FastEPD native parallel path, 960x540, 16-gray capable. Backward- compatible enum addition: OD_STRUCTS_VERSION 2.0 -> 2.1 (changelog rolled), OD_CONFIG_MINOR_VERSION 4 -> 5, @since 1.5. Mirrors regenerated (py/js/d.ts/swift), validate_mirrors green. --- src/opendisplay_structs.d.ts | 11 ++++++----- src/opendisplay_structs.h | 27 +++++++++++++++++---------- src/opendisplay_structs.js | 15 ++++++++++----- src/opendisplay_structs.py | 13 +++++++------ src/opendisplay_structs.swift | 15 +++++++++------ 5 files changed, 49 insertions(+), 32 deletions(-) diff --git a/src/opendisplay_structs.d.ts b/src/opendisplay_structs.d.ts index a661d1e..70d2c35 100644 --- a/src/opendisplay_structs.d.ts +++ b/src/opendisplay_structs.d.ts @@ -1,6 +1,6 @@ // @generated by tools/gen_js_structs.py -- DO NOT EDIT BY HAND. -// Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.0) -// Source SHA-256: 0efe652cca093f2add8a8d7a897ead8e8d3403582192d52584e2682decac1603 +// Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.1) +// Source SHA-256: 88c64f4d288a8dc61108857ad045e4f3a4ae4d296d2f2336552989bc86f3437d // Regenerate: tools/gen_js_structs.py --write (CI drift gate: --check) // // TypeScript declarations for opendisplay_structs.js. Value enums are frozen @@ -9,10 +9,10 @@ // ===== Loose wire constants ===== export declare const OD_STRUCTS_VERSION_MAJOR: 2; -export declare const OD_STRUCTS_VERSION_MINOR: 0; -export declare const OD_STRUCTS_VERSION_STR: "2.0"; +export declare const OD_STRUCTS_VERSION_MINOR: 1; +export declare const OD_STRUCTS_VERSION_STR: "2.1"; export declare const OD_CONFIG_VERSION: 1; -export declare const OD_CONFIG_MINOR_VERSION: 4; +export declare const OD_CONFIG_MINOR_VERSION: 5; export declare const OD_CONFIG_CRC_POLY: 0x1021; export declare const OD_CONFIG_CRC_INIT: 0xFFFF; export declare const OD_PIN_UNUSED: 0xFF; @@ -238,6 +238,7 @@ export declare const PanelIC: Readonly<{ OD_PANEL_IC_ED103TC2_1872X1404_4GRAY: 3001; OD_PANEL_IC_INKPLATE5V2_1280X720: 3002; OD_PANEL_IC_INKPLATE10_1200X825: 3003; + OD_PANEL_IC_M5PAPERS3_960X540: 3004; }>; export declare const LedType: Readonly<{ diff --git a/src/opendisplay_structs.h b/src/opendisplay_structs.h index 7cc80c0..a0c6acb 100644 --- a/src/opendisplay_structs.h +++ b/src/opendisplay_structs.h @@ -19,9 +19,9 @@ * type mirrors (see docs/shared-types-plan.md); codegen must carry the prose * through as idiomatic doc comments in each target language. * - * OD_STRUCTS_VERSION 2.0 (MAJOR.MINOR spec marker for THIS file; see + * OD_STRUCTS_VERSION 2.1 (MAJOR.MINOR spec marker for THIS file; see * VERSIONING POLICY below -- NOT sent on the wire) - * LAST CHANGED 2026-07-18 + * LAST CHANGED 2026-08-30 * * The two version schemes carried here are DISTINCT (see §6 Q2 of the plan): * - OD_STRUCTS_VERSION_* : documents this spec file, like protocol.h's @@ -66,7 +66,15 @@ * CHANGELOG (newest first; entries accrue under "Unreleased" and roll into a * new version heading on each bump -- see AGENT INSTRUCTIONS below) * -------------------------------------------------------------------------- - * Unreleased (since 2.0) + * Unreleased (since 2.1) + * - Add each payload-layout change here as it lands. On the next version bump, + * move these under a new "MAJOR.MINOR (YYYY-MM-DD)" heading. + * + * 2.1 (2026-08-30) + * - Add PanelIC value OD_PANEL_IC_M5PAPERS3_960X540 = 3004 (M5Stack PaperS3, + * ED047TC1-class 960x540 parallel panel, 16-gray capable; FastEPD native + * parallel path). Backward-compatible enum addition (@since 1.5); the + * on-wire config-format minor bumps 4 -> 5 (OD_CONFIG_MINOR_VERSION). * - Doc-only: fixed two comment shapes the codegen parser mis-read and added * the CODEGEN AUTHORING RULES banner section to prevent recurrence. Split the * combined BusFlags/PinBitmap @bits comment into one comment per group; folded @@ -76,8 +84,6 @@ * placeholder macros (no wire change; these bits stay reserved-must-be-0): * TransmissionModes bit5/bit6 -> OD_TRANSMISSION_MODE_RESERVED_5/_6; * MsdStatusBits bit3 -> OD_MSD_STATUS_RESERVED_3. Documentation only. - * - Add each payload-layout change here as it lands. On the next version bump, - * move these under a new "MAJOR.MINOR (YYYY-MM-DD)" heading. * * 2.0 (2026-07-18) * - Initial canonical shared payload contract: the wire-payload counterpart @@ -245,8 +251,8 @@ /* Payload-spec revision, MAJOR.MINOR. Documents THIS file; NOT sent on the wire. * Distinct from the on-wire OD_CONFIG_VERSION pair defined in SECTION 1. */ #define OD_STRUCTS_VERSION_MAJOR 2u -#define OD_STRUCTS_VERSION_MINOR 0u -#define OD_STRUCTS_VERSION_STR "2.0" +#define OD_STRUCTS_VERSION_MINOR 1u +#define OD_STRUCTS_VERSION_STR "2.1" /* -------------------------------------------------------------------------- * Portable compile-time size check. Defined once here; every packed struct is @@ -281,10 +287,10 @@ /* On-wire config-format version. UNLIKE OD_STRUCTS_VERSION / OD_PROTOCOL_VERSION, * these ARE transmitted / negotiated: OuterPacketHeader.version carries the - * MAJOR byte. Frozen at 1.4 by this header (the app's bundled config.yaml is at + * MAJOR byte. At 1.5 as of this header (the app's bundled config.yaml is at * minor 3 and must catch up). */ #define OD_CONFIG_VERSION 1u /* @doc "outer-packet major version byte" */ -#define OD_CONFIG_MINOR_VERSION 4u /* @doc "config-format minor; backward-compatible additions" */ +#define OD_CONFIG_MINOR_VERSION 5u /* @doc "config-format minor; backward-compatible additions" */ /* CRC over the outer packet. CRC16-CCITT, poly 0x1021, init 0xFFFF, computed * over length+version+packets AS IF the 2-byte length field were 0x0000 (the @@ -675,7 +681,8 @@ enum PanelIC { OD_PANEL_IC_ED103TC2_1872X1404 = 3000, /**< @doc "E Ink ED103TC2 + IT8951 (10.3\", 1872x1404, 1bpp; FastEPD IT8951 path, values 3000+)" */ OD_PANEL_IC_ED103TC2_1872X1404_4GRAY = 3001, /**< @doc "same panel as 3000; 4bpp (16-level gray via FastEPD)" */ OD_PANEL_IC_INKPLATE5V2_1280X720 = 3002, /**< @doc "Soldered Inkplate 5 V2 (ED050WROW, 1280x720, 1bpp; FastEPD native parallel path)" */ - OD_PANEL_IC_INKPLATE10_1200X825 = 3003 /**< @doc "Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path)" */ + OD_PANEL_IC_INKPLATE10_1200X825 = 3003, /**< @doc "Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path)" */ + OD_PANEL_IC_M5PAPERS3_960X540 = 3004 /**< @doc "M5Stack PaperS3 (ED047TC1-class, 960x540, 16-gray capable; FastEPD native parallel path)" @since 1.5 */ }; /* DisplayConfig.transmission_modes @bits TransmissionModes (bits 5-6 reserved -- diff --git a/src/opendisplay_structs.js b/src/opendisplay_structs.js index 072706d..3b98030 100644 --- a/src/opendisplay_structs.js +++ b/src/opendisplay_structs.js @@ -1,6 +1,6 @@ // @generated by tools/gen_js_structs.py -- DO NOT EDIT BY HAND. -// Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.0) -// Source SHA-256: 0efe652cca093f2add8a8d7a897ead8e8d3403582192d52584e2682decac1603 +// Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.1) +// Source SHA-256: 88c64f4d288a8dc61108857ad045e4f3a4ae4d296d2f2336552989bc86f3437d // Regenerate: tools/gen_js_structs.py --write (CI drift gate: --check) // // OpenDisplay BLE payload structs, enums, and bitfields. Every layout describes bytes @@ -15,10 +15,10 @@ // ===== Loose wire constants ===== export const OD_STRUCTS_VERSION_MAJOR = 2; -export const OD_STRUCTS_VERSION_MINOR = 0; -export const OD_STRUCTS_VERSION_STR = "2.0"; +export const OD_STRUCTS_VERSION_MINOR = 1; +export const OD_STRUCTS_VERSION_STR = "2.1"; export const OD_CONFIG_VERSION = 1; // outer-packet major version byte -export const OD_CONFIG_MINOR_VERSION = 4; // config-format minor; backward-compatible additions +export const OD_CONFIG_MINOR_VERSION = 5; // config-format minor; backward-compatible additions export const OD_CONFIG_CRC_POLY = 0x1021; // CRC16-CCITT polynomial export const OD_CONFIG_CRC_INIT = 0xFFFF; // CRC16-CCITT initial value export const OD_PIN_UNUSED = 0xFF; // pin field value meaning 'no pin' @@ -540,6 +540,11 @@ export const PanelIC = Object.freeze({ OD_PANEL_IC_INKPLATE5V2_1280X720: 3002, /** Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path) */ OD_PANEL_IC_INKPLATE10_1200X825: 3003, + /** + * M5Stack PaperS3 (ED047TC1-class, 960x540, 16-gray capable; FastEPD native parallel + * path) + */ + OD_PANEL_IC_M5PAPERS3_960X540: 3004, }); /** LED wiring type (LedConfig.led_type). (on-wire width: 1 byte) */ diff --git a/src/opendisplay_structs.py b/src/opendisplay_structs.py index b829061..87dc5a4 100644 --- a/src/opendisplay_structs.py +++ b/src/opendisplay_structs.py @@ -1,10 +1,10 @@ # @generated by tools/gen_python_structs.py -- DO NOT EDIT BY HAND. -# Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.0) -# Source SHA-256: 0efe652cca093f2add8a8d7a897ead8e8d3403582192d52584e2682decac1603 +# Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.1) +# Source SHA-256: 88c64f4d288a8dc61108857ad045e4f3a4ae4d296d2f2336552989bc86f3437d # Regenerate: tools/gen_python_structs.py --write (CI drift gate: --check) """OpenDisplay BLE payload structs, enums, and bitfields. -Generated from the canonical opendisplay_structs.h (OD_STRUCTS_VERSION 2.0). +Generated from the canonical opendisplay_structs.h (OD_STRUCTS_VERSION 2.1). Every layout here describes bytes that travel on the OpenDisplay BLE wire. Do not hand-edit; edit the header and regenerate. Byte order is LITTLE-ENDIAN by default; the big-endian exceptions (WifiConfig.server_port and all of @@ -19,12 +19,12 @@ # ===== Loose wire constants ===== OD_STRUCTS_VERSION_MAJOR: Final = 2 -OD_STRUCTS_VERSION_MINOR: Final = 0 -OD_STRUCTS_VERSION_STR: Final = "2.0" +OD_STRUCTS_VERSION_MINOR: Final = 1 +OD_STRUCTS_VERSION_STR: Final = "2.1" # outer-packet major version byte OD_CONFIG_VERSION: Final = 1 # config-format minor; backward-compatible additions -OD_CONFIG_MINOR_VERSION: Final = 4 +OD_CONFIG_MINOR_VERSION: Final = 5 # CRC16-CCITT polynomial OD_CONFIG_CRC_POLY: Final = 0x1021 # CRC16-CCITT initial value @@ -326,6 +326,7 @@ class PanelIC(IntEnum): OD_PANEL_IC_ED103TC2_1872X1404_4GRAY = 3001 # same panel as 3000; 4bpp (16-level gray via FastEPD) OD_PANEL_IC_INKPLATE5V2_1280X720 = 3002 # Soldered Inkplate 5 V2 (ED050WROW, 1280x720, 1bpp; FastEPD native parallel path) OD_PANEL_IC_INKPLATE10_1200X825 = 3003 # Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path) + OD_PANEL_IC_M5PAPERS3_960X540 = 3004 # M5Stack PaperS3 (ED047TC1-class, 960x540, 16-gray capable; FastEPD native parallel path) class LedType(IntEnum): diff --git a/src/opendisplay_structs.swift b/src/opendisplay_structs.swift index 5dc9f73..c3b1486 100644 --- a/src/opendisplay_structs.swift +++ b/src/opendisplay_structs.swift @@ -1,11 +1,11 @@ // @generated by tools/gen_swift_structs.py -- DO NOT EDIT BY HAND. -// Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.0) -// Source SHA-256: 0efe652cca093f2add8a8d7a897ead8e8d3403582192d52584e2682decac1603 +// Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.1) +// Source SHA-256: 88c64f4d288a8dc61108857ad045e4f3a4ae4d296d2f2336552989bc86f3437d // Regenerate: tools/gen_swift_structs.py --write (CI drift gate: --check) // // OpenDisplay BLE payload structs, enums, and bitfields. // -// Generated from the canonical opendisplay_structs.h (OD_STRUCTS_VERSION 2.0). +// Generated from the canonical opendisplay_structs.h (OD_STRUCTS_VERSION 2.1). // Every layout here describes bytes that travel on the OpenDisplay BLE wire. Do not // hand-edit; edit the header and regenerate. Byte order is LITTLE-ENDIAN by default; // the big-endian exceptions (WifiConfig.server_port and all of @@ -16,12 +16,12 @@ // MARK: - Loose wire constants public let OD_STRUCTS_VERSION_MAJOR: UInt8 = 2 -public let OD_STRUCTS_VERSION_MINOR: UInt8 = 0 -public let OD_STRUCTS_VERSION_STR: String = "2.0" +public let OD_STRUCTS_VERSION_MINOR: UInt8 = 1 +public let OD_STRUCTS_VERSION_STR: String = "2.1" /// outer-packet major version byte public let OD_CONFIG_VERSION: UInt8 = 1 /// config-format minor; backward-compatible additions -public let OD_CONFIG_MINOR_VERSION: UInt8 = 4 +public let OD_CONFIG_MINOR_VERSION: UInt8 = 5 /// CRC16-CCITT polynomial public let OD_CONFIG_CRC_POLY: UInt16 = 0x1021 /// CRC16-CCITT initial value @@ -514,6 +514,9 @@ public enum PanelIC: UInt16, CaseIterable { case inkplate5v21280x720 = 3002 /// Soldered Inkplate 10 (ED097TC2, 1200x825, 1bpp; FastEPD native parallel path) case inkplate101200x825 = 3003 + /// M5Stack PaperS3 (ED047TC1-class, 960x540, 16-gray capable; FastEPD native parallel + /// path) + case m5papers3960x540 = 3004 } /// LED wiring type (LedConfig.led_type). (on-wire width: 1 byte) From 99051d1bccdff6208c2bbf24c28f66109b8da561 Mon Sep 17 00:00:00 2001 From: AsLY4 <18554279+AsLY4@users.noreply.github.com> Date: Thu, 3 Sep 2026 09:39:18 +0000 Subject: [PATCH 3/3] structs: fold Firmware-side Unreleased additions back into canonical (parity restore) Firmware PR #157 added three bit definitions to the VENDORED header only: OD_LED_FLAG_BUTTON_PRESS (LedFlags bit4), OD_BUZZER_FLAG_BUTTON_PRESS (BuzzerFlags bit1), and OD_MSD_STATUS_ENCRYPTION_ENABLED (MsdStatusBits bit3, replacing RESERVED_3 with a legacy alias). Restored here verbatim with matching Unreleased changelog entries; mirrors regenerated and validated. No wire-layout change; OD_STRUCTS_VERSION stays 2.1. --- src/opendisplay_structs.d.ts | 5 ++++- src/opendisplay_structs.h | 17 ++++++++++++++--- src/opendisplay_structs.js | 11 +++++++---- src/opendisplay_structs.py | 14 ++++++++++---- src/opendisplay_structs.swift | 19 +++++++++++++------ 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/src/opendisplay_structs.d.ts b/src/opendisplay_structs.d.ts index 70d2c35..b9a7a58 100644 --- a/src/opendisplay_structs.d.ts +++ b/src/opendisplay_structs.d.ts @@ -1,6 +1,6 @@ // @generated by tools/gen_js_structs.py -- DO NOT EDIT BY HAND. // Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.1) -// Source SHA-256: 88c64f4d288a8dc61108857ad045e4f3a4ae4d296d2f2336552989bc86f3437d +// Source SHA-256: 3c16f7cee08c7d42186aebb7b6ffdf8f84e7001e051aad81c7d0408815e6ebce // Regenerate: tools/gen_js_structs.py --write (CI drift gate: --check) // // TypeScript declarations for opendisplay_structs.js. Value enums are frozen @@ -319,6 +319,7 @@ export declare const OD_LED_FLAG_LED1_INVERT: 1; export declare const OD_LED_FLAG_LED2_INVERT: 2; export declare const OD_LED_FLAG_LED3_INVERT: 4; export declare const OD_LED_FLAG_LED4_INVERT: 8; +export declare const OD_LED_FLAG_BUTTON_PRESS: 16; export declare const OD_SECURITY_FLAG_REWRITE_ALLOWED: 1; export declare const OD_SECURITY_FLAG_SHOW_KEY_ON_SCREEN: 2; export declare const OD_SECURITY_FLAG_RESET_PIN_ENABLED: 4; @@ -329,11 +330,13 @@ export declare const OD_TOUCH_FLAG_INVERT_X: 1; export declare const OD_TOUCH_FLAG_INVERT_Y: 2; export declare const OD_TOUCH_FLAG_SWAP_XY: 4; export declare const OD_BUZZER_FLAG_ENABLE_ACTIVE_HIGH: 1; +export declare const OD_BUZZER_FLAG_BUTTON_PRESS: 2; export declare const OD_NFC_FLAG_ENABLED: 1; export declare const OD_FLASH_FLAG_ENABLED: 1; export declare const OD_MSD_STATUS_BATTERY_VOLTAGE_BIT8: 1; export declare const OD_MSD_STATUS_REBOOT_FLAG: 2; export declare const OD_MSD_STATUS_CONNECTION_REQUESTED: 4; +export declare const OD_MSD_STATUS_ENCRYPTION_ENABLED: 8; export declare const OD_MSD_STATUS_RESERVED_3: 8; export declare const OD_MSD_STATUS_MAIN_LOOP_COUNTER_SHIFT: 4; export declare const OD_MSD_STATUS_MAIN_LOOP_COUNTER_MASK: 0xF0; diff --git a/src/opendisplay_structs.h b/src/opendisplay_structs.h index a0c6acb..0ec81a0 100644 --- a/src/opendisplay_structs.h +++ b/src/opendisplay_structs.h @@ -67,6 +67,14 @@ * new version heading on each bump -- see AGENT INSTRUCTIONS below) * -------------------------------------------------------------------------- * Unreleased (since 2.1) + * - LedFlags bit4: OD_LED_FLAG_BUTTON_PRESS (short LED flash on physical + * button press / button-wake synthetic click; default off). + * - BuzzerFlags bit1: OD_BUZZER_FLAG_BUTTON_PRESS (short chirp on physical + * button press / button-wake synthetic click; default off). + * - MsdStatusBits bit3: OD_MSD_STATUS_ENCRYPTION_ENABLED (1 = app-layer + * encryption active). Firmware sets it when encryption_enabled and master + * key are non-zero; dynamic[11] is all 0xFF when no display is configured. + * (Folded back from the Firmware side, PR #157 — parity restore.) * - Add each payload-layout change here as it lands. On the next version bump, * move these under a new "MAJOR.MINOR (YYYY-MM-DD)" heading. * @@ -742,11 +750,12 @@ enum LedType { OD_LED_TYPE_FOUR_SEPARATE = 3 /**< @doc "four separate LEDs" */ }; -/* LedConfig.led_flags @bits LedFlags (bits 4-7 reserved). */ +/* LedConfig.led_flags @bits LedFlags (bits 5-7 reserved). */ #define OD_LED_FLAG_LED1_INVERT (1u << 0) /* @doc "invert LED channel 1 polarity" */ #define OD_LED_FLAG_LED2_INVERT (1u << 1) /* @doc "invert LED channel 2 polarity" */ #define OD_LED_FLAG_LED3_INVERT (1u << 2) /* @doc "invert LED channel 3 polarity" */ #define OD_LED_FLAG_LED4_INVERT (1u << 3) /* @doc "invert LED channel 4 polarity" */ +#define OD_LED_FLAG_BUTTON_PRESS (1u << 4) /* @doc "short flash on physical button press (incl. button-wake synthetic click); default off" */ /** @struct LedConfig @packet 0x21 @repeatable max=4 * @doc "LED channel pins + invert flags. Up to 4 instances. 22 bytes. NOTE: the @@ -970,8 +979,9 @@ OD_STATIC_ASSERT(sizeof(struct TouchController) == 32, "TouchController wire siz * 0x29 buzzer (config.yaml packet name: passive_buzzer) * ----------------------------------------------------------------------- */ -/* BuzzerConfig.flags @bits BuzzerFlags (bits 1-7 reserved). */ +/* BuzzerConfig.flags @bits BuzzerFlags (bits 2-7 reserved). */ #define OD_BUZZER_FLAG_ENABLE_ACTIVE_HIGH (1u << 0) /* @doc "enable pin is active-high when set; otherwise active-low" */ +#define OD_BUZZER_FLAG_BUTTON_PRESS (1u << 1) /* @doc "short chirp on physical button press (incl. button-wake synthetic click); default off" */ /** @struct BuzzerConfig @packet 0x29 @repeatable max=4 * @doc "Buzzer (passive piezo, PWM-driven). Up to 4 instances. 32 bytes. The tone @@ -1232,7 +1242,8 @@ OD_STATIC_ASSERT(sizeof(struct AuthProof) == 32, "AuthProof wire size"); #define OD_MSD_STATUS_BATTERY_VOLTAGE_BIT8 (1u << 0) /* @doc "high bit of the 10-bit battery voltage (units of 10 mV); combine with battery_voltage_low" */ #define OD_MSD_STATUS_REBOOT_FLAG (1u << 1) /* @doc "device rebooted since last read" */ #define OD_MSD_STATUS_CONNECTION_REQUESTED (1u << 2) /* @doc "device is requesting a connection" */ -#define OD_MSD_STATUS_RESERVED_3 (1u << 3) /* @reserved @doc "reserved; must be 0 (placeholder name for a future status flag; sits between the flags and the bits 4-7 counter)" */ +#define OD_MSD_STATUS_ENCRYPTION_ENABLED (1u << 3) /* @doc "application-layer encryption active (encryption_enabled and non-zero master key)" */ +#define OD_MSD_STATUS_RESERVED_3 (1u << 3) /* @deprecated @doc "legacy name for OD_MSD_STATUS_ENCRYPTION_ENABLED (same bit)" */ #define OD_MSD_STATUS_MAIN_LOOP_COUNTER_SHIFT 4u /* @doc "bits 4-7: free-running main-loop nibble counter (liveness)" */ #define OD_MSD_STATUS_MAIN_LOOP_COUNTER_MASK 0xF0u /* @doc "mask for the bits 4-7 main-loop counter nibble" */ diff --git a/src/opendisplay_structs.js b/src/opendisplay_structs.js index 3b98030..8037ad2 100644 --- a/src/opendisplay_structs.js +++ b/src/opendisplay_structs.js @@ -1,6 +1,6 @@ // @generated by tools/gen_js_structs.py -- DO NOT EDIT BY HAND. // Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.1) -// Source SHA-256: 88c64f4d288a8dc61108857ad045e4f3a4ae4d296d2f2336552989bc86f3437d +// Source SHA-256: 3c16f7cee08c7d42186aebb7b6ffdf8f84e7001e051aad81c7d0408815e6ebce // Regenerate: tools/gen_js_structs.py --write (CI drift gate: --check) // // OpenDisplay BLE payload structs, enums, and bitfields. Every layout describes bytes @@ -685,11 +685,12 @@ export const OD_TRANSMISSION_MODE_RESERVED_5 = 1 << 5; // reserved; must be 0 ( export const OD_TRANSMISSION_MODE_RESERVED_6 = 1 << 6; // reserved; must be 0 (placeholder name for a future transmission mode) export const OD_TRANSMISSION_MODE_CLEAR_ON_BOOT = 1 << 7; // Clear screen on boot. Synonymous with config.yaml's no_boot_text / NO_BOOT_TEXT -- same bit, same behavior (clearing on boot is why no boot text shows). -// LedConfig.led_flags @bits LedFlags (bits 4-7 reserved). +// LedConfig.led_flags @bits LedFlags (bits 5-7 reserved). export const OD_LED_FLAG_LED1_INVERT = 1 << 0; // invert LED channel 1 polarity export const OD_LED_FLAG_LED2_INVERT = 1 << 1; // invert LED channel 2 polarity export const OD_LED_FLAG_LED3_INVERT = 1 << 2; // invert LED channel 3 polarity export const OD_LED_FLAG_LED4_INVERT = 1 << 3; // invert LED channel 4 polarity +export const OD_LED_FLAG_BUTTON_PRESS = 1 << 4; // short flash on physical button press (incl. button-wake synthetic click); default off // Bitfield group BusFlags: DataBus.bus_flags @bits BusFlags -- all bits reserved today // (must be 0). @@ -710,8 +711,9 @@ export const OD_TOUCH_FLAG_INVERT_X = 1 << 0; // invert X using panel width export const OD_TOUCH_FLAG_INVERT_Y = 1 << 1; // invert Y using panel height export const OD_TOUCH_FLAG_SWAP_XY = 1 << 2; // swap X and Y before invert/clip -// BuzzerConfig.flags @bits BuzzerFlags (bits 1-7 reserved). +// BuzzerConfig.flags @bits BuzzerFlags (bits 2-7 reserved). export const OD_BUZZER_FLAG_ENABLE_ACTIVE_HIGH = 1 << 0; // enable pin is active-high when set; otherwise active-low +export const OD_BUZZER_FLAG_BUTTON_PRESS = 1 << 1; // short chirp on physical button press (incl. button-wake synthetic click); default off // NfcConfig.flags @bits NfcFlags (bits 1-7 reserved). export const OD_NFC_FLAG_ENABLED = 1 << 0; // must be set to enable NFC init (no fallback init if clear) @@ -724,7 +726,8 @@ export const OD_FLASH_FLAG_ENABLED = 1 << 0; // must be set to enable flash pin export const OD_MSD_STATUS_BATTERY_VOLTAGE_BIT8 = 1 << 0; // high bit of the 10-bit battery voltage (units of 10 mV); combine with battery_voltage_low export const OD_MSD_STATUS_REBOOT_FLAG = 1 << 1; // device rebooted since last read export const OD_MSD_STATUS_CONNECTION_REQUESTED = 1 << 2; // device is requesting a connection -export const OD_MSD_STATUS_RESERVED_3 = 1 << 3; // reserved; must be 0 (placeholder name for a future status flag; sits between the flags and the bits 4-7 counter) +export const OD_MSD_STATUS_ENCRYPTION_ENABLED = 1 << 3; // application-layer encryption active (encryption_enabled and non-zero master key) +export const OD_MSD_STATUS_RESERVED_3 = 1 << 3; // legacy name for OD_MSD_STATUS_ENCRYPTION_ENABLED (same bit) export const OD_MSD_STATUS_MAIN_LOOP_COUNTER_SHIFT = 4; // bits 4-7: free-running main-loop nibble counter (liveness) export const OD_MSD_STATUS_MAIN_LOOP_COUNTER_MASK = 0xF0; // mask for the bits 4-7 main-loop counter nibble diff --git a/src/opendisplay_structs.py b/src/opendisplay_structs.py index 87dc5a4..fefb712 100644 --- a/src/opendisplay_structs.py +++ b/src/opendisplay_structs.py @@ -1,6 +1,6 @@ # @generated by tools/gen_python_structs.py -- DO NOT EDIT BY HAND. # Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.1) -# Source SHA-256: 88c64f4d288a8dc61108857ad045e4f3a4ae4d296d2f2336552989bc86f3437d +# Source SHA-256: 3c16f7cee08c7d42186aebb7b6ffdf8f84e7001e051aad81c7d0408815e6ebce # Regenerate: tools/gen_python_structs.py --write (CI drift gate: --check) """OpenDisplay BLE payload structs, enums, and bitfields. @@ -463,12 +463,13 @@ class TransmissionModes(IntFlag): class LedFlags(IntFlag): - """LedConfig.led_flags @bits LedFlags (bits 4-7 reserved).""" + """LedConfig.led_flags @bits LedFlags (bits 5-7 reserved).""" OD_LED_FLAG_LED1_INVERT = 1 << 0 # invert LED channel 1 polarity OD_LED_FLAG_LED2_INVERT = 1 << 1 # invert LED channel 2 polarity OD_LED_FLAG_LED3_INVERT = 1 << 2 # invert LED channel 3 polarity OD_LED_FLAG_LED4_INVERT = 1 << 3 # invert LED channel 4 polarity + OD_LED_FLAG_BUTTON_PRESS = 1 << 4 # short flash on physical button press (incl. button-wake synthetic click); default off # Bitfield group BusFlags: DataBus.bus_flags @bits BusFlags -- all bits reserved today (must @@ -497,9 +498,10 @@ class TouchFlags(IntFlag): class BuzzerFlags(IntFlag): - """BuzzerConfig.flags @bits BuzzerFlags (bits 1-7 reserved).""" + """BuzzerConfig.flags @bits BuzzerFlags (bits 2-7 reserved).""" OD_BUZZER_FLAG_ENABLE_ACTIVE_HIGH = 1 << 0 # enable pin is active-high when set; otherwise active-low + OD_BUZZER_FLAG_BUTTON_PRESS = 1 << 1 # short chirp on physical button press (incl. button-wake synthetic click); default off class NfcFlags(IntFlag): @@ -522,7 +524,8 @@ class MsdStatusBits(IntFlag): OD_MSD_STATUS_BATTERY_VOLTAGE_BIT8 = 1 << 0 # high bit of the 10-bit battery voltage (units of 10 mV); combine with battery_voltage_low OD_MSD_STATUS_REBOOT_FLAG = 1 << 1 # device rebooted since last read OD_MSD_STATUS_CONNECTION_REQUESTED = 1 << 2 # device is requesting a connection - OD_MSD_STATUS_RESERVED_3 = 1 << 3 # reserved; must be 0 (placeholder name for a future status flag; sits between the flags and the bits 4-7 counter) + OD_MSD_STATUS_ENCRYPTION_ENABLED = 1 << 3 # application-layer encryption active (encryption_enabled and non-zero master key) + OD_MSD_STATUS_RESERVED_3 = 1 << 3 # legacy name for OD_MSD_STATUS_ENCRYPTION_ENABLED (same bit) OD_MSD_STATUS_MAIN_LOOP_COUNTER_SHIFT: Final = 4 # bits 4-7: free-running main-loop nibble counter (liveness) OD_MSD_STATUS_MAIN_LOOP_COUNTER_MASK: Final = 0xF0 # mask for the bits 4-7 main-loop counter nibble @@ -1681,6 +1684,7 @@ class MsdAdvertisement(_PackedStruct): "OD_LED_FLAG_LED2_INVERT", "OD_LED_FLAG_LED3_INVERT", "OD_LED_FLAG_LED4_INVERT", + "OD_LED_FLAG_BUTTON_PRESS", "SecurityFlags", "OD_SECURITY_FLAG_REWRITE_ALLOWED", "OD_SECURITY_FLAG_SHOW_KEY_ON_SCREEN", @@ -1694,6 +1698,7 @@ class MsdAdvertisement(_PackedStruct): "OD_TOUCH_FLAG_SWAP_XY", "BuzzerFlags", "OD_BUZZER_FLAG_ENABLE_ACTIVE_HIGH", + "OD_BUZZER_FLAG_BUTTON_PRESS", "NfcFlags", "OD_NFC_FLAG_ENABLED", "FlashFlags", @@ -1702,6 +1707,7 @@ class MsdAdvertisement(_PackedStruct): "OD_MSD_STATUS_BATTERY_VOLTAGE_BIT8", "OD_MSD_STATUS_REBOOT_FLAG", "OD_MSD_STATUS_CONNECTION_REQUESTED", + "OD_MSD_STATUS_ENCRYPTION_ENABLED", "OD_MSD_STATUS_RESERVED_3", "OD_MSD_STATUS_MAIN_LOOP_COUNTER_SHIFT", "OD_MSD_STATUS_MAIN_LOOP_COUNTER_MASK", diff --git a/src/opendisplay_structs.swift b/src/opendisplay_structs.swift index c3b1486..0336ccd 100644 --- a/src/opendisplay_structs.swift +++ b/src/opendisplay_structs.swift @@ -1,6 +1,6 @@ // @generated by tools/gen_swift_structs.py -- DO NOT EDIT BY HAND. // Source: opendisplay_structs.h (OD_STRUCTS_VERSION 2.1) -// Source SHA-256: 88c64f4d288a8dc61108857ad045e4f3a4ae4d296d2f2336552989bc86f3437d +// Source SHA-256: 3c16f7cee08c7d42186aebb7b6ffdf8f84e7001e051aad81c7d0408815e6ebce // Regenerate: tools/gen_swift_structs.py --write (CI drift gate: --check) // // OpenDisplay BLE payload structs, enums, and bitfields. @@ -720,7 +720,7 @@ public struct TransmissionModes: OptionSet { public static let clearOnBoot = TransmissionModes(rawValue: 1 << 7) } -/// LedConfig.led_flags @bits LedFlags (bits 4-7 reserved). +/// LedConfig.led_flags @bits LedFlags (bits 5-7 reserved). public struct LedFlags: OptionSet { public let rawValue: UInt8 public init(rawValue: UInt8) { self.rawValue = rawValue } @@ -733,6 +733,9 @@ public struct LedFlags: OptionSet { public static let led3Invert = LedFlags(rawValue: 1 << 2) /// invert LED channel 4 polarity public static let led4Invert = LedFlags(rawValue: 1 << 3) + /// short flash on physical button press (incl. button-wake synthetic click); default + /// off + public static let buttonPress = LedFlags(rawValue: 1 << 4) } /// Bitfield group BusFlags: DataBus.bus_flags @bits BusFlags -- all bits reserved today @@ -773,13 +776,16 @@ public struct TouchFlags: OptionSet { public static let swapXy = TouchFlags(rawValue: 1 << 2) } -/// BuzzerConfig.flags @bits BuzzerFlags (bits 1-7 reserved). +/// BuzzerConfig.flags @bits BuzzerFlags (bits 2-7 reserved). public struct BuzzerFlags: OptionSet { public let rawValue: UInt8 public init(rawValue: UInt8) { self.rawValue = rawValue } /// enable pin is active-high when set; otherwise active-low - public static let high = BuzzerFlags(rawValue: 1 << 0) + public static let enableActiveHigh = BuzzerFlags(rawValue: 1 << 0) + /// short chirp on physical button press (incl. button-wake synthetic click); default + /// off + public static let buttonPress = BuzzerFlags(rawValue: 1 << 1) } /// NfcConfig.flags @bits NfcFlags (bits 1-7 reserved). @@ -813,8 +819,9 @@ public struct MsdStatusBits: OptionSet { public static let rebootFlag = MsdStatusBits(rawValue: 1 << 1) /// device is requesting a connection public static let connectionRequested = MsdStatusBits(rawValue: 1 << 2) - /// reserved; must be 0 (placeholder name for a future status flag; sits between the - /// flags and the bits 4-7 counter) + /// application-layer encryption active (encryption_enabled and non-zero master key) + public static let encryptionEnabled = MsdStatusBits(rawValue: 1 << 3) + /// legacy name for OD_MSD_STATUS_ENCRYPTION_ENABLED (same bit) public static let reserved3 = MsdStatusBits(rawValue: 1 << 3) /// bits 4-7: free-running main-loop nibble counter (liveness) public static let mainLoopCounterShift: UInt8 = 4