

B0: packet type

B0 - 0 : set driver setting 
  else : TBC ...
  
  B1: setting structure id (When B0 == 0 'driver setting')
    1: struct cameraInstructionSet
      ! No extra indicate byte
      B2~: fields of structure data
      
      action -  
              structure not exist : allocate it
                            exist : trucate or extend! 
        
    2: struct cameraFunction
      B2, B3: index of cameraFunction list, field of "cameraInstructionSet"
      B4~: fields of structure data

      action - 
              check index is valid for "numberOfInstructionSet" of "cameraInstructionSet"
              
              valid:
                append or update data
                cameraAction list of trucate or extend!

    3: struct cameraAction
      B2, B3: index of cameraFunction list, field of "cameraInstructionSet"
      B4    : index of maximum action array "MAX_ACTION_IDX"
      B5, B6: index of cameraAction [B4] list in "cameraAction"
      B7~B15: field of structure data
      B16~  : data [B15] bytes 
      
      action - 
              check index is valid for "numberOfInstructionSet" of "cameraInstructionSet"
              
              valid: override data ....
                
    4: struct captureSetting
      B2, B3: index of cameraFunction list, field of "cameraInstructionSet"
      B4~: fields of structure data
      
      action - 
              check index is valid for "numberOfInstructionSet" of "cameraInstructionSet"
              
              valid: override data ....
      

  Host request handshaking status...
    Read status
    B0: command status
        0 - ok,
        else errors
    B1: which command for this ack
    B2: struct id
        
    

  ------------------------------------------------------------------------------------------------------
B0 -  1: Read driver setting ...
  B1 ~ [B6] as set driver setting condition ...
  
  
  
  
  B0: command type
    0: Set driver setting
    1: get driver setting
        
        B1: struct id
        B2~ struct sub id + data ....
        
    2: Run one test step
       B1, B2: which step be run 
        
    0x10: I2C read/write
        B1: I2C config:  
          b0: 
            0 - 7 bits address,
            1 - 10 bits address
          b2~b1: sub-address when read
            00: No sub address
            01: 1 byte
            10: 2 byte
            11: 3 byte
          b3: Ack ignore
          b4:
          b5:
          b6:
          b7: read(1), write(0)
            
        B2, B3: I2C address,
        
        write:
          B4, ~: data ... (length included in received length
        
        // report
        B0: 0x10 - for I2c read/write
        B1: read/write status - b7(1)- read, b7(0)-write, b7~b0: 0 - ok
        B2, B3: I2c read/write length
        B4~: read data ...
        
        //.       
        LINE_CODING linecoding =
        {
          0,    /* 16 bits, Response to host actually read/write lenth */
          0,    /* 8 bits,  Called result */
          0,    /* 8 bits,  device address by master */
          0,    /* 16 bits, Host request to Read/Write Length */
          0x00, /* 16 bits, sub address while used 2 bits for sub address length, 14 bit for address content */
          0x00, /* 8 bits,  for bit rate setting */
          0x00  /* 8 bit,   Device Hw/Sw I2c, 0: Software, 1: Hardware */
        };
        
        
        
      
      
command packet Handshaking:
        USB host                                    device
        command write   ---->
                read commad status
                                          <-----    command processing status + Ack
                                          
        
        
        
        
        