PDK API Guide for J721E
csitx.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2020
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 
43 /* @} */
44 
91 #ifndef CSITX_H_
92 #define CSITX_H_
93 
94 /* ========================================================================== */
95 /* Include Files */
96 /* ========================================================================== */
97 #include <ti/csl/csl_csitx.h>
98 #include <ti/drv/fvid2/fvid2.h>
100 #include <ti/drv/csitx/soc/csitx_soc.h>
102 #include <ti/drv/udma/udma.h>
103 
104 #ifdef __cplusplus
105 extern "C" {
106 #endif
107 
108 /* ========================================================================== */
109 /* Macros & Typedefs */
110 /* ========================================================================== */
111 
113 #define CSITX_TX_DRV_ID (FVID2_CSITX_DRV_BASE + 0x00000000U)
114 
115 /* transmit IOCTL's */
131 #define IOCTL_CSITX_GET_INST_STATUS (FVID2_CSITX_DRV_IOCTL_BASE + 0x0000U)
132 
146 #define IOCTL_CSITX_PRINT_DEBUG_LOGS (FVID2_CSITX_DRV_IOCTL_BASE + 0x0100U)
147 /* @} */
148 
158 #define CSITX_CH_TYPE_TX ((uint32_t) 0x0U)
159 
161 #define CSITX_CH_TYPE_COLORBAR ((uint32_t) 0x1U)
162 
164 #define CSITX_CH_TYPE_LPBK ((uint32_t) 0x2U)
165 /* @} */
166 
168 #define CSITX_BUF_ALIGNMENT (UDMA_CACHELINE_ALIGNMENT)
169 
170 /* ========================================================================== */
171 /* Structure Declarations */
172 /* ========================================================================== */
176 typedef struct
177 {
178  uint32_t chId;
182  uint32_t chType;
185  uint32_t vcNum;
189  uint32_t outCsiDataType;
230  uint32_t vBlank;
232  uint32_t hBlank;
240  uint8_t ringOrderId;
243 } Csitx_ChCfg;
244 
248 typedef struct
249 {
250  uint32_t rxCompEnable;
255  uint32_t rxv1p3MapEnable;
261  uint32_t numDataLanes;
263  uint32_t lanePolarityCtrl[(CSITX_TX_DATA_LANES_MAX + CSITX_TX_CLK_LANES_MAX)];
284  uint32_t eventGrpNum;
288 } Csitx_InstCfg;
289 
294 typedef struct
295 {
296  uint32_t numCh;
305 
310 typedef struct
311 {
312  Udma_DrvHandle drvHandle;
315 
319 typedef struct
320 {
321  int32_t retVal;
324 
328 typedef struct
329 {
330  uint32_t queueCount[CSITX_NUM_CH];
334  uint32_t dequeueCount[CSITX_NUM_CH];
338  uint32_t frmRepeatCount[CSITX_NUM_CH];
342  uint32_t overflowCount;
347 
348 /* ========================================================================== */
349 /* Function Declarations */
350 /* ========================================================================== */
358 int32_t Csitx_init(const Csitx_InitParams *initParams);
359 
365 int32_t Csitx_deInit(void);
366 
373 void Csitx_initParamsInit(Csitx_InitParams *initPrms);
374 
391 
398 void Csitx_chCfgInit(Csitx_ChCfg *chCfg);
399 
406 void Csitx_instCfgInit(Csitx_InstCfg *instCfg);
407 
415 /* ========================================================================== */
416 /* Function Definitions */
417 /* ========================================================================== */
418 
419 /* None */
420 
421 #ifdef __cplusplus
422 }
423 #endif
424 
425 #endif /* #ifndef CSITX_H_ */
426 /* @} */
UDMA TX channel parameters.
Definition: udma_ch.h:286
Structure containing csitx module initialization arguments.
Definition: csitx.h:248
Csitx_InstCfg instCfg
Definition: csitx.h:301
CSITX Driver configuration file.
uint32_t vBlank
Definition: csitx.h:230
#define CSITX_EVENT_GROUP_MAX
Definition: csitx_event.h:85
uint32_t rxCompEnable
Definition: csitx.h:250
#define CSITX_TX_CLK_LANES_MAX
Defines total number of physical clock lanes that can be used per CSITX instance.
Definition: csitx_soc.h:118
uint32_t numDataLanes
Definition: csitx.h:261
Capture driver create status. Returned after calling Fvid2_create().
Definition: csitx.h:319
Csitx_DPhyCfg dphyCfg
Definition: csitx.h:282
uint8_t ringOrderId
Definition: csitx.h:240
uint32_t eventGrpNum
Definition: csitx.h:284
int32_t Csitx_deInit(void)
CSITX Driver de-Init function.
Capture driver create arguments, used when calling Fvid2_create(). Structure containing Streams confi...
Definition: csitx.h:310
CSITX event related parameters.
Definition: csitx_event.h:315
void Csitx_initParamsInit(Csitx_InitParams *initPrms)
Csitx_InitParams structure init function.
UDMA Driver API/interface file.
void Csitx_instCfgInit(Csitx_InstCfg *instCfg)
Csitx_InstCfg structure init function.
Udma_ChTxPrms txChParams
Definition: csitx.h:238
void Csitx_chCfgInit(Csitx_ChCfg *chCfg)
Csitx_ChCfg structure init function.
D-PHY configuration structure.
Definition: csitx_soc.h:272
Capture status structure used to get the current status.
Definition: csitx.h:328
uint32_t numCh
Definition: csitx.h:296
FVID2 video buffer format specification.
Definition: csl_fvid2_dataTypes.h:1069
uint32_t hBlank
Definition: csitx.h:232
#define CSITX_TX_DATA_LANES_MAX
Defines total number of physical data lanes that can be used per CSITX instance.
Definition: csitx_soc.h:115
uint32_t chType
Definition: csitx.h:182
Fvid2_Format inFmt
Definition: csitx.h:191
This file contains the CSL API's for CSI-TX.
Structure containing Channels configurations.
Definition: csitx.h:176
uint32_t outCsiDataType
Definition: csitx.h:189
void Csitx_createParamsInit(Csitx_CreateParams *createPrms)
Csitx_CreateParams structure init function.
Udma_DrvHandle drvHandle
Definition: csitx.h:312
#define CSITX_NUM_CH
Number of Channels: Maximum number of channels for configuration Application can save some memory by ...
Definition: csitx_cfg.h:75
uint32_t chId
Definition: csitx.h:178
uint32_t enableFrameRepeat
Definition: csitx.h:274
uint32_t rxv1p3MapEnable
Definition: csitx.h:255
uint32_t startDelayPeriod
Definition: csitx.h:234
CSITX event related parameters and API.
uint32_t overflowCount
Definition: csitx.h:342
Capture driver create arguments, used when calling Fvid2_create(). Structure containing Streams confi...
Definition: csitx.h:294
int32_t Csitx_init(const Csitx_InitParams *initParams)
CSITX Driver Init function.
int32_t retVal
Definition: csitx.h:321
void Csitx_instStatusInit(Csitx_InstStatus *status)
Csitx_InstStatus structure init function.
uint32_t vcNum
Definition: csitx.h:185