📄 csl_prev.h
字号:
/** Minimum Y value. Values less than set value are clipped to the set value*/
Uint8 minY;
/** Maximum Cb and Cr value, values greater than set value are clipped to the set value*/
Uint8 maxC;
/** Minimum Cb and Cr value. Values less than set value are clipped to the set value*/
Uint8 minC;
} CSL_PrevYCData;
/** @brief This structure is used for setting the YC values.
*
*/
typedef struct CSL_PrevWriteTableData_{
/** Enumeration to select the Table which needs to be written */
CSL_PrevTableSelect tableSelect;
/** Data to be written
* Only 20-bits are valid for the non-linear enhancer
* Only 8 LSB are chosen for the gamma, noise filter, and
* CFA coefficient tables
*/
Uint32 *tableData;
} CSL_PrevWriteTableData;
/** @brief This structure is used for storing the preview output sizes.
*
*/
typedef struct CSL_PrevOutSizeData_{
/** Output number of pixels per line
*/
Uint16 width;
/** Output number of lines per frame
*/
Uint16 height;
} CSL_PrevOutSizeData;
/** @brief This is used for configuring input and output port enables and data sizes
*
* The pointer to this structure is given to the CSL APIs
*
*/
typedef struct CSL_PrevPortData_{
/** Input Source, CSL_PREV_SOURCE_CCDC, CSL_PREV_SOURCE_SDRAM*/
Uint16 inputSource;
/** Data Bit Width, CSL_PREV_IN_WIDTH_10_BITWIDE, CSL_PREV_IN_WIDTH_8_BITWIDE */
Uint16 dataBitWidth;
/** One shot mode enable/disable (from CCDC), CSL_PREV_CONTINUOUS_VIA_VPORT, CSL_PREV_ONESHOTMODE */
Uint16 oneShot;
/** Sdram output port enable: CSL_PREV_SDRPORT_ENABLE, CSL_PREV_SDRPORT_DISABLE*/
Uint16 sdramOutputEnable;
/** Resizer output port enable: CSL_PREV_RSZPORT_ENABLE, CSL_PREV_RSZPORT_DISABLE*/
Uint16 rszOutputEnable;
/** Horizontal and vertical input data */
CSL_PrevHorzVertData *horzVertData;
/** Read address : (Must be on a 32 byte boundary)*/
Uint32 *readAddr;
/** Read line offset : (Must be on a 32 byte boundary)*/
Uint16 readOffset;
/** Dark frame address : (Must be on a 32 byte boundary)*/
Uint32 *dfAddr;
/** Dark frame line offset : (Must be on a 32 byte boundary)*/
Uint16 dfOffset;
/** Write address : (Must be on a 32 byte boundary)*/
Uint32 *writeAddr;
/** Write line offset : (Must be on a 32 byte boundary)*/
Uint16 writeOffset;
} CSL_PrevPortData;
/** @brief This object contains setup parameters required for PREV hardware
* setup.
*
* The pointer to this is passed to the CSL_prevHwSetup() CSL API.
*/
typedef struct CSL_PrevHwSetup_{
/** The following parameters are REQUIRED. If a NULL pointer is passed to the
* following paramters, then an error will be returned. Default structures
* are available in the csl_prev_defaults.h for use here.
*/
/** YC position
* CSL_PREV_YCPOS_YCRYCB,
* CSL_PREV_YCPOS_YCBYCR,
* CSL_PREV_YCPOS_CBYCRY,
* CSL_PREV_YCPOS_CRYCBY,
*/
Uint8 ycPosition;
/** Sets the CFA related parameters */
CSL_PrevCFAData *cfaData;
/** Sets the input formatter/averager related parameters */
CSL_PrevAveData *aveData;
/** Sets the white balance coefficients */
CSL_PrevWBalData *wBalData;
/** Select the White balance coefficients for the matrix
(matrix[line#(0:3)][pixel#(0:3)])*/
Uint8 **wBalCoefMatrix;
/** Sets the black adjustment offsets */
CSL_PrevBlackAdjData *blackAdjData;
/** Sets the RGB2RGB blending gains and offsets */
CSL_PrevRGB2RGBData *rgb2rgbData;
/** Sets the color space converter related parameters */
CSL_PrevCSCData *cscData;
/** Sets the contrast and brightness parameters */
CSL_PrevCntBrtData *cntBrtData;
/** Sets the minumum and maximum values for Y & C */
CSL_PrevYCData *ycData;
/** The following parameters are not required. If a NULL pointer is passed to the
* following paramters, then the data for these parameters will not be set.
*/
/** Enables/Disables functional modes in the preview engine */
CSL_PrevModeData *modeData;
/** Sets the horizontal median filter related parameters */
CSL_PrevHMedData *hMedData;
/** Sets the noise filter related parameters */
CSL_PrevNFData *nFData;
/** Sets the chroma suppression related parameters */
CSL_PrevCSupData *cSupData;
/** Reg gamma table data */
Uint32 *gammaRedTable;
/** Green gamma table data */
Uint32 *gammaGreenTable;
/** Blue gamma table data */
Uint32 *gammaBlueTable;
/** Non linear enhancement table data */
Uint32 *nlEnhanceTable;
} CSL_PrevHwSetup;
/**************************************************************************\
* PREV global function declarations
\**************************************************************************/
/** This function is idempotent in that calling it many times is same as
* calling it once. This function initializes the PREV CSL data structures.
*
* <b> Usage Constraints: </b>
* This function should be called before using any of the CSL APIs
*
* @b Example:
* @verbatim
...
if (CSL_SOK != CSL_prevInit()) {
return;
}
@endverbatim
*
* @return returns the status of the operation
*
*/
CSL_Status CSL_prevInit(
void
);
/** The open call sets up the data structures for the particular instance of
* PREV device. The device can be re-opened anytime after it has been normally
* closed if so required. The handle returned by this call is input as an essential
* argument for rest of the APIs described for this module.
*
* <b> Usage Constraints: </b>
* The CSL system as well as PREV must be successfully initialized
* via @a CSL_prevInit() before calling this function. Memory for the @a CSL_prevObj
* must be allocated outside this call. This object must be retained while usage of
* this peripheral.
*
* @b Example:
* @verbatim
CSL_PrevObj prevObj;
CSL_Status status;
...
hPrev = CSL_prevOpen(&prevObj,
CSL_PREV_0,
CSL_EXCLUSIVE,
&status);
@endverbatim
*
* @return returns a handle @a CSL_PrevHandle to the requested instance of
* PREV if the call is successful, otherwise, a @a NULL is returned.
*
*/
CSL_PrevHandle CSL_prevOpen (
/** Pointer to the object that holds reference to the
* instance of PREV requested after the call
*/
CSL_PrevObj *hPrevObj,
/** Instance of PREV to which a handle is requested
*/
CSL_PrevNum prevNum,
/** Specifies if PREV should be opened with exclusive or
* shared access to the associate pins
*/
CSL_OpenMode openMode,
/** This returns the status (success/errors) of the call
*/
CSL_Status *status
);
/** The Close call releases PREV handle created by @a CSL_prevOpen()
*
* <b> Usage Constraints: </b>
* Both @a CSL_prevInit() and @a CSL_prevOpen() must be called successfully
* in that order before @a CSL_prevClose() can be called.
*
* @b Example:
* @verbatim
CSL_PrevHandle hPrev;
...
CSL_prevClose(hPrev);
@endverbatim
*
* @return returns the status of the operation (see @a CSL_Status)
*
*/
CSL_Status CSL_prevClose(
/** Pointer to the object that holds reference to the
* instance of PREV requested after the call
*/
CSL_PrevHandle hPrev
);
/** This function initializes the device registers with the appropriate values
* provided through the HwSetup Data structure. After the Setup is completed,
* the preview engine is ready for its operation. For information passed through
* the HwSetup Data structure refer @a CSL_PrevHwSetup.
*
* <b> Usage Constraints: </b>
* Both @a CSL_prevInit() and @a CSL_prevOpen() must be called
* successfully in that order before this function can be called. The user
* has to allocate space for & fill in the main setup structure appropriately
* before calling this function
*
* @b Example:
* @verbatim
CSL_PrevHandle hPrev;
CSL_PrevHwSetup hwSetup = CSL_PREV_HWSETUP_DEFAULTS;
CSL_prevHwSetup(hPrev, &hwSetup);
@endverbatim
*
* @return Returns the status of the setup operation
*
*/
CSL_Status CSL_prevHwSetup(
/** Pointer to the object that holds reference to the
* instance of PREV requested after the call
*/
CSL_PrevHandle hPrev,
/** Pointer to setup structure which contains the
* information to program PREV to a useful state
*/
CSL_PrevHwSetup *setup
);
/** Control operations for the PREV. For a particular control operation, the
* pointer to the corresponding data type needs to be passed as argument HwControl
* function Call. All the arguments (Structure elements included) passed to the
* HwControl function are inputs. For the list of commands supported and argument
* type that can be @a void* casted & passed with a particular command refer to
* @a CSL_PrevHwControlCmd.
*
* <b> Usage Constraints: </b>
* Both @a CSL_prevInit() and @a CSL_prevOpen() must be called successfully
* in that order before @a CSL_prevHwControl() can be called. For the
* argument type that can be @a void* casted & passed with a particular command
* refer to @a CSL_PrevHwControlCmd
*
* @b Example:
* @verbatim
CSL_PrevHandle hPrev;
CSL_Status status;
...
status = CSL_prevHwControl(hPrev,
CSL_PREV_CMD_SET_MODE,
&command);
@endverbatim
*
* @return returns the status of the operation (see @a CSL_Status)
*
*/
CSL_Status CSL_prevHwControl(
/** Pointer to the object that holds reference to the
* instance of PREV requested after the call
*/
CSL_PrevHandle hPrev,
/** The command to this API indicates the action to be taken
*/
CSL_PrevHwControlCmd cmd,
/** An optional argument @a void* casted
*/
void *arg
);
/** This function is used to read the current device configuration, status flags
* and the value present associated registers. Following table details the various
* status queries supported and the associated data structure to record the response.
* User should allocate memory for the said data type and pass its pointer as an
* unadorned void* argument to the status query call. For details about the various
* status queries supported and the associated data structure to record the response,
* refer to @a CSL_PrevHwStatusQuery
*
* <b> Usage Constraints: </b>
* Both @a CSL_prevInit() and @a CSL_prevOpen() must be called successfully
* in that order before @a CSL_prevGetHwStatus() can be called. For the
* argument type that can be @a void* casted & passed with a particular command
* refer to @a CSL_PrevHwStatusQuery
*
* @b Example:
* @verbatim
CSL_PrevHandle hPrev;
CSL_Status status;
Uint16 response;
...
status = CSL_prevGetHwStatus(hPrev,
CSL_PREV_QUERY_IS_BUSY,
&response);
@endverbatim
*
* @return Returns the status of the operation (see @a CSL_Status)
*
*/
CSL_Status CSL_prevGetHwStatus(
/** Pointer to the object that holds reference to the
* instance of PREV requested after the call
*/
CSL_PrevHandle hPrev,
/** The query to this API which indicates the status
* to be returned
*/
CSL_PrevHwStatusQuery query,
/** Placeholder to return the status. @a void* casted */
void *response
);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -