📄 csl_camaux.h
字号:
/** ============================================================================
* @file csl_camAux.h
*
* @path $(CSLPATH)\arm\cam\inc
*
* @desc API header file for the camera interface CSL
*/
/* ============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ===========================================================================
*/
/* @(#) PSP/CSL 3.00.01.00[5912] (2004-05-15) */
/* =============================================================================
* Revision History
* ===============
* 09-Jul-2004 ka File Created.
* =============================================================================
*/
#ifndef _CSL_CAMAUX_H_
#define _CSL_CAMAUX_H_
#include <csl_cam.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Status query functions of the camera interface
*/
/** ============================================================================
* @n@b CSL_camItStat
*
* @b Description
* @n Gets the status of all the interrupt sources. Application is supposed
* to apply appropriate mask on the returned value to know whether a
* particular interrupt source has caused an interrupt source has caused
* an interrupt.
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
* @endverbatim
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Returns the current value of the interrupt source status register
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
Uint32 stat;
...
stat = CSL_camItStat (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
Uint32 CSL_camItStat (
CSL_CamHandle hCam
)
{
volatile Uint32 value;
value = hCam->regs->IT_STATUS;
return (value);
}
/** ============================================================================
* @n@b CSL_camGetHSyncStat
*
* @b Description
* @n Gets the status of HSYNC occurance.
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> Bool
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Returns the status of the HSYNC occurance
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
Bool hSyncStat;
...
hSyncStat = CSL_camGetHSyncStat (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
Bool CSL_camGetHSyncStat (
CSL_CamHandle hCam
)
{
volatile Bool temp;
temp = (Bool) CSL_FEXT(hCam->regs->STATUS, CAM_STATUS_HSTATUS);
return (temp);
}
/** ============================================================================
* @n@b CSL_camGetVSyncStat
*
* @b Description
* @n Gets the status of VSYNC occurance.
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> Bool
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Returns the status of the VSYNC occurance
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
Bool hSyncStat;
...
hSyncStat = CSL_camGetVSyncStat (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
Bool CSL_camGetVSyncStat (
CSL_CamHandle hCam
)
{
volatile Bool temp;
temp = (Bool) CSL_FEXT (hCam->regs->STATUS, CAM_STATUS_VSTATUS);
return (temp);
}
/** ============================================================================
* @n@b CSL_camGetCamData
*
* @b Description
* @n Reads the image data from FIFO
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Returns the image data from FIFO
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
Uint32 camData = 0;
...
camData = CSL_camGetCamData (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
Uint32 CSL_camGetCamData (
CSL_CamHandle hCam
)
{
volatile Uint32 camData = 0;
camData = hCam->regs->CAMDATA;
return (camData);
}
/** ============================================================================
* @n@b CSL_camGetPeakCounter
*
* @b Description
* @n Gets the maximum number of words written to FIFO during the transfer
* since the last clear to zero
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> Uint8
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Returns the maximum number of words written to FIFO during the transfer
* since the last clear to zero
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
Uint8 peakCounter = 0;
...
peakCounter = CSL_camGetPeakCounter (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
Uint32 CSL_camGetPeakCounter (
CSL_CamHandle hCam
)
{
volatile Uint32 peakCounter = 0;
peakCounter =
CSL_FEXT (hCam->regs->PEAK_COUNTER, CAM_PEAK_COUNTER_PEAK_COUNTER);
return (peakCounter);
}
/** ============================================================================
* @n@b CSL_camLClkEnable
*
* @b Description
* @n Enables the CAM.LCLK
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Enables the CAM.LCLK
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
...
CSL_camLClkEnable (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
void CSL_camLClkEnable (
CSL_CamHandle hCam
)
{
/** Enables CAM.LCLK */
CSL_FINS(hCam->regs->CTRLCLOCK, CAM_CTRLCLOCK_LCLK_EN, TRUE);
}
/** ============================================================================
* @n@b CSL_camLClkDisable
*
* @b Description
* @n Disables the CAM.LCLK
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Disables the CAM.LCLK
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
...
CSL_camLClkDisable (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
void CSL_camLClkDisable (
CSL_CamHandle hCam
)
{
/** Disbles CAM.LCLK */
CSL_FINS(hCam->regs->CTRLCLOCK, CAM_CTRLCLOCK_LCLK_EN, FALSE);
}
/** ============================================================================
* @n@b CSL_camMClkEnable
*
* @b Description
* @n Enables the internal clock of interface
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Enables the internal clock of interface
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
...
CSL_camMClkEnable (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
void CSL_camMClkEnable (
CSL_CamHandle hCam
)
{
/** Enable the internal clock of interface */
CSL_FINS(hCam->regs->CTRLCLOCK, CAM_CTRLCLOCK_MCLK_EN, TRUE);
}
/** ============================================================================
* @n@b CSL_camMClkDisable
*
* @b Description
* @n Disables the internal clock of interface
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Disables the internal clock of interface
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
...
CSL_camMClkDisable (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
void CSL_camMClkDisable (
CSL_CamHandle hCam
)
{
/** Disable the internal clock of interface */
CSL_FINS(hCam->regs->CTRLCLOCK, CAM_CTRLCLOCK_MCLK_EN, FALSE);
}
/** ============================================================================
* @n@b CSL_camExClkEnable
*
* @b Description
* @n Enables the CAM.EXCLK
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Enables the CAM.EXCLK
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
...
CSL_camExClkEnable (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
void CSL_camExClkEnable (
CSL_CamHandle hCam
)
{
/** Enable CAM.EXCLK */
CSL_FINS(hCam->regs->CTRLCLOCK, CAM_CTRLCLOCK_CAMEXCLK_EN, TRUE);
}
/** ============================================================================
* @n@b CSL_camExClkDisable
*
* @b Description
* @n Enables the CAM.EXCLK
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Enables the CAM.EXCLK
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
...
CSL_camExClkDisable (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
void CSL_camExClkDisable (
CSL_CamHandle hCam
)
{
/** Disable CAM.EXCLK */
CSL_FINS(hCam->regs->CTRLCLOCK, CAM_CTRLCLOCK_CAMEXCLK_EN, TRUE);
}
/** ============================================================================
* @n@b CSL_camResetFifo
*
* @b Description
* @n Resets the FIFO
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Resets the FIFO
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
...
CSL_camExClkDisable (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
void CSL_camResetFifo (
CSL_CamHandle hCam
)
{
/** Resets the FIFO */
CSL_FINS(hCam->regs->MODE, CAM_MODE_RAZ_FIFO, TRUE);
CSL_FINS(hCam->regs->MODE, CAM_MODE_RAZ_FIFO, FALSE);
}
/** ============================================================================
* @n@b CSL_camRst
*
* @b Description
* @n Resets the camera module
*
* @b Arguments
* @verbatim
hCam Handle to the CSL for camera interface module
@endverbatim
*
* <b> Return Value </b> None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Resets the camera module
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_CamHandle hCam;
...
CSL_camRst (hCam);
...
@endverbatim
* ===========================================================================
*/
static inline
void CSL_camRst (
CSL_CamHandle hCam
)
{
/** Resets the camera module */
CSL_FINS(hCam->regs->GPIO, CAM_GPIO_CAM_RST, TRUE);
CSL_FINS(hCam->regs->GPIO, CAM_GPIO_CAM_RST, FALSE);
}
#ifdef __cplusplus
}
#endif
#endif /* _CSL_CAMAUX_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -