User Tools

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 control0x06R/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 on-board fan (FPGA-72+) 1 turns the on-board fan on, 0 turns it off
5 RAW ModeSetting bit 5 and clearing bit 0x06::2 will enable RAW mode output (4K Only)
4 Video FormatBit 4 selects between NV12 ('1') and YUY2 ('0') output formats
3 DPC enableSetting bit 3 along with bit 0x06::0 will perform a DPC correction
2 HSUB enableBit 2 is to enable/disable Horizontal Subsampling Deprecated
1 Audio enableBit 1 is to enable/disable on-board microphones
0 Video enableBit 0 enables/disables video streaming
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_RED_L0x08R/W7:0 Red LEDLSB of LED's red intensity in range [0..255]
LED_RED_H0x09R/WReserved
LED_GREEN_L0x0AR/W7:0 Green LEDLSB of LED's green intensity in range [0..255]
LED_GREEN_H0x0BR/WReserved
LED_BLUE_L0x0CR/W7:0 Blue LEDLSB of LED's blue intensity in range [0..255]
LED_BLUE_H0x0DR/WReserved

0x0E-0x0F - Noise Reduction

Name Offset Access Bit mapping Notes
Chroma NR Control0x0ER/W7 Reserved, must be 0
6:0 value
Chroma (color or an \(H\) component of the \(H/S/L\) pixel data) noise reduction in range \([0\%..100\%]\) mapped into \([0..127]\). Setting this to 0 effectively turns the chroma denoising off
Luma NR Control0x0FR/W7 Reserved, must be 0
6:0 value
Luma (brightness or an \(L\) component of the \(H/S/L\) pixel data) noise reduction in range \([0\%..100\%]\) mapped into \([0..127]\). Setting this to 0 effectively turns the luma denoising off

0x10-0x1F - Basic UVC controls

Name Offset Access Bit mapping Notes
Brightness_L0x10R/W7:0 LSB16 bits of brightness are split into 8 bits of LSB and MSB
Brightness_H0x11R/W7:0 MSB
Contrast_L0x12R/W7:0 LSB16 bits of contrast are split into 8 bits of LSB and MSB
Contrast_H0x13R/W7:0 MSB
Saturation_L0x14R/W7:0 LSB16 bits of saturation are split into 8 bits of LSB and MSB
Saturation_H0x15R/W7:0 MSB
Sharpness_L0x16R/W7:0 LSB16 bits of sharpness are split into 8 bits of LSB and MSB
Sharpness_H0x17R/W7:0 MSB
Gamma_L0x18R/W7:0 LSB16 bits of gamma are split into 8 bits of LSB and MSB
Gamma_H0x19R/W7:0 MSB
Hue_L0x1AR/W7:0 LSB16 bits of hue are split into 8 bits of LSB and MSB
Hue_H0x1BR/W7:0 MSB
Reserved0x1C
Reserved0x1D
Reserved0x1E
Reserved0x1F

0x20-0x27 - Defective pixel cancellation

Name Offset Access Bit mapping Notes
DPC Threshold LSB0x20R/W7:0 LSB 16 bit of DPC Threshold are split into 8 bits of LSB and MSB
DPC Threshold MSB0x21R/W7:0 MSB
DPC count LSB0x22R/O7:0 LSBOnce the DPC calibration is done the 16-bit value is stored in these 2 registers
DPC count MSB0x23R/O7:0 MSB
Grey threshold0x24R/W 7:0 If the full range of incoming \(R,G,B\) triplet is up to that number (inclusive), force both the \(H\) and \(S\) to be 0
Reserved0x25
Reserved0x26
Reserved0x27

0x28-0x3F - General image statistics

Name Offset Access Bit mapping Notes
Y average0x28R/O7:0 value
flags0x29R/O7:0 valueflags for OverExposure and SFP+ cage device. The following bits are currently defined:
7:3 - reserved
2 - set to 1 if there is an active device in SFP+ cage FIXME1)
1 - indicates whether a red overexposure is detected
0 - set if there is a general overexposure detected
FPS_L0x2BR/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
FPS_H0x2CR/O7:0 MSB
Reserved0x2D
AWB Y limit0x2ER/W7:0 valueLower bound brightness threshold for pixels to qualify for AWB statistic counter, default value 100
AWB S limit0x2FR/W7:0 valueUpper bound saturation threshold for pixels to qualify for AWB statistic counter, default value 10
Reserved0x30
AWB Red total counter0x33-0x31R/O24-bit value0x33 is MSB, 0x31 is LSB
Reserved0x34
AWB Green total counter0x37-0x35R/O24-bit value0x37 is MSB, 0x35 is LSB
Reserved0x38
AWB Blue total counter0x3B-0x39R/O24-bit value0x39 is MSB, 0x3B is LSB
AWB total pixel counter0x3F-0x3CR/O32-bit value0x3F is MSB, 0x3C is LSB

0x40-0x45 - AWB adjustments

Name Offset Access Bit mapping Notes
AWB Red adjustment0x40R/W7:0 - valuea signed 8-bit value of an adjustment to apply to every pixel in Red channel. Default is 0
reserved0x41
AWB Green adjustment0x42R/W7:0 - valuea signed 8-bit value of an adjustment to apply to every pixel in Green channel. Default is 0
reserved0x43
AWB Blue adjustment0x44R/W7:0 - valuea signed 8-bit value of an adjustment to apply to every pixel in Blue channel. Default is 0
reserved0x45

0x46-0x4F - Media setup

Name Offset Access Bit mapping Notes
Media output modules0x46R/W7 - res
6 - res (headphones)
5 - res (UAC)
4 - res
3 - res
2 - SDI video
1 - SFP+ video
0 - UVC
Enable/disable state of individual media output modules for video and audio streams
Video transform blocks0x47R/W7 - res (sharpness)
6 - res
5 - res
4 - res
3 - res
2 - HSL pipeline
1 - CCM
0 - res (UVC Gamma)
Enable/disable individual transformation blocks in video pipeline
Video output format0x48R/W7:4 - UVC
3:0 - SDI FPS
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/W7:6 - res
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
MIPI configuration0x4AR/W7:4 - res
3:2 - de-mosaicing strategy
1:0 - MIPI bit depth
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
MIPI bit depth controls the data packing format for the pixels coming through MIPI interface. MIPI bit depth \(d_p\) is calculated from a 2-bit value \(N\) as: \[d_p = (N+4)*2\]
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:42)) 3 (packed YUV 4:2:23)) 7 (planar YUV 4:2:04))
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) Y105) (16bpp6))BI_BITFIELDS (48bpp) Y410 (32bpp7)) Y210 (32bpp)
YUVP?/Y42T (24bpp?)
P010 (32bpp)
2 (12 bit) BYR2 (16pbb8))BI_BITFIELDS (48bpp) Y4129) (40bpp10)) Y21211) (32bpp12)) P01213) (32bpp14))
3 (14 bit) Y1615) (16bpp16))BI_BITFIELDS (48bpp) Y41417) (48bpp18)) Y21419) (32bpp20)) P01421) (32bpp22))

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 hue LSB0x86R/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°]
CK hue MSB0x87R/W7:6 reserved
5:0 hue MSB
CK tolerance LSB0x88R/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
CK tolerance MSB0x89R/W7:5 reserved
4:0 tolerance MSB
CK red LSB0x8AR/W7:0 red LSB
CK red MSB0x8BR/Wreserved
CK green LSB0x8CR/W7:0 green LSB
CK green MSB0x8DR/Wreserved
CK blue LSB0x8ER/W7:0 blue LSB
CK blue MSB0x8FR/Wreserved

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)23)
100 - Lightness vs. Lightness (12 bits)
101 - Hue vs. Lightness (12 bits)24)
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-0xCF

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_00_L0xD0R/W7:0 LSB\(CCM_{00}\)
CCM_00_H0xD1R/W7:0 MSB
CCM_01_L0xD2R/W7:0 LSB\(CCM_{01}\)
CCM_01_H0xD3R/W7:0 MSB
CCM_02_L0xD4R/W7:0 LSB\(CCM_{02}\)
CCM_02_H0xD5R/W7:0 MSB
CCM_10_L0xD6R/W7:0 LSB\(CCM_{10}\)
CCM_10_H0xD7R/W7:0 MSB
CCM_11_L0xD8R/W7:0 LSB\(CCM_{11}\)
CCM_11_H0xD9R/W7:0 MSB
CCM_12_L0xDAR/W7:0 LSB\(CCM_{12}\)
CCM_12_H0xDBR/W7:0 MSB
CCM_20_L0xDCR/W7:0 LSB\(CCM_{20}\)
CCM_20_H0xDDR/W7:0 MSB
CCM_21_L0xDER/W7:0 LSB\(CCM_{21}\)
CCM_21_H0xDFR/W7:0 MSB
CCM_22_L0xE0R/W7:0 LSB\(CCM_{22}\)
CCM_22_H0xE1R/W7: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
1)
move out of here into a separate register, dedicated to peripherals
2)
ordering is UYV
3)
macropixel byte ordering: Y0U0Y1V0
4)
chroma plane is a interleaved set of U/V samples
5) , 9) , 11) , 13) , 17) , 19) , 21)
need to register with MS
6)
not 10
7)
includes 2 bit alpha at [31:30]
8)
not 12
10)
or 36?
12)
or 24?
14)
or 24, or 18?
15)
yes, 16, not 14
16)
not 14
18)
or 42?
20)
or 28?
22)
or 21?
23) , 24)
scheduled for later

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