| Next revision | Previous revision |
| code:cachedglobalstatus_v0x01 [2021/05/16 16:12] – created Igor Yefmov | code:cachedglobalstatus_v0x01 [2022/04/04 23:32] (current) – external edit 127.0.0.1 |
|---|
| typedef struct UvcSelectedMode{ | typedef struct UvcSelectedMode{ |
| float fps; | float fps; |
| UvcFrameGeom geometry: 2; | UvcFrameGeom geometry: 2; // just an enum |
| UvcFrameFmt format: 2; | UvcFrameFmt format: 2; // just an enum |
| uint8_t reserved: 4; | uint8_t reserved: 4; |
| } UvcMode; | } UvcMode; |
| uint8_t bm; | uint8_t bm; |
| struct{ | struct{ |
| CyBool_t video_en : 1; | uint8_t video_en : 1; |
| CyBool_t audio_en : 1; | uint8_t audio_en : 1; |
| CyBool_t hsub_en : 1; | uint8_t hsub_en : 1; |
| CyBool_t dpc_en : 1; | uint8_t dpc_en : 1; |
| CyBool_t fmt_select : 1; // 0 - YUY2, 1 - NV12 | uint8_t fmt_select : 1; // 0 - YUY2, 1 - NV12 |
| CyBool_t video_raw : 1; | uint8_t video_raw : 1; |
| CyBool_t fan_en : 1; | uint8_t fan_en : 1; |
| CyBool_t cfg_en : 1; | uint8_t cfg_en : 1; |
| }; | }; |
| } FpgaCtrlReg; | } FpgaCtrlReg; |
| uint16_t fpga_build; | uint16_t fpga_build; |
| FpgaCtrlReg fpga_ctrl; // FX3 controls the state of this FPGA register so makes sense to cache it here for faster read access | FpgaCtrlReg fpga_ctrl; // FX3 controls the state of this FPGA register so makes sense to cache it here for faster read access |
| CyBool_t gpif_initialized :1; // whether the GPIF init function has been called | uint8_t gpif_initialized :1; // whether the GPIF init function has been called |
| CyBool_t fpga_cfg_ready :1; // true if FPGA Configuration DMA has been configured | uint8_t fpga_cfg_ready :1; // true if FPGA Configuration DMA has been configured |
| CyBool_t force_fan_on_aux_pwr :1; // automatically turn the fan on if running on AUX power | uint8_t force_fan_on_aux_pwr :1; // automatically turn the fan on if running on AUX power |
| CyBool_t uvc_streaming_started :1; // whether USB host has started streaming video | uint8_t uvc_streaming_started :1; // whether USB host has started streaming video |
| CyBool_t uac_streaming_started :1; // whether USB host has started streaming audio | uint8_t uac_streaming_started :1; // whether USB host has started streaming audio |
| uint8_t sfp_present :1; // `1` if there's a device present in SFP+ cage | uint8_t sfp_present :1; // `1` if there's a device present in SFP+ cage |
| UvcMode uvc_mode; | UvcMode uvc_mode; |
| uint8_t sensor_tgt_y_avg; | uint8_t sensor_tgt_y_avg; |
| PUInt16 sensor_tgt_gain_g; | uint16_t sensor_tgt_gain_g; |
| int16_t sensor_gain_r; | int16_t sensor_gain_r; |
| int16_t sensor_gain_b; | int16_t sensor_gain_b; |
| PInt16 fpga_gain_r; | int16_t fpga_gain_r; |
| PInt16 fpga_gain_b; | int16_t fpga_gain_b; |
| uint32_t awb_oe_trig_count; // FPGA reported a red overexposure event during AWB stats' accumulation | uint32_t awb_oe_trig_count; // FPGA reported a red overexposure event during AWB stats' accumulation |
| uint16_t last_usb_log_idx; // for drainig the logs out | uint16_t last_usb_log_idx; // for drainig the logs out |
| // background scheduler is based off of the CyU3PThreadSleep(interval_main_step) in the main loop which non-blockingly waits before running tasks | // background scheduler is based off of the CyU3PThreadSleep(interval_main_step) in the main loop which non-blockingly waits before running tasks |
| PUInt16 bg_main_step; // minimal polling interval for BG tasks | uint16_t bg_main_step; // minimal polling interval for BG tasks |
| struct{ | struct{ |
| PUInt16 color_grading // push Color Grading tables from cache to FPGA | uint16_t color_grading // push Color Grading tables from cache to FPGA |
| , autoexp // AE update interval | , autoexp // AE |
| , awb // AWB update interval | , awb // AWB |
| , sfp // SFP+ cage's PnP | , sfp // SFP+ cage's PnP |
| , log // send accumulated logs from gl_UsbLogBuffer using CyU3PDebugPrint() | , log // send accumulated logs from gl_UsbLogBuffer using CyU3PDebugPrint() |
| , health // check for internal errors and report via CyU3PDebugPrint() | , health // check for internal errors and report via CyU3PDebugPrint() |
| , aux_pwr; // use power more liberaly when running on AUX | , aux_pwr; // use power more liberally when running on AUX |
| } bg_interval // frequency of running a background task (the shorter the interval - the higher the frequency) | } bg_interval // frequency of running a background task (the shorter the interval - the higher the frequency) |
| , bg_clock // bg task's timer counter | , bg_clock // bg task's timer counter |