groupgets / purethermal1-firmware

Reference firmware for PureThermal 1 FLIR Lepton Dev Kit
MIT License
125 stars 62 forks source link

Custom CCI #14

Closed Sheyne closed 6 years ago

Sheyne commented 6 years ago

I implemented support for running custom CCI commands. Format is as follows:

On the CUSTOM_UVC extension unit there are 5 controls:

  1. CUST_CONTROL_COMMAND, read/write (516 bytes)
    • sets up the current custom command of the form:
      • (2 bytes) command-id
      • (2 bytes) command-length (in bytes, not lepton 16bit words)
      • (512 bytes) (optional) command-data
  2. CUST_CONTROL_GET, readonly
    • runs the current custom command as get and returns the data and the error code
  3. CUST_CONTROL_SET, readonly
    • runs the current custom command as set and returns the error code
  4. CUST_CONTROL_RUN, readonly
    • runs the current custom command as run and returns the error code
  5. CUST_CONTROL_DIRECT_WRITE, readonly
    • writes directly to the register at address command-id (possibly the buffer) length bytes from the command-data field and returns the error code
  6. CUST_CONTROL_DIRECT_READ, readonly
    • reads directly to the register at address command-id (possibly the buffer) length bytes and returns the error code followed by the length and the data

@kekiefer Do you have any design suggestions or do you think this is good as is? We need support for running arbitrary commands and in some cases getting rich error codes.

kekiefer commented 6 years ago

Rebased and merged

kekiefer commented 6 years ago

Thanks a lot for the PR. Would you mind adding some information to the wiki on how to use this, or examples in the purethermal1-uvc-capture?