Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
code:code [2017/10/13 17:18] – Igor Yefmov | code:code [2024/02/18 02:08] (current) – [Preface] Igor Yefmov | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Preface ====== | ||
+ | |||
Controlling the camera is done via writing " | Controlling the camera is done via writing " | ||
- standard UVC - this one is automagically supported by any UVC 1.1 compliant OS, which in the year 2017 would be "any modern OS". This interface covers the universally standardized controls for [[https:// | - standard UVC - this one is automagically supported by any UVC 1.1 compliant OS, which in the year 2017 would be "any modern OS". This interface covers the universally standardized controls for [[https:// | ||
- | - direct I²C access via Cypress' | + | - (Gen 3 and Gen 4) direct I²C access via Cypress' |
- | - FX3 Host Vendor Command Interface - this interfaces with the Cypress' | + | - FX3 Host Vendor Command Interface - this interfaces with the Cypress' |
- | - FPGA I²C Access - a " | + | - FPGA I²C Access - a " |
+ | |||
+ | If you are set on writing your own UI and don't want to be bothered too much with figuring out how to communicate with the camera you have an option of using the [[code: | ||
+ | |||
+ | ====== More details ====== | ||
+ | %%SUB2r%% camera is built on a Cypress FX3 chipset that facilitates the '' | ||
+ | |||
+ | On Windows the device is registered with a GUID '' | ||
+ | |||
+ | Here's a sample code that shows how to send commands to both the FX3 Host (defined on this page) and to access '' | ||
+ | |||
+ | <code c++>// set a new auto-functions' | ||
+ | // just issue the command directly to FX3's vendor request interface | ||
+ | void setAUInterval(){ | ||
+ | S2R::FX3 fx3; | ||
+ | fx3.open(0); | ||
+ | fx3.vrCmd(S2R:: | ||
+ | } | ||
+ | |||
+ | // run DPC calibration - also just a straight-up vendor request command | ||
+ | void runDPC(UCHAR _threshold = 240){ | ||
+ | S2R::FX3 fx3; | ||
+ | fx3.open(0); | ||
+ | fx3.vrCmd(S2R:: | ||
+ | } | ||
+ | |||
+ | // increase LED's green brightness by 25% | ||
+ | // utilize | ||
+ | void lightUpTheGreen(){ | ||
+ | using Cmd = S2R:: | ||
+ | using OpType = S2R:: | ||
+ | |||
+ | S2R::FX3 fx3; | ||
+ | fx3.open(0); | ||
+ | uint8_t | ||
+ | // LED green is mapped to register 0x0A ONLY for Gen3 and Gen4, won't work for Gen5 | ||
+ | const uint16_t clrChannel{0x0A}; | ||
+ | fx3.vrCmd(Cmd:: | ||
+ | buf[0] += buf[0] / 4; // yes, this can totally overflow | ||
+ | fx3.vrCmd(Cmd:: | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Firmware Version Info ====== | ||
+ | This applies to both FX3 and FPGA firmware version info data structures. | ||
+ | |||
+ | ===== Bit layout ===== | ||
+ | The bits are laid out in 4 sequential bytes as follows: | ||
+ | ^ 3 ^^^^^^^^ | ||
+ | ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^ | ||
+ | | buildNo[12: | ||
+ | |||
+ | ===== Firmware version info C/ | ||
+ | The FX3 version structure is as follows (little-endian memory layout): | ||
+ | |||
+ | <code cpp firmware-version.h> | ||
+ | struct FwVersion{ | ||
+ | unsigned vendorId | ||
+ | unsigned hwCfgId | ||
+ | unsigned productId | ||
+ | unsigned releaseType : 3; | ||
+ | unsigned buildNo | ||
+ | }; | ||
+ | static_assert(sizeof(FwVersion) == 4); | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== FX3 Version Info ===== | ||
+ | The version id is also encoded into the firmware image file name as: | ||
+ | < | ||
+ | |||
+ | |Code |Value | | ||
+ | ^ Vendor ID ^^ | ||
+ | |1|Cypress| | ||
+ | ^ Hardware ID ^^ | ||
+ | |1|FX3 Gen1| | ||
+ | ^ Product ID ^^ | ||
+ | |1|reserved for Gen 1 camera, a.k.a. "Moon landing" | ||
+ | |2|reserved for Gen 2 camera, a.k.a. " | ||
+ | |3|Gen 3 camera (Alpha), a.k.a. " | ||
+ | |4|Gen 3 camera, Production| | ||
+ | |5|Gen 4 camera, a.k.a. " | ||
+ | |6|Gen 5 camera, either " | ||
+ | ^ Release type ^^ | ||
+ | |0|Private build: Private build for debugging and similar purposes | | ||
+ | |1|Alpha: feature-incomplete early development cycle " | ||
+ | |2|Beta: feature-complete, | ||
+ | |3|Evaluation: | ||
+ | |4|Release candidate: feature complete and stable | | ||
+ | |5|Release: general availability | | ||
+ | |6|Backport: | ||
+ | |7|Emergency bug fix: a critical post-release bugfix | | ||
+ | ^ Build number | ||
+ | |# | ||
+ | |||
+ | |||
+ | ===== FPGA Version Info ===== | ||
+ | The version id is also encoded into the firmware image file name as: | ||
+ | < | ||
+ | |||
+ | ==== Vendor ID that represents a vendor of the main computation unit ==== | ||
+ | |Code |Value | | ||
+ | |1|Xilinx (AMD)| | ||
+ | |2|Altera (Intel)| | ||
+ | |||
+ | ==== Hardware ID for VendorId 1 (Xylinx) | ||
+ | |Code |Value | | ||
+ | |1|Artix-7 100T| | ||
+ | |2|Artix-7 200T| | ||
+ | |3|Artix %%UltraScale+%% XCAU25P| | ||
+ | |||
+ | ==== Hardware ID for VendorId 2 (Altera) | ||
+ | |Code |Value | | ||
+ | |1|Cyclone 10 GX| | ||
+ | |||
+ | ==== Product ID ==== | ||
+ | |Code |Value | | ||
+ | |1|reserved| | ||
+ | |2|reserved| | ||
+ | |3|Gen 3 camera (Alpha), a.k.a. " | ||
+ | |4|Gen 3 camera, Production| | ||
+ | |5|Gen 4 camera, a.k.a. “Vitreledonella”| | ||
+ | |6|Gen 5 camera, prosumer grade " | ||
+ | |7|Gen 5 camera, professional grade " | ||
+ | |||
+ | ==== Release type ==== | ||
+ | |Code |Value | | ||
+ | |0|Private build| | ||
+ | |1|Alpha| | ||
+ | |2|Beta| | ||
+ | |3|Eval/ | ||
+ | |4|Release candidate| | ||
+ | |5|Release| | ||
+ | |6|Backport| | ||
+ | |7|Emergency bug fix| | ||
+ | |||
+ | ==== Build number | ||
+ | |Code |Value | | ||
+ | |# | ||
+ | |||
+ | |||
+ | ---- | ||
+ | ====== Firmware Versioning evolution ====== | ||
+ | |||
+ | ====== FX3 Version Info ====== | ||
+ | The version id is also encoded into the firmware image file name as: | ||
+ | < | ||
+ | |||
+ | ===== FX3 version info C/ | ||
+ | The FX3 version structure is as follows (little-endian memory layout): | ||
+ | |||
+ | <code cpp firmware-version.h> | ||
+ | struct FwVersion{ | ||
+ | unsigned vendorId | ||
+ | unsigned hwCfgId | ||
+ | unsigned productId | ||
+ | #ifdef OLD_VER_FMT | ||
+ | unsigned releaseType : 5; | ||
+ | unsigned buildNo | ||
+ | #else | ||
+ | unsigned releaseType : 3; | ||
+ | unsigned buildNo | ||
+ | #endif | ||
+ | }; | ||
+ | static_assert(sizeof(FwVersion) == 4); | ||
+ | </ | ||
+ | |||
+ | Prior to FPGA v. 89 there was no standard-compliant way of representing the version info in a C struct though (which is exactly what prompted the rework in the first place). | ||
+ | ==== Bit layout ==== | ||
+ | The bits are laid out in 4 sequential bytes as follows (depending on the version): | ||
+ | ^ version | ||
+ | ^ ::: ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^ | ||
+ | | fx3< | ||
+ | | fx3< | ||
+ | | fx3> | ||
+ | |||
+ | Because of the change in bit layout different byte sequences shown below are needed to produce the same result (exact same component values for the sake of simplicity and only as an illustration): | ||
+ | ^ version | ||
+ | .vendorId = 1 | ||
+ | .hwCfgId = 1 | ||
+ | .productId = 5 | ||
+ | .releaseType = 3 | ||
+ | .buildNo = 0x67</ | ||
+ | | fx3> | ||
+ | | fx3< | ||
+ | | fx3> | ||
+ | |||
+ | ===== Vendor ID ===== | ||
+ | ^Code ^Value ^ | ||
+ | |1|Cypress| | ||
+ | |||
+ | ===== Hardware ID ===== | ||
+ | ^Code ^Value ^ | ||
+ | |1|FX3| | ||
+ | |||
+ | ===== Product ID ===== | ||
+ | ^Code ^Value ^ | ||
+ | |1|reserved for Gen 1 camera, a.k.a. "Moon landing" | ||
+ | |2|reserved for Gen 2 camera, a.k.a. " | ||
+ | |3|Gen 3 camera (Alpha), a.k.a. " | ||
+ | |4|Gen 3 camera, Production| | ||
+ | |5|Gen 4 camera, a.k.a. " | ||
+ | |6|Gen 5 camera, either " | ||
+ | |||
+ | ===== Release type ===== | ||
+ | ^ Code ^ Name ^ Meaning ^ | ||
+ | |0|Private build| Private build for debugging and similar purposes | | ||
+ | |1|Alpha| feature-incomplete early development cycle " | ||
+ | |2|Beta| feature-complete, | ||
+ | |3|Evaluation| Tech preview | | ||
+ | |4|Release candidate| feature complete and stable | | ||
+ | |5|Release| general availability | | ||
+ | |6|Backport| backport of a feature from next gen camera | | ||
+ | |7|Emergency bug fix| a critical post-release bugfix | | ||
+ | |||
+ | ===== Build number ===== | ||
+ | ^Code ^Value ^ | ||
+ | |# | ||
+ | |||
+ | |||
+ | ====== FPGA Version Info ====== | ||
+ | The version id is also encoded into the firmware image file name as: | ||
+ | < | ||
+ | |||
+ | |||
+ | ===== Vendor ID ===== | ||
+ | A '' | ||
+ | ^Code ^Value ^ | ||
+ | |1|Xilinx (AMD)| | ||
+ | |2|Altera (Intel)| | ||
+ | |||
+ | ===== Hardware ID ===== | ||
+ | A '' | ||
+ | ^%%VendorId%%^Code ^Value ^ | ||
+ | |1|1|Artix-7 100T| | ||
+ | |1|2|Artix-7 200T| | ||
+ | |1|3|Artix %%UltraScale+%% XCAU25P| | ||
+ | |2|1|Cyclone 10 GX| | ||
+ | ===== Product ID ===== | ||
+ | An '' | ||
+ | ^Code ^Value ^ | ||
+ | |1|reserved| | ||
+ | |2|reserved| | ||
+ | |3|Gen 3 camera (Alpha), a.k.a. " | ||
+ | |4|Gen 3 camera, Production| | ||
+ | |5|Gen 4 camera, a.k.a. “Vitreledonella”| | ||
+ | |6|Gen 5 camera, prosumer grade " | ||
+ | |7|Gen 5 camera, professional grade " | ||
+ | ===== Release type ===== | ||
+ | Lower '' | ||
+ | ^Code ^Value ^ | ||
+ | |0|Private build| | ||
+ | |1|Alpha| | ||
+ | |2|Beta| | ||
+ | |3|Eval/ | ||
+ | |4|Release candidate| | ||
+ | |5|Release| | ||
+ | |6|Backport| | ||
+ | |7|Emergency bug fix| | ||
+ | |||
+ | ===== Build number ===== | ||
+ | '' | ||
+ | ^Code ^Value ^ | ||
+ | |# | ||
- | The last two ([[code: |