enhance: Deprecated enhance_v6_0 driver.
Added active enhance_v7_0 driver. Signed-off-by: Shravan Kumar A <skumara@xilinx.com> Acked-by: Srikanth Vemula <svemula@xilinx.com>
This commit is contained in:
parent
a656eeaa1b
commit
1b561d8e6b
7 changed files with 620 additions and 0 deletions
45
XilinxProcessorIPLib/drivers/enhance/data/enhance.mdd
Executable file
45
XilinxProcessorIPLib/drivers/enhance/data/enhance.mdd
Executable file
|
@ -0,0 +1,45 @@
|
|||
###############################################################################
|
||||
#
|
||||
# Copyright (C) 2009 - 2014 Xilinx, Inc. All rights reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# Use of the Software is limited solely to applications:
|
||||
# (a) running on a Xilinx device, or
|
||||
# (b) that interact with a Xilinx device through a bus or interconnect.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the Xilinx shall not be used
|
||||
# in advertising or otherwise to promote the sale, use or other dealings in
|
||||
# this Software without prior written authorization from Xilinx.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
OPTION psf_version = 2.1;
|
||||
|
||||
BEGIN driver enhance
|
||||
|
||||
OPTION supported_peripherals = (v_enhance_v[8]_[0-9]);
|
||||
OPTION driver_state = ACTIVE;
|
||||
OPTION copyfiles = all;
|
||||
OPTION VERSION = 7.0;
|
||||
OPTION NAME = enhance;
|
||||
|
||||
END driver
|
||||
|
||||
|
37
XilinxProcessorIPLib/drivers/enhance/data/enhance.tcl
Executable file
37
XilinxProcessorIPLib/drivers/enhance/data/enhance.tcl
Executable file
|
@ -0,0 +1,37 @@
|
|||
###############################################################################
|
||||
#
|
||||
# Copyright (C) 2009 - 2014 Xilinx, Inc. All rights reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# Use of the Software is limited solely to applications:
|
||||
# (a) running on a Xilinx device, or
|
||||
# (b) that interact with a Xilinx device through a bus or interconnect.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the Xilinx shall not be used
|
||||
# in advertising or otherwise to promote the sale, use or other dealings in
|
||||
# this Software without prior written authorization from Xilinx.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
proc generate {drv_handle} {
|
||||
xdefine_include_file $drv_handle "xparameters.h" "ENHANCE" "NUM_INSTANCES" "C_BASEADDR" "C_HIGHADDR" "DEVICE_ID" "C_S_AXIS_VIDEO_DATA_WIDTH" "C_S_AXIS_VIDEO_FORMAT" "C_S_AXIS_VIDEO_TDATA_WIDTH" "C_M_AXIS_VIDEO_DATA_WIDTH" "C_M_AXIS_VIDEO_FORMAT" "C_M_AXIS_VIDEO_TDATA_WIDTH" "C_HAS_AXI4_LITE" "C_HAS_DEBUG" "C_HAS_INTC_IF" "C_MAX_COLS" "C_ACTIVE_COLS" "C_ACTIVE_ROWS" "C_HAS_NOISE" "C_HAS_ENHANCE" "C_HAS_HALO" "C_HAS_ALIAS" "C_OPT_SIZE" "C_NOISE_THRESHOLD" "C_ENHANCE_STRENGTH" "C_HALO_SUPPRESS"
|
||||
xdefine_canonical_xpars $drv_handle "xparameters.h" "ENHANCE" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_S_AXIS_VIDEO_DATA_WIDTH" "C_S_AXIS_VIDEO_FORMAT" "C_S_AXIS_VIDEO_TDATA_WIDTH" "C_M_AXIS_VIDEO_DATA_WIDTH" "C_M_AXIS_VIDEO_FORMAT" "C_M_AXIS_VIDEO_TDATA_WIDTH" "C_HAS_AXI4_LITE" "C_HAS_DEBUG" "C_HAS_INTC_IF" "C_MAX_COLS" "C_ACTIVE_COLS" "C_ACTIVE_ROWS" "C_HAS_NOISE" "C_HAS_ENHANCE" "C_HAS_HALO" "C_HAS_ALIAS" "C_OPT_SIZE" "C_NOISE_THRESHOLD" "C_ENHANCE_STRENGTH" "C_HALO_SUPPRESS"
|
||||
}
|
||||
|
152
XilinxProcessorIPLib/drivers/enhance/examples/example.c
Executable file
152
XilinxProcessorIPLib/drivers/enhance/examples/example.c
Executable file
|
@ -0,0 +1,152 @@
|
|||
/******************************************************************************
|
||||
* (c) Copyright 2009-2013 Xilinx, Inc. All rights reserved.
|
||||
*
|
||||
* This file contains confidential and proprietary information
|
||||
* of Xilinx, Inc. and is protected under U.S. and
|
||||
* international copyright and other intellectual property
|
||||
* laws.
|
||||
*
|
||||
* DISCLAIMER
|
||||
* This disclaimer is not a license and does not grant any
|
||||
* rights to the materials distributed herewith. Except as
|
||||
* otherwise provided in a valid license issued to you by
|
||||
* Xilinx, and to the maximum extent permitted by applicable
|
||||
* law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
|
||||
* WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
|
||||
* AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
|
||||
* BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
|
||||
* INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
|
||||
* (2) Xilinx shall not be liable (whether in contract or tort,
|
||||
* including negligence, or under any other theory of
|
||||
* liability) for any loss or damage of any kind or nature
|
||||
* related to, arising under or in connection with these
|
||||
* materials, including for any direct, or any indirect,
|
||||
* special, incidental, or consequential loss or damage
|
||||
* (including loss of data, profits, goodwill, or any type of
|
||||
* loss or damage suffered as a result of any action brought
|
||||
* by a third party) even if such damage or loss was
|
||||
* reasonably foreseeable or Xilinx had been advised of the
|
||||
* possibility of the same.
|
||||
*
|
||||
* CRITICAL APPLICATIONS
|
||||
* Xilinx products are not designed or intended to be fail-
|
||||
* safe, or for use in any application requiring fail-safe
|
||||
* performance, such as life-support or safety devices or
|
||||
* systems, Class III medical devices, nuclear facilities,
|
||||
* applications related to the deployment of airbags, or any
|
||||
* other applications that could lead to death, personal
|
||||
* injury, or severe property or environmental damage
|
||||
* (individually and collectively, "Critical
|
||||
* Applications"). Customer assumes the sole risk and
|
||||
* liability of any use of Xilinx products in Critical
|
||||
* Applications, subject only to applicable laws and
|
||||
* regulations governing limitations on product liability.
|
||||
*
|
||||
* THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
|
||||
* PART OF THIS FILE AT ALL TIMES.
|
||||
******************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @file example.c
|
||||
*
|
||||
* This file demonstrates how to use Xilinx Image Enhancement (Enhance)
|
||||
* driver of the Xilinx Image Enhancement core. This code does not
|
||||
* cover the Enhance setup and any other configuration which might be
|
||||
* required to get the Enhance device working properly.
|
||||
*
|
||||
* <pre>
|
||||
* MODIFICATION HISTORY:
|
||||
*
|
||||
* Ver Who Date Changes
|
||||
* ----- ---- -------- -------------------------------------------------------
|
||||
* 5.00a vc 06/19/13 Updated for new edge enhancement and noise reduction algorithms and registers
|
||||
* 4.00a vc 12/18/12 Updated for new gain quantization levels
|
||||
* 4.00a vc 10/16/12 Switched from Xuint32 to u32
|
||||
* Renamed example function to main()
|
||||
* Renamed reference to XPAR_ENHANCE_0_BASEADDR
|
||||
* 4.00a vc 04/24/12 Updated for v4.00.a
|
||||
* 2.00a vc 12/14/10 First release
|
||||
* </pre>
|
||||
*
|
||||
* ***************************************************************************
|
||||
*/
|
||||
|
||||
#include "enhance.h"
|
||||
#include "xparameters.h"
|
||||
|
||||
/***************************************************************************/
|
||||
// Image Enhancement Register Reading Example
|
||||
// This function provides an example of how to read the current configuration
|
||||
// settings of the Enhance core.
|
||||
/***************************************************************************/
|
||||
void report_enhance_settings(u32 BaseAddress) {
|
||||
|
||||
xil_printf("Image Edge Enhancement Core Configuration:\r\n");
|
||||
xil_printf(" Enhance Version: 0x%08x\r\n", ENHANCE_ReadReg(BaseAddress, ENHANCE_VERSION));
|
||||
xil_printf(" Enhance Enable Bit: %1d\r\n", ENHANCE_ReadReg(BaseAddress, ENHANCE_CONTROL) & ENHANCE_CTL_EN_MASK);
|
||||
xil_printf(" Enhance Register Update Bit: %1d\r\n", (ENHANCE_ReadReg(BaseAddress, ENHANCE_CONTROL) & ENHANCE_CTL_RU_MASK) >> 1);
|
||||
xil_printf(" Enhance Reset Bit: %1d\r\n", (ENHANCE_ReadReg(BaseAddress, ENHANCE_CONTROL) & ENHANCE_CTL_RESET) >> 31);
|
||||
xil_printf(" Enhance AutoReset Bit: %1d\r\n", (ENHANCE_ReadReg(BaseAddress, ENHANCE_CONTROL) & ENHANCE_CTL_AUTORESET) >> 30);
|
||||
xil_printf(" Active Columns=%d, Active Rows=%d\r\n",
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_ACTIVE_SIZE)&0x0000FFFF,
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_ACTIVE_SIZE)>>16);
|
||||
xil_printf(" Noise Threshold=%d, Enhance Strength=%d, Halo Suppression=%d\r\n",
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_NOISE_THRESHOLD),
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_ENHANCE_STRENGTH),
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_HALO_SUPPRESS));
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
// Image Enhancement Register Update Example
|
||||
// This function provides an example of the process used to update
|
||||
// the noise, enhance, and halo registers in the Enhance core.
|
||||
// In most video systems, it is expected that this process would be executed
|
||||
// in response to an interrupt connected to the SOF video timing signal
|
||||
// or a timeout signal associated with a watchdog timer.
|
||||
/***************************************************************************/
|
||||
void ENHANCE_Update_Example(u32 BaseAddress) {
|
||||
|
||||
//Enable the Enhance software enable
|
||||
ENHANCE_Enable(BaseAddress);
|
||||
|
||||
//Disable register updates.
|
||||
//This is the default operating mode for the Enhance core, and allows
|
||||
//registers to be updated without effecting the core's behavior.
|
||||
ENHANCE_RegUpdateDisable(BaseAddress);
|
||||
|
||||
//Set the noise threshold
|
||||
// These values are integers in the range: [0, 2^DATA_WIDTH-1]
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_NOISE_THRESHOLD, 255); //maximum value for 8 bit data
|
||||
|
||||
//Set the enhance strength and halo suppression factor
|
||||
// These values are floating point values in the range: [0, 1]
|
||||
// These are represented as integers by multiplying by 2^15,
|
||||
// resulting in an integer value in the range from [0, 32728]
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_ENHANCE_STRENGTH, 32768); //maximum value
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_HALO_SUPPRESS, 32768); //maximum value
|
||||
|
||||
//Enable register updates.
|
||||
//This mode will cause the active size and noise, enhance, halo registers internal
|
||||
//to the Enhance core to automatically be updated on the next SOF
|
||||
ENHANCE_RegUpdateEnable(BaseAddress);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
//
|
||||
// This is the main function for the Enhance example.
|
||||
//
|
||||
/*****************************************************************************/
|
||||
int main(void)
|
||||
{
|
||||
//Print the current settings for the Enhance core
|
||||
report_enhance_settings(XPAR_ENHANCE_0_BASEADDR);
|
||||
|
||||
//Call the Enhance example, specify the Device ID generated in xparameters.h
|
||||
ENHANCE_Update_Example(XPAR_ENHANCE_0_BASEADDR);
|
||||
|
||||
return 0;
|
||||
}
|
17
XilinxProcessorIPLib/drivers/enhance/examples/index.html
Executable file
17
XilinxProcessorIPLib/drivers/enhance/examples/index.html
Executable file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Driver example applications</title>
|
||||
<link rel="stylesheet" type="text/css" href="../help.css">
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF">
|
||||
<h1> Example Applications for the driver enhance_v6_0</h1>
|
||||
<HR>
|
||||
<ul>
|
||||
<li>example.c <a href="example.c">(source)</a> </li>
|
||||
</ul>
|
||||
<p><font face="Times New Roman" color="#800000">Copyright <20> 1995-2014 Xilinx, Inc. All rights reserved.</font></p>
|
||||
</body>
|
||||
</html>
|
29
XilinxProcessorIPLib/drivers/enhance/src/Makefile
Executable file
29
XilinxProcessorIPLib/drivers/enhance/src/Makefile
Executable file
|
@ -0,0 +1,29 @@
|
|||
COMPILER=
|
||||
ARCHIVER=
|
||||
CP=cp
|
||||
COMPILER_FLAGS=
|
||||
EXTRA_COMPILER_FLAGS=
|
||||
LIB=libxil.a
|
||||
LEVEL=0
|
||||
|
||||
RELEASEDIR=../../../lib
|
||||
INCLUDEDIR=../../../include
|
||||
INCLUDES=-I./. -I${INCLUDEDIR}
|
||||
|
||||
INCLUDEFILES=*.h
|
||||
LIBSOURCES=*.c
|
||||
|
||||
OUTS = *.o
|
||||
|
||||
libs:
|
||||
echo "Compiling enhance"
|
||||
$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES)
|
||||
$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS}
|
||||
make clean
|
||||
|
||||
include:
|
||||
${CP} $(INCLUDEFILES) $(INCLUDEDIR)
|
||||
|
||||
clean:
|
||||
rm -rf ${OUTS}
|
||||
|
63
XilinxProcessorIPLib/drivers/enhance/src/enhance.c
Executable file
63
XilinxProcessorIPLib/drivers/enhance/src/enhance.c
Executable file
|
@ -0,0 +1,63 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009 - 2014 Xilinx, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* Use of the Software is limited solely to applications:
|
||||
* (a) running on a Xilinx device, or
|
||||
* (b) that interact with a Xilinx device through a bus or interconnect.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of the Xilinx shall not be used
|
||||
* in advertising or otherwise to promote the sale, use or other dealings in
|
||||
* this Software without prior written authorization from Xilinx.
|
||||
*
|
||||
******************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @file enhance.c
|
||||
*
|
||||
* This is main code of Xilinx Image Enhancement (ENHANCE)
|
||||
* device driver. Please see enhance.h for more details of the driver.
|
||||
*
|
||||
* MODIFICATION HISTORY:
|
||||
*
|
||||
* Ver Who Date Changes
|
||||
* ----- ---- -------- -------------------------------------------------------
|
||||
* 5.00a vyc 06/19/13 Updated for ENHANCE V8.0
|
||||
* 4.00a vyc 04/24/12 Updated for ENHANCE V4.00.a
|
||||
* 3.00a rc 09/11/11 Updated for ENHANCE V3.0
|
||||
* 2.00a vc 12/14/10 Updated for ENHANCE V2.0
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/***************************** Include Files *********************************/
|
||||
|
||||
#include "enhance.h"
|
||||
#include "xenv.h"
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
// Note: All functions are currently implemented as high-performance macros
|
||||
// within enhance.h
|
||||
/*****************************************************************************/
|
||||
|
||||
|
277
XilinxProcessorIPLib/drivers/enhance/src/enhance.h
Executable file
277
XilinxProcessorIPLib/drivers/enhance/src/enhance.h
Executable file
|
@ -0,0 +1,277 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009 - 2014 Xilinx, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* Use of the Software is limited solely to applications:
|
||||
* (a) running on a Xilinx device, or
|
||||
* (b) that interact with a Xilinx device through a bus or interconnect.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of the Xilinx shall not be used
|
||||
* in advertising or otherwise to promote the sale, use or other dealings in
|
||||
* this Software without prior written authorization from Xilinx.
|
||||
*
|
||||
******************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @file enhance.h
|
||||
*
|
||||
* This header file contains identifiers and register-level driver functions (or
|
||||
* macros) that can be used to access the Xilinx Image Enhancement core instance.
|
||||
*
|
||||
* MODIFICATION HISTORY:
|
||||
*
|
||||
* Ver Who Date Changes
|
||||
* ----- ---- -------- -------------------------------------------------------
|
||||
* 5.00a vyc 06/19/13 Updated for ENHANCE V8.0
|
||||
* New edge enhancement algorithm and registers
|
||||
* Noise reduction support added
|
||||
* 4.00a vyc 04/24/12 Updated for ENHANCE V4.00.a
|
||||
* Converted from xio.h to xil_io.h, translating
|
||||
* basic type, MB cache functions, exceptions and
|
||||
* assertion to xil_io format.
|
||||
* 3.00a rc 09/11/11 Updated for ENHANCE V3.0
|
||||
* 2.00a vc 12/14/10 Updated for ENHANCE V2.0
|
||||
* 6.0 adk 19/12/13 Updated as per the New Tcl API's
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef ENHANCE_DRIVER_H /* prevent circular inclusions */
|
||||
#define ENHANCE_DRIVER_H /* by using protection macros */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************** Include Files *********************************/
|
||||
|
||||
#include "xil_io.h"
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
/**
|
||||
* Register Offsets
|
||||
*/
|
||||
/* General Control Registers */
|
||||
#define ENHANCE_CONTROL 0x0000 /**< Control */
|
||||
#define ENHANCE_STATUS 0x0004 /**< Status */
|
||||
#define ENHANCE_ERROR 0x0008 /**< Error */
|
||||
#define ENHANCE_IRQ_ENABLE 0x000C /**< IRQ Enable */
|
||||
#define ENHANCE_VERSION 0x0010 /**< Version */
|
||||
#define ENHANCE_SYSDEBUG0 0x0014 /**< System Debug 0 */
|
||||
#define ENHANCE_SYSDEBUG1 0x0018 /**< System Debug 1 */
|
||||
#define ENHANCE_SYSDEBUG2 0x001C /**< System Debug 2 */
|
||||
/* Timing Control Registers */
|
||||
#define ENHANCE_ACTIVE_SIZE 0x0020 /**< Horizontal and Vertical Active Frame Size */
|
||||
/* Core Specific Registers */
|
||||
#define ENHANCE_NOISE_THRESHOLD 0x0100 /**< Noise Reduction Control */
|
||||
#define ENHANCE_ENHANCE_STRENGTH 0x0104 /**< Edge Enhancement Control */
|
||||
#define ENHANCE_HALO_SUPPRESS 0x0108 /**< Halo Suppression Control */
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* Control Register bit definition
|
||||
*/
|
||||
#define ENHANCE_CTL_EN_MASK 0x00000001 /**< Enable */
|
||||
#define ENHANCE_CTL_RU_MASK 0x00000002 /**< Register Update */
|
||||
#define ENHANCE_CTL_AUTORESET 0x40000000 /**< Software Reset - Auto-synchronize to SOF */
|
||||
#define ENHANCE_CTL_RESET 0x80000000 /**< Software Reset - Instantaneous */
|
||||
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
#define ENHANCE_In32 Xil_In32
|
||||
#define ENHANCE_Out32 Xil_Out32
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the given register.
|
||||
*
|
||||
* @param BaseAddress is the Xilinx base address of the Image Enhancement core (from xparameters.h)
|
||||
* @param RegOffset is the register offset of the register (defined at top of this file)
|
||||
*
|
||||
* @return The 32-bit value of the register
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* u32 ENHANCE_ReadReg(u32 BaseAddress, u32 RegOffset)
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ENHANCE_ReadReg(BaseAddress, RegOffset) \
|
||||
ENHANCE_In32((BaseAddress) + (RegOffset))
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Write the given register.
|
||||
*
|
||||
* @param BaseAddress is the Xilinx base address of the Image Enhancement core (from xparameters.h)
|
||||
* @param RegOffset is the register offset of the register (defined at top of this file)
|
||||
* @param Data is the 32-bit value to write to the register
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* void ENHANCE_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ENHANCE_WriteReg(BaseAddress, RegOffset, Data) \
|
||||
ENHANCE_Out32((BaseAddress) + (RegOffset), (Data))
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This macro enables a Image Enhancement core instance.
|
||||
*
|
||||
* @param BaseAddress is the Xilinx base address of the Image Enhancement core (from xparameters.h)
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* void ENHANCE_Enable(u32 BaseAddress);
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ENHANCE_Enable(BaseAddress) \
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_CONTROL, \
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_CONTROL) | \
|
||||
ENHANCE_CTL_EN_MASK)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This macro disables a Image Enhancement core instance.
|
||||
*
|
||||
* @param BaseAddress is the Xilinx base address of the Image Enhancement core (from xparameters.h)
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* void ENHANCE_Disable(u32 BaseAddress);
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ENHANCE_Disable(BaseAddress) \
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_CONTROL, \
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_CONTROL) & \
|
||||
~ENHANCE_CTL_EN_MASK)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This macro commits all the register value changes made so far by the software
|
||||
* to the Image Enhancement core instance. The registers will be automatically updated
|
||||
* on the next rising-edge of the SOF signal on the core.
|
||||
* It is up to the user to manually disable the register update after a sufficient
|
||||
* amount of time.
|
||||
*
|
||||
* This function only works when the Image Enhancement core is enabled.
|
||||
*
|
||||
* @param BaseAddress is the Xilinx base address of the Image Enhancement core (from xparameters.h)
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* void ENHANCE_RegUpdateEnable(u32 BaseAddress);
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ENHANCE_RegUpdateEnable(BaseAddress) \
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_CONTROL, \
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_CONTROL) | \
|
||||
ENHANCE_CTL_RU_MASK)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This macro prevents the Image Enhancement core instance from committing recent changes made
|
||||
* so far by the software. When disabled, changes to other configuration registers
|
||||
* are stored, but do not effect the behavior of the core.
|
||||
*
|
||||
* This function only works when the Image Enhancement core is enabled.
|
||||
*
|
||||
* @param BaseAddress is the Xilinx base address of the Image Enhancement core (from xparameters.h)
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* void ENHANCE_RegUpdateDisable(u32 BaseAddress);
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ENHANCE_RegUpdateDisable(BaseAddress) \
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_CONTROL, \
|
||||
ENHANCE_ReadReg(BaseAddress, ENHANCE_CONTROL) & \
|
||||
~ENHANCE_CTL_RU_MASK)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* This macro resets a Image Enhancement core instance. This reset effects the core immediately,
|
||||
* and may cause image tearing.
|
||||
*
|
||||
* This reset resets the Image Enhancement's configuration registers.
|
||||
*
|
||||
*
|
||||
* @param BaseAddress is the Xilinx base address of the Image Enhancement core (from xparameters.h)
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* void ENHANCE_Reset(u32 BaseAddress);
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ENHANCE_Reset(BaseAddress) \
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_CONTROL, ENHANCE_CTL_RESET) \
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This macro resets a Image Enhancement core instance, but differs from ENHANCE_Reset() in that it
|
||||
* automatically synchronizes to the SOF input of the core to prevent tearing.
|
||||
*
|
||||
* On the next SOF following a call to ENHANCE_AutoSyncReset(),
|
||||
* all of the core's configuration registers and outputs will be reset, then the
|
||||
* reset flag will be immediately released, allowing the core to immediately resume
|
||||
* default operation.
|
||||
*
|
||||
* @param BaseAddress is the Xilinx base address of the Image Enhancement core (from xparameters.h)
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* void ENHANCE_AutoSyncReset(u32 BaseAddress);
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ENHANCE_AutoSyncReset(BaseAddress) \
|
||||
ENHANCE_WriteReg(BaseAddress, ENHANCE_CONTROL, ENHANCE_CTL_AUTORESET) \
|
||||
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* end of protection macro */
|
Loading…
Add table
Reference in a new issue