diff --git a/XilinxProcessorIPLib/drivers/scaler/data/scaler.tcl b/XilinxProcessorIPLib/drivers/scaler/data/scaler.tcl index c15c0928..fc2dc27a 100755 --- a/XilinxProcessorIPLib/drivers/scaler/data/scaler.tcl +++ b/XilinxProcessorIPLib/drivers/scaler/data/scaler.tcl @@ -33,77 +33,11 @@ # Ver Who Date Changes # -------- ------ -------- ------------------------------------ # 5.0 adk 12/10/13 Updated as per the New Tcl API's +# 7.0 adk 22/08/14 Modified config_files parameters by adding prefix C_. proc generate {drv_handle} { xdefine_include_file $drv_handle "xparameters.h" "XSCALER" "NUM_INSTANCES" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_NUM_V_TAPS" "C_NUM_H_TAPS" "C_MAX_PHASES" "C_MAX_COEF_SETS" "C_CHROMA_FORMAT" "C_SEPARATE_YC_COEFS" "C_SEPARATE_HV_COEFS" - xdefine_config_file $drv_handle "xscaler_g.c" "XScaler" "DEVICE_ID" "C_BASEADDR" "NUM_V_TAPS" "NUM_H_TAPS" "MAX_PHASES" "MAX_COEF_SETS" "C_CHROMA_FORMAT" "C_SEPARATE_YC_COEFS" "C_SEPARATE_HV_COEFS" + xdefine_config_file $drv_handle "xscaler_g.c" "XScaler" "DEVICE_ID" "C_BASEADDR" "C_NUM_V_TAPS" "C_NUM_H_TAPS" "C_MAX_PHASES" "C_MAX_COEF_SETS" "C_CHROMA_FORMAT" "C_SEPARATE_YC_COEFS" "C_SEPARATE_HV_COEFS" xdefine_canonical_xpars $drv_handle "xparameters.h" "XScaler" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_NUM_V_TAPS" "C_NUM_H_TAPS" "C_MAX_PHASES" "C_MAX_COEF_SETS" "C_CHROMA_FORMAT" "C_SEPARATE_YC_COEFS" "C_SEPARATE_HV_COEFS" } - -# -# Given a list of arguments, define each as a canonical constant name, using -# the driver name, in an include file. -# -proc xdefine_canonical_xpars {drv_handle file_name drv_string args} { - # Open include file - set file_handle [::hsm::utils::open_include_file $file_name] - - # Get all the peripherals connected to this driver - set periphs [::hsm::utils::get_common_driver_ips $drv_handle] - - # Get the names of all the peripherals connected to this driver - foreach periph $periphs { - set peripheral_name [string toupper [get_property NAME $periph]] - lappend peripherals $peripheral_name - } - - # Get possible canonical names for all the peripherals connected to this driver - set device_id 0 - foreach periph $periphs { - set canonical_name [string toupper [format "%s_%s" $drv_string $device_id]] - lappend canonicals $canonical_name - - # Create a list of IDs of the peripherals whose hardware instance name - # doesn't match the canonical name. These IDs can be used later to - # generate canonical definitions - if { [lsearch $peripherals $canonical_name] < 0 } { - lappend indices $device_id - } - incr device_id - } - - set i 0 - foreach periph $periphs { - set periph_name [string toupper [get_property NAME $periph]] - - # Generate canonical definitions only for the peripherals whose - # canonical name is not the same as hardware instance name - if { [lsearch $canonicals $periph_name] < 0 } { - puts $file_handle "/* Canonical definitions for peripheral $periph_name */" - set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]] - - foreach arg $args { - set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg] - - # The commented out rvalue is the name of the instance-specific constant - # set rvalue [::hsm::utils::get_ip_param_name $periph $arg] - - # The rvalue set below is the actual value of the parameter - set rvalue [get_property CONFIG.$arg $periph] - if {[llength $rvalue] == 0} { - set rvalue 0 - } - set rvalue [::hsm::utils::format_addr_string $rvalue $arg] - - puts $file_handle "#define $lvalue $rvalue" - - } - puts $file_handle "" - incr i - } - } - - puts $file_handle "\n/******************************************************************/\n" - close $file_handle -} diff --git a/XilinxProcessorIPLib/drivers/scaler/examples/index.html b/XilinxProcessorIPLib/drivers/scaler/examples/index.html index 02631472..cdc2ff72 100755 --- a/XilinxProcessorIPLib/drivers/scaler/examples/index.html +++ b/XilinxProcessorIPLib/drivers/scaler/examples/index.html @@ -7,10 +7,10 @@
-Copyright © 1995-2014 Xilinx, Inc. All rights reserved.
diff --git a/XilinxProcessorIPLib/drivers/scaler/examples/example.c b/XilinxProcessorIPLib/drivers/scaler/examples/scaler_example.c similarity index 94% rename from XilinxProcessorIPLib/drivers/scaler/examples/example.c rename to XilinxProcessorIPLib/drivers/scaler/examples/scaler_example.c index da2e841d..eb6cfc09 100755 --- a/XilinxProcessorIPLib/drivers/scaler/examples/example.c +++ b/XilinxProcessorIPLib/drivers/scaler/examples/scaler_example.c @@ -32,7 +32,7 @@ /*****************************************************************************/ /** * - * @file example.c + * @file scaler_example.c * * This file demonstrates how to use Xilinx XScaler driver on Xilinx MVI Video * Scaler core. This code does not cover the Video DMA (VDMA) setup and any @@ -46,9 +46,14 @@ ** MODIFICATION HISTORY: * - * Ver Who Date Changes - * ----- ---- -------- ------------------------------------------------------ - * 1.00a xd 02/09/09 First release + * Ver Who Date Changes + * ----- --- -------- ------------------------------------------------------ + * 1.00a xd 02/09/09 First release + * 7.00 adk 22/08/14 Renamed example.c to scaler_example.c + * XPAR_SCALER_0_DEVICE_ID is changed to + * XPAR_XSCALER_0_DEVICE_ID. + * Chaged typecast of XScaler_CoefValueLookup from u16 to + * s16. ** *****************************************************************************/ @@ -59,7 +64,7 @@ /* * Device related constants. Defined in xparameters.h. */ -#define SCALER_DEVICE_ID XPAR_SCALER_0_DEVICE_ID +#define SCALER_DEVICE_ID XPAR_XSCALER_0_DEVICE_ID /* * Index of Coefficient Set to load and use @@ -106,7 +111,7 @@ int main(void) if (Status != 0) { return 1; } - + printf("\n Successfully ran Scaler example \n"); return 0; } diff --git a/XilinxProcessorIPLib/drivers/scaler/src/xscaler.c b/XilinxProcessorIPLib/drivers/scaler/src/xscaler.c index 0818e52c..7cf578cd 100755 --- a/XilinxProcessorIPLib/drivers/scaler/src/xscaler.c +++ b/XilinxProcessorIPLib/drivers/scaler/src/xscaler.c @@ -41,18 +41,31 @@ *
* MODIFICATION HISTORY: * -* Ver Who Date Changes -* ----- ---- -------- ------------------------------------------------------- -* 1.00a xd 02/10/09 First release -* 2.00a xd 12/14/09 Updated doxygen document tags -* 4.01a cw 06/27/12 Updated tcl file with new parameter names (num_x_taps) - Updated mdd file with updated supported_peripherals field. -* 4.02a mpv 03/11/13 Updated the Driver to select the correct coeff bin. -* Changed RegValue variable to a volatile type -* Removed 10.x patch in the Tcl file -* 4.03a mpv 05/28/13 Fixed version limit in MDD file -* Updated the Driver input, output and aperture size mask -* 5.00a mpv 12/13/13 Updated to dynamic coeff generation to reduce driver size +* Ver Who Date Changes +* ----- ---- -------- ------------------------------------------------------- +* 1.00a xd 02/10/09 First release +* 2.00a xd 12/14/09 Updated Doxygen document tags +* 4.01a cw 06/27/12 Updated tcl file with new parameter names (num_x_taps) +* Updated mdd file with updated supported_peripherals +* field. +* 4.02a mpv 03/11/13 Updated the Driver to select the correct coeff bin. +* Changed RegValue variable to a volatile type +* Removed 10.x patch in the Tcl file +* 4.03a mpv 05/28/13 Fixed version limit in MDD file +* Updated the Driver input, output and aperture size +* mask +* 5.00a mpv 12/13/13 Updated to dynamic coeff generation to reduce driver +* size +* 7.0 adk 08/22/14 Modified prototype of XScaler_GetVersion API. +* and functionality of StubCallBack. Modified assert +* conditions in functions XScaler_CfgInitialize, +* XScaler_SetPhaseNum, XScaler_LoadCoeffBank. +* Removed error callback from XScaler_CfgInitialize +* function. +* Uncommented XScaler_Reset in XScaler_CfgInitialize +* function. +* Removed ErrorMask parameter in StubCallBack as there +* was only one interrupt. ** ******************************************************************************/ @@ -82,14 +95,12 @@ * This macro calculates the integral value nearest to x rounding half-way cases * away from zero, regardless of the current rounding direction. * -* @param x has a float type value +* @param x has a float type value * -* @return the integral value nearest to x rounding half-way cases away from -* zero, regardless of the current rounding direction. +* @return The integral value nearest to x rounding half-way cases away +* from zero, regardless of the current rounding direction. * -* @note -* C-style signature: -* s32 round(float x); +* @note C-style signature: s32 round(float x); * ******************************************************************************/ #define round(x) ((x) >= 0 ? (s32)((x) + 0.5) : (s32)((x) - 0.5)) @@ -99,7 +110,7 @@ /************************** Function Prototypes ******************************/ static u32 XScaler_CoeffBinOffset(u32 InSize, u32 OutSize); -static void StubCallBack(void *CallBackRef, u32 Mask); +static void StubCallBack(void *CallBackRef); /************************* Data Structure Definitions ************************/ @@ -125,15 +136,18 @@ extern s16 *XScaler_GenCoefTable(u32 Tap, u32 Phase); * prior to using a Scaler device. Initialization of a Scaler includes setting * up the instance data, and ensuring the hardware is in a quiescent state. * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param CfgPtr points to the configuration structure associated with the - * Scaler device. - * @param EffectiveAddr is the base address of the device. If address - * translation is being used, then this parameter must - * reflect the virtual base address. Otherwise, the physical address - * should be used. - * @return XST_SUCCESS + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param CfgPtr points to the configuration structure associated with + * the Scaler device. + * @param EffectiveAddr is the base address of the device. If address + * translation is being used, then this parameter must + * reflect the virtual base address. Otherwise, the physical + * address should be used. + * + * @return XST_SUCCESS + * + * @note None. * *****************************************************************************/ int XScaler_CfgInitialize(XScaler *InstancePtr, XScaler_Config *CfgPtr, @@ -144,16 +158,12 @@ int XScaler_CfgInitialize(XScaler *InstancePtr, XScaler_Config *CfgPtr, Xil_AssertNonvoid(InstancePtr != NULL); Xil_AssertNonvoid(CfgPtr != NULL); - Xil_AssertNonvoid(CfgPtr->MaxPhaseNum > 0); Xil_AssertNonvoid(CfgPtr->MaxPhaseNum <= XSCL_MAX_PHASE_NUM); - Xil_AssertNonvoid(CfgPtr->HoriTapNum > 0); Xil_AssertNonvoid(CfgPtr->HoriTapNum <= XSCL_MAX_TAP_NUM); - Xil_AssertNonvoid(CfgPtr->VertTapNum > 0); Xil_AssertNonvoid(CfgPtr->VertTapNum <= XSCL_MAX_TAP_NUM); - Xil_AssertNonvoid(CfgPtr->CoeffSetNum > 0); Xil_AssertNonvoid(CfgPtr->CoeffSetNum <= XSCL_MAX_COEFF_SET_NUM); Xil_AssertNonvoid(EffectiveAddr != (u32)NULL); @@ -166,13 +176,12 @@ int XScaler_CfgInitialize(XScaler *InstancePtr, XScaler_Config *CfgPtr, /* Set all handlers to stub values, let user configure this data later */ - InstancePtr->EventCallBack = (XScaler_CallBack)StubCallBack; - InstancePtr->ErrorCallBack = (XScaler_CallBack)StubCallBack; + InstancePtr->CallBack = (XScaler_CallBack)StubCallBack; /* Reset the hardware and set the flag to indicate the driver is ready */ - //XScaler_Reset(InstancePtr); + XScaler_Reset(InstancePtr); InstancePtr->IsReady = XIL_COMPONENT_IS_READY; return XST_SUCCESS; @@ -185,11 +194,14 @@ int XScaler_CfgInitialize(XScaler *InstancePtr, XScaler_Config *CfgPtr, * calculates the scale factor accordingly based on the aperture setting and * sets up the Scaler appropriately. * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param AperturePtr points to the aperture setting structure to set up - * the Scaler device. - * @return XST_SUCCESS + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param AperturePtr points to the aperture setting structure to set up + * the Scaler device. + * + * @return XST_SUCCESS. + * + * @note None. * *****************************************************************************/ int XScaler_SetAperture(XScaler *InstancePtr, XScalerAperture *AperturePtr) @@ -273,18 +285,20 @@ int XScaler_SetAperture(XScaler *InstancePtr, XScalerAperture *AperturePtr) & XSCL_SRCSIZE_NUMLINE_MASK; /* Set up aperture related register in the Scaler */ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_APTVERT, InLine); - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_APTHORI, InPixel); - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_OUTSIZE, OutSize); - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_SRCSIZE, SrcSize); - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_HSF, (u32)(round(HoriScaleFactor))); - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_VSF, (u32)(round(VertScaleFactor))); + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_APTVERT_OFFSET), InLine); + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_APTHORI_OFFSET), InPixel); + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_OUTSIZE_OFFSET), OutSize); + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_SRCSIZE_OFFSET), SrcSize); + + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_HSF_OFFSET), (u32)(round(HoriScaleFactor))); + + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_VSF_OFFSET), (u32)(round(VertScaleFactor))); return XST_SUCCESS; } @@ -294,11 +308,14 @@ int XScaler_SetAperture(XScaler *InstancePtr, XScalerAperture *AperturePtr) * This function gets aperture of a Scaler device. The aperture setting * consists of input video aperture and output video size. * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param AperturePtr points to the aperture structure to store the current - * Scaler device setting after this function returns. - * @return None + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param AperturePtr points to the aperture structure to store the + * current Scaler device setting after this function returns. + * + * @return None. + * + * @note None. * *****************************************************************************/ void XScaler_GetAperture(XScaler *InstancePtr, XScalerAperture *AperturePtr) @@ -338,7 +355,6 @@ void XScaler_GetAperture(XScaler *InstancePtr, XScalerAperture *AperturePtr) (OutSize & XSCL_OUTSIZE_NUMLINE_MASK) >> XSCL_OUTSIZE_NUMLINE_SHIFT; - return; } /*****************************************************************************/ @@ -346,11 +362,14 @@ void XScaler_GetAperture(XScaler *InstancePtr, XScalerAperture *AperturePtr) * This function sets the numbers of vertical and horizontal phases to be used * by a Scaler device. * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param VertPhaseNum is the number of vertical phase to set to - * @param HoriPhaseNum is the number of horizontal phase to set to - * @return None + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param VertPhaseNum is the number of vertical phase to set to + * @param HoriPhaseNum is the number of horizontal phase to set to + * + * @return None. + * + * @note None. * *****************************************************************************/ void XScaler_SetPhaseNum(XScaler *InstancePtr, u16 VertPhaseNum, @@ -361,8 +380,6 @@ void XScaler_SetPhaseNum(XScaler *InstancePtr, u16 VertPhaseNum, /* Assert bad arguments and conditions */ Xil_AssertVoid(InstancePtr != NULL); Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(VertPhaseNum > 0); - Xil_AssertVoid(HoriPhaseNum > 0); Xil_AssertVoid(VertPhaseNum <= InstancePtr->Config.MaxPhaseNum); Xil_AssertVoid(HoriPhaseNum <= InstancePtr->Config.MaxPhaseNum); @@ -373,10 +390,8 @@ void XScaler_SetPhaseNum(XScaler *InstancePtr, u16 VertPhaseNum, PhaseRegValue |= HoriPhaseNum & XSCL_NUMPHASE_HORI_MASK; /* Set up the Scaler core using the numbers of phases */ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_NUMPHASE, - PhaseRegValue); - - return; + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_NUMPHASE_OFFSET), PhaseRegValue); } /*****************************************************************************/ @@ -384,13 +399,16 @@ void XScaler_SetPhaseNum(XScaler *InstancePtr, u16 VertPhaseNum, * This function gets the numbers of vertical and horizontal phases currently * used by a Scaler device. * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param VertPhaseNumPtr will point to the number of vertical phases used - * after this function returns. - * @param HoriPhaseNumPtr will point to the number of horizontal phases used - * after this function returns. - * @return None + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param VertPhaseNumPtr will point to the number of vertical phases + * used after this function returns. + * @param HoriPhaseNumPtr will point to the number of horizontal phases + * used after this function returns. + * + * @return None. + * + * @note None. * *****************************************************************************/ void XScaler_GetPhaseNum(XScaler *InstancePtr, u16 *VertPhaseNumPtr, @@ -405,8 +423,8 @@ void XScaler_GetPhaseNum(XScaler *InstancePtr, u16 *VertPhaseNumPtr, Xil_AssertVoid(HoriPhaseNumPtr != NULL); /* Get the value of "Number of Phases Register" */ - PhaseRegValue = XScaler_ReadReg((InstancePtr)->Config.BaseAddress, - XSCL_NUMPHASE); + PhaseRegValue = XScaler_ReadReg(InstancePtr->Config.BaseAddress, + (XSCL_NUMPHASE_OFFSET)); /* Parse the value and store the results */ *VertPhaseNumPtr = @@ -414,7 +432,6 @@ void XScaler_GetPhaseNum(XScaler *InstancePtr, u16 *VertPhaseNumPtr, XSCL_NUMPHASE_VERT_SHIFT; *HoriPhaseNumPtr = PhaseRegValue & XSCL_NUMPHASE_HORI_MASK; - return; } /*****************************************************************************/ @@ -422,11 +439,14 @@ void XScaler_GetPhaseNum(XScaler *InstancePtr, u16 *VertPhaseNumPtr, * This function sets up Luma and Chroma start fractional values used by a * Scaler device. * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param StartFractionPtr is a pointer to a start fractional value set to be - * used. - * @return None + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param StartFractionPtr is a pointer to a start fractional value set + * to be used. + * + * @return None. + * + * @note None. * *****************************************************************************/ void XScaler_SetStartFraction(XScaler *InstancePtr, @@ -438,11 +458,13 @@ void XScaler_SetStartFraction(XScaler *InstancePtr, Xil_AssertVoid(StartFractionPtr != NULL); /* Set up the fractional values */ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_FRCTLUMALEFT, + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, + XSCL_FRCTLUMALEFT_OFFSET, (u32)StartFractionPtr->LumaLeftHori & XSCL_FRCTLUMALEFT_VALUE_MASK); - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_FRCTLUMATOP, + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, + XSCL_FRCTLUMATOP_OFFSET, (u32)StartFractionPtr->LumaTopVert & XSCL_FRCTLUMATOP_VALUE_MASK); @@ -451,11 +473,11 @@ void XScaler_SetStartFraction(XScaler *InstancePtr, (u32)StartFractionPtr->ChromaLeftHori & XSCL_FRCTCHROMALEFT_VALUE_MASK); - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_FRCTCHROMATOP, + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, + XSCL_FRCTCHROMATOP_OFFSET, (u32)StartFractionPtr->ChromaTopVert & XSCL_FRCTCHROMATOP_VALUE_MASK); - return; } /*****************************************************************************/ @@ -463,12 +485,15 @@ void XScaler_SetStartFraction(XScaler *InstancePtr, * This function gets Luma and Chroma start fractional values currently used * by a Scaler device. * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param StartFractionPtr is a pointer to a start fractional value structure - * to be populated with the fractional values after this function - * returns. - * @return None + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param StartFractionPtr is a pointer to a start fractional value + * structure to be populated with the fractional values after this + * function returns. + * + * @return None. + * + * @note None. * *****************************************************************************/ void XScaler_GetStartFraction(XScaler *InstancePtr, @@ -482,25 +507,24 @@ void XScaler_GetStartFraction(XScaler *InstancePtr, /* Fetch the fractional values */ StartFractionPtr->LumaLeftHori = (s32) XScaler_ReadReg((InstancePtr)->Config.BaseAddress, - XSCL_FRCTLUMALEFT) + XSCL_FRCTLUMALEFT_OFFSET) & XSCL_FRCTLUMALEFT_VALUE_MASK; StartFractionPtr->LumaTopVert = (s32) XScaler_ReadReg((InstancePtr)->Config.BaseAddress, - XSCL_FRCTLUMATOP) + XSCL_FRCTLUMATOP_OFFSET) & XSCL_FRCTLUMATOP_VALUE_MASK; StartFractionPtr->ChromaLeftHori = (s32) XScaler_ReadReg((InstancePtr)->Config.BaseAddress, - XSCL_FRCTCHROMALEFT) + XSCL_FRCTCHROMALEFT_OFFSET) & XSCL_FRCTCHROMALEFT_VALUE_MASK; StartFractionPtr->ChromaTopVert = (s32) XScaler_ReadReg((InstancePtr)->Config.BaseAddress, - XSCL_FRCTCHROMATOP) + XSCL_FRCTCHROMATOP_OFFSET) & XSCL_FRCTCHROMATOP_VALUE_MASK; - return; } /*****************************************************************************/ @@ -508,28 +532,32 @@ void XScaler_GetStartFraction(XScaler *InstancePtr, * This function fetches the color space format and coefficient bank sharing * decisions made on a Scaler device at build-time. * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param ChromaFormat points to an 8-bit variable that will be assigned with - * the Chroma format chosen for the Scaler device at the build time - * after this function returns. Please use XSCL_CHROMA_FORMAT_* defined - * in xscaler_hw.h to interpret the variable value. - * @param ChromaLumaShareCoeff points to an 8-bit variable that will be - * assigned by this function with the decision value on coefficient - * bank sharing between Chroma and Luma filter operations. The decision - * is made for the Scaler device at build time and can NOT be changed - * at run-time. Value 0 indicates that each of Chroma and Luma filter - * operations has its own coefficient bank. Value 1 indicates that - * Chroma and Luma filter operations share one common coefficient bank. - * @param HoriVertShareCoeff points to an 8-bit variable that will be - * assigned by this function with the decision value on coefficient - * bank sharing between Horizontal and Vertical filter operations. The - * decision is made for the Scaler device at build time and can NOT - * be changed at run-time. Value 0 indicates that each of Horizontal - * and Vertical filter operations has its own coefficient bank. Value 1 - * indicates that Horizontal and Vertical filter operations share one - * common coefficient bank. - * @return None. + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param ChromaFormat points to an 8-bit variable that will be assigned + * with the Chroma format chosen for the Scaler device at the + * build time after this function returns. Please use + * XSCL_CHROMA_FORMAT_* defined in xscaler_hw.h to interpret the + * variable value. + * @param ChromaLumaShareCoeff points to an 8-bit variable that will be + * assigned by this function with the decision value on coefficient + * bank sharing between Chroma and Luma filter operations. The + * decision is made for the Scaler device at build time and can + * NOT be changed at run-time. Value 0 indicates that each of Chroma + * and Luma filter operations has its own coefficient bank. Value + * 1 indicates that Chroma and Luma filter operations share one + * common coefficient bank. + * @param HoriVertShareCoeff points to an 8-bit variable that will be + * assigned by this function with the decision value on coefficient + * bank sharing between Horizontal and Vertical filter operations. + * The decision is made for the Scaler device at build time and + * can NOT be changed at run-time. Value 0 indicates that each of + * Horizontal and Vertical filter operations has its own + * coefficient bank. Value 1 indicates that Horizontal and + * Vertical filter operations share one common coefficient bank. + * + * @return None. + * * @note * * !!!IMPORTANT!!! @@ -619,7 +647,6 @@ void XScaler_GetCoeffBankSharingInfo(XScaler *InstancePtr, break; } - return; } /*****************************************************************************/ @@ -627,12 +654,15 @@ void XScaler_GetCoeffBankSharingInfo(XScaler *InstancePtr, * This function returns the pointer to the coefficients for a scaling * operation given input/output sizes and the Tap and Phase numbers. * - * @param InSize indicates the size (width or height) of the input video. - * @param OutSize indicates the size (width or height) of the output video. - * @param Tap indicates the Tap number. - * @param Phase indicates the Phase number. - * @return The points to the coefficients ready for the scaling operation. - * @note None. + * @param InSize indicates the size (width or height) of the input video. + * @param OutSize indicates the size (width or height) of the output + * video. + * @param Tap indicates the Tap number. + * @param Phase indicates the Phase number. + * + * @return The points to the coefficients ready for the scaling operation. + * + * @note None. * *****************************************************************************/ s16 *XScaler_CoefValueLookup(u32 InSize, u32 OutSize, u32 Tap, u32 Phase) @@ -676,10 +706,12 @@ s16 *XScaler_CoefValueLookup(u32 InSize, u32 OutSize, u32 Tap, u32 Phase) * XScaler_LoadCoeffBank(&Scaler, &VertChromaCoeffBank); * * - * @param InstancePtr is a pointer to the Scaler device instance to be worked - * on. - * @param CoeffBankPtr is a pointer to a coefficient bank that is to be loaded - * @return None + * @param InstancePtr is a pointer to the Scaler device instance to be + * worked on. + * @param CoeffBankPtr is a pointer to a coefficient bank that is to be + * loaded. + * + * @return None. * *****************************************************************************/ void XScaler_LoadCoeffBank(XScaler *InstancePtr, @@ -696,16 +728,17 @@ void XScaler_LoadCoeffBank(XScaler *InstancePtr, Xil_AssertVoid(CoeffBankPtr != NULL); Xil_AssertVoid(CoeffBankPtr->SetIndex < InstancePtr->Config.CoeffSetNum); Xil_AssertVoid(CoeffBankPtr->CoeffValueBuf != NULL); - Xil_AssertVoid(CoeffBankPtr->PhaseNum > 0); + Xil_AssertVoid(CoeffBankPtr->PhaseNum <= InstancePtr->Config.MaxPhaseNum); - Xil_AssertVoid(CoeffBankPtr->TapNum > 0); + Xil_AssertVoid(CoeffBankPtr->TapNum <= XSCL_MAX_TAP_NUM); /* Start the coefficient bank loading by writing the bank index first */ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_COEFFSETADDR, - CoeffBankPtr->SetIndex & XSCL_COEFFSETADDR_ADDR_MASK); + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_COEFFSETADDR_OFFSET), ((CoeffBankPtr->SetIndex) & + (XSCL_COEFFSETADDR_ADDR_MASK))); /* Now load the valid values */ CoeffValueTapBase = CoeffBankPtr->CoeffValueBuf; @@ -719,8 +752,8 @@ void XScaler_LoadCoeffBank(XScaler *InstancePtr, (((u32)CoeffValueTapBase[TapIndex++]) & 0xFFFF) << 16; } - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_COEFFVALUE, CoeffValue); + XScaler_WriteReg(InstancePtr->Config.BaseAddress, + (XSCL_COEFFVALUE_OFFSET), CoeffValue); } CoeffValueTapBase += CoeffBankPtr->TapNum; } @@ -734,11 +767,10 @@ void XScaler_LoadCoeffBank(XScaler *InstancePtr, for (TapIndex = 0; TapIndex < (CoeffBankPtr->TapNum + 1) / 2; TapIndex++) { XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_COEFFVALUE, 0); + XSCL_COEFFVALUE_OFFSET, 0); } } - return; } /*****************************************************************************/ @@ -752,22 +784,20 @@ void XScaler_LoadCoeffBank(XScaler *InstancePtr, * the vertical part and the Scaler device supports using the horizontal part * of one coefficient set w/ the vertical part of a different coefficient set. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. +* @param VertSetIndex indicates the index of the coefficient set in which +* the vertical part will be used by the Scaler device. Valid value +* is from 0 to (the number of the coefficient sets implemented by +* the Scaler device - 1). +* @param HoriSetIndex indicates the index of the coefficient set in which +* the horizontal part will be used by the Scaler device. Valid +* value is from 0 to (the number of the coefficient sets +* implemented by the Scaler device - 1). * -* @param VertSetIndex indicates the index of the coefficient set in which -* the vertical part will be used by the Scaler device. Valid value -* is from 0 to (the number of the coefficient sets implemented by the -* Scaler device - 1) +* @return None. * -* @param HoriSetIndex indicates the index of the coefficient set in which -* the horizontal part will be used by the Scaler device. Valid value -* is from 0 to (the number of the coefficient sets implemented by the -* Scaler device - 1) -* -* @return None. -* -* @note None. +* @note None. * ******************************************************************************/ void XScaler_SetActiveCoeffSet(XScaler *InstancePtr, @@ -787,9 +817,8 @@ void XScaler_SetActiveCoeffSet(XScaler *InstancePtr, XSCL_COEFFSETS_VERT_MASK; XScaler_WriteReg((InstancePtr)->Config.BaseAddress, - XSCL_COEFFSETS, RegValue); + XSCL_COEFFSETS_OFFSET, RegValue); - return; } /*****************************************************************************/ @@ -803,25 +832,23 @@ void XScaler_SetActiveCoeffSet(XScaler *InstancePtr, * the vertical part and the Scaler device supports using the horizontal part * of one coefficient set w/ the vertical part of a different coefficient set. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. +* @param VertSetIndexPtr points to the index of the active coefficient +* set in which the vertical part is being used by the Scaler +* device after this function returns. +* @param HoriSetIndexPtr points to the index of the active coefficient +* set in which the horizontal part is being used by the Scaler +* device after this function returns. * -* @param VertSetIndexPtr points to the index of the active coefficient set -* in which the vertical part is being used by the Scaler device -* after this function returns. +* @return None. * -* @param HoriSetIndexPtr points to the index of the active coefficient set -* in which the horizontal part is being used by the Scaler device -* after this function returns. -* -* @return None. -* -* @note None. +* @note None. * ******************************************************************************/ void XScaler_GetActiveCoeffSet(XScaler *InstancePtr, - u8 *VertSetIndexPtr, - u8 *HoriSetIndexPtr) + u8 *VertSetIndexPtr, + u8 *HoriSetIndexPtr) { u32 RegValue; @@ -840,7 +867,6 @@ void XScaler_GetActiveCoeffSet(XScaler *InstancePtr, *HoriSetIndexPtr = (u8)(RegValue & XSCL_COEFFSETS_HORI_MASK); - return; } /*****************************************************************************/ @@ -848,9 +874,11 @@ void XScaler_GetActiveCoeffSet(XScaler *InstancePtr, * This function calculates the index of the coefficient Bin to use based on * the input and output video size (Width or Height) * - * @param InSize indicates the size (width or height) of the input video. - * @param OutSize indicates the size (width or height) of the output video. - * @return The index of the coefficient Bin. + * @param InSize indicates the size (width or height) of the input video. + * @param OutSize indicates the size (width or height) of the output + * video. + * + * @return The index of the coefficient Bin. * *****************************************************************************/ static u32 XScaler_CoeffBinOffset(u32 InSize, u32 OutSize) @@ -864,7 +892,7 @@ static u32 XScaler_CoeffBinOffset(u32 InSize, u32 OutSize) if (OutSize > InSize) CoeffBinIndex = 0; else - CoeffBinIndex =1 + (OutSize * 16 / InSize); + CoeffBinIndex = 1 + (OutSize * 16 / InSize); return CoeffBinIndex; } @@ -872,63 +900,49 @@ static u32 XScaler_CoeffBinOffset(u32 InSize, u32 OutSize) /*****************************************************************************/ /** * -* This function returns the version of a Scaler device. +* This function returns the contents of version register of the Scaler core. * -* @param InstancePtr is a pointer to the Scaler device instance to be -* worked on. -* @param Major points to an unsigned 16-bit variable that will be assigned -* with the major version number after this function returns. Value -* range is from 0x0 to 0xF. -* @param Minor points to an unsigned 16-bit variable that will be assigned -* with the minor version number after this function returns. Value -* range is from 0x00 to 0xFF. -* @param Revision points to an unsigned 16-bit variable that will be assigned -* with the revision version number after this function returns. Value -* range is from 0xA to 0xF. -* @return None. -* @note Example: Device version should read v2.01.c if major version number -* is 0x2, minor version number is 0x1, and revision version number is -* 0xC. +* @param InstancePtr is a pointer to the Scaler core instance to be +* worked on. +* +* @return Contents of the version register. +* +* @note None. * ******************************************************************************/ -//void XScaler_GetVersion(XScaler *InstancePtr, u16 *Major, u16 *Minor, -// u16 *Revision) -//{ -// u32 Version; -// -// /* Verify arguments */ -// Xil_AssertVoid(InstancePtr != NULL); -// Xil_AssertVoid(Major != NULL); -// Xil_AssertVoid(Minor != NULL); -// Xil_AssertVoid(Revision != NULL); -// -// /* Read device version */ -// Version = XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_VER); -// -// /* Parse the version and pass the info to the caller via output -// * parameters -// */ -// *Major = (u16) -// ((Version & XSCL_VER_MAJOR_MASK) >> XSCL_VER_MAJOR_SHIFT); -// -// *Minor = (u16) -// ((Version & XSCL_VER_MINOR_MASK) >> XSCL_VER_MINOR_SHIFT); -// -// *Revision = (u16) -// ((Version & XSCL_VER_REV_MASK) >> XSCL_VER_REV_SHIFT); -// -// return; -//} +u32 XScaler_GetVersion(XScaler *InstancePtr) +{ + u32 Data; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + Data = XScaler_ReadReg(InstancePtr->Config.BaseAddress, + (XSCL_VER_OFFSET)); + + return Data; +} /*****************************************************************************/ /* - * This routine is a stub for the frame done interrupt callback. The stub is - * here in case the upper layer forgot to set the callback. On initialization, - * the frame done interrupt callback is set to this stub. It is considered an - * error for this function to be invoked. - * - *****************************************************************************/ -static void StubCallBack(void *CallBackRef, u32 EventMask) +* +* This routine is a stub for the frame done interrupt callback. The stub is +* here in case the upper layer forgot to set the callback. On initialization, +* the frame done interrupt callback is set to this stub. It is considered an +* error for this function to be invoked. +* +* @param CallBackRef is a callback reference passed in by the upper +* layer when setting the callback functions, and passed back +* to the upper layer when the callback is invoked. +* +* @return None. +* +* @note None. +* +*****************************************************************************/ +static void StubCallBack(void *CallBackRef) { + + (void)CallBackRef; Xil_AssertVoidAlways(); } diff --git a/XilinxProcessorIPLib/drivers/scaler/src/xscaler.h b/XilinxProcessorIPLib/drivers/scaler/src/xscaler.h index 0581ccfa..618a09a7 100755 --- a/XilinxProcessorIPLib/drivers/scaler/src/xscaler.h +++ b/XilinxProcessorIPLib/drivers/scaler/src/xscaler.h @@ -97,12 +97,78 @@ *
* MODIFICATION HISTORY: * -* Ver Who Date Changes -* ----- ---- -------- ------------------------------------------------------- -* 1.00a xd 05/14/09 First release -* 2.00a xd 12/14/09 Updated doxygen document tags -* 3.00a xd 07/29/10 Added device version & sharable coefficient bank support -* 6.0 adk 19/12/13 Updated as per the New Tcl API's +* Ver Who Date Changes +* ----- ------ -------- ------------------------------------------------------- +* 1.00a xd 05/14/09 First release +* 2.00a xd 12/14/09 Updated Doxygen document tags +* 3.00a xd 07/29/10 Added core version & sharable coefficient bank +* support +* 6.0 adk 12/19/13 Updated as per the New Tcl API's +* 7.0 adk 08/22/14 Removed XSCL_HANDLER_ERROR and XSCL_HANDLER_EVENT macros. +* Removed ErrorCallBack and its ref ErrorRef from XScaler +* structure. +* Modified EventCallBack as CallBack and +* EventRef as CallBackRef. +* Modified XSCL_STSDONE to XSCL_STATUS_OFFSET, +* XSCL_STS to XSCL_STATUS_OFFSET, XSCL_STSERR to +* XSCL_ERROR_OFFSET. +* Removed the following functional macros +* XScaler_IntrGetPending, +* XScaler_IntrEnableGlobal and XScaler_IntrDisableGlobal. +* uncommented interrupt related macros. +* Modified prototypes of the following functions by removing IntrType +* parameter as there was only one interrupt :XScaler_IntrEnable, +* XScaler_IntrDisable and XScaler_IntrClear. +* +* Modifications from xscalar_hw.h file are: +* Appended register offset macros with _OFFSET and +* Bit definition with _MASK. +* Provided backward compatibility for changed macros. +* Defined the following macros XSCL_CTL_MEMRD_EN_MASK. +* Modified XSCL_CTL_ENABLE to XSCL_CTL_SW_EN_MASK, +* XSCL_RESET_RESET_MASK to XSCL_CTL_RESET_MASK, +* XSCL_CTL_REGUPDATE to XSCL_CTL_RUE_MASK, +* XSCL_STSDONE_DONE and XSCL_STS_COEF_W_RDY_MASK to +* XSCL_IXR_COEF_W_RDY_MASK. +* Added XSCL_ERR_*_MASK s. +* Removed XSCL_GIER_GIE_MASK. +* Removed following macros as they were not defined in +* latest product guide(v 8.1): +* XSCL_STSERR_CODE*_MASK, XSCL_IXR_OUTPUT_FRAME_DONE_MASK, +* XSCL_IXR_COEF_FIFO_READY_MASK, XSCL_IXR_INPUT_ERROR_MASK +* XSCL_IXR_COEF_WR_ERROR_MASK, +* XSCL_IXR_REG_UPDATE_DONE_MASK, +* XSCL_IXR_OUTPUT_ERROR_MASK, XSCL_IXR_EVENT_MASK, +* XSCL_IXR_ERROR_MASK, XSCL_IXR_ALLINTR_MASK, +* XSCL_HSF_INT_MASK, XSCL_VSF_INT_MASK, +* XSCL_COEFFVALUE_BASE_SHIFT and XSCL_COEFVALUE_BASE_MASK. +* Modified bits of the following macros: +* XSCL_HSF_FRAC_MASK and XSCL_VSF_FRAC_MASK. +* +* Modifications from xscalar.c file are: +* Modified prototype of XScaler_GetVersion API. +* and functionality of StubCallBack. Modified assert +* conditions in functions XScaler_CfgInitialize, +* XScaler_SetPhaseNum, XScaler_LoadCoeffBank. +* Removed error callback from XScaler_CfgInitialize +* function. +* Uncommented XScaler_Reset in XScaler_CfgInitialize +* function. +* +* Modifications from file xscalar_coefs.c file are +* Removed typedef unsigned short s16 as it was already +* defined in xil_types.h. +* Modified coefs_struct to Coefs_Struct. +* Updated doxygen document tags. +* XScaler_coef_table is made as a global variable. +* Memory allocated was freed after usage. +* +* Modifications from xscalar_intr.c file are +* XScaler_IntrHandler and XScaler_SetCallBack APIs were +* modified +* +* Added XScaler_LookupConfig in xscalar_sinit.c file and +* ** ******************************************************************************/ @@ -119,19 +185,13 @@ extern "C" { #include "stdio.h" #include "math.h" #include "stdlib.h" - +#include "xil_assert.h" #include "xscaler_hw.h" #include "xil_types.h" #include "xstatus.h" /************************** Constant Definitions *****************************/ -/** @name Interrupt Types for setting up Callbacks - * @{ - */ -#define XSCL_HANDLER_EVENT 1 /**< Normal Event Interrupt Type */ -#define XSCL_HANDLER_ERROR 2 /**< Error Interrupt Type */ -/*@}*/ /** @name Minimum and Maximum Tap Numbers * @{ @@ -210,7 +270,7 @@ typedef struct { * either normal events or errors. The value is created by "OR'ing" * XSCL_IXR_* constants defined in xscaler_hw.h */ -typedef void (*XScaler_CallBack) (void *CallBackRef, u32 EventMask); +typedef void (*XScaler_CallBack) (void *CallBackRef); /** * The XScaler driver instance data. An instance must be allocated for each @@ -221,15 +281,10 @@ typedef struct { u32 IsReady; /**< Device and the driver instance are initialized */ - XScaler_CallBack EventCallBack; /**< Call back for Normal Event + XScaler_CallBack CallBack; /**< Call back for interrupt */ - void *EventRef; /**< To be passed to the Normal Event + void *CallBackRef; /**< To be passed to the interrupt callback */ - - XScaler_CallBack ErrorCallBack; /**< Call back for Error interrupt */ - void *ErrorRef; /**< To be passed to the Error - interrupt callback */ - } XScaler; /** @@ -287,20 +342,20 @@ typedef struct { * * This macro enables a Scaler device. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be worked +* on. * * @return None. * -* @note -* C-style signature: -* void XScaler_Enable(XScaler *InstancePtr); +* @note C-style signature: +* void XScaler_Enable(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_Enable(InstancePtr) \ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_CTL, \ - XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_CTL) \ - | XSCL_CTL_ENABLE) + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET), \ + ((XScaler_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET))) | (XSCL_CTL_SW_EN_MASK))) /*****************************************************************************/ @@ -308,58 +363,60 @@ typedef struct { * * This macro disables a Scaler device. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XScaler_Disable(XScaler *InstancePtr); +* @note C-style signature: +* void XScaler_Disable(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_Disable(InstancePtr) \ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_CTL, \ - XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_CTL) \ - & (~XSCL_CTL_ENABLE)) + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET), \ + ((XScaler_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET)) & (~(XSCL_CTL_SW_EN_MASK))))) /*****************************************************************************/ /** * * This macro checks if a Scaler device is enabled. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return TRUE if the Scaler device is enabled; FALSE otherwise. +* @return - TRUE if the Scaler device is enabled. +* - FALSE otherwise. * -* @note -* C-style signature: -* boolean XScaler_IsEnabled(XScaler *InstancePtr); +* @note C-style signature: +* boolean XScaler_IsEnabled(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_IsEnabled(InstancePtr) \ - ((XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_CTL) & \ - XSCL_CTL_ENABLE) ? TRUE : FALSE) + XScaler_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET)) & (XSCL_CTL_SW_EN_MASK) ? TRUE : FALSE /*****************************************************************************/ /** * * This macro checks if a Scaler operation is finished * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return TRUE if the Scaler operation is finished; FALSE otherwise. +* @return +* - TRUE if the Scaler operation is finished. +* - FALSE otherwise. * -* @note -* C-style signature: -* boolean XScaler_CheckDone(XScaler *InstancePtr); +* @note C-style signature: +* boolean XScaler_CheckDone(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_CheckDone(InstancePtr) \ - ((XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_STSDONE) & \ - XSCL_STSDONE_DONE) ? TRUE : FALSE) + XScaler_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_STATUS_OFFSET)) & \ + (XSCL_STS_COEF_W_RDY_MASK) ? TRUE : FALSE /*****************************************************************************/ /** @@ -367,20 +424,20 @@ typedef struct { * This macro tells a Scaler device to pick up the register value changes made * so far. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * * @return None. * -* @note -* C-style signature: -* void XScaler_EnableRegUpdate(XScaler *InstancePtr); +* @note C-style signature: +* void XScaler_EnableRegUpdate(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_EnableRegUpdate(InstancePtr) \ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_CTL, \ - XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_CTL) \ - | XSCL_CTL_REGUPDATE) + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET), \ + ((XScaler_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET))) | (XSCL_CTL_RUE_MASK))) /*****************************************************************************/ /** @@ -390,20 +447,20 @@ typedef struct { * multiple registers need to be updated. All register updates could be made * with no tight time constraints with the help of this macro. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XScaler_DisableRegUpdate(XScaler *InstancePtr); +* @note C-style signature: +* void XScaler_DisableRegUpdate(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_DisableRegUpdate(InstancePtr) \ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_CTL, \ - XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_CTL) \ - & ~XSCL_CTL_REGUPDATE) + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET), \ + ((XScaler_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET))) & (~(XSCL_CTL_RUE_MASK)))) /*****************************************************************************/ /** @@ -411,89 +468,90 @@ typedef struct { * This macro checks if a Scaler device is ready to accept the coefficients * the software is going to load. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return TRUE if the Scaler device is ready for the coefficient load; FALSE - otherwise +* @return +* - TRUE if the Scaler device is ready for the coefficient load. +* - FALSE otherwise. * -* @note -* C-style signature: -* boolean XScaler_CoeffLoadReady(XScaler *InstancePtr); +* @note C-style signature: +* boolean XScaler_CoeffLoadReady(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_CoeffLoadReady(InstancePtr) \ - ((XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_STS) & \ - XSCL_STS_COEF_W_RDY_MASK) ? TRUE : FALSE) + XScaler_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_STATUS_OFFSET)) & \ + (XSCL_STS_COEF_W_RDY_MASK) ? TRUE : FALSE /*****************************************************************************/ /** * * This macro checks the error status of a Scaler device. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return The error type, if any. Use XSCL_STSERR_* defined in xscaler_hw.h -* to interpret the value. +* @return The error type, if any. Use XSCL_STSERR_* defined in +* xscaler_hw.h to interpret the value. * -* @note -* C-style signature: -* u32 XScaler_GetError(XScaler *InstancePtr); +* @note C-style signature: +* u32 XScaler_GetError(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_GetError(InstancePtr) \ - XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_STSERR) + XScaler_ReadReg((InstancePtr)->Config.BaseAddress, (XSCL_ERROR_OFFSET)) /*****************************************************************************/ /** * * This macro resets a Scaler device. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XScaler_Reset(XScaler *InstancePtr); +* @note C-style signature: +* void XScaler_Reset(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_Reset(InstancePtr) \ - XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_CTL, \ - XSCL_RESET_RESET_MASK) + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET), (XSCL_CTL_RESET_MASK)) /*****************************************************************************/ /** * * This macro checks if the reset on a Scaler device is done. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return TRUE if the reset is done; FALSE otherwise. +* @return +* - TRUE if the reset is done; +* - FALSE otherwise. * -* @note -* C-style signature: -* boolean XScaler_IsResetDone(XScaler *InstancePtr); +* @note C-style signature: +* boolean XScaler_IsResetDone(XScaler *InstancePtr); * ******************************************************************************/ #define XScaler_IsResetDone(InstancePtr) \ - ((XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_RESET) & \ - XSCL_RESET_RESET_MASK) ? FALSE : TRUE) + XScaler_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_CTL_OFFSET)) & \ + (XSCL_CTL_RESET_MASK) ? FALSE : TRUE /*****************************************************************************/ /** * This macro calculates the N-th Triangular number: 1 + 2 + ... + N * - * @param N indicates the positive integer number to calculate the N-th - * Triangular number. - * @return The N-th triangular number. + * @param N indicates the positive integer number to calculate the N-th + * Triangular number. * - * @note - * C-style signature: - * u32 XScaler_TriangularNumber(u32 N); + * @return The N-th triangular number. + * + * @note C-style signature: + * u32 XScaler_TriangularNumber(u32 N); * *****************************************************************************/ #define XScaler_TriangularNumber(N) ((N) * ((N) + 1) / 2) @@ -503,13 +561,13 @@ typedef struct { * This macro calculates the offset of a coefficient Tap from the beginning of * a coefficient Bin. * - * @param Tap indicates the index of the coefficient tap in the coefficient - * Bin - * @return The offset of the coefficient TAP from the beginning of a - * coefficient Bin - * @note - * C-style signature: - * u32 XScaler_CoefTapOffset(u32 Tap); + * @param Tap indicates the index of the coefficient tap in the + * coefficient Bin. + * + * @return The offset of the coefficient TAP from the beginning of a + * coefficient Bin. + * @note C-style signature: + * u32 XScaler_CoefTapOffset(u32 Tap); * *****************************************************************************/ #define XScaler_CoefTapOffset(Tap) \ @@ -522,13 +580,14 @@ typedef struct { * beginning of a coefficient Tap given the currently used Phase and Tap * numbers for scaling operation. * - * @param Tap indicates the number of Taps used for the scaling operation - * @param Phase indicates the number of Phases used for the scaling operation - * @return The offset of the first coefficient Phase from the beginning of a - * coefficient Tap. - * @note - * C-style signature: - * u32 XScaler_CoefPhaseOffset(u32 Tap, u32 Phase); + * @param Tap indicates the number of Taps used for the scaling operation. + * @param Phase indicates the number of Phases used for the scaling + * operation. + * + * @return The offset of the first coefficient Phase from the beginning of + * a coefficient Tap. + * @note C-style signature: + * u32 XScaler_CoefPhaseOffset(u32 Tap, u32 Phase); * *****************************************************************************/ #define XScaler_CoefPhaseOffset(Tap, Phase) \ @@ -538,144 +597,60 @@ typedef struct { (Tap) * (XScaler_TriangularNumber(16) - 1) : \ (Tap) * (XScaler_TriangularNumber(16) - 1 + 32)) -/*****************************************************************************/ -/** -* -* This macro enables the global interrupt on a Scaler device. -* -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. -* -* @return None. -* -* @note -* C-style signature: -* void XScaler_IntrEnableGlobal(XScaler *InstancePtr); -* -******************************************************************************/ -//#define XScaler_IntrEnableGlobal(InstancePtr) \ -// XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_GIER, \ -// XSCL_GIER_GIE_MASK) /*****************************************************************************/ /** * -* This macro disables the global interrupt on a Scaler device. +* This macro enables the Coef_FIFO_Ready interrupt on a Scaler device. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XScaler_IntrDisableGlobal(XScaler *InstancePtr); +* @note C-style signature: +* void XScaler_IntrEnable(XScaler *InstancePtr); * ******************************************************************************/ -//#define XScaler_IntrDisableGlobal(InstancePtr) \ -// XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_GIER, 0) +#define XScaler_IntrEnable(InstancePtr) \ + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_IRQ_EN_OFFSET),(XSCL_IXR_COEF_W_RDY_MASK)) \ /*****************************************************************************/ /** * -* This macro enables the given individual interrupt(s) on a Scaler device. +* This macro disables the Coef_FIFO_Ready interrupt on a Scaler device. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @param IntrType is the type of the interrupts to enable. Use OR'ing of -* XSCL_IXR_* constants defined in xscaler_hw.h to create this parameter -* value. +* @return None. * -* @return None -* -* @note -* -* The existing enabled interrupt(s) will remain enabled. -* -* C-style signature: -* void XScaler_IntrEnable(XScaler *InstancePtr, u32 IntrType); +* @note C-style signature: +* void XScaler_IntrDisable(XScaler *InstancePtr); * ******************************************************************************/ -//#define XScaler_IntrEnable(InstancePtr, IntrType) \ -// XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_IER, \ -// ((IntrType) & XSCL_IXR_ALLINTR_MASK) | \ -// XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_IER)) +#define XScaler_IntrDisable(InstancePtr) \ + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_IRQ_EN_OFFSET), 0) /*****************************************************************************/ /** * -* This macro disables the given individual interrupt(s) on a Scaler device. +* This macro clears/acknowledges Coef_FIFO_Ready interrupt of a Scaler device. * -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. +* @param InstancePtr is a pointer to the Scaler device instance to be +* worked on. * -* @param IntrType is the type of the interrupts to disable. Use OR'ing of -* XSCL_IXR_* constants defined in xscaler_hw.h to create this parameter -* value. +* @return None * -* @return None -* -* @note -* -* Any other interrupt not covered by parameter IntrType, if enabled before -* this macro is called, will remain enabled. -* -* C-style signature: -* void XScaler_IntrDisable(XScaler *InstancePtr, u32 IntrType); +* @note C-style signature: +* void XScaler_IntrClear(XScaler *InstancePtr) * ******************************************************************************/ -//#define XScaler_IntrDisable(InstancePtr, IntrType) \ -// XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_IER, \ -// (~(IntrType)) & XSCL_IXR_ALLINTR_MASK & \ -// XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_IER)) - -/*****************************************************************************/ -/** -* -* This macro returns the pending interrupts of a Scaler device. -* -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. -* -* @return The pending interrupts of the Scaler. Use XSCL_IXR_* constants -* defined in xscaler_hw.h to interpret this value. -* -* @note -* -* C-style signature: -* u32 XScaler_IntrGetPending(XScaler *InstancePtr) -* -******************************************************************************/ -//#define XScaler_IntrGetPending(InstancePtr) \ -// (XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_IER) & \ -// XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_ISR) & \ -// XSCL_IXR_ALLINTR_MASK) - -/*****************************************************************************/ -/** -* -* This macro clears/acknowledges pending interrupts of a Scaler device. -* -* @param InstancePtr is a pointer to the Scaler device instance to be worked -* on. -* -* @param IntrType is the pending interrupts to clear/acknowledge. Use OR'ing -* of XSCL_IXR_* constants defined in xscaler_hw.h to create this -* parameter value. -* -* @return None -* -* @note -* -* C-style signature: -* void XScaler_IntrClear(XScaler *InstancePtr, u32 IntrType) -* -******************************************************************************/ -//#define XScaler_IntrClear(InstancePtr, IntrType) \ -// XScaler_WriteReg((InstancePtr)->Config.BaseAddress, XSCL_ISR, \ -// (IntrType) & XSCL_IXR_ALLINTR_MASK & \ -// XScaler_ReadReg((InstancePtr)->Config.BaseAddress, XSCL_ISR)) +#define XScaler_IntrClear(InstancePtr) \ + XScaler_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XSCL_STATUS_OFFSET), (XSCL_IXR_COEF_W_RDY_MASK)) /*@}*/ @@ -719,10 +694,7 @@ void XScaler_GetCoeffBankSharingInfo(XScaler *InstancePtr, u8 *ChromaFormat, u8 *ChromaLumaShareCoeff, u8 *HoriVertShareCoeff); - -/* Version functions */ -//void XScaler_GetVersion(XScaler *InstancePtr, u16 *Major, u16 *Minor, -// u16 *Revision); +u32 XScaler_GetVersion(XScaler *InstancePtr); /* * Initialization functions in xscaler_sinit.c @@ -733,7 +705,7 @@ XScaler_Config *XScaler_LookupConfig(u16 DeviceId); * Interrupt related functions in xscaler_intr.c */ void XScaler_IntrHandler(void *InstancePtr); -int XScaler_SetCallBack(XScaler *InstancePtr, u32 IntrType, +void XScaler_SetCallBack(XScaler *InstancePtr, void *CallBackFunc, void *CallBackRef); #ifdef __cplusplus diff --git a/XilinxProcessorIPLib/drivers/scaler/src/xscaler_coefs.c b/XilinxProcessorIPLib/drivers/scaler/src/xscaler_coefs.c index fb0e0fae..f1452ecb 100755 --- a/XilinxProcessorIPLib/drivers/scaler/src/xscaler_coefs.c +++ b/XilinxProcessorIPLib/drivers/scaler/src/xscaler_coefs.c @@ -43,10 +43,15 @@ * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- * 1.00a xd 06/15/09 First release. Coefficients are auto-generated in -* Matlab using -* /Video_Scaler/reference_model/src/CreateCoefficients.m +* Matlab using +* /Video_Scaler/reference_model/src/CreateCoefficients.m * 2.00a xd 12/14/09 Updated doxygen document tags * 5.00a mpv 12/13/13 Updated to dynamic coeff generation to reduce driver size +* 7.0 adk 08/22/14 Removed typedef unsigned short s16 as it was already +* defined in xil_types.h. +* Updated doxygen document tags. +* XScaler_coef_table is made as a global variable. +* Memory allocated was freed after usage. * * ******************************************************************************/ @@ -54,8 +59,11 @@ #include "xscaler.h" /************************** Constant Definitions *****************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ +/** @name PI definition + * @{ + */ +#define PI 3.14159265358979 +/*@}*/ /************************* Data Structure Definitions ************************/ @@ -86,96 +94,180 @@ u16 XScaler_CoefficientBinScalingFactors[XSCL_NUM_COEF_BINS] = { 6666 }; -/** -* XScaler_GenCoefTable generates a table that contains the coefficient values -* for scaling operations - * @param Tap is the number of taps configured - * @param Phase is the number of phase configured - * the Scaler device. - * @return XScaler_coef_table - * -************ new coef generation************ -*/ -#define PI 3.14159265358979 -typedef unsigned short uint16; +s16* XScaler_coef_table = NULL; /**< Coefficients table */ +/** +* This structure contains a pointer to double dimensional array which will be +* filled by coefficients. +*/ struct coefs_struct{ short int** coefficients; }SingleFrameCoefs; -/*memory allocation*/ -int XScaler_AllocCoefsBuff(struct coefs_struct* coefs, int max_taps, int max_phases) + +/************************** Function Definitions ******************************/ + +/*****************************************************************************/ +/** +* This function allocates memory to a double dimensional array. +* +* @param Coefs is a pointer to Coefs_Struct structure which has a +* double dimensional array which needs to be allocated memory. +* @param Max_Taps indicates the number of taps which is used to allocate +* that number of columns. +* @param Max_Phases indicates the number of phases which is used to +* allocate that number of rows. +* +* @return +* 1 - Indicates allocation of memory is failed. +* 0 - Indicates allocation of memory is success. +* +* @note None. +* +******************************************************************************/ +int XScaler_AllocCoefsBuff(struct coefs_struct* Coefs, u32 Max_Taps, + u32 Max_Phases) { - int phase, tap; - if ((coefs->coefficients = (short int **) ((uint16**)calloc(max_phases, sizeof(uint16*)))) == 0) return(1); - for (phase = 0; phase
* MODIFICATION HISTORY: * -* Ver Who Date Changes -* ----- ---- -------- ------------------------------------------------------- -* 1.00a xd 02/10/09 First release -* 2.00a xd 12/14/09 Updated doxygen document tags +* Ver Who Date Changes +* ----- ------ -------- ------------------------------------------------------ +* 1.00a xd 02/10/09 First release. +* 2.00a xd 12/14/09 Updated Doxygen document tags. +* 7.0 adk 08/22/14 XScaler_IntrHandler and XScaler_SetCallBack APIs were +* modified ** ******************************************************************************/ @@ -56,121 +58,65 @@ * * This function is the interrupt handler for the Scaler driver. * -* This handler reads the pending interrupt from the IER/ISR, determines the -* source of the interrupts, calls according callbacks, and finally clears the -* interrupts. +* This handler calls callback, and finally clears the interrupts. * * The application is responsible for connecting this function to the interrupt * system. Application beyond this driver is also responsible for providing -* callbacks to handle interrupts and installing the callbacks using -* XScaler_SetCallBack() during initialization phase. An example delivered with -* this driver demonstrates how this could be done. +* callbacks to handle interrupts and installing the callbacks using +* XScaler_SetCallBack() during initialization phase. * -* @param InstancePtr is a pointer to the XScaler instance that just -* interrupted. -* @return None. -* @note None. +* @param InstancePtr is a pointer to the XScaler instance that just +* interrupted. +* @return None. +* @note None. * ******************************************************************************/ void XScaler_IntrHandler(void *InstancePtr) { - XScaler *XScalerPtr; - u32 PendingIntr; - u32 ErrorMask; - u32 EventMask; - XScalerPtr = (XScaler *)InstancePtr; + XScaler *XScalerPtr = (XScaler *)((void *)InstancePtr); /* Validate parameters */ Xil_AssertVoid(XScalerPtr != NULL); Xil_AssertVoid(XScalerPtr->IsReady == XIL_COMPONENT_IS_READY); - /* Get pending interrupts */ - PendingIntr = XScaler_IntrGetPending(XScalerPtr); + + XScalerPtr->CallBack(XScalerPtr->CallBackRef); /* Clear pending interrupt(s) */ - XScaler_IntrClear(XScalerPtr, PendingIntr); + XScaler_IntrClear(XScalerPtr); - /* Error interrupt is occurring or spurious interrupt */ - if ((0 == (PendingIntr & XSCL_IXR_ALLINTR_MASK)) || - (PendingIntr & XSCL_IXR_ERROR_MASK)) { - ErrorMask = PendingIntr & XSCL_IXR_ERROR_MASK; - XScalerPtr->ErrorCallBack(XScalerPtr->ErrorRef, ErrorMask); - - /* The Error Interrupt Callback should reset the Scaler device - * and so there is no need to handle other pending interrupts - */ - return; - } - - /* A normal event just happened */ - if ((PendingIntr & XSCL_IXR_EVENT_MASK)) { - EventMask = PendingIntr & XSCL_IXR_EVENT_MASK; - XScalerPtr->EventCallBack(XScalerPtr->EventRef, EventMask); - } - - return; } /*****************************************************************************/ /** * -* This routine installs an asynchronous callback function for the given -* HandlerType: -* -*
-* HandlerType Callback Function Type -* ----------------------- --------------------------- -* XSCL_HANDLER_EVENT XScaler_CallBack -* XSCL_HANDLER_ERROR XScaler_CallBack -* -* HandlerType Invoked by this driver when: -* ----------------------- -------------------------------------------------- -* XSCL_HANDLER_EVENT A normal event just happened. Normal events include -* frame done, Coefficient FIFO Ready and Shadow -* Register updated. -* -* XSCL_HANDLER_ERROR An error just happened. -* -*+* This routine installs an asynchronous callback function. * * @param InstancePtr is a pointer to the XScaler instance to be worked * on. -* @param HandlerType specifies which callback is to be attached. * @param CallBackFunc is the address of the callback function. * @param CallBackRef is a user data item that will be passed to the * callback function when it is invoked. * -* @return -* - XST_SUCCESS when handler is installed. -* - XST_INVALID_PARAM when HandlerType is invalid. +* @return None. * -* @note -* Invoking this function for a handler that already has been installed replaces -* it with the new handler. +* @note None. * ******************************************************************************/ -int XScaler_SetCallBack(XScaler *InstancePtr, u32 HandlerType, +void XScaler_SetCallBack(XScaler *InstancePtr, void *CallBackFunc, void *CallBackRef) { - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertNonvoid(CallBackFunc != NULL); - Xil_AssertNonvoid(CallBackRef != NULL); - switch (HandlerType) { - case XSCL_HANDLER_EVENT: - InstancePtr->EventCallBack = (XScaler_CallBack)CallBackFunc; - InstancePtr->EventRef = CallBackRef; - break; + /* Validate arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); + Xil_AssertVoid(CallBackFunc != NULL); + Xil_AssertVoid(CallBackRef != NULL); - case XSCL_HANDLER_ERROR: - InstancePtr->ErrorCallBack = (XScaler_CallBack)CallBackFunc; - InstancePtr->ErrorRef = CallBackRef; - break; + /* Setting the HandlerType */ + InstancePtr->CallBack = + (XScaler_CallBack)((void *)CallBackFunc); + InstancePtr->CallBackRef = CallBackRef; - default: - return XST_INVALID_PARAM; - } - return XST_SUCCESS; } diff --git a/XilinxProcessorIPLib/drivers/scaler/src/xscaler_sinit.c b/XilinxProcessorIPLib/drivers/scaler/src/xscaler_sinit.c index 78bc03e1..8277d09b 100755 --- a/XilinxProcessorIPLib/drivers/scaler/src/xscaler_sinit.c +++ b/XilinxProcessorIPLib/drivers/scaler/src/xscaler_sinit.c @@ -39,10 +39,10 @@ *
* MODIFICATION HISTORY: * -* Ver Who Date Changes -* ----- ---- -------- ------------------------------------------------------- -* 1.00a xd 05/14/09 First release -* 2.00a xd 12/14/09 Updated doxygen document tags + * Ver Who Date Changes + * ----- ---- -------- -------- ------------------------------------------------------- + * 1.00a xd 05/14/09 First release + * 2.00a xd 12/14/09 Updated doxygen document tags ** *****************************************************************************/