⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_hist.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/** @mainpageHIST CSL 3.x
 *
 * @section Introduction
 *
 * @subsection xxx Purpose and Scope
 * The purpose of this document is to identify a set of common CSL APIs for
 * theHIST module across various devices. The CSL developer is expected to
 * refer to this document while designing APIs for these modules. Some of the
 * listed APIs may not be applicable to a givenHIST module. While other cases
 * this list of APIs may not be sufficient to cover all the features of a
 * particularHIST Module. The CSL developer should use his discretion designing
 * new APIs or extending the existing ones to cover these.
 *
 * @subsection aaa Terms and Abbreviations
 *   -# CSL:  Chip Support Library
 *   -# API:  Application Programmer Interface
 *
 * @subsection References
 *    -# CSL-001-DES, CSL 3.x Design Specification DocumentVersion 1.02
 *    -# HIST_SPEC, HIST Detailed Design Specification, Version 1.00.w.10 
 *
 */

/** @file csl_hist.h
 *
 * @brief    Header file for functional layer of CSL
 *
 * Description
 *    - The different enumerations, structure definitions
 *      and function declarations
 *
 * Modification 1
 *    - modified on: 10/21/2004
 *    - reason: Created the sources
 *
 * Modification 2
 *    - modified on: 04/08/2005
 *    - reason: Added several modifications based on DSC feedback
 *
 *
 * @date 21th Oct, 2004
 * @author Sandeep Tiwari
 *
 */
#ifndef _CSL_HIST_H_
#define _CSL_HIST_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <cslr.h>
#include <csl_error.h>
#include <csl_sysData.h>
#include <csl_types.h>
#include <cslr_hist.h>

/****** ********************************************************************\
*		HIST global macro declarations
\**************************************************************************/

/** Constants for passing parameters to the HIST Hardware Setup function
 */

/** For indicating that the HIST is enabled    */
#define CSL_HIST_ENABLE							(CSL_HIST_PCR_ENABLE_ENABLE)
/** For indicating that the HIST is disabled   */
#define CSL_HIST_DISABLE						(CSL_HIST_PCR_ENABLE_DISABLE)

/** For indicating that HIST is busy  */
#define CSL_HIST_BUSY							(CSL_HIST_PCR_BUSY_BUSY)
/** For indicating that the HIST is not busy  */
#define CSL_HIST_NOT_BUSY						(CSL_HIST_PCR_BUSY_NOTBUSY)

/** For indicating that the i/p data width is (9-14)-bits   */
#define CSL_HIST_DATA_WIDTH_9_14				(CSL_HIST_HIST_CNT_DATSIZ_9TO14_BITS)
/** For indicating that the i/p data width is 8-bits */
#define CSL_HIST_DATA_WIDTH_8					(CSL_HIST_HIST_CNT_DATSIZ_8BITS)

/** For indicating that the i/p source is CCDC  */
#define CSL_HIST_SOURCE_CCDC					(CSL_HIST_HIST_CNT_SOURCE_CCDC)
/** For indicating that the i/p source is SDRAM */
#define CSL_HIST_SOURCE_SDRAM					(CSL_HIST_HIST_CNT_SOURCE_SDRAM)

/** For indicating that the CFA pattern is conventional pattern */
#define CSL_HIST_CFA_CONVENTIONAL				(CSL_HIST_HIST_CNT_CFA_2D_2X2_CONVENTIONAL)
/** For indicating that the CFA pattern is foveon pattern */
#define CSL_HIST_CFA_FOVEON						(CSL_HIST_HIST_CNT_CFA_FOVEON_PATTERN)

/** For indicating that the clear after read function is enabled */
#define CSL_HIST_CLEAR_AFTER_READ				(CSL_HIST_HIST_CNT_CLR_CLEAR_AFTER_READ)
/** For indicating that the clear after read function is disabled */
#define CSL_HIST_NO_CLEAR_AFTER_READ			(CSL_HIST_HIST_CNT_CLR_NOCLEAR_AFTER_READ)


/**************************************************************************\
* HIST global typedef declarations
\**************************************************************************/

/** @brief This object contains the reference to the instance of HIST opened
 *  using the @a CSL_histOpen().
 *
 *  The pointer to this, is passed to all HIST CSL APIs.
 */
typedef struct CSL_HistObj {
	/** This is the mode which the CSL instance is opened     */
	CSL_OpenMode openMode;
	/** This is a unique identifier to the instance of HIST being
	 *  referred to by this object
	 */
	CSL_Uid uid;
	/** This is the variable that contains the current state of a
	 *  resource being shared by current instance of HIST with
        *  other peripherals
       */
	CSL_Xio xio;
      /** This is a pointer to the registers of the instance of HIST
       *  referred to by this object
       */
	CSL_HistRegsOvly regs;
	/** This is the instance of HIST being referred to by this object  */
	CSL_HistNum perNum;
}CSL_HistObj;


typedef struct CSL_HistObj *CSL_HistHandle;


/** @brief HIST Peripheral ID, Class, and Revision structure
*
*  This structure is used for querying the HIST peripheral ID, class, and revision 
*/
typedef struct CSL_HistRevStatus_{
     /** HIST Peripheral ID */
     Uint16 peripheralID;
     /** Class Identification */
     Uint16 classID;
     /**  Revision Number*/
     Uint16 revNum;
}CSL_HistRevStatus;	 

/** @brief Enumeration for queries passed to @a CSL_histGetHwStatus()
 *
 * This is used to get the status of different operations or to get the
 * existing setup of HIST.
 */

typedef enum {
		/** Get the HIST module ID and revision numbers (response type: @a (CSL_HistRevStatus*)) */  
		CSL_HIST_QUERY_REV_ID = 1,
		/** Get the HIST busy status (reponse type: @a Uint16 *) */      
		CSL_HIST_QUERY_IS_BUSY    
 } CSL_HistHwStatusQuery;


/** @brief Enumeration for queries passed to @a CSL_histHwControl()
 *
 * This is used to select the commands to control the operations
 * existing setup of HIST. The arguments to be passed with each
 * enumeration if any are specified next to the enumeration.
 */
 typedef enum {
		/** Enable/Disable the HIST module : argument @a (Uint16*)
			  CSL_HIST_ENABLE, CSL_HIST_DISABLE*/		
		CSL_HIST_CMD_ENABLE=1,
		/** Select input source: argument @a (Uint16*) 
		      CSL_HIST_SOURCE_CCDC, CSL_HIST_SOURCE_SDRAM */
		CSL_HIST_CMD_SELECT_INPUT_SOURCE,
		/** Set input data width: argument @a (Uint16*)
		      CSL_HIST_DATA_WIDTH_9_14, CSL_HIST_DATA_WIDTH_8 */
		CSL_HIST_CMD_SELECT_INP_DATA_WIDTH,
		/** Set no of bits to right shift data (0-7): argument @a (Uint16*) */
		CSL_HIST_CMD_SET_BIT_SHIFT,
		/** Config CFA pattern: argument @a (Uint16*) 
		      CSL_HIST_CFA_CONVENTIONAL, CSL_HIST_CFA_FOVEON */ 
		CSL_HIST_CMD_SELECT_CFA_PATTERN,
		/** Config white balance gain: argument @a (CSL_HistWBGainInfo *) */ 
		CSL_HIST_CMD_SET_WBGAIN,
		/** Select no of bins per histogram : argument @a (CSL_HistBinsNum*)
			  CSL_HIST_BINS_NUM_32, 
			  CSL_HIST_BINS_NUM_64, 
			  CSL_HIST_BINS_NUM_128, 
			  CSL_HIST_BINS_NUM_256 */
		CSL_HIST_CMD_SELECT_BINS,
		/** Select the "clear data after read" functionality: argument @a (Uint16*) 
		      CSL_HIST_CLEAR_AFTER_READ, CSL_HIST_NO_CLEAR_AFTER_READ */
		CSL_HIST_CMD_SELECT_CLEAR_DATA,
		/** Config Region : argument @a (CSL_HistRegInfo *) */
		CSL_HIST_CMD_SET_REGION_INFO,
		/** Config read address : argument @a (Uint32*) */
		CSL_HIST_CMD_SET_SDRAM_ADDR,
		/** Config read offset: argument @a (Uint16*) */
		CSL_HIST_CMD_SET_SDRAM_OFFSET,
		/** Set no of pixels: argument @a (CSL_HistPixelInfo *) */
		CSL_HIST_CMD_SET_PIXEL_INFO,
		/** Explicitly clear the HIST data: no argument  */
		CSL_HIST_CMD_CLEAR_DATA,
		/** Read the HIST data into a buffer: argument @a (CSL_HistReadDataInfo*)  */
		CSL_HIST_CMD_READ_DATA
               
} CSL_HistHwControlCmd;


/** @brief Enumeration for number of bins to use
 *
 * This is used to identify how many bins are being used.
 */

typedef enum {
		/** For indicating that the no of bins per histogram is 32 bins */
		CSL_HIST_BINS_NUM_32  = (CSL_HIST_HIST_CNT_BINS_32BINS),
		/** For indicating that the no of bins per histogram is 64 bins */
		CSL_HIST_BINS_NUM_64  = (CSL_HIST_HIST_CNT_BINS_64BINS),
		/** For indicating that the no of bins per histogram is 128 bins */
		CSL_HIST_BINS_NUM_128 = (CSL_HIST_HIST_CNT_BINS_128BINS),
		/** For indicating that the no of bins per histogram is 256 bins */
		CSL_HIST_BINS_NUM_256 = (CSL_HIST_HIST_CNT_BINS_256BINS)
 } CSL_HistBinsNum;

/** @brief Enumeration for region numbers for @a CSL_HistRegInfo struct
 *
 * This is used to identify which region is being set.
 */

typedef enum {
		/** Region 0 */  
		CSL_HIST_R0 = 0,
		/** Region 1 */  
		CSL_HIST_R1,
		/** Region 2 */  
		CSL_HIST_R2,
		/** Region 3 */  
		CSL_HIST_R3
 } CSL_HistRegionNum;


/**
 * This structure is used to obtain the white balance gain information of
 * HIST @ CSL_histHwControl() function
 */

 typedef struct CSL_HistWBGainInfo{

		/** Pixel locations for following numbers */
		/** Bayer			Foveon				  */
		/** 0   1			0    1    2			  */
		/** 2   3								  */

		/** WB Gain pixel 0 (U8Q5)*/
		Uint8 wg00;
		/** WB Gain pixel 1 (U8Q5)*/
		Uint8 wg01;
		/** WB Gain pixel 2 (U8Q5)*/
		Uint8 wg02;
		/** WB Gain pixel 3 (U8Q5)*/
		Uint8 wg03;
		
 }CSL_HistWBGainInfo;

/**
 * This structure is used to obtain the region(0.1.2.3) information of
 * HIST @ CSL_histHwControl() function
 */

 typedef struct CSL_HistRegInfo{

 		/** Region Number  */
		CSL_HistRegionNum  rNum;
		/** Horizontal start location */
		Uint16 rhStart;
		/** Horizontal end */
		Uint16 rhEnd;
		/** Vertical start location */
		Uint16 rvStart;
		/** Vertical end */
		Uint16 rvEnd;
		
 }CSL_HistRegInfo;

 /**
 * This structure is used to obtain histogram data of
 * HIST @ CSL_histHwControl() function
 */

 typedef struct CSL_HistReadDataInfo{

		/** Histogram starting address for data to be read (0-1023) */
		Uint16 addr;
		/** Number of entries to read (0-1023) */
		Uint16 size;
		/** Pointer to the buffer where the histogram data should be stored */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -