AM62x MCU+ SDK  10.01.00
csl_dssTop.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2023
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * Neither the name of Texas Instruments Incorporated nor the names of
18  * its contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
52 #ifndef CSL_DSSTOP_H_
53 #define CSL_DSSTOP_H_
54 
55 /* ========================================================================== */
56 /* Include Files */
57 /* ========================================================================== */
58 
60 #include <drivers/fvid2.h>
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 /* ========================================================================== */
67 /* Macros & Typedefs */
68 /* ========================================================================== */
69 
78 #define CSL_DSS_VID_PIPE_TYPE_VID ((uint32_t) 0x0)
79 
80 #define CSL_DSS_VID_PIPE_TYPE_VIDL ((uint32_t) 0x1)
81 
91 #define CSL_DSS_COMM_REG_ID_0 ((uint32_t) 0x0U)
92 
93 #define CSL_DSS_COMM_REG_ID_1 ((uint32_t) 0x1U)
94 
95 #define CSL_DSS_COMM_REG_ID_MAX ((uint32_t) 0x2U)
96 
106 #define CSL_DSS_VID_PIPE_ID_VID1 ((uint32_t) 0x0U)
107 
108 #define CSL_DSS_VID_PIPE_ID_VIDL1 ((uint32_t) 0x1U)
109 
110 #define CSL_DSS_VID_PIPE_ID_MAX ((uint32_t) 0x2U)
111 
112 #define CSL_DSS_VID_PIPE_ID_INVALID ((uint32_t) 0xFFU)
113 
123 #define CSL_DSS_OVERLAY_ID_1 ((uint32_t) 0x0U)
124 
125 #define CSL_DSS_OVERLAY_ID_2 ((uint32_t) 0x1U)
126 
127 #define CSL_DSS_OVERLAY_ID_MAX ((uint32_t) 0x2U)
128 
138 #define CSL_DSS_VP_ID_1 ((uint32_t) 0x0U)
139 
140 #define CSL_DSS_VP_ID_2 ((uint32_t) 0x1U)
141 
142 #define CSL_DSS_VP_ID_MAX ((uint32_t) 0x2U)
143 
153 #define CSL_DSS_VP_ID_1_MASK ((uint32_t) 0x1U)
154 
155 #define CSL_DSS_VP_ID_2_MASK ((uint32_t) 0x2U)
156 
166 #define CSL_DSS_CSC_RANGE_LIMITED ((uint32_t) 0x0U)
167 
168 #define CSL_DSS_CSC_RANGE_FULL ((uint32_t) 0x1U)
169 
170 #define CSL_DSS_CSC_RANGE_CUSTOM ((uint32_t) 0x2U)
171 
181 #define CSL_DSS_SAFETY_CHK_FRAME_FREEZE_DETECT \
182  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_CAPTUREMODE_VAL_FRAMEFREEZE)
183 
184 #define CSL_DSS_SAFETY_CHK_DATA_INTEGRITY \
185  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_CAPTUREMODE_VAL_DATACHECK)
186 
196 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_NO \
197  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_DISABLE)
198 
199 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_EVEN \
200  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_EVEN)
201 
202 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_ODD \
203  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_ODD)
204 
207 #define CSL_DSS_NUM_LUT_ENTRIES ((uint32_t) 256U)
208 
210 #define CSL_DSS_MODULE_INVALID ((uint32_t) 0xFFU)
211 
212 /* ========================================================================== */
213 /* Structure Declarations */
214 /* ========================================================================== */
215 
219 typedef struct
220 {
221  uint32_t cscRange;
224  int32_t c00;
226  int32_t c01;
228  int32_t c02;
230  int32_t c10;
232  int32_t c11;
234  int32_t c12;
236  int32_t c20;
238  int32_t c21;
240  int32_t c22;
242  int32_t preOffset1;
244  int32_t preOffset2;
246  int32_t preOffset3;
248  int32_t postOffset1;
250  int32_t postOffset2;
252  int32_t postOffset3;
255 
259 typedef struct
260 {
261  uint32_t safetyChkEnable;
265  uint32_t safetyChkMode;
272  uint32_t thresholdValue;
276  uint32_t frameSkip;
302 
303 /* ========================================================================== */
304 /* Function Declarations */
305 /* ========================================================================== */
306 
307 /* None */
308 
309 /* ========================================================================== */
310 /* Static Function Declarations */
311 /* ========================================================================== */
312 
319 static inline void CSL_dssCscCoeffInit(
320  CSL_DssCscCoeff *cscCoeff);
321 
328 static inline void CSL_dssSafetyChkCfgInit(
329  CSL_DssSafetyChkCfg *safetyCfg);
330 
331 /* ========================================================================== */
332 /* Static Function Definitions */
333 /* ========================================================================== */
334 
335 static inline void CSL_dssCscCoeffInit(
336  CSL_DssCscCoeff *cscCoeff)
337 {
338  if(NULL != cscCoeff)
339  {
341  cscCoeff->c00 = 0;
342  cscCoeff->c01 = 0;
343  cscCoeff->c02 = 0;
344  cscCoeff->c10 = 0;
345  cscCoeff->c11 = 0;
346  cscCoeff->c12 = 0;
347  cscCoeff->c20 = 0;
348  cscCoeff->c21 = 0;
349  cscCoeff->c22 = 0;
350  cscCoeff->preOffset1 = 0;
351  cscCoeff->preOffset2 = 0;
352  cscCoeff->preOffset3 = 0;
353  cscCoeff->postOffset1 = 0;
354  cscCoeff->postOffset2 = 0;
355  cscCoeff->postOffset3 = 0;
356  }
357 }
358 
359 static inline void CSL_dssSafetyChkCfgInit(
360  CSL_DssSafetyChkCfg *safetyCfg)
361 {
362  if(NULL != safetyCfg)
363  {
364  safetyCfg->safetyChkEnable = FALSE;
366  safetyCfg->seedSelectEnable = 0U;
367  safetyCfg->thresholdValue = FALSE;
369  safetyCfg->regionPos.startX = 0U;
370  safetyCfg->regionPos.startY = 0U;
371  safetyCfg->regionSize.width = 0U;
372  safetyCfg->regionSize.height = 0U;
373  }
374 }
375 
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #endif /* #ifndef CSL_DSSTOP_H_ */
381 
CSL_DssSafetyChkCfg
Configuration for doing safety checks.
Definition: csl_dssTop.h:260
CSL_DssCscCoeff::postOffset1
int32_t postOffset1
Definition: csl_dssTop.h:248
Fvid2_PosConfig::startY
uint32_t startY
Definition: fvid2_dataTypes.h:1386
CSL_DssCscCoeff::c02
int32_t c02
Definition: csl_dssTop.h:228
CSL_DssCscCoeff::c11
int32_t c11
Definition: csl_dssTop.h:232
CSL_dssSafetyChkCfgInit
static void CSL_dssSafetyChkCfgInit(CSL_DssSafetyChkCfg *safetyCfg)
CSL_DssSafetyChkCfg structure init function.
Definition: csl_dssTop.h:359
CSL_DssCscCoeff::preOffset3
int32_t preOffset3
Definition: csl_dssTop.h:246
CSL_DssSafetyChkCfg::safetyChkEnable
uint32_t safetyChkEnable
Definition: csl_dssTop.h:261
CSL_DssCscCoeff::preOffset2
int32_t preOffset2
Definition: csl_dssTop.h:244
CSL_DssCscCoeff::c21
int32_t c21
Definition: csl_dssTop.h:238
CSL_DssCscCoeff::postOffset2
int32_t postOffset2
Definition: csl_dssTop.h:250
CSL_DssCscCoeff::preOffset1
int32_t preOffset1
Definition: csl_dssTop.h:242
Fvid2_PosConfig::startX
uint32_t startX
Definition: fvid2_dataTypes.h:1384
CSL_DssCscCoeff
Structure containing coefficients for Color Space Conversion.
Definition: csl_dssTop.h:220
CSL_DssSafetyChkCfg::seedSelectEnable
uint32_t seedSelectEnable
Definition: csl_dssTop.h:268
cslr_dss.h
NULL
#define NULL
Define NULL if not defined.
Definition: csl_types.h:100
fvid2.h
Fvid2_SizeConfig
Structure containing size configuration.
Definition: fvid2_dataTypes.h:1395
CSL_DssSafetyChkCfg::frameSkip
uint32_t frameSkip
Definition: csl_dssTop.h:276
Fvid2_PosConfig
Structure containing position configuration - used in VCOMP and CIG.
Definition: fvid2_dataTypes.h:1383
CSL_DssCscCoeff::c22
int32_t c22
Definition: csl_dssTop.h:240
CSL_DssSafetyChkCfg::thresholdValue
uint32_t thresholdValue
Definition: csl_dssTop.h:272
CSL_DssCscCoeff::c10
int32_t c10
Definition: csl_dssTop.h:230
CSL_dssCscCoeffInit
static void CSL_dssCscCoeffInit(CSL_DssCscCoeff *cscCoeff)
CSL_DssCscCoeff structure init function.
Definition: csl_dssTop.h:335
CSL_DssCscCoeff::cscRange
uint32_t cscRange
Definition: csl_dssTop.h:221
Fvid2_SizeConfig::width
UInt32 width
Definition: fvid2_dataTypes.h:1396
Fvid2_SizeConfig::height
UInt32 height
Definition: fvid2_dataTypes.h:1398
CSL_DssSafetyChkCfg::regionPos
Fvid2_PosConfig regionPos
Definition: csl_dssTop.h:279
CSL_DssCscCoeff::c00
int32_t c00
Definition: csl_dssTop.h:224
CSL_DssCscCoeff::postOffset3
int32_t postOffset3
Definition: csl_dssTop.h:252
CSL_DSS_SAFETY_CHK_FRAME_SKIP_NO
#define CSL_DSS_SAFETY_CHK_FRAME_SKIP_NO
No frames are skipped.
Definition: csl_dssTop.h:196
CSL_DssCscCoeff::c01
int32_t c01
Definition: csl_dssTop.h:226
CSL_DSS_CSC_RANGE_LIMITED
#define CSL_DSS_CSC_RANGE_LIMITED
Limited range selected.
Definition: csl_dssTop.h:166
CSL_DssSafetyChkCfg::safetyChkMode
uint32_t safetyChkMode
Definition: csl_dssTop.h:265
CSL_DSS_SAFETY_CHK_FRAME_FREEZE_DETECT
#define CSL_DSS_SAFETY_CHK_FRAME_FREEZE_DETECT
Frame freeze detect enabled.
Definition: csl_dssTop.h:181
CSL_DssCscCoeff::c20
int32_t c20
Definition: csl_dssTop.h:236
CSL_DssSafetyChkCfg::regionSize
Fvid2_SizeConfig regionSize
Definition: csl_dssTop.h:290
FALSE
#define FALSE
Definition: csl_types.h:62
CSL_DssCscCoeff::c12
int32_t c12
Definition: csl_dssTop.h:234