PDK API Guide for J721E
csirx_ss.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2018
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
41 /* @} */
56 /* Sequence for configuring Video port/DMA:
57  * 1. Disable VP/DMA
58  * 2. Configure VP/DMA
59  * 3. Enable VP/DMA
60  */
61 #ifndef CSL_CSIRX_SS_H_
62 #define CSL_CSIRX_SS_H_
63 
64 /* ========================================================================== */
65 /* Include Files */
66 /* ========================================================================== */
67 #include <ti/csl/cslr_csirx.h>
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
73 /* ========================================================================== */
74 /* Macros & Typedefs */
75 /* ========================================================================== */
79 #define CSL_CSIRX_PSI_L_THREAD_NUM_MAX ((uint32_t)32U)
80 
81 /* ========================================================================== */
82 /* Structures and Enums */
83 /* ========================================================================== */
87 typedef enum
88 {
94 
106 #define CSL_CSIRX_DMA_DATA_SIZE_SHIFT_8BITS (uint32_t)0U
107 
108 #define CSL_CSIRX_DMA_DATA_SIZE_SHIFT_16BITS (uint32_t)1U
109 
110 #define CSL_CSIRX_DMA_DATA_SIZE_SHIFT_32BITS (uint32_t)2U
111 /* @} */
112 
124 #define CSL_CSIRX_YUV422_MODE_UYVY (uint32_t)0U
125 
126 #define CSL_CSIRX_YUV422_MODE_VYUY (uint32_t)1U
127 
128 #define CSL_CSIRX_YUV422_MODE_YUYV (uint32_t)2U
129 
130 #define CSL_CSIRX_YUV422_MODE_YVYU (uint32_t)3U
131 /* @} */
132 
136 typedef struct
137 {
138  uint32_t instance;
142  uint32_t inWidth;
144  uint32_t inHeight;
147 
151 typedef struct
152 {
153  uint32_t chNum;
155  uint32_t virtCh;
157  uint32_t dataType;
159  uint32_t pck12CfgEnable;
164  uint32_t dataSizeShift;
168  uint32_t dualPkgEnable;
173  uint32_t yuv422Mode;
177  uint32_t dstTag;
179  uint32_t srcTag;
181  uint32_t psFlags;
183  uint32_t pktType;
186 
191 typedef struct
192 {
193  uint32_t scheme;
195  uint32_t bu;
197  uint32_t function;
199  uint32_t rtlRev;
201  uint32_t major;
203  uint32_t custom;
205  uint32_t minor;
208 /* ========================================================================== */
209 /* Global Variables */
210 /* ========================================================================== */
211 
212 /* None */
213 
214 /* ========================================================================== */
215 /* Function Declarations */
216 /* ========================================================================== */
226 void CSL_csirxGetRevisionId(const CSL_csi_rx_ifRegs *ifRegisters,
227  CSL_CsirxRevisionId *revId);
228 
240 int32_t CSL_csirxEnableVP(CSL_csi_rx_ifRegs *ifRegisters,
241  uint32_t instance,
242  uint32_t enable);
243 
255 int32_t CSL_csirxConfigVP(CSL_csi_rx_ifRegs *ifRegisters,
256  const CSL_CsirxVPConfig* config);
257 
268 void CSL_csirxAssertPixelIfReset(CSL_csi_rx_ifRegs *ifRegisters, uint32_t assert_stat);
280 int32_t CSL_csirxEnableDMA(CSL_csi_rx_ifRegs *ifRegisters,
281  uint32_t threadNum,
282  uint32_t enable);
283 
295 int32_t CSL_csirxConfigDMA(CSL_csi_rx_ifRegs *ifRegisters,
296  const CSL_CsirxDMAConfig* config);
297 
298 #ifdef __cplusplus
299 }
300 
301 #endif /*extern "C" */
302 
303 #endif
304 
int32_t CSL_csirxEnableDMA(CSL_csi_rx_ifRegs *ifRegisters, uint32_t threadNum, uint32_t enable)
This API is used enable/disable DMA.
int32_t CSL_csirxEnableVP(CSL_csi_rx_ifRegs *ifRegisters, uint32_t instance, uint32_t enable)
This API is used enable/disable Video Port.
uint32_t inWidth
Definition: csirx_ss.h:142
uint32_t psFlags
Definition: csirx_ss.h:181
Structure for PSI-L/DMA configuration for CSI Rx SS.
Definition: csirx_ss.h:151
void CSL_csirxAssertPixelIfReset(CSL_csi_rx_ifRegs *ifRegisters, uint32_t assert_stat)
This API is used assert/de-assert reset for pixel interface.
uint32_t pktType
Definition: csirx_ss.h:183
Structure for accessing Revision ID and Core Release Info. of CSI Rx module.
Definition: csirx_ss.h:191
uint32_t scheme
Definition: csirx_ss.h:193
uint32_t instance
Definition: csirx_ss.h:138
void CSL_csirxGetRevisionId(const CSL_csi_rx_ifRegs *ifRegisters, CSL_CsirxRevisionId *revId)
This API is used get the CSI Rx revision ID.
uint32_t srcTag
Definition: csirx_ss.h:179
CSL_CsirxVPInstance
Enum to represent the Video Port Instance.
Definition: csirx_ss.h:87
Definition: cslr_csi_rx_if.h:61
uint32_t inHeight
Definition: csirx_ss.h:144
uint32_t virtCh
Definition: csirx_ss.h:155
Definition: csirx_ss.h:91
uint32_t bu
Definition: csirx_ss.h:195
uint32_t dstTag
Definition: csirx_ss.h:177
uint32_t minor
Definition: csirx_ss.h:205
uint32_t yuv422Mode
Definition: csirx_ss.h:173
uint32_t dataType
Definition: csirx_ss.h:157
uint32_t dualPkgEnable
Definition: csirx_ss.h:168
int32_t CSL_csirxConfigVP(CSL_csi_rx_ifRegs *ifRegisters, const CSL_CsirxVPConfig *config)
This API is used to configure Video Port.
Structure for Video Port configuration for CSI Rx SS.
Definition: csirx_ss.h:136
uint32_t dataSizeShift
Definition: csirx_ss.h:164
#define CSL_CSI_RX_IF_VP1
Definition: cslr_csi_rx_if.h:78
Definition: csirx_ss.h:89
int32_t CSL_csirxConfigDMA(CSL_csi_rx_ifRegs *ifRegisters, const CSL_CsirxDMAConfig *config)
This API is used to configure DMA.
uint32_t custom
Definition: csirx_ss.h:203
uint32_t chNum
Definition: csirx_ss.h:153
uint32_t major
Definition: csirx_ss.h:201
uint32_t pck12CfgEnable
Definition: csirx_ss.h:159
#define CSL_CSI_RX_IF_VP0
Definition: cslr_csi_rx_if.h:77
uint32_t rtlRev
Definition: csirx_ss.h:199