Adding Long Packet

This commit is contained in:
Lee Lup Yuen 2022-10-06 10:48:23 +08:00
parent cde3404d46
commit f629019379

View file

@ -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