DLPU114A August 2024 – November 2024 DLPC8445
The command packet defines the packet format to follow when commands are sent to the controller. Fields that are always present are indicated in bold, and optional fields are indicated in normal font.
The definition of which fields are present is based on the 1-byte header field. The length field is mandatory if a command is defined as having variable data size.
Field | Size (bytes) | Description |
---|---|---|
Header | 1 | See Table 5-2 table below |
Opcode | 1 | Command opcode |
Length | 2 or 0 based on data length present field in the header |
Length of the command data in bytes following this byte. Checksum is not included in length. For example, when length being set as 10 means there are 10 bytes of data after this length field. LSB of length shall be sent first followed by MSB. |
Data | 0-511 (total maximum of 512 bytes in the whole message including header and checksum) | Parameters/data |
Checksum | 1 or 0 (optional as checksum present field of header) |
Checksum of all bytes in the message including header bytes. Fletcher's checksum is implemented as below: uint32 SimpleChecksum = 0; uint32 SumofSumChecksum = 0; uint08 *Addr = (uint08 *) StartAddress; while (NumBytes--) { SimpleChecksum += *Addr++; SumofSumChecksum += SimpleChecksum; } |
Bits | Field Name | Values |
---|---|---|
0:2 | Destination | Numerical destination code of the applicable command |
3 | Opcode Length | 0 = One byte opcode |
4 | Datalength Present | 1 = Length field present in the extended header 0 = No length field present |
5 | Checksum Present | 1 = Checksum present after data bytes 0 = Checksum not present |
6 | Reply Requested | 1 = Device will send a response packet to every write command. This field is
applicable only for write commands. 0 = Response packet not sent for write commands |
7 | Read Command | 1 = Read Command 0 = Write Command |
An example of a command packet for the Read LED Enable command (see Section 9.6.2) can be seen below: