From f62901937936c8e7801a8ca0b347e9c5c39b0086 Mon Sep 17 00:00:00 2001 From: Lee Lup Yuen Date: Thu, 6 Oct 2022 10:48:23 +0800 Subject: [PATCH] Adding Long Packet --- display.zig | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/display.zig b/display.zig index 4bf29ca..cbfa00c 100644 --- a/display.zig +++ b/display.zig @@ -77,6 +77,31 @@ pub export fn nuttx_mipi_dsi_dcs_write( return 0; } +// TODO: Compose Long Packet: https://lupyuen.github.io/articles/dsi#long-packet-for-mipi-dsi +// Packet Header (4 bytes): +// - Data Identifier (DI) (1 byte): +// Virtual Channel Identifier (Bits 6 to 7) +// Data Type (Bits 0 to 5) +// (Virtual Channel should be 0, I think) +// +// - Word Count (WC) (2 bytes): +// Number of bytes in the Packet Payload +// +// - Error Correction Code (ECC) (1 byte): +// Allow single-bit errors to be corrected and 2-bit errors to be detected in the Packet Header +// See "12.3.6.12: Error Correction Code", Page 208: +// https://github.com/sipeed/sipeed2022_autumn_competition/blob/main/assets/BL808_RM_en.pdf) +// +// Packet Payload: +// - Data (0 to 65,541 bytes): +// Number of data bytes should match the Word Count (WC) +// +// Packet Footer: +// - Checksum (CS) (2 bytes): +// 16-bit Cyclic Redundancy Check (CRC) +// See "12.3.6.13: Packet Footer", Page 210: +// https://github.com/sipeed/sipeed2022_autumn_competition/blob/main/assets/BL808_RM_en.pdf) + /// MIPI DSI Device pub const mipi_dsi_device = extern struct { /// Number of Data Lanes