?? ddc_previewer.h
字號:
/*******************************************************************************
**+--------------------------------------------------------------------------+**
**| **** |**
**| **** |**
**| ******o*** |**
**| ********_///_**** |**
**| ***** /_//_/ **** |**
**| ** ** (__/ **** |**
**| ********* |**
**| **** |**
**| *** |**
**| |**
**| Copyright (c) 2006-2010 Texas Instruments Incorporated |**
**| ALL RIGHTS RESERVED |**
**| |**
**| Permission is hereby granted to licensees of Texas Instruments |**
**| Incorporated (TI) products to use this computer program for the sole |**
**| purpose of implementing a licensee product based on TI products. |**
**| No other rights to reproduce, use, or disseminate this computer |**
**| program, whether in part or in whole, are granted. |**
**| |**
**| TI makes no representation or warranties with respect to the |**
**| performance of this computer program, and specifically disclaims |**
**| any responsibility for any damages, special or consequential, |**
**| connected with the use of this program. |**
**| |**
**+--------------------------------------------------------------------------+**
*******************************************************************************/
/**
* \file ddc_previewer.h
*
* \brief DDC header file for Previewer
*
* This file contains the interfaces, data types and symbolic definitions at
* DDC layer, which are needed by DDA/DDC layer source files.
*
* (C) Copyright 2010, Texas Instruments, Inc
*
* \author EI2
*
* \version 0.1 Created
* 1.0 First Release
*/
#ifndef _DDC_PREVIEWER_H
#define _DDC_PREVIEWER_H
/******************************************************************************
Header File Inclusion
******************************************************************************/
#include <tistdtypes.h>
#include <std.h>
#include <psp_common.h>
#include <pal_ossem.h>
#include "psp_previewer.h"
/******************************************************************************
Macros
******************************************************************************/
/* interrupt mapping is required or not */
#define DDC_PREVIEWER_INTERRUPT_MAPPING_NOT_NEEDED 0u
#define DDC_PREVIEWER_INTERRUPT_MAPPING_NEEDED 1u
/* Channel Configure State */
#define DDC_PREVIEWER_CHANNEL_NOT_CONFIGURED ((Uint8)0u)
#define DDC_PREVIEWER_CHANNEL_CONFIGURED ((Uint8)1u)
/* DDC error status */
#define DDC_PREVIEWER_ERROR_FOUND ((Uint32)0u)
#define DDC_PREVIEWER_ERROR_NOT_FOUND ((Uint32)1u)
/* DDC error codes, passed to DDA layer */
#define DDC_PREV_SOK ((DDC_prevResult)(0))
#define DDC_PREV_E_FAIL ((DDC_prevResult)(-1))
#define DDC_PREV_INVALID_STATE ((DDC_prevResult)(-2))
#define DDC_PREV_INVALID_PARAM ((DDC_prevResult)(-3))
#define DDC_PREV_MEMORY_ERROR ((DDC_prevResult)(-4))
#define DDC_PREV_RESOURCE_ERROR ((DDC_prevResult)(-5))
#define DDC_PREV_OVERFLOW_ERROR ((DDC_prevResult)(-6))
#define DDC_PREV_NOT_SUPPORTED ((DDC_prevResult)(-7))
/* previewer crop size as per feature */
#define DDC_PREV_HMF_HCROP ((Uint32)4u)
#define DDC_PREV_NOISE_FILTER_HCROP ((Uint32)4u)
#define DDC_PREV_NOISE_FILTER_VCROP ((Uint32)4u)
#define DDC_PREV_CFA_HCROP ((Uint32)4u)
#define DDC_PREV_CFA_VCROP ((Uint32)4u)
#define DDC_PREV_LUMA_HCROP ((Uint32)2u)
/* to varify that address or offset is 32 bytes aligned*/
#define DDC_PREV_32_ALIGNED_MASK ((Uint32)0x1F)
/* intitial semaphore values */
#define DDC_PREV_INIT_ISR_SEM ((Uint32)0u)
#define DDC_PREV_INIT_CHANNEL_SEM ((Uint32)1u)
/* uninitialised interrupt number */
#define DDC_PREV_UNINIT_ISR_NO ((Uint32)0xFF)
/******************************************************************************
Data-Structures
******************************************************************************/
/**
* \brief DDC_prevResult
*
* DDC related error codes that will be passed to the DDA layer.
*/
typedef Uint32 DDC_prevResult;
/**
* \previewer ddcISRType
*
* interrupt prototype
*/
typedef void (*ddcISRType)();
/**
* \brief DDC_prevDeviceObject
*
* This structure is filled at the time of device binding.
*/
typedef struct _DDC_prevDeviceObject
{
Uint8 intNum;
/**< Interrupt number on which interrupt for previewer is captured. */
Ptr regs;
/**< Handle for previewer registers */
PAL_OsSemHandle semIsr;
/**< This is the semaphore that will be posted at the end of ISR and
in preview IOCTL, driver will pend on this semaphore. */
}DDC_prevDeviceObject, *DDC_prevDeviceHandle;
/**
* \brief DDC_prevChannelObject
*
* This structure is initialised at the time of channel creation.
*/
typedef struct _DDC_prevChannelObject
{
PSP_previewerChannelCreateMode channelMode;
/**< indicates channel source is SDRAM or CCDC. */
PSP_previewerParams DDC_prevParams;
/**< contains all the parameters related to previewer. */
PAL_OsSemHandle channelSem;
/**< channel semaphore, used when ioctl is called. */
PSP_previewerDarkFrameCapture DFCState;
/**< dark frame capture state. */
Int8 configState;
/**< indicates channel parameters are configured or not. */
}DDC_prevChannelObject, *DDC_prevChannelHandle;
/******************************************************************************
Functions
******************************************************************************/
/**
* \brief DDC_prevDeviceCreate
*
* It creates a given previewer device at DDC layer.
* It will take object of previewer device structure and assigned it to passed
* parameter. It will call DDC_prevPerformRegisterOverlaying function.
*
* \param ddcDeviceHandle [OUT] handle for this device instance at DDC
* layer will be initialized here
* \return success PSP_SOK
* failure PSP error
*/
DDC_prevResult DDC_prevDeviceCreate(PSP_Handle *ddcDeviceHandle);
/**
* \brief Open Channel of the previewer device at DDC layer
*
* The function take an object of DDC_prevChannelObject structure
* and keep configState to NOT_CONFIGURED state.channelSem will be created.
* verify that Interrupt mapping is required or not.
* Return the channel handle.
*
* \param chanParams [IN] pointer to Previewer Create Channel
* Stracture
* \param ddcChannelHandle [OUT] pointer to channel handle at DDC layer,
* which will be filled here.
* \param interruptMapRequired [OUT] indicates interrupt mapping is
* required or not.
* \param interruptMapInfo [OUT] indicates on which event mapping is needed.
* \param isrFunc [OUT] pointer to ISR function
* \return success PSP_SOK
* failure PSP error
*/
DDC_prevResult DDC_prevOpenHandle(PSP_previewerChannelCreateMode *chanParams,
PSP_Handle *ddcChannelHandle,
Uint32 *interruptMapRequired,
Uint8 *interruptMapInfo,
ddcISRType *isrFunc);
/**
* \brief DDC_prevIoctl
*
* It controls Channel of the previewer device.
* This function provides ioctl functionality for previewer.It will call
* respective function to execute proper IOCTL.
*
* \param ddcChannelHandle [IN] channel handle
* \param cmd [IN] Operation to be performed, typically an
* enum gets passed
* \param arg [IN/OUT] Provides additonal information related to
* the operation
* \return success PSP_SOK
* failure PSP error
*/
DDC_prevResult DDC_prevIoctl(PSP_Handle ddcChannelHandle,
PSP_previewerControlCmd cmd, Ptr cmdArg);
/**
* \brief DDC_prevCloseHandle
*
* It closes Channel of the previewer device at DDC layer.
* This function will close the channel at DDC level.Previewer Channel
* structure will be deleted.
*
* \param ddcChannelHandle [IN] channel handle
* \return success PSP_SOK
* failure PSP error
*/
DDC_prevResult DDC_prevCloseHandle(PSP_Handle ddcChannelHandle);
/**
* \brief DDC_prevDeviceDelete
*
* It deletes a given previewer device at DDC layer.It will delete previewer
* device object at DDC layer, will delete semaphore of ISR.
*
* \param ddcDeviceHandle [IN] handle for this device instance at DDC
* layer
* \return success PSP_SOK
* failure PSP error
*/
DDC_prevResult DDC_prevDeviceDelete(PSP_Handle ddcDeviceHandle);
/**
* \brief DDC_prevISR
*
* It will be registered as an interrupt when source is SDRAM - one shot mode
*
* \param void
* \return void
*/
void DDC_prevISR(Uint32 arg);
#endif /* End of _DDC_PREVIEWER_H */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -