User Tools

This is an old revision of the document!


FX3/FPGA API spec

This page describes FX3/FPGA API for Square1 and Studio (gen5) products.

For gen4 and earlier API see FX3/FPGA API spec up to REX.

Preface

SUB2r camera is built on a Cypress FX3 chipset that facilitates the Super-Speed USB 3.0+ communication between the device and a host system. Every component of the camera, be it an FPGA or an image sensor, receives user commands via that Cypress FX3.

On Windows the device is registered with a GUID {36FC9E60-C465-11CF-8056-444553540000} and if you are not planning on using the SUB2r-lib for your development - that would be the GUID to search for to properly connect to the command channel.

Whether you use SUB2r-lib or not you need to install the provided driver for the OS to properly configure the device in order to be able to connect to its control endpoints.

Here's a sample code that shows how to send commands to both the FX3 Host and to FPGA I²C bridge. The code lacks error checking (for clarity) and this should go without saying that if you copy-paste it into your code you must add error handling :)

// set a new auto-functions' update interval to 2x the default
// just issue the command directly to FX3's vendor request interface
void setAUInterval(){
    S2R::I2C fx3;
    fx3.open(0);
    fx3.vrCmd(S2R::FX3::af_au_period, S2R::FX3::write, 6000, 0);
}
 
// run DPC calibration - also just a straight-up vendor request command to FX3
void runDPC(UCHAR _threshold = 240){
    S2R::I2C fx3;
    fx3.open(0);
    fx3.vrCmd(S2R::FX3::calibrate_dpc, S2R::FX3::write, _threshold, 0);
}
 
// increase LED's green brightness by 25%
// utilize the FPGA's I²C bridge
void lightUpTheGreen()
{
    using Cmd = S2R::FX3::Fx3Cmd;
    using OpType = S2R::FX3::VrCmdOpType;
 
    S2R::FX3 fx3;   // `S2R::I2C fx3;` works as well
    fx3.open(0);
    uint8_t        buf[1]{0};
    const uint16_t clrChannel{0x0A};    // LED green
    fx3.vrCmd(Cmd::i2c_bridge, OpType::read, 0, clrChannel, buf, 1);
    buf[0] += buf[0] / 4;  // yes, this can totally overflow
    fx3.vrCmd(Cmd::i2c_bridge, OpType::write, buf[0], clrChannel);
}

FX3 API Reference

The following tables provide information on how to access the camera's functionality for FX3 Host Vendor Command Interface. The address space is split into smaller chunks, grouped by common functionality:

0x00-0x9F

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0x00-0x9F Think of this as “system address space”

0xA0-0xA7

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Bootloader check0xA0 R/W Check if a bootloader is running, the result is in the command's status code (success/failure interpreted as true/false)
MS OS Descr.0xA1bits 3:0 - see notes R/O174MS OS Platform DescriptorFor details on the structure and valid parameters' values refer to Microsoft's documentation for Microsoft OS 2.0 Descriptors Specification
The 4 LSB of the wIndex field are the descriptor's index. Valid values are:
7 - MS OS 2.0 descriptor
8 - MS OS 2.0 set alternative enumeration (currently not supported)
:!: Run DPC calibration0xA2 DPC ThresholdW/O Start the dynamic DPC calibration with the given DPC Threshold in range [0..4095]
Reserved0xA3
:!: FPGA I²C Bridge0xA4FPGA register offsetFPGA data (write)R/W0 or 17:0 - FPGA dataFPGA write returns 0 byte buffer, FPGA read returns 1 byte buffer. Read/write is requested via control endpoint's direction attribute being set to DIR_FROM_DEVICE/DIR_TO_DEVICE.
For details on individual commands refer to FPGA I²C bridge
:!: Sensor I²C bridge (8-bit configuration registers)0xA5 [15:0] - sensor register address mask and data (if writing) - see Notes column for details R/W0 or 1 7:0 - sensor register's data register - a 16 bit register address
mask - an 8-bit MSB that specifies which bits to affect during a write operation - only the bits that are set in mask will be affected by bits in data. Setting mask to 0 ultimately turns a write operation into a read one as no bits are getting modified
data - an 8-bit LSB that specifies the new data to write into sensor's register. The write only affects the bits that are set in mask
Read operation returns an 8-bit register's value
Read/write is requested via control endpoint's direction attribute being set to DIR_FROM_DEVICE/DIR_TO_DEVICE.
For details on each sensor's register's function refer to the sensor's specification
Reserved for future I²C bridge 0xA6
:!: Video Mode Select0xA7 R/W 1 7:2 - Reserved
1 - HDR mode
0 - RAW mode
1 - chose between HDR(1) or linear (0) sensor mode
0 - select RAW mode (1) or Processed Video (0) for video pipeline
N.B. “Raw mode” has been moved here from 0xA5 in FX3 version 46

0xA8-0xA9 - sysinfo

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: Sysinfo0xA8data structure version:
1 - deprecated
2 - supported version
bitmask of additional checks to perform:
:!: 0 - reinit FPGA and/or sensor if needed
1-7: reserved
R/O54
struct SysInfoV2
Get various internal system info on the guts of the RTOS and the firmware running on FX3, as well as overall configuration and health check results. Returned bytes:
Version 2: SysInfoV2
Reserved0xA9

0xAA-0xAF - versioning and reprogramming

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Erase SPI Flash0xAA W/O Any write to this location invalidates the FX3 SPI Flash and causes the FX3 to reset itself to a bootloader mode for reprogramming
FX3 version0xAB R/O431:19 Build#
18:16 Release type
15:8 Product ID
7:3 HW_CFG_ID
2:0 Vendor ID
Get detailed version information of the FX3, for more details refer to FX3 Version Info
:!: FPGA version0xAC R/O431:19 Build#
18:16 Release type
15:8 Product ID
7:3 HW_CFG_ID
2:0 Vendor ID
Get detailed version information of the FPGA, for more details refer to FPGA Version Info
:!: FPGA config. ctrl.0xAD W/O Any write to this location will put the FPGA into configuration mode
:!: FPGA config. status - SPI codes0xAE R/O2 see below for details Retrieve detailed status of the FPGA configuration operation
SPI Flash write enable0xAF W/O Reconfigure the FX3 IOMatrix to disable GPIF and enable SPI to be re-written

FPGA config status - SPI codes

Bit name Description
15 Program SwitchWord OK
14 Verify OK Verification succeeded
13 Program OK Programming completed successfully
12 Erase OK SPI erase was successful
11 Erase SwitchWord OK
10 Check ID OK
9 Initialize OK
8 Config started Config operation has started
7 CRC error
6 Timeout error
5 Program error Error while programming the SPI
4 Erase error Encountered an error while erasing SPI
3 IdCode error
2 Config error Configuration operation errored out
1 Config done Configuration operation is complete
0 Config not busySet to 1 while the config is not busy

0xB0 - FPS control

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: FPS0xB0 R/W4float32 FPSFPS value is in IEEE float32 format, x86 LE

0xB1 - Bulk color grading

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: Bulk color grading0xB115:8 - table
7:0 - starting index
15:8 - version
7:0 - count
R/Wcount x 2 Currently only version 1 is supported.
The table is a value from this list:
000 - Hue vs. Hue (14 bits)
001 - Hue vs. Saturation (12 bits)
010 - Lightness vs. Saturation (12 bits)
011 - Saturation vs. Saturation (12 bits)1)
100 - Lightness vs. Lightness (12 bits)
101 - Hue vs. Lightness (12 bits)2)
110-111 - reserved
Starting index is a 0-based offset of the first written/read color grading value
Version is currently 1
Count - how many entries to write/read
The buffer is exchanged in data phase of the USB control request (both IN/OUT)

0xB2 - Color correction matrix (a.k.a. CCM or CMX)

See Color correction matrix article in this Wiki's ISP section for more details.

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: Color correction matrix0xB2 0 0x0303 R/W32packed C-array float[3][3]That data buffer could also be defined as float[9] or as byte* for the same exact memory layout on LE systems

0xB3-0xB7

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xB3
Reserved0xB4
Reserved0xB5
Reserved0xB6
Reserved0xB7

0xB8 - FPGA stats

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: FPGA stats0xB8statistics type0ROsee notessee notesRead out various stats from FPGA, see table below for details

FPGA stats' details

Name Value Return type Notes
:!: MIPI FPS0x01floatIEEE float32 format, x86 LE number derived from MIPI-observed time between first pixel output of two consecutive video frames received by FPGA

0xB9

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xB9

0xBA - SDI control

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: SDI control 0xBA 0 1 R/W 1 0 - SDI on/off SDI control, for now only on/off with the default video mode of 1080p@60fps 10bit YUV 4:2:0 packed

0xBB-0xBF

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xBB
Reserved0xBC
Reserved0xBD
Reserved0xBE
Reserved0xBF

0xC0-0xC1

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xC0
Reserved0xC1

0xC2-0xC4 - SPI flash management

The SPI flash memory (either 128MB or 256MB) is partitioned into 65KB sectors, each comprised of 256 pages. Each page is 256 bytes long.

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
SPI flash write page0xC216:0 page address W/O256 write a page of SPI flash (same command as Cypress' examples). The flash page size is fixed to 256 bytes
SPI flash read page0xC316:0 page address R/O256page's contentread a page of SPI flash (same command as Cypress' examples). The flash page size is fixed to 256 bytes
SPI flash sector erase/poll0xC47:0 - sector0 - poll
1 - erase
R/W either erase a SPI flash sector, or poll SPI busy status (same command as Cypress' examples)

sector's byte address is computed by multiplying wIndex by 65536

For Erase SPI flash sector function:
- wValue = 0x0001
- wIndex = SPI flash sector address
- wLength = 0x0000
No data phase associated with this command

For Check SPI busy status function:
- wValue = 0x0000
- wIndex = 0x0000
- wLength = 0x0001
Data phase indicates flash busy status:
- 0x00 means SPI flash has finished write/erase operation
- non-zero value means that SPI flash is still busy processing previous write/erase command.

0xC5-0xCB

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xC5
Reserved0xC6
Reserved0xC7
Reserved0xC8
Reserved0xC9
Reserved0xCA
Reserved0xCB

0xCC - FPGA temperature sensor

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: FPGA core temperature0xCC R/O FPGA temperature read from the on-board sensor (not implemented yet)

0xCD-0xCF

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xCD
Reserved0xCE
Reserved0xCF

0xD0-0xD7 - Auto exposure configuration

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: AE Setpoint0xD0 AE SetpointR/W0 or 2 11:0 AE SetpointTarget Auto Exposure Luminance Setpoint [0..4095]
Default: 2500
This controls the “average luminance” of the whole frame that we are trying to achieve. The higher the value the brighter the result is going to be
Reserved0xD1
Reserved0xD2
Reserved0xD3
Reserved0xD4
Reserved0xD5
Reserved0xD6
Reserved0xD7

0xD8-0xDE - Auto white balance configuration

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: AWB Setpoint0xD8 AWB SetpointR/W0 or 2 11:0 AWB SetpointAuto White Balance G Gain Setpoint [0..4095]
Default 2048
The pinned value for Green Gain that is used as the basis for the rest of the white balance adjustments. Only change this value if you need to make your picture brighter and you have exhausted both the Exposure and the Global Gain options
Reserved0xDC
Reserved0xDD
Reserved0xDE

0xDF - Auto-functions' timing

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Auto Update Period0xDF Auto Update PeriodR/W0 or 2 15:0 Auto Update PeriodAuto Update Period [0..65535])
Default 17
Determines how long we wait before trying to apply a new update for both exposure and white balance (when auto functions are enabled), as well as other up-keep operations, like pushing data over I²C bus.
This is an asynchronous update rate.
That value is approximately in milliseconds

0xE0 - FX3 reset

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
FX3 reset0xE0 W/O Cypress vendor command to soft reset FX3

0xE1-0xEF

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xE1
Reserved0xE2
Reserved0xE3
Reserved0xE4
Reserved0xE5
Reserved0xE6
Reserved0xE7
Reserved0xE8
Reserved0xE9
Reserved0xEA
Reserved0xEB
Reserved0xEC
Reserved0xED
Reserved0xEE
Reserved0xEF

0xF0-0xF9

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xF0
Reserved0xF1
Reserved0xF2
Reserved0xF3
Reserved0xF4
Reserved0xF5
Reserved0xF6
Reserved0xF7
Reserved0xF8
Reserved0xF9

0xFA - [Debug] Get raw descriptor

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Get raw descriptor0xFAcommand (see below)struct to returnR/Ovaries by command (see below)struct's byte bufferSee below for details

List of commands supported by this API:

Cmd (wIndex) Meaning
0get a 2-byte descriptive text label's length (not including the C-style null-terminator)
1get descriptive text label (up to 4096 bytes without a C-style null-terminator)
2get a 2-byte size of the structure in bytes
3get structure's byte buffer

As of FX3 version 58 the following internal structures are supported:

Index (wValue) Details
0reserved (unused)
1USB device descriptor HS
2USB device descriptor SS
3USB Device Qualifier descriptor
4USB BOS (Binary Object Store) descriptor
5MS OS Platform Capability descriptor version 2.0
6Full-Speed (2.0) USB Configuration descriptor
7High-Speed (2.0) USB Configuration descriptor
8Super-Speed (3.0) USB Configuration descriptor

0xFB - OS runtime info

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
:!: OS runtime info0xFBsee belowsee belowR/Osee belowsee belowQuery for OS internal info. A type of query is specified in wValue field and, along with other fields, is described in the table below
wValue wIndex Description
:!: 0 get number of user trheads
:!: 1 0-based thread's index get info on the thread, see struct OsThreadInfo for details

0xFC-0xFF - Reserved for debug APIs

Name Offset wIndex wValue Access type Byte length Return buffer bits Notes
Reserved0xFC
Reserved0xFD
Reserved0xFE
Reserved0xFF

FPGA I²C bridge (registers' map)

The following tables provide information on how to access the camera's functionality for an FPGA I²C bridge.

Here's a sample code (skipping all error checking) that sets the LED to bright-yellow color:

S2R::FX3 dev; // auto-open device #0
using S2R::FX3;
dev.vrCmd(FX3Cmd::i2c_bridge, VrCmdOpType::write, 255, 0x08); // red
dev.vrCmd(FX3Cmd::i2c_bridge, VrCmdOpType::write, 255, 0x0A); // green
dev.vrCmd(FX3Cmd::i2c_bridge, VrCmdOpType::write, 0, 0x0C);   // blue

The address space is broken down into smaller chunks, grouped by common functionality:

0x00-0x07 - FPGA general access

Name Offset Access Bit mapping Notes
:!: FPGA Version #00x00R/O7:5 Vendor ID
4:0 HW_CFG_ID
:!: FPGA Version #10x01R/O7:0 Product ID
:!: FPGA Version #20x02R/O7:3 Release type
2:0 Build number MSB
Build number is split into 2 MSB and 8 LSB for a combined total width of 10 bits
:!: FPGA Version #30x03R/O7:0 Build number LSB
:!: FPGA config status #00x04R/Osee SPI codes for detailsLSB (bits 7-0) of the FPGA config status
:!: FPGA config status #10x05R/Osee SPI codes for detailsMSB (bits 15-8) of the FPGA config status
:!: FPGA control/status0x06R/W Global control of the FPGA's functionality
:!: 7 FPGA config enableIf bit 7 is set, the GPIF becomes read only and waits for an update bitstream
:!: 6 DPC enable Setting bit 3 along with bit 0x06::0 will perform a DPC correction
5 reserved
4 reserved
3 reserved
2 reserved
1 reserved
:!: 0 SFP+ (R/O) set to 1 by FPGA if there is an active device in SFP+ cage, not writeable by FX3
:!: FPGA core temperature0x07 R/O 7:0 - temperature in Farenheits Reading of the FPGA's internal temperature sensor in degrees of Farenheits

0x08-0x0D - LED

Name Offset Access Bit mapping Notes
:!: LED_RED0x08R/W7:0 Red LEDLSB of LED's red intensity in range [0..255]
Reserved0x09
:!: LED_GREEN0x0AR/W7:0 Green LEDLSB of LED's green intensity in range [0..255]
Reserved0x0B
:!: LED_BLUE0x0CR/W7:0 Blue LEDLSB of LED's blue intensity in range [0..255]
Reserved0x0D

0x0E-0x0F - Reserved

Name Offset Access Bit mapping Notes
Reserved0x0E
Reserved0x0F

0x10-0x1F - Basic UVC controls

Name Offset Access Bit mapping Notes
:!: Brightness0x10R/W7:0 LSB16 bits of brightness are split into 8 bits of LSB and MSB
0x117:0 MSB
:!: Contrast0x12R/W7:0 LSB16 bits of contrast are split into 8 bits of LSB and MSB
0x137:0 MSB
:!: Saturation0x14R/W7:0 LSB16 bits of saturation are split into 8 bits of LSB and MSB
0x157:0 MSB
:!: Sharpness0x16R/W7:0 LSB16 bits of sharpness are split into 8 bits of LSB and MSB
0x177:0 MSB
:!: Gamma0x18R/W7:0 LSB16 bits of gamma are split into 8 bits of LSB and MSB
0x197:0 MSB
:!: Hue0x1AR/W7:0 LSB16 bits of hue are split into 8 bits of LSB and MSB
0x1B7:0 MSB
Reserved0x1C
Reserved0x1D
Reserved0x1E
Reserved0x1F

0x20-0x27 - Defective pixel cancellation

Name Offset Access Bit mapping Notes
:!: DPC Threshold0x20R/W7:0 LSB 16 bit of DPC Threshold are split into 8 bits of LSB and MSB
0x217:0 MSB
:!: DPC count0x22R/O7:0 LSBOnce the DPC calibration is done the 16-bit value is stored in these 2 registers
0x237:0 MSB
Reserved0x24
Reserved0x25
Reserved0x26
Reserved0x27

0x28-0x3F - General image statistics

Name Offset Access Bit mapping Notes
:!: flags0x28R/O7:0 valueflags for OverExposure and SFP+ cage device. The following bits are currently defined:
7:2 - reserved
:!: 1 - indicates whether a red overexposure is detected
:!: 0 - set if there is a general overexposure detected
:!: FPS0x29R/O7:0 LSB16-bit unsigned value representing number of 10μs units between frame start signals from the image sensor, e.g. a value of 1000 means it took 10ms between 2 frame start signals, which corresponds to 100FPS
0x2A7:0 MSB
:!: Y average0x2BR/OLSBAverage “brightness” value
0x2DMSB
Reserved0x2C
Reserved0x2E
Reserved0x2F
:!: AWB Red total0x33-0x30R/O32-bit value0x33 is MSB, 0x30 is LSB
:!: AWB Green total0x37-0x34R/O32-bit value0x37 is MSB, 0x34 is LSB
:!: AWB Blue total0x3B-0x38R/O32-bit value0x3B is MSB, 0x38 is LSB
:!: AWB total pixel0x3F-0x3CR/O32-bit value0x3F is MSB, 0x3C is LSB

0x40-0x45 - AWB adjustments

Name Offset Access Bit mapping Notes
:!: AWB Red adjustment0x40R/W7:0 - LSBa signed 16-bit value of an adjustment to apply to every pixel in Red channel. Default is 0
0x417:0 - MSB
:!: AWB Green adjustment0x42R/W7:0 - LSBa signed 16-bit value of an adjustment to apply to every pixel in Green channel. Default is 0
0x437:0 - MSB
:!: AWB Blue adjustment0x44R/W7:0 - LSBa signed 16-bit value of an adjustment to apply to every pixel in Blue channel. Default is 0
0x457:0 - MSB

0x46-0x4F - Media setup

Name Offset Access Bit mapping Notes
:!: Media output modules0x46R/W7 - res
6 - res (headphones)
5 - res (UAC)
4 - res
:!: 3 - HDMI video
:!: 2 - SDI video
:!: 1 - SFP+ video
:!: 0 - UVC
Enable/disable state of individual media output modules for video and audio streams
:!: Video transform blocks0x47R/W:!: 7 - sharpness
6 - res
5 - res
4 - res
3 - res
2 - res
:!: 1 - CCM
:!: 0 - (UVC Gamma)
Enable/disable individual transformation blocks in video pipeline
:!: Video output format0x48R/W:!: 7:4 - UVC
:!: 3:0 - SDI, SFP+, SDI
Bit depth for all video formats is set in register 0x49
UVC video formats:
0 - “RAW” greyscale pre-debayer pixels
1 - 4:4:4 RGB
2 - (res) packed YCbCr 4:4:4
3 - packed YCbCr 4:2:2
4 - (res) packed YCbCr 4:2:0
5 - (res) planar YCbCr 4:4:4
6 - (res) planar YCbCr 4:2:2
7 - planar YCbCr 4:2:0
8-15 - (res) MJPEG, MPEG-x/H.26x, etc
SDI and SFP+ video output formats/FPS are always in unison. See SDI FPS table below for codes. SDI output is always in a packed (not planar) YUV 4:2:2 format
:!: Video output pixel bit depth0x49R/W:!: 7:6 - HDMI
:!: 5:4 - SDI
:!: 3:2 - SFP+
:!: 1:0 - UVC
Pixel bit depths \(d_p\) is calculated from a 2-bit value \(N\) as: \[d_p = (N+4)*2\] Not all values are valid, for example SDI and SFP+ both do not support 8-bit output and UVC only supports 8-bit color depth, at least for now
:!: Image sensor configuration0x4AR/W7:2 - res
:!: 1:0 - de-mosaicing strategy
De-mosaicing strategy directs the use of a specific implementation of color reconstruction:
3, 2 - reserved
1 - use “branching 5×5”, for example the one described here
0 - use “branchless 5×5”, like the one described in here
Reserved0x4B
:!: Audio transform blocks0x4CR/W7:0 - resEnable/disable individual transformation blocks in audio pipeline
Reserved0x4D
Reserved0x4E
Reserved0x4F

FOURCC formats (for UVC)

A combination of data in 0x49[1:0] (pixel bit depth) and 0x48[6:3] (video format) used for UVC is mapped into standard FOURCC codes as summarized in the following table:

0x49[1:0]\0x48[6:3] 0 (RAW) 1 (RGB) 2 (packed YUV 4:4:43)) 3 (packed YUV 4:2:24)) 7 (planar YUV 4:2:05))
0 (8 bit) :!: BA81/BYR1/GREY/Y8/Y800 (8bpp):!: BI_RGB/RGB (24bpp) :!: Y444/IYU2 (24bpp) :!: YUY2/YUYV (16 bpp):!: NV12 (12bpp)
1 (10 bit) :!: Y106) (16bpp7)):!: BI_BITFIELDS (48bpp) :!: Y410 (32bpp8)) :!: Y210 (32bpp)
YUVP?/Y42T (24bpp?)
:!: P010 (32bpp)
2 (12 bit) :!: BYR2 (16pbb9)):!: BI_BITFIELDS (48bpp) :!: Y41210) (40bpp11)) :!: Y21212) (32bpp13)) :!: P01214) (32bpp15))
3 (14 bit) :!: Y1616) (16bpp17)):!: BI_BITFIELDS (48bpp) :!: Y41418) (48bpp19)) :!: Y21420) (32bpp21)) :!: P01422) (32bpp23))

SDI FPS

Below is the table that lists codes for supported SDI FPS settings st in 0x48[3:0]:

FPS code
23.98 0x01
24 0x02
25 0x04
29.97 0x05
30 0x06
50 0x08
59.94 0x09
60 0x0A
120 0x0C

SDI pixel clock frequency

Frame geometry MHz FPS
1920×1080 74.18 23.98
29.97
74.25 24
25
30
148.35 59.94
148.5 50
60
297 120
3840×2160 296.70 23.98
29.97
297 24
25
30
593.41 59.94
594 50
60
1188 120
7680×4320 1188 24
30

0x50-0x5F - Reserved

Name Offset Access Bit mapping Notes
Reserved0x50-0x5F

0x60-0x6F - Reserved

Name Offset Access Bit mapping Notes
Reserved0x60-0x6F

0x70-0x7F - Reserved

Name Offset Access Bit mapping Notes
Reserved0x70-0x7F

0x80-0xBF - Green Screen enhancer

“Green screen”, a.k.a. “Chroma Key” on-board optimization is designed to replace a range of colors with a single solid one

0x80-0x8F - band #0

If enabled these setting take precedence over other 3 bands

Name Offset Access Bit mapping Notes
:!: CK control0x80R/W7:1 reserved
0 enable
enable/disable Chroma Key control
:!: CK status0x81 reserved
:!: CK saturation min0x82R/W7:0 sat. min[0..255] to specify the minimum saturation threshold
:!: CK saturation max0x83R/W7:0 sat. max[0..255] to specify the maximum saturation threshold
:!: CK luma min0x84R/W7:0 luma min[0..255] to specify the minimum brightness threshold
:!: CK luma max0x85R/W7:0 luma max[0..255] to specify the maximum brightness threshold
:!: CK hue0x86R/W7:0 hue LSB14 bits of a signed hue value are split into 8 LSB and 6 MSB, its [-8K..+8K] range is mapped into [-180°..+180°]
0x877:6 reserved
5:0 hue MSB
:!: CK tolerance0x88R/W7:0 tolerance LSB13 bits of an unsigned hue tolerance value are split into 8 LSB and 5 MSB, valid range is [0..8K], which is mapped into [0°..180°].
That value specifies how far to stretch the CK hue value both ways (symmetrically). If the CK tolerance is above 90° the covered color space is over 50% of values
0x897:5 reserved
4:0 tolerance MSB
:!: CK red0x8AR/W7:0 red LSB
0x8B7:0 red MSB
:!: CK green0x8CR/W7:0 green LSB
0x8D7:0 green MSB
:!: CK blue0x8ER/W7:0 blue LSB
0x8F7:0 blue MSB

0x90-0x9F - band #1

Color substitution (if enabled) takes place after the first band had a chance to process the pixels

The layout of the settings is identical to that of band #0 just shifted down by a paragraph and occupying address block 0x90-0x9F

0xA0-0xAF - band #2

Color substitution (if enabled) takes place after the first and second bands had a chance to process the pixels

The layout of the settings is identical to that of band #0 just shifted down by 2 paragraphs and occupying address block 0xA0-0xAF

0xB0-0xBF - band #3

Color substitution (if enabled) takes place after other bands had a chance to process the pixels

The layout of the settings is identical to that of band #0 just shifted down by 3 paragraphs and occupying address block 0xB0-0xBF

0xC0-0xCF - Color grading

Name Offset Access Bit mapping Notes
:!: switch0xC0W Controls what information is being read/written by accessing the next set of registers (0xC2..0xC3)
7:5 table switch000 - Hue vs. Hue (14 bits)
001 - Hue vs. Saturation (12 bits)
010 - Lightness vs. Saturation (12 bits)
011 - Saturation vs. Saturation (12 bits)24)
100 - Lightness vs. Lightness (12 bits)
101 - Hue vs. Lightness (12 bits)25)
110-111 - reserved
4:1 pageReserved for a page number in the table, currently is always set to 0
0 access mode the only valid value right now is 0, which is “normal mode”, in which all the subsequent access to the registers in this API block are governed by the values in 0xC0 and 0xC1
1 would be used for “bulk access” where after a read or write access to register 0xC2 the “Index” value will auto-increment by one so that the next pair will access the subsequent table slot
:!: Index LSB0xC1W7:0 index LSB index into a page in the table (we only use 6 bits today and the rest are ignored)
:!: Value L0xC2R/W7:0 LSB 16 bits split into 8 LSB and 8 MSB
- for a “Hue vs. Hue” table the 14 bits signed value is in range [-8192..+8192] which maps linearly into a Hue angle range -180°..+180°
- for a “Hue vs. Saturation” table (as well as for similar tables LvS and SvS) the 12 bit unsigned value in range [0..+1280] maps linearly into a Saturation range [0%..1000%] where 100% is the neutral position and 0% produces a greyscale image
- (until FPGA v.72) for a “Lightness vs. Lightness” table (as well as for similar table HvL) the 12 bit unsigned value in range [0..+4095] maps linearly into a Lightness absolute range [0..255] where 0 is pitch black and 255 is the maximum possible pixel luminosity value
- (starting with FPGA v.73) for a “Lightness vs. Lightness” table (as well as for similar table HvL) the 13 bit signed value in range [-4096..+4095] maps linearly into a Lightness *relative* (adjustment) range [-256..255] where 0 is no adjustment to pixel luminosity value
:!: Value H0xC3R/W7:0 MSB
Reserved0xC4
Reserved0xC5
Reserved0xC6
Reserved0xC7
Reserved0xC8
Reserved0xC9
Reserved0xCA
Reserved0xCB
Reserved0xCC
Reserved0xCD
Reserved0xCE
Reserved0xCF

0xD0-0xE1 - Color Correction Matrix (a.k.a. CCM or CMX)

See Color correction matrix article in this Wiki's ISP section for more details. The 16-bit (MSB-LSB) value is defined as 7+9 bits, where MSB[7:1] are the integer part and MSB[0]LSB[7:0] is the fractional part (effectively that value is 512 times larger than the original fractional part).

Name Offset Access Bit mapping Notes
:!: CCM_000xD0R/W7:0 LSB\(CCM_{00}\)
0xD17:0 MSB
:!: CCM_010xD2R/W7:0 LSB\(CCM_{01}\)
0xD37:0 MSB
:!: CCM_020xD4R/W7:0 LSB\(CCM_{02}\)
0xD57:0 MSB
:!: CCM_100xD6R/W7:0 LSB\(CCM_{10}\)
0xD77:0 MSB
:!: CCM_110xD8R/W7:0 LSB\(CCM_{11}\)
0xD97:0 MSB
:!: CCM_120xDAR/W7:0 LSB\(CCM_{12}\)
0xDB7:0 MSB
:!: CCM_200xDCR/W7:0 LSB\(CCM_{20}\)
0xDD7:0 MSB
:!: CCM_210xDER/W7:0 LSB\(CCM_{21}\)
0xDF7:0 MSB
:!: CCM_220xE0R/W7:0 LSB\(CCM_{22}\)
0xE17:0 MSB

0xE2-0xEF

Name Offset Access Bit mapping Notes
Reserved0xE2
Reserved0xE3
Reserved0xE4
Reserved0xE5
Reserved0xE6
Reserved0xE7
Reserved0xE8
Reserved0xE9
Reserved0xEA
Reserved0xEB
Reserved0xEC
Reserved0xED
Reserved0xEE
Reserved0xEF

0xF0-0xFF

Name Offset Access Bit mapping Notes
Reserved0xF0
Reserved0xF1
Reserved0xF2
Reserved0xF3
Reserved0xF4
Reserved0xF5
Reserved0xF6
Reserved0xF7
Reserved0xF8
Reserved0xF9
Reserved0xFA
Reserved0xFB
Reserved0xFC
Reserved0xFD
Reserved0xFE
Reserved0xFF

FX3 Version Info

The version id is also encoded into the firmware image file name as:

<VendorID>_<HardwareID>_<ProductID>_<ReleaseType>_<BuildNumber>

FX3 version info C/C++-struct

The FX3 version structure is as follows (little-endian memory layout):

firmware-version.h
struct FwVersion{
    unsigned vendorId    : 3;
    unsigned hwCfgId     : 5;
    unsigned productId   : 8;
    unsigned releaseType : 3;
    unsigned buildNo     : 13;
};
static_assert(sizeof(FwVersion) == 4);

Bit layout

The bits are laid out in 4 sequential bytes as follows (depending on the version):

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 7 6 5 4 3 2 1 0
buildNo[12:5] buildNo[4:0] releaseType productId hwCfgId vendorId

Vendor ID

Code Value
1Cypress

Hardware ID

Code Value
1FX3

Product ID

Code Value
1reserved for Gen 1 camera, a.k.a. “Moon landing”
2reserved for Gen 2 camera, a.k.a. “Piggy”
3Gen 3 camera (Alpha), a.k.a. “Frankie” (from Frankenstein's Monster)
4Gen 3 camera, Production
5Gen 4 camera, a.k.a. “Vitreledonella”
6Gen 5 camera, either “Square One” or “Studio”

Release type

Code Name Meaning
0Private build Private build for debugging and similar purposes
1Alpha feature-incomplete early development cycle “somewhat stable” build
2Beta feature-complete, but not very stable build (lots of bugs)
3Evaluation Tech preview
4Release candidate feature complete and stable
5Release general availability
6Backport backport of a feature from next gen camera
7Emergency bug fix a critical post-release bugfix

Build number

Code Value
#Increments on each build

FPGA Version Info

The version id is also encoded into the firmware image file name as:

<VendorID>_<HardwareID>_<ProductID>_<ReleaseType>_<BuildNumber>

Vendor ID

A 3-bit number that represents a vendor of the main computation unit

Code Value
1Xilinx (AMD)
2Altera (Intel)

Hardware ID

A 5-bit number that represents a model from the list in the following table:

VendorIdCode Value
11Artix-7 100T
2Artix-7 200T
3Artix UltraScale+ XCAU25P
21Cyclone 10 GX

Product ID

An 8-bit number, unique to each product type from the table below:

Code Value
1reserved
2reserved
3Gen 3 camera (Alpha), a.k.a. “Frankie”
4Gen 3 camera, Production
5Gen 4 camera, a.k.a. “Vitreledonella”
6Gen 5 camera, prosumer grade “Square One”
7Gen 5 camera, professional grade “Studio”

Release type

Lower 3 bits of this 5-bit value map to a type of build below, the upper 2 bits are reserved for future use and must be b00

Code Value
0Private build
1Alpha
2Beta
3Eval/Tech preview
4Release candidate
5Release
6Backport
7Emergency bug fix

Build number

11 bits of a build number (the range is 1..2047)

Code Value
#Increments on each build
1) , 2) , 24) , 25)
scheduled for later
3)
ordering is UYV
4)
macropixel byte ordering: Y0U0Y1V0
5)
chroma plane is a interleaved set of U/V samples
6) , 10) , 12) , 14) , 18) , 20) , 22)
need to register with MS
7)
not 10
8)
includes 2 bit alpha at [31:30]
9)
not 12
11)
or 36?
13)
or 24?
15)
or 24, or 18?
16)
yes, 16, not 14
17)
not 14
19)
or 42?
21)
or 28?
23)
or 21?

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information