PDK API Guide for AM65xx
csl_dssTop.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2018
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 
66 #ifndef CSL_DSSTOP_H_
67 #define CSL_DSSTOP_H_
68 
69 /* ========================================================================== */
70 /* Include Files */
71 /* ========================================================================== */
72 
73 #include <ti/csl/soc.h>
75 #include <ti/csl/cslr_dss.h>
76 
77 #ifdef __cplusplus
78 extern "C" {
79 #endif
80 
81 /* ========================================================================== */
82 /* Macros & Typedefs */
83 /* ========================================================================== */
84 
93 #define CSL_DSS_VID_PIPE_TYPE_VID ((uint32_t) 0x0)
94 
95 #define CSL_DSS_VID_PIPE_TYPE_VIDL ((uint32_t) 0x1)
96 /* @} */
97 
106 #define CSL_DSS_COMM_REG_ID_0 ((uint32_t) 0x0U)
107 
108 #define CSL_DSS_COMM_REG_ID_1 ((uint32_t) 0x1U)
109 
110 #define CSL_DSS_COMM_REG_ID_MAX ((uint32_t) 0x2U)
111 /* @} */
112 
121 #define CSL_DSS_VID_PIPE_ID_VID1 ((uint32_t) 0x0U)
122 
123 #define CSL_DSS_VID_PIPE_ID_VIDL1 ((uint32_t) 0x1U)
124 
125 #define CSL_DSS_VID_PIPE_ID_MAX ((uint32_t) 0x2U)
126 /* @} */
127 
136 #define CSL_DSS_OVERLAY_ID_1 ((uint32_t) 0x0U)
137 
138 #define CSL_DSS_OVERLAY_ID_2 ((uint32_t) 0x1U)
139 
140 #define CSL_DSS_OVERLAY_ID_MAX ((uint32_t) 0x2U)
141 /* @} */
142 
151 #define CSL_DSS_VP_ID_1 ((uint32_t) 0x0U)
152 
153 #define CSL_DSS_VP_ID_2 ((uint32_t) 0x1U)
154 
155 #define CSL_DSS_VP_ID_MAX ((uint32_t) 0x2U)
156 /* @} */
157 
166 #define CSL_DSS_VP_ID_1_MASK ((uint32_t) 0x1U)
167 
168 #define CSL_DSS_VP_ID_2_MASK ((uint32_t) 0x2U)
169 /* @} */
170 
179 #define CSL_DSS_CSC_RANGE_LIMITED ((uint32_t) 0x0U)
180 
181 #define CSL_DSS_CSC_RANGE_FULL ((uint32_t) 0x1U)
182 /* @} */
183 
192 #define CSL_DSS_SAFETY_CHK_FRAME_FREEZE_DETECT \
193  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_CAPTUREMODE_VAL_FRAMEFREEZE)
194 
195 #define CSL_DSS_SAFETY_CHK_DATA_INTEGRITY \
196  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_CAPTUREMODE_VAL_DATACHECK)
197 /* @} */
198 
207 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_NO \
208  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_DISABLE)
209 
210 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_EVEN \
211  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_EVEN)
212 
213 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_ODD \
214  ((uint32_t) CSL_DSS_VID_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_ODD)
215 /* @} */
216 
218 #define CSL_DSS_NUM_LUT_ENTRIES ((uint32_t) 256U)
219 
221 #define CSL_DSS_MODULE_INVALID ((uint32_t) 0xFFU)
222 
223 /* ========================================================================== */
224 /* Structure Declarations */
225 /* ========================================================================== */
226 
230 typedef struct
231 {
232  uint32_t cscRange;
235  int32_t c00;
237  int32_t c01;
239  int32_t c02;
241  int32_t c10;
243  int32_t c11;
245  int32_t c12;
247  int32_t c20;
249  int32_t c21;
251  int32_t c22;
253  int32_t preOffset1;
255  int32_t preOffset2;
257  int32_t preOffset3;
259  int32_t postOffset1;
261  int32_t postOffset2;
263  int32_t postOffset3;
266 
270 typedef struct
271 {
272  uint32_t safetyChkEnable;
276  uint32_t safetyChkMode;
283  uint32_t thresholdValue;
287  uint32_t frameSkip;
313 
314 /* ========================================================================== */
315 /* Function Declarations */
316 /* ========================================================================== */
317 
318 /* None */
319 
320 /* ========================================================================== */
321 /* Static Function Declarations */
322 /* ========================================================================== */
323 
331 static inline void CSL_dssCscCoeffInit(
332  CSL_DssCscCoeff *cscCoeff);
333 
341 static inline void CSL_dssSafetyChkCfgInit(
342  CSL_DssSafetyChkCfg *safetyCfg);
343 
344 /* ========================================================================== */
345 /* Static Function Definitions */
346 /* ========================================================================== */
347 
348 static inline void CSL_dssCscCoeffInit(
349  CSL_DssCscCoeff *cscCoeff)
350 {
351  if(NULL != cscCoeff)
352  {
354  cscCoeff->c00 = 0;
355  cscCoeff->c01 = 0;
356  cscCoeff->c02 = 0;
357  cscCoeff->c10 = 0;
358  cscCoeff->c11 = 0;
359  cscCoeff->c12 = 0;
360  cscCoeff->c20 = 0;
361  cscCoeff->c21 = 0;
362  cscCoeff->c22 = 0;
363  cscCoeff->preOffset1 = 0;
364  cscCoeff->preOffset2 = 0;
365  cscCoeff->preOffset3 = 0;
366  cscCoeff->postOffset1 = 0;
367  cscCoeff->postOffset2 = 0;
368  cscCoeff->postOffset3 = 0;
369  }
370 }
371 
372 static inline void CSL_dssSafetyChkCfgInit(
373  CSL_DssSafetyChkCfg *safetyCfg)
374 {
375  if(NULL != safetyCfg)
376  {
377  safetyCfg->safetyChkEnable = FALSE;
379  safetyCfg->seedSelectEnable = 0U;
380  safetyCfg->thresholdValue = FALSE;
382  safetyCfg->regionPos.startX = 0U;
383  safetyCfg->regionPos.startY = 0U;
384  safetyCfg->regionSize.width = 0U;
385  safetyCfg->regionSize.height = 0U;
386  }
387 }
388 
389 #ifdef __cplusplus
390 }
391 #endif
392 
393 #endif /* #ifndef CSL_DSSTOP_H_ */
394 
395 /* @} */
int32_t preOffset1
Definition: csl_dssTop.h:253
#define CSL_DSS_SAFETY_CHK_FRAME_FREEZE_DETECT
Frame freeze detect enabled.
Definition: csl_dssTop.h:192
Fvid2_SizeConfig regionSize
Definition: csl_dssTop.h:301
Structure containing size configuration.
Definition: csl_fvid2_dataTypes.h:1351
Structure containing position configuration - used in VCOMP and CIG.
Definition: csl_fvid2_dataTypes.h:1339
int32_t c21
Definition: csl_dssTop.h:249
UInt32 height
Definition: csl_fvid2_dataTypes.h:1355
uint32_t seedSelectEnable
Definition: csl_dssTop.h:279
#define FALSE
Definition: csl_types.h:55
int32_t postOffset2
Definition: csl_dssTop.h:261
int32_t c22
Definition: csl_dssTop.h:251
static void CSL_dssSafetyChkCfgInit(CSL_DssSafetyChkCfg *safetyCfg)
CSL_DssSafetyChkCfg structure init function.
Definition: csl_dssTop.h:372
uint32_t frameSkip
Definition: csl_dssTop.h:287
int32_t c12
Definition: csl_dssTop.h:245
int32_t postOffset1
Definition: csl_dssTop.h:259
int32_t preOffset3
Definition: csl_dssTop.h:257
int32_t preOffset2
Definition: csl_dssTop.h:255
int32_t c10
Definition: csl_dssTop.h:241
uint32_t startY
Definition: csl_fvid2_dataTypes.h:1343
uint32_t safetyChkEnable
Definition: csl_dssTop.h:272
int32_t c00
Definition: csl_dssTop.h:235
CSL FVID2 Datatypes.
#define CSL_DSS_SAFETY_CHK_FRAME_SKIP_NO
No frames are skipped.
Definition: csl_dssTop.h:207
uint32_t startX
Definition: csl_fvid2_dataTypes.h:1341
uint32_t safetyChkMode
Definition: csl_dssTop.h:276
int32_t postOffset3
Definition: csl_dssTop.h:263
#define NULL
Define NULL if not defined.
Definition: csl_types.h:107
static void CSL_dssCscCoeffInit(CSL_DssCscCoeff *cscCoeff)
CSL_DssCscCoeff structure init function.
Definition: csl_dssTop.h:348
int32_t c01
Definition: csl_dssTop.h:237
Fvid2_PosConfig regionPos
Definition: csl_dssTop.h:290
Structure containing coefficients for Color Space Conversion.
Definition: csl_dssTop.h:230
uint32_t cscRange
Definition: csl_dssTop.h:232
UInt32 width
Definition: csl_fvid2_dataTypes.h:1353
uint32_t thresholdValue
Definition: csl_dssTop.h:283
#define CSL_DSS_CSC_RANGE_LIMITED
Limited range selected.
Definition: csl_dssTop.h:179
Configuration for doing safety checks.
Definition: csl_dssTop.h:270
int32_t c02
Definition: csl_dssTop.h:239
int32_t c20
Definition: csl_dssTop.h:247
int32_t c11
Definition: csl_dssTop.h:243