;This file is read by XCMangler and each boxed text item will be read as a command sequence title. 
;All lines after the boxed text will be included as part of the command sequence until a blank line is encountered
;The last line of the file needs to have a ; to terminate the processing.
;If you are creating a new command you must calculate a checksum by performing an XOR of all bytes after the command byte
 
;The first byte is the channel it will select the processors QSPI interface device. 0E is the ACP or XC chip and 07 is the BCM7015
;the assembler program I wrote that runs on the DCT will process any channel that is addressable on the QSPI hardware but it may not
;function correctly outside of the two described here.

;The second byte is the number of bytes that are to follow, make sure you count them correctly. 
;The assembler program will not work correctly if it is wrong.

;The third byte performs multiple functions depending on what stage the sequence is in. generally 80 and up values are set value types
;and 00 01 etc. are get values or acknowledge values.
;Some returned values represent specific events like the number of bytes that are ready to get from the ACP 
;For example GetReg-UA will retrieve the ACP's stored Unit Address sending OE 02 00 00 at the right time will read back 05 09 
;which represents register 05 and 09 bytes of data. For the logging to work correctly you will need to read an extra byte.
;Here is a commented GetReg05-UA sequence to help illustrate it.
;
; 0E 04 80 05 00 05			on channel 0E send 04 bytes consisting of set cmd 80 05 00 and a calculated XOR checksum of 05
; 0E 01 00 				read back the cmd register which will be 05 if it worked
; 0E 02 00 00 				read back the data parm values which will be 05 09 register 05 and 09 bytes of info if its ready
; 0E 01 01 				acknowledge with 01
; 0E 0A 00 00 00 00 00 00 00 00 00 00 	read the 09 bytes + 1 to log it correctly
;
;Enjoy - cipher
  

;Reset ACP
;This is a soft reset of the ACP
;This will clear an invalid state responce value of 11 from the ACP
;which it normally responds with 55

[ACPReset]
0E 02 86 09
0E 02 86 08
0E 02 86 18
0E 01 02
0E 03 00 00 00
0E 02 86 18
0E 05 80 02 01 00 03

;Send System ID
;This is a unique value that is set on the DAC6000 Headend component there can be multiple system ID's 
;for a CC depending on how many DAC's they run. Here the values 29 is the current epoch and 19 35 85 is the 
;DAC's ID

[SendSystemID]
0E 09 80 0E 05 30 29 19 35 85 BB
0E 01 00 
0E 02 00 00 
0E 01 01 
0E 03 00 00 00 

;Get UA
;Get the Unit Address stored in regiter 5 of the ACP

[GetReg05-UA]
0E 04 80 05 00 05
0E 01 00 
0E 02 00 00 
0E 01 01 
0E 0A 00 00 00 00 00 00 00 00 00 00

;Get register 0B 
;The function of this cmd is not known but is does return what appears to be a encrypted key which
;may have something to do with PPV signing 

[GetReg0B]
0E 06 80 0B 02 00 00 09 
0E 01 00 
0E 02 00 00 
0E 01 01 
0E 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

;Get register 0B 
;Unknown function

[GetReg04]
0E 04 80 04 00 04 
0E 01 00 
0E 02 00 00 
0E 01 01 
0E 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

;Get register 07 
;Unknown function

[GetReg07]
0E 05 80 07 01 00 06 
0E 01 00 
0E 02 00 00  
0E 01 01 
0E 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

;Get register 07 
;Unknown function

[GetReg06]
0E 04 80 06 00 06
0E 01 00
0E 02 00 00
0E 01 01
0E 08 00 00 00 00 00 00 00 00

;End