📄 csl_cam.h
字号:
/** ============================================================================
* @file csl_cam.h
*
* @path $(CSLPATH)\arm\cam\src
*
* @desc API header file for 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-27) */
/* =============================================================================
* Revision History
* ===============
* 10-aug-2004 ka Changes for new CSL architecture
*
* =============================================================================
*/
#ifndef _CSL_CAM_H_
#define _CSL_CAM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <csl.h>
#include <cslr_cam.h>
/**
* Camera interface global typedef declarations
*/
/** This enum describes describes the active edge configuration of CAM.LCLK */
typedef enum {
/** Camera data is latched on rising edge of CAM.LCLK */
CSL_CAM_LCLK_POL_RISE = CSL_CAM_CTRLCLOCK_POLCLK_RISING_EDGE,
/** Camera data is latched on falling edge of CAM.LCLK */
CSL_CAM_LCLK_POL_FALL = CSL_CAM_CTRLCLOCK_POLCLK_FALLING_EDGE
} CSL_CamPolClk;
/** This enum describes the possible values of the frequency of CAM.EXCLK */
typedef enum {
/** Set CAM.EXCLK clock frequency to ARM_PER_CK frequency divided by 8 */
CSL_CAM_ARM_PER_CK_BY_8 = CSL_CAM_CTRLCLOCK_FOSCMOD_ARM_PER_CK_8,
/** Set CAM.EXCLK clock frequency to ARM_PER_CK frequency divided by 3 */
CSL_CAM_ARM_PER_CK_BY_3 = CSL_CAM_CTRLCLOCK_FOSCMOD_ARM_PER_CK_3,
/** Set CAM.EXCLK clock frequency to ARM_PER_CK frequency divided by 16 */
CSL_CAM_ARM_PER_CK_BY_16 = CSL_CAM_CTRLCLOCK_FOSCMOD_ARM_PER_CK_16,
/** Set CAM.EXCLK clock frequency to ARM_PER_CK frequency divided by 2 */
CSL_CAM_ARM_PER_CK_BY_2 = CSL_CAM_CTRLCLOCK_FOSCMOD_ARM_PER_CK_2,
/** Set CAM.EXCLK clock frequency to ARM_PER_CK frequency divided by 10 */
CSL_CAM_ARM_PER_CK_BY_10 = CSL_CAM_CTRLCLOCK_FOSCMOD_ARM_PER_CK_10,
/** Set CAM.EXCLK clock frequency to ARM_PER_CK frequency divided by 4 */
CSL_CAM_ARM_PER_CK_BY_4 = CSL_CAM_CTRLCLOCK_FOSCMOD_ARM_PER_CK_4,
/** Set CAM.EXCLK clock frequency to ARM_PER_CK frequency divided by 12 */
CSL_CAM_ARM_PER_CK_BY_12 = CSL_CAM_CTRLCLOCK_FOSCMOD_ARM_PER_CK_12
} CSL_CamExClkFreq;
/** This enum describes the set of order of the data recieved from the camera */
typedef enum {
/** Every two bytes recieved from the camera are not swapped */
CSL_CAM_ORDERCAMD_NOT_SWAPPED = CSL_CAM_MODE_ORDERCAMD_NOT_SWAPPED,
/** Every two bytes recieved from the camera are swapped */
CSL_CAM_ORDERCAMD_SWAPPED = CSL_CAM_MODE_ORDERCAMD_SWAPPED
} CSL_CamOrderCamData;
/**
* This enum describes the list of image sizes supported by the camera
* interface
*/
typedef enum {
/** CIF image */
CSL_CAM_IMG_CIF = CSL_CAM_MODE_IMGSIZE_CIF,
/** QCIF image */
CSL_CAM_IMG_QCIF = CSL_CAM_MODE_IMGSIZE_QCIF,
/** VGA image */
CSL_CAM_IMG_VGA = CSL_CAM_MODE_IMGSIZE_VGA,
/** QVGA image */
CSL_CAM_IMG_QVGA = CSL_CAM_MODE_IMGSIZE_QVGA
} CSL_CamImgSize;
/**
* This enum describes the modes of data transfers supported by camera interface
* between camera and the camera interface
*/
typedef enum {
/** Synchrous mode */
CSL_CAM_OSC_SYNC = CSL_CAM_MODE_CAMOSC_SYNC_MODE,
/** Asynchrous mode */
CSL_CAM_OSC_ASYNC = CSL_CAM_MODE_CAMOSC_ASYNC_MODE
} CSL_CamOsc;
/**
* This structure is used to pass the configuration parameters to the
* CSL_CamHwSetup() function, which in turn configures the operating parameters
* of the camera interface by programming the camera interface registers
*/
typedef struct {
/** Enables/Disables CAM.LCLK */
Bool lClkEnable;
/** Enables/Disables internal clock of interface */
Bool mClkEnable;
/** Enables/Disables CAM.EXCLK */
Bool camExClkEnable;
/** Sets the polarity of CAM.LCLK */
CSL_CamPolClk polClk;
/** Sets the frequency of the CAM.EXCLK clock */
CSL_CamExClkFreq camExClkFreq;
/** Reset FIFO */
Bool resetFifo;
/** Enable/Disable interrupt on FIFO_FULL */
Bool fifoFullIntEnable;
/** Enables/Disables data transfer interrupt */
Bool dataTxIntEnable;
/** Programmable DMA request trigger value. DMA request is made when FIFO
* counter is equal to the threshold value. Currently, set this field to 1
* in DMA mode
*/
Uint8 threshold;
/** Enables/Disables DMA mode */
Bool dmaModeEnable;
/** Enables/Disables interrupt on HSYNC falling edge */
Bool hsyncDownIntEnable;
/** Enables/Disables interrupt on HSYNC rising edge */
Bool hsyncUpIntEnable;
/** Enables/Disables interrupt on VSYNC falling edge */
Bool vsyncDownIntEnable;
/** Enables/Disables interrupt on VSYNC rising edge */
Bool vsyncUpIntEnable;
/** Sets order of 2 consecutive bytes recieved from camera (YUV format) */
CSL_CamOrderCamData orderCamd;
/** Sets the image size. Currently, this parameter has no effect on the
* camera interface
*/
CSL_CamImgSize imgSize;
/** Sets the mode of data transfer between camera and camera interface.
* Currently, this parameter has no effect on the camera interface
*/
CSL_CamOsc camOsc;
/** Resets the camera module */
Bool resetCam;
} CSL_CamHwSetup;
/**
* This enum describes the commands used to control the camera interface
* through CSL_CamHwControl()
*/
typedef enum {
/**
* @brief Enables the CAM.LCLK
* @param None
*/
CSL_CAM_CMD_LCLK_EN = 0,
/**
* @brief Disables the CAM.LCLK
* @param None
*/
CSL_CAM_CMD_LCLK_DIS = 1,
/**
* @brief Enables the internal clock of interface
* @param None
*/
CSL_CAM_CMD_MCLK_EN = 2,
/**
* @brief Disbales the internal clock of interface
* @param None
*/
CSL_CAM_CMD_MCLK_DIS = 3,
/**
* @brief Enables CAM.EXCLK
* @param None
*/
CSL_CAM_CMD_EXCLK_EN = 4,
/**
* @brief Disables CAM.EXCLK
* @param None
*/
CSL_CAM_CMD_EXCLK_DIS = 5,
/**
* @brief Resets the FIFO
* @param None
*/
CSL_CAM_CMD_RESET_FIFO = 6,
/**
* @brief Resets the camera module
* @param None
*/
CSL_CAM_CMD_RST = 7
} CSL_CamHwControlCmd;
/**
* This enum describes the queries used to get status of various parameters of
* the camera module. These values are used in CSL_camGetHwStatus ()
*/
typedef enum {
/**
* @brief 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.
* @param Uint32 *
*/
CSL_CAM_QUERY_IT_STAT = 0,
/**
* @brief Gets the status of HSYNC occurance
* @param Bool *
*/
CSL_CAM_QUERY_HSYNC_STAT = 1,
/**
* @brief Gets the status of VSYNC occurance
* @param Bool *
*/
CSL_CAM_QUERY_VSYNC_STAT = 2,
/**
* @brief Reads the image data from FIFO
* @param Uint32 *
*/
CSL_CAM_QUERY_CAMDATA = 3,
/**
* @brief Gets the maximum number of words written to FIFO during the
* transfer since the last clear to zero
* @param Uint32 *
*/
CSL_CAM_QUERY_PEAK_COUNTER = 4
} CSL_CamHwStatusQuery;
/**
* Config-structure
*
* Used to configure the camera interface using CSL_camHwSetupRaw()
*/
typedef struct {
/** Clock control register */
Uint32 CTRLCLOCK;
/** Interrupt source status register */
Uint32 IT_STATUS;
/** Camera interface mode configuration register */
Uint32 MODE;
/** Status register */
Uint32 STATUS;
/** Image data register */
Uint32 CAMDATA;
/** Camera interface GPIO register */
Uint32 GPIO;
/** FIFO peak counter register */
Uint32 PEAK_COUNTER;
} CSL_CamConfig;
/** Module specific context information. Present implementation of camera
* interface CSL doesn't have any context information.
*/
typedef struct {
/** Context information of camera interface CSL.
* The below declaration is just a place-holder for future implementation.
*/
Uint16 contextInfo;
} CSL_CamContext;
/** Module specific parameters. Present implementation of camera interface CSL
* doesn't have any module specific parameters.
*/
typedef struct {
/** Bit mask to be used for module specific parameters. The below
* declaration is just a place-holder for future implementation.
*/
CSL_BitMask16 flags;
} CSL_CamParam;
/** This structure contains the base-address information for the peripheral
* instance
*/
typedef struct {
/** Base-address of the configuration registers of the peripheral
*/
CSL_CamRegsOvly regs;
} CSL_CamBaseAddress;
/** Camera interface object structure */
typedef struct CSL_CamObj {
/** Pointer to the register overlay structure of the camera interface */
CSL_CamRegsOvly regs;
/** Instance of camera interface being referred by this object */
CSL_InstNum perNum;
} CSL_CamObj;
/** Default values for config structure */
#define CSL_CAM_CONFIG_DEFAULTS { \
CSL_CAM_CTRLCLOCK_RESETVAL, \
CSL_CAM_IT_STATUS_RESETVAL, \
CSL_CAM_MODE_RESETVAL, \
CSL_CAM_STATUS_RESETVAL, \
CSL_CAM_GPIO_RESETVAL, \
CSL_CAM_CAMDATA_RESETVAL, \
CSL_CAM_PEAK_COUNTER_RESETVAL \
}
/** Default hardware setup parameters */
#define CSL_CAM_HWSETUP_DEFAULTS { \
FALSE, \
FALSE, \
FALSE, \
CSL_CAM_CTRLCLOCK_POLCLK_RISING_EDGE, \
CSL_CAM_CTRLCLOCK_FOSCMOD_ARM_PER_CK_8, \
FALSE, \
FALSE, \
FALSE, \
1, \
FALSE, \
FALSE, \
FALSE, \
FALSE, \
FALSE, \
CSL_CAM_MODE_ORDERCAMD_NOT_SWAPPED, \
CSL_CAM_MODE_IMGSIZE_CIF, \
CSL_CAM_MODE_CAMOSC_SYNC_MODE, \
FALSE \
}
/**
* This data type is used to return the handle to the CSL of the camera
* interface timer
*/
typedef struct CSL_CamObj *CSL_CamHandle;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -