diff --git a/XilinxProcessorIPLib/drivers/cfa/data/cfa.mdd b/XilinxProcessorIPLib/drivers/cfa/data/cfa.mdd index f42c0fee..431f5265 100755 --- a/XilinxProcessorIPLib/drivers/cfa/data/cfa.mdd +++ b/XilinxProcessorIPLib/drivers/cfa/data/cfa.mdd @@ -1,43 +1,43 @@ -############################################################################## -# -# Copyright (C) 2001 - 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 -# XILINX 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 cfa - - OPTION supported_peripherals = (v_cfa); - OPTION driver_state = ACTIVE; - OPTION copyfiles = all; - OPTION VERSION = 7.0; - OPTION NAME = cfa; - -END driver - - +############################################################################## +# +# Copyright (C) 2001 - 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 +# XILINX 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 cfa + + OPTION supported_peripherals = (v_cfa); + OPTION driver_state = ACTIVE; + OPTION copyfiles = all; + OPTION VERSION = 7.0; + OPTION NAME = cfa; + +END driver + + diff --git a/XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl b/XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl index ac96718b..c5ac99c7 100755 --- a/XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl +++ b/XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl @@ -1,33 +1,33 @@ -############################################################################## -# -# Copyright (C) 2001 - 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 -# XILINX 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. -# +############################################################################## +# +# Copyright (C) 2001 - 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 +# XILINX 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} { diff --git a/XilinxProcessorIPLib/drivers/cfa/examples/index.html b/XilinxProcessorIPLib/drivers/cfa/examples/index.html index 624181e2..0baf5fd6 100755 --- a/XilinxProcessorIPLib/drivers/cfa/examples/index.html +++ b/XilinxProcessorIPLib/drivers/cfa/examples/index.html @@ -1,18 +1,18 @@ - - - - - -Driver example applications - - - -

Example Applications for the driver cfa_v7_0

-
- -

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

- - - + + + + + +Driver example applications + + + +

Example Applications for the driver cfa_v7_0

+
+ +

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

+ + + diff --git a/XilinxProcessorIPLib/drivers/emacps/src/xemacps_bd.h b/XilinxProcessorIPLib/drivers/emacps/src/xemacps_bd.h index 17bdd8e4..df1aa95b 100644 --- a/XilinxProcessorIPLib/drivers/emacps/src/xemacps_bd.h +++ b/XilinxProcessorIPLib/drivers/emacps/src/xemacps_bd.h @@ -63,8 +63,8 @@ * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- * 1.00a wsy 01/10/10 First release - * 2.1 srt 07/15/14 Add support for Ronaldo GEM specification and 64-bit - * changes. + * 2.1 srt 07/15/14 Add support for Zynq Ultrascale MP GEM specification + * and 64-bit changes. * 3.0 kvn 02/13/15 Modified code for MISRA-C:2012 compliance. * 3.0 hk 02/20/15 Added support for jumbo frames. * Disable extended mode. Perform all 64 bit changes under diff --git a/XilinxProcessorIPLib/drivers/enhance/data/enhance.mdd b/XilinxProcessorIPLib/drivers/enhance/data/enhance.mdd index cb4915f2..67fcfc70 100755 --- a/XilinxProcessorIPLib/drivers/enhance/data/enhance.mdd +++ b/XilinxProcessorIPLib/drivers/enhance/data/enhance.mdd @@ -1,43 +1,43 @@ -############################################################################## -# -# 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 -# XILINX 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 - - +############################################################################## +# +# 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 +# XILINX 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 + + diff --git a/XilinxProcessorIPLib/drivers/enhance/data/enhance.tcl b/XilinxProcessorIPLib/drivers/enhance/data/enhance.tcl index 656332b9..7d9ab30a 100755 --- a/XilinxProcessorIPLib/drivers/enhance/data/enhance.tcl +++ b/XilinxProcessorIPLib/drivers/enhance/data/enhance.tcl @@ -1,32 +1,32 @@ -############################################################################## -# -# 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 -# XILINX 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. +############################################################################## +# +# 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 +# XILINX 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} { diff --git a/XilinxProcessorIPLib/drivers/enhance/examples/enhance_selftest_example.c b/XilinxProcessorIPLib/drivers/enhance/examples/enhance_selftest_example.c index 5ac6bb8c..1b3dd791 100644 --- a/XilinxProcessorIPLib/drivers/enhance/examples/enhance_selftest_example.c +++ b/XilinxProcessorIPLib/drivers/enhance/examples/enhance_selftest_example.c @@ -1,161 +1,161 @@ -/****************************************************************************** -* -* (c) Copyright 2010-14 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 enhance_selftest_example.c -* -* This file contains an example using the XEnhance driver to do self test -* on the device. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date     Changes
-* ----- ------ -------- -----------------------------------------------
-* 1.00a drg/jz 01/13/10 First Release
-* 1.03a  sg    08/14/12 Updated the example for CR 666306. Modified
-*		     	the device ID to use the first Device Id
-*			Removed the printf at the start of the main
-* 7.0   adk    02/19/14 Modified function names as per guidelines
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xenhance.h" -#include "xparameters.h" -#include "xil_printf.h" - -/************************** Constant Definitions *****************************/ -/* - * The following constants map to the XPAR parameters created in the - * xparameters.h file. They are defined here such that a user can easily - * change all the needed parameters in one place. - */ -/**************************** Type Definitions *******************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/************************** Function Prototypes ******************************/ - -u32 XEnhanceSelfTestExample(u16 DeviceId); - -/************************** Variable Definitions *****************************/ - -XEnhance InstancePtr; /**< Instance of the Enhance Device */ - -/*****************************************************************************/ -/** -* -* Main function to call the example. -* -* @return XST_SUCCESS if successful, otherwise XST_FAILURE. -* -* @note None. -* -******************************************************************************/ -int main(void) -{ - u32 Status; - - /* - * Run the selftest example - */ - Status = XEnhanceSelfTestExample((u16)XPAR_ENHANCE_0_DEVICE_ID); - if (Status != XST_SUCCESS) { - xil_printf("ENHANCE Selftest Example Failed\r\n"); - return XST_FAILURE; - } - - xil_printf("Successfully ran ENHANCE Selftest Example\r\n"); - - return XST_SUCCESS; -} - -/*****************************************************************************/ -/** -* -* This function does a minimal test on the XEnhance driver. -* -* -* @param DeviceId is the XPAR__DEVICE_ID value from -* xparameters.h. -* -* @return XST_SUCCESS if successful, otherwise XST_FAILURE. -* -* @note None. -* -******************************************************************************/ -u32 XEnhanceSelfTestExample(u16 DeviceId) -{ - u32 Status; - XEnhance_Config *Config; - - /* - * Initialize the ENHANCE driver so that it's ready to use - * Look up the configuration in the config table, - * then initialize it. - */ - Config = XEnhance_LookupConfig(DeviceId); - if (NULL == Config) { - return XST_FAILURE; - } - - Status = XEnhance_CfgInitialize(&InstancePtr, Config, - Config->BaseAddress); - if (Status != (u32)XST_SUCCESS) { - return (u32)XST_FAILURE; - } - - /* - * Perform a self-test to check hardware build. - */ - Status = XEnhance_SelfTest(&InstancePtr); - if (Status != (u32)XST_SUCCESS) { - return (u32)XST_FAILURE; - } - - return XST_SUCCESS; -} +/****************************************************************************** +* +* (c) Copyright 2010-14 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 enhance_selftest_example.c +* +* This file contains an example using the XEnhance driver to do self test +* on the device. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- -----------------------------------------------
+* 1.00a drg/jz 01/13/10 First Release
+* 1.03a  sg    08/14/12 Updated the example for CR 666306. Modified
+*		     	the device ID to use the first Device Id
+*			Removed the printf at the start of the main
+* 7.0   adk    02/19/14 Modified function names as per guidelines
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xenhance.h" +#include "xparameters.h" +#include "xil_printf.h" + +/************************** Constant Definitions *****************************/ +/* + * The following constants map to the XPAR parameters created in the + * xparameters.h file. They are defined here such that a user can easily + * change all the needed parameters in one place. + */ +/**************************** Type Definitions *******************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/************************** Function Prototypes ******************************/ + +u32 XEnhanceSelfTestExample(u16 DeviceId); + +/************************** Variable Definitions *****************************/ + +XEnhance InstancePtr; /**< Instance of the Enhance Device */ + +/*****************************************************************************/ +/** +* +* Main function to call the example. +* +* @return XST_SUCCESS if successful, otherwise XST_FAILURE. +* +* @note None. +* +******************************************************************************/ +int main(void) +{ + u32 Status; + + /* + * Run the selftest example + */ + Status = XEnhanceSelfTestExample((u16)XPAR_ENHANCE_0_DEVICE_ID); + if (Status != XST_SUCCESS) { + xil_printf("ENHANCE Selftest Example Failed\r\n"); + return XST_FAILURE; + } + + xil_printf("Successfully ran ENHANCE Selftest Example\r\n"); + + return XST_SUCCESS; +} + +/*****************************************************************************/ +/** +* +* This function does a minimal test on the XEnhance driver. +* +* +* @param DeviceId is the XPAR__DEVICE_ID value from +* xparameters.h. +* +* @return XST_SUCCESS if successful, otherwise XST_FAILURE. +* +* @note None. +* +******************************************************************************/ +u32 XEnhanceSelfTestExample(u16 DeviceId) +{ + u32 Status; + XEnhance_Config *Config; + + /* + * Initialize the ENHANCE driver so that it's ready to use + * Look up the configuration in the config table, + * then initialize it. + */ + Config = XEnhance_LookupConfig(DeviceId); + if (NULL == Config) { + return XST_FAILURE; + } + + Status = XEnhance_CfgInitialize(&InstancePtr, Config, + Config->BaseAddress); + if (Status != (u32)XST_SUCCESS) { + return (u32)XST_FAILURE; + } + + /* + * Perform a self-test to check hardware build. + */ + Status = XEnhance_SelfTest(&InstancePtr); + if (Status != (u32)XST_SUCCESS) { + return (u32)XST_FAILURE; + } + + return XST_SUCCESS; +} diff --git a/XilinxProcessorIPLib/drivers/enhance/examples/index.html b/XilinxProcessorIPLib/drivers/enhance/examples/index.html index f7b975f7..66e92258 100755 --- a/XilinxProcessorIPLib/drivers/enhance/examples/index.html +++ b/XilinxProcessorIPLib/drivers/enhance/examples/index.html @@ -1,18 +1,18 @@ - - - - - -Driver example applications - - - -

Example Applications for the driver enhance_v7_0

-
- -

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

- - - + + + + + +Driver example applications + + + +

Example Applications for the driver enhance_v7_0

+
+ +

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

+ + + diff --git a/XilinxProcessorIPLib/drivers/enhance/src/Makefile b/XilinxProcessorIPLib/drivers/enhance/src/Makefile index 059349eb..36194c11 100644 --- a/XilinxProcessorIPLib/drivers/enhance/src/Makefile +++ b/XilinxProcessorIPLib/drivers/enhance/src/Makefile @@ -1,29 +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} - +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} + diff --git a/XilinxProcessorIPLib/drivers/enhance/src/xenhance.c b/XilinxProcessorIPLib/drivers/enhance/src/xenhance.c index a29b3991..1a5cace3 100644 --- a/XilinxProcessorIPLib/drivers/enhance/src/xenhance.c +++ b/XilinxProcessorIPLib/drivers/enhance/src/xenhance.c @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* 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 -* XILINX 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. -* +/****************************************************************************** +* +* 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 +* XILINX 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 xenhance.c @@ -39,714 +39,714 @@ * * This file contains the implementation of the interface functions for * Enhance core. Refer to the header file xenhance.h for more detailed -* information. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who  Date     Changes
-* ----- --- -------- ---------------------------------------------------
-* 2.00a vc  12/14/10 Updated for ENHANCE V2.0
-* 3.00a rc  09/11/11 Updated for ENHANCE V3.0
-* 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.
-* 5.00a vyc 06/19/13 Updated for ENHANCE V8.0
-*                    New edge enhancement algorithm and registers
-*                    Noise reduction support added
-* 6.0   adk 19/12/13 Updated as per the New Tcl API's
-* 7.0   adk 02/19/14 Changed the filename from enhance.c to xenhance.c.
-*                    Modified the following functions
-*                    XENHANCE_CfgInitialize -> XEnhance_CfgInitialize
-*                    XENHANCE_Setup -> XEnhance_Setup
-*
-*                    Implemented the following functions:
-*                    XEnhance_GetVersion, XEnhance_EnableDbgByPass
-*                    XEnhance_IsDbgByPassEnabled, XEnhance_DisableDbgBypass
-*                    XEnhance_EnableDbgTestPattern,
-*                    XEnhance_IsDbgTestPatternEnabled
-*                    XEnhance_DisableDbgTestPattern
-*                    XEnhance_GetDbgFrameCount, XEnhance_GetDbgLineCount,
-*                    XEnhance_GetDbgPixelCount, XEnhance_SetActiveSize,
-*                    XEnhance_GetActiveSize, XEnhance_SetNoiseThreshold,
-*                    XEnhance_GetNoiseThreshold, XEnhance_SetEdgeStrength,
-*                    XEnhance_GetEdgeStrength, XEnhance_SetHaloSuppress
-*                    XEnhance_GetHaloSuppress.
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xenhance.h" - -/************************** Constant Definitions *****************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - -static void StubErrCallBack(void *CallBackRef, u32 ErrorMask); -static void StubCallBack(void *CallBackRef); - -/************************** Variable Definitions *****************************/ - - -/************************** Function Definitions *****************************/ - -/****************************************************************************/ -/** -* -* This function initializes a Enhance core. This function must be called -* prior to using a Enhance core. Initialization of a Enhance includes -* setting up the instance data, and ensuring the hardware is in a quiescent -* state. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* @param CfgPtr is a reference to a configuration structure -* containing information about the Enhance core. -* @param EffectiveAddr is the base address of the core. 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 if initialization was successful. -* -* @note None. -* -******************************************************************************/ -int XEnhance_CfgInitialize(XEnhance *InstancePtr, XEnhance_Config *CfgPtr, - u32 EffectiveAddr) -{ - /* Verify arguments. */ - Xil_AssertNonvoid(CfgPtr != NULL); - Xil_AssertNonvoid(EffectiveAddr != ((u32)0x0U)); - - /* Setup the instance */ - (void)memset((void *)InstancePtr, 0, sizeof(XEnhance)); - (void)memcpy((void *)&(InstancePtr->Config), (const void *)CfgPtr, - sizeof(XEnhance_Config)); - InstancePtr->Config.BaseAddress = EffectiveAddr; - - /* Set all handlers to stub values, let user configure this data - * later - */ - InstancePtr->ProcStartCallBack = - (XEnhance_CallBack)((void *)StubCallBack); - InstancePtr->FrameDoneCallBack = - (XEnhance_CallBack)((void *)StubCallBack); - InstancePtr->ErrCallBack = - (XEnhance_ErrorCallBack)((void *)StubErrCallBack); - - /* Reset the hardware and set the flag to indicate the core is - * ready - */ - XEnhance_Reset(InstancePtr); - InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY); - - return (XST_SUCCESS); -} - -/*****************************************************************************/ -/** -* -* This function sets the input/output frame size in Active Size register and -* enables the register update. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XEnhance_Setup(XEnhance *InstancePtr) -{ - u32 Data; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - - XEnhance_RegUpdateDisable(InstancePtr); - - /* Write active size register */ - Data = ((((InstancePtr)->VSize) << (XENH_ACTSIZE_NUM_LINE_SHIFT)) & - (XENH_ACTSIZE_NUM_LINE_MASK)) | - (((InstancePtr)->HSize) & - (XENH_ACTSIZE_NUM_PIXEL_MASK)); - - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, - (XENH_ACTIVE_SIZE_OFFSET), Data); - XEnhance_RegUpdateEnable(InstancePtr); -} - -/*****************************************************************************/ -/** -* -* This sets the bypass bit of the control register to switch the core to bypass -* mode if debug is enabled in the Enhance core. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return None. -* -* @note Debug functionality should be enabled.. -* -******************************************************************************/ -void XEnhance_EnableDbgByPass(XEnhance *InstancePtr) -{ - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid((InstancePtr)->Config.HasDebug != (u16)0x0U); - - /* Write into control register to set debug bypass. */ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET), - (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET)) | ((XENH_CTL_BPE_MASK)))); -} - -/*****************************************************************************/ -/** -* -* This function gets the current status of the bypass setting of the Enhance -* core. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return Core debug bypass mode. -* - TRUE = Bypass mode is enabled. -* - FALSE = Bypass mode is not enabled. -* -* @note Debug functionality should be enabled. -* -******************************************************************************/ -int XEnhance_IsDbgByPassEnabled(XEnhance *InstancePtr) -{ - u32 Data; - int Status; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid((InstancePtr)->Config.HasDebug != (u16)0x0U); - - /* Read from control register to know debug bypass status. */ - Data = XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET)) & ((u32)((XENH_CTL_BPE_MASK))); - if (Data == (XENH_CTL_BPE_MASK)) { - Status = (TRUE); - } - else { - Status = (FALSE); - } - - return Status; -} - -/*****************************************************************************/ -/** -* -* This function disables Bypass mode of the Enhance core. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return None. -* -* @note Debug functionality should be enabled. -* -******************************************************************************/ -void XEnhance_DisableDbgBypass(XEnhance *InstancePtr) -{ - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid((InstancePtr)->Config.HasDebug != (u16)0x0U); - - /* Write into control register to disable debug bypass. */ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET), - (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET)) & (~(XENH_CTL_BPE_MASK)))); -} - -/*****************************************************************************/ -/** -* -* This function sets the test-pattern mode of the Enhance core if debug -* features is enabled. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return None. -* -* @note Debug functionality should be enabled. -* -******************************************************************************/ -void XEnhance_EnableDbgTestPattern(XEnhance *InstancePtr) -{ - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->Config.HasDebug != (u16)0x0U); - - /* Write into control register to set test pattern. */ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET), - ((XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET))) | - ((XENH_CTL_TPE_MASK)))); -} - -/*****************************************************************************/ -/** -* -* This function gets the test-pattern mode if debug feature is enabled. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return Test-pattern generator mode. -* - TRUE = Test-pattern mode is enabled. -* - FALSE = Test-pattern mode is not enabled. -* -* @note Debug functionality should be enabled. -* -******************************************************************************/ -int XEnhance_IsDbgTestPatternEnabled(XEnhance *InstancePtr) -{ - u32 Data; - int Status; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0U); - - /* Read from control register to know debug test pattern status. */ - Data = XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET)) & ((XENH_CTL_TPE_MASK)); - if (Data == (XENH_CTL_TPE_MASK)) { - Status = (TRUE); - } - else { - Status = (FALSE); - } - - return Status; -} - -/*****************************************************************************/ -/** -* -* This function disables the test Pattern mode of the Enhance core. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return None. -* -* @note Debug functionality should be enabled. -* -******************************************************************************/ -void XEnhance_DisableDbgTestPattern(XEnhance *InstancePtr) -{ - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid((InstancePtr)->Config.HasDebug != (u16)0x0U); - - /* Write into control register to disable debug bypass. */ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET), - ((XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, - (XENH_CONTROL_OFFSET))) & - (~(XENH_CTL_TPE_MASK)))); -} -/*****************************************************************************/ -/** -* -* This function returns the contents of Version register. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return Returns the contents of the Version register. -* -* @note None. -* -******************************************************************************/ -u32 XEnhance_GetVersion(XEnhance *InstancePtr) -{ - u32 Data; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - - /* Read version register of the Enhance core */ - Data = XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, - (XENH_VERSION_OFFSET)); - - return Data; -} - -/*****************************************************************************/ -/** -* -* This function gets number of frames processed since power-up or last -* time the core is reset. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return FrameCount is the number of frames processed since power-up. -* -* @note Debug functionality should be enabled. -* -******************************************************************************/ -u32 XEnhance_GetDbgFrameCount(XEnhance *InstancePtr) -{ - u32 FrameCount; - - /* Verify argument. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); - - /* Reads Frame Throughput monitor */ - FrameCount = XEnhance_ReadReg(InstancePtr->Config.BaseAddress, - (XENH_SYSDEBUG0_OFFSET)); - - return FrameCount; -} - -/*****************************************************************************/ -/** -* -* This function gets the number of lines processed since power-up or last -* time the core is reset. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return LineCount is the number of lines processed since power-up. -* -* @note Debug functionality should be enabled. -* -******************************************************************************/ -u32 XEnhance_GetDbgLineCount(XEnhance *InstancePtr) -{ - u32 LineCount; - - /* Verify argument. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); - - /* Reads Line throughput monitor */ - LineCount = XEnhance_ReadReg(InstancePtr->Config.BaseAddress, - (XENH_SYSDEBUG1_OFFSET)); - - return LineCount; -} - -/*****************************************************************************/ -/** -* -* This function gets the number of pixels processed since power-up or last -* time the core is reset. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return PixelCount is the number of pixels processed since power-up. -* -* @note Debug functionality should be enabled. -* -******************************************************************************/ -u32 XEnhance_GetDbgPixelCount(XEnhance *InstancePtr) -{ - u32 PixelCount; - - /* Verify argument. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); - - /* Reads Pixel Throughput monitor */ - PixelCount=XEnhance_ReadReg(InstancePtr->Config.BaseAddress, - (XENH_SYSDEBUG2_OFFSET)); - - return PixelCount; -} - -/*****************************************************************************/ -/** -* -* This function sets active H/V sizes in the Active size register. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* @param HSize is number of Active Pixels per scan line to be set. -* Range of HSize is 32 to 7680. -* @param VSize is number of Active Lines per frame to be set. -* Range of VSize is 32 to 7680. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XEnhance_SetActiveSize(XEnhance *InstancePtr, u16 HSize, u16 VSize) -{ - u32 Size; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid((VSize >= (u16)(XENH_VSIZE_FIRST)) && - (VSize <= (u16)(XENH_VSIZE_LAST))); - Xil_AssertVoid((HSize >= (u16)(XENH_HSIZE_FIRST)) && - (HSize <= (u16)(XENH_HSIZE_LAST))); - - Size = (((u32)VSize) << ((u32)(XENH_ACTSIZE_NUM_LINE_SHIFT))) | (HSize); - XEnhance_WriteReg(InstancePtr->Config.BaseAddress, - (XENH_ACTIVE_SIZE_OFFSET), Size); -} - -/*****************************************************************************/ -/** -* -* This function gets the number of Active Pixel per Scan line -* and number of Active Lines per Frame from the Active Frame Size register. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* @param HSize is a pointer to 16-bit variable in which -* the number of Active Pixels per Scan Line is returned. -* (Range is 32 to 7680). -* @param VSize is a pointer to 16-bit variable in which -* the number of Active Lines per Frame is returned. -* (Range is 32 to 7680). -* -* @return None. -* -* @note None. -* -*****************************************************************************/ -void XEnhance_GetActiveSize(XEnhance *InstancePtr, u16 *HSize, u16 *VSize) -{ - u32 Data; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(HSize != NULL); - Xil_AssertVoid(VSize != NULL); - - Data = XEnhance_ReadReg(InstancePtr->Config.BaseAddress, - XENH_ACTIVE_SIZE_OFFSET); - - /* Reads Number of Active Lines per Frame */ - *HSize = (u16)((Data) & (XENH_ACTSIZE_NUM_PIXEL_MASK)); - - /* Reads Number of Active Lines per Frame */ - *VSize = (u16)((Data) & (XENH_ACTSIZE_NUM_LINE_MASK)) >> - (XENH_ACTSIZE_NUM_LINE_SHIFT); -} - -/*****************************************************************************/ -/** -* -* This function sets the Noise Threshold value for the Enhance core -* The amount of noise reduction can be controlled through Noise -* Threshold parameter. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* @param Threshold is the value to set the Noise Threshold. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XEnhance_SetNoiseThreshold(XEnhance *InstancePtr, u32 Threshold) -{ - /* Verify argument. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(Threshold <= (u32)XENH_NOISETHRES_MAX); - - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, - (XENH_NOISE_THRESHOLD_OFFSET), Threshold); - -} - -/*****************************************************************************/ -/** -* -* This function gets the Noise Threshold value for the Enhance core. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return The amount of noise reduction that can be controlled. -* -* @note None. -* -******************************************************************************/ -u32 XEnhance_GetNoiseThreshold(XEnhance *InstancePtr) -{ - u32 NoiseThreshold; - - /* Verify argument. */ - Xil_AssertNonvoid(InstancePtr != NULL); - - NoiseThreshold = (XEnhance_ReadReg(InstancePtr-> Config.BaseAddress, - (XENH_NOISE_THRESHOLD_OFFSET))) & - (XENH_NOISE_THRESHOLD_MASK); - - return NoiseThreshold; -} - -/*****************************************************************************/ -/** -* -* This function sets the Edge Strength value for the Enhance core. -* i.e. The amount of edge enhancement can be controlled through the -* programmable Enhance Strength parameter. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* @param Strength is the value to set the Edge Strength of the core. -* -* @return None. -* -* @note The larger the strength, the stronger the edge enhancement. -* -******************************************************************************/ -void XEnhance_SetEdgeStrength(XEnhance *InstancePtr, u32 Strength) -{ - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(Strength <= (u32)XENH_ENHSTRENGTH_MAX); - - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, - (XENH_ENHANCE_STRENGTH_OFFSET), Strength); -} - -/*****************************************************************************/ -/** -* -* This function gets the Edge Strength value for the Enhance core. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return The amount of edge enhancement that can be controlled. -* -* @note None. -* -******************************************************************************/ -u32 XEnhance_GetEdgeStrength(XEnhance *InstancePtr) -{ - u32 EdgeStrength; - - /* Verify argument. */ - Xil_AssertNonvoid(InstancePtr != NULL); - - EdgeStrength = (XEnhance_ReadReg(InstancePtr->Config.BaseAddress, - (XENH_ENHANCE_STRENGTH_OFFSET))) & - (XENH_STRENGTH_MASK); - - return EdgeStrength; -} - -/*****************************************************************************/ -/** -* -* This function sets the Halo Suppress value for the Enhance core. -* i.e. The amount of halo suppression can be controlled through the -* programmable Halo Suppress parameter. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* @param Suppress is the value to set the Suppression value. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XEnhance_SetHaloSuppress(XEnhance *InstancePtr, u32 Suppress) -{ - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(Suppress <= (u32)XENH_HALOSUPPRESS_MAX); - - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, - (XENH_HALO_SUPPRESS_OFFSET), Suppress); -} - -/*****************************************************************************/ -/** -* -* This function gets the Halo Suppress value for the Enhance core. -* -* @param InstancePtr is a pointer to XEnhance instance to be worked on. -* -* @return The amount of halo suppression that can be controlled. -* -* @note None. -* -******************************************************************************/ -u32 XEnhance_GetHaloSuppress(XEnhance *InstancePtr) -{ - u32 HaloSuppress; - - /* Verify argument. */ - Xil_AssertNonvoid(InstancePtr != NULL); - - HaloSuppress = (XEnhance_ReadReg(InstancePtr->Config.BaseAddress, - (XENH_HALO_SUPPRESS_OFFSET))) & - (XENH_HALO_SUPPRESS_MASK); - - return HaloSuppress; -} - -/*****************************************************************************/ -/** -* -* This routine is a stub for the asynchronous callbacks. The stub is here in -* case the upper layer forgot to set the handlers. On initialization, All -* handlers except error handler are set to this callback. It is considered an -* error for this handler 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) -{ - /* Verify arguments. */ - Xil_AssertVoid(CallBackRef != NULL); - Xil_AssertVoidAlways(); -} - -/*****************************************************************************/ -/** -* -* This routine is a stub for the asynchronous error interrupt callback. The -* stub is here in case the upper layer forgot to set the handler. On -* initialization, Error interrupt handler is set to this callback. It is -* considered an error for this handler 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. -* @param ErrorMask is a bit mask indicating the cause of the error. Its -* value equals 'OR'ing one or more XENH_IXR_*_MASK values defined -* in xenhance_hw.h. -* -* @return None. -* -* @note None. -* -*****************************************************************************/ -static void StubErrCallBack(void *CallBackRef, u32 ErrorMask) -{ - /* Verify arguments. */ - Xil_AssertVoid((ErrorMask == ((u32)0x0U)) || - (ErrorMask > ((u32)0x0U))); +* information. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who  Date     Changes
+* ----- --- -------- ---------------------------------------------------
+* 2.00a vc  12/14/10 Updated for ENHANCE V2.0
+* 3.00a rc  09/11/11 Updated for ENHANCE V3.0
+* 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.
+* 5.00a vyc 06/19/13 Updated for ENHANCE V8.0
+*                    New edge enhancement algorithm and registers
+*                    Noise reduction support added
+* 6.0   adk 19/12/13 Updated as per the New Tcl API's
+* 7.0   adk 02/19/14 Changed the filename from enhance.c to xenhance.c.
+*                    Modified the following functions
+*                    XENHANCE_CfgInitialize -> XEnhance_CfgInitialize
+*                    XENHANCE_Setup -> XEnhance_Setup
+*
+*                    Implemented the following functions:
+*                    XEnhance_GetVersion, XEnhance_EnableDbgByPass
+*                    XEnhance_IsDbgByPassEnabled, XEnhance_DisableDbgBypass
+*                    XEnhance_EnableDbgTestPattern,
+*                    XEnhance_IsDbgTestPatternEnabled
+*                    XEnhance_DisableDbgTestPattern
+*                    XEnhance_GetDbgFrameCount, XEnhance_GetDbgLineCount,
+*                    XEnhance_GetDbgPixelCount, XEnhance_SetActiveSize,
+*                    XEnhance_GetActiveSize, XEnhance_SetNoiseThreshold,
+*                    XEnhance_GetNoiseThreshold, XEnhance_SetEdgeStrength,
+*                    XEnhance_GetEdgeStrength, XEnhance_SetHaloSuppress
+*                    XEnhance_GetHaloSuppress.
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xenhance.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + +static void StubErrCallBack(void *CallBackRef, u32 ErrorMask); +static void StubCallBack(void *CallBackRef); + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/****************************************************************************/ +/** +* +* This function initializes a Enhance core. This function must be called +* prior to using a Enhance core. Initialization of a Enhance includes +* setting up the instance data, and ensuring the hardware is in a quiescent +* state. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* @param CfgPtr is a reference to a configuration structure +* containing information about the Enhance core. +* @param EffectiveAddr is the base address of the core. 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 if initialization was successful. +* +* @note None. +* +******************************************************************************/ +int XEnhance_CfgInitialize(XEnhance *InstancePtr, XEnhance_Config *CfgPtr, + u32 EffectiveAddr) +{ + /* Verify arguments. */ + Xil_AssertNonvoid(CfgPtr != NULL); + Xil_AssertNonvoid(EffectiveAddr != ((u32)0x0U)); + + /* Setup the instance */ + (void)memset((void *)InstancePtr, 0, sizeof(XEnhance)); + (void)memcpy((void *)&(InstancePtr->Config), (const void *)CfgPtr, + sizeof(XEnhance_Config)); + InstancePtr->Config.BaseAddress = EffectiveAddr; + + /* Set all handlers to stub values, let user configure this data + * later + */ + InstancePtr->ProcStartCallBack = + (XEnhance_CallBack)((void *)StubCallBack); + InstancePtr->FrameDoneCallBack = + (XEnhance_CallBack)((void *)StubCallBack); + InstancePtr->ErrCallBack = + (XEnhance_ErrorCallBack)((void *)StubErrCallBack); + + /* Reset the hardware and set the flag to indicate the core is + * ready + */ + XEnhance_Reset(InstancePtr); + InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY); + + return (XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* +* This function sets the input/output frame size in Active Size register and +* enables the register update. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XEnhance_Setup(XEnhance *InstancePtr) +{ + u32 Data; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + + XEnhance_RegUpdateDisable(InstancePtr); + + /* Write active size register */ + Data = ((((InstancePtr)->VSize) << (XENH_ACTSIZE_NUM_LINE_SHIFT)) & + (XENH_ACTSIZE_NUM_LINE_MASK)) | + (((InstancePtr)->HSize) & + (XENH_ACTSIZE_NUM_PIXEL_MASK)); + + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, + (XENH_ACTIVE_SIZE_OFFSET), Data); + XEnhance_RegUpdateEnable(InstancePtr); +} + +/*****************************************************************************/ +/** +* +* This sets the bypass bit of the control register to switch the core to bypass +* mode if debug is enabled in the Enhance core. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return None. +* +* @note Debug functionality should be enabled.. +* +******************************************************************************/ +void XEnhance_EnableDbgByPass(XEnhance *InstancePtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid((InstancePtr)->Config.HasDebug != (u16)0x0U); + + /* Write into control register to set debug bypass. */ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET), + (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET)) | ((XENH_CTL_BPE_MASK)))); +} + +/*****************************************************************************/ +/** +* +* This function gets the current status of the bypass setting of the Enhance +* core. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return Core debug bypass mode. +* - TRUE = Bypass mode is enabled. +* - FALSE = Bypass mode is not enabled. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +int XEnhance_IsDbgByPassEnabled(XEnhance *InstancePtr) +{ + u32 Data; + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid((InstancePtr)->Config.HasDebug != (u16)0x0U); + + /* Read from control register to know debug bypass status. */ + Data = XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET)) & ((u32)((XENH_CTL_BPE_MASK))); + if (Data == (XENH_CTL_BPE_MASK)) { + Status = (TRUE); + } + else { + Status = (FALSE); + } + + return Status; +} + +/*****************************************************************************/ +/** +* +* This function disables Bypass mode of the Enhance core. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return None. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +void XEnhance_DisableDbgBypass(XEnhance *InstancePtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid((InstancePtr)->Config.HasDebug != (u16)0x0U); + + /* Write into control register to disable debug bypass. */ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET), + (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET)) & (~(XENH_CTL_BPE_MASK)))); +} + +/*****************************************************************************/ +/** +* +* This function sets the test-pattern mode of the Enhance core if debug +* features is enabled. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return None. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +void XEnhance_EnableDbgTestPattern(XEnhance *InstancePtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->Config.HasDebug != (u16)0x0U); + + /* Write into control register to set test pattern. */ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET), + ((XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET))) | + ((XENH_CTL_TPE_MASK)))); +} + +/*****************************************************************************/ +/** +* +* This function gets the test-pattern mode if debug feature is enabled. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return Test-pattern generator mode. +* - TRUE = Test-pattern mode is enabled. +* - FALSE = Test-pattern mode is not enabled. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +int XEnhance_IsDbgTestPatternEnabled(XEnhance *InstancePtr) +{ + u32 Data; + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0U); + + /* Read from control register to know debug test pattern status. */ + Data = XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET)) & ((XENH_CTL_TPE_MASK)); + if (Data == (XENH_CTL_TPE_MASK)) { + Status = (TRUE); + } + else { + Status = (FALSE); + } + + return Status; +} + +/*****************************************************************************/ +/** +* +* This function disables the test Pattern mode of the Enhance core. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return None. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +void XEnhance_DisableDbgTestPattern(XEnhance *InstancePtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid((InstancePtr)->Config.HasDebug != (u16)0x0U); + + /* Write into control register to disable debug bypass. */ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET), + ((XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, + (XENH_CONTROL_OFFSET))) & + (~(XENH_CTL_TPE_MASK)))); +} +/*****************************************************************************/ +/** +* +* This function returns the contents of Version register. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return Returns the contents of the Version register. +* +* @note None. +* +******************************************************************************/ +u32 XEnhance_GetVersion(XEnhance *InstancePtr) +{ + u32 Data; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + /* Read version register of the Enhance core */ + Data = XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, + (XENH_VERSION_OFFSET)); + + return Data; +} + +/*****************************************************************************/ +/** +* +* This function gets number of frames processed since power-up or last +* time the core is reset. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return FrameCount is the number of frames processed since power-up. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +u32 XEnhance_GetDbgFrameCount(XEnhance *InstancePtr) +{ + u32 FrameCount; + + /* Verify argument. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Reads Frame Throughput monitor */ + FrameCount = XEnhance_ReadReg(InstancePtr->Config.BaseAddress, + (XENH_SYSDEBUG0_OFFSET)); + + return FrameCount; +} + +/*****************************************************************************/ +/** +* +* This function gets the number of lines processed since power-up or last +* time the core is reset. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return LineCount is the number of lines processed since power-up. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +u32 XEnhance_GetDbgLineCount(XEnhance *InstancePtr) +{ + u32 LineCount; + + /* Verify argument. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Reads Line throughput monitor */ + LineCount = XEnhance_ReadReg(InstancePtr->Config.BaseAddress, + (XENH_SYSDEBUG1_OFFSET)); + + return LineCount; +} + +/*****************************************************************************/ +/** +* +* This function gets the number of pixels processed since power-up or last +* time the core is reset. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return PixelCount is the number of pixels processed since power-up. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +u32 XEnhance_GetDbgPixelCount(XEnhance *InstancePtr) +{ + u32 PixelCount; + + /* Verify argument. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Reads Pixel Throughput monitor */ + PixelCount=XEnhance_ReadReg(InstancePtr->Config.BaseAddress, + (XENH_SYSDEBUG2_OFFSET)); + + return PixelCount; +} + +/*****************************************************************************/ +/** +* +* This function sets active H/V sizes in the Active size register. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* @param HSize is number of Active Pixels per scan line to be set. +* Range of HSize is 32 to 7680. +* @param VSize is number of Active Lines per frame to be set. +* Range of VSize is 32 to 7680. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XEnhance_SetActiveSize(XEnhance *InstancePtr, u16 HSize, u16 VSize) +{ + u32 Size; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid((VSize >= (u16)(XENH_VSIZE_FIRST)) && + (VSize <= (u16)(XENH_VSIZE_LAST))); + Xil_AssertVoid((HSize >= (u16)(XENH_HSIZE_FIRST)) && + (HSize <= (u16)(XENH_HSIZE_LAST))); + + Size = (((u32)VSize) << ((u32)(XENH_ACTSIZE_NUM_LINE_SHIFT))) | (HSize); + XEnhance_WriteReg(InstancePtr->Config.BaseAddress, + (XENH_ACTIVE_SIZE_OFFSET), Size); +} + +/*****************************************************************************/ +/** +* +* This function gets the number of Active Pixel per Scan line +* and number of Active Lines per Frame from the Active Frame Size register. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* @param HSize is a pointer to 16-bit variable in which +* the number of Active Pixels per Scan Line is returned. +* (Range is 32 to 7680). +* @param VSize is a pointer to 16-bit variable in which +* the number of Active Lines per Frame is returned. +* (Range is 32 to 7680). +* +* @return None. +* +* @note None. +* +*****************************************************************************/ +void XEnhance_GetActiveSize(XEnhance *InstancePtr, u16 *HSize, u16 *VSize) +{ + u32 Data; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(HSize != NULL); + Xil_AssertVoid(VSize != NULL); + + Data = XEnhance_ReadReg(InstancePtr->Config.BaseAddress, + XENH_ACTIVE_SIZE_OFFSET); + + /* Reads Number of Active Lines per Frame */ + *HSize = (u16)((Data) & (XENH_ACTSIZE_NUM_PIXEL_MASK)); + + /* Reads Number of Active Lines per Frame */ + *VSize = (u16)((Data) & (XENH_ACTSIZE_NUM_LINE_MASK)) >> + (XENH_ACTSIZE_NUM_LINE_SHIFT); +} + +/*****************************************************************************/ +/** +* +* This function sets the Noise Threshold value for the Enhance core +* The amount of noise reduction can be controlled through Noise +* Threshold parameter. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* @param Threshold is the value to set the Noise Threshold. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XEnhance_SetNoiseThreshold(XEnhance *InstancePtr, u32 Threshold) +{ + /* Verify argument. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(Threshold <= (u32)XENH_NOISETHRES_MAX); + + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, + (XENH_NOISE_THRESHOLD_OFFSET), Threshold); + +} + +/*****************************************************************************/ +/** +* +* This function gets the Noise Threshold value for the Enhance core. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return The amount of noise reduction that can be controlled. +* +* @note None. +* +******************************************************************************/ +u32 XEnhance_GetNoiseThreshold(XEnhance *InstancePtr) +{ + u32 NoiseThreshold; + + /* Verify argument. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + NoiseThreshold = (XEnhance_ReadReg(InstancePtr-> Config.BaseAddress, + (XENH_NOISE_THRESHOLD_OFFSET))) & + (XENH_NOISE_THRESHOLD_MASK); + + return NoiseThreshold; +} + +/*****************************************************************************/ +/** +* +* This function sets the Edge Strength value for the Enhance core. +* i.e. The amount of edge enhancement can be controlled through the +* programmable Enhance Strength parameter. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* @param Strength is the value to set the Edge Strength of the core. +* +* @return None. +* +* @note The larger the strength, the stronger the edge enhancement. +* +******************************************************************************/ +void XEnhance_SetEdgeStrength(XEnhance *InstancePtr, u32 Strength) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(Strength <= (u32)XENH_ENHSTRENGTH_MAX); + + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, + (XENH_ENHANCE_STRENGTH_OFFSET), Strength); +} + +/*****************************************************************************/ +/** +* +* This function gets the Edge Strength value for the Enhance core. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return The amount of edge enhancement that can be controlled. +* +* @note None. +* +******************************************************************************/ +u32 XEnhance_GetEdgeStrength(XEnhance *InstancePtr) +{ + u32 EdgeStrength; + + /* Verify argument. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + EdgeStrength = (XEnhance_ReadReg(InstancePtr->Config.BaseAddress, + (XENH_ENHANCE_STRENGTH_OFFSET))) & + (XENH_STRENGTH_MASK); + + return EdgeStrength; +} + +/*****************************************************************************/ +/** +* +* This function sets the Halo Suppress value for the Enhance core. +* i.e. The amount of halo suppression can be controlled through the +* programmable Halo Suppress parameter. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* @param Suppress is the value to set the Suppression value. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XEnhance_SetHaloSuppress(XEnhance *InstancePtr, u32 Suppress) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(Suppress <= (u32)XENH_HALOSUPPRESS_MAX); + + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, + (XENH_HALO_SUPPRESS_OFFSET), Suppress); +} + +/*****************************************************************************/ +/** +* +* This function gets the Halo Suppress value for the Enhance core. +* +* @param InstancePtr is a pointer to XEnhance instance to be worked on. +* +* @return The amount of halo suppression that can be controlled. +* +* @note None. +* +******************************************************************************/ +u32 XEnhance_GetHaloSuppress(XEnhance *InstancePtr) +{ + u32 HaloSuppress; + + /* Verify argument. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + HaloSuppress = (XEnhance_ReadReg(InstancePtr->Config.BaseAddress, + (XENH_HALO_SUPPRESS_OFFSET))) & + (XENH_HALO_SUPPRESS_MASK); + + return HaloSuppress; +} + +/*****************************************************************************/ +/** +* +* This routine is a stub for the asynchronous callbacks. The stub is here in +* case the upper layer forgot to set the handlers. On initialization, All +* handlers except error handler are set to this callback. It is considered an +* error for this handler 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) +{ + /* Verify arguments. */ + Xil_AssertVoid(CallBackRef != NULL); + Xil_AssertVoidAlways(); +} + +/*****************************************************************************/ +/** +* +* This routine is a stub for the asynchronous error interrupt callback. The +* stub is here in case the upper layer forgot to set the handler. On +* initialization, Error interrupt handler is set to this callback. It is +* considered an error for this handler 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. +* @param ErrorMask is a bit mask indicating the cause of the error. Its +* value equals 'OR'ing one or more XENH_IXR_*_MASK values defined +* in xenhance_hw.h. +* +* @return None. +* +* @note None. +* +*****************************************************************************/ +static void StubErrCallBack(void *CallBackRef, u32 ErrorMask) +{ + /* Verify arguments. */ + Xil_AssertVoid((ErrorMask == ((u32)0x0U)) || + (ErrorMask > ((u32)0x0U))); Xil_AssertVoid(CallBackRef != NULL); Xil_AssertVoidAlways(); } diff --git a/XilinxProcessorIPLib/drivers/enhance/src/xenhance.h b/XilinxProcessorIPLib/drivers/enhance/src/xenhance.h index d9343c98..cd69c5d6 100644 --- a/XilinxProcessorIPLib/drivers/enhance/src/xenhance.h +++ b/XilinxProcessorIPLib/drivers/enhance/src/xenhance.h @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* 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 -* XILINX 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. -* +/****************************************************************************** +* +* 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 +* XILINX 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 xenhance.h @@ -39,608 +39,608 @@ * * This header file contains identifiers and register-level driver functions (or * macros), range macros, structure typedefs that can be used to access the -* Image Statistic core instance. -* -* The Image Enhancement core offers noise reduction and/or edge enhancement. -* For edge enhancement, optional anti-halo and anti-alias post-processing -* modules are available to reduce image artifacts that can appear from the -* high-pass filtering of the edge enhancement filters. The amount of noise -* reduction and edge enhancement is controlled through user parameters. -* There are two variations of the algorithm offered to choose between high -* performance and minimal resource usage. This core works on YCbCr 4:4:4 and -* 4:2:2 data. The core is capable of a maximum resolution of 7680 columns by -* 7680 rows with 8, 10, 12, or 16 bits per pixel and supports the bandwidth -* necessary for High-definition (1080p60) resolutions in all Xilinx FPGA device -* families. Higher resolutions can be supported in Xilinx high-performance -* device families. -* -* Initialization & Configuration -* -* The device driver enables higher layer software (e.g., an application) to -* communicate to the Enhance core. -* -* XEnhance_CfgInitialize() API is used to initialize the Enhance core. -* The user needs to first call the XEnhance_LookupConfig() API which returns -* the Configuration structure pointer which is passed as a parameter to the -* XEnhance_CfgInitialize() API. -* -* Interrupts -* -* The driver provides an interrupt handler XEnhance_IntrHandler for handling -* the interrupt from the Enhance core. The users of this driver have to -* register this handler with the interrupt system and provide the callback -* functions by using XEnhance_SetCallBack API. -* -* Virtual Memory -* -* This driver supports Virtual Memory. The RTOS is responsible for calculating -* the correct device base address in Virtual Memory space. -* -* Threads -* -* This driver is not thread safe. Any needs for threads or thread mutual -* exclusion must be satisfied by the layer above this driver. -* -* Asserts -* -* Asserts are used within all Xilinx drivers to enforce constraints on argument -* values. Asserts can be turned off on a system-wide basis by defining, at -* compile time, the NDEBUG identifier. By default, asserts are turned on and it -* is recommended that users leave asserts on during development. -* -* Building the driver -* -* The XEnhance driver is composed of several source files. This allows the user -* to build and link only those parts of the driver that are necessary. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- ---- -------- -----------------------------------------------------
-* 2.00a vc  12/14/10 Updated for ENHANCE V2.0
-* 3.00a rc  09/11/11 Updated for ENHANCE V3.0
-* 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.
-* 5.00a vyc 06/19/13 Updated for ENHANCE V8.0
-*                    New edge enhancement algorithm and registers
-*                    Noise reduction support added
-* 6.0   adk 19/12/13 Updated as per the New Tcl API's
-* 7.0   adk 02/19/14 Changed the filename from enhance.h to xenhance.h.
-*                    Changes in xenhance.h:
-*                    Removed the following macros
-*                    ENHANCE_Enable, ENHANCE_Disable, ENHANCE_RegUpdateEnable,
-*                    ENHANCE_RegUpdateDisable, ENHANCE_Reset,
-*                    ENHANCE_AutoSyncReset
-*
-*                    Added the following function macros
-*                    XEnhance_Enable, XEnhance_Disable,
-*                    XEnhance_RegUpdateDisable, XEnhance_RegUpdateDisable
-*                    XEnhance_Reset, XEnhance_SyncReset, XEnhance_IntrEnable
-*                    XEnhance_IntrDisable, XEnhance_StatusGetPending
-*                    XEnhance_IntrGetPending, XEnhance_IntrClear
-*
-*                    Added the following type definitions:
-*                    XEnhance_Config and XEnhance structures.
-*                    XEnhance_CallBack and XEnhance_ErrorCallBack.
-*
-*                    Changes in xenhance.c:
-*                    Modified the following functions
-*                    XENHANCE_CfgInitialize -> XEnhance_CfgInitialize
-*                    XENHANCE_Setup -> XEnhance_Setup
-*
-*                    Implemented the following functions:
-*                    XEnhance_CfgInitialize, XEnhance_Setup,
-*                    XEnhance_GetVersion, XEnhance_EnableDbgByPass,
-*                    XEnhance_IsDbgByPassEnabled, XEnhance_DisableDbgBypass
-*                    XEnhance_EnableDbgTestPattern,
-*                    XEnhance_IsDbgTestPatternEnabled
-*                    XEnhance_DisableDbgTestPattern
-*                    XEnhance_GetDbgFrameCount, XEnhance_GetDbgLineCount,
-*                    XEnhance_GetDbgPixelCount, XEnhance_SetActiveSize,
-*                    XEnhance_GetActiveSize, XEnhance_SetNoiseThreshold,
-*                    XEnhance_GetNoiseThreshold, XEnhance_SetEdgeStrength,
-*                    XEnhance_GetEdgeStrength, XEnhance_SetHaloSuppress
-*                    XEnhance_GetHaloSuppress.
-*
-*                    Changes in xenhance_hw.h:
-*                    Added the register offsets and bit masks for the
-*                    registers and added backward compatibility for macros.
-*
-*                    Changes in xenhance_intr.c:
-*                    Implemented the following functions
-*                    XEnhance_IntrHandler
-*                    XEnhance_SetCallBack
-*
-*                    Changes in xenhance_sinit.c:
-*                    Implemented the following function
-*                    XEnhance_LookupConfig
-*
-*                    Changes in xenhance_selftest.c:
-*                    Implemented the following function
-*                    XEnhance_SelfTest
-* 
-* -******************************************************************************/ - -#ifndef XENHANCE_H_ -#define XENHANCE_H_ /**< Prevent circular inclusions by using - * protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ - -#include "xil_assert.h" -#include "xstatus.h" -#include "xenhance_hw.h" - -/************************** Constant Definitions *****************************/ - -/** @name Handler Types -* @{ -*/ -/** -* These constants specify different types of handlers and used to -* differentiate interrupt requests from core. -* -*/ -enum { - XENH_HANDLER_PROCSTART = 1, /**< A processing start event - * interrupt type */ - XENH_HANDLER_FRAMEDONE, /**< A frame done event - * interrupt type */ - XENH_HANDLER_ERROR /**< An error condition event - * interrupt type */ -} ; -/*@}*/ - -/** @name Active size range macros -* @{ -*/ -#define XENH_VSIZE_FIRST 32 /**< Vertical Size starting - * value */ -#define XENH_VSIZE_LAST 7680 /**< Vertical Size ending - * value */ -#define XENH_HSIZE_FIRST 32 /**< Horizontal Size starting - * value */ -#define XENH_HSIZE_LAST 7680 /**< Horizontal Size ending - * value */ -/*@}*/ - -/** @name Noise threshold range macros -* @{ -*/ -#define XENH_NOISETHRES_MIN 0 /**< Noise threshold starting - * value */ -#define XENH_NOISETHRES_MAX 255 /**< Noise threshold ending - * value */ -/*@}*/ - -/** @name Strength range macros -* @{ -*/ -#define XENH_ENHSTRENGTH_MIN 0 /**< Strength starting value */ -#define XENH_ENHSTRENGTH_MAX 32768 /**< Strength ending value */ -/*@}*/ - -/** @name Halo Suppress range macros -* @{ -*/ -#define XENH_HALOSUPPRESS_MIN 0 /**< Halo Suppress starting - * value */ -#define XENH_HALOSUPPRESS_MAX 32768 /**< Halo Suppress ending - * value */ -/*@}*/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -/*****************************************************************************/ -/** -* -* This function macro enables the Image Enhancement core instance. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return None. -* -* @note C-style signature: -* void XEnhance_Enable(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_Enable(InstancePtr) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET), \ - XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET)) | (XENH_CTL_SW_EN_MASK)) - -/*****************************************************************************/ -/** -* -* This function macro disables the Image Enhancement core instance. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return None. -* -* @note C-style signature: -* void XEnhance_Disable(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_Disable(InstancePtr) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET), \ - XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET)) & (~(XENH_CTL_SW_EN_MASK))) - -/*****************************************************************************/ -/** -* -* This function macro starts the Image Enhancement core instance. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return None. -* -* @note C-style signature: -* void XEnhance_Start(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_Start XEnhance_Enable - -/*****************************************************************************/ -/** -* -* This function macro stops the Image Enhancement core instance. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return None. -* -* @note C-style signature: -* void XEnhance_Stop(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_Stop XEnhance_Disable - -/*****************************************************************************/ -/** -* -* This function macro commits all the register value changes made so far by the -* software to the Image Enhancement core instance. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return None. -* -* @note C-style signature: -* void XEnhance_RegUpdateEnable(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_RegUpdateEnable(InstancePtr) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET), \ - (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET))) | (XENH_CTL_RUE_MASK)) - -/*****************************************************************************/ -/** -* -* This function 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. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return None. -* -* @note C-style signature: -* void XEnhance_RegUpdateDisable(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_RegUpdateDisable(InstancePtr) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET), \ - ((XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET))) & \ - (~(XENH_CTL_RUE_MASK)))) - -/*****************************************************************************/ -/** -* -* This function macro resets a Image Enhancement core instance, but differs from -* XEnhance_Reset() in that it automatically synchronizes to the SOF input of -* the core to prevent tearing. -* -* On the next SOF following a call to XEnhance_SyncReset(), -* 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 InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return None. -* -* @note C-style signature: -* void Enhance_SyncReset(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_SyncReset(InstancePtr) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET), (XENH_CTL_AUTORESET_MASK)) - -/*****************************************************************************/ -/** -* -* This function macro resets a Image Enhancement core instance. This reset -* effects the core immediately, and may cause image tearing. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return None. -* -* @note C-style signature: -* void XEnhance_Reset(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_Reset(InstancePtr) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_CONTROL_OFFSET), (XENH_CTL_RESET_MASK)) - -/*****************************************************************************/ -/** -* -* This function macro returns the pending status of a Enhance core. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return The pending interrupts of the Enhance core. Use XENH_IXR_*_MASK -* constants defined in xenhance_hw.h to interpret this value. -* -* @note C-style signature: -* u32 XEnhance_StatusGePending(XEnhance *InstancePtr). -* -******************************************************************************/ -#define XEnhance_StatusGetPending(InstancePtr) \ - XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_STATUS_OFFSET)) & (XENH_IXR_ALLINTR_MASK) - -/*****************************************************************************/ -/** -* -* This function macro clears/acknowledges pending interrupts of a Enhance core. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* @param IntrType is the pending interrupts to clear/acknowledge. Use -* OR'ing of XENH_IXR_*_MASK constants defined in xEnhance_hw.h -* to create this parameter value. -* -* @return None. -* -* @note C-style signature: -* void XEnhance_IntrClear(XEnhance *InstancePtr, u32 IntrType) -* -******************************************************************************/ -#define XEnhance_IntrClear(InstancePtr, IntrType) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_STATUS_OFFSET), ((IntrType) & (XENH_IXR_ALLINTR_MASK))) - -/*****************************************************************************/ -/** -* -* This function macro enables the given individual interrupt(s) on the Enhance -* core. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* @param IntrType is the bit-mask of the interrupts to be enabled. -* Bit positions of 1 will be enabled. Bit positions of 0 will -* keep the previous setting. This mask is formed by OR'ing -* XENH_IXR_*_MASK bits defined in xenhance_hw.h. -* -* @return None. -* -* @note The existing enabled interrupt(s) will remain enabled. -* C-style signature: -* void XEnhance_IntrEnable(XEnhance *InstancePtr, u32 IntrType) -* -******************************************************************************/ -#define XEnhance_IntrEnable(InstancePtr, IntrType) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_IRQ_EN_OFFSET), \ - ((IntrType) & (XENH_IXR_ALLINTR_MASK)) | \ - (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_IRQ_EN_OFFSET)))) - -/*****************************************************************************/ -/** -* -* This function macro disables the given individual interrupt(s) on the -* Enhance core by updating Irq_Enable register. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* @param IntrType is the bit-mask of the interrupts to be disabled. -* Bit positions of 1 will be disabled. Bit positions of 0 will -* keep the previous setting. This mask is formed by OR'ing -* XENH_IXR_*_MASK bits defined in xenhance_hw.h. -* -* @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 XEnhance_IntrDisable(XEnhance *InstancePtr, u32 IntrType) -* -******************************************************************************/ -#define XEnhance_IntrDisable(InstancePtr, IntrType) \ - XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XENH_IRQ_EN_OFFSET), \ - (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_IRQ_EN_OFFSET)) & ((~(IntrType)) & \ - (XENH_IXR_ALLINTR_MASK)))) - -/*****************************************************************************/ -/** -* -* This function macro returns the pending interrupts of a Enhance core. -* -* @param InstancePtr is a pointer to the Enhance core instance to be -* worked on. -* -* @return The pending interrupts of the Enhance core. Use XENH_IXR_*_MASK -* constants defined in xenhance_hw.h to interpret this value. -* -* @note C-style signature: -* u32 XEnhance_IntrGetPending(XEnhance *InstancePtr) -* -******************************************************************************/ -#define XEnhance_IntrGetPending(InstancePtr) \ - XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_IRQ_EN_OFFSET)) & \ - (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XENH_STATUS_OFFSET))) & ((u32)(XENH_IXR_ALLINTR_MASK)) - -/**************************** Type Definitions *******************************/ - -/** -* This typedef contains configuration information for a Video Enhance core. -* Each Video Enhance core should have a configuration structure associated. -* -******************************************************************************/ -typedef struct { - u16 DeviceId; /**< DeviceId is the unique ID of the - * device */ - u32 BaseAddress; /**< BaseAddress is the physical base - * address of the core registers */ - u32 SlaveAxisVideoFormat; /**< Slave axis video format */ - u32 MasteAxisVideoFoemat; /**< Master axis video format */ - u32 SlaveAxiClkFreqHz; /**< Slave axi clock */ - u16 HasIntcIf; /**< Has Intc IF */ - u16 HasDebug; /**< Has Debug */ - u32 MaxColumns; /**< Maximum columns */ - u32 ActiveColumns; /**< Active columns */ - u32 ActiveRows; /**< Active Rows */ - u16 HasNoise; /**< Has noise */ - u16 HasEnhance; /**< Has enhance */ - u16 HasHalo; /**< Has halo suppression */ - u16 HasAlias; /**< Has Alias */ - u32 OptSize; /**< Optional size */ - u16 NoiseThreshold; /**< Noise Threshold */ - u32 EnhanceStrength; /**< Enhance strength */ - u16 HaloSuppress; /**< Halo suppression */ -} XEnhance_Config; - -/*****************************************************************************/ -/** -* -* Callback type for all interrupts except error interrupt. -* -* @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. -* -******************************************************************************/ -typedef void (*XEnhance_CallBack)(void *CallBackRef); - -/*****************************************************************************/ -/** -* -* Callback type for Error interrupt. -* -* @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. -* @param ErrorMask is a bit mask indicating the cause of the error. Its -* value equals 'OR'ing one or more XENH_IXR_*_MASK values defined in -* xenhance_hw.h -* -******************************************************************************/ -typedef void (*XEnhance_ErrorCallBack)(void *CallBackRef, u32 ErrorMask); - -/** -* The Enhance driver instance data structure. A pointer to an instance data -* structure is passed around by functions to refer to a specific driver -* instance. -*/ -typedef struct { - XEnhance_Config Config; /**< Hardware configuration */ - u32 IsReady; /**< Device and the driver instantly - * are initialized */ - u16 HSize; /**< Active Video Horizontal Size */ - u16 VSize; /**< Active Video Vertical Size */ - - /* IRQ Callbacks */ - XEnhance_CallBack ProcStartCallBack; /**< Callback for Processing - * Start interrupt */ - void *ProcStartRef; /**< To be passed to Process - * Start interrupt - * callback */ - XEnhance_CallBack FrameDoneCallBack; /**< Callback for Frame Done - * interrupt */ - void *FrameDoneRef; /**< To be passed to the Frame - * Done interrupt callback */ - XEnhance_ErrorCallBack ErrCallBack; /**< Callback for Error - * interrupt */ - void *ErrRef; /**< To be passed to the Error - * interrupt callback */ -} XEnhance; - -/************************** Function Prototypes ******************************/ - -int XEnhance_CfgInitialize(XEnhance *InstancePtr, XEnhance_Config *CfgPtr, - u32 EffectiveAddr); -void XEnhance_Setup(XEnhance *InstancePtr); -void XEnhance_EnableDbgByPass(XEnhance *InstancePtr); -int XEnhance_IsDbgByPassEnabled(XEnhance *InstancePtr); -void XEnhance_DisableDbgBypass(XEnhance *InstancePtr); -void XEnhance_EnableDbgTestPattern(XEnhance *InstancePtr); -int XEnhance_IsDbgTestPatternEnabled(XEnhance *InstancePtr); -void XEnhance_DisableDbgTestPattern(XEnhance *InstancePtr); -u32 XEnhance_GetVersion(XEnhance *InstancePtr); -u32 XEnhance_GetDbgFrameCount(XEnhance *InstancePtr); -u32 XEnhance_GetDbgLineCount(XEnhance *InstancePtr); -u32 XEnhance_GetDbgPixelCount(XEnhance *InstancePtr); -void XEnhance_SetActiveSize(XEnhance *InstancePtr, u16 HSize, u16 VSize); -void XEnhance_GetActiveSize(XEnhance *InstancePtr, u16 *HSize, u16 *VSize); -void XEnhance_SetNoiseThreshold(XEnhance *InstancePtr, u32 Threshold); -u32 XEnhance_GetNoiseThreshold(XEnhance *InstancePtr); -void XEnhance_SetEdgeStrength(XEnhance *InstancePtr, u32 Strength); -u32 XEnhance_GetEdgeStrength(XEnhance *InstancePtr); -void XEnhance_SetHaloSuppress(XEnhance *InstancePtr, u32 Suppress); -u32 XEnhance_GetHaloSuppress(XEnhance *InstancePtr); - -/* Initialization functions in xEnhance_sinit.c */ -XEnhance_Config *XEnhance_LookupConfig(u16 DeviceId); - -/* Self test functions in xenhance_selftest.c */ -int XEnhance_SelfTest(XEnhance*InstancePtr); - -/* Interrupt related functions in xEnhance_intr.c */ -void XEnhance_IntrHandler(void *InstancePtr); -int XEnhance_SetCallBack(XEnhance *InstancePtr, u32 HandlerType, - void *CallBackFunc, void *CallBackRef); - -/************************** Variable Declarations ****************************/ - - -#ifdef __cplusplus -} +* Image Statistic core instance. +* +* The Image Enhancement core offers noise reduction and/or edge enhancement. +* For edge enhancement, optional anti-halo and anti-alias post-processing +* modules are available to reduce image artifacts that can appear from the +* high-pass filtering of the edge enhancement filters. The amount of noise +* reduction and edge enhancement is controlled through user parameters. +* There are two variations of the algorithm offered to choose between high +* performance and minimal resource usage. This core works on YCbCr 4:4:4 and +* 4:2:2 data. The core is capable of a maximum resolution of 7680 columns by +* 7680 rows with 8, 10, 12, or 16 bits per pixel and supports the bandwidth +* necessary for High-definition (1080p60) resolutions in all Xilinx FPGA device +* families. Higher resolutions can be supported in Xilinx high-performance +* device families. +* +* Initialization & Configuration +* +* The device driver enables higher layer software (e.g., an application) to +* communicate to the Enhance core. +* +* XEnhance_CfgInitialize() API is used to initialize the Enhance core. +* The user needs to first call the XEnhance_LookupConfig() API which returns +* the Configuration structure pointer which is passed as a parameter to the +* XEnhance_CfgInitialize() API. +* +* Interrupts +* +* The driver provides an interrupt handler XEnhance_IntrHandler for handling +* the interrupt from the Enhance core. The users of this driver have to +* register this handler with the interrupt system and provide the callback +* functions by using XEnhance_SetCallBack API. +* +* Virtual Memory +* +* This driver supports Virtual Memory. The RTOS is responsible for calculating +* the correct device base address in Virtual Memory space. +* +* Threads +* +* This driver is not thread safe. Any needs for threads or thread mutual +* exclusion must be satisfied by the layer above this driver. +* +* Asserts +* +* Asserts are used within all Xilinx drivers to enforce constraints on argument +* values. Asserts can be turned off on a system-wide basis by defining, at +* compile time, the NDEBUG identifier. By default, asserts are turned on and it +* is recommended that users leave asserts on during development. +* +* Building the driver +* +* The XEnhance driver is composed of several source files. This allows the user +* to build and link only those parts of the driver that are necessary. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who Date     Changes
+* ----- ---- -------- -----------------------------------------------------
+* 2.00a vc  12/14/10 Updated for ENHANCE V2.0
+* 3.00a rc  09/11/11 Updated for ENHANCE V3.0
+* 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.
+* 5.00a vyc 06/19/13 Updated for ENHANCE V8.0
+*                    New edge enhancement algorithm and registers
+*                    Noise reduction support added
+* 6.0   adk 19/12/13 Updated as per the New Tcl API's
+* 7.0   adk 02/19/14 Changed the filename from enhance.h to xenhance.h.
+*                    Changes in xenhance.h:
+*                    Removed the following macros
+*                    ENHANCE_Enable, ENHANCE_Disable, ENHANCE_RegUpdateEnable,
+*                    ENHANCE_RegUpdateDisable, ENHANCE_Reset,
+*                    ENHANCE_AutoSyncReset
+*
+*                    Added the following function macros
+*                    XEnhance_Enable, XEnhance_Disable,
+*                    XEnhance_RegUpdateDisable, XEnhance_RegUpdateDisable
+*                    XEnhance_Reset, XEnhance_SyncReset, XEnhance_IntrEnable
+*                    XEnhance_IntrDisable, XEnhance_StatusGetPending
+*                    XEnhance_IntrGetPending, XEnhance_IntrClear
+*
+*                    Added the following type definitions:
+*                    XEnhance_Config and XEnhance structures.
+*                    XEnhance_CallBack and XEnhance_ErrorCallBack.
+*
+*                    Changes in xenhance.c:
+*                    Modified the following functions
+*                    XENHANCE_CfgInitialize -> XEnhance_CfgInitialize
+*                    XENHANCE_Setup -> XEnhance_Setup
+*
+*                    Implemented the following functions:
+*                    XEnhance_CfgInitialize, XEnhance_Setup,
+*                    XEnhance_GetVersion, XEnhance_EnableDbgByPass,
+*                    XEnhance_IsDbgByPassEnabled, XEnhance_DisableDbgBypass
+*                    XEnhance_EnableDbgTestPattern,
+*                    XEnhance_IsDbgTestPatternEnabled
+*                    XEnhance_DisableDbgTestPattern
+*                    XEnhance_GetDbgFrameCount, XEnhance_GetDbgLineCount,
+*                    XEnhance_GetDbgPixelCount, XEnhance_SetActiveSize,
+*                    XEnhance_GetActiveSize, XEnhance_SetNoiseThreshold,
+*                    XEnhance_GetNoiseThreshold, XEnhance_SetEdgeStrength,
+*                    XEnhance_GetEdgeStrength, XEnhance_SetHaloSuppress
+*                    XEnhance_GetHaloSuppress.
+*
+*                    Changes in xenhance_hw.h:
+*                    Added the register offsets and bit masks for the
+*                    registers and added backward compatibility for macros.
+*
+*                    Changes in xenhance_intr.c:
+*                    Implemented the following functions
+*                    XEnhance_IntrHandler
+*                    XEnhance_SetCallBack
+*
+*                    Changes in xenhance_sinit.c:
+*                    Implemented the following function
+*                    XEnhance_LookupConfig
+*
+*                    Changes in xenhance_selftest.c:
+*                    Implemented the following function
+*                    XEnhance_SelfTest
+* 
+* +******************************************************************************/ + +#ifndef XENHANCE_H_ +#define XENHANCE_H_ /**< Prevent circular inclusions by using + * protection macros */ + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************** Include Files *********************************/ + +#include "xil_assert.h" +#include "xstatus.h" +#include "xenhance_hw.h" + +/************************** Constant Definitions *****************************/ + +/** @name Handler Types +* @{ +*/ +/** +* These constants specify different types of handlers and used to +* differentiate interrupt requests from core. +* +*/ +enum { + XENH_HANDLER_PROCSTART = 1, /**< A processing start event + * interrupt type */ + XENH_HANDLER_FRAMEDONE, /**< A frame done event + * interrupt type */ + XENH_HANDLER_ERROR /**< An error condition event + * interrupt type */ +} ; +/*@}*/ + +/** @name Active size range macros +* @{ +*/ +#define XENH_VSIZE_FIRST 32 /**< Vertical Size starting + * value */ +#define XENH_VSIZE_LAST 7680 /**< Vertical Size ending + * value */ +#define XENH_HSIZE_FIRST 32 /**< Horizontal Size starting + * value */ +#define XENH_HSIZE_LAST 7680 /**< Horizontal Size ending + * value */ +/*@}*/ + +/** @name Noise threshold range macros +* @{ +*/ +#define XENH_NOISETHRES_MIN 0 /**< Noise threshold starting + * value */ +#define XENH_NOISETHRES_MAX 255 /**< Noise threshold ending + * value */ +/*@}*/ + +/** @name Strength range macros +* @{ +*/ +#define XENH_ENHSTRENGTH_MIN 0 /**< Strength starting value */ +#define XENH_ENHSTRENGTH_MAX 32768 /**< Strength ending value */ +/*@}*/ + +/** @name Halo Suppress range macros +* @{ +*/ +#define XENH_HALOSUPPRESS_MIN 0 /**< Halo Suppress starting + * value */ +#define XENH_HALOSUPPRESS_MAX 32768 /**< Halo Suppress ending + * value */ +/*@}*/ + +/***************** Macros (Inline Functions) Definitions *********************/ + +/*****************************************************************************/ +/** +* +* This function macro enables the Image Enhancement core instance. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return None. +* +* @note C-style signature: +* void XEnhance_Enable(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_Enable(InstancePtr) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET), \ + XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET)) | (XENH_CTL_SW_EN_MASK)) + +/*****************************************************************************/ +/** +* +* This function macro disables the Image Enhancement core instance. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return None. +* +* @note C-style signature: +* void XEnhance_Disable(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_Disable(InstancePtr) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET), \ + XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET)) & (~(XENH_CTL_SW_EN_MASK))) + +/*****************************************************************************/ +/** +* +* This function macro starts the Image Enhancement core instance. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return None. +* +* @note C-style signature: +* void XEnhance_Start(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_Start XEnhance_Enable + +/*****************************************************************************/ +/** +* +* This function macro stops the Image Enhancement core instance. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return None. +* +* @note C-style signature: +* void XEnhance_Stop(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_Stop XEnhance_Disable + +/*****************************************************************************/ +/** +* +* This function macro commits all the register value changes made so far by the +* software to the Image Enhancement core instance. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return None. +* +* @note C-style signature: +* void XEnhance_RegUpdateEnable(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_RegUpdateEnable(InstancePtr) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET), \ + (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET))) | (XENH_CTL_RUE_MASK)) + +/*****************************************************************************/ +/** +* +* This function 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. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return None. +* +* @note C-style signature: +* void XEnhance_RegUpdateDisable(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_RegUpdateDisable(InstancePtr) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET), \ + ((XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET))) & \ + (~(XENH_CTL_RUE_MASK)))) + +/*****************************************************************************/ +/** +* +* This function macro resets a Image Enhancement core instance, but differs from +* XEnhance_Reset() in that it automatically synchronizes to the SOF input of +* the core to prevent tearing. +* +* On the next SOF following a call to XEnhance_SyncReset(), +* 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 InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return None. +* +* @note C-style signature: +* void Enhance_SyncReset(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_SyncReset(InstancePtr) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET), (XENH_CTL_AUTORESET_MASK)) + +/*****************************************************************************/ +/** +* +* This function macro resets a Image Enhancement core instance. This reset +* effects the core immediately, and may cause image tearing. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return None. +* +* @note C-style signature: +* void XEnhance_Reset(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_Reset(InstancePtr) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_CONTROL_OFFSET), (XENH_CTL_RESET_MASK)) + +/*****************************************************************************/ +/** +* +* This function macro returns the pending status of a Enhance core. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return The pending interrupts of the Enhance core. Use XENH_IXR_*_MASK +* constants defined in xenhance_hw.h to interpret this value. +* +* @note C-style signature: +* u32 XEnhance_StatusGePending(XEnhance *InstancePtr). +* +******************************************************************************/ +#define XEnhance_StatusGetPending(InstancePtr) \ + XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_STATUS_OFFSET)) & (XENH_IXR_ALLINTR_MASK) + +/*****************************************************************************/ +/** +* +* This function macro clears/acknowledges pending interrupts of a Enhance core. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* @param IntrType is the pending interrupts to clear/acknowledge. Use +* OR'ing of XENH_IXR_*_MASK constants defined in xEnhance_hw.h +* to create this parameter value. +* +* @return None. +* +* @note C-style signature: +* void XEnhance_IntrClear(XEnhance *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XEnhance_IntrClear(InstancePtr, IntrType) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_STATUS_OFFSET), ((IntrType) & (XENH_IXR_ALLINTR_MASK))) + +/*****************************************************************************/ +/** +* +* This function macro enables the given individual interrupt(s) on the Enhance +* core. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* @param IntrType is the bit-mask of the interrupts to be enabled. +* Bit positions of 1 will be enabled. Bit positions of 0 will +* keep the previous setting. This mask is formed by OR'ing +* XENH_IXR_*_MASK bits defined in xenhance_hw.h. +* +* @return None. +* +* @note The existing enabled interrupt(s) will remain enabled. +* C-style signature: +* void XEnhance_IntrEnable(XEnhance *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XEnhance_IntrEnable(InstancePtr, IntrType) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_IRQ_EN_OFFSET), \ + ((IntrType) & (XENH_IXR_ALLINTR_MASK)) | \ + (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_IRQ_EN_OFFSET)))) + +/*****************************************************************************/ +/** +* +* This function macro disables the given individual interrupt(s) on the +* Enhance core by updating Irq_Enable register. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* @param IntrType is the bit-mask of the interrupts to be disabled. +* Bit positions of 1 will be disabled. Bit positions of 0 will +* keep the previous setting. This mask is formed by OR'ing +* XENH_IXR_*_MASK bits defined in xenhance_hw.h. +* +* @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 XEnhance_IntrDisable(XEnhance *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XEnhance_IntrDisable(InstancePtr, IntrType) \ + XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XENH_IRQ_EN_OFFSET), \ + (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_IRQ_EN_OFFSET)) & ((~(IntrType)) & \ + (XENH_IXR_ALLINTR_MASK)))) + +/*****************************************************************************/ +/** +* +* This function macro returns the pending interrupts of a Enhance core. +* +* @param InstancePtr is a pointer to the Enhance core instance to be +* worked on. +* +* @return The pending interrupts of the Enhance core. Use XENH_IXR_*_MASK +* constants defined in xenhance_hw.h to interpret this value. +* +* @note C-style signature: +* u32 XEnhance_IntrGetPending(XEnhance *InstancePtr) +* +******************************************************************************/ +#define XEnhance_IntrGetPending(InstancePtr) \ + XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_IRQ_EN_OFFSET)) & \ + (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XENH_STATUS_OFFSET))) & ((u32)(XENH_IXR_ALLINTR_MASK)) + +/**************************** Type Definitions *******************************/ + +/** +* This typedef contains configuration information for a Video Enhance core. +* Each Video Enhance core should have a configuration structure associated. +* +******************************************************************************/ +typedef struct { + u16 DeviceId; /**< DeviceId is the unique ID of the + * device */ + u32 BaseAddress; /**< BaseAddress is the physical base + * address of the core registers */ + u32 SlaveAxisVideoFormat; /**< Slave axis video format */ + u32 MasteAxisVideoFoemat; /**< Master axis video format */ + u32 SlaveAxiClkFreqHz; /**< Slave axi clock */ + u16 HasIntcIf; /**< Has Intc IF */ + u16 HasDebug; /**< Has Debug */ + u32 MaxColumns; /**< Maximum columns */ + u32 ActiveColumns; /**< Active columns */ + u32 ActiveRows; /**< Active Rows */ + u16 HasNoise; /**< Has noise */ + u16 HasEnhance; /**< Has enhance */ + u16 HasHalo; /**< Has halo suppression */ + u16 HasAlias; /**< Has Alias */ + u32 OptSize; /**< Optional size */ + u16 NoiseThreshold; /**< Noise Threshold */ + u32 EnhanceStrength; /**< Enhance strength */ + u16 HaloSuppress; /**< Halo suppression */ +} XEnhance_Config; + +/*****************************************************************************/ +/** +* +* Callback type for all interrupts except error interrupt. +* +* @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. +* +******************************************************************************/ +typedef void (*XEnhance_CallBack)(void *CallBackRef); + +/*****************************************************************************/ +/** +* +* Callback type for Error interrupt. +* +* @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. +* @param ErrorMask is a bit mask indicating the cause of the error. Its +* value equals 'OR'ing one or more XENH_IXR_*_MASK values defined in +* xenhance_hw.h +* +******************************************************************************/ +typedef void (*XEnhance_ErrorCallBack)(void *CallBackRef, u32 ErrorMask); + +/** +* The Enhance driver instance data structure. A pointer to an instance data +* structure is passed around by functions to refer to a specific driver +* instance. +*/ +typedef struct { + XEnhance_Config Config; /**< Hardware configuration */ + u32 IsReady; /**< Device and the driver instantly + * are initialized */ + u16 HSize; /**< Active Video Horizontal Size */ + u16 VSize; /**< Active Video Vertical Size */ + + /* IRQ Callbacks */ + XEnhance_CallBack ProcStartCallBack; /**< Callback for Processing + * Start interrupt */ + void *ProcStartRef; /**< To be passed to Process + * Start interrupt + * callback */ + XEnhance_CallBack FrameDoneCallBack; /**< Callback for Frame Done + * interrupt */ + void *FrameDoneRef; /**< To be passed to the Frame + * Done interrupt callback */ + XEnhance_ErrorCallBack ErrCallBack; /**< Callback for Error + * interrupt */ + void *ErrRef; /**< To be passed to the Error + * interrupt callback */ +} XEnhance; + +/************************** Function Prototypes ******************************/ + +int XEnhance_CfgInitialize(XEnhance *InstancePtr, XEnhance_Config *CfgPtr, + u32 EffectiveAddr); +void XEnhance_Setup(XEnhance *InstancePtr); +void XEnhance_EnableDbgByPass(XEnhance *InstancePtr); +int XEnhance_IsDbgByPassEnabled(XEnhance *InstancePtr); +void XEnhance_DisableDbgBypass(XEnhance *InstancePtr); +void XEnhance_EnableDbgTestPattern(XEnhance *InstancePtr); +int XEnhance_IsDbgTestPatternEnabled(XEnhance *InstancePtr); +void XEnhance_DisableDbgTestPattern(XEnhance *InstancePtr); +u32 XEnhance_GetVersion(XEnhance *InstancePtr); +u32 XEnhance_GetDbgFrameCount(XEnhance *InstancePtr); +u32 XEnhance_GetDbgLineCount(XEnhance *InstancePtr); +u32 XEnhance_GetDbgPixelCount(XEnhance *InstancePtr); +void XEnhance_SetActiveSize(XEnhance *InstancePtr, u16 HSize, u16 VSize); +void XEnhance_GetActiveSize(XEnhance *InstancePtr, u16 *HSize, u16 *VSize); +void XEnhance_SetNoiseThreshold(XEnhance *InstancePtr, u32 Threshold); +u32 XEnhance_GetNoiseThreshold(XEnhance *InstancePtr); +void XEnhance_SetEdgeStrength(XEnhance *InstancePtr, u32 Strength); +u32 XEnhance_GetEdgeStrength(XEnhance *InstancePtr); +void XEnhance_SetHaloSuppress(XEnhance *InstancePtr, u32 Suppress); +u32 XEnhance_GetHaloSuppress(XEnhance *InstancePtr); + +/* Initialization functions in xEnhance_sinit.c */ +XEnhance_Config *XEnhance_LookupConfig(u16 DeviceId); + +/* Self test functions in xenhance_selftest.c */ +int XEnhance_SelfTest(XEnhance*InstancePtr); + +/* Interrupt related functions in xEnhance_intr.c */ +void XEnhance_IntrHandler(void *InstancePtr); +int XEnhance_SetCallBack(XEnhance *InstancePtr, u32 HandlerType, + void *CallBackFunc, void *CallBackRef); + +/************************** Variable Declarations ****************************/ + + +#ifdef __cplusplus +} #endif #endif /* End of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_g.c b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_g.c index e0a2e607..1038a1d8 100644 --- a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_g.c +++ b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_g.c @@ -1,68 +1,68 @@ -/****************************************************************************** -* -* Copyright (C) 2010 - 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 -* XILINX 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. -* -******************************************************************************/ - -#include "xparameters.h" -#include "xenhance.h" - -/* -* The configuration table for devices -*/ - -XEnhance_Config XEnhance_ConfigTable[] = -{ - { - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_DEVICE_ID, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_BASEADDR, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_S_AXIS_VIDEO_DATA_WIDTH, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_M_AXIS_VIDEO_DATA_WIDTH, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_S_AXIS_VIDEO_FORMAT, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_M_AXIS_VIDEO_FORMAT, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_S_AXIS_VIDEO_TDATA_WIDTH, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_M_AXIS_VIDEO_TDATA_WIDTH, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_AXI4_LITE, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_INTC_IF, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_DEBUG, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_MAX_COLS, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_ACTIVE_COLS, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_ACTIVE_ROWS, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_NOISE, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_ENHANCE, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_HALO, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_ALIAS, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_OPT_SIZE, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_NOISE_THRESHOLD, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_ENHANCE_STRENGTH, - XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HALO_SUPPRESS - } -}; - - +/****************************************************************************** +* +* Copyright (C) 2010 - 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 +* XILINX 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. +* +******************************************************************************/ + +#include "xparameters.h" +#include "xenhance.h" + +/* +* The configuration table for devices +*/ + +XEnhance_Config XEnhance_ConfigTable[] = +{ + { + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_DEVICE_ID, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_BASEADDR, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_S_AXIS_VIDEO_DATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_M_AXIS_VIDEO_DATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_S_AXIS_VIDEO_FORMAT, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_M_AXIS_VIDEO_FORMAT, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_S_AXIS_VIDEO_TDATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_M_AXIS_VIDEO_TDATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_AXI4_LITE, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_INTC_IF, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_DEBUG, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_MAX_COLS, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_ACTIVE_COLS, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_ACTIVE_ROWS, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_NOISE, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_ENHANCE, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_HALO, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HAS_ALIAS, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_OPT_SIZE, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_NOISE_THRESHOLD, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_ENHANCE_STRENGTH, + XPAR_FMC_SENSOR_INPUT_V_ENHANCE_1_HALO_SUPPRESS + } +}; + + diff --git a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_hw.h b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_hw.h index c88555bc..a7969999 100644 --- a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_hw.h +++ b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_hw.h @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* Copyright (C) 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 -* XILINX 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. -* +/****************************************************************************** +* +* Copyright (C) 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 +* XILINX 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 xenhance_hw.h @@ -39,252 +39,252 @@ * * This header file contains identifiers and register-level driver functions (or * macros) that can be used to access the Xilinx Video Image Enhancement -* core. -* -* For more information about the operation of this core, see the hardware -* specification and documentation in the higher level driver xenhance.h source -* code file. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- -------------------------------------------------------
-* 7.0   adk 01/07/14 First release.
-*                    Added the register offsets and bit masks for the
-*                    registers and added backward compatibility for macros.
-* 
-* -******************************************************************************/ - -#ifndef XENHANCE_HW_H_ -#define XENHANCE_HW_H_ /**< Prevent circular inclusions by using - * protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ - -#include "xil_io.h" - -/************************** Constant Definitions *****************************/ - -/** @name Control Registers - * @{ - */ -#define XENH_CONTROL_OFFSET 0x0000 /**< Control Offset */ -#define XENH_STATUS_OFFSET 0x0004 /**< Status Offset */ -#define XENH_ERROR_OFFSET 0x0008 /**< Error Offset */ -#define XENH_IRQ_EN_OFFSET 0x000C /**< IRQ Enable Offset */ -#define XENH_VERSION_OFFSET 0x0010 /**< Version Offset */ -#define XENH_SYSDEBUG0_OFFSET 0x0014 /**< System Debug 0 - * Offset */ -#define XENH_SYSDEBUG1_OFFSET 0x0018 /**< System Debug 1 - * Offset */ -#define XENH_SYSDEBUG2_OFFSET 0x001C /**< System Debug 2 - * Offset */ -/*@}*/ - -/** @name Timing Control Registers - * @{ - */ -#define XENH_ACTIVE_SIZE_OFFSET 0x0020 /**< Horizontal and Vertical - * Active Frame Size Offset */ -/*@}*/ - -/** @name Core Specific Registers - * @{ - */ -#define XENH_NOISE_THRESHOLD_OFFSET 0x0100 /**< Noise Reduction - * Control Active */ -#define XENH_ENHANCE_STRENGTH_OFFSET 0x0104 /**< Edge Enhancement - * Control Active */ -#define XENH_HALO_SUPPRESS_OFFSET 0x0108 /**< Halo Suppression - * Control Active */ -/*@}*/ - -/** @name Enhance Control Register Bit Masks - * @{ - */ -#define XENH_CTL_SW_EN_MASK 0x00000001 /**< Enable Mask */ -#define XENH_CTL_RUE_MASK 0x00000002 /**< Register - * Update Enable Mask */ -#define XENH_CTL_BPE_MASK 0x00000010 /**< Bypass Mask */ -#define XENH_CTL_TPE_MASK 0x00000020 /**< Test Pattern Mask */ -#define XENH_CTL_AUTORESET_MASK 0x40000000 /**< Software Reset - - * Auto-synchronize to - * SOF Mask */ -#define XENH_CTL_RESET_MASK 0x80000000 /**< Software Reset - - * Instantaneous - * Mask */ -/*@}*/ - -/** @name Interrupt Register Bit Masks. It is applicable for - * Status and Irq_Enable Registers - * @{ - */ -#define XENH_IXR_PROCS_STARTED_MASK 0x00000001 /**< Process started - * Mask */ -#define XENH_IXR_EOF_MASK 0x00000002 /**< End-Of-Frame Mask */ -#define XENH_IXR_SE_MASK 0x00010000 /**< Slave Error Mask */ -#define XENH_IXR_ALLINTR_MASK 0x00010003 /**< OR'ing of all Mask */ -/*@}*/ - -/** @name Enhance Error Register Bit Masks - * @{ - */ -#define XENH_ERR_EOL_EARLY_MASK 0x00000001 /**< Frame EOL early Mask */ -#define XENH_ERR_EOL_LATE_MASK 0x00000002 /**< Frame EOL late Mask */ -#define XENH_ERR_SOF_EARLY_MASK 0x00000004 /**< Frame SOF early Mask */ -#define XENH_ERR_SOF_LATE_MASK 0x00000008 /**< Frame SOF late Mask */ -/*@}*/ - -/** @name Enhance Version Register bit definition - * @{ - */ -#define XENH_VER_REV_NUM_MASK 0x000000FF /**< Revision Number Mask */ -#define XENH_VER_PID_MASK 0x00000F00 /**< Patch ID Mask */ -#define XENH_VER_MINOR_MASK 0x00FF0000 /**< Version Minor Mask */ -#define XENH_VER_MAJOR_MASK 0xFF000000 /**< Version Major Mask */ -#define XENH_VER_REV_MASK 0x0000F000 /**< VersionRevision Mask */ -#define XENH_VER_INTERNAL_SHIFT 8 /**< Version Internal Shift */ -#define XENH_VER_REV_SHIFT 12 /**< Version Revision Shift */ -#define XENH_VER_MINOR_SHIFT 16 /**< Version Minor Shift */ -#define XENH_VER_MAJOR_SHIFT 24 /**< Version Major Shift */ -/*@}*/ - -/** @name Enhance ActiveSize register Masks and Shifts - * @{ - */ -#define XENH_ACTSIZE_NUM_PIXEL_MASK 0x00001FFF /**< Active size - * Mask */ -#define XENH_ACTSIZE_NUM_LINE_MASK 0x1FFF0000 /**< Number of Active - * lines per Frame - * (Vertical) Mask */ -#define XENH_ACTSIZE_NUM_LINE_SHIFT 16 /**< Active size - * Shift */ -/*@}*/ - -/** @name Enhance Noise Threshold Register Bit Masks - * @{ - */ -#define XENH_NOISE_THRESHOLD_MASK 0x0000FFFF /**< Noise Threshold - * Mask */ -/*@}*/ - -/** @name Enhance Strength Register Bit Masks - * @{ - */ -#define XENH_STRENGTH_MASK 0x0000FFFF /**< Enhance Strength - * Mask */ -/*@}*/ - -/** @name Enhance Halo Suppress Register Bit Masks -* @{ -*/ -#define XENH_HALO_SUPPRESS_MASK 0x0000FFFF /**< Halo Suppress - * Mask */ -/*@}*/ - -/**@name Backward compatibility macros - * @{ - */ -#define ENHANCE_CONTROL XENH_CONTROL_OFFSET -#define ENHANCE_STATUS XENH_STATUS_OFFSET -#define ENHANCE_ERROR XENH_ERROR_OFFSET -#define ENHANCE_IRQ_ENABLE XENH_IRQ_EN_OFFSET -#define ENHANCE_VERSION XENH_VERSION_OFFSET -#define ENHANCE_SYSDEBUG0 XENH_SYSDEBUG0_OFFSET -#define ENHANCE_SYSDEBUG1 XENH_SYSDEBUG1_OFFSET -#define ENHANCE_SYSDEBUG2 XENH_SYSDEBUG2_OFFSET -#define ENHANCE_ACTIVE_SIZE XENH_ACTIVE_SIZE_OFFSET -#define ENHANCE_NOISE_THRESHOLD XENH_NOISE_THRESHOLD_OFFSET -#define ENHANCE_ENHANCE_STRENGTH XENH_ENHANCE_STRENGTH_OFFSET -#define ENHANCE_HALO_SUPPRESS XENH_HALO_SUPPRESS_OFFSET - -#define ENHANCE_CTL_EN_MASK XENH_CTL_SW_EN_MASK -#define ENHANCE_CTL_RU_MASK XENH_CTL_RUE_MASK -#define ENHANCE_CTL_RESET XENH_CTL_RESET_MASK -#define ENHANCE_CTL_AUTORESET XENH_CTL_AUTORESET_MASK - -#define ENHANCE_In32 XEnhance_In32 -#define ENHANCE_Out32 XEnhance_Out32 -#define ENHANCE_ReadReg XEnhance_ReadReg -#define ENHANCE_WriteReg XEnhance_WriteReg -/*@}*/ - -/** @name Interrupt Registers - * @{ - */ -/** -* Interrupt status register generates a interrupt if the corresponding bits of -* interrupt enable register bits are set. -*/ - -#define XENH_ISR_OFFSET XENH_STATUS_OFFSET /**< Interrupt Status - * Register */ -#define XENH_IER_OFFSET XENH_IRQ_EN_OFFSET /**< Interrupt Enable - * Register corresponds - * to Status bits */ -/*@}*/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -#define XEnhance_In32 Xil_In32 /**< Enhance Input Operation. */ -#define XEnhance_Out32 Xil_Out32 /**< Enhance Output Operation. */ - -/*****************************************************************************/ -/** -* -* This function macro reads the given register. -* -* @param BaseAddress is the base address of the Image Enhancement core. -* @param RegOffset is the register offset of the core (defined at. -* top of this file). -* -* @return The 32-bit value of the register. -* -* @note C-style signature:2 -* u32 XEnhance_ReadReg(u32 BaseAddress, u32 RegOffset). -* -******************************************************************************/ -#define XEnhance_ReadReg(BaseAddress, RegOffset) \ - XEnhance_In32((BaseAddress) + (u32)(RegOffset)) - -/*****************************************************************************/ -/** -* -* This function macro writes the given register. -* -* @param BaseAddress is the base address of the Image Enhancement core. -* @param RegOffset is the register offset of the core (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 XEnhance_WriteReg(u32 BaseAddress, u32 RegOffset, -* u32 Data). -* -******************************************************************************/ -#define XEnhance_WriteReg(BaseAddress, RegOffset, Data) \ - XEnhance_Out32((BaseAddress) + (u32)(RegOffset), (Data)) - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - - -/************************** Variable Declarations ****************************/ - - -#ifdef __cplusplus -} - +* core. +* +* For more information about the operation of this core, see the hardware +* specification and documentation in the higher level driver xenhance.h source +* code file. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who Date     Changes
+* ----- --- -------- -------------------------------------------------------
+* 7.0   adk 01/07/14 First release.
+*                    Added the register offsets and bit masks for the
+*                    registers and added backward compatibility for macros.
+* 
+* +******************************************************************************/ + +#ifndef XENHANCE_HW_H_ +#define XENHANCE_HW_H_ /**< Prevent circular inclusions by using + * protection macros */ + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************** Include Files *********************************/ + +#include "xil_io.h" + +/************************** Constant Definitions *****************************/ + +/** @name Control Registers + * @{ + */ +#define XENH_CONTROL_OFFSET 0x0000 /**< Control Offset */ +#define XENH_STATUS_OFFSET 0x0004 /**< Status Offset */ +#define XENH_ERROR_OFFSET 0x0008 /**< Error Offset */ +#define XENH_IRQ_EN_OFFSET 0x000C /**< IRQ Enable Offset */ +#define XENH_VERSION_OFFSET 0x0010 /**< Version Offset */ +#define XENH_SYSDEBUG0_OFFSET 0x0014 /**< System Debug 0 + * Offset */ +#define XENH_SYSDEBUG1_OFFSET 0x0018 /**< System Debug 1 + * Offset */ +#define XENH_SYSDEBUG2_OFFSET 0x001C /**< System Debug 2 + * Offset */ +/*@}*/ + +/** @name Timing Control Registers + * @{ + */ +#define XENH_ACTIVE_SIZE_OFFSET 0x0020 /**< Horizontal and Vertical + * Active Frame Size Offset */ +/*@}*/ + +/** @name Core Specific Registers + * @{ + */ +#define XENH_NOISE_THRESHOLD_OFFSET 0x0100 /**< Noise Reduction + * Control Active */ +#define XENH_ENHANCE_STRENGTH_OFFSET 0x0104 /**< Edge Enhancement + * Control Active */ +#define XENH_HALO_SUPPRESS_OFFSET 0x0108 /**< Halo Suppression + * Control Active */ +/*@}*/ + +/** @name Enhance Control Register Bit Masks + * @{ + */ +#define XENH_CTL_SW_EN_MASK 0x00000001 /**< Enable Mask */ +#define XENH_CTL_RUE_MASK 0x00000002 /**< Register + * Update Enable Mask */ +#define XENH_CTL_BPE_MASK 0x00000010 /**< Bypass Mask */ +#define XENH_CTL_TPE_MASK 0x00000020 /**< Test Pattern Mask */ +#define XENH_CTL_AUTORESET_MASK 0x40000000 /**< Software Reset - + * Auto-synchronize to + * SOF Mask */ +#define XENH_CTL_RESET_MASK 0x80000000 /**< Software Reset - + * Instantaneous + * Mask */ +/*@}*/ + +/** @name Interrupt Register Bit Masks. It is applicable for + * Status and Irq_Enable Registers + * @{ + */ +#define XENH_IXR_PROCS_STARTED_MASK 0x00000001 /**< Process started + * Mask */ +#define XENH_IXR_EOF_MASK 0x00000002 /**< End-Of-Frame Mask */ +#define XENH_IXR_SE_MASK 0x00010000 /**< Slave Error Mask */ +#define XENH_IXR_ALLINTR_MASK 0x00010003 /**< OR'ing of all Mask */ +/*@}*/ + +/** @name Enhance Error Register Bit Masks + * @{ + */ +#define XENH_ERR_EOL_EARLY_MASK 0x00000001 /**< Frame EOL early Mask */ +#define XENH_ERR_EOL_LATE_MASK 0x00000002 /**< Frame EOL late Mask */ +#define XENH_ERR_SOF_EARLY_MASK 0x00000004 /**< Frame SOF early Mask */ +#define XENH_ERR_SOF_LATE_MASK 0x00000008 /**< Frame SOF late Mask */ +/*@}*/ + +/** @name Enhance Version Register bit definition + * @{ + */ +#define XENH_VER_REV_NUM_MASK 0x000000FF /**< Revision Number Mask */ +#define XENH_VER_PID_MASK 0x00000F00 /**< Patch ID Mask */ +#define XENH_VER_MINOR_MASK 0x00FF0000 /**< Version Minor Mask */ +#define XENH_VER_MAJOR_MASK 0xFF000000 /**< Version Major Mask */ +#define XENH_VER_REV_MASK 0x0000F000 /**< VersionRevision Mask */ +#define XENH_VER_INTERNAL_SHIFT 8 /**< Version Internal Shift */ +#define XENH_VER_REV_SHIFT 12 /**< Version Revision Shift */ +#define XENH_VER_MINOR_SHIFT 16 /**< Version Minor Shift */ +#define XENH_VER_MAJOR_SHIFT 24 /**< Version Major Shift */ +/*@}*/ + +/** @name Enhance ActiveSize register Masks and Shifts + * @{ + */ +#define XENH_ACTSIZE_NUM_PIXEL_MASK 0x00001FFF /**< Active size + * Mask */ +#define XENH_ACTSIZE_NUM_LINE_MASK 0x1FFF0000 /**< Number of Active + * lines per Frame + * (Vertical) Mask */ +#define XENH_ACTSIZE_NUM_LINE_SHIFT 16 /**< Active size + * Shift */ +/*@}*/ + +/** @name Enhance Noise Threshold Register Bit Masks + * @{ + */ +#define XENH_NOISE_THRESHOLD_MASK 0x0000FFFF /**< Noise Threshold + * Mask */ +/*@}*/ + +/** @name Enhance Strength Register Bit Masks + * @{ + */ +#define XENH_STRENGTH_MASK 0x0000FFFF /**< Enhance Strength + * Mask */ +/*@}*/ + +/** @name Enhance Halo Suppress Register Bit Masks +* @{ +*/ +#define XENH_HALO_SUPPRESS_MASK 0x0000FFFF /**< Halo Suppress + * Mask */ +/*@}*/ + +/**@name Backward compatibility macros + * @{ + */ +#define ENHANCE_CONTROL XENH_CONTROL_OFFSET +#define ENHANCE_STATUS XENH_STATUS_OFFSET +#define ENHANCE_ERROR XENH_ERROR_OFFSET +#define ENHANCE_IRQ_ENABLE XENH_IRQ_EN_OFFSET +#define ENHANCE_VERSION XENH_VERSION_OFFSET +#define ENHANCE_SYSDEBUG0 XENH_SYSDEBUG0_OFFSET +#define ENHANCE_SYSDEBUG1 XENH_SYSDEBUG1_OFFSET +#define ENHANCE_SYSDEBUG2 XENH_SYSDEBUG2_OFFSET +#define ENHANCE_ACTIVE_SIZE XENH_ACTIVE_SIZE_OFFSET +#define ENHANCE_NOISE_THRESHOLD XENH_NOISE_THRESHOLD_OFFSET +#define ENHANCE_ENHANCE_STRENGTH XENH_ENHANCE_STRENGTH_OFFSET +#define ENHANCE_HALO_SUPPRESS XENH_HALO_SUPPRESS_OFFSET + +#define ENHANCE_CTL_EN_MASK XENH_CTL_SW_EN_MASK +#define ENHANCE_CTL_RU_MASK XENH_CTL_RUE_MASK +#define ENHANCE_CTL_RESET XENH_CTL_RESET_MASK +#define ENHANCE_CTL_AUTORESET XENH_CTL_AUTORESET_MASK + +#define ENHANCE_In32 XEnhance_In32 +#define ENHANCE_Out32 XEnhance_Out32 +#define ENHANCE_ReadReg XEnhance_ReadReg +#define ENHANCE_WriteReg XEnhance_WriteReg +/*@}*/ + +/** @name Interrupt Registers + * @{ + */ +/** +* Interrupt status register generates a interrupt if the corresponding bits of +* interrupt enable register bits are set. +*/ + +#define XENH_ISR_OFFSET XENH_STATUS_OFFSET /**< Interrupt Status + * Register */ +#define XENH_IER_OFFSET XENH_IRQ_EN_OFFSET /**< Interrupt Enable + * Register corresponds + * to Status bits */ +/*@}*/ + +/***************** Macros (Inline Functions) Definitions *********************/ + +#define XEnhance_In32 Xil_In32 /**< Enhance Input Operation. */ +#define XEnhance_Out32 Xil_Out32 /**< Enhance Output Operation. */ + +/*****************************************************************************/ +/** +* +* This function macro reads the given register. +* +* @param BaseAddress is the base address of the Image Enhancement core. +* @param RegOffset is the register offset of the core (defined at. +* top of this file). +* +* @return The 32-bit value of the register. +* +* @note C-style signature:2 +* u32 XEnhance_ReadReg(u32 BaseAddress, u32 RegOffset). +* +******************************************************************************/ +#define XEnhance_ReadReg(BaseAddress, RegOffset) \ + XEnhance_In32((BaseAddress) + (u32)(RegOffset)) + +/*****************************************************************************/ +/** +* +* This function macro writes the given register. +* +* @param BaseAddress is the base address of the Image Enhancement core. +* @param RegOffset is the register offset of the core (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 XEnhance_WriteReg(u32 BaseAddress, u32 RegOffset, +* u32 Data). +* +******************************************************************************/ +#define XEnhance_WriteReg(BaseAddress, RegOffset, Data) \ + XEnhance_Out32((BaseAddress) + (u32)(RegOffset), (Data)) + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Declarations ****************************/ + + +#ifdef __cplusplus +} + #endif #endif /* End of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_intr.c b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_intr.c index b38ead8f..6a21aaa1 100644 --- a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_intr.c +++ b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_intr.c @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* Copyright (C) 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 -* XILINX 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. -* +/****************************************************************************** +* +* Copyright (C) 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 +* XILINX 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 xenhance_intr.c @@ -39,173 +39,173 @@ * * This code contains interrupt related functions of Xilinx Enhance core. * Please see xenhance.h for more details of the core. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- -----------------------------------------------
-* 7.0   adk 02/19/14 First release.
-*                    Implemented the following functions
-*                    XEnhance_IntrHandler
-*                    XEnhance_SetCallBack
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xenhance.h" - -/************************** Constant Definitions *****************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - - -/************************** Variable Definitions *****************************/ - - -/************************** Function Definitions *****************************/ - -/*****************************************************************************/ -/** -* -* This function is the interrupt handler for the Enhance 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. -* -* 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 -* XEnhance_SetCallBack() during initialization phase. -* -* @param InstancePtr is a pointer to the XEnhance instance that just -* interrupted. -* -* @return None. -* -* @note Interrupt interface should be enabled. -* -******************************************************************************/ -void XEnhance_IntrHandler(void *InstancePtr) -{ - u32 PendingIntr; - u32 ErrorStatus; - XEnhance *XEnhancePtr = (XEnhance *)((void *)InstancePtr); - - /* Verify arguments. */ - Xil_AssertVoid(XEnhancePtr != NULL); - Xil_AssertVoid(XEnhancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid(XEnhancePtr->Config.HasIntcIf != (u16)0x0); - - /* Get pending interrupts. */ - PendingIntr = (u32)(XEnhance_IntrGetPending(XEnhancePtr)); - - /* A Slave Error interrupt has happened. */ - if (((PendingIntr) & (XENH_IXR_SE_MASK)) == - ((XENH_IXR_SE_MASK))) { - ErrorStatus = (PendingIntr) & (XENH_IXR_SE_MASK); - XEnhancePtr->ErrCallBack(XEnhancePtr->ErrRef, ErrorStatus); - } - - /* A Processing Start has happened. */ - if (((PendingIntr) & (XENH_IXR_PROCS_STARTED_MASK)) == - (XENH_IXR_PROCS_STARTED_MASK)) { - XEnhancePtr->ProcStartCallBack - (XEnhancePtr->ProcStartRef); - } - - /* A Frame Done interrupt has happened */ - if (((PendingIntr) & (XENH_IXR_EOF_MASK)) == - (XENH_IXR_EOF_MASK)) { - XEnhancePtr->FrameDoneCallBack - (XEnhancePtr->FrameDoneRef); - } - - /* Clear pending interrupt(s). */ - XEnhance_IntrClear(XEnhancePtr, PendingIntr); - -} - -/*****************************************************************************/ -/** -* -* This routine installs an asynchronous callback function for the given -* HandlerType: -* -*
-* HandlerType              Callback Function Type
-* -----------------------  --------------------------------
-* XENH_HANDLER_PROCSTART   ProcStartCallBack
-* XENH_HANDLER_FRAMEDONE   FrameDoneCallBack
-* XENH_HANDLER_ERROR       ErrCallBack
-* 
-* -* @param InstancePtr is a pointer to the XEnhance 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. -* -* @note Invoking this function for a handler that already has been -* installed replaces it with the new handler. -* -******************************************************************************/ -int XEnhance_SetCallBack(XEnhance *InstancePtr, u32 HandlerType, - void *CallBackFunc, void *CallBackRef) -{ - int Status; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == - (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertNonvoid(CallBackFunc != NULL); - Xil_AssertNonvoid(CallBackRef != NULL); - Xil_AssertNonvoid((HandlerType >= (u32)(XENH_HANDLER_PROCSTART)) && - (HandlerType <= (u32)(XENH_HANDLER_ERROR))); - - /* Calls the respective callbacks according to handler type. */ - switch (HandlerType) { - case XENH_HANDLER_PROCSTART: - InstancePtr->ProcStartCallBack = - (XEnhance_CallBack)((void *)CallBackFunc); - InstancePtr->ProcStartRef = CallBackRef; - Status = (XST_SUCCESS); - break; - - case XENH_HANDLER_FRAMEDONE: - InstancePtr->FrameDoneCallBack = - (XEnhance_CallBack)((void *)CallBackFunc); - InstancePtr->FrameDoneRef = CallBackRef; - Status = (XST_SUCCESS); - break; - - case XENH_HANDLER_ERROR: - InstancePtr->ErrCallBack = - (XEnhance_ErrorCallBack)((void *)CallBackFunc); - InstancePtr->ErrRef = CallBackRef; - Status = (XST_SUCCESS); - break; - - default: - Status = (XST_INVALID_PARAM); - break; - } +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who Date     Changes
+* ----- --- -------- -----------------------------------------------
+* 7.0   adk 02/19/14 First release.
+*                    Implemented the following functions
+*                    XEnhance_IntrHandler
+*                    XEnhance_SetCallBack
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xenhance.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function is the interrupt handler for the Enhance 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. +* +* 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 +* XEnhance_SetCallBack() during initialization phase. +* +* @param InstancePtr is a pointer to the XEnhance instance that just +* interrupted. +* +* @return None. +* +* @note Interrupt interface should be enabled. +* +******************************************************************************/ +void XEnhance_IntrHandler(void *InstancePtr) +{ + u32 PendingIntr; + u32 ErrorStatus; + XEnhance *XEnhancePtr = (XEnhance *)((void *)InstancePtr); + + /* Verify arguments. */ + Xil_AssertVoid(XEnhancePtr != NULL); + Xil_AssertVoid(XEnhancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid(XEnhancePtr->Config.HasIntcIf != (u16)0x0); + + /* Get pending interrupts. */ + PendingIntr = (u32)(XEnhance_IntrGetPending(XEnhancePtr)); + + /* A Slave Error interrupt has happened. */ + if (((PendingIntr) & (XENH_IXR_SE_MASK)) == + ((XENH_IXR_SE_MASK))) { + ErrorStatus = (PendingIntr) & (XENH_IXR_SE_MASK); + XEnhancePtr->ErrCallBack(XEnhancePtr->ErrRef, ErrorStatus); + } + + /* A Processing Start has happened. */ + if (((PendingIntr) & (XENH_IXR_PROCS_STARTED_MASK)) == + (XENH_IXR_PROCS_STARTED_MASK)) { + XEnhancePtr->ProcStartCallBack + (XEnhancePtr->ProcStartRef); + } + + /* A Frame Done interrupt has happened */ + if (((PendingIntr) & (XENH_IXR_EOF_MASK)) == + (XENH_IXR_EOF_MASK)) { + XEnhancePtr->FrameDoneCallBack + (XEnhancePtr->FrameDoneRef); + } + + /* Clear pending interrupt(s). */ + XEnhance_IntrClear(XEnhancePtr, PendingIntr); + +} + +/*****************************************************************************/ +/** +* +* This routine installs an asynchronous callback function for the given +* HandlerType: +* +*
+* HandlerType              Callback Function Type
+* -----------------------  --------------------------------
+* XENH_HANDLER_PROCSTART   ProcStartCallBack
+* XENH_HANDLER_FRAMEDONE   FrameDoneCallBack
+* XENH_HANDLER_ERROR       ErrCallBack
+* 
+* +* @param InstancePtr is a pointer to the XEnhance 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. +* +* @note Invoking this function for a handler that already has been +* installed replaces it with the new handler. +* +******************************************************************************/ +int XEnhance_SetCallBack(XEnhance *InstancePtr, u32 HandlerType, + void *CallBackFunc, void *CallBackRef) +{ + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->IsReady == + (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertNonvoid(CallBackFunc != NULL); + Xil_AssertNonvoid(CallBackRef != NULL); + Xil_AssertNonvoid((HandlerType >= (u32)(XENH_HANDLER_PROCSTART)) && + (HandlerType <= (u32)(XENH_HANDLER_ERROR))); + + /* Calls the respective callbacks according to handler type. */ + switch (HandlerType) { + case XENH_HANDLER_PROCSTART: + InstancePtr->ProcStartCallBack = + (XEnhance_CallBack)((void *)CallBackFunc); + InstancePtr->ProcStartRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + case XENH_HANDLER_FRAMEDONE: + InstancePtr->FrameDoneCallBack = + (XEnhance_CallBack)((void *)CallBackFunc); + InstancePtr->FrameDoneRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + case XENH_HANDLER_ERROR: + InstancePtr->ErrCallBack = + (XEnhance_ErrorCallBack)((void *)CallBackFunc); + InstancePtr->ErrRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + default: + Status = (XST_INVALID_PARAM); + break; + } return Status; } diff --git a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_selftest.c b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_selftest.c index 52025f53..3b40c22f 100644 --- a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_selftest.c +++ b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_selftest.c @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* Copyright (C) 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 -* XILINX 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. -* +/****************************************************************************** +* +* Copyright (C) 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 +* XILINX 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 xenhance_selftest.c @@ -39,76 +39,76 @@ * * This file contains the self-test functions for the Enhance driver. * The self test function reads the Version register. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who  Date     Changes
-* ----- ---- -------- -----------------------------------------------
-* 7.0   adk  19/02/14 First Release.
-*                     Implemented the following function
-*                     XEnhance_SelfTest
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xenhance.h" -#include "xstatus.h" - -/************************** Constant Definitions *****************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - - -/************************** Variable Definitions *****************************/ - - -/************************** Function Definitions *****************************/ - -/*****************************************************************************/ -/** -* -* This function reads complete Version register of Enhance core and compares -* with zero values as part of self test. -* -* @param InstancePtr is a pointer to the XEnhance instance to be worked -* on. -* -* @return -* - XST_SUCCESS if the test was successful. -* - XST_FAILURE if the test failed. -* -* @note None. -* -******************************************************************************/ -int XEnhance_SelfTest(XEnhance *InstancePtr) -{ - u32 Version; - int Status; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - - /* Read Enhance core version register. */ - Version = XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, - (XENH_VERSION_OFFSET)); - - /* Compare Version with non-zero */ - if(Version != (u32)0x00) { - Status = (XST_SUCCESS); - } - else { - Status = (XST_FAILURE); - } +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who  Date     Changes
+* ----- ---- -------- -----------------------------------------------
+* 7.0   adk  19/02/14 First Release.
+*                     Implemented the following function
+*                     XEnhance_SelfTest
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xenhance.h" +#include "xstatus.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function reads complete Version register of Enhance core and compares +* with zero values as part of self test. +* +* @param InstancePtr is a pointer to the XEnhance instance to be worked +* on. +* +* @return +* - XST_SUCCESS if the test was successful. +* - XST_FAILURE if the test failed. +* +* @note None. +* +******************************************************************************/ +int XEnhance_SelfTest(XEnhance *InstancePtr) +{ + u32 Version; + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + /* Read Enhance core version register. */ + Version = XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, + (XENH_VERSION_OFFSET)); + + /* Compare Version with non-zero */ + if(Version != (u32)0x00) { + Status = (XST_SUCCESS); + } + else { + Status = (XST_FAILURE); + } return Status; } diff --git a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_sinit.c b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_sinit.c index 46ac4f3c..39ce11e5 100644 --- a/XilinxProcessorIPLib/drivers/enhance/src/xenhance_sinit.c +++ b/XilinxProcessorIPLib/drivers/enhance/src/xenhance_sinit.c @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* Copyright (C) 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 -* XILINX 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. -* +/****************************************************************************** +* +* Copyright (C) 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 +* XILINX 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 xenhance_sinit.c @@ -39,75 +39,75 @@ * * This file contains static initialization methods for Xilinx Enhance core. * -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who  Date     Changes
-* ----- ---- -------- ------------------------------------------------------
-* 7.0   adk  02/19/14 First release.
-*                     Implemented the following function
-*                     XEnhance_LookupConfig
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xenhance.h" -#include "xparameters.h" - -/************************** Constant Definitions *****************************/ - - -/**************************** Type Definitions *******************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/************************** Function Prototypes ******************************/ - - -/************************** Variable Declaration *****************************/ - - -/************************** Function Definitions *****************************/ - -/*****************************************************************************/ -/** -* -* This function returns a reference to an XEnhance_Config structure -* based on the unique device id, DeviceId. The return value will refer -* to an entry in the device configuration table defined in the xenhance_g.c. -* file. -* -* @param DeviceId is the unique device ID of the device for the lookup -* operation. -* -* @return XEnhance_LookupConfig returns a reference to a config record in -* the configuration table (in xenhance_g.c) corresponding to -* DeviceId, or NULL if no match is found. -* -* @note None. -* -******************************************************************************/ -XEnhance_Config *XEnhance_LookupConfig(u16 DeviceId) -{ - extern XEnhance_Config - XEnhance_ConfigTable[XPAR_ENHANCE_NUM_INSTANCES]; - XEnhance_Config *CfgPtr = NULL; - u32 Index; - - /* To get the reference pointer to XEnhance_Config structure */ - for (Index = (u32)0x0; Index < (u32)(XPAR_ENHANCE_NUM_INSTANCES); - Index++) { - - /* Compare device Id with configTable's device Id */ - if (XEnhance_ConfigTable[Index].DeviceId == DeviceId) { - CfgPtr = &XEnhance_ConfigTable[Index]; - break; - } - } +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who  Date     Changes
+* ----- ---- -------- ------------------------------------------------------
+* 7.0   adk  02/19/14 First release.
+*                     Implemented the following function
+*                     XEnhance_LookupConfig
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xenhance.h" +#include "xparameters.h" + +/************************** Constant Definitions *****************************/ + + +/**************************** Type Definitions *******************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Declaration *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function returns a reference to an XEnhance_Config structure +* based on the unique device id, DeviceId. The return value will refer +* to an entry in the device configuration table defined in the xenhance_g.c. +* file. +* +* @param DeviceId is the unique device ID of the device for the lookup +* operation. +* +* @return XEnhance_LookupConfig returns a reference to a config record in +* the configuration table (in xenhance_g.c) corresponding to +* DeviceId, or NULL if no match is found. +* +* @note None. +* +******************************************************************************/ +XEnhance_Config *XEnhance_LookupConfig(u16 DeviceId) +{ + extern XEnhance_Config + XEnhance_ConfigTable[XPAR_ENHANCE_NUM_INSTANCES]; + XEnhance_Config *CfgPtr = NULL; + u32 Index; + + /* To get the reference pointer to XEnhance_Config structure */ + for (Index = (u32)0x0; Index < (u32)(XPAR_ENHANCE_NUM_INSTANCES); + Index++) { + + /* Compare device Id with configTable's device Id */ + if (XEnhance_ConfigTable[Index].DeviceId == DeviceId) { + CfgPtr = &XEnhance_ConfigTable[Index]; + break; + } + } return (XEnhance_Config *)CfgPtr; } diff --git a/XilinxProcessorIPLib/drivers/mutex/examples/xmutex_tapp_example.c b/XilinxProcessorIPLib/drivers/mutex/examples/xmutex_tapp_example.c index b3f5cbb7..b60fa7ff 100644 --- a/XilinxProcessorIPLib/drivers/mutex/examples/xmutex_tapp_example.c +++ b/XilinxProcessorIPLib/drivers/mutex/examples/xmutex_tapp_example.c @@ -4,7 +4,7 @@ * * 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 +* 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: diff --git a/XilinxProcessorIPLib/drivers/osd/data/osd.mdd b/XilinxProcessorIPLib/drivers/osd/data/osd.mdd index 081a9606..c31358cd 100755 --- a/XilinxProcessorIPLib/drivers/osd/data/osd.mdd +++ b/XilinxProcessorIPLib/drivers/osd/data/osd.mdd @@ -1,51 +1,51 @@ -############################################################################## -# -# Copyright (C) 2008 - 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 -# XILINX 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. -# -# MODIFICATION HISTORY: -# -# Ver Who Date Changes -# ----- ------ -------- ------------------------------------------------------ -# 1.00a adk 02/18/14 Removed the implementation of interrupt_handler array. -# +############################################################################## +# +# Copyright (C) 2008 - 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 +# XILINX 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. +# +# MODIFICATION HISTORY: +# +# Ver Who Date Changes +# ----- ------ -------- ------------------------------------------------------ +# 1.00a adk 02/18/14 Removed the implementation of interrupt_handler array. +# ############################################################################### - -OPTION psf_version = 2.1; - -BEGIN driver osd - - OPTION supported_peripherals = (v_osd_v[6-9]_[0-9]); - OPTION driver_state = ACTIVE; - OPTION copyfiles = all; - OPTION VERSION = 4.0; - OPTION NAME = osd; - -END driver - - + +OPTION psf_version = 2.1; + +BEGIN driver osd + + OPTION supported_peripherals = (v_osd_v[6-9]_[0-9]); + OPTION driver_state = ACTIVE; + OPTION copyfiles = all; + OPTION VERSION = 4.0; + OPTION NAME = osd; + +END driver + + diff --git a/XilinxProcessorIPLib/drivers/osd/data/osd.tcl b/XilinxProcessorIPLib/drivers/osd/data/osd.tcl index 4a0db059..fd5ccecf 100755 --- a/XilinxProcessorIPLib/drivers/osd/data/osd.tcl +++ b/XilinxProcessorIPLib/drivers/osd/data/osd.tcl @@ -1,32 +1,32 @@ -############################################################################## -# -# Copyright (C) 2008 - 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 -# XILINX 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. +############################################################################## +# +# Copyright (C) 2008 - 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 +# XILINX 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. ############################################################################### #uses "xillib.tcl" diff --git a/XilinxProcessorIPLib/drivers/osd/examples/index.html b/XilinxProcessorIPLib/drivers/osd/examples/index.html index 2b01bdaf..e0c2ce5e 100755 --- a/XilinxProcessorIPLib/drivers/osd/examples/index.html +++ b/XilinxProcessorIPLib/drivers/osd/examples/index.html @@ -1,17 +1,17 @@ - - - - - -Driver example applications - - - -

Example Applications for the driver osd_v3_1

-
- -

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

- - + + + + + +Driver example applications + + + +

Example Applications for the driver osd_v3_1

+
+ +

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

+ + diff --git a/XilinxProcessorIPLib/drivers/osd/examples/osd_selftest_example.c b/XilinxProcessorIPLib/drivers/osd/examples/osd_selftest_example.c index 5131e5e7..26a13c6b 100644 --- a/XilinxProcessorIPLib/drivers/osd/examples/osd_selftest_example.c +++ b/XilinxProcessorIPLib/drivers/osd/examples/osd_selftest_example.c @@ -1,150 +1,150 @@ -/****************************************************************************** -* -* Copyright (C) 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 -* XILINX 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 osd_selftest_example.c -* -* This file contains an example using the OSD driver to do self test -* on the core. -* -* @note None. -* -* MODIFICATION HISTORY: -*
-* Ver   Who    Date     Changes
-* ----- ------ -------- ------------------------------------------------------
-* 4.0   adk    02/18/14 First Release
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xparameters.h" -#include "xosd.h" -#include "xil_printf.h" - -/************************** Constant Definitions *****************************/ - -/** -* The following constants map to the XPAR parameters created in the -* xparameters.h file. They are defined here such that a user can easily -* change all the needed parameters in one place. -*/ -#define XOSD_DEVICE_ID XPAR_OSD_0_DEVICE_ID - -/**************************** Type Definitions *******************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/************************** Function Prototypes ******************************/ - -int XOsdSelfTestExample(u16 DeviceId); - -/************************** Variable Definitions *****************************/ - -XOsd OsdInst; /**< Instance of the OSD Device */ - -/*****************************************************************************/ -/** -* -* Main/Entry function for self test example. -* -* @return -* - XST_SUCCESS if successful. -* - XST_FAILURE if unsuccessful. -* -* @note None -* -******************************************************************************/ -int main(void) -{ - int Status; - - /* Run selftest example */ - Status = XOsdSelfTestExample(XOSD_DEVICE_ID); - - if (Status != XST_SUCCESS) { - xil_printf("OSD driver Selftest Example Failed\r\n"); - return XST_FAILURE; - } - - xil_printf("Successfully ran OSD driver Selftest Example\r\n"); - - return XST_SUCCESS; -} - -/*****************************************************************************/ -/** -* -* This function does a minimal test on the OSD driver. -* -* @param DeviceId is an ID of OSD core or device. -* -* @return -* - XST_SUCCESS if successful. -* - XST_FAILURE if unsuccessful. -* -* @note None. -* -******************************************************************************/ -int XOsdSelfTestExample(u16 DeviceId) -{ - int Status; - XOsd_Config *Config; - - /* Initialize the OSD driver so that it's ready to use look up the - * configuration in the config table, then initialize it. - */ - Config = XOsd_LookupConfig(DeviceId); - - if (NULL == Config) { - return XST_FAILURE; - } - - Status = XOsd_CfgInitialize(&OsdInst, Config, Config->BaseAddress); - - if (Status != XST_SUCCESS) { - return XST_FAILURE; - } - /* Perform a self-test to check hardware build. */ - Status = XOsd_SelfTest(&OsdInst); - - if (Status != XST_SUCCESS) { - return XST_FAILURE; - } - - return XST_SUCCESS; -} +/****************************************************************************** +* +* Copyright (C) 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 +* XILINX 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 osd_selftest_example.c +* +* This file contains an example using the OSD driver to do self test +* on the core. +* +* @note None. +* +* MODIFICATION HISTORY: +*
+* Ver   Who    Date     Changes
+* ----- ------ -------- ------------------------------------------------------
+* 4.0   adk    02/18/14 First Release
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xparameters.h" +#include "xosd.h" +#include "xil_printf.h" + +/************************** Constant Definitions *****************************/ + +/** +* The following constants map to the XPAR parameters created in the +* xparameters.h file. They are defined here such that a user can easily +* change all the needed parameters in one place. +*/ +#define XOSD_DEVICE_ID XPAR_OSD_0_DEVICE_ID + +/**************************** Type Definitions *******************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/************************** Function Prototypes ******************************/ + +int XOsdSelfTestExample(u16 DeviceId); + +/************************** Variable Definitions *****************************/ + +XOsd OsdInst; /**< Instance of the OSD Device */ + +/*****************************************************************************/ +/** +* +* Main/Entry function for self test example. +* +* @return +* - XST_SUCCESS if successful. +* - XST_FAILURE if unsuccessful. +* +* @note None +* +******************************************************************************/ +int main(void) +{ + int Status; + + /* Run selftest example */ + Status = XOsdSelfTestExample(XOSD_DEVICE_ID); + + if (Status != XST_SUCCESS) { + xil_printf("OSD driver Selftest Example Failed\r\n"); + return XST_FAILURE; + } + + xil_printf("Successfully ran OSD driver Selftest Example\r\n"); + + return XST_SUCCESS; +} + +/*****************************************************************************/ +/** +* +* This function does a minimal test on the OSD driver. +* +* @param DeviceId is an ID of OSD core or device. +* +* @return +* - XST_SUCCESS if successful. +* - XST_FAILURE if unsuccessful. +* +* @note None. +* +******************************************************************************/ +int XOsdSelfTestExample(u16 DeviceId) +{ + int Status; + XOsd_Config *Config; + + /* Initialize the OSD driver so that it's ready to use look up the + * configuration in the config table, then initialize it. + */ + Config = XOsd_LookupConfig(DeviceId); + + if (NULL == Config) { + return XST_FAILURE; + } + + Status = XOsd_CfgInitialize(&OsdInst, Config, Config->BaseAddress); + + if (Status != XST_SUCCESS) { + return XST_FAILURE; + } + /* Perform a self-test to check hardware build. */ + Status = XOsd_SelfTest(&OsdInst); + + if (Status != XST_SUCCESS) { + return XST_FAILURE; + } + + return XST_SUCCESS; +} diff --git a/XilinxProcessorIPLib/drivers/osd/src/Makefile b/XilinxProcessorIPLib/drivers/osd/src/Makefile index 118e65e8..8ebb71ba 100644 --- a/XilinxProcessorIPLib/drivers/osd/src/Makefile +++ b/XilinxProcessorIPLib/drivers/osd/src/Makefile @@ -1,29 +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 osd" - $(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES) - $(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS} - make clean - -include: - ${CP} $(INCLUDEFILES) $(INCLUDEDIR) - -clean: - rm -rf ${OUTS} - +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 osd" + $(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES) + $(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS} + make clean + +include: + ${CP} $(INCLUDEFILES) $(INCLUDEDIR) + +clean: + rm -rf ${OUTS} + diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd.c b/XilinxProcessorIPLib/drivers/osd/src/xosd.c index 840684a9..2b7eb83a 100644 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd.c @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* 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 -* XILINX 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. -* -******************************************************************************/ -/*****************************************************************************/ +/****************************************************************************** +* +* 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 +* XILINX 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 xosd.c @@ -39,109 +39,109 @@ * * This file is main code of Xilinx Video On-Screen-Display (OSD) core. * Please see xosd.h for more details of the driver. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date     Changes
-* ----- ------ -------- -------------------------------------------------------
-* 1.00a xd     08/18/08 First release.
-* 1.02a xd     12/21/10 Removed endian conversion for text bank loading.
-* 1.03a cm     09/07/11 Updated XOsd_GetLayerAlpha(), XOsd_SetLayerAlpha(),
-*                       XOsd_SetBackgroundColor() and XOsd_GetBackgroundColor()
-*                       to allow 10 and 12 bit alpha and background colors.
-* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating
-*                       basic types, MB cache functions, exceptions and
-*                       assertions to xil_io format.
-* 4.0   adk    02/18/14 Renamed S_AXIS_VIDEO_DATA_WIDTH ->
-*                                                      SlaveAxisVideoDataWidth.
-*                       Removed from XOsd_CfgInitialize:
-*                       VbiStartCallBack, VbiStartRef, VbiEndCallBack,
-*                       VbiEndRef.
-*
-*                       Added in XOsd_CfgInitialize:
-*                       ProcStartCallBack, ProcStartRef.
-*
-*                       Renamed the following function prototypes:
-*                       XOSD_CfgInitialize -> XOsd_CfgInitialize,
-*                       XOSD_SetScreenSize -> XOsd_SetActiveSize,
-*                       XOSD_GetScreenSize -> XOsd_GetActiveSize,
-*                       XOSD_SetBackgroundColor -> XOsd_SetBackgroundColor,
-*                       XOSD_GetBackgroundColor -> XOSD_GetBackgroundColor,
-*                       XOSD_SetLayerDimension -> XOsd_SetLayerDimension,
-*                       XOSD_GetLayerDimension -> XOsd_GetLayerDimension,
-*                       XOSD_SetLayerAlpha -> XOsd_SetLayerAlpha,
-*                       XOSD_GetLayerAlpha -> XOsd_GetLayerAlpha,
-*                       XOSD_SetLayerAlpha -> XOsd_SetLayerAlpha,
-*                       XOSD_GetLayerAlpha -> XOsd_GetLayerAlpha,
-*                       XOSD_SetLayerPriority -> XOsd_SetLayerPriority,
-*                       XOSD_GetLayerPriority -> XOsd_GetLayerPriority,
-*                       XOSD_EnableLayer -> XOsd_EnableLayer,
-*                       XOSD_DisableLayer -> XOsd_DisableLayer,
-*                       XOSD_LoadColorLUTBank - > XOsd_LoadColorLUTBank,
-*                       XOSD_LoadCharacterSetBank -> XOsd_LoadCharacterSetBank,
-*                       XOSD_LoadTextBank - > XOsd_LoadTextBank,
-*                       XOSD_SetActiveBank -> XOsd_SetActiveBank,
-*                       XOSD_CreateInstruction -> XOsd_CreateInstruction,
-*                       XOSD_LoadInstructionList -> XOsd_LoadInstructionList,
-*                       XOSD_LookupConfig -> XOsd_LookupConfig,
-*                       XOSD_IntrHandler -> XOsd_IntrHandler,
-*                       XOSD_SetCallBack -> XOsd_SetCallBack.
-*
-*                       Changed the prototype of XOSD_GetVersion and renamed it as
-*                       XOsd_GetVersion
-*
-*                       Removed the following function implementation:
-*                       XOSD_SetBlankPolarity.
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xosd.h" - -/************************** Constant Definitions *****************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - -static void PopulateLayerProperty(XOsd *InstancePtr, XOsd_Config *CfgPtr); -static void StubCallBack(void *CallBackRef); -static void StubErrCallBack(void *CallBackRef, u32 ErrorMask); - -/************************** Variable Definitions *****************************/ - - -/************************** Function Definitions *****************************/ - -/*****************************************************************************/ -/** -* -* This function initializes an OSD core. This function must be called -* prior to using an OSD core. Initialization of an OSD includes setting up -* the instance data and ensuring the hardware is in a quiescent state. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param CfgPtr points to the configuration structure associated -* with the OSD core. -* @param EffectiveAddr is the base address of the core. 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 if XOsd_CfgInitialize was successful. -* -* @note None. -* -******************************************************************************/ -int XOsd_CfgInitialize(XOsd *InstancePtr, XOsd_Config *CfgPtr, +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- -------------------------------------------------------
+* 1.00a xd     08/18/08 First release.
+* 1.02a xd     12/21/10 Removed endian conversion for text bank loading.
+* 1.03a cm     09/07/11 Updated XOsd_GetLayerAlpha(), XOsd_SetLayerAlpha(),
+*                       XOsd_SetBackgroundColor() and XOsd_GetBackgroundColor()
+*                       to allow 10 and 12 bit alpha and background colors.
+* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating
+*                       basic types, MB cache functions, exceptions and
+*                       assertions to xil_io format.
+* 4.0   adk    02/18/14 Renamed S_AXIS_VIDEO_DATA_WIDTH ->
+*                                                      SlaveAxisVideoDataWidth.
+*                       Removed from XOsd_CfgInitialize:
+*                       VbiStartCallBack, VbiStartRef, VbiEndCallBack,
+*                       VbiEndRef.
+*
+*                       Added in XOsd_CfgInitialize:
+*                       ProcStartCallBack, ProcStartRef.
+*
+*                       Renamed the following function prototypes:
+*                       XOSD_CfgInitialize -> XOsd_CfgInitialize,
+*                       XOSD_SetScreenSize -> XOsd_SetActiveSize,
+*                       XOSD_GetScreenSize -> XOsd_GetActiveSize,
+*                       XOSD_SetBackgroundColor -> XOsd_SetBackgroundColor,
+*                       XOSD_GetBackgroundColor -> XOSD_GetBackgroundColor,
+*                       XOSD_SetLayerDimension -> XOsd_SetLayerDimension,
+*                       XOSD_GetLayerDimension -> XOsd_GetLayerDimension,
+*                       XOSD_SetLayerAlpha -> XOsd_SetLayerAlpha,
+*                       XOSD_GetLayerAlpha -> XOsd_GetLayerAlpha,
+*                       XOSD_SetLayerAlpha -> XOsd_SetLayerAlpha,
+*                       XOSD_GetLayerAlpha -> XOsd_GetLayerAlpha,
+*                       XOSD_SetLayerPriority -> XOsd_SetLayerPriority,
+*                       XOSD_GetLayerPriority -> XOsd_GetLayerPriority,
+*                       XOSD_EnableLayer -> XOsd_EnableLayer,
+*                       XOSD_DisableLayer -> XOsd_DisableLayer,
+*                       XOSD_LoadColorLUTBank - > XOsd_LoadColorLUTBank,
+*                       XOSD_LoadCharacterSetBank -> XOsd_LoadCharacterSetBank,
+*                       XOSD_LoadTextBank - > XOsd_LoadTextBank,
+*                       XOSD_SetActiveBank -> XOsd_SetActiveBank,
+*                       XOSD_CreateInstruction -> XOsd_CreateInstruction,
+*                       XOSD_LoadInstructionList -> XOsd_LoadInstructionList,
+*                       XOSD_LookupConfig -> XOsd_LookupConfig,
+*                       XOSD_IntrHandler -> XOsd_IntrHandler,
+*                       XOSD_SetCallBack -> XOsd_SetCallBack.
+*
+*                       Changed the prototype of XOSD_GetVersion and renamed it as
+*                       XOsd_GetVersion
+*
+*                       Removed the following function implementation:
+*                       XOSD_SetBlankPolarity.
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xosd.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + +static void PopulateLayerProperty(XOsd *InstancePtr, XOsd_Config *CfgPtr); +static void StubCallBack(void *CallBackRef); +static void StubErrCallBack(void *CallBackRef, u32 ErrorMask); + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function initializes an OSD core. This function must be called +* prior to using an OSD core. Initialization of an OSD includes setting up +* the instance data and ensuring the hardware is in a quiescent state. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param CfgPtr points to the configuration structure associated +* with the OSD core. +* @param EffectiveAddr is the base address of the core. 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 if XOsd_CfgInitialize was successful. +* +* @note None. +* +******************************************************************************/ +int XOsd_CfgInitialize(XOsd *InstancePtr, XOsd_Config *CfgPtr, u32 EffectiveAddr) { /* Verify arguments. */ @@ -152,55 +152,55 @@ int XOsd_CfgInitialize(XOsd *InstancePtr, XOsd_Config *CfgPtr, /* Setup the instance */ (void)memset((void *)InstancePtr, 0, sizeof(XOsd)); - (void)memcpy((void *)&(InstancePtr->Config), (const void *)CfgPtr, - sizeof(XOsd_Config)); - InstancePtr->Config.BaseAddress = EffectiveAddr; - - /* Reset to use instruction from the OSD internal buffer */ - InstancePtr->InstructionInExternalMem = 0; - - /* Set all handlers to stub values, let user configure this - * data later - */ - InstancePtr->ProcStartCallBack = - (XOsd_CallBack)((void *)StubCallBack); - InstancePtr->FrameDoneCallBack = - (XOsd_CallBack)((void *)StubCallBack); - InstancePtr->ErrCallBack = - (XOsd_ErrorCallBack)((void *)StubErrCallBack); - - /* Populate the layer properties into a array to help easy - * fetch later - */ - PopulateLayerProperty(InstancePtr, CfgPtr); - - /* Reset the hardware and set the flag to indicate the - * driver is ready - */ - XOsd_Reset(InstancePtr); - InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY); - - return (XST_SUCCESS); -} - -/*****************************************************************************/ -/** -* -* This function sets the screen size of the OSD Output. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param Width defines the width of the OSD output. -* @param Height defines the height of the OSD output. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_SetActiveSize(XOsd *InstancePtr, u32 Width, u32 Height) -{ - u32 RegValue; - + (void)memcpy((void *)&(InstancePtr->Config), (const void *)CfgPtr, + sizeof(XOsd_Config)); + InstancePtr->Config.BaseAddress = EffectiveAddr; + + /* Reset to use instruction from the OSD internal buffer */ + InstancePtr->InstructionInExternalMem = 0; + + /* Set all handlers to stub values, let user configure this + * data later + */ + InstancePtr->ProcStartCallBack = + (XOsd_CallBack)((void *)StubCallBack); + InstancePtr->FrameDoneCallBack = + (XOsd_CallBack)((void *)StubCallBack); + InstancePtr->ErrCallBack = + (XOsd_ErrorCallBack)((void *)StubErrCallBack); + + /* Populate the layer properties into a array to help easy + * fetch later + */ + PopulateLayerProperty(InstancePtr, CfgPtr); + + /* Reset the hardware and set the flag to indicate the + * driver is ready + */ + XOsd_Reset(InstancePtr); + InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY); + + return (XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* +* This function sets the screen size of the OSD Output. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param Width defines the width of the OSD output. +* @param Height defines the height of the OSD output. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_SetActiveSize(XOsd *InstancePtr, u32 Width, u32 Height) +{ + u32 RegValue; + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); @@ -209,158 +209,158 @@ void XOsd_SetActiveSize(XOsd *InstancePtr, u32 Width, u32 Height) Xil_AssertVoid(Width <= (u32)(XOSD_ACTSIZE_NUM_PIXEL_MASK)); Xil_AssertVoid(Height <= ((XOSD_ACTSIZE_NUM_LINE_MASK) >> (XOSD_ACTSIZE_NUM_LINE_SHIFT))); - - /* Save the dimension info in the driver instance for error handling */ - InstancePtr->ScreenWidth = Width; - InstancePtr->ScreenHeight = Height; - - /* Update the screen size register */ - RegValue = Width; - RegValue |= (Height << (XOSD_ACTSIZE_NUM_LINE_SHIFT)) & - (XOSD_ACTSIZE_NUM_LINE_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - (XOSD_ACTIVE_SIZE_OFFSET), RegValue); -} - -/*****************************************************************************/ -/** -* -* This function gets the screen size of the OSD Output. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param WidthPtr will point to the width of the OSD output after this -* function returns. -* @param HeightPtr will point to the height of the OSD output after this -* function returns. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_GetActiveSize(XOsd *InstancePtr, u32 *WidthPtr, u32 *HeightPtr) -{ - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid(WidthPtr != NULL); - Xil_AssertVoid(HeightPtr != NULL); - - /* Get the screen size info */ - RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, - (XOSD_ACTIVE_SIZE_OFFSET)); - *WidthPtr = (RegValue) & (XOSD_ACTSIZE_NUM_PIXEL_MASK); - *HeightPtr = ((RegValue) & (XOSD_ACTSIZE_NUM_LINE_MASK)) >> - (XOSD_ACTSIZE_NUM_LINE_SHIFT); -} - -/*****************************************************************************/ -/** -* -* This function sets the background color used by the OSD output. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param Red indicates the red value to be used in the background color. -* @param Blue indicates the blue value to be used in the background -* color. -* @param Green indicates the green value to be used in the background -* color. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_SetBackgroundColor(XOsd *InstancePtr, u16 Red, u16 Blue, u16 Green) -{ - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - - /* Update the background color register */ - RegValue = ((u32)Green) & (XOSD_BC0_YG_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_BC0_OFFSET), - RegValue); - RegValue = ((u32)Blue) & (XOSD_BC1_UCBB_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_BC1_OFFSET), - RegValue); - RegValue = ((u32)Red) & (XOSD_BC2_VCRR_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_BC2_OFFSET), - RegValue); -} - -/*****************************************************************************/ -/** -* -* This function gets the background color used by the OSD output. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param RedPtr will point to the red value used in the background color -* after this function returns. -* @param BluePtr will point to the blue value used in the background -* color after this function returns. -* @param GreenPtr will point to the green value used in the background -* color after this function returns. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_GetBackgroundColor(XOsd *InstancePtr, u16 *RedPtr, u16 *BluePtr, - u16 *GreenPtr) -{ - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid(RedPtr != NULL); - Xil_AssertVoid(BluePtr != NULL); - Xil_AssertVoid(GreenPtr != NULL); - - /* Get the background color */ - *GreenPtr = (u16)((XOsd_ReadReg(InstancePtr->Config.BaseAddress, - (XOSD_BC0_OFFSET))) & (XOSD_BC0_YG_MASK)); - *BluePtr = (u16)((XOsd_ReadReg(InstancePtr->Config.BaseAddress, - (XOSD_BC1_OFFSET))) & (XOSD_BC1_UCBB_MASK)); - *RedPtr = (u16)((XOsd_ReadReg(InstancePtr->Config.BaseAddress, - XOSD_BC2_OFFSET)) & (XOSD_BC2_VCRR_MASK)); -} - - -/*****************************************************************************/ -/** -* -* This function sets the start position and size of an OSD layer. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param LayerIndex indicates which layer to be worked on. Valid -* value range is from 0 to (the number of layers implemented in -* the core - 1). -* @param XStart indicates the horizontal start pixel of origin of the -* layer. -* @param YStart indicates the vertical start line of origin of the -* layer. -* @param XSize indicates the horizontal size of the layer. -* @param YSize indicates the vertical size of the layer. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_SetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 XStart, - u16 YStart, u16 XSize, u16 YSize) -{ - u32 LayerBaseRegAddr; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + + /* Save the dimension info in the driver instance for error handling */ + InstancePtr->ScreenWidth = Width; + InstancePtr->ScreenHeight = Height; + + /* Update the screen size register */ + RegValue = Width; + RegValue |= (Height << (XOSD_ACTSIZE_NUM_LINE_SHIFT)) & + (XOSD_ACTSIZE_NUM_LINE_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + (XOSD_ACTIVE_SIZE_OFFSET), RegValue); +} + +/*****************************************************************************/ +/** +* +* This function gets the screen size of the OSD Output. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param WidthPtr will point to the width of the OSD output after this +* function returns. +* @param HeightPtr will point to the height of the OSD output after this +* function returns. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_GetActiveSize(XOsd *InstancePtr, u32 *WidthPtr, u32 *HeightPtr) +{ + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid(WidthPtr != NULL); + Xil_AssertVoid(HeightPtr != NULL); + + /* Get the screen size info */ + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_ACTIVE_SIZE_OFFSET)); + *WidthPtr = (RegValue) & (XOSD_ACTSIZE_NUM_PIXEL_MASK); + *HeightPtr = ((RegValue) & (XOSD_ACTSIZE_NUM_LINE_MASK)) >> + (XOSD_ACTSIZE_NUM_LINE_SHIFT); +} + +/*****************************************************************************/ +/** +* +* This function sets the background color used by the OSD output. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param Red indicates the red value to be used in the background color. +* @param Blue indicates the blue value to be used in the background +* color. +* @param Green indicates the green value to be used in the background +* color. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_SetBackgroundColor(XOsd *InstancePtr, u16 Red, u16 Blue, u16 Green) +{ + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + + /* Update the background color register */ + RegValue = ((u32)Green) & (XOSD_BC0_YG_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_BC0_OFFSET), + RegValue); + RegValue = ((u32)Blue) & (XOSD_BC1_UCBB_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_BC1_OFFSET), + RegValue); + RegValue = ((u32)Red) & (XOSD_BC2_VCRR_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_BC2_OFFSET), + RegValue); +} + +/*****************************************************************************/ +/** +* +* This function gets the background color used by the OSD output. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param RedPtr will point to the red value used in the background color +* after this function returns. +* @param BluePtr will point to the blue value used in the background +* color after this function returns. +* @param GreenPtr will point to the green value used in the background +* color after this function returns. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_GetBackgroundColor(XOsd *InstancePtr, u16 *RedPtr, u16 *BluePtr, + u16 *GreenPtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid(RedPtr != NULL); + Xil_AssertVoid(BluePtr != NULL); + Xil_AssertVoid(GreenPtr != NULL); + + /* Get the background color */ + *GreenPtr = (u16)((XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_BC0_OFFSET))) & (XOSD_BC0_YG_MASK)); + *BluePtr = (u16)((XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_BC1_OFFSET))) & (XOSD_BC1_UCBB_MASK)); + *RedPtr = (u16)((XOsd_ReadReg(InstancePtr->Config.BaseAddress, + XOSD_BC2_OFFSET)) & (XOSD_BC2_VCRR_MASK)); +} + + +/*****************************************************************************/ +/** +* +* This function sets the start position and size of an OSD layer. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param LayerIndex indicates which layer to be worked on. Valid +* value range is from 0 to (the number of layers implemented in +* the core - 1). +* @param XStart indicates the horizontal start pixel of origin of the +* layer. +* @param YStart indicates the vertical start line of origin of the +* layer. +* @param XSize indicates the horizontal size of the layer. +* @param YSize indicates the vertical size of the layer. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_SetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 XStart, + u16 YStart, u16 XSize, u16 YSize) +{ + u32 LayerBaseRegAddr; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != (XOSD_LAYER_TYPE_DISABLE)); @@ -369,71 +369,71 @@ void XOsd_SetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 XStart, Xil_AssertVoid(((u32)XStart + (u32)XSize) <= InstancePtr->ScreenWidth); Xil_AssertVoid(((u32)YStart + (u32)YSize) <= InstancePtr->ScreenHeight); - - /* Calculate the base register address of the layer to work on */ - LayerBaseRegAddr = (u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * - ((u32)(XOSD_LAYER_SIZE))); - - /* Set the origin of the layer */ - RegValue = ((u32)XStart) & (XOSD_LXP_XSTART_MASK); - RegValue |= (((u32)YStart) << (XOSD_LXP_YSTART_SHIFT)) & - (XOSD_LXP_YSTART_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, LayerBaseRegAddr + - (XOSD_LXP), RegValue); - - /* Set the size of the layer */ - RegValue = ((u32)XSize) & (XOSD_LXS_XSIZE_MASK); - RegValue |= (((u32)YSize) << (XOSD_LXS_YSIZE_SHIFT)) & - (XOSD_LXS_YSIZE_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXS)), RegValue); -} - -/*****************************************************************************/ -/** -* -* This function gets the start position and size of an OSD layer. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param LayerIndex indicates which layer to be worked on. Valid -* value range is from 0 to (the number of layers implemented -* in the core - 1). -* @param XStartPtr will point to the horizontal start pixel value -* of origin of the layer after this function returns. -* @param YStartPtr will point to the vertical start line of origin -* of the layer after this function returns. -* @param XSizePtr will point to the horizontal size value of the -* layer after this function returns. -* @param YSizePtr will point to the vertical size value of the -* layer after this function returns. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_GetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 *XStartPtr, - u16 *YStartPtr, u16 *XSizePtr, u16 *YSizePtr) -{ - u32 LayerBaseRegAddr; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != - (XOSD_LAYER_TYPE_DISABLE)); - Xil_AssertVoid(XStartPtr != NULL); - Xil_AssertVoid(YStartPtr != NULL); - Xil_AssertVoid(XSizePtr != NULL); - Xil_AssertVoid(YSizePtr != NULL); - - /* Calculate the base register address of the layer to work on */ - LayerBaseRegAddr = (u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * - ((u32)XOSD_LAYER_SIZE)); - - /* Get the origin of the layer */ + + /* Calculate the base register address of the layer to work on */ + LayerBaseRegAddr = (u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * + ((u32)(XOSD_LAYER_SIZE))); + + /* Set the origin of the layer */ + RegValue = ((u32)XStart) & (XOSD_LXP_XSTART_MASK); + RegValue |= (((u32)YStart) << (XOSD_LXP_YSTART_SHIFT)) & + (XOSD_LXP_YSTART_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, LayerBaseRegAddr + + (XOSD_LXP), RegValue); + + /* Set the size of the layer */ + RegValue = ((u32)XSize) & (XOSD_LXS_XSIZE_MASK); + RegValue |= (((u32)YSize) << (XOSD_LXS_YSIZE_SHIFT)) & + (XOSD_LXS_YSIZE_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXS)), RegValue); +} + +/*****************************************************************************/ +/** +* +* This function gets the start position and size of an OSD layer. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param LayerIndex indicates which layer to be worked on. Valid +* value range is from 0 to (the number of layers implemented +* in the core - 1). +* @param XStartPtr will point to the horizontal start pixel value +* of origin of the layer after this function returns. +* @param YStartPtr will point to the vertical start line of origin +* of the layer after this function returns. +* @param XSizePtr will point to the horizontal size value of the +* layer after this function returns. +* @param YSizePtr will point to the vertical size value of the +* layer after this function returns. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_GetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 *XStartPtr, + u16 *YStartPtr, u16 *XSizePtr, u16 *YSizePtr) +{ + u32 LayerBaseRegAddr; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != + (XOSD_LAYER_TYPE_DISABLE)); + Xil_AssertVoid(XStartPtr != NULL); + Xil_AssertVoid(YStartPtr != NULL); + Xil_AssertVoid(XSizePtr != NULL); + Xil_AssertVoid(YSizePtr != NULL); + + /* Calculate the base register address of the layer to work on */ + LayerBaseRegAddr = (u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * + ((u32)XOSD_LAYER_SIZE)); + + /* Get the origin of the layer */ RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, ((LayerBaseRegAddr) + (XOSD_LXP))); *XStartPtr = (u16)((RegValue) & (XOSD_LXP_XSTART_MASK)); @@ -442,53 +442,53 @@ void XOsd_GetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 *XStartPtr, /* Get the size of the layer */ RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, - LayerBaseRegAddr + (XOSD_LXS)); - *XSizePtr = (u16)((RegValue) & (XOSD_LXS_XSIZE_MASK)); - *YSizePtr = (u16)(((RegValue) & (XOSD_LXS_YSIZE_MASK)) >> - (XOSD_LXS_YSIZE_SHIFT)); -} - -/*****************************************************************************/ -/** -* -* This function sets the alpha value and mode of an OSD layer. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param LayerIndex indicates which layer to be worked on. Valid value -* range is from 0 to (the number of layers implemented in the -* core - 1). -* @param GlobalAlphaEnable indicates whether to enable the global alpha. -* Use any non-0 value to enable the global alpha, and 0 to -* disable it. -* @param GlobalAlphaValue indicates the transparent level. 0 for 100% -* transparent, 255 (8bit) for 0% transparent (100% opaque). -* This argument will be ignored if parameter GlobalAlphaEnble has -* value 0. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_SetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, - u16 GlobalAlphaEnable, u16 GlobalAlphaValue) -{ - u32 LayerBaseRegAddr; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != - (XOSD_LAYER_TYPE_DISABLE)); - - /* Calculate the base register address of the layer to work on */ - LayerBaseRegAddr = (u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * - ((u32)(XOSD_LAYER_SIZE))); - - /* Read the current Layer Control register value */ - RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + LayerBaseRegAddr + (XOSD_LXS)); + *XSizePtr = (u16)((RegValue) & (XOSD_LXS_XSIZE_MASK)); + *YSizePtr = (u16)(((RegValue) & (XOSD_LXS_YSIZE_MASK)) >> + (XOSD_LXS_YSIZE_SHIFT)); +} + +/*****************************************************************************/ +/** +* +* This function sets the alpha value and mode of an OSD layer. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param LayerIndex indicates which layer to be worked on. Valid value +* range is from 0 to (the number of layers implemented in the +* core - 1). +* @param GlobalAlphaEnable indicates whether to enable the global alpha. +* Use any non-0 value to enable the global alpha, and 0 to +* disable it. +* @param GlobalAlphaValue indicates the transparent level. 0 for 100% +* transparent, 255 (8bit) for 0% transparent (100% opaque). +* This argument will be ignored if parameter GlobalAlphaEnble has +* value 0. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_SetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, + u16 GlobalAlphaEnable, u16 GlobalAlphaValue) +{ + u32 LayerBaseRegAddr; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != + (XOSD_LAYER_TYPE_DISABLE)); + + /* Calculate the base register address of the layer to work on */ + LayerBaseRegAddr = (u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * + ((u32)(XOSD_LAYER_SIZE))); + + /* Read the current Layer Control register value */ + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, ((LayerBaseRegAddr) + (XOSD_LXC))); /* Update the global alpha enable and the global alpha value fields */ @@ -496,62 +496,62 @@ void XOsd_SetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, RegValue |= ((u32)(XOSD_LXC_GALPHAEN_MASK)); } else { - RegValue &= (u32)(~(XOSD_LXC_GALPHAEN_MASK)); - } - RegValue &= (u32)(~(XOSD_LXC_ALPHA_MASK)); - RegValue |= (((u32)GlobalAlphaValue) << (XOSD_LXC_ALPHA_SHIFT)) & - (XOSD_LXC_ALPHA_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); -} - -/*****************************************************************************/ -/** -* -* This function gets the alpha value and mode of an OSD layer. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param LayerIndex indicates which layer to be worked on. Valid -* value range is from 0 to (the number of layers implemented -* in the core - 1). -* @param GlobalAlphaEnablePtr will point to a flag indicating whether the -* global alpha is enabled on a layer after this function returns. -* Flag 1 indicates that the global alpha is enabled, 0 indicates -* that it is not. -* @param GlobalAlphaValuePtr will point to the transparent level after -* this function returns. 0 for 100% transparent, 255 (8bit) -* for 0% transparent (100% opaque). -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_GetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, - u16 *GlobalAlphaEnablePtr, u16 *GlobalAlphaValuePtr) -{ - u32 LayerBaseRegAddr; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != - (XOSD_LAYER_TYPE_DISABLE)); - Xil_AssertVoid(GlobalAlphaEnablePtr != NULL); - Xil_AssertVoid(GlobalAlphaValuePtr != NULL); - - /* Calculate the base register address of the layer to work on */ - LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * - ((u32)(XOSD_LAYER_SIZE)))); - - /* Read the current layer control register value */ - RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC))); - - /* Get the info of the global alpha enable and the global alpha value - * fields + RegValue &= (u32)(~(XOSD_LXC_GALPHAEN_MASK)); + } + RegValue &= (u32)(~(XOSD_LXC_ALPHA_MASK)); + RegValue |= (((u32)GlobalAlphaValue) << (XOSD_LXC_ALPHA_SHIFT)) & + (XOSD_LXC_ALPHA_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); +} + +/*****************************************************************************/ +/** +* +* This function gets the alpha value and mode of an OSD layer. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param LayerIndex indicates which layer to be worked on. Valid +* value range is from 0 to (the number of layers implemented +* in the core - 1). +* @param GlobalAlphaEnablePtr will point to a flag indicating whether the +* global alpha is enabled on a layer after this function returns. +* Flag 1 indicates that the global alpha is enabled, 0 indicates +* that it is not. +* @param GlobalAlphaValuePtr will point to the transparent level after +* this function returns. 0 for 100% transparent, 255 (8bit) +* for 0% transparent (100% opaque). +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_GetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, + u16 *GlobalAlphaEnablePtr, u16 *GlobalAlphaValuePtr) +{ + u32 LayerBaseRegAddr; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != + (XOSD_LAYER_TYPE_DISABLE)); + Xil_AssertVoid(GlobalAlphaEnablePtr != NULL); + Xil_AssertVoid(GlobalAlphaValuePtr != NULL); + + /* Calculate the base register address of the layer to work on */ + LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * + ((u32)(XOSD_LAYER_SIZE)))); + + /* Read the current layer control register value */ + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC))); + + /* Get the info of the global alpha enable and the global alpha value + * fields */ *GlobalAlphaEnablePtr = (u16)((((RegValue) & ((u32)(XOSD_LXC_GALPHAEN_MASK))) == @@ -559,168 +559,168 @@ void XOsd_GetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, *GlobalAlphaValuePtr = (u16)(((RegValue) & (XOSD_LXC_ALPHA_MASK)) >> (XOSD_LXC_ALPHA_SHIFT)); } - -/*****************************************************************************/ -/** -* -* This function sets the priority of an OSD layer. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param LayerIndex indicates which layer to be worked on. Valid value -* range is from 0 to (the number of layers implemented in the -* core - 1). -* @param Priority indicates the priority to be applied on the layer. -* Use one of XOSD_LAYER_PRIORITY_0 (the lowest priority) through -* XOSD_LAYER_PRIORITY_7 (the highest priority) defined in -* xosd_hw.h. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_SetLayerPriority(XOsd *InstancePtr, u8 LayerIndex, u8 Priority) -{ - u32 LayerBaseRegAddr; - u32 RegValue; - - /* Verify arguments */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != - (XOSD_LAYER_TYPE_DISABLE)); - Xil_AssertVoid(Priority <= (XOSD_LAYER_PRIORITY_7)); - - /* Calculate the base register address of the layer to work on */ - LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET)) + ((((u32)LayerIndex) * - ((u32)(XOSD_LAYER_SIZE)))); - - /* Read the current layer control register value */ - RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC))); - - /* Update the priority field */ - RegValue &= (u32)(~(XOSD_LXC_PRIORITY_MASK)); - RegValue |= (((u32)Priority) << (XOSD_LXC_PRIORITY_SHIFT)) - & (XOSD_LXC_PRIORITY_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); -} - -/*****************************************************************************/ -/** -* -* This function gets the priority of an OSD layer. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param LayerIndex indicates which layer to be worked on. Valid value -* range is from 0 to (the number of layers implemented in the -* core - 1). -* @param PriorityPtr will point to the priority used on the layer -* after this function returns. Use one of XOSD_LAYER_PRIORITY_0 -* (the lowest priority) through XOSD_LAYER_PRIORITY_7 -* (the highest priority) defined in xosd_hw.h to interpret -* the value. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_GetLayerPriority(XOsd *InstancePtr, u8 LayerIndex, u8 *PriorityPtr) -{ - u32 LayerBaseRegAddr; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != - (XOSD_LAYER_TYPE_DISABLE)); - Xil_AssertVoid(PriorityPtr != NULL); - - /* Calculate the base register address of the layer to work on */ - LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET)) + ((((u32)LayerIndex) * - ((u32)(XOSD_LAYER_SIZE)))); - - /* Read the current layer control register value */ - RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC))); - - /* Get the priority field */ - *PriorityPtr = (u8)(((RegValue) & (XOSD_LXC_PRIORITY_MASK)) >> - (XOSD_LXC_PRIORITY_SHIFT)); -} - -/*****************************************************************************/ -/** -* -* This function enables an OSD layer. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param LayerIndex indicates which layer to be worked on. Valid -* value range is from 0 to (the number of layers implemented -* in the core - 1). -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_EnableLayer(XOsd *InstancePtr, u8 LayerIndex) -{ - u32 LayerBaseRegAddr; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != - (XOSD_LAYER_TYPE_DISABLE)); - - /* Calculate the base register address of the layer to work on */ - LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET)) + ((((u32)LayerIndex) * - ((u32)(XOSD_LAYER_SIZE)))); - - /* Read the current layer control register value */ - RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC))); - - /* Set the layer enable field */ - RegValue |= (XOSD_LXC_EN_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); -} - -/*****************************************************************************/ -/** -* -* This function disables an OSD layer. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param LayerIndex indicates which layer to be worked on. Valid -* value range is from 0 to (the number of layers implemented -* in the core - 1). -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_DisableLayer(XOsd *InstancePtr, u8 LayerIndex) -{ - u32 LayerBaseRegAddr; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != - (XOSD_LAYER_TYPE_DISABLE)); + +/*****************************************************************************/ +/** +* +* This function sets the priority of an OSD layer. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param LayerIndex indicates which layer to be worked on. Valid value +* range is from 0 to (the number of layers implemented in the +* core - 1). +* @param Priority indicates the priority to be applied on the layer. +* Use one of XOSD_LAYER_PRIORITY_0 (the lowest priority) through +* XOSD_LAYER_PRIORITY_7 (the highest priority) defined in +* xosd_hw.h. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_SetLayerPriority(XOsd *InstancePtr, u8 LayerIndex, u8 Priority) +{ + u32 LayerBaseRegAddr; + u32 RegValue; + + /* Verify arguments */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != + (XOSD_LAYER_TYPE_DISABLE)); + Xil_AssertVoid(Priority <= (XOSD_LAYER_PRIORITY_7)); + + /* Calculate the base register address of the layer to work on */ + LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET)) + ((((u32)LayerIndex) * + ((u32)(XOSD_LAYER_SIZE)))); + + /* Read the current layer control register value */ + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC))); + + /* Update the priority field */ + RegValue &= (u32)(~(XOSD_LXC_PRIORITY_MASK)); + RegValue |= (((u32)Priority) << (XOSD_LXC_PRIORITY_SHIFT)) + & (XOSD_LXC_PRIORITY_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); +} + +/*****************************************************************************/ +/** +* +* This function gets the priority of an OSD layer. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param LayerIndex indicates which layer to be worked on. Valid value +* range is from 0 to (the number of layers implemented in the +* core - 1). +* @param PriorityPtr will point to the priority used on the layer +* after this function returns. Use one of XOSD_LAYER_PRIORITY_0 +* (the lowest priority) through XOSD_LAYER_PRIORITY_7 +* (the highest priority) defined in xosd_hw.h to interpret +* the value. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_GetLayerPriority(XOsd *InstancePtr, u8 LayerIndex, u8 *PriorityPtr) +{ + u32 LayerBaseRegAddr; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != + (XOSD_LAYER_TYPE_DISABLE)); + Xil_AssertVoid(PriorityPtr != NULL); + + /* Calculate the base register address of the layer to work on */ + LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET)) + ((((u32)LayerIndex) * + ((u32)(XOSD_LAYER_SIZE)))); + + /* Read the current layer control register value */ + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC))); + + /* Get the priority field */ + *PriorityPtr = (u8)(((RegValue) & (XOSD_LXC_PRIORITY_MASK)) >> + (XOSD_LXC_PRIORITY_SHIFT)); +} + +/*****************************************************************************/ +/** +* +* This function enables an OSD layer. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param LayerIndex indicates which layer to be worked on. Valid +* value range is from 0 to (the number of layers implemented +* in the core - 1). +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_EnableLayer(XOsd *InstancePtr, u8 LayerIndex) +{ + u32 LayerBaseRegAddr; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != + (XOSD_LAYER_TYPE_DISABLE)); + + /* Calculate the base register address of the layer to work on */ + LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET)) + ((((u32)LayerIndex) * + ((u32)(XOSD_LAYER_SIZE)))); + + /* Read the current layer control register value */ + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC))); + + /* Set the layer enable field */ + RegValue |= (XOSD_LXC_EN_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); +} + +/*****************************************************************************/ +/** +* +* This function disables an OSD layer. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param LayerIndex indicates which layer to be worked on. Valid +* value range is from 0 to (the number of layers implemented +* in the core - 1). +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_DisableLayer(XOsd *InstancePtr, u8 LayerIndex) +{ + u32 LayerBaseRegAddr; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)LayerIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != + (XOSD_LAYER_TYPE_DISABLE)); /* Calculate the base register address of the layer to work on */ LayerBaseRegAddr = ((u32)(XOSD_L0C_OFFSET)) + @@ -728,56 +728,56 @@ void XOsd_DisableLayer(XOsd *InstancePtr, u8 LayerIndex) /* Read the current layer control register value */ RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC))); - - /* Clear the layer enable field */ - RegValue &= (u32)(~(XOSD_LXC_EN_MASK)); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); -} - -/*****************************************************************************/ -/** -* -* This function loads color look up table data into an OSD Graphics Controller -* bank. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param GcIndex indicates which Graphics Controller to work on. -* Valid value range is from 0 to (The Number of Layers) - 1. -* The layer's type must be set to XOSD_LAYER_TYPE_GPU -* (defined in xosd_hw.h) for this function to work properly. -* @param BankIndex indicates which GC Bank to be worked on. Valid -* value range is from 0 to XOSD_GC_BANK_NUM - 1. -* @param ColorData points to the color LUT data to be loaded. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_LoadColorLUTBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 ColorData[]) -{ - u32 Index; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == - (XOSD_LAYER_TYPE_GPU)); - Xil_AssertVoid(BankIndex < (XOSD_GC_BANK_NUM)); - Xil_AssertVoid(ColorData != NULL); - - /* Choose which bank to be loaded */ - RegValue = (((u32)BankIndex) + (XOSD_GCWBA_COL0)) & - (XOSD_GCWBA_BANK_MASK); - RegValue |= (((u32)GcIndex) << (XOSD_GCWBA_GCNUM_SHIFT)) - & (XOSD_GCWBA_GCNUM_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCWBA_OFFSET), - RegValue); + ((LayerBaseRegAddr) + (XOSD_LXC))); + + /* Clear the layer enable field */ + RegValue &= (u32)(~(XOSD_LXC_EN_MASK)); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); +} + +/*****************************************************************************/ +/** +* +* This function loads color look up table data into an OSD Graphics Controller +* bank. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param GcIndex indicates which Graphics Controller to work on. +* Valid value range is from 0 to (The Number of Layers) - 1. +* The layer's type must be set to XOSD_LAYER_TYPE_GPU +* (defined in xosd_hw.h) for this function to work properly. +* @param BankIndex indicates which GC Bank to be worked on. Valid +* value range is from 0 to XOSD_GC_BANK_NUM - 1. +* @param ColorData points to the color LUT data to be loaded. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_LoadColorLUTBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, + u32 ColorData[]) +{ + u32 Index; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == + (XOSD_LAYER_TYPE_GPU)); + Xil_AssertVoid(BankIndex < (XOSD_GC_BANK_NUM)); + Xil_AssertVoid(ColorData != NULL); + + /* Choose which bank to be loaded */ + RegValue = (((u32)BankIndex) + (XOSD_GCWBA_COL0)) & + (XOSD_GCWBA_BANK_MASK); + RegValue |= (((u32)GcIndex) << (XOSD_GCWBA_GCNUM_SHIFT)) + & (XOSD_GCWBA_GCNUM_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCWBA_OFFSET), + RegValue); /* Load color data */ if(InstancePtr->Config.SlaveAxisVideoDataWidth == (u16)(XOSD_DATA_8)) { @@ -785,9 +785,9 @@ void XOsd_LoadColorLUTBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, Index < ((InstancePtr->Layers[GcIndex].ColorLutSize * (XOSD_COLOR_ENTRY_SIZE)) / sizeof(u32)); Index++) { - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - (XOSD_GCD_OFFSET), ColorData[Index]); - } + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + (XOSD_GCD_OFFSET), ColorData[Index]); + } } /* For video channel size of 10 or 12, the color size is 64 bits */ else { @@ -795,11 +795,11 @@ void XOsd_LoadColorLUTBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, Index < (((InstancePtr->Layers[GcIndex].ColorLutSize) * ((XOSD_DATA_2) * (XOSD_COLOR_ENTRY_SIZE))) / (sizeof(u32))); - Index++) { - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - (XOSD_GCD_OFFSET), ColorData[Index]); - } - } + Index++) { + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + (XOSD_GCD_OFFSET), ColorData[Index]); + } + } /* Set the active color LUT bank */ RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET)); @@ -807,60 +807,60 @@ void XOsd_LoadColorLUTBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, RegValue |= ((u32)BankIndex) << ((XOSD_GCABA_COL_SHIFT) + ((u32)GcIndex)); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET), - RegValue); -} - -/*****************************************************************************/ -/** -* -* This function loads character set data (font) into an OSD Graphics -* Controller bank. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param GcIndex indicates which Graphics Controller to work on. Valid -* value range is from 0 to (The Number of Layers) - 1. The -* layer's type must be set to XOSD_LAYER_TYPE_GPU -* (defined in xosd_hw.h) for this function to work properly. -* @param BankIndex indicates which GC bank to be worked on. Valid -* value range is from 0 to XOSD_GC_BANK_NUM - 1. -* @param CharSetData points to the character set data to be loaded. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_LoadCharacterSetBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 CharSetData[]) -{ - u32 RegValue; - u32 FontWriteNum; - u32 Index; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == - (XOSD_LAYER_TYPE_GPU)); - Xil_AssertVoid(BankIndex < (XOSD_GC_BANK_NUM)); - Xil_AssertVoid(CharSetData != NULL); - - /* Choose which bank to be loaded */ - RegValue = (((u32)BankIndex) + (XOSD_GCWBA_CHR0)) & - (XOSD_GCWBA_BANK_MASK); - RegValue |= (((u32)GcIndex) << (XOSD_GCWBA_GCNUM_SHIFT)) & - (XOSD_GCWBA_GCNUM_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCWBA_OFFSET), - RegValue); - - /* Calculate the number of write to load the whole font data set */ - FontWriteNum = ((u32)(InstancePtr->Layers[GcIndex].FontWidth) * - (u32)(InstancePtr->Layers[GcIndex].FontHeight) * - (u32)(InstancePtr->Layers[GcIndex].FontBitsPerPixel)); - FontWriteNum /= (u32)(XOSD_FONT_BIT_TO_BYTE); - FontWriteNum *= (u32)(InstancePtr->Layers[GcIndex].FontNumChars); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET), + RegValue); +} + +/*****************************************************************************/ +/** +* +* This function loads character set data (font) into an OSD Graphics +* Controller bank. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param GcIndex indicates which Graphics Controller to work on. Valid +* value range is from 0 to (The Number of Layers) - 1. The +* layer's type must be set to XOSD_LAYER_TYPE_GPU +* (defined in xosd_hw.h) for this function to work properly. +* @param BankIndex indicates which GC bank to be worked on. Valid +* value range is from 0 to XOSD_GC_BANK_NUM - 1. +* @param CharSetData points to the character set data to be loaded. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_LoadCharacterSetBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, + u32 CharSetData[]) +{ + u32 RegValue; + u32 FontWriteNum; + u32 Index; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == + (XOSD_LAYER_TYPE_GPU)); + Xil_AssertVoid(BankIndex < (XOSD_GC_BANK_NUM)); + Xil_AssertVoid(CharSetData != NULL); + + /* Choose which bank to be loaded */ + RegValue = (((u32)BankIndex) + (XOSD_GCWBA_CHR0)) & + (XOSD_GCWBA_BANK_MASK); + RegValue |= (((u32)GcIndex) << (XOSD_GCWBA_GCNUM_SHIFT)) & + (XOSD_GCWBA_GCNUM_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCWBA_OFFSET), + RegValue); + + /* Calculate the number of write to load the whole font data set */ + FontWriteNum = ((u32)(InstancePtr->Layers[GcIndex].FontWidth) * + (u32)(InstancePtr->Layers[GcIndex].FontHeight) * + (u32)(InstancePtr->Layers[GcIndex].FontBitsPerPixel)); + FontWriteNum /= (u32)(XOSD_FONT_BIT_TO_BYTE); + FontWriteNum *= (u32)(InstancePtr->Layers[GcIndex].FontNumChars); FontWriteNum /= (u32)sizeof(u32); /* Load the font data */ @@ -868,7 +868,7 @@ void XOsd_LoadCharacterSetBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCD_OFFSET), CharSetData[Index]); } - + /* Set the bank to be active so the font is used by the core */ RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET)); @@ -876,50 +876,50 @@ void XOsd_LoadCharacterSetBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, RegValue |= ((u32)BankIndex) << ((XOSD_GCABA_CHR_SHIFT) + ((u32)GcIndex)); XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET), - RegValue); -} - -/*****************************************************************************/ -/** -* -* This function loads text data into an OSD Graphics Controller bank. -* -* @param InstancePtr is a pointer to the XOsd instance to be -* worked on. -* @param GcIndex indicates which Graphics Controller to work on. -* Valid value range is from 0 to (The Number of Layers) - 1. -* The layer's type must be set to XOSD_LAYER_TYPE_GPU -* (defined in xosd_hw.h) for this function to work properly. -* @param BankIndex indicates which GC bank to be worked on. Valid value -* range is from 0 to XOSD_GC_BANK_NUM - 1. -* @param TextData points to the text data to be loaded. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_LoadTextBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 TextData[]) -{ - u32 Index; - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == - (XOSD_LAYER_TYPE_GPU)); - Xil_AssertVoid(BankIndex < (XOSD_GC_BANK_NUM)); - Xil_AssertVoid(TextData != NULL); - - /* Choose which bank to be loaded */ - RegValue = (((u32)BankIndex) + (XOSD_GCWBA_TXT0)) & - (XOSD_GCWBA_BANK_MASK); - RegValue |= (((u32)GcIndex) << (XOSD_GCWBA_GCNUM_SHIFT)) & - (XOSD_GCWBA_GCNUM_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCWBA_OFFSET), + RegValue); +} + +/*****************************************************************************/ +/** +* +* This function loads text data into an OSD Graphics Controller bank. +* +* @param InstancePtr is a pointer to the XOsd instance to be +* worked on. +* @param GcIndex indicates which Graphics Controller to work on. +* Valid value range is from 0 to (The Number of Layers) - 1. +* The layer's type must be set to XOSD_LAYER_TYPE_GPU +* (defined in xosd_hw.h) for this function to work properly. +* @param BankIndex indicates which GC bank to be worked on. Valid value +* range is from 0 to XOSD_GC_BANK_NUM - 1. +* @param TextData points to the text data to be loaded. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_LoadTextBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, + u32 TextData[]) +{ + u32 Index; + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == + (XOSD_LAYER_TYPE_GPU)); + Xil_AssertVoid(BankIndex < (XOSD_GC_BANK_NUM)); + Xil_AssertVoid(TextData != NULL); + + /* Choose which bank to be loaded */ + RegValue = (((u32)BankIndex) + (XOSD_GCWBA_TXT0)) & + (XOSD_GCWBA_BANK_MASK); + RegValue |= (((u32)GcIndex) << (XOSD_GCWBA_GCNUM_SHIFT)) & + (XOSD_GCWBA_GCNUM_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCWBA_OFFSET), RegValue); /* Load text data */ @@ -927,12 +927,12 @@ void XOsd_LoadTextBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, Index < (u32)((((u32)(InstancePtr-> Layers[GcIndex].TextNumStrings) * (u32)(InstancePtr->Layers[GcIndex].TextMaxStringLength)) / - sizeof(u32))); - Index++) { - XOsd_WriteReg(InstancePtr->Config.BaseAddress, - (XOSD_GCD_OFFSET), TextData[Index]); - } - + sizeof(u32))); + Index++) { + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + (XOSD_GCD_OFFSET), TextData[Index]); + } + /* Set the active text bank */ RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET)); @@ -940,50 +940,50 @@ void XOsd_LoadTextBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, RegValue |= ((u32)BankIndex) << ((XOSD_GCABA_TXT_SHIFT) + ((u32)GcIndex)); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET), - RegValue); -} - -/*****************************************************************************/ -/** -* -* This function chooses active banks for a GC in the OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param GcIndex indicates which Graphics Controller to work on. -* Valid value range is from 0 to (The Number of Layers) - 1. -* The layer's type must be set to XOSD_LAYER_TYPE_GPU -* (defined in xosd_hw.h) for this function to work properly. -* @param ColorBankIndex indicates the color LUT bank to be choose as -* active. -* @param CharBankIndex indicates the character set bank to be chosen as -* active. -* @param TextBankIndex indicates the text data bank to be chosen as -* active. -* @param InstructionBankIndex indicates the instruction bank to be -* chosen as active. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_SetActiveBank(XOsd *InstancePtr, u8 GcIndex, u8 ColorBankIndex, - u8 CharBankIndex, u8 TextBankIndex, u8 InstructionBankIndex) -{ - u32 RegValue; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == - (XOSD_LAYER_TYPE_GPU)); - Xil_AssertVoid(ColorBankIndex < (XOSD_GC_BANK_NUM)); - Xil_AssertVoid(CharBankIndex < (XOSD_GC_BANK_NUM)); - Xil_AssertVoid(TextBankIndex < (XOSD_GC_BANK_NUM)); - Xil_AssertVoid(InstructionBankIndex < (XOSD_GC_BANK_NUM)); - + XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET), + RegValue); +} + +/*****************************************************************************/ +/** +* +* This function chooses active banks for a GC in the OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param GcIndex indicates which Graphics Controller to work on. +* Valid value range is from 0 to (The Number of Layers) - 1. +* The layer's type must be set to XOSD_LAYER_TYPE_GPU +* (defined in xosd_hw.h) for this function to work properly. +* @param ColorBankIndex indicates the color LUT bank to be choose as +* active. +* @param CharBankIndex indicates the character set bank to be chosen as +* active. +* @param TextBankIndex indicates the text data bank to be chosen as +* active. +* @param InstructionBankIndex indicates the instruction bank to be +* chosen as active. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_SetActiveBank(XOsd *InstancePtr, u8 GcIndex, u8 ColorBankIndex, + u8 CharBankIndex, u8 TextBankIndex, u8 InstructionBankIndex) +{ + u32 RegValue; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == + (XOSD_LAYER_TYPE_GPU)); + Xil_AssertVoid(ColorBankIndex < (XOSD_GC_BANK_NUM)); + Xil_AssertVoid(CharBankIndex < (XOSD_GC_BANK_NUM)); + Xil_AssertVoid(TextBankIndex < (XOSD_GC_BANK_NUM)); + Xil_AssertVoid(InstructionBankIndex < (XOSD_GC_BANK_NUM)); + /* Clear the current active bank setting first */ RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET)); @@ -996,150 +996,150 @@ void XOsd_SetActiveBank(XOsd *InstancePtr, u8 GcIndex, u8 ColorBankIndex, (XOSD_GCABA_CHR_MASK); /* Choose the active banks */ - RegValue |= (((u32)InstructionBankIndex) << ((u32)GcIndex)) & - (XOSD_GCABA_INS_MASK); - RegValue |= (((u32)ColorBankIndex) << ((XOSD_GCABA_COL_SHIFT) + - (GcIndex))) & (XOSD_GCABA_COL_MASK); - RegValue |= (((u32)TextBankIndex) << ((XOSD_GCABA_TXT_SHIFT) + - (GcIndex))) & (XOSD_GCABA_TXT_MASK); - RegValue |= (((u32)CharBankIndex) << ((XOSD_GCABA_CHR_SHIFT) + - (GcIndex))) & (XOSD_GCABA_CHR_MASK); - XOsd_WriteReg(InstancePtr->Config.BaseAddress, XOSD_GCABA_OFFSET, - RegValue); -} - -/*****************************************************************************/ -/** -* -* This function creates an instruction for the OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param InstructionPtr is a pointer to the instruction buffer to be -* populated with the instruction to be created. The upper level -* application is responsible for allocating this instruction -* buffer. -* @param GcIndex indicates the Graphics Controller that will consume the -* instruction. Valid value range is from 0 to -* (The Number of Layers) - 1. The layer's type must be set to -* XOSD_LAYER_TYPE_GPU (defined in xosd_hw.h) for this function to -* work properly. -* @param ObjType indicates the type of object to draw. Use one of -* XOSD_INS_OPCODE_* constants defined in xosd_hw.h. -* @param ObjSize indicates line width of boxes and lines and the text -* scale factor for text boxes. -* @param XStart indicates the horizontal start pixel of the Object. -* @param YStart indicates the vertical start line of the Object. -* @param XEnd indicates the horizontal end pixel of the Object. -* @param YEnd indicates the vertical end line of the Object. -* @param TextIndex indicates the string index. -* @param ColorIndex indicates the color index. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_CreateInstruction(XOsd *InstancePtr, u32 InstructionPtr[], - u8 GcIndex, u16 ObjType, u8 ObjSize, u16 XStart, u16 YStart, - u16 XEnd, u16 YEnd, u8 TextIndex, u8 ColorIndex) -{ - u32 Value; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid(InstructionPtr != NULL); - Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == - (XOSD_LAYER_TYPE_GPU)); - Xil_AssertVoid((ObjType == (XOSD_INS_OPCODE_END)) || - (ObjType == (XOSD_INS_OPCODE_NOP)) || - (ObjType == (XOSD_INS_OPCODE_BOXTXT)) || - (ObjType == (XOSD_INS_OPCODE_LINE)) || - (ObjType == (XOSD_INS_OPCODE_TXT)) || - (ObjType == (XOSD_INS_OPCODE_BOX))); - Xil_AssertVoid((u32)XEnd < InstancePtr->ScreenWidth); - Xil_AssertVoid((u32)YEnd < InstancePtr->ScreenHeight); - Xil_AssertVoid(TextIndex < - InstancePtr->Layers[GcIndex].TextNumStrings); - Xil_AssertVoid(ColorIndex < InstancePtr->Layers[GcIndex].ColorLutSize); - - /* Clear the whole instruction first */ - (void)memset((void *)InstructionPtr, 0, (XOSD_INS_SIZE) * - (sizeof(u32))); - - /* Populate instruction word 0 fields */ - Value = ((u32)XStart) & (XOSD_INS0_XSTART_MASK); - Value |= (((u32)XEnd) << (XOSD_INS0_XEND_SHIFT)) & - (XOSD_INS0_XEND_MASK); - Value |= (((u32)GcIndex) << (XOSD_INS0_GCNUM_SHIFT)) & - (XOSD_INS0_GCNUM_MASK); - Value |= (((u32)ObjType) << (XOSD_INS0_OPCODE_SHIFT)) & - (XOSD_INS0_OPCODE_MASK); - InstructionPtr[XOSD_INS0] = Value; - - /* Populate instruction word 1 fields */ - Value = ((u32)TextIndex) & (XOSD_INS1_TXTINDEX_MASK); - InstructionPtr[XOSD_INS1] = Value; - - /* Populate instruction word 2 fields */ - Value = ((u32)YStart) & (XOSD_INS2_YSTART_MASK); - Value |= (((u32)YEnd) << (XOSD_INS2_YEND_SHIFT)) & - (XOSD_INS2_YEND_MASK); - Value |= (((u32)ObjSize) << (XOSD_INS2_OBJSIZE_SHIFT)) & - (XOSD_INS2_OBJSIZE_MASK); - InstructionPtr[XOSD_INS2] = Value; - - /* Populate instruction word 3 fields */ - Value = ((u32)ColorIndex) & (XOSD_INS3_COL_MASK); - InstructionPtr[XOSD_INS3] = Value; -} - -/*****************************************************************************/ -/** -* -* This function load an instruction list to be used by an Graphic Controller -* in the OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param GcIndex indicates which Graphics Controller to work on. Valid -* value range is from 0 to (The Number of Layers) - 1. The -* layer's type must be set to XOSD_LAYER_TYPE_GPU -* (defined in xosd_hw.h) for this function to work properly. -* @param BankIndex indicates which GC Bank to be worked on. Valid -* value range is from 0 to XOSD_GC_BANK_NUM. -* @param InstSetPtr is a pointer to the start of the instruction list -* to load into the OSD core. The last instruction in the list -* must has XOSD_INS_OPCODE_END type. -* @param InstNum indicates the number of the instructions in the list to -* load. Valid value range is from 1 to the half of the size of -* the instruction memory created for the Graphic Controller. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_LoadInstructionList(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 InstSetPtr[], u32 InstNum) -{ - u32 RegValue; - u32 Index; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == - (XOSD_LAYER_TYPE_GPU)); - Xil_AssertVoid(BankIndex < (XOSD_GC_BANK_NUM)); - Xil_AssertVoid(InstSetPtr != NULL); - Xil_AssertVoid(InstNum <= InstancePtr->Layers[GcIndex].InstructionNum); - - /* Choose which bank to be loaded */ - RegValue = (((u32)BankIndex) + (XOSD_GCWBA_INS0)) & - (XOSD_GCWBA_BANK_MASK); - RegValue |= (((u32)GcIndex) << (XOSD_GCWBA_GCNUM_SHIFT)) & + RegValue |= (((u32)InstructionBankIndex) << ((u32)GcIndex)) & + (XOSD_GCABA_INS_MASK); + RegValue |= (((u32)ColorBankIndex) << ((XOSD_GCABA_COL_SHIFT) + + (GcIndex))) & (XOSD_GCABA_COL_MASK); + RegValue |= (((u32)TextBankIndex) << ((XOSD_GCABA_TXT_SHIFT) + + (GcIndex))) & (XOSD_GCABA_TXT_MASK); + RegValue |= (((u32)CharBankIndex) << ((XOSD_GCABA_CHR_SHIFT) + + (GcIndex))) & (XOSD_GCABA_CHR_MASK); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, XOSD_GCABA_OFFSET, + RegValue); +} + +/*****************************************************************************/ +/** +* +* This function creates an instruction for the OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param InstructionPtr is a pointer to the instruction buffer to be +* populated with the instruction to be created. The upper level +* application is responsible for allocating this instruction +* buffer. +* @param GcIndex indicates the Graphics Controller that will consume the +* instruction. Valid value range is from 0 to +* (The Number of Layers) - 1. The layer's type must be set to +* XOSD_LAYER_TYPE_GPU (defined in xosd_hw.h) for this function to +* work properly. +* @param ObjType indicates the type of object to draw. Use one of +* XOSD_INS_OPCODE_* constants defined in xosd_hw.h. +* @param ObjSize indicates line width of boxes and lines and the text +* scale factor for text boxes. +* @param XStart indicates the horizontal start pixel of the Object. +* @param YStart indicates the vertical start line of the Object. +* @param XEnd indicates the horizontal end pixel of the Object. +* @param YEnd indicates the vertical end line of the Object. +* @param TextIndex indicates the string index. +* @param ColorIndex indicates the color index. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_CreateInstruction(XOsd *InstancePtr, u32 InstructionPtr[], + u8 GcIndex, u16 ObjType, u8 ObjSize, u16 XStart, u16 YStart, + u16 XEnd, u16 YEnd, u8 TextIndex, u8 ColorIndex) +{ + u32 Value; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid(InstructionPtr != NULL); + Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == + (XOSD_LAYER_TYPE_GPU)); + Xil_AssertVoid((ObjType == (XOSD_INS_OPCODE_END)) || + (ObjType == (XOSD_INS_OPCODE_NOP)) || + (ObjType == (XOSD_INS_OPCODE_BOXTXT)) || + (ObjType == (XOSD_INS_OPCODE_LINE)) || + (ObjType == (XOSD_INS_OPCODE_TXT)) || + (ObjType == (XOSD_INS_OPCODE_BOX))); + Xil_AssertVoid((u32)XEnd < InstancePtr->ScreenWidth); + Xil_AssertVoid((u32)YEnd < InstancePtr->ScreenHeight); + Xil_AssertVoid(TextIndex < + InstancePtr->Layers[GcIndex].TextNumStrings); + Xil_AssertVoid(ColorIndex < InstancePtr->Layers[GcIndex].ColorLutSize); + + /* Clear the whole instruction first */ + (void)memset((void *)InstructionPtr, 0, (XOSD_INS_SIZE) * + (sizeof(u32))); + + /* Populate instruction word 0 fields */ + Value = ((u32)XStart) & (XOSD_INS0_XSTART_MASK); + Value |= (((u32)XEnd) << (XOSD_INS0_XEND_SHIFT)) & + (XOSD_INS0_XEND_MASK); + Value |= (((u32)GcIndex) << (XOSD_INS0_GCNUM_SHIFT)) & + (XOSD_INS0_GCNUM_MASK); + Value |= (((u32)ObjType) << (XOSD_INS0_OPCODE_SHIFT)) & + (XOSD_INS0_OPCODE_MASK); + InstructionPtr[XOSD_INS0] = Value; + + /* Populate instruction word 1 fields */ + Value = ((u32)TextIndex) & (XOSD_INS1_TXTINDEX_MASK); + InstructionPtr[XOSD_INS1] = Value; + + /* Populate instruction word 2 fields */ + Value = ((u32)YStart) & (XOSD_INS2_YSTART_MASK); + Value |= (((u32)YEnd) << (XOSD_INS2_YEND_SHIFT)) & + (XOSD_INS2_YEND_MASK); + Value |= (((u32)ObjSize) << (XOSD_INS2_OBJSIZE_SHIFT)) & + (XOSD_INS2_OBJSIZE_MASK); + InstructionPtr[XOSD_INS2] = Value; + + /* Populate instruction word 3 fields */ + Value = ((u32)ColorIndex) & (XOSD_INS3_COL_MASK); + InstructionPtr[XOSD_INS3] = Value; +} + +/*****************************************************************************/ +/** +* +* This function load an instruction list to be used by an Graphic Controller +* in the OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param GcIndex indicates which Graphics Controller to work on. Valid +* value range is from 0 to (The Number of Layers) - 1. The +* layer's type must be set to XOSD_LAYER_TYPE_GPU +* (defined in xosd_hw.h) for this function to work properly. +* @param BankIndex indicates which GC Bank to be worked on. Valid +* value range is from 0 to XOSD_GC_BANK_NUM. +* @param InstSetPtr is a pointer to the start of the instruction list +* to load into the OSD core. The last instruction in the list +* must has XOSD_INS_OPCODE_END type. +* @param InstNum indicates the number of the instructions in the list to +* load. Valid value range is from 1 to the half of the size of +* the instruction memory created for the Graphic Controller. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_LoadInstructionList(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, + u32 InstSetPtr[], u32 InstNum) +{ + u32 RegValue; + u32 Index; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid((u16)GcIndex < InstancePtr->Config.LayerNum); + Xil_AssertVoid(InstancePtr->Layers[GcIndex].LayerType == + (XOSD_LAYER_TYPE_GPU)); + Xil_AssertVoid(BankIndex < (XOSD_GC_BANK_NUM)); + Xil_AssertVoid(InstSetPtr != NULL); + Xil_AssertVoid(InstNum <= InstancePtr->Layers[GcIndex].InstructionNum); + + /* Choose which bank to be loaded */ + RegValue = (((u32)BankIndex) + (XOSD_GCWBA_INS0)) & + (XOSD_GCWBA_BANK_MASK); + RegValue |= (((u32)GcIndex) << (XOSD_GCWBA_GCNUM_SHIFT)) & (XOSD_GCWBA_GCNUM_MASK); XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCWBA_OFFSET), RegValue); @@ -1147,8 +1147,8 @@ void XOsd_LoadInstructionList(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCD_OFFSET), InstSetPtr[Index]); } - - /* Notify OSD this is the end of the instruction list by adding an END + + /* Notify OSD this is the end of the instruction list by adding an END * instruction */ if (InstNum < InstancePtr->Layers[GcIndex].InstructionNum) { @@ -1165,34 +1165,34 @@ void XOsd_LoadInstructionList(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, RegValue |= ((u32)BankIndex << (u32)GcIndex); XOsd_WriteReg(InstancePtr->Config.BaseAddress, (XOSD_GCABA_OFFSET), RegValue); -} - -/*****************************************************************************/ -/* -* -* This function populates the layer array in the XOsd instance with -* the properties of all layers. This is to help fetch the information faster -* later. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param CfgPtr is a to the configuration structure associated with -* the OSD core. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -static void PopulateLayerProperty(XOsd *InstancePtr, XOsd_Config *CfgPtr) -{ - XOsd *IpTemp = NULL; - XOsd_Config *Cfg = NULL; - - /* Verify arguments. */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(CfgPtr != NULL); - - /* Use short variable names to keep the lines in this function +} + +/*****************************************************************************/ +/* +* +* This function populates the layer array in the XOsd instance with +* the properties of all layers. This is to help fetch the information faster +* later. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param CfgPtr is a to the configuration structure associated with +* the OSD core. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +static void PopulateLayerProperty(XOsd *InstancePtr, XOsd_Config *CfgPtr) +{ + XOsd *IpTemp = NULL; + XOsd_Config *Cfg = NULL; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(CfgPtr != NULL); + + /* Use short variable names to keep the lines in this function * shorter */ IpTemp = InstancePtr; @@ -1200,216 +1200,216 @@ static void PopulateLayerProperty(XOsd *InstancePtr, XOsd_Config *CfgPtr) /* Layer #0 */ IpTemp->Layers[0].LayerType = Cfg->Layer0Type; - IpTemp->Layers[0].InstructionNum = Cfg->Layer0InstructionMemSize; - IpTemp->Layers[0].InstructionBoxEnable = Cfg->Layer0InstructionBoxEnable; - IpTemp->Layers[0].InstructionLineEnable = Cfg->Layer0InstructionLineEnable; - IpTemp->Layers[0].InstructionTextEnable = Cfg->Layer0InstructionTextEnable; - IpTemp->Layers[0].ColorLutSize = Cfg->Layer0ColorLutSize; - IpTemp->Layers[0].ColorLutMemoryType = Cfg->Layer0ColorLutMemoryType; - IpTemp->Layers[0].FontNumChars = Cfg->Layer0FontNumChars; - IpTemp->Layers[0].FontWidth = Cfg->Layer0FontWidth; - IpTemp->Layers[0].FontHeight = Cfg->Layer0FontHeight; - IpTemp->Layers[0].FontBitsPerPixel = Cfg->Layer0FontBitsPerPixel; - IpTemp->Layers[0].FontAsciiOffset = Cfg->Layer0FontAsciiOffset; - IpTemp->Layers[0].TextNumStrings = Cfg->Layer0TextNumStrings; - IpTemp->Layers[0].TextMaxStringLength = Cfg->Layer0TextMaxStringLength; - - /* Layer #1 */ - IpTemp->Layers[1].LayerType = Cfg->Layer1Type; - IpTemp->Layers[1].InstructionNum = Cfg->Layer1InstructionMemSize; - IpTemp->Layers[1].InstructionBoxEnable = Cfg->Layer1InstructionBoxEnable; - IpTemp->Layers[1].InstructionLineEnable = Cfg->Layer1InstructionLineEnable; - IpTemp->Layers[1].InstructionTextEnable = Cfg->Layer1InstructionTextEnable; - IpTemp->Layers[1].ColorLutSize = Cfg->Layer1ColorLutSize; - IpTemp->Layers[1].ColorLutMemoryType = Cfg->Layer1ColorLutMemoryType; - IpTemp->Layers[1].FontNumChars = Cfg->Layer1FontNumChars; - IpTemp->Layers[1].FontWidth = Cfg->Layer1FontWidth; - IpTemp->Layers[1].FontHeight = Cfg->Layer1FontHeight; - IpTemp->Layers[1].FontBitsPerPixel = Cfg->Layer1FontBitsPerPixel; - IpTemp->Layers[1].FontAsciiOffset = Cfg->Layer1FontAsciiOffset; - IpTemp->Layers[1].TextNumStrings = Cfg->Layer1TextNumStrings; - IpTemp->Layers[1].TextMaxStringLength = Cfg->Layer1TextMaxStringLength; - - /* Layer #2 */ - IpTemp->Layers[2].LayerType = Cfg->Layer2Type; - IpTemp->Layers[2].InstructionNum = Cfg->Layer2InstructionMemSize; - IpTemp->Layers[2].InstructionBoxEnable = Cfg->Layer2InstructionBoxEnable; - IpTemp->Layers[2].InstructionLineEnable = Cfg->Layer2InstructionLineEnable; - IpTemp->Layers[2].InstructionTextEnable = Cfg->Layer2InstructionTextEnable; - IpTemp->Layers[2].ColorLutSize = Cfg->Layer2ColorLutSize; - IpTemp->Layers[2].ColorLutMemoryType = Cfg->Layer2ColorLutMemoryType; - IpTemp->Layers[2].FontNumChars = Cfg->Layer2FontNumChars; - IpTemp->Layers[2].FontWidth = Cfg->Layer2FontWidth; - IpTemp->Layers[2].FontHeight = Cfg->Layer2FontHeight; - IpTemp->Layers[2].FontBitsPerPixel = Cfg->Layer2FontBitsPerPixel; - IpTemp->Layers[2].FontAsciiOffset = Cfg->Layer2FontAsciiOffset; - IpTemp->Layers[2].TextNumStrings = Cfg->Layer2TextNumStrings; - IpTemp->Layers[2].TextMaxStringLength = Cfg->Layer2TextMaxStringLength; - - /* Layer #3 */ - IpTemp->Layers[3].LayerType = Cfg->Layer3Type; - IpTemp->Layers[3].InstructionNum = Cfg->Layer3InstructionMemSize; - IpTemp->Layers[3].InstructionBoxEnable = Cfg->Layer3InstructionBoxEnable; - IpTemp->Layers[3].InstructionLineEnable = Cfg->Layer3InstructionLineEnable; - IpTemp->Layers[3].InstructionTextEnable = Cfg->Layer3InstructionTextEnable; - IpTemp->Layers[3].ColorLutSize = Cfg->Layer3ColorLutSize; - IpTemp->Layers[3].ColorLutMemoryType = Cfg->Layer3ColorLutMemoryType; - IpTemp->Layers[3].FontNumChars = Cfg->Layer3FontNumChars; - IpTemp->Layers[3].FontWidth = Cfg->Layer3FontWidth; - IpTemp->Layers[3].FontHeight = Cfg->Layer3FontHeight; - IpTemp->Layers[3].FontBitsPerPixel = Cfg->Layer3FontBitsPerPixel; - IpTemp->Layers[3].FontAsciiOffset = Cfg->Layer3FontAsciiOffset; - IpTemp->Layers[3].TextNumStrings = Cfg->Layer3TextNumStrings; - IpTemp->Layers[3].TextMaxStringLength = Cfg->Layer3TextMaxStringLength; - - /* Layer #4 */ - IpTemp->Layers[4].LayerType = Cfg->Layer4Type; - IpTemp->Layers[4].InstructionNum = Cfg->Layer4InstructionMemSize; - IpTemp->Layers[4].InstructionBoxEnable = Cfg->Layer4InstructionBoxEnable; - IpTemp->Layers[4].InstructionLineEnable = Cfg->Layer4InstructionLineEnable; - IpTemp->Layers[4].InstructionTextEnable = Cfg->Layer4InstructionTextEnable; - IpTemp->Layers[4].ColorLutSize = Cfg->Layer4ColorLutSize; - IpTemp->Layers[4].ColorLutMemoryType = Cfg->Layer4ColorLutMemoryType; - IpTemp->Layers[4].FontNumChars = Cfg->Layer4FontNumChars; - IpTemp->Layers[4].FontWidth = Cfg->Layer4FontWidth; - IpTemp->Layers[4].FontHeight = Cfg->Layer4FontHeight; - IpTemp->Layers[4].FontBitsPerPixel = Cfg->Layer4FontBitsPerPixel; - IpTemp->Layers[4].FontAsciiOffset = Cfg->Layer4FontAsciiOffset; - IpTemp->Layers[4].TextNumStrings = Cfg->Layer4TextNumStrings; - IpTemp->Layers[4].TextMaxStringLength = Cfg->Layer4TextMaxStringLength; - - /* Layer #5 */ - IpTemp->Layers[5].LayerType = Cfg->Layer5Type; - IpTemp->Layers[5].InstructionNum = Cfg->Layer5InstructionMemSize; - IpTemp->Layers[5].InstructionBoxEnable = Cfg->Layer5InstructionBoxEnable; - IpTemp->Layers[5].InstructionLineEnable = Cfg->Layer5InstructionLineEnable; - IpTemp->Layers[5].InstructionTextEnable = Cfg->Layer5InstructionTextEnable; - IpTemp->Layers[5].ColorLutSize = Cfg->Layer5ColorLutSize; - IpTemp->Layers[5].ColorLutMemoryType = Cfg->Layer5ColorLutMemoryType; - IpTemp->Layers[5].FontNumChars = Cfg->Layer5FontNumChars; - IpTemp->Layers[5].FontWidth = Cfg->Layer5FontWidth; - IpTemp->Layers[5].FontHeight = Cfg->Layer5FontHeight; - IpTemp->Layers[5].FontBitsPerPixel = Cfg->Layer5FontBitsPerPixel; - IpTemp->Layers[5].FontAsciiOffset = Cfg->Layer5FontAsciiOffset; - IpTemp->Layers[5].TextNumStrings = Cfg->Layer5TextNumStrings; - IpTemp->Layers[5].TextMaxStringLength = Cfg->Layer5TextMaxStringLength; - - /* Layer #6 */ - IpTemp->Layers[6].LayerType = Cfg->Layer6Type; - IpTemp->Layers[6].InstructionNum = Cfg->Layer6InstructionMemSize; - IpTemp->Layers[6].InstructionBoxEnable = Cfg->Layer6InstructionBoxEnable; - IpTemp->Layers[6].InstructionLineEnable = Cfg->Layer6InstructionLineEnable; - IpTemp->Layers[6].InstructionTextEnable = Cfg->Layer6InstructionTextEnable; - IpTemp->Layers[6].ColorLutSize = Cfg->Layer6ColorLutSize; - IpTemp->Layers[6].ColorLutMemoryType = Cfg->Layer6ColorLutMemoryType; - IpTemp->Layers[6].FontNumChars = Cfg->Layer6FontNumChars; - IpTemp->Layers[6].FontWidth = Cfg->Layer6FontWidth; - IpTemp->Layers[6].FontHeight = Cfg->Layer6FontHeight; - IpTemp->Layers[6].FontBitsPerPixel = Cfg->Layer6FontBitsPerPixel; - IpTemp->Layers[6].FontAsciiOffset = Cfg->Layer6FontAsciiOffset; - IpTemp->Layers[6].TextNumStrings = Cfg->Layer6TextNumStrings; - IpTemp->Layers[6].TextMaxStringLength = Cfg->Layer6TextMaxStringLength; - - /* Layer #7 */ - IpTemp->Layers[7].LayerType = Cfg->Layer7Type; - IpTemp->Layers[7].InstructionNum = Cfg->Layer7InstructionMemSize; - IpTemp->Layers[7].InstructionBoxEnable = Cfg->Layer7InstructionBoxEnable; - IpTemp->Layers[7].InstructionLineEnable = Cfg->Layer7InstructionLineEnable; - IpTemp->Layers[7].InstructionTextEnable = Cfg->Layer7InstructionTextEnable; - IpTemp->Layers[7].ColorLutSize = Cfg->Layer7ColorLutSize; - IpTemp->Layers[7].ColorLutMemoryType = Cfg->Layer7ColorLutMemoryType; - IpTemp->Layers[7].FontNumChars = Cfg->Layer7FontNumChars; - IpTemp->Layers[7].FontWidth = Cfg->Layer7FontWidth; - IpTemp->Layers[7].FontHeight = Cfg->Layer7FontHeight; - IpTemp->Layers[7].FontBitsPerPixel = Cfg->Layer7FontBitsPerPixel; - IpTemp->Layers[7].FontAsciiOffset = Cfg->Layer7FontAsciiOffset; - IpTemp->Layers[7].TextNumStrings = Cfg->Layer7TextNumStrings; - IpTemp->Layers[7].TextMaxStringLength = Cfg->Layer7TextMaxStringLength; - - /* Convert instruction memory sizes into the maximum numbers of - * instructions supported - */ - IpTemp->Layers[0].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); - IpTemp->Layers[1].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); - IpTemp->Layers[2].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); - IpTemp->Layers[3].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); - IpTemp->Layers[4].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); - IpTemp->Layers[5].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); - IpTemp->Layers[6].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); - IpTemp->Layers[7].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); -} - -/*****************************************************************************/ -/** -* -* This function returns the Version of the OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return Contents of the Version register. -* -* @note None. -* -******************************************************************************/ -u32 XOsd_GetVersion(XOsd *InstancePtr) -{ - u32 Data; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - - /* Read core version */ - Data = XOsd_ReadReg(InstancePtr->Config.BaseAddress, XOSD_VER_OFFSET); - - return Data; -} - -/*****************************************************************************/ -/** -* -* This function is a stub for the asynchronous callbacks. The stub is here in -* case the upper layer forgot to set the handlers. On initialization, All -* handlers except error handler are set to this callback. It is considered an -* error for this handler 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(); -} - -/*****************************************************************************/ -/** -* -* This routine is a stub for the asynchronous error interrupt callback. The -* stub is here in case the upper layer forgot to set the handler. On -* initialization, error interrupt handler is set to this callback. It is -* considered an error for this handler 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. -* @param ErrorMask is a bit mask indicating the cause of the error. Its -* value equals 'OR'ing one or more XOSD_IXR_* values defined -* in xosd_hw.h. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -static void StubErrCallBack(void *CallBackRef, u32 ErrorMask) -{ - (void)CallBackRef; + IpTemp->Layers[0].InstructionNum = Cfg->Layer0InstructionMemSize; + IpTemp->Layers[0].InstructionBoxEnable = Cfg->Layer0InstructionBoxEnable; + IpTemp->Layers[0].InstructionLineEnable = Cfg->Layer0InstructionLineEnable; + IpTemp->Layers[0].InstructionTextEnable = Cfg->Layer0InstructionTextEnable; + IpTemp->Layers[0].ColorLutSize = Cfg->Layer0ColorLutSize; + IpTemp->Layers[0].ColorLutMemoryType = Cfg->Layer0ColorLutMemoryType; + IpTemp->Layers[0].FontNumChars = Cfg->Layer0FontNumChars; + IpTemp->Layers[0].FontWidth = Cfg->Layer0FontWidth; + IpTemp->Layers[0].FontHeight = Cfg->Layer0FontHeight; + IpTemp->Layers[0].FontBitsPerPixel = Cfg->Layer0FontBitsPerPixel; + IpTemp->Layers[0].FontAsciiOffset = Cfg->Layer0FontAsciiOffset; + IpTemp->Layers[0].TextNumStrings = Cfg->Layer0TextNumStrings; + IpTemp->Layers[0].TextMaxStringLength = Cfg->Layer0TextMaxStringLength; + + /* Layer #1 */ + IpTemp->Layers[1].LayerType = Cfg->Layer1Type; + IpTemp->Layers[1].InstructionNum = Cfg->Layer1InstructionMemSize; + IpTemp->Layers[1].InstructionBoxEnable = Cfg->Layer1InstructionBoxEnable; + IpTemp->Layers[1].InstructionLineEnable = Cfg->Layer1InstructionLineEnable; + IpTemp->Layers[1].InstructionTextEnable = Cfg->Layer1InstructionTextEnable; + IpTemp->Layers[1].ColorLutSize = Cfg->Layer1ColorLutSize; + IpTemp->Layers[1].ColorLutMemoryType = Cfg->Layer1ColorLutMemoryType; + IpTemp->Layers[1].FontNumChars = Cfg->Layer1FontNumChars; + IpTemp->Layers[1].FontWidth = Cfg->Layer1FontWidth; + IpTemp->Layers[1].FontHeight = Cfg->Layer1FontHeight; + IpTemp->Layers[1].FontBitsPerPixel = Cfg->Layer1FontBitsPerPixel; + IpTemp->Layers[1].FontAsciiOffset = Cfg->Layer1FontAsciiOffset; + IpTemp->Layers[1].TextNumStrings = Cfg->Layer1TextNumStrings; + IpTemp->Layers[1].TextMaxStringLength = Cfg->Layer1TextMaxStringLength; + + /* Layer #2 */ + IpTemp->Layers[2].LayerType = Cfg->Layer2Type; + IpTemp->Layers[2].InstructionNum = Cfg->Layer2InstructionMemSize; + IpTemp->Layers[2].InstructionBoxEnable = Cfg->Layer2InstructionBoxEnable; + IpTemp->Layers[2].InstructionLineEnable = Cfg->Layer2InstructionLineEnable; + IpTemp->Layers[2].InstructionTextEnable = Cfg->Layer2InstructionTextEnable; + IpTemp->Layers[2].ColorLutSize = Cfg->Layer2ColorLutSize; + IpTemp->Layers[2].ColorLutMemoryType = Cfg->Layer2ColorLutMemoryType; + IpTemp->Layers[2].FontNumChars = Cfg->Layer2FontNumChars; + IpTemp->Layers[2].FontWidth = Cfg->Layer2FontWidth; + IpTemp->Layers[2].FontHeight = Cfg->Layer2FontHeight; + IpTemp->Layers[2].FontBitsPerPixel = Cfg->Layer2FontBitsPerPixel; + IpTemp->Layers[2].FontAsciiOffset = Cfg->Layer2FontAsciiOffset; + IpTemp->Layers[2].TextNumStrings = Cfg->Layer2TextNumStrings; + IpTemp->Layers[2].TextMaxStringLength = Cfg->Layer2TextMaxStringLength; + + /* Layer #3 */ + IpTemp->Layers[3].LayerType = Cfg->Layer3Type; + IpTemp->Layers[3].InstructionNum = Cfg->Layer3InstructionMemSize; + IpTemp->Layers[3].InstructionBoxEnable = Cfg->Layer3InstructionBoxEnable; + IpTemp->Layers[3].InstructionLineEnable = Cfg->Layer3InstructionLineEnable; + IpTemp->Layers[3].InstructionTextEnable = Cfg->Layer3InstructionTextEnable; + IpTemp->Layers[3].ColorLutSize = Cfg->Layer3ColorLutSize; + IpTemp->Layers[3].ColorLutMemoryType = Cfg->Layer3ColorLutMemoryType; + IpTemp->Layers[3].FontNumChars = Cfg->Layer3FontNumChars; + IpTemp->Layers[3].FontWidth = Cfg->Layer3FontWidth; + IpTemp->Layers[3].FontHeight = Cfg->Layer3FontHeight; + IpTemp->Layers[3].FontBitsPerPixel = Cfg->Layer3FontBitsPerPixel; + IpTemp->Layers[3].FontAsciiOffset = Cfg->Layer3FontAsciiOffset; + IpTemp->Layers[3].TextNumStrings = Cfg->Layer3TextNumStrings; + IpTemp->Layers[3].TextMaxStringLength = Cfg->Layer3TextMaxStringLength; + + /* Layer #4 */ + IpTemp->Layers[4].LayerType = Cfg->Layer4Type; + IpTemp->Layers[4].InstructionNum = Cfg->Layer4InstructionMemSize; + IpTemp->Layers[4].InstructionBoxEnable = Cfg->Layer4InstructionBoxEnable; + IpTemp->Layers[4].InstructionLineEnable = Cfg->Layer4InstructionLineEnable; + IpTemp->Layers[4].InstructionTextEnable = Cfg->Layer4InstructionTextEnable; + IpTemp->Layers[4].ColorLutSize = Cfg->Layer4ColorLutSize; + IpTemp->Layers[4].ColorLutMemoryType = Cfg->Layer4ColorLutMemoryType; + IpTemp->Layers[4].FontNumChars = Cfg->Layer4FontNumChars; + IpTemp->Layers[4].FontWidth = Cfg->Layer4FontWidth; + IpTemp->Layers[4].FontHeight = Cfg->Layer4FontHeight; + IpTemp->Layers[4].FontBitsPerPixel = Cfg->Layer4FontBitsPerPixel; + IpTemp->Layers[4].FontAsciiOffset = Cfg->Layer4FontAsciiOffset; + IpTemp->Layers[4].TextNumStrings = Cfg->Layer4TextNumStrings; + IpTemp->Layers[4].TextMaxStringLength = Cfg->Layer4TextMaxStringLength; + + /* Layer #5 */ + IpTemp->Layers[5].LayerType = Cfg->Layer5Type; + IpTemp->Layers[5].InstructionNum = Cfg->Layer5InstructionMemSize; + IpTemp->Layers[5].InstructionBoxEnable = Cfg->Layer5InstructionBoxEnable; + IpTemp->Layers[5].InstructionLineEnable = Cfg->Layer5InstructionLineEnable; + IpTemp->Layers[5].InstructionTextEnable = Cfg->Layer5InstructionTextEnable; + IpTemp->Layers[5].ColorLutSize = Cfg->Layer5ColorLutSize; + IpTemp->Layers[5].ColorLutMemoryType = Cfg->Layer5ColorLutMemoryType; + IpTemp->Layers[5].FontNumChars = Cfg->Layer5FontNumChars; + IpTemp->Layers[5].FontWidth = Cfg->Layer5FontWidth; + IpTemp->Layers[5].FontHeight = Cfg->Layer5FontHeight; + IpTemp->Layers[5].FontBitsPerPixel = Cfg->Layer5FontBitsPerPixel; + IpTemp->Layers[5].FontAsciiOffset = Cfg->Layer5FontAsciiOffset; + IpTemp->Layers[5].TextNumStrings = Cfg->Layer5TextNumStrings; + IpTemp->Layers[5].TextMaxStringLength = Cfg->Layer5TextMaxStringLength; + + /* Layer #6 */ + IpTemp->Layers[6].LayerType = Cfg->Layer6Type; + IpTemp->Layers[6].InstructionNum = Cfg->Layer6InstructionMemSize; + IpTemp->Layers[6].InstructionBoxEnable = Cfg->Layer6InstructionBoxEnable; + IpTemp->Layers[6].InstructionLineEnable = Cfg->Layer6InstructionLineEnable; + IpTemp->Layers[6].InstructionTextEnable = Cfg->Layer6InstructionTextEnable; + IpTemp->Layers[6].ColorLutSize = Cfg->Layer6ColorLutSize; + IpTemp->Layers[6].ColorLutMemoryType = Cfg->Layer6ColorLutMemoryType; + IpTemp->Layers[6].FontNumChars = Cfg->Layer6FontNumChars; + IpTemp->Layers[6].FontWidth = Cfg->Layer6FontWidth; + IpTemp->Layers[6].FontHeight = Cfg->Layer6FontHeight; + IpTemp->Layers[6].FontBitsPerPixel = Cfg->Layer6FontBitsPerPixel; + IpTemp->Layers[6].FontAsciiOffset = Cfg->Layer6FontAsciiOffset; + IpTemp->Layers[6].TextNumStrings = Cfg->Layer6TextNumStrings; + IpTemp->Layers[6].TextMaxStringLength = Cfg->Layer6TextMaxStringLength; + + /* Layer #7 */ + IpTemp->Layers[7].LayerType = Cfg->Layer7Type; + IpTemp->Layers[7].InstructionNum = Cfg->Layer7InstructionMemSize; + IpTemp->Layers[7].InstructionBoxEnable = Cfg->Layer7InstructionBoxEnable; + IpTemp->Layers[7].InstructionLineEnable = Cfg->Layer7InstructionLineEnable; + IpTemp->Layers[7].InstructionTextEnable = Cfg->Layer7InstructionTextEnable; + IpTemp->Layers[7].ColorLutSize = Cfg->Layer7ColorLutSize; + IpTemp->Layers[7].ColorLutMemoryType = Cfg->Layer7ColorLutMemoryType; + IpTemp->Layers[7].FontNumChars = Cfg->Layer7FontNumChars; + IpTemp->Layers[7].FontWidth = Cfg->Layer7FontWidth; + IpTemp->Layers[7].FontHeight = Cfg->Layer7FontHeight; + IpTemp->Layers[7].FontBitsPerPixel = Cfg->Layer7FontBitsPerPixel; + IpTemp->Layers[7].FontAsciiOffset = Cfg->Layer7FontAsciiOffset; + IpTemp->Layers[7].TextNumStrings = Cfg->Layer7TextNumStrings; + IpTemp->Layers[7].TextMaxStringLength = Cfg->Layer7TextMaxStringLength; + + /* Convert instruction memory sizes into the maximum numbers of + * instructions supported + */ + IpTemp->Layers[0].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); + IpTemp->Layers[1].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); + IpTemp->Layers[2].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); + IpTemp->Layers[3].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); + IpTemp->Layers[4].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); + IpTemp->Layers[5].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); + IpTemp->Layers[6].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); + IpTemp->Layers[7].InstructionNum /= (XOSD_INS_MEM_SIZE_TO_NUM); +} + +/*****************************************************************************/ +/** +* +* This function returns the Version of the OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return Contents of the Version register. +* +* @note None. +* +******************************************************************************/ +u32 XOsd_GetVersion(XOsd *InstancePtr) +{ + u32 Data; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + /* Read core version */ + Data = XOsd_ReadReg(InstancePtr->Config.BaseAddress, XOSD_VER_OFFSET); + + return Data; +} + +/*****************************************************************************/ +/** +* +* This function is a stub for the asynchronous callbacks. The stub is here in +* case the upper layer forgot to set the handlers. On initialization, All +* handlers except error handler are set to this callback. It is considered an +* error for this handler 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(); +} + +/*****************************************************************************/ +/** +* +* This routine is a stub for the asynchronous error interrupt callback. The +* stub is here in case the upper layer forgot to set the handler. On +* initialization, error interrupt handler is set to this callback. It is +* considered an error for this handler 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. +* @param ErrorMask is a bit mask indicating the cause of the error. Its +* value equals 'OR'ing one or more XOSD_IXR_* values defined +* in xosd_hw.h. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +static void StubErrCallBack(void *CallBackRef, u32 ErrorMask) +{ + (void)CallBackRef; (void)ErrorMask; Xil_AssertVoidAlways(); } diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd.h b/XilinxProcessorIPLib/drivers/osd/src/xosd.h index 3f85bb35..4e9c7580 100644 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd.h +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd.h @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* 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 -* XILINX 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. -* -******************************************************************************/ -/*****************************************************************************/ +/****************************************************************************** +* +* 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 +* XILINX 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 xosd.h @@ -39,235 +39,235 @@ * * This is main header file of the Xilinx On-Screen-Display (OSD) core. * -* An OSD is an image superimposed on a screen picture, commonly used by modern -* televisions, VCRs, and DVD players to display information such as volume, -* channel, and time. -* -* Xilinx OSD core has the following main features: -* -* - Read Video Data from one of three sources as -* - VFBC/Frame Buffer, -* - VideoBus and -* - Graphics Controller. -* - Alpha Compositing and Alpha Blending of up to 8 layers. -* - Up to 8 priorities, one for each of the layers. -* - Real-Time Graphics Controller. -* - Write Composited Video Data to either -* - VFBC/Frame Buffer, or -* - VideoBus. -* -* For a full description of OSD features, please see the hardware spec. -* -* Interrupt Service -* -* Three interrupt types are supported: -* -* - Processing Start Interrupt -* - Frame Done Interrupt -* - Error Interrupt -* -* Software Initialization -* -* Please follow the example provided with this driver for the steps -* to use this driver. -* -* Cache Coherency -* -* Alignment -* -* Limitations -* -* BUS Interface -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date     Changes
-* ----- ------ -------- -------------------------------------------------------
-* 1.00a xd     08/18/08 First release
-* 1.01a xd     07/30/10 Added device version support; Supported Doxygen; Fixed
-*                       CR #534952
-* 1.02a xd     12/21/10 Removed endian conversion for text bank loading
-* 1.03a cm     09/07/11 Updated XOSD_GetLayerAlpha(), XOSD_SetLayerAlpha(),
-*                       XOSD_SetBackgroundColor() and XOSD_GetBackgroundColor()
-*                       to allow 10 and 12 bit alpha and background colors.
-* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating
-*                       basic types, MB cache functions, exceptions and
-*                       assertions to xil_io format.
-* 3.0   adk    19/12/13 Updated as per the New Tcl API's.
-* 4.0   adk    02/18/14 Converted defined macros to enum types.
-*                       Removed interrupt types XOSD_HANDLER_VBISTART and
-*                       XOSD_HANDLER_VBIEND.
-*                       Added interrupt type: XOSD_HANDLER_PROCSTART.
-*                       Renamed the following function macros:
-*                       XOSD_Enable -> XOsd_Enable,
-*                       XOSD_Disable -> XOsd_Disable,
-*                       XOSD_RegUpdateEnable -> XOsd_RegUpdateEnable,
-*                       XOSD_RegUpdateDisable -> XOsd_RegUpdateDisable,
-*                       XOSD_Reset -> XOsd_Reset,
-*                       XOSD_IntrEnable -> XOsd_IntrEnable,
-*                       XOSD_IntrDisable -> XOsd_IntrDisable,
-*                       XOSD_IntrGetPending -> XOsd_IntrGetPending,
-*                       XOSD_IntrClear -> XOsd_IntrClear.
-*
-*                       Added the following function macros:
-*                       XOsd_SyncReset, XOsd_StatusGetPending, XOsd_FSyncReset.
-*
-*                       Removed the following function macros:
-*                       XOSD_IntrEnableGlobal, XOSD_IntrDisableGlobal.
-*
-*                       Renamed S_AXIS_VIDEO_DATA_WIDTH ->
-*                                                      SlaveAxisVideoDataWidth.
-*                       Removed struct members from core structure:
-*                       VbiStartCallBack, VbiStartRef, VbiEndCallBack,
-*                       VbiEndRef.
-*
-*                       Added struct members in core structure:
-*                       ProcStartCallBack, ProcStartRef.
-*
-*                       Added the following function prototypes:
-*                       XOsd_SelfTest.
-*
-*                       Removed the following function prototypes:
-*                       XOSD_SetBlankPolarity.
-*
-*                       Changes in xosd_sinit.c:
-*                       Renamed the following functions:
-*                       XOSD_LookupConfig - > XOsd_LookupConfig
-*
-*                       Changes in xosd_selftest.c:
-*                       Implemented the following functions:
-*                       XOsd_SelfTest.
-*
-*                       Changes in xosd_intr.c:
-*                       Renamed the following functions:
-*                       XOSD_IntrHandler - > XOsd_IntrHandler.
-*                       XOSD_SetCallBack -> XOsd_SetCallBack.
-*                       Removed the following handlers:
-*                       XOSD_HANDLER_VBISTART, XOSD_HANDLER_VBIEND.
-*                       Added new handler XOSD_HANDLER_PROCSTART.
-*                       Added Doxygen support, adherence to Xilinx
-*                       coding guidelines.
-*
-*                       Changes in xosd_hw.h:
-*                       Suffixed "_OFFSET" to all register offset macros.
-*                       Added register offsets, bit masks for the registers and
-*                       added backward compatibility for macros.
-*
-*                       Removed following macros:
-*                       XOSD_GIER_GIE_MASK, XOSD_IXR_GAO_MASK
-*                       XOSD_IXR_GIE_MASK, XOSD_IXR_OOE_MASK,
-*                       XOSD_IXR_IUE_MASK, XOSD_IXR_VBIE_MASK,
-*                       XOSD_IXR_VBIS_MASK, XOSD_IXR_FE_MASK, XOSD_IXR_FD_MASK,
-*                       XOSD_IXR_ALLIERR_MASK.
-*
-*                       Changes from xosd.c:
-*                       Renamed S_AXIS_VIDEO_DATA_WIDTH ->
-*                                                      SlaveAxisVideoDataWidth.
-*                       Removed from XOsd_CfgInitialize:
-*                       VbiStartCallBack, VbiStartRef, VbiEndCallBack,
-*                       VbiEndRef.
-*
-*                       Added in XOsd_CfgInitialize:
-*                       ProcStartCallBack, ProcStartRef.
-*
-*                       Renamed the following function prototypes:
-*                       XOSD_CfgInitialize -> XOsd_CfgInitialize,
-*                       XOSD_SetScreenSize -> XOsd_SetActiveSize,
-*                       XOSD_GetScreenSize -> XOsd_GetActiveSize,
-*                       XOSD_SetBackgroundColor -> XOsd_SetBackgroundColor,
-*                       XOSD_GetBackgroundColor -> XOSD_GetBackgroundColor,
-*                       XOSD_SetLayerDimension -> XOsd_SetLayerDimension,
-*                       XOSD_GetLayerDimension -> XOsd_GetLayerDimension,
-*                       XOSD_SetLayerAlpha -> XOsd_SetLayerAlpha,
-*                       XOSD_GetLayerAlpha -> XOsd_GetLayerAlpha,
-*                       XOSD_SetLayerAlpha -> XOsd_SetLayerAlpha,
-*                       XOSD_GetLayerAlpha -> XOsd_GetLayerAlpha,
-*                       XOSD_SetLayerPriority -> XOsd_SetLayerPriority,
-*                       XOSD_GetLayerPriority -> XOsd_GetLayerPriority,
-*                       XOSD_EnableLayer -> XOsd_EnableLayer,
-*                       XOSD_DisableLayer -> XOsd_DisableLayer,
-*                       XOSD_LoadColorLUTBank - > XOsd_LoadColorLUTBank,
-*                       XOSD_LoadCharacterSetBank -> XOsd_LoadCharacterSetBank,
-*                       XOSD_LoadTextBank - > XOsd_LoadTextBank,
-*                       XOSD_SetActiveBank -> XOsd_SetActiveBank,
-*                       XOSD_CreateInstruction -> XOsd_CreateInstruction,
-*                       XOSD_LoadInstructionList -> XOsd_LoadInstructionList,
-*                       XOSD_LookupConfig -> XOsd_LookupConfig,
-*                       XOSD_IntrHandler -> XOsd_IntrHandler,
-*                       XOSD_SetCallBack -> XOsd_SetCallBack.
-*
-*                       Changed the prototype of XOSD_GetVersion and renamed it as
-*                       XOsd_GetVersion
-*
-*                       Removed the following function implementation:
-*                       XOSD_SetBlankPolarity.
-* 
-* -******************************************************************************/ - -#ifndef XOSD_H_ -#define XOSD_H_ /**< Prevent circular inclusions by - * using protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ - -#include "xosd_hw.h" -#include "xil_assert.h" -#include "xstatus.h" - -/************************** Constant Definitions *****************************/ - -/** @name Interrupt types for setting up callbacks - * @{ - */ -enum { - XOSD_HANDLER_PROCSTART = 1, /**< A processing start event interrupt - * type */ - XOSD_HANDLER_FRAMEDONE, /**< A frame done event interrupt - * type */ - XOSD_HANDLER_ERROR /**< An error condition interrupt - * type */ -}; -/*@}*/ - -/** @name Compatibility Macros - * @{ - */ -#define XOSD_Config XOsd_Config -#define XOSD_Layer XOsd_Layer -#define XOSD_CallBack XOsd_CallBack -#define XOSD_ErrorCallBack XOsd_ErrorCallBack -#define XOSD XOsd -#define XOSD_Instruction XOsd_Instruction -#define XOSD_Enable XOsd_Enable -#define XOSD_Disable XOsd_Disable -#define XOSD_RegUpdateEnable XOsd_RegUpdateEnable -#define XOSD_RegUpdateDisable XOsd_RegUpdateDisable -#define XOSD_Reset XOsd_Reset -#define XOSD_IntrEnable XOsd_IntrEnable -#define XOSD_IntrDisable XOsd_IntrDisable -#define XOSD_IntrGetPending XOsd_IntrGetPending -#define XOSD_IntrClear XOsd_IntrClear -#define XOSD_CfgInitialize XOsd_CfgInitialize -#define XOSD_SetScreenSize XOsd_SetActiveSize -#define XOSD_GetScreenSize XOsd_GetActiveSize -#define XOSD_SetBackgroundColor XOsd_SetBackgroundColor -#define XOSD_GetBackgroundColor XOsd_GetBackgroundColor -#define XOSD_SetLayerDimension XOsd_SetLayerDimension -#define XOSD_GetLayerDimension XOsd_GetLayerDimension -#define XOSD_SetLayerAlpha XOsd_SetLayerAlpha -#define XOSD_GetLayerAlpha XOsd_GetLayerAlpha -#define XOSD_SetLayerPriority XOsd_SetLayerPriority -#define XOSD_GetLayerPriority XOsd_GetLayerPriority -#define XOSD_EnableLayer XOsd_EnableLayer -#define XOSD_DisableLayer XOsd_DisableLayer -#define XOSD_LoadColorLUTBank XOsd_LoadColorLUTBank -#define XOSD_LoadCharacterSetBank XOsd_LoadCharacterSetBank +* An OSD is an image superimposed on a screen picture, commonly used by modern +* televisions, VCRs, and DVD players to display information such as volume, +* channel, and time. +* +* Xilinx OSD core has the following main features: +* +* - Read Video Data from one of three sources as +* - VFBC/Frame Buffer, +* - VideoBus and +* - Graphics Controller. +* - Alpha Compositing and Alpha Blending of up to 8 layers. +* - Up to 8 priorities, one for each of the layers. +* - Real-Time Graphics Controller. +* - Write Composited Video Data to either +* - VFBC/Frame Buffer, or +* - VideoBus. +* +* For a full description of OSD features, please see the hardware spec. +* +* Interrupt Service +* +* Three interrupt types are supported: +* +* - Processing Start Interrupt +* - Frame Done Interrupt +* - Error Interrupt +* +* Software Initialization +* +* Please follow the example provided with this driver for the steps +* to use this driver. +* +* Cache Coherency +* +* Alignment +* +* Limitations +* +* BUS Interface +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- -------------------------------------------------------
+* 1.00a xd     08/18/08 First release
+* 1.01a xd     07/30/10 Added device version support; Supported Doxygen; Fixed
+*                       CR #534952
+* 1.02a xd     12/21/10 Removed endian conversion for text bank loading
+* 1.03a cm     09/07/11 Updated XOSD_GetLayerAlpha(), XOSD_SetLayerAlpha(),
+*                       XOSD_SetBackgroundColor() and XOSD_GetBackgroundColor()
+*                       to allow 10 and 12 bit alpha and background colors.
+* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating
+*                       basic types, MB cache functions, exceptions and
+*                       assertions to xil_io format.
+* 3.0   adk    19/12/13 Updated as per the New Tcl API's.
+* 4.0   adk    02/18/14 Converted defined macros to enum types.
+*                       Removed interrupt types XOSD_HANDLER_VBISTART and
+*                       XOSD_HANDLER_VBIEND.
+*                       Added interrupt type: XOSD_HANDLER_PROCSTART.
+*                       Renamed the following function macros:
+*                       XOSD_Enable -> XOsd_Enable,
+*                       XOSD_Disable -> XOsd_Disable,
+*                       XOSD_RegUpdateEnable -> XOsd_RegUpdateEnable,
+*                       XOSD_RegUpdateDisable -> XOsd_RegUpdateDisable,
+*                       XOSD_Reset -> XOsd_Reset,
+*                       XOSD_IntrEnable -> XOsd_IntrEnable,
+*                       XOSD_IntrDisable -> XOsd_IntrDisable,
+*                       XOSD_IntrGetPending -> XOsd_IntrGetPending,
+*                       XOSD_IntrClear -> XOsd_IntrClear.
+*
+*                       Added the following function macros:
+*                       XOsd_SyncReset, XOsd_StatusGetPending, XOsd_FSyncReset.
+*
+*                       Removed the following function macros:
+*                       XOSD_IntrEnableGlobal, XOSD_IntrDisableGlobal.
+*
+*                       Renamed S_AXIS_VIDEO_DATA_WIDTH ->
+*                                                      SlaveAxisVideoDataWidth.
+*                       Removed struct members from core structure:
+*                       VbiStartCallBack, VbiStartRef, VbiEndCallBack,
+*                       VbiEndRef.
+*
+*                       Added struct members in core structure:
+*                       ProcStartCallBack, ProcStartRef.
+*
+*                       Added the following function prototypes:
+*                       XOsd_SelfTest.
+*
+*                       Removed the following function prototypes:
+*                       XOSD_SetBlankPolarity.
+*
+*                       Changes in xosd_sinit.c:
+*                       Renamed the following functions:
+*                       XOSD_LookupConfig - > XOsd_LookupConfig
+*
+*                       Changes in xosd_selftest.c:
+*                       Implemented the following functions:
+*                       XOsd_SelfTest.
+*
+*                       Changes in xosd_intr.c:
+*                       Renamed the following functions:
+*                       XOSD_IntrHandler - > XOsd_IntrHandler.
+*                       XOSD_SetCallBack -> XOsd_SetCallBack.
+*                       Removed the following handlers:
+*                       XOSD_HANDLER_VBISTART, XOSD_HANDLER_VBIEND.
+*                       Added new handler XOSD_HANDLER_PROCSTART.
+*                       Added Doxygen support, adherence to Xilinx
+*                       coding guidelines.
+*
+*                       Changes in xosd_hw.h:
+*                       Suffixed "_OFFSET" to all register offset macros.
+*                       Added register offsets, bit masks for the registers and
+*                       added backward compatibility for macros.
+*
+*                       Removed following macros:
+*                       XOSD_GIER_GIE_MASK, XOSD_IXR_GAO_MASK
+*                       XOSD_IXR_GIE_MASK, XOSD_IXR_OOE_MASK,
+*                       XOSD_IXR_IUE_MASK, XOSD_IXR_VBIE_MASK,
+*                       XOSD_IXR_VBIS_MASK, XOSD_IXR_FE_MASK, XOSD_IXR_FD_MASK,
+*                       XOSD_IXR_ALLIERR_MASK.
+*
+*                       Changes from xosd.c:
+*                       Renamed S_AXIS_VIDEO_DATA_WIDTH ->
+*                                                      SlaveAxisVideoDataWidth.
+*                       Removed from XOsd_CfgInitialize:
+*                       VbiStartCallBack, VbiStartRef, VbiEndCallBack,
+*                       VbiEndRef.
+*
+*                       Added in XOsd_CfgInitialize:
+*                       ProcStartCallBack, ProcStartRef.
+*
+*                       Renamed the following function prototypes:
+*                       XOSD_CfgInitialize -> XOsd_CfgInitialize,
+*                       XOSD_SetScreenSize -> XOsd_SetActiveSize,
+*                       XOSD_GetScreenSize -> XOsd_GetActiveSize,
+*                       XOSD_SetBackgroundColor -> XOsd_SetBackgroundColor,
+*                       XOSD_GetBackgroundColor -> XOSD_GetBackgroundColor,
+*                       XOSD_SetLayerDimension -> XOsd_SetLayerDimension,
+*                       XOSD_GetLayerDimension -> XOsd_GetLayerDimension,
+*                       XOSD_SetLayerAlpha -> XOsd_SetLayerAlpha,
+*                       XOSD_GetLayerAlpha -> XOsd_GetLayerAlpha,
+*                       XOSD_SetLayerAlpha -> XOsd_SetLayerAlpha,
+*                       XOSD_GetLayerAlpha -> XOsd_GetLayerAlpha,
+*                       XOSD_SetLayerPriority -> XOsd_SetLayerPriority,
+*                       XOSD_GetLayerPriority -> XOsd_GetLayerPriority,
+*                       XOSD_EnableLayer -> XOsd_EnableLayer,
+*                       XOSD_DisableLayer -> XOsd_DisableLayer,
+*                       XOSD_LoadColorLUTBank - > XOsd_LoadColorLUTBank,
+*                       XOSD_LoadCharacterSetBank -> XOsd_LoadCharacterSetBank,
+*                       XOSD_LoadTextBank - > XOsd_LoadTextBank,
+*                       XOSD_SetActiveBank -> XOsd_SetActiveBank,
+*                       XOSD_CreateInstruction -> XOsd_CreateInstruction,
+*                       XOSD_LoadInstructionList -> XOsd_LoadInstructionList,
+*                       XOSD_LookupConfig -> XOsd_LookupConfig,
+*                       XOSD_IntrHandler -> XOsd_IntrHandler,
+*                       XOSD_SetCallBack -> XOsd_SetCallBack.
+*
+*                       Changed the prototype of XOSD_GetVersion and renamed it as
+*                       XOsd_GetVersion
+*
+*                       Removed the following function implementation:
+*                       XOSD_SetBlankPolarity.
+* 
+* +******************************************************************************/ + +#ifndef XOSD_H_ +#define XOSD_H_ /**< Prevent circular inclusions by + * using protection macros */ + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************** Include Files *********************************/ + +#include "xosd_hw.h" +#include "xil_assert.h" +#include "xstatus.h" + +/************************** Constant Definitions *****************************/ + +/** @name Interrupt types for setting up callbacks + * @{ + */ +enum { + XOSD_HANDLER_PROCSTART = 1, /**< A processing start event interrupt + * type */ + XOSD_HANDLER_FRAMEDONE, /**< A frame done event interrupt + * type */ + XOSD_HANDLER_ERROR /**< An error condition interrupt + * type */ +}; +/*@}*/ + +/** @name Compatibility Macros + * @{ + */ +#define XOSD_Config XOsd_Config +#define XOSD_Layer XOsd_Layer +#define XOSD_CallBack XOsd_CallBack +#define XOSD_ErrorCallBack XOsd_ErrorCallBack +#define XOSD XOsd +#define XOSD_Instruction XOsd_Instruction +#define XOSD_Enable XOsd_Enable +#define XOSD_Disable XOsd_Disable +#define XOSD_RegUpdateEnable XOsd_RegUpdateEnable +#define XOSD_RegUpdateDisable XOsd_RegUpdateDisable +#define XOSD_Reset XOsd_Reset +#define XOSD_IntrEnable XOsd_IntrEnable +#define XOSD_IntrDisable XOsd_IntrDisable +#define XOSD_IntrGetPending XOsd_IntrGetPending +#define XOSD_IntrClear XOsd_IntrClear +#define XOSD_CfgInitialize XOsd_CfgInitialize +#define XOSD_SetScreenSize XOsd_SetActiveSize +#define XOSD_GetScreenSize XOsd_GetActiveSize +#define XOSD_SetBackgroundColor XOsd_SetBackgroundColor +#define XOSD_GetBackgroundColor XOsd_GetBackgroundColor +#define XOSD_SetLayerDimension XOsd_SetLayerDimension +#define XOSD_GetLayerDimension XOsd_GetLayerDimension +#define XOSD_SetLayerAlpha XOsd_SetLayerAlpha +#define XOSD_GetLayerAlpha XOsd_GetLayerAlpha +#define XOSD_SetLayerPriority XOsd_SetLayerPriority +#define XOSD_GetLayerPriority XOsd_GetLayerPriority +#define XOSD_EnableLayer XOsd_EnableLayer +#define XOSD_DisableLayer XOsd_DisableLayer +#define XOSD_LoadColorLUTBank XOsd_LoadColorLUTBank +#define XOSD_LoadCharacterSetBank XOsd_LoadCharacterSetBank #define XOSD_LoadTextBank XOsd_LoadTextBank #define XOSD_SetActiveBank XOsd_SetActiveBank #define XOSD_CreateInstruction XOsd_CreateInstruction @@ -275,631 +275,631 @@ enum { #define XOSD_LoadInstructionList XOsd_LoadInstructionList #define XOSD_LookupConfig XOsd_LookupConfig #define XOSD_IntrHandler XOsd_IntrHandler -#define XOSD_SetCallBack XOsd_SetCallBack -/*@}*/ - -/**************************** Type Definitions *******************************/ - -/** -* OSD core configuration structure. -* Each OSD core should have a configuration structure associated. -*/ -typedef struct { - u16 DeviceId; /**< DeviceId is the unique ID - * of the core */ - u32 BaseAddress; /**< BaseAddress is the physical base address - * of the OSD core registers */ - u16 LayerNum; /**< The number of Layers */ - u16 SlaveAxisVideoDataWidth; /**< Slave Axis Video Data Width */ - u16 Layer0Type; /**< Type of Layer #0 */ - u16 Layer1Type; /**< Type of Layer #1 */ - u16 Layer2Type; /**< Type of Layer #2 */ - u16 Layer3Type; /**< Type of Layer #3 */ - u16 Layer4Type; /**< Type of Layer #4 */ - u16 Layer5Type; /**< Type of Layer #5 */ - u16 Layer6Type; /**< Type of Layer #6 */ - u16 Layer7Type; /**< Type of Layer #7 */ - - /**< Layer 0 */ - u16 Layer0InstructionMemSize; /**< Instruction Memory Size */ - u16 Layer0InstructionBoxEnable; /**< Instruction Box Enable */ - u16 Layer0InstructionLineEnable;/**< Instruction Line Enable */ - u16 Layer0InstructionTextEnable;/**< Instruction Text Enable */ - u16 Layer0ColorLutSize; /**< Color Look Up Table (LUT) Size */ - u16 Layer0ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 Layer0FontNumChars; /**< Font: Number of characters */ - u16 Layer0FontWidth; /**< Font: Width */ - u16 Layer0FontHeight; /**< Font: Height */ - u16 Layer0FontBitsPerPixel; /**< Font: Number of bits per pixel */ - u16 Layer0FontAsciiOffset; /**< Font: ASCII offset of 1st - * character */ - u16 Layer0TextNumStrings; /**< Text: Number of Strings */ - u16 Layer0TextMaxStringLength; /**< Text: Maximum length of a - * String */ - - /**< Layer 1 */ - u16 Layer1InstructionMemSize; /**< Instruction Memory Size */ - u16 Layer1InstructionBoxEnable; /**< Instruction Box Enable */ - u16 Layer1InstructionLineEnable; /**< Instruction Line Enable */ - u16 Layer1InstructionTextEnable; /**< Instruction Text Enable */ - u16 Layer1ColorLutSize; /**< Color LUT Size */ - u16 Layer1ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 Layer1FontNumChars; /**< Font: Number of - * characters */ - u16 Layer1FontWidth; /**< Font: Width */ - u16 Layer1FontHeight; /**< Font: Height */ - u16 Layer1FontBitsPerPixel; /**< Font: Number of bits - * per pixel */ - u16 Layer1FontAsciiOffset; /**< Font: ASCII offset of 1st - * character */ - u16 Layer1TextNumStrings; /**< Text: Number of Strings */ - u16 Layer1TextMaxStringLength; /**< Text: Maximum length of - * a String */ - - /**< Layer 2 */ - u16 Layer2InstructionMemSize; /**< Instruction Memory Size */ - u16 Layer2InstructionBoxEnable; /**< Instruction Box Enable */ - u16 Layer2InstructionLineEnable; /**< Instruction Line Enable */ - u16 Layer2InstructionTextEnable; /**< Instruction Text Enable */ - u16 Layer2ColorLutSize; /**< Color LUT Size */ - u16 Layer2ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 Layer2FontNumChars; /**< Font: Number of - * characters */ - u16 Layer2FontWidth; /**< Font: Width */ - u16 Layer2FontHeight; /**< Font: Height */ - u16 Layer2FontBitsPerPixel; /**< Font: Number of bits - * per pixel */ - u16 Layer2FontAsciiOffset; /**< Font: ASCII offset of 1st - * character */ - u16 Layer2TextNumStrings; /**< Text: Number of Strings */ - u16 Layer2TextMaxStringLength; /**< Text: Maximum length of - * a String */ - - /**< Layer 3 */ - u16 Layer3InstructionMemSize; /**< Instruction Memory Size */ - u16 Layer3InstructionBoxEnable; /**< Instruction Box Enable */ - u16 Layer3InstructionLineEnable; /**< Instruction Line Enable */ - u16 Layer3InstructionTextEnable; /**< Instruction Text Enable */ - u16 Layer3ColorLutSize; /**< Color LUT Size */ - u16 Layer3ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 Layer3FontNumChars; /**< Font: Number of - * characters */ - u16 Layer3FontWidth; /**< Font: Width */ - u16 Layer3FontHeight; /**< Font: Height */ - u16 Layer3FontBitsPerPixel; /**< Font: Number of bits - * per pixel */ - u16 Layer3FontAsciiOffset; /**< Font: ASCII offset of - * 1st character */ - u16 Layer3TextNumStrings; /**< Text: Number of Strings */ - u16 Layer3TextMaxStringLength; /**< Text: Maximum length of - * a String */ - - /**< Layer 4 */ - u16 Layer4InstructionMemSize; /**< Instruction Memory Size */ - u16 Layer4InstructionBoxEnable; /**< Instruction Box Enable */ - u16 Layer4InstructionLineEnable; /**< Instruction Line Enable */ - u16 Layer4InstructionTextEnable; /**< Instruction Text Enable */ - u16 Layer4ColorLutSize; /**< Color LUT Size */ - u16 Layer4ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 Layer4FontNumChars; /**< Font: Number of - * characters */ - u16 Layer4FontWidth; /**< Font: Width */ - u16 Layer4FontHeight; /**< Font: Height */ - u16 Layer4FontBitsPerPixel; /**< Font: Number of bits - * per pixel */ - u16 Layer4FontAsciiOffset; /**< Font: ASCII offset of 1st - * character */ - u16 Layer4TextNumStrings; /**< Text: Number of Strings */ - u16 Layer4TextMaxStringLength; /**< Text: Maximum length of - * a String */ - - /**< Layer 5 */ - u16 Layer5InstructionMemSize; /**< Instruction Memory Size */ - u16 Layer5InstructionBoxEnable; /**< Instruction Box Enable */ - u16 Layer5InstructionLineEnable; /**< Instruction Line Enable */ - u16 Layer5InstructionTextEnable; /**< Instruction Text Enable */ - u16 Layer5ColorLutSize; /**< Color LUT Size */ - u16 Layer5ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 Layer5FontNumChars; /**< Font: Number of - * characters */ - u16 Layer5FontWidth; /**< Font: Width */ - u16 Layer5FontHeight; /**< Font: Height */ - u16 Layer5FontBitsPerPixel; /**< Font: Number of bits per - * pixel */ - u16 Layer5FontAsciiOffset; /**< Font: ASCII offset of - * 1st character */ - u16 Layer5TextNumStrings; /**< Text: Number of Strings */ - u16 Layer5TextMaxStringLength; /**< Text: Maximum length of - * a String */ - - /**< Layer 6 */ - u16 Layer6InstructionMemSize; /**< Instruction Memory Size */ - u16 Layer6InstructionBoxEnable; /**< Instruction Box Enable */ - u16 Layer6InstructionLineEnable; /**< Instruction Line Enable */ - u16 Layer6InstructionTextEnable; /**< Instruction Text Enable */ - u16 Layer6ColorLutSize; /**< Color LUT Size */ - u16 Layer6ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 Layer6FontNumChars; /**< Font: Number of - * characters */ - u16 Layer6FontWidth; /**< Font: Width */ - u16 Layer6FontHeight; /**< Font: Height */ - u16 Layer6FontBitsPerPixel; /**< Font: Number of bits - * per pixel */ - u16 Layer6FontAsciiOffset; /**< Font: ASCII offset of - * 1st character */ - u16 Layer6TextNumStrings; /**< Text: Number of Strings */ - u16 Layer6TextMaxStringLength; /**< Text: Maximum length of - * a String */ - - /**< Layer 7 */ - u16 Layer7InstructionMemSize; /**< Instruction Memory Size */ - u16 Layer7InstructionBoxEnable; /**< Instruction Box Enable */ - u16 Layer7InstructionLineEnable; /**< Instruction Line Enable */ - u16 Layer7InstructionTextEnable; /**< Instruction Text Enable */ - u16 Layer7ColorLutSize; /**< Color LUT Size */ - u16 Layer7ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 Layer7FontNumChars; /**< Font: Number of - * characters */ - u16 Layer7FontWidth; /**< Font: Width */ - u16 Layer7FontHeight; /**< Font: Height */ - u16 Layer7FontBitsPerPixel; /**< Font: Number of bits - * per pixel */ - u16 Layer7FontAsciiOffset; /**< Font: ASCII offset of - * 1st character */ - u16 Layer7TextNumStrings; /**< Text: Number of Strings */ - u16 Layer7TextMaxStringLength; /**< Text: Maximum length - * of a String */ -} XOsd_Config; - -/** -* The OSD core layer info structure -*/ -typedef struct { - - u16 LayerType; /**< Type of the layer */ - u16 InstructionNum; /**< The Number of Instructions */ - u16 InstructionBoxEnable; /**< Instruction Box Enable */ - u16 InstructionLineEnable; /**< Instruction Line Enable */ - u16 InstructionTextEnable; /**< Instruction Text Enable */ - u16 ColorLutSize; /**< Color LUT Size */ - u16 ColorLutMemoryType; /**< Color LUT Memory Type */ - u16 FontNumChars; /**< Font: Number of characters */ - u16 FontWidth; /**< Font: Width */ - u16 FontHeight; /**< Font: Height */ - u16 FontBitsPerPixel; /**< Font: Number of bits per pixel */ - u16 FontAsciiOffset; /**< Font: ASCII offset of - * 1st character */ - u16 TextNumStrings; /**< Text: Number of Strings */ - u16 TextMaxStringLength; /**< Text: Maximum length of - * a String */ -} XOsd_Layer; - -/*****************************************************************************/ -/** -* -* This function callback type for all interrupts except error interrupt. -* -* @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. -* -******************************************************************************/ -typedef void (*XOsd_CallBack)(void *CallBackRef); - -/*****************************************************************************/ -/** -* -* This function callback type for error interrupt. -* -* @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. -* @param ErrorMask is a bit mask indicating the cause of the error. Its -* value equals 'OR'ing one or more XOSD_IXR_* values defined in -* xosd_hw.h. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -typedef void (*XOsd_ErrorCallBack)(void *CallBackRef, u32 ErrorMask); - -/** -* The XOsd instance data. An instance must be allocated for each -* OSD core in use. -*/ -typedef struct { - XOsd_Config Config; /**< Hardware configuration */ - u32 IsReady; /**< Core instance is initialized */ - u32 InstructionInExternalMem; /**< Flag indicating if - * the instruction list is from - * external memory */ - u32 ScreenHeight; /**< Screen Height of the OSD output */ - u32 ScreenWidth; /**< Screen Width of the OSD output */ - - XOsd_Layer Layers[(XOSD_MAX_NUM_OF_LAYERS)]; /**< Properties of - * layers */ - - /* - * IRQ Callbacks - */ - XOsd_CallBack ProcStartCallBack; /**< Call back for Processing - * Start interrupt */ - void *ProcStartRef; /**< To be passed to the - * Process Start - * interrupt callback */ - XOsd_CallBack FrameDoneCallBack; /**< Call back for Frame Done - * interrupt */ - void *FrameDoneRef; /**< To be passed to the Frame - * Done interrupt callback */ - XOsd_ErrorCallBack ErrCallBack; /**< Call back for Error interrupt */ - void *ErrRef; /**< To be passed to the Error - * interrupt callback */ -} XOsd; - -/** -* The XOsd_Instruction data structure for holding one GC instruction. -*/ -typedef u32 XOsd_Instruction[XOSD_INS_SIZE]; - -/***************** Macros (Inline Functions) Definitions *********************/ - -/*****************************************************************************/ -/** -* -* This function macro enables an OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return None. -* -* @note C-style signature: -* void XOsd_Enable(XOsd *InstancePtr) -* -******************************************************************************/ -#define XOsd_Enable(InstancePtr) \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ - ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_CTL_OFFSET))) | (XOSD_CTL_EN_MASK))) - -/*****************************************************************************/ -/** -* -* This function macro disables an OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return None. -* -* @note C-style signature: -* void XOsd_Disable(XOsd *InstancePtr) -* -******************************************************************************/ -#define XOsd_Disable(InstancePtr) \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ - ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_CTL_OFFSET))) & (~(XOSD_CTL_EN_MASK)))) - -/*****************************************************************************/ -/** -* -* This function macro commits all the register value changes made so far by -* the software to the OSD core instance. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return None. -* -* @note C-style signature: -* void XOsd_RegUpdateEnable(XOsd *InstancePtr) -* -******************************************************************************/ -#define XOsd_RegUpdateEnable(InstancePtr) \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ - ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_CTL_OFFSET))) | (XOSD_CTL_RUE_MASK))) - -/*****************************************************************************/ -/** -* -* This function macro prevents the OSD core 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. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return None. -* -* @note C-style signature: -* void XOsd_RegUpdateDisable(XOsd *InstancePtr) -* -******************************************************************************/ -#define XOsd_RegUpdateDisable(InstancePtr) \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ - ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_CTL_OFFSET))) & (~(XOSD_CTL_RUE_MASK)))) - -/*****************************************************************************/ -/** -* -* This function macro resets an OSD core This effects the core immediately, and -* may cause image tearing. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return None. -* -* @note C-style signature: -* void XOsd_Reset(XOsd *InstancePtr) -* This bit automatically clears when reset complete. -* -******************************************************************************/ -#define XOsd_Reset(InstancePtr) \ -{ \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ - (XOSD_CTL_SW_RST_MASK)); \ - (InstancePtr)->InstructionInExternalMem = (u32)0x0; \ - (InstancePtr)->ScreenHeight = (u32)0x0; \ - (InstancePtr)->ScreenWidth = (u32)0x0; \ -} - -/*****************************************************************************/ -/** -* -* This function macro enables the given individual interrupt(s) on the -* OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param IntrType is the bit-mask of the interrupts to be enabled. -* Bit positions of 1 will be enabled. Bit positions of 0 will -* keep the previous setting.This mask is formed by OR'ing of -* XOSD_IXR_*_MASK bits defined in xosd_hw.h. -* -* @return None. -* -* @note The existing enabled interrupt(s) will remain enabled. -* C-style signature: -* void XOsd_IntrEnable(XOsd *InstancePtr, u32 IntrType) -* -******************************************************************************/ -#define XOsd_IntrEnable(InstancePtr, IntrType) \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET), \ - (((IntrType) & (XOSD_IXR_ALLINTR_MASK)) | \ - (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_IER_OFFSET))))) - -/*****************************************************************************/ -/** -* -* This function macro disables the given individual interrupt(s) on the -* OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param IntrType is the bit-mask of the interrupts to be enabled. -* Bit positions of 1 will be disabled. Bit positions of 0 will -* keep the previous setting.This mask is formed by OR'ing of -* XOSD_IXR_*_MASK bits defined in xosd_hw.h. -* -* @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 XOsd_IntrDisable(XOsd *InstancePtr, u32 IntrType) -* -******************************************************************************/ -#define XOsd_IntrDisable(InstancePtr, IntrType) \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET), \ - (((~(IntrType)) & (XOSD_IXR_ALLINTR_MASK)) & \ - (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_IER_OFFSET))))) - -/*****************************************************************************/ -/** -* -* This function macro returns the pending interrupts of the OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return The pending interrupts of the OSD core. Use XOSD_IXR_*_MASK -* constants defined in xosd_hw.h to interpret this value. -* -* @note C-style signature: -* u32 XOsd_IntrGetPending(XOsd *InstancePtr) -* -******************************************************************************/ -#define XOsd_IntrGetPending(InstancePtr) \ - XOsd_ReadReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET)) & \ - (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_STATUS_OFFSET))) & (XOSD_IXR_ALLINTR_MASK) - -/*****************************************************************************/ -/** -* -* This function macro clears/acknowledges pending interrupts of the -* OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* @param IntrType is the pending interrupts to clear/acknowledge. -* Use OR'ing of XOSD_IXR_*_MASK constants defined in xosd_hw.h to -* create this parameter value. -* -* @return None -* -* @note C-style signature: -* void XOsd_IntrClear(XOsd *InstancePtr, u32 IntrType) -* -******************************************************************************/ -#define XOsd_IntrClear(InstancePtr, IntrType) \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_STATUS_OFFSET), ((IntrType) & (XOSD_IXR_ALLINTR_MASK))) - -/*****************************************************************************/ -/** -* -* This function macro returns the pending status of the OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return The pending interrupts of the OSD. Use XOSD_IXR_* constants -* defined in xosd_hw.h to interpret this value. -* -* @note C-style signature: -* u32 XOsd_StatusGePending(XOsd *InstancePtr) -* -******************************************************************************/ -#define XOsd_StatusGetPending(InstancePtr) \ - XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ - (XOSD_STATUS_OFFSET)) & (XOSD_IXR_ALLINTR_MASK) - - -/*****************************************************************************/ -/** -* -* This function macro resets a OSD core at the end of the frame being -* processed. It enables core automatically synchronizes to the SOF of the core -* to prevent image tearing. This function macro is differ from XOsd_Reset(). -* -* On the next rising-edge of SOF following a call to XOsd_SyncReset(), -* 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 InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return None. -* -* @note C-style signature: -* void XOsd_SyncReset(XOsd *InstancePtr) -* This bit automatically clears when reset complete. -* -******************************************************************************/ -#define XOsd_SyncReset(InstancePtr) \ - XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ - (XOSD_CTL_FSYNC_MASK)) - - -/*****************************************************************************/ -/** -* -* This macro resets the OSD core at the end of the frame being -* processed. It enables core automatically synchronizes to the SOF of the core -* to prevent image tearing. This function macro is differ from XOsd_Reset(). -* -* On the next rising-edge of SOF following a call to XOsd_SyncReset(), -* 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. -* -******************************************************************************/ -#define XOsd_FSyncReset XOsd_SyncReset - -/*****************************************************************************/ -/** -* -* This function macro stops an OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return None. -* -* @note C-style signature: -* void XOsd_Start(XOsd *InstancePtr) -* -******************************************************************************/ -#define XOsd_Start XOsd_Enable - -/*****************************************************************************/ -/** -* -* This function macro stops an OSD core. -* -* @param InstancePtr is a pointer to the XOsd instance to be worked on. -* -* @return None. -* -* @note C-style signature: -* void XOsd_Stop(XOsd *InstancePtr) -* -******************************************************************************/ -#define XOsd_Stop XOsd_Disable - - -/************************** Function Prototypes ******************************/ - -/* Initialization and control functions in xosd.c */ - -/* Initialization */ -int XOsd_CfgInitialize(XOsd *InstancePtr, XOsd_Config *CfgPtr, - u32 EffectiveAddr); - -/* Set/Get Active Size of the OSD Output */ -void XOsd_SetActiveSize(XOsd *InstancePtr, u32 Width, u32 Height); -void XOsd_GetActiveSize(XOsd *InstancePtr, u32 *WidthPtr, u32 *HeightPtr); - -/* Set/Get Background color */ -void XOsd_SetBackgroundColor(XOsd *InstancePtr, u16 Red, u16 Blue, u16 Green); -void XOsd_GetBackgroundColor(XOsd *InstancePtr, u16 *RedPtr, u16 *BluePtr, - u16 *GreenPtr); - -/* Layer related functions */ -void XOsd_SetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 XStart, - u16 YStart, u16 XSize, u16 YSize); -void XOsd_GetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 *XStartPtr, - u16 *YStartPtr, u16 *XSizePtr, u16 *YSizePtr); - -void XOsd_SetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, - u16 GlobalAlphaEnable, u16 GlobalAlphaValue); -void XOsd_GetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, - u16 *GlobalAlphaEnablePtr, u16 *GlobalAlphaValuePtr); - -void XOsd_SetLayerPriority(XOsd *InstancePtr, u8 LayerIndex, u8 Priority); -void XOsd_GetLayerPriority(XOsd *InstancePtr, u8 LayerIndex, u8 *PriorityPtr); - -void XOsd_EnableLayer(XOsd *InstancePtr, u8 LayerIndex); -void XOsd_DisableLayer(XOsd *InstancePtr, u8 LayerIndex); - -/* Graphics Controller related functions */ -void XOsd_LoadColorLUTBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 ColorData[]); -void XOsd_LoadCharacterSetBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 CharSetData[]); -void XOsd_LoadTextBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 TextData[]); -void XOsd_SetActiveBank(XOsd *InstancePtr, u8 GcIndex, u8 ColorBankIndex, - u8 CharBankIndex, u8 TextBankIndex, u8 InstructionBankIndex); - -/* Create and load instruction(s) */ -void XOsd_CreateInstruction(XOsd *InstancePtr, u32 InstructionPtr[], - u8 GcIndex, u16 ObjType, u8 ObjSize, u16 XStart, - u16 YStart, u16 XEnd, u16 YEnd, u8 TextIndex, u8 ColorIndex); -void XOsd_LoadInstructionList(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 InstSetPtr[], u32 InstNum); - -/* Version functions */ -u32 XOsd_GetVersion(XOsd *InstancePtr); - -/* Initialization functions in xosd_sinit.c */ -XOsd_Config *XOsd_LookupConfig(u16 DeviceId); - -/* Interrupt related functions in xosd_intr.c */ -void XOsd_IntrHandler(void *InstancePtr); -int XOsd_SetCallBack(XOsd *InstancePtr, u32 HandlerType, void *CallBackFunc, - void *CallBackRef); - -/* SelfTest related function in xosd_selftest.c */ -int XOsd_SelfTest(XOsd *InstancePtr); - -/************************** Variable Declarations ****************************/ - - -#ifdef __cplusplus -} +#define XOSD_SetCallBack XOsd_SetCallBack +/*@}*/ + +/**************************** Type Definitions *******************************/ + +/** +* OSD core configuration structure. +* Each OSD core should have a configuration structure associated. +*/ +typedef struct { + u16 DeviceId; /**< DeviceId is the unique ID + * of the core */ + u32 BaseAddress; /**< BaseAddress is the physical base address + * of the OSD core registers */ + u16 LayerNum; /**< The number of Layers */ + u16 SlaveAxisVideoDataWidth; /**< Slave Axis Video Data Width */ + u16 Layer0Type; /**< Type of Layer #0 */ + u16 Layer1Type; /**< Type of Layer #1 */ + u16 Layer2Type; /**< Type of Layer #2 */ + u16 Layer3Type; /**< Type of Layer #3 */ + u16 Layer4Type; /**< Type of Layer #4 */ + u16 Layer5Type; /**< Type of Layer #5 */ + u16 Layer6Type; /**< Type of Layer #6 */ + u16 Layer7Type; /**< Type of Layer #7 */ + + /**< Layer 0 */ + u16 Layer0InstructionMemSize; /**< Instruction Memory Size */ + u16 Layer0InstructionBoxEnable; /**< Instruction Box Enable */ + u16 Layer0InstructionLineEnable;/**< Instruction Line Enable */ + u16 Layer0InstructionTextEnable;/**< Instruction Text Enable */ + u16 Layer0ColorLutSize; /**< Color Look Up Table (LUT) Size */ + u16 Layer0ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 Layer0FontNumChars; /**< Font: Number of characters */ + u16 Layer0FontWidth; /**< Font: Width */ + u16 Layer0FontHeight; /**< Font: Height */ + u16 Layer0FontBitsPerPixel; /**< Font: Number of bits per pixel */ + u16 Layer0FontAsciiOffset; /**< Font: ASCII offset of 1st + * character */ + u16 Layer0TextNumStrings; /**< Text: Number of Strings */ + u16 Layer0TextMaxStringLength; /**< Text: Maximum length of a + * String */ + + /**< Layer 1 */ + u16 Layer1InstructionMemSize; /**< Instruction Memory Size */ + u16 Layer1InstructionBoxEnable; /**< Instruction Box Enable */ + u16 Layer1InstructionLineEnable; /**< Instruction Line Enable */ + u16 Layer1InstructionTextEnable; /**< Instruction Text Enable */ + u16 Layer1ColorLutSize; /**< Color LUT Size */ + u16 Layer1ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 Layer1FontNumChars; /**< Font: Number of + * characters */ + u16 Layer1FontWidth; /**< Font: Width */ + u16 Layer1FontHeight; /**< Font: Height */ + u16 Layer1FontBitsPerPixel; /**< Font: Number of bits + * per pixel */ + u16 Layer1FontAsciiOffset; /**< Font: ASCII offset of 1st + * character */ + u16 Layer1TextNumStrings; /**< Text: Number of Strings */ + u16 Layer1TextMaxStringLength; /**< Text: Maximum length of + * a String */ + + /**< Layer 2 */ + u16 Layer2InstructionMemSize; /**< Instruction Memory Size */ + u16 Layer2InstructionBoxEnable; /**< Instruction Box Enable */ + u16 Layer2InstructionLineEnable; /**< Instruction Line Enable */ + u16 Layer2InstructionTextEnable; /**< Instruction Text Enable */ + u16 Layer2ColorLutSize; /**< Color LUT Size */ + u16 Layer2ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 Layer2FontNumChars; /**< Font: Number of + * characters */ + u16 Layer2FontWidth; /**< Font: Width */ + u16 Layer2FontHeight; /**< Font: Height */ + u16 Layer2FontBitsPerPixel; /**< Font: Number of bits + * per pixel */ + u16 Layer2FontAsciiOffset; /**< Font: ASCII offset of 1st + * character */ + u16 Layer2TextNumStrings; /**< Text: Number of Strings */ + u16 Layer2TextMaxStringLength; /**< Text: Maximum length of + * a String */ + + /**< Layer 3 */ + u16 Layer3InstructionMemSize; /**< Instruction Memory Size */ + u16 Layer3InstructionBoxEnable; /**< Instruction Box Enable */ + u16 Layer3InstructionLineEnable; /**< Instruction Line Enable */ + u16 Layer3InstructionTextEnable; /**< Instruction Text Enable */ + u16 Layer3ColorLutSize; /**< Color LUT Size */ + u16 Layer3ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 Layer3FontNumChars; /**< Font: Number of + * characters */ + u16 Layer3FontWidth; /**< Font: Width */ + u16 Layer3FontHeight; /**< Font: Height */ + u16 Layer3FontBitsPerPixel; /**< Font: Number of bits + * per pixel */ + u16 Layer3FontAsciiOffset; /**< Font: ASCII offset of + * 1st character */ + u16 Layer3TextNumStrings; /**< Text: Number of Strings */ + u16 Layer3TextMaxStringLength; /**< Text: Maximum length of + * a String */ + + /**< Layer 4 */ + u16 Layer4InstructionMemSize; /**< Instruction Memory Size */ + u16 Layer4InstructionBoxEnable; /**< Instruction Box Enable */ + u16 Layer4InstructionLineEnable; /**< Instruction Line Enable */ + u16 Layer4InstructionTextEnable; /**< Instruction Text Enable */ + u16 Layer4ColorLutSize; /**< Color LUT Size */ + u16 Layer4ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 Layer4FontNumChars; /**< Font: Number of + * characters */ + u16 Layer4FontWidth; /**< Font: Width */ + u16 Layer4FontHeight; /**< Font: Height */ + u16 Layer4FontBitsPerPixel; /**< Font: Number of bits + * per pixel */ + u16 Layer4FontAsciiOffset; /**< Font: ASCII offset of 1st + * character */ + u16 Layer4TextNumStrings; /**< Text: Number of Strings */ + u16 Layer4TextMaxStringLength; /**< Text: Maximum length of + * a String */ + + /**< Layer 5 */ + u16 Layer5InstructionMemSize; /**< Instruction Memory Size */ + u16 Layer5InstructionBoxEnable; /**< Instruction Box Enable */ + u16 Layer5InstructionLineEnable; /**< Instruction Line Enable */ + u16 Layer5InstructionTextEnable; /**< Instruction Text Enable */ + u16 Layer5ColorLutSize; /**< Color LUT Size */ + u16 Layer5ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 Layer5FontNumChars; /**< Font: Number of + * characters */ + u16 Layer5FontWidth; /**< Font: Width */ + u16 Layer5FontHeight; /**< Font: Height */ + u16 Layer5FontBitsPerPixel; /**< Font: Number of bits per + * pixel */ + u16 Layer5FontAsciiOffset; /**< Font: ASCII offset of + * 1st character */ + u16 Layer5TextNumStrings; /**< Text: Number of Strings */ + u16 Layer5TextMaxStringLength; /**< Text: Maximum length of + * a String */ + + /**< Layer 6 */ + u16 Layer6InstructionMemSize; /**< Instruction Memory Size */ + u16 Layer6InstructionBoxEnable; /**< Instruction Box Enable */ + u16 Layer6InstructionLineEnable; /**< Instruction Line Enable */ + u16 Layer6InstructionTextEnable; /**< Instruction Text Enable */ + u16 Layer6ColorLutSize; /**< Color LUT Size */ + u16 Layer6ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 Layer6FontNumChars; /**< Font: Number of + * characters */ + u16 Layer6FontWidth; /**< Font: Width */ + u16 Layer6FontHeight; /**< Font: Height */ + u16 Layer6FontBitsPerPixel; /**< Font: Number of bits + * per pixel */ + u16 Layer6FontAsciiOffset; /**< Font: ASCII offset of + * 1st character */ + u16 Layer6TextNumStrings; /**< Text: Number of Strings */ + u16 Layer6TextMaxStringLength; /**< Text: Maximum length of + * a String */ + + /**< Layer 7 */ + u16 Layer7InstructionMemSize; /**< Instruction Memory Size */ + u16 Layer7InstructionBoxEnable; /**< Instruction Box Enable */ + u16 Layer7InstructionLineEnable; /**< Instruction Line Enable */ + u16 Layer7InstructionTextEnable; /**< Instruction Text Enable */ + u16 Layer7ColorLutSize; /**< Color LUT Size */ + u16 Layer7ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 Layer7FontNumChars; /**< Font: Number of + * characters */ + u16 Layer7FontWidth; /**< Font: Width */ + u16 Layer7FontHeight; /**< Font: Height */ + u16 Layer7FontBitsPerPixel; /**< Font: Number of bits + * per pixel */ + u16 Layer7FontAsciiOffset; /**< Font: ASCII offset of + * 1st character */ + u16 Layer7TextNumStrings; /**< Text: Number of Strings */ + u16 Layer7TextMaxStringLength; /**< Text: Maximum length + * of a String */ +} XOsd_Config; + +/** +* The OSD core layer info structure +*/ +typedef struct { + + u16 LayerType; /**< Type of the layer */ + u16 InstructionNum; /**< The Number of Instructions */ + u16 InstructionBoxEnable; /**< Instruction Box Enable */ + u16 InstructionLineEnable; /**< Instruction Line Enable */ + u16 InstructionTextEnable; /**< Instruction Text Enable */ + u16 ColorLutSize; /**< Color LUT Size */ + u16 ColorLutMemoryType; /**< Color LUT Memory Type */ + u16 FontNumChars; /**< Font: Number of characters */ + u16 FontWidth; /**< Font: Width */ + u16 FontHeight; /**< Font: Height */ + u16 FontBitsPerPixel; /**< Font: Number of bits per pixel */ + u16 FontAsciiOffset; /**< Font: ASCII offset of + * 1st character */ + u16 TextNumStrings; /**< Text: Number of Strings */ + u16 TextMaxStringLength; /**< Text: Maximum length of + * a String */ +} XOsd_Layer; + +/*****************************************************************************/ +/** +* +* This function callback type for all interrupts except error interrupt. +* +* @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. +* +******************************************************************************/ +typedef void (*XOsd_CallBack)(void *CallBackRef); + +/*****************************************************************************/ +/** +* +* This function callback type for error interrupt. +* +* @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. +* @param ErrorMask is a bit mask indicating the cause of the error. Its +* value equals 'OR'ing one or more XOSD_IXR_* values defined in +* xosd_hw.h. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +typedef void (*XOsd_ErrorCallBack)(void *CallBackRef, u32 ErrorMask); + +/** +* The XOsd instance data. An instance must be allocated for each +* OSD core in use. +*/ +typedef struct { + XOsd_Config Config; /**< Hardware configuration */ + u32 IsReady; /**< Core instance is initialized */ + u32 InstructionInExternalMem; /**< Flag indicating if + * the instruction list is from + * external memory */ + u32 ScreenHeight; /**< Screen Height of the OSD output */ + u32 ScreenWidth; /**< Screen Width of the OSD output */ + + XOsd_Layer Layers[(XOSD_MAX_NUM_OF_LAYERS)]; /**< Properties of + * layers */ + + /* + * IRQ Callbacks + */ + XOsd_CallBack ProcStartCallBack; /**< Call back for Processing + * Start interrupt */ + void *ProcStartRef; /**< To be passed to the + * Process Start + * interrupt callback */ + XOsd_CallBack FrameDoneCallBack; /**< Call back for Frame Done + * interrupt */ + void *FrameDoneRef; /**< To be passed to the Frame + * Done interrupt callback */ + XOsd_ErrorCallBack ErrCallBack; /**< Call back for Error interrupt */ + void *ErrRef; /**< To be passed to the Error + * interrupt callback */ +} XOsd; + +/** +* The XOsd_Instruction data structure for holding one GC instruction. +*/ +typedef u32 XOsd_Instruction[XOSD_INS_SIZE]; + +/***************** Macros (Inline Functions) Definitions *********************/ + +/*****************************************************************************/ +/** +* +* This function macro enables an OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XOsd_Enable(XOsd *InstancePtr) +* +******************************************************************************/ +#define XOsd_Enable(InstancePtr) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_CTL_OFFSET))) | (XOSD_CTL_EN_MASK))) + +/*****************************************************************************/ +/** +* +* This function macro disables an OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XOsd_Disable(XOsd *InstancePtr) +* +******************************************************************************/ +#define XOsd_Disable(InstancePtr) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_CTL_OFFSET))) & (~(XOSD_CTL_EN_MASK)))) + +/*****************************************************************************/ +/** +* +* This function macro commits all the register value changes made so far by +* the software to the OSD core instance. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XOsd_RegUpdateEnable(XOsd *InstancePtr) +* +******************************************************************************/ +#define XOsd_RegUpdateEnable(InstancePtr) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_CTL_OFFSET))) | (XOSD_CTL_RUE_MASK))) + +/*****************************************************************************/ +/** +* +* This function macro prevents the OSD core 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. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XOsd_RegUpdateDisable(XOsd *InstancePtr) +* +******************************************************************************/ +#define XOsd_RegUpdateDisable(InstancePtr) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_CTL_OFFSET))) & (~(XOSD_CTL_RUE_MASK)))) + +/*****************************************************************************/ +/** +* +* This function macro resets an OSD core This effects the core immediately, and +* may cause image tearing. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XOsd_Reset(XOsd *InstancePtr) +* This bit automatically clears when reset complete. +* +******************************************************************************/ +#define XOsd_Reset(InstancePtr) \ +{ \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + (XOSD_CTL_SW_RST_MASK)); \ + (InstancePtr)->InstructionInExternalMem = (u32)0x0; \ + (InstancePtr)->ScreenHeight = (u32)0x0; \ + (InstancePtr)->ScreenWidth = (u32)0x0; \ +} + +/*****************************************************************************/ +/** +* +* This function macro enables the given individual interrupt(s) on the +* OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param IntrType is the bit-mask of the interrupts to be enabled. +* Bit positions of 1 will be enabled. Bit positions of 0 will +* keep the previous setting.This mask is formed by OR'ing of +* XOSD_IXR_*_MASK bits defined in xosd_hw.h. +* +* @return None. +* +* @note The existing enabled interrupt(s) will remain enabled. +* C-style signature: +* void XOsd_IntrEnable(XOsd *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XOsd_IntrEnable(InstancePtr, IntrType) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET), \ + (((IntrType) & (XOSD_IXR_ALLINTR_MASK)) | \ + (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_IER_OFFSET))))) + +/*****************************************************************************/ +/** +* +* This function macro disables the given individual interrupt(s) on the +* OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param IntrType is the bit-mask of the interrupts to be enabled. +* Bit positions of 1 will be disabled. Bit positions of 0 will +* keep the previous setting.This mask is formed by OR'ing of +* XOSD_IXR_*_MASK bits defined in xosd_hw.h. +* +* @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 XOsd_IntrDisable(XOsd *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XOsd_IntrDisable(InstancePtr, IntrType) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET), \ + (((~(IntrType)) & (XOSD_IXR_ALLINTR_MASK)) & \ + (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_IER_OFFSET))))) + +/*****************************************************************************/ +/** +* +* This function macro returns the pending interrupts of the OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return The pending interrupts of the OSD core. Use XOSD_IXR_*_MASK +* constants defined in xosd_hw.h to interpret this value. +* +* @note C-style signature: +* u32 XOsd_IntrGetPending(XOsd *InstancePtr) +* +******************************************************************************/ +#define XOsd_IntrGetPending(InstancePtr) \ + XOsd_ReadReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET)) & \ + (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_STATUS_OFFSET))) & (XOSD_IXR_ALLINTR_MASK) + +/*****************************************************************************/ +/** +* +* This function macro clears/acknowledges pending interrupts of the +* OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* @param IntrType is the pending interrupts to clear/acknowledge. +* Use OR'ing of XOSD_IXR_*_MASK constants defined in xosd_hw.h to +* create this parameter value. +* +* @return None +* +* @note C-style signature: +* void XOsd_IntrClear(XOsd *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XOsd_IntrClear(InstancePtr, IntrType) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_STATUS_OFFSET), ((IntrType) & (XOSD_IXR_ALLINTR_MASK))) + +/*****************************************************************************/ +/** +* +* This function macro returns the pending status of the OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return The pending interrupts of the OSD. Use XOSD_IXR_* constants +* defined in xosd_hw.h to interpret this value. +* +* @note C-style signature: +* u32 XOsd_StatusGePending(XOsd *InstancePtr) +* +******************************************************************************/ +#define XOsd_StatusGetPending(InstancePtr) \ + XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_STATUS_OFFSET)) & (XOSD_IXR_ALLINTR_MASK) + + +/*****************************************************************************/ +/** +* +* This function macro resets a OSD core at the end of the frame being +* processed. It enables core automatically synchronizes to the SOF of the core +* to prevent image tearing. This function macro is differ from XOsd_Reset(). +* +* On the next rising-edge of SOF following a call to XOsd_SyncReset(), +* 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 InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XOsd_SyncReset(XOsd *InstancePtr) +* This bit automatically clears when reset complete. +* +******************************************************************************/ +#define XOsd_SyncReset(InstancePtr) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + (XOSD_CTL_FSYNC_MASK)) + + +/*****************************************************************************/ +/** +* +* This macro resets the OSD core at the end of the frame being +* processed. It enables core automatically synchronizes to the SOF of the core +* to prevent image tearing. This function macro is differ from XOsd_Reset(). +* +* On the next rising-edge of SOF following a call to XOsd_SyncReset(), +* 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. +* +******************************************************************************/ +#define XOsd_FSyncReset XOsd_SyncReset + +/*****************************************************************************/ +/** +* +* This function macro stops an OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XOsd_Start(XOsd *InstancePtr) +* +******************************************************************************/ +#define XOsd_Start XOsd_Enable + +/*****************************************************************************/ +/** +* +* This function macro stops an OSD core. +* +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XOsd_Stop(XOsd *InstancePtr) +* +******************************************************************************/ +#define XOsd_Stop XOsd_Disable + + +/************************** Function Prototypes ******************************/ + +/* Initialization and control functions in xosd.c */ + +/* Initialization */ +int XOsd_CfgInitialize(XOsd *InstancePtr, XOsd_Config *CfgPtr, + u32 EffectiveAddr); + +/* Set/Get Active Size of the OSD Output */ +void XOsd_SetActiveSize(XOsd *InstancePtr, u32 Width, u32 Height); +void XOsd_GetActiveSize(XOsd *InstancePtr, u32 *WidthPtr, u32 *HeightPtr); + +/* Set/Get Background color */ +void XOsd_SetBackgroundColor(XOsd *InstancePtr, u16 Red, u16 Blue, u16 Green); +void XOsd_GetBackgroundColor(XOsd *InstancePtr, u16 *RedPtr, u16 *BluePtr, + u16 *GreenPtr); + +/* Layer related functions */ +void XOsd_SetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 XStart, + u16 YStart, u16 XSize, u16 YSize); +void XOsd_GetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 *XStartPtr, + u16 *YStartPtr, u16 *XSizePtr, u16 *YSizePtr); + +void XOsd_SetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, + u16 GlobalAlphaEnable, u16 GlobalAlphaValue); +void XOsd_GetLayerAlpha(XOsd *InstancePtr, u8 LayerIndex, + u16 *GlobalAlphaEnablePtr, u16 *GlobalAlphaValuePtr); + +void XOsd_SetLayerPriority(XOsd *InstancePtr, u8 LayerIndex, u8 Priority); +void XOsd_GetLayerPriority(XOsd *InstancePtr, u8 LayerIndex, u8 *PriorityPtr); + +void XOsd_EnableLayer(XOsd *InstancePtr, u8 LayerIndex); +void XOsd_DisableLayer(XOsd *InstancePtr, u8 LayerIndex); + +/* Graphics Controller related functions */ +void XOsd_LoadColorLUTBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, + u32 ColorData[]); +void XOsd_LoadCharacterSetBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, + u32 CharSetData[]); +void XOsd_LoadTextBank(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, + u32 TextData[]); +void XOsd_SetActiveBank(XOsd *InstancePtr, u8 GcIndex, u8 ColorBankIndex, + u8 CharBankIndex, u8 TextBankIndex, u8 InstructionBankIndex); + +/* Create and load instruction(s) */ +void XOsd_CreateInstruction(XOsd *InstancePtr, u32 InstructionPtr[], + u8 GcIndex, u16 ObjType, u8 ObjSize, u16 XStart, + u16 YStart, u16 XEnd, u16 YEnd, u8 TextIndex, u8 ColorIndex); +void XOsd_LoadInstructionList(XOsd *InstancePtr, u8 GcIndex, u8 BankIndex, + u32 InstSetPtr[], u32 InstNum); + +/* Version functions */ +u32 XOsd_GetVersion(XOsd *InstancePtr); + +/* Initialization functions in xosd_sinit.c */ +XOsd_Config *XOsd_LookupConfig(u16 DeviceId); + +/* Interrupt related functions in xosd_intr.c */ +void XOsd_IntrHandler(void *InstancePtr); +int XOsd_SetCallBack(XOsd *InstancePtr, u32 HandlerType, void *CallBackFunc, + void *CallBackRef); + +/* SelfTest related function in xosd_selftest.c */ +int XOsd_SelfTest(XOsd *InstancePtr); + +/************************** Variable Declarations ****************************/ + + +#ifdef __cplusplus +} #endif #endif /* End of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_g.c b/XilinxProcessorIPLib/drivers/osd/src/xosd_g.c index c7133f0a..717ca29e 100644 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_g.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_g.c @@ -12,134 +12,134 @@ Copyright 1986-2014 Xilinx, Inc. All Rights reserved. * Description: Driver configuration * *******************************************************************/ - -#include "xparameters.h" -#include "xosd.h" - -/* -* The configuration table for devices -*/ - -XOsd_Config XOsd_ConfigTable[] = -{ - { - XPAR_HDMI_OUTPUT_V_OSD_1_DEVICE_ID, - XPAR_HDMI_OUTPUT_V_OSD_1_BASEADDR, - XPAR_HDMI_OUTPUT_V_OSD_1_NUM_LAYERS, - XPAR_HDMI_OUTPUT_V_OSD_1_S_AXIS_VIDEO_DATA_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_TYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_TYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_TYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_TYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_TYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_TYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_TYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_TYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_IMEM_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_INS_BOX_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_INS_LINE_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_INS_TEXT_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_CLUT_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_CLUT_MEMTYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_NUM_CHARS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_HEIGHT, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_BPP, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_ASCII_OFFSET, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_TEXT_NUM_STRINGS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_TEXT_MAX_STRING_LENGTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_IMEM_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_INS_BOX_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_INS_LINE_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_INS_TEXT_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_CLUT_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_CLUT_MEMTYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_NUM_CHARS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_HEIGHT, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_BPP, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_ASCII_OFFSET, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_TEXT_NUM_STRINGS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_TEXT_MAX_STRING_LENGTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_IMEM_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_INS_BOX_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_INS_LINE_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_INS_TEXT_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_CLUT_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_CLUT_MEMTYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_NUM_CHARS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_HEIGHT, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_BPP, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_ASCII_OFFSET, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_TEXT_NUM_STRINGS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_TEXT_MAX_STRING_LENGTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_IMEM_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_INS_BOX_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_INS_LINE_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_INS_TEXT_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_CLUT_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_CLUT_MEMTYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_NUM_CHARS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_HEIGHT, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_BPP, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_ASCII_OFFSET, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_TEXT_NUM_STRINGS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_TEXT_MAX_STRING_LENGTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_IMEM_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_INS_BOX_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_INS_LINE_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_INS_TEXT_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_CLUT_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_CLUT_MEMTYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_NUM_CHARS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_HEIGHT, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_BPP, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_ASCII_OFFSET, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_TEXT_NUM_STRINGS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_TEXT_MAX_STRING_LENGTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_IMEM_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_INS_BOX_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_INS_LINE_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_INS_TEXT_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_CLUT_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_CLUT_MEMTYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_NUM_CHARS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_HEIGHT, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_BPP, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_ASCII_OFFSET, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_TEXT_NUM_STRINGS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_TEXT_MAX_STRING_LENGTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_IMEM_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_INS_BOX_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_INS_LINE_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_INS_TEXT_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_CLUT_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_CLUT_MEMTYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_NUM_CHARS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_HEIGHT, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_BPP, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_ASCII_OFFSET, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_TEXT_NUM_STRINGS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_TEXT_MAX_STRING_LENGTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_IMEM_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_INS_BOX_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_INS_LINE_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_INS_TEXT_EN, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_CLUT_SIZE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_CLUT_MEMTYPE, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_NUM_CHARS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_WIDTH, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_HEIGHT, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_BPP, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_ASCII_OFFSET, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_TEXT_NUM_STRINGS, - XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_TEXT_MAX_STRING_LENGTH - } -}; - - + +#include "xparameters.h" +#include "xosd.h" + +/* +* The configuration table for devices +*/ + +XOsd_Config XOsd_ConfigTable[] = +{ + { + XPAR_HDMI_OUTPUT_V_OSD_1_DEVICE_ID, + XPAR_HDMI_OUTPUT_V_OSD_1_BASEADDR, + XPAR_HDMI_OUTPUT_V_OSD_1_NUM_LAYERS, + XPAR_HDMI_OUTPUT_V_OSD_1_S_AXIS_VIDEO_DATA_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_TYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_TYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_TYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_TYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_TYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_TYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_TYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_TYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_IMEM_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_INS_BOX_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_INS_LINE_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_INS_TEXT_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_CLUT_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_CLUT_MEMTYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_NUM_CHARS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_HEIGHT, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_BPP, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_FONT_ASCII_OFFSET, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_TEXT_NUM_STRINGS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER0_TEXT_MAX_STRING_LENGTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_IMEM_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_INS_BOX_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_INS_LINE_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_INS_TEXT_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_CLUT_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_CLUT_MEMTYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_NUM_CHARS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_HEIGHT, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_BPP, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_FONT_ASCII_OFFSET, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_TEXT_NUM_STRINGS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER1_TEXT_MAX_STRING_LENGTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_IMEM_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_INS_BOX_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_INS_LINE_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_INS_TEXT_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_CLUT_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_CLUT_MEMTYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_NUM_CHARS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_HEIGHT, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_BPP, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_FONT_ASCII_OFFSET, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_TEXT_NUM_STRINGS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER2_TEXT_MAX_STRING_LENGTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_IMEM_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_INS_BOX_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_INS_LINE_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_INS_TEXT_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_CLUT_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_CLUT_MEMTYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_NUM_CHARS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_HEIGHT, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_BPP, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_FONT_ASCII_OFFSET, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_TEXT_NUM_STRINGS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER3_TEXT_MAX_STRING_LENGTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_IMEM_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_INS_BOX_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_INS_LINE_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_INS_TEXT_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_CLUT_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_CLUT_MEMTYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_NUM_CHARS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_HEIGHT, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_BPP, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_FONT_ASCII_OFFSET, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_TEXT_NUM_STRINGS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER4_TEXT_MAX_STRING_LENGTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_IMEM_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_INS_BOX_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_INS_LINE_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_INS_TEXT_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_CLUT_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_CLUT_MEMTYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_NUM_CHARS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_HEIGHT, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_BPP, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_FONT_ASCII_OFFSET, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_TEXT_NUM_STRINGS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER5_TEXT_MAX_STRING_LENGTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_IMEM_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_INS_BOX_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_INS_LINE_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_INS_TEXT_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_CLUT_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_CLUT_MEMTYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_NUM_CHARS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_HEIGHT, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_BPP, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_FONT_ASCII_OFFSET, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_TEXT_NUM_STRINGS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER6_TEXT_MAX_STRING_LENGTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_IMEM_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_INS_BOX_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_INS_LINE_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_INS_TEXT_EN, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_CLUT_SIZE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_CLUT_MEMTYPE, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_NUM_CHARS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_WIDTH, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_HEIGHT, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_BPP, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_FONT_ASCII_OFFSET, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_TEXT_NUM_STRINGS, + XPAR_HDMI_OUTPUT_V_OSD_1_LAYER7_TEXT_MAX_STRING_LENGTH + } +}; + + diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_hw.h b/XilinxProcessorIPLib/drivers/osd/src/xosd_hw.h index 8a5022a1..5bd709ea 100644 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_hw.h +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_hw.h @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* 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 -* XILINX 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. -* +/****************************************************************************** +* +* 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 +* XILINX 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 xosd_hw.h @@ -39,104 +39,104 @@ * * This header file contains identifiers and register-level driver functions (or * macros) that can be used to access the Xilinx Video On-Screen-Display -* (OSD) core. -* -* For more information about the operation of this core, see the hardware -* specification and documentation in the higher level driver xosd.h source -* code file. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date     Changes
-* ----- ------ -------- -------------------------------------------------------
-* 1.00a xd     08/01/08 First release.
-* 2.00a cm     06/12/12 14.1/14.2 release with address map updated to match
-*                       video over AXI4-Stream Specification.
-* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating
-*                       basic types, MB cache functions, exceptions and
-*                       assertions to xil_io format.
-* 4.0   adk    02/18/14 Suffixed "_OFFSET" to all register offset macros.
-*                       Added register offsets, bit masks for the registers and
-*                       added backward compatibility for macros.
-*
-*                       Removed following macros:
-*                       XOSD_GIER_GIE_MASK, XOSD_IXR_GAO_MASK
-*                       XOSD_IXR_GIE_MASK, XOSD_IXR_OOE_MASK,
-*                       XOSD_IXR_IUE_MASK, XOSD_IXR_VBIE_MASK,
-*                       XOSD_IXR_VBIS_MASK, XOSD_IXR_FE_MASK, XOSD_IXR_FD_MASK,
-*                       XOSD_IXR_ALLIERR_MASK.
-* 
-* -******************************************************************************/ - -#ifndef XOSD_HW_H_ -#define XOSD_HW_H_ /**< Prevent circular inclusions by using - * protection macros. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ - -#include "xil_io.h" - -/************************** Constant Definitions *****************************/ - -/** @name Register Offsets - * @{ - */ -#define XOSD_CTL_OFFSET 0x000 /**< Control Offset */ -#define XOSD_ACTIVE_SIZE_OFFSET 0x020 /**< Screen Size / Output Active_Size - * Offset */ -#define XOSD_BC0_OFFSET 0x100 /**< Background Color Channel 0 - * Offset */ -#define XOSD_BC1_OFFSET 0x104 /**< Background Color Channel 1 - * Offset */ -#define XOSD_BC2_OFFSET 0x108 /**< Background Color Channel 2 - * Offset */ - -#define XOSD_L0C_OFFSET 0x110 /**< Layer 0 Control Offset */ -#define XOSD_L0P_OFFSET 0x114 /**< Layer 0 Position Offset */ -#define XOSD_L0S_OFFSET 0x118 /**< Layer 0 Size Offset */ - -#define XOSD_L1C_OFFSET 0x120 /**< Layer 1 Control Offset */ -#define XOSD_L1P_OFFSET 0x124 /**< Layer 1 Position Offset */ -#define XOSD_L1S_OFFSET 0x128 /**< Layer 1 Size Offset */ - -#define XOSD_L2C_OFFSET 0x130 /**< Layer 2 Control Offset */ -#define XOSD_L2P_OFFSET 0x134 /**< Layer 2 Position Offset */ -#define XOSD_L2S_OFFSET 0x138 /**< Layer 2 Size Offset */ - -#define XOSD_L3C_OFFSET 0x140 /**< Layer 3 Control Offset */ -#define XOSD_L3P_OFFSET 0x144 /**< Layer 3 Position Offset */ -#define XOSD_L3S_OFFSET 0x148 /**< Layer 3 Size Offset */ - -#define XOSD_L4C_OFFSET 0x150 /**< Layer 4 Control Offset */ -#define XOSD_L4P_OFFSET 0x154 /**< Layer 4 Position Offset */ -#define XOSD_L4S_OFFSET 0x158 /**< Layer 4 Size Offset */ - -#define XOSD_L5C_OFFSET 0x160 /**< Layer 5 Control Offset */ -#define XOSD_L5P_OFFSET 0x164 /**< Layer 5 Position Offset */ -#define XOSD_L5S_OFFSET 0x168 /**< Layer 5 Size Offset */ - -#define XOSD_L6C_OFFSET 0x170 /**< Layer 6 Control Offset */ -#define XOSD_L6P_OFFSET 0x174 /**< Layer 6 Position Offset */ -#define XOSD_L6S_OFFSET 0x178 /**< Layer 6 Size Offset */ - -#define XOSD_L7C_OFFSET 0x180 /**< Layer 7 Control Offset */ -#define XOSD_L7P_OFFSET 0x184 /**< Layer 7 Position Offset */ -#define XOSD_L7S_OFFSET 0x188 /**< Layer 7 Size Offset */ - -#define XOSD_GCWBA_OFFSET 0x190 /**< GPU Write Bank Address Offset */ -#define XOSD_GCABA_OFFSET 0x194 /**< GPU Active Bank Address Offset */ -#define XOSD_GCD_OFFSET 0x198 /**< GPU Data Offset */ - -#define XOSD_VER_OFFSET 0x010 /**< Version Offset */ -#define XOSD_RST_OFFSET XOSD_CTL_OFFSET /**< Software Reset Offset */ - -/** +* (OSD) core. +* +* For more information about the operation of this core, see the hardware +* specification and documentation in the higher level driver xosd.h source +* code file. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- -------------------------------------------------------
+* 1.00a xd     08/01/08 First release.
+* 2.00a cm     06/12/12 14.1/14.2 release with address map updated to match
+*                       video over AXI4-Stream Specification.
+* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating
+*                       basic types, MB cache functions, exceptions and
+*                       assertions to xil_io format.
+* 4.0   adk    02/18/14 Suffixed "_OFFSET" to all register offset macros.
+*                       Added register offsets, bit masks for the registers and
+*                       added backward compatibility for macros.
+*
+*                       Removed following macros:
+*                       XOSD_GIER_GIE_MASK, XOSD_IXR_GAO_MASK
+*                       XOSD_IXR_GIE_MASK, XOSD_IXR_OOE_MASK,
+*                       XOSD_IXR_IUE_MASK, XOSD_IXR_VBIE_MASK,
+*                       XOSD_IXR_VBIS_MASK, XOSD_IXR_FE_MASK, XOSD_IXR_FD_MASK,
+*                       XOSD_IXR_ALLIERR_MASK.
+* 
+* +******************************************************************************/ + +#ifndef XOSD_HW_H_ +#define XOSD_HW_H_ /**< Prevent circular inclusions by using + * protection macros. */ + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************** Include Files *********************************/ + +#include "xil_io.h" + +/************************** Constant Definitions *****************************/ + +/** @name Register Offsets + * @{ + */ +#define XOSD_CTL_OFFSET 0x000 /**< Control Offset */ +#define XOSD_ACTIVE_SIZE_OFFSET 0x020 /**< Screen Size / Output Active_Size + * Offset */ +#define XOSD_BC0_OFFSET 0x100 /**< Background Color Channel 0 + * Offset */ +#define XOSD_BC1_OFFSET 0x104 /**< Background Color Channel 1 + * Offset */ +#define XOSD_BC2_OFFSET 0x108 /**< Background Color Channel 2 + * Offset */ + +#define XOSD_L0C_OFFSET 0x110 /**< Layer 0 Control Offset */ +#define XOSD_L0P_OFFSET 0x114 /**< Layer 0 Position Offset */ +#define XOSD_L0S_OFFSET 0x118 /**< Layer 0 Size Offset */ + +#define XOSD_L1C_OFFSET 0x120 /**< Layer 1 Control Offset */ +#define XOSD_L1P_OFFSET 0x124 /**< Layer 1 Position Offset */ +#define XOSD_L1S_OFFSET 0x128 /**< Layer 1 Size Offset */ + +#define XOSD_L2C_OFFSET 0x130 /**< Layer 2 Control Offset */ +#define XOSD_L2P_OFFSET 0x134 /**< Layer 2 Position Offset */ +#define XOSD_L2S_OFFSET 0x138 /**< Layer 2 Size Offset */ + +#define XOSD_L3C_OFFSET 0x140 /**< Layer 3 Control Offset */ +#define XOSD_L3P_OFFSET 0x144 /**< Layer 3 Position Offset */ +#define XOSD_L3S_OFFSET 0x148 /**< Layer 3 Size Offset */ + +#define XOSD_L4C_OFFSET 0x150 /**< Layer 4 Control Offset */ +#define XOSD_L4P_OFFSET 0x154 /**< Layer 4 Position Offset */ +#define XOSD_L4S_OFFSET 0x158 /**< Layer 4 Size Offset */ + +#define XOSD_L5C_OFFSET 0x160 /**< Layer 5 Control Offset */ +#define XOSD_L5P_OFFSET 0x164 /**< Layer 5 Position Offset */ +#define XOSD_L5S_OFFSET 0x168 /**< Layer 5 Size Offset */ + +#define XOSD_L6C_OFFSET 0x170 /**< Layer 6 Control Offset */ +#define XOSD_L6P_OFFSET 0x174 /**< Layer 6 Position Offset */ +#define XOSD_L6S_OFFSET 0x178 /**< Layer 6 Size Offset */ + +#define XOSD_L7C_OFFSET 0x180 /**< Layer 7 Control Offset */ +#define XOSD_L7P_OFFSET 0x184 /**< Layer 7 Position Offset */ +#define XOSD_L7S_OFFSET 0x188 /**< Layer 7 Size Offset */ + +#define XOSD_GCWBA_OFFSET 0x190 /**< GPU Write Bank Address Offset */ +#define XOSD_GCABA_OFFSET 0x194 /**< GPU Active Bank Address Offset */ +#define XOSD_GCD_OFFSET 0x198 /**< GPU Data Offset */ + +#define XOSD_VER_OFFSET 0x010 /**< Version Offset */ +#define XOSD_RST_OFFSET XOSD_CTL_OFFSET /**< Software Reset Offset */ + +/** * Interrupt status register generates a interrupt if the corresponding bits * of interrupt enable register bits are set. */ @@ -145,462 +145,462 @@ extern "C" { #define XOSD_IER_OFFSET 0x00C /**< Interrupt Enable * Register Offset */ -#define XOSD_STATUS_OFFSET 0x004 /**< Status Offset */ -#define XOSD_ERROR_OFFSET 0x008 /**< Error Offset */ - -#define XOSD_OPENC_OFFSET 0x028 /**< Output Encoding Offset */ -/*@}*/ - -/** @name Memory footprint of layers - * @{ - */ -#define XOSD_LAYER_SIZE 0x10 /**< Total number of Layers */ -#define XOSD_LXC 0x00 /**< Layer Control */ -#define XOSD_LXP 0x04 /**< Layer Position */ -#define XOSD_LXS 0x08 /**< Layer Size */ -/*@}*/ - -/** @name Graphics Controller Bank related constants - * @{ - */ -#define XOSD_GC_BANK_NUM 2 /**< The number of Banks in each - * Graphics controller */ -/*@}*/ - -/** @name Active Size Register bit definition and Shift - * @{ - */ -#define XOSD_ACTSIZE_NUM_PIXEL_MASK 0x00000FFF /**< Horizontal Width of - * OSD Output Mask */ -#define XOSD_ACTSIZE_NUM_LINE_MASK 0x0FFF0000 /**< Vertical Height of - * OSD Output Mask */ -#define XOSD_ACTSIZE_NUM_LINE_SHIFT 16 /**< Vertical Height of - * OSD Output Shift */ -/*@}*/ - -/** @name Background Color Channel 0 Mask - * @{ - */ -#define XOSD_BC0_YG_MASK 0x00000FFF /**< Y (luma) or Green Mask */ -/*@}*/ - -/** @name Background Color Channel 1 Mask - * @{ - */ -#define XOSD_BC1_UCBB_MASK 0x00000FFF /**< U (Cb) or Blue Mask */ -/*@}*/ - -/** @name Background Color Channel 2 Mask - * @{ - */ -#define XOSD_BC2_VCRR_MASK 0x00000FFF /**< V(Cr) or Red Mask */ -/*@}*/ - -/** @name Maximum number of the layers - * @{ - */ -#define XOSD_MAX_NUM_OF_LAYERS 8 /**< The max number of - * layers */ -/*@}*/ - -/** @name Layer Control (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit - * definition and Shifts - * @{ - */ -#define XOSD_LXC_ALPHA_MASK 0x1FFF0000 /**< Global Alpha Value Mask */ -#define XOSD_LXC_ALPHA_SHIFT 16 /**< Bit shift number of - * Global Alpha Value */ -#define XOSD_LXC_PRIORITY_MASK 0x00000700 /**< Layer Priority Mask */ -#define XOSD_LXC_PRIORITY_SHIFT 8 /**< Bit shift number of - * Layer Priority */ -#define XOSD_LXC_GALPHAEN_MASK 0x00000002 /**< Global Alpha Enable - * Mask */ -#define XOSD_LXC_EN_MASK 0x00000001 /**< Layer Enable Mask */ -/*@}*/ - -/** @name Layer Position (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit - * definition and Shifts - * @{ - */ -#define XOSD_LXP_YSTART_MASK 0x0FFF0000 /**< Vertical start line of - * origin of layer Mask */ -#define XOSD_LXP_YSTART_SHIFT 16 /**< Bit shift of vertical start - * line of origin of layer */ -#define XOSD_LXP_XSTART_MASK 0x00000FFF /**< Horizontal start pixel of - * origin of layer Mask */ -/*@}*/ - -/** @name Layer Size (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit - * definition and Shift - * @{ - */ -#define XOSD_LXS_YSIZE_MASK 0x0FFF0000 /**< Vertical size of layer - * Mask */ -#define XOSD_LXS_YSIZE_SHIFT 16 /**< Bit shift number of - * vertical size of layer */ -#define XOSD_LXS_XSIZE_MASK 0x00000FFF /**< Horizontal size of - * layer Mask */ -/*@}*/ - -/** @name Graphics Controller Write Bank Address bit definition and Shift - * @{ - */ -#define XOSD_GCWBA_GCNUM_MASK 0x00000700 /**< Graphics Controller - * Number Mask */ -#define XOSD_GCWBA_GCNUM_SHIFT 8 /**< Bit shift of Graphics - * Controller Number */ -#define XOSD_GCWBA_BANK_MASK 0x00000007 /**< Controls which bank to - * write GPU instructions and - * Color LUT data into */ -#define XOSD_GCWBA_INS0 0x00000000 /**< Instruction RAM 0 */ -#define XOSD_GCWBA_INS1 0x00000001 /**< Instruction RAM 1 */ -#define XOSD_GCWBA_COL0 0x00000002 /**< Color LUT RAM 0 */ -#define XOSD_GCWBA_COL1 0x00000003 /**< Color LUT RAM 1 */ -#define XOSD_GCWBA_TXT0 0x00000004 /**< Text RAM 0 */ -#define XOSD_GCWBA_TXT1 0x00000005 /**< Text RAM 1 */ -#define XOSD_GCWBA_CHR0 0x00000006 /**< Character Set RAM 0 */ -#define XOSD_GCWBA_CHR1 0x00000007 /**< Character Set RAM 1 */ -/*@}*/ - -/** @name Graphics Controller Active Bank Address bit definition and Shifts - * @{ - */ -#define XOSD_GCABA_CHR_MASK 0xFF000000 /**< Set the active Character - * Bank Mask */ -#define XOSD_GCABA_CHR_SHIFT 24 /**< Bit shift of active - * Character Bank */ -#define XOSD_GCABA_TXT_MASK 0x00FF0000 /**< Set the active Text - * Bank Mask */ -#define XOSD_GCABA_TXT_SHIFT 16 /**< Bit shift of active Text - * Bank */ -#define XOSD_GCABA_COL_MASK 0x0000FF00 /**< Set the active Color Table - * Bank Mask */ -#define XOSD_GCABA_COL_SHIFT 8 /**< Bit shift of active Color - * Table Bank */ -#define XOSD_GCABA_INS_MASK 0x000000FF /**< Set the active instruction - * Bank Mask */ -/*@}*/ - -/** @name Version Register bit definition and Shifts - * @{ - */ -#define XOSD_VER_MAJOR_MASK 0xFF000000 /**< Major Version Mask */ -#define XOSD_VER_MAJOR_SHIFT 24 /**< Major Version Shift */ -#define XOSD_VER_MINOR_MASK 0x00FF0000 /**< Minor Version Mask */ -#define XOSD_VER_MINOR_SHIFT 16 /**< Minor Version Bit Shift */ -#define XOSD_VER_REV_MASK 0x0000F000 /**< Revision Version Mask */ -#define XOSD_VER_REV_SHIFT 12 /**< Revision Bit Shift */ -/*@}*/ - -/** @name Software Reset - * @{ - */ -#define XOSD_RST_RESET XOSD_CTL_SW_RST_MASK /**< Software Reset */ -/*@}*/ - -/** @name Interrupt Register Bit Masks. It is applicable for ISR and IER. - * @{ - */ -#define XOSD_IXR_LAYER0_ERROR_MASK 0x00000010 /**< Layer 0 Error - * interrupt enable - * Mask */ -#define XOSD_IXR_LAYER1_ERROR_MASK 0x00000020 /**< Layer 1 Error - * interrupt enable - * Mask */ -#define XOSD_IXR_LAYER2_ERROR_MASK 0x00000040 /**< Layer 2 Error - * interrupt enable - * Mask */ -#define XOSD_IXR_LAYER3_ERROR_MASK 0x00000080 /**< Layer 3 Error - * interrupt enable - * Mask */ -#define XOSD_IXR_LAYER4_ERROR_MASK 0x00000100 /**< Layer 4 Error - * interrupt enable - * Mask */ -#define XOSD_IXR_LAYER5_ERROR_MASK 0x00000200 /**< Layer 5 Error - * interrupt enable - * Mask */ -#define XOSD_IXR_LAYER6_ERROR_MASK 0x00000400 /**< Layer 6 Error - * interrupt enable - * Mask */ -#define XOSD_IXR_LAYER7_ERROR_MASK 0x00000800 /**< Layer 7 Error - * interrupt enable - * Mask */ -#define XOSD_IXR_PROC_STARTED_MASK 0x00000001 /**< OSD Processing started - * Mask */ -#define XOSD_IXR_EOF_MASK 0x00000002 /**< OSD End of frame mask */ -#define XOSD_IXR_ALLERR_MASK (XOSD_IXR_LAYER0_ERROR_MASK | \ - XOSD_IXR_LAYER1_ERROR_MASK | \ - XOSD_IXR_LAYER2_ERROR_MASK | \ - XOSD_IXR_LAYER3_ERROR_MASK | \ - XOSD_IXR_LAYER4_ERROR_MASK | \ - XOSD_IXR_LAYER5_ERROR_MASK | \ - XOSD_IXR_LAYER6_ERROR_MASK | \ - XOSD_IXR_LAYER7_ERROR_MASK ) - /**< OSD Layer 0 to Layer 7 - * Error Mask */ - -#define XOSD_IXR_ALLINTR_MASK (XOSD_IXR_PROC_STARTED_MASK | \ - XOSD_IXR_EOF_MASK | \ - XOSD_IXR_ALLERR_MASK) /**< OR'ing of all - * Masks */ -/*@}*/ - -/** @name Layer Types - * @{ - */ -#define XOSD_LAYER_TYPE_DISABLE 0 /**< Layer is disabled */ -#define XOSD_LAYER_TYPE_GPU 1 /**< Layer's type is GPU */ -#define XOSD_LAYER_TYPE_VFBC 2 /**< Layer's type is VFBC */ -/*@}*/ - -/** @name Supported instruction numbers given an instruction memory size - * @{ - */ -#define XOSD_INS_MEM_SIZE_TO_NUM 1 /**< Conversion to the number - * of instructions from the - * instruction memory size */ -/*@}*/ - -/** @name GC instruction word offset definition - * @{ - */ -#define XOSD_INS0 0 /**< Instruction word 0 offset */ -#define XOSD_INS1 1 /**< Instruction word 1 offset */ -#define XOSD_INS2 2 /**< Instruction word 2 offset */ -#define XOSD_INS3 3 /**< Instruction word 3 offset */ -#define XOSD_INS_SIZE 4 /**< Size of an instruction in words */ -/*@}*/ - -/** @name GC Instruction word 0 definition and Shifts - * @{ - */ -#define XOSD_INS0_OPCODE_MASK 0xF0000000 /**< Operation Code (OpCode) - * Mask */ -#define XOSD_INS0_OPCODE_SHIFT 28 /**< Bit shift number of - * OpCode */ -#define XOSD_INS0_GCNUM_MASK 0x07000000 /**< Graphics controller number - * (GC#) Mask */ -#define XOSD_INS0_GCNUM_SHIFT 24 /**< Bit shift number of GC# */ -#define XOSD_INS0_XEND_MASK 0x00FFF000 /**< Horizontal end pixel of - * the object Mask */ - -#define XOSD_INS0_XEND_SHIFT 12 /**< Bit shift number of - * Horizontal end pixel of - * the object */ -#define XOSD_INS0_XSTART_MASK 0x00000FFF /**< Horizontal start pixel of - * the Object Mask */ -/*@}*/ - -/** @name GC Instruction word 1 definition - * @{ - */ -#define XOSD_INS1_TXTINDEX_MASK 0x0000000F /**< String Index */ -/*@}*/ - -/** @name GC Instruction word 2 definition and Shifts - * @{ - */ -#define XOSD_INS2_OBJSIZE_MASK 0xFF000000 /**< Object Size Mask */ -#define XOSD_INS2_OBJSIZE_SHIFT 24 /**< Bit shift number of Object - * Size */ -#define XOSD_INS2_YEND_MASK 0x00FFF000 /**< Vertical end line of the - * object Mask */ -#define XOSD_INS2_YEND_SHIFT 12 /**< Bit shift number of - * Vertical end line of the - * object */ -#define XOSD_INS2_YSTART_MASK 0x00000FFF /**< Vertical start line of the - * Object Mask */ -/*@}*/ - -/** @name GC Instruction word 3 definition - * @{ - */ -#define XOSD_INS3_COL_MASK 0x0000000F /**< Color Index for - * Box/Text Mask */ -/*@}*/ - -/** @name GC Instruction Operation Code definition (used in Instruction word 0) - * @{ - */ -#define XOSD_INS_OPCODE_END 0x0 /**< End of instruction list */ -#define XOSD_INS_OPCODE_NOP 0x8 /**< NOP */ -#define XOSD_INS_OPCODE_BOX 0xA /**< Box */ -#define XOSD_INS_OPCODE_LINE 0xC /**< Line */ -#define XOSD_INS_OPCODE_TXT 0xE /**< Text */ -#define XOSD_INS_OPCODE_BOXTXT 0xF /**< Box Text */ -/*@}*/ - -/** @name GC color size - * @{ - */ -#define XOSD_COLOR_ENTRY_SIZE 4 /**< Size of each color entry - * in bytes */ -/*@}*/ - -/** @name GC font unit size - * @{ - */ -#define XOSD_FONT_BIT_TO_BYTE 8 /**< Ratio to convert font size - * to byte */ -/*@}*/ - -/** @name Layer priority - * @{ - */ -#define XOSD_LAYER_PRIORITY_0 0 /**< Priority 0 --- Lowest */ -#define XOSD_LAYER_PRIORITY_1 1 /**< Priority 1 */ -#define XOSD_LAYER_PRIORITY_2 2 /**< Priority 2 */ -#define XOSD_LAYER_PRIORITY_3 3 /**< Priority 3 */ -#define XOSD_LAYER_PRIORITY_4 4 /**< Priority 4 */ -#define XOSD_LAYER_PRIORITY_5 5 /**< Priority 5 */ -#define XOSD_LAYER_PRIORITY_6 6 /**< Priority 6 */ -#define XOSD_LAYER_PRIORITY_7 7 /**< Priority 7 --- Highest */ -/*@}*/ - -/** @name Output Encoding Register bit definition - * @{ - */ -#define XOSD_OPENC_VID_FORMAT_MASK 0x0000000F /**< OSD Output Video - * Format Mask - * 0: YUV 4:2:2 - * 1: YUV 4:4:4 - * 2: RGB - * 3: YUV 4:2:0 */ -#define XOSD_OPENC_NBITS_MASK 0x00000030 /**< Vertical Height of - * OSD Output Mask */ -/*@}*/ - -/** @name Error Register bit definition - * @{ - */ -#define XOSD_ERR_LAYER7_SOF_LATE_MASK 0x80000000 /**< OSD Layer 7 error - * for SOF late - * Mask */ -#define XOSD_ERR_LAYER7_SOF_EARLY_MASK 0x40000000 /**< OSD Layer 7 error - * for SOF early - * Mask */ -#define XOSD_ERR_LAYER7_EOL_LATE_MASK 0x20000000 /**< OSD Layer 7 error - * for EOL late - * Mask */ -#define XOSD_ERR_LAYER7_EOL_EARLY_MASK 0x10000000 /**< OSD Layer 7 error - * for EOL early */ - -#define XOSD_ERR_LAYER6_SOF_LATE_MASK 0x08000000 /**< OSD Layer 6 error - * for SOF late - * Mask */ -#define XOSD_ERR_LAYER6_SOF_EARLY_MASK 0x04000000 /**< OSD Layer 6 error - * for SOF early - * Mask */ -#define XOSD_ERR_LAYER6_EOL_LATE_MASK 0x02000000 /**< OSD Layer 6 error - * for EOL late - * Mask */ -#define XOSD_ERR_LAYER6_EOL_EARLY_MASK 0x01000000 /**< OSD Layer 6 error - * for EOL early - * Mask */ - -#define XOSD_ERR_LAYER5_SOF_LATE_MASK 0x00800000 /**< OSD Layer 5 error - * for SOF late - * Mask */ -#define XOSD_ERR_LAYER5_SOF_EARLY_MASK 0x00400000 /**< OSD Layer 5 error - * for SOF early - * Mask */ -#define XOSD_ERR_LAYER5_EOL_LATE_MASK 0x00200000 /**< OSD Layer 5 error - * for EOL late - * Mask */ -#define XOSD_ERR_LAYER5_EOL_EARLY_MASK 0x00100000 /**< OSD Layer 5 error - * for EOL early - * Mask */ - -#define XOSD_ERR_LAYER4_SOF_LATE_MASK 0x00080000 /**< OSD Layer 4 error - * for SOF late - * Mask */ -#define XOSD_ERR_LAYER4_SOF_EARLY_MASK 0x00040000 /**< OSD Layer 4 error - * for SOF early - * Mask */ -#define XOSD_ERR_LAYER4_EOL_LATE_MASK 0x00020000 /**< OSD Layer 4 error - * for EOL late - * Mask */ -#define XOSD_ERR_LAYER4_EOL_EARLY_MASK 0x00010000 /**< OSD Layer 4 error - * for EOL early - * Mask */ - -#define XOSD_ERR_LAYER3_SOF_LATE_MASK 0x00008000 /**< OSD Layer 3 error - * for SOF late - * Mask */ -#define XOSD_ERR_LAYER3_SOF_EARLY_MASK 0x00004000 /**< OSD Layer 3 error - * for SOF early - * Mask */ -#define XOSD_ERR_LAYER3_EOL_LATE_MASK 0x00002000 /**< OSD Layer 3 error - * for EOL late - * Mask */ -#define XOSD_ERR_LAYER3_EOL_EARLY_MASK 0x00001000 /**< OSD Layer 3 error - * for EOL early - * Mask */ - -#define XOSD_ERR_LAYER2_SOF_LATE_MASK 0x00000800 /**< OSD Layer 2 error - * for SOF late - * Mask */ -#define XOSD_ERR_LAYER2_SOF_EARLY_MASK 0x00000400 /**< OSD Layer 2 error - * for SOF early - * Mask */ -#define XOSD_ERR_LAYER2_EOL_LATE_MASK 0x00000200 /**< OSD Layer 2 error - * for EOL late - * Mask */ -#define XOSD_ERR_LAYER2_EOL_EARLY_MASK 0x00000100 /**< OSD Layer 2 error - * for EOL early - * Mask */ - -#define XOSD_ERR_LAYER1_SOF_LATE_MASK 0x00000080 /**< OSD Layer 1 error - * for SOF late - * Mask */ -#define XOSD_ERR_LAYER1_SOF_EARLY_MASK 0x00000040 /**< OSD Layer 1 error - * for SOF early - * Mask */ -#define XOSD_ERR_LAYER1_EOL_LATE_MASK 0x00000020 /**< OSD Layer 1 error - * for EOL late - * Mask */ -#define XOSD_ERR_LAYER1_EOL_EARLY_MASK 0x00000010 /**< OSD Layer 1 error - * for EOL early - * Mask */ - -#define XOSD_ERR_LAYER0_SOF_LATE_MASK 0x00000008 /**< OSD Layer 0 error - * for SOF late - * Mask */ -#define XOSD_ERR_LAYER0_SOF_EARLY_MASK 0x00000004 /**< OSD Layer 0 error - * for SOF early - * Mask */ -#define XOSD_ERR_LAYER0_EOL_LATE_MASK 0x00000002 /**< OSD Layer 0 error - * for EOL late - * Mask */ -#define XOSD_ERR_LAYER0_EOL_EARLY_MASK 0x00000001 /**< OSD Layer 0 error - * for EOL early - * Mask */ - -#define XOSD_ERR_ALL_ERR_MASK 0xFFFFFFFF /**< OSD Layer 0 to - * Layer 7 error for - * EOL late or early - * early or SOF late - * or early Mask */ -/*@}*/ - -/** @name Control Register bit definition - * @{ - */ -#define XOSD_CTL_EN_MASK 0x00000001 /**< Enable / SW Enable Mask */ -#define XOSD_CTL_RUE_MASK 0x00000002 /**< Register Update Enable - * Mask */ -#define XOSD_CTL_FSYNC_MASK 0x40000000 /**< Frame Sync Reset Mask */ -#define XOSD_CTL_SW_RST_MASK 0x80000000 /**< Core Reset Mask */ -/*@}*/ - -/** @name Constants. It is defined as constants to use instead magic numbers. - * @{ - */ -#define XOSD_DATA_8 8 -#define XOSD_DATA_2 2 -/*@}*/ - -/** @name Compatibility Macros +#define XOSD_STATUS_OFFSET 0x004 /**< Status Offset */ +#define XOSD_ERROR_OFFSET 0x008 /**< Error Offset */ + +#define XOSD_OPENC_OFFSET 0x028 /**< Output Encoding Offset */ +/*@}*/ + +/** @name Memory footprint of layers + * @{ + */ +#define XOSD_LAYER_SIZE 0x10 /**< Total number of Layers */ +#define XOSD_LXC 0x00 /**< Layer Control */ +#define XOSD_LXP 0x04 /**< Layer Position */ +#define XOSD_LXS 0x08 /**< Layer Size */ +/*@}*/ + +/** @name Graphics Controller Bank related constants + * @{ + */ +#define XOSD_GC_BANK_NUM 2 /**< The number of Banks in each + * Graphics controller */ +/*@}*/ + +/** @name Active Size Register bit definition and Shift + * @{ + */ +#define XOSD_ACTSIZE_NUM_PIXEL_MASK 0x00000FFF /**< Horizontal Width of + * OSD Output Mask */ +#define XOSD_ACTSIZE_NUM_LINE_MASK 0x0FFF0000 /**< Vertical Height of + * OSD Output Mask */ +#define XOSD_ACTSIZE_NUM_LINE_SHIFT 16 /**< Vertical Height of + * OSD Output Shift */ +/*@}*/ + +/** @name Background Color Channel 0 Mask + * @{ + */ +#define XOSD_BC0_YG_MASK 0x00000FFF /**< Y (luma) or Green Mask */ +/*@}*/ + +/** @name Background Color Channel 1 Mask + * @{ + */ +#define XOSD_BC1_UCBB_MASK 0x00000FFF /**< U (Cb) or Blue Mask */ +/*@}*/ + +/** @name Background Color Channel 2 Mask + * @{ + */ +#define XOSD_BC2_VCRR_MASK 0x00000FFF /**< V(Cr) or Red Mask */ +/*@}*/ + +/** @name Maximum number of the layers + * @{ + */ +#define XOSD_MAX_NUM_OF_LAYERS 8 /**< The max number of + * layers */ +/*@}*/ + +/** @name Layer Control (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit + * definition and Shifts + * @{ + */ +#define XOSD_LXC_ALPHA_MASK 0x1FFF0000 /**< Global Alpha Value Mask */ +#define XOSD_LXC_ALPHA_SHIFT 16 /**< Bit shift number of + * Global Alpha Value */ +#define XOSD_LXC_PRIORITY_MASK 0x00000700 /**< Layer Priority Mask */ +#define XOSD_LXC_PRIORITY_SHIFT 8 /**< Bit shift number of + * Layer Priority */ +#define XOSD_LXC_GALPHAEN_MASK 0x00000002 /**< Global Alpha Enable + * Mask */ +#define XOSD_LXC_EN_MASK 0x00000001 /**< Layer Enable Mask */ +/*@}*/ + +/** @name Layer Position (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit + * definition and Shifts + * @{ + */ +#define XOSD_LXP_YSTART_MASK 0x0FFF0000 /**< Vertical start line of + * origin of layer Mask */ +#define XOSD_LXP_YSTART_SHIFT 16 /**< Bit shift of vertical start + * line of origin of layer */ +#define XOSD_LXP_XSTART_MASK 0x00000FFF /**< Horizontal start pixel of + * origin of layer Mask */ +/*@}*/ + +/** @name Layer Size (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit + * definition and Shift + * @{ + */ +#define XOSD_LXS_YSIZE_MASK 0x0FFF0000 /**< Vertical size of layer + * Mask */ +#define XOSD_LXS_YSIZE_SHIFT 16 /**< Bit shift number of + * vertical size of layer */ +#define XOSD_LXS_XSIZE_MASK 0x00000FFF /**< Horizontal size of + * layer Mask */ +/*@}*/ + +/** @name Graphics Controller Write Bank Address bit definition and Shift + * @{ + */ +#define XOSD_GCWBA_GCNUM_MASK 0x00000700 /**< Graphics Controller + * Number Mask */ +#define XOSD_GCWBA_GCNUM_SHIFT 8 /**< Bit shift of Graphics + * Controller Number */ +#define XOSD_GCWBA_BANK_MASK 0x00000007 /**< Controls which bank to + * write GPU instructions and + * Color LUT data into */ +#define XOSD_GCWBA_INS0 0x00000000 /**< Instruction RAM 0 */ +#define XOSD_GCWBA_INS1 0x00000001 /**< Instruction RAM 1 */ +#define XOSD_GCWBA_COL0 0x00000002 /**< Color LUT RAM 0 */ +#define XOSD_GCWBA_COL1 0x00000003 /**< Color LUT RAM 1 */ +#define XOSD_GCWBA_TXT0 0x00000004 /**< Text RAM 0 */ +#define XOSD_GCWBA_TXT1 0x00000005 /**< Text RAM 1 */ +#define XOSD_GCWBA_CHR0 0x00000006 /**< Character Set RAM 0 */ +#define XOSD_GCWBA_CHR1 0x00000007 /**< Character Set RAM 1 */ +/*@}*/ + +/** @name Graphics Controller Active Bank Address bit definition and Shifts + * @{ + */ +#define XOSD_GCABA_CHR_MASK 0xFF000000 /**< Set the active Character + * Bank Mask */ +#define XOSD_GCABA_CHR_SHIFT 24 /**< Bit shift of active + * Character Bank */ +#define XOSD_GCABA_TXT_MASK 0x00FF0000 /**< Set the active Text + * Bank Mask */ +#define XOSD_GCABA_TXT_SHIFT 16 /**< Bit shift of active Text + * Bank */ +#define XOSD_GCABA_COL_MASK 0x0000FF00 /**< Set the active Color Table + * Bank Mask */ +#define XOSD_GCABA_COL_SHIFT 8 /**< Bit shift of active Color + * Table Bank */ +#define XOSD_GCABA_INS_MASK 0x000000FF /**< Set the active instruction + * Bank Mask */ +/*@}*/ + +/** @name Version Register bit definition and Shifts + * @{ + */ +#define XOSD_VER_MAJOR_MASK 0xFF000000 /**< Major Version Mask */ +#define XOSD_VER_MAJOR_SHIFT 24 /**< Major Version Shift */ +#define XOSD_VER_MINOR_MASK 0x00FF0000 /**< Minor Version Mask */ +#define XOSD_VER_MINOR_SHIFT 16 /**< Minor Version Bit Shift */ +#define XOSD_VER_REV_MASK 0x0000F000 /**< Revision Version Mask */ +#define XOSD_VER_REV_SHIFT 12 /**< Revision Bit Shift */ +/*@}*/ + +/** @name Software Reset + * @{ + */ +#define XOSD_RST_RESET XOSD_CTL_SW_RST_MASK /**< Software Reset */ +/*@}*/ + +/** @name Interrupt Register Bit Masks. It is applicable for ISR and IER. + * @{ + */ +#define XOSD_IXR_LAYER0_ERROR_MASK 0x00000010 /**< Layer 0 Error + * interrupt enable + * Mask */ +#define XOSD_IXR_LAYER1_ERROR_MASK 0x00000020 /**< Layer 1 Error + * interrupt enable + * Mask */ +#define XOSD_IXR_LAYER2_ERROR_MASK 0x00000040 /**< Layer 2 Error + * interrupt enable + * Mask */ +#define XOSD_IXR_LAYER3_ERROR_MASK 0x00000080 /**< Layer 3 Error + * interrupt enable + * Mask */ +#define XOSD_IXR_LAYER4_ERROR_MASK 0x00000100 /**< Layer 4 Error + * interrupt enable + * Mask */ +#define XOSD_IXR_LAYER5_ERROR_MASK 0x00000200 /**< Layer 5 Error + * interrupt enable + * Mask */ +#define XOSD_IXR_LAYER6_ERROR_MASK 0x00000400 /**< Layer 6 Error + * interrupt enable + * Mask */ +#define XOSD_IXR_LAYER7_ERROR_MASK 0x00000800 /**< Layer 7 Error + * interrupt enable + * Mask */ +#define XOSD_IXR_PROC_STARTED_MASK 0x00000001 /**< OSD Processing started + * Mask */ +#define XOSD_IXR_EOF_MASK 0x00000002 /**< OSD End of frame mask */ +#define XOSD_IXR_ALLERR_MASK (XOSD_IXR_LAYER0_ERROR_MASK | \ + XOSD_IXR_LAYER1_ERROR_MASK | \ + XOSD_IXR_LAYER2_ERROR_MASK | \ + XOSD_IXR_LAYER3_ERROR_MASK | \ + XOSD_IXR_LAYER4_ERROR_MASK | \ + XOSD_IXR_LAYER5_ERROR_MASK | \ + XOSD_IXR_LAYER6_ERROR_MASK | \ + XOSD_IXR_LAYER7_ERROR_MASK ) + /**< OSD Layer 0 to Layer 7 + * Error Mask */ + +#define XOSD_IXR_ALLINTR_MASK (XOSD_IXR_PROC_STARTED_MASK | \ + XOSD_IXR_EOF_MASK | \ + XOSD_IXR_ALLERR_MASK) /**< OR'ing of all + * Masks */ +/*@}*/ + +/** @name Layer Types + * @{ + */ +#define XOSD_LAYER_TYPE_DISABLE 0 /**< Layer is disabled */ +#define XOSD_LAYER_TYPE_GPU 1 /**< Layer's type is GPU */ +#define XOSD_LAYER_TYPE_VFBC 2 /**< Layer's type is VFBC */ +/*@}*/ + +/** @name Supported instruction numbers given an instruction memory size + * @{ + */ +#define XOSD_INS_MEM_SIZE_TO_NUM 1 /**< Conversion to the number + * of instructions from the + * instruction memory size */ +/*@}*/ + +/** @name GC instruction word offset definition + * @{ + */ +#define XOSD_INS0 0 /**< Instruction word 0 offset */ +#define XOSD_INS1 1 /**< Instruction word 1 offset */ +#define XOSD_INS2 2 /**< Instruction word 2 offset */ +#define XOSD_INS3 3 /**< Instruction word 3 offset */ +#define XOSD_INS_SIZE 4 /**< Size of an instruction in words */ +/*@}*/ + +/** @name GC Instruction word 0 definition and Shifts + * @{ + */ +#define XOSD_INS0_OPCODE_MASK 0xF0000000 /**< Operation Code (OpCode) + * Mask */ +#define XOSD_INS0_OPCODE_SHIFT 28 /**< Bit shift number of + * OpCode */ +#define XOSD_INS0_GCNUM_MASK 0x07000000 /**< Graphics controller number + * (GC#) Mask */ +#define XOSD_INS0_GCNUM_SHIFT 24 /**< Bit shift number of GC# */ +#define XOSD_INS0_XEND_MASK 0x00FFF000 /**< Horizontal end pixel of + * the object Mask */ + +#define XOSD_INS0_XEND_SHIFT 12 /**< Bit shift number of + * Horizontal end pixel of + * the object */ +#define XOSD_INS0_XSTART_MASK 0x00000FFF /**< Horizontal start pixel of + * the Object Mask */ +/*@}*/ + +/** @name GC Instruction word 1 definition + * @{ + */ +#define XOSD_INS1_TXTINDEX_MASK 0x0000000F /**< String Index */ +/*@}*/ + +/** @name GC Instruction word 2 definition and Shifts + * @{ + */ +#define XOSD_INS2_OBJSIZE_MASK 0xFF000000 /**< Object Size Mask */ +#define XOSD_INS2_OBJSIZE_SHIFT 24 /**< Bit shift number of Object + * Size */ +#define XOSD_INS2_YEND_MASK 0x00FFF000 /**< Vertical end line of the + * object Mask */ +#define XOSD_INS2_YEND_SHIFT 12 /**< Bit shift number of + * Vertical end line of the + * object */ +#define XOSD_INS2_YSTART_MASK 0x00000FFF /**< Vertical start line of the + * Object Mask */ +/*@}*/ + +/** @name GC Instruction word 3 definition + * @{ + */ +#define XOSD_INS3_COL_MASK 0x0000000F /**< Color Index for + * Box/Text Mask */ +/*@}*/ + +/** @name GC Instruction Operation Code definition (used in Instruction word 0) + * @{ + */ +#define XOSD_INS_OPCODE_END 0x0 /**< End of instruction list */ +#define XOSD_INS_OPCODE_NOP 0x8 /**< NOP */ +#define XOSD_INS_OPCODE_BOX 0xA /**< Box */ +#define XOSD_INS_OPCODE_LINE 0xC /**< Line */ +#define XOSD_INS_OPCODE_TXT 0xE /**< Text */ +#define XOSD_INS_OPCODE_BOXTXT 0xF /**< Box Text */ +/*@}*/ + +/** @name GC color size + * @{ + */ +#define XOSD_COLOR_ENTRY_SIZE 4 /**< Size of each color entry + * in bytes */ +/*@}*/ + +/** @name GC font unit size + * @{ + */ +#define XOSD_FONT_BIT_TO_BYTE 8 /**< Ratio to convert font size + * to byte */ +/*@}*/ + +/** @name Layer priority + * @{ + */ +#define XOSD_LAYER_PRIORITY_0 0 /**< Priority 0 --- Lowest */ +#define XOSD_LAYER_PRIORITY_1 1 /**< Priority 1 */ +#define XOSD_LAYER_PRIORITY_2 2 /**< Priority 2 */ +#define XOSD_LAYER_PRIORITY_3 3 /**< Priority 3 */ +#define XOSD_LAYER_PRIORITY_4 4 /**< Priority 4 */ +#define XOSD_LAYER_PRIORITY_5 5 /**< Priority 5 */ +#define XOSD_LAYER_PRIORITY_6 6 /**< Priority 6 */ +#define XOSD_LAYER_PRIORITY_7 7 /**< Priority 7 --- Highest */ +/*@}*/ + +/** @name Output Encoding Register bit definition + * @{ + */ +#define XOSD_OPENC_VID_FORMAT_MASK 0x0000000F /**< OSD Output Video + * Format Mask + * 0: YUV 4:2:2 + * 1: YUV 4:4:4 + * 2: RGB + * 3: YUV 4:2:0 */ +#define XOSD_OPENC_NBITS_MASK 0x00000030 /**< Vertical Height of + * OSD Output Mask */ +/*@}*/ + +/** @name Error Register bit definition + * @{ + */ +#define XOSD_ERR_LAYER7_SOF_LATE_MASK 0x80000000 /**< OSD Layer 7 error + * for SOF late + * Mask */ +#define XOSD_ERR_LAYER7_SOF_EARLY_MASK 0x40000000 /**< OSD Layer 7 error + * for SOF early + * Mask */ +#define XOSD_ERR_LAYER7_EOL_LATE_MASK 0x20000000 /**< OSD Layer 7 error + * for EOL late + * Mask */ +#define XOSD_ERR_LAYER7_EOL_EARLY_MASK 0x10000000 /**< OSD Layer 7 error + * for EOL early */ + +#define XOSD_ERR_LAYER6_SOF_LATE_MASK 0x08000000 /**< OSD Layer 6 error + * for SOF late + * Mask */ +#define XOSD_ERR_LAYER6_SOF_EARLY_MASK 0x04000000 /**< OSD Layer 6 error + * for SOF early + * Mask */ +#define XOSD_ERR_LAYER6_EOL_LATE_MASK 0x02000000 /**< OSD Layer 6 error + * for EOL late + * Mask */ +#define XOSD_ERR_LAYER6_EOL_EARLY_MASK 0x01000000 /**< OSD Layer 6 error + * for EOL early + * Mask */ + +#define XOSD_ERR_LAYER5_SOF_LATE_MASK 0x00800000 /**< OSD Layer 5 error + * for SOF late + * Mask */ +#define XOSD_ERR_LAYER5_SOF_EARLY_MASK 0x00400000 /**< OSD Layer 5 error + * for SOF early + * Mask */ +#define XOSD_ERR_LAYER5_EOL_LATE_MASK 0x00200000 /**< OSD Layer 5 error + * for EOL late + * Mask */ +#define XOSD_ERR_LAYER5_EOL_EARLY_MASK 0x00100000 /**< OSD Layer 5 error + * for EOL early + * Mask */ + +#define XOSD_ERR_LAYER4_SOF_LATE_MASK 0x00080000 /**< OSD Layer 4 error + * for SOF late + * Mask */ +#define XOSD_ERR_LAYER4_SOF_EARLY_MASK 0x00040000 /**< OSD Layer 4 error + * for SOF early + * Mask */ +#define XOSD_ERR_LAYER4_EOL_LATE_MASK 0x00020000 /**< OSD Layer 4 error + * for EOL late + * Mask */ +#define XOSD_ERR_LAYER4_EOL_EARLY_MASK 0x00010000 /**< OSD Layer 4 error + * for EOL early + * Mask */ + +#define XOSD_ERR_LAYER3_SOF_LATE_MASK 0x00008000 /**< OSD Layer 3 error + * for SOF late + * Mask */ +#define XOSD_ERR_LAYER3_SOF_EARLY_MASK 0x00004000 /**< OSD Layer 3 error + * for SOF early + * Mask */ +#define XOSD_ERR_LAYER3_EOL_LATE_MASK 0x00002000 /**< OSD Layer 3 error + * for EOL late + * Mask */ +#define XOSD_ERR_LAYER3_EOL_EARLY_MASK 0x00001000 /**< OSD Layer 3 error + * for EOL early + * Mask */ + +#define XOSD_ERR_LAYER2_SOF_LATE_MASK 0x00000800 /**< OSD Layer 2 error + * for SOF late + * Mask */ +#define XOSD_ERR_LAYER2_SOF_EARLY_MASK 0x00000400 /**< OSD Layer 2 error + * for SOF early + * Mask */ +#define XOSD_ERR_LAYER2_EOL_LATE_MASK 0x00000200 /**< OSD Layer 2 error + * for EOL late + * Mask */ +#define XOSD_ERR_LAYER2_EOL_EARLY_MASK 0x00000100 /**< OSD Layer 2 error + * for EOL early + * Mask */ + +#define XOSD_ERR_LAYER1_SOF_LATE_MASK 0x00000080 /**< OSD Layer 1 error + * for SOF late + * Mask */ +#define XOSD_ERR_LAYER1_SOF_EARLY_MASK 0x00000040 /**< OSD Layer 1 error + * for SOF early + * Mask */ +#define XOSD_ERR_LAYER1_EOL_LATE_MASK 0x00000020 /**< OSD Layer 1 error + * for EOL late + * Mask */ +#define XOSD_ERR_LAYER1_EOL_EARLY_MASK 0x00000010 /**< OSD Layer 1 error + * for EOL early + * Mask */ + +#define XOSD_ERR_LAYER0_SOF_LATE_MASK 0x00000008 /**< OSD Layer 0 error + * for SOF late + * Mask */ +#define XOSD_ERR_LAYER0_SOF_EARLY_MASK 0x00000004 /**< OSD Layer 0 error + * for SOF early + * Mask */ +#define XOSD_ERR_LAYER0_EOL_LATE_MASK 0x00000002 /**< OSD Layer 0 error + * for EOL late + * Mask */ +#define XOSD_ERR_LAYER0_EOL_EARLY_MASK 0x00000001 /**< OSD Layer 0 error + * for EOL early + * Mask */ + +#define XOSD_ERR_ALL_ERR_MASK 0xFFFFFFFF /**< OSD Layer 0 to + * Layer 7 error for + * EOL late or early + * early or SOF late + * or early Mask */ +/*@}*/ + +/** @name Control Register bit definition + * @{ + */ +#define XOSD_CTL_EN_MASK 0x00000001 /**< Enable / SW Enable Mask */ +#define XOSD_CTL_RUE_MASK 0x00000002 /**< Register Update Enable + * Mask */ +#define XOSD_CTL_FSYNC_MASK 0x40000000 /**< Frame Sync Reset Mask */ +#define XOSD_CTL_SW_RST_MASK 0x80000000 /**< Core Reset Mask */ +/*@}*/ + +/** @name Constants. It is defined as constants to use instead magic numbers. + * @{ + */ +#define XOSD_DATA_8 8 +#define XOSD_DATA_2 2 +/*@}*/ + +/** @name Compatibility Macros * @{ */ #define XOSD_CTL XOSD_CTL_OFFSET @@ -609,46 +609,46 @@ extern "C" { #define XOSD_OPENC XOSD_OPENC_OFFSET #define XOSD_BC0 XOSD_BC0_OFFSET #define XOSD_BC1 XOSD_BC1_OFFSET -#define XOSD_BC2 XOSD_BC2_OFFSET - -#define XOSD_L0C XOSD_L0C_OFFSET -#define XOSD_L0P XOSD_L0P_OFFSET -#define XOSD_L0S XOSD_L0S_OFFSET - -#define XOSD_L1C XOSD_L1C_OFFSET -#define XOSD_L1P XOSD_L1P_OFFSET -#define XOSD_L1S XOSD_L1S_OFFSET - -#define XOSD_L2C XOSD_L2C_OFFSET -#define XOSD_L2P XOSD_L2P_OFFSET -#define XOSD_L2S XOSD_L2S_OFFSET - -#define XOSD_L3C XOSD_L3C_OFFSET -#define XOSD_L3P XOSD_L3P_OFFSET -#define XOSD_L3S XOSD_L3S_OFFSET - -#define XOSD_L4C XOSD_L4C_OFFSET -#define XOSD_L4P XOSD_L4P_OFFSET -#define XOSD_L4S XOSD_L4S_OFFSET - -#define XOSD_L5C XOSD_L5C_OFFSET -#define XOSD_L5P XOSD_L5P_OFFSET -#define XOSD_L5S XOSD_L5S_OFFSET - -#define XOSD_L6C XOSD_L6C_OFFSET -#define XOSD_L6P XOSD_L6P_OFFSET -#define XOSD_L6S XOSD_L6S_OFFSET - -#define XOSD_L7C XOSD_L7C_OFFSET -#define XOSD_L7P XOSD_L7P_OFFSET -#define XOSD_L7S XOSD_L7S_OFFSET - -#define XOSD_GCWBA XOSD_GCWBA_OFFSET -#define XOSD_GCABA XOSD_GCABA_OFFSET -#define XOSD_GCD XOSD_GCD_OFFSET - -#define XOSD_RST XOSD_RST_OFFSET - +#define XOSD_BC2 XOSD_BC2_OFFSET + +#define XOSD_L0C XOSD_L0C_OFFSET +#define XOSD_L0P XOSD_L0P_OFFSET +#define XOSD_L0S XOSD_L0S_OFFSET + +#define XOSD_L1C XOSD_L1C_OFFSET +#define XOSD_L1P XOSD_L1P_OFFSET +#define XOSD_L1S XOSD_L1S_OFFSET + +#define XOSD_L2C XOSD_L2C_OFFSET +#define XOSD_L2P XOSD_L2P_OFFSET +#define XOSD_L2S XOSD_L2S_OFFSET + +#define XOSD_L3C XOSD_L3C_OFFSET +#define XOSD_L3P XOSD_L3P_OFFSET +#define XOSD_L3S XOSD_L3S_OFFSET + +#define XOSD_L4C XOSD_L4C_OFFSET +#define XOSD_L4P XOSD_L4P_OFFSET +#define XOSD_L4S XOSD_L4S_OFFSET + +#define XOSD_L5C XOSD_L5C_OFFSET +#define XOSD_L5P XOSD_L5P_OFFSET +#define XOSD_L5S XOSD_L5S_OFFSET + +#define XOSD_L6C XOSD_L6C_OFFSET +#define XOSD_L6P XOSD_L6P_OFFSET +#define XOSD_L6S XOSD_L6S_OFFSET + +#define XOSD_L7C XOSD_L7C_OFFSET +#define XOSD_L7P XOSD_L7P_OFFSET +#define XOSD_L7S XOSD_L7S_OFFSET + +#define XOSD_GCWBA XOSD_GCWBA_OFFSET +#define XOSD_GCABA XOSD_GCABA_OFFSET +#define XOSD_GCD XOSD_GCD_OFFSET + +#define XOSD_RST XOSD_RST_OFFSET + #define XOSD_ISR XOSD_ISR_OFFSET #define XOSD_IER XOSD_IER_OFFSET @@ -659,65 +659,65 @@ extern "C" { #define XOSD_In32 XOsd_In32 #define XOSD_Out32 XOsd_Out32 -#define XOSD_ReadReg XOsd_ReadReg -#define XOSD_WriteReg XOsd_WriteReg -/*@}*/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -/** @name Core register I/O APIs - * @{ - */ - -#define XOsd_In32 Xil_In32 -#define XOsd_Out32 Xil_Out32 - -/*****************************************************************************/ -/** -* -* This function reads the given register. -* -* @param BaseAddress is the base address of the OSD core. -* @param RegOffset is the register offset of the OSD core. -* -* @return The 32-bit value of the register. -* -* @note C-style signature: -* u32 XOsd_ReadReg(u32 BaseAddress, u32 RegOffset) -* -******************************************************************************/ -#define XOsd_ReadReg(BaseAddress, RegOffset) \ - XOsd_In32((BaseAddress) + (u32)(RegOffset)) - -/*****************************************************************************/ -/** -* -* This function writes the given register. -* -* @param BaseAddress is the base address of the OSD core. -* @param RegOffset is the register offset of the OSD core. -* @param Data is the 32-bit value to write into the core register. -* -* @return None. -* -* @note C-style signature: -* void XOsd_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data) -* -******************************************************************************/ -#define XOsd_WriteReg(BaseAddress, RegOffset, Data) \ - XOsd_Out32((BaseAddress) + (u32)(RegOffset), (Data)) -/*@}*/ - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - - -/************************** Variable Declarations ****************************/ - -#ifdef __cplusplus -} +#define XOSD_ReadReg XOsd_ReadReg +#define XOSD_WriteReg XOsd_WriteReg +/*@}*/ + +/***************** Macros (Inline Functions) Definitions *********************/ + +/** @name Core register I/O APIs + * @{ + */ + +#define XOsd_In32 Xil_In32 +#define XOsd_Out32 Xil_Out32 + +/*****************************************************************************/ +/** +* +* This function reads the given register. +* +* @param BaseAddress is the base address of the OSD core. +* @param RegOffset is the register offset of the OSD core. +* +* @return The 32-bit value of the register. +* +* @note C-style signature: +* u32 XOsd_ReadReg(u32 BaseAddress, u32 RegOffset) +* +******************************************************************************/ +#define XOsd_ReadReg(BaseAddress, RegOffset) \ + XOsd_In32((BaseAddress) + (u32)(RegOffset)) + +/*****************************************************************************/ +/** +* +* This function writes the given register. +* +* @param BaseAddress is the base address of the OSD core. +* @param RegOffset is the register offset of the OSD core. +* @param Data is the 32-bit value to write into the core register. +* +* @return None. +* +* @note C-style signature: +* void XOsd_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data) +* +******************************************************************************/ +#define XOsd_WriteReg(BaseAddress, RegOffset, Data) \ + XOsd_Out32((BaseAddress) + (u32)(RegOffset), (Data)) +/*@}*/ + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Declarations ****************************/ + +#ifdef __cplusplus +} #endif #endif /* End of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_intr.c b/XilinxProcessorIPLib/drivers/osd/src/xosd_intr.c index cd780d26..9fb8f8d9 100644 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_intr.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_intr.c @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* 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 -* XILINX 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. -* -******************************************************************************/ -/*****************************************************************************/ +/****************************************************************************** +* +* 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 +* XILINX 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 xosd_intr.c @@ -39,80 +39,80 @@ * * This code contains interrupt related functions of Xilinx Video * On-Screen-Display core. Please see xosd.h for more details of -* the driver. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date     Changes
-* ----- ------ -------- -------------------------------------------------------
-* 1.00a xd     08/18/08 First release.
-* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating basic
-*                       types, MB cache functions, exceptions and assertions
-*                       to xil_io format.
-* 4.0   adk    02/18/14 Renamed the following functions:
-*                       XOSD_IntrHandler - > XOsd_IntrHandler.
-*                       XOSD_SetCallBack -> XOsd_SetCallBack.
-*                       Removed the following handlers:
-*                       XOSD_HANDLER_VBISTART, XOSD_HANDLER_VBIEND.
-*                       Added new handler XOSD_HANDLER_PROCSTART.
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xosd.h" - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - - -/************************** Variable Definitions *****************************/ - - -/************************** Function Definitions *****************************/ - -/*****************************************************************************/ -/** -* -* This function is the interrupt handler for the On-Screen-Display 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. -* -* 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 -* XOsd_SetCallBack() during initialization phase. -* -* @param InstancePtr is a pointer to the XOsd instance that just -* interrupted. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XOsd_IntrHandler(void *InstancePtr) -{ - u32 PendingIntr; - u32 ErrorStatus; - XOsd *XOsdPtr = NULL; - - XOsdPtr = (XOsd *)((void *)InstancePtr); - - /* Validate arguments. */ - Xil_AssertVoid(XOsdPtr != NULL); - Xil_AssertVoid(XOsdPtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - - /* Get pending interrupts. */ +* the driver. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- -------------------------------------------------------
+* 1.00a xd     08/18/08 First release.
+* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating basic
+*                       types, MB cache functions, exceptions and assertions
+*                       to xil_io format.
+* 4.0   adk    02/18/14 Renamed the following functions:
+*                       XOSD_IntrHandler - > XOsd_IntrHandler.
+*                       XOSD_SetCallBack -> XOsd_SetCallBack.
+*                       Removed the following handlers:
+*                       XOSD_HANDLER_VBISTART, XOSD_HANDLER_VBIEND.
+*                       Added new handler XOSD_HANDLER_PROCSTART.
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xosd.h" + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function is the interrupt handler for the On-Screen-Display 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. +* +* 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 +* XOsd_SetCallBack() during initialization phase. +* +* @param InstancePtr is a pointer to the XOsd instance that just +* interrupted. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XOsd_IntrHandler(void *InstancePtr) +{ + u32 PendingIntr; + u32 ErrorStatus; + XOsd *XOsdPtr = NULL; + + XOsdPtr = (XOsd *)((void *)InstancePtr); + + /* Validate arguments. */ + Xil_AssertVoid(XOsdPtr != NULL); + Xil_AssertVoid(XOsdPtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + + /* Get pending interrupts. */ PendingIntr = (u32)(XOsd_IntrGetPending(XOsdPtr)); /* Error interrupt is occurring or spurious interrupt. */ @@ -120,93 +120,93 @@ void XOsd_IntrHandler(void *InstancePtr) ErrorStatus = (PendingIntr) & (XOSD_IXR_ALLERR_MASK); XOsdPtr->ErrCallBack(XOsdPtr->ErrRef, ErrorStatus); } - - /* A Processing start interrupt has occurred. */ - if (((PendingIntr) & (XOSD_IXR_PROC_STARTED_MASK)) == - (XOSD_IXR_PROC_STARTED_MASK)) { - XOsdPtr->ProcStartCallBack(XOsdPtr->ProcStartRef); - } - - /* A frame done interrupt has occurred. */ - if (((PendingIntr) & (XOSD_IXR_EOF_MASK)) == - (XOSD_IXR_EOF_MASK)) { - XOsdPtr->FrameDoneCallBack(XOsdPtr->FrameDoneRef); - } - - /* Clear pending interrupts. */ - XOsd_IntrClear(XOsdPtr, PendingIntr); - -} - -/*****************************************************************************/ -/** -* -* This routine installs an asynchronous callback function for the given -* HandlerType: -* -*
-* HandlerType              Callback Function Type
-* -----------------------  -------------------------------
-* XOSD_HANDLER_PROCSTART   StubCallBack
-* XOSD_HANDLER_FRAMEDONE   StubCallBack
-* XOSD_HANDLER_ERROR       StubErrCallBack
-*
-* 
-* -* @param InstancePtr is a pointer to the XOsd 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. -* -* @note Invoking this function for a handler that already has been -* installed replaces it with the new handler. -* -******************************************************************************/ -int XOsd_SetCallBack(XOsd *InstancePtr, u32 HandlerType, - void *CallBackFunc, void *CallBackRef) -{ - int Status; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == - (u32)(XIL_COMPONENT_IS_READY)); - Xil_AssertNonvoid(CallBackFunc != NULL); - Xil_AssertNonvoid(CallBackRef != NULL); - Xil_AssertNonvoid((HandlerType >= (u32)(XOSD_HANDLER_PROCSTART)) && - (HandlerType <= (u32)(XOSD_HANDLER_ERROR))); - - /* Setting the HandlerType. */ - switch (HandlerType) { - case XOSD_HANDLER_PROCSTART: - InstancePtr->ProcStartCallBack = - (XOsd_CallBack)((void *)CallBackFunc); - InstancePtr->ProcStartRef = CallBackRef; - Status = (XST_SUCCESS); - break; - - case XOSD_HANDLER_FRAMEDONE: - InstancePtr->FrameDoneCallBack = - (XOsd_CallBack)((void *)CallBackFunc); - InstancePtr->FrameDoneRef = CallBackRef; - Status = (XST_SUCCESS); - break; - - case XOSD_HANDLER_ERROR: - InstancePtr->ErrCallBack = - (XOsd_ErrorCallBack)((void *)CallBackFunc); - InstancePtr->ErrRef = CallBackRef; - Status = (XST_SUCCESS); - break; - - default: - Status = (XST_INVALID_PARAM); - break; - } + + /* A Processing start interrupt has occurred. */ + if (((PendingIntr) & (XOSD_IXR_PROC_STARTED_MASK)) == + (XOSD_IXR_PROC_STARTED_MASK)) { + XOsdPtr->ProcStartCallBack(XOsdPtr->ProcStartRef); + } + + /* A frame done interrupt has occurred. */ + if (((PendingIntr) & (XOSD_IXR_EOF_MASK)) == + (XOSD_IXR_EOF_MASK)) { + XOsdPtr->FrameDoneCallBack(XOsdPtr->FrameDoneRef); + } + + /* Clear pending interrupts. */ + XOsd_IntrClear(XOsdPtr, PendingIntr); + +} + +/*****************************************************************************/ +/** +* +* This routine installs an asynchronous callback function for the given +* HandlerType: +* +*
+* HandlerType              Callback Function Type
+* -----------------------  -------------------------------
+* XOSD_HANDLER_PROCSTART   StubCallBack
+* XOSD_HANDLER_FRAMEDONE   StubCallBack
+* XOSD_HANDLER_ERROR       StubErrCallBack
+*
+* 
+* +* @param InstancePtr is a pointer to the XOsd 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. +* +* @note Invoking this function for a handler that already has been +* installed replaces it with the new handler. +* +******************************************************************************/ +int XOsd_SetCallBack(XOsd *InstancePtr, u32 HandlerType, + void *CallBackFunc, void *CallBackRef) +{ + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->IsReady == + (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertNonvoid(CallBackFunc != NULL); + Xil_AssertNonvoid(CallBackRef != NULL); + Xil_AssertNonvoid((HandlerType >= (u32)(XOSD_HANDLER_PROCSTART)) && + (HandlerType <= (u32)(XOSD_HANDLER_ERROR))); + + /* Setting the HandlerType. */ + switch (HandlerType) { + case XOSD_HANDLER_PROCSTART: + InstancePtr->ProcStartCallBack = + (XOsd_CallBack)((void *)CallBackFunc); + InstancePtr->ProcStartRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + case XOSD_HANDLER_FRAMEDONE: + InstancePtr->FrameDoneCallBack = + (XOsd_CallBack)((void *)CallBackFunc); + InstancePtr->FrameDoneRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + case XOSD_HANDLER_ERROR: + InstancePtr->ErrCallBack = + (XOsd_ErrorCallBack)((void *)CallBackFunc); + InstancePtr->ErrRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + default: + Status = (XST_INVALID_PARAM); + break; + } return Status; } diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_selftest.c b/XilinxProcessorIPLib/drivers/osd/src/xosd_selftest.c index c229094a..8fb8595d 100644 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_selftest.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_selftest.c @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* Copyright (C) 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 -* XILINX 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. -* +/****************************************************************************** +* +* Copyright (C) 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 +* XILINX 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 xosd_selftest.c @@ -39,72 +39,72 @@ * * This file contains the self-test function for the OSD core. * -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date     Changes
-* ----- ------ -------- --------------------------------------------------
-* 4.0   adk    02/18/14 First Release.
-*                       Implemented the following functions:
-*                       XOsd_SelfTest.
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xosd.h" - -/************************** Constant Definitions *****************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - - -/************************** Variable Definitions *****************************/ - - -/************************** Function Definitions *****************************/ - -/*****************************************************************************/ -/** -* -* This function reads Version register of OSD core and compares with zero -* as part of self test. -* -* @param InstancePtr is a pointer to the XOsd instance. -* -* @return - XST_SUCCESS if the Version register read test was successful. -* - XST_FAILURE if the Version register read test failed. -* -* @note None. -* -******************************************************************************/ -int XOsd_SelfTest(XOsd *InstancePtr) -{ - u32 Version; - int Status; - - /* Verify argument. */ - Xil_AssertNonvoid(InstancePtr != NULL); - - /* Read OSD core Version register. */ - Version = XOsd_ReadReg(InstancePtr->Config.BaseAddress, - (XOSD_VER_OFFSET)); - - /* Compare Version with zero. */ - if (Version != (u32)0x0) { - Status = (XST_SUCCESS); - } - else { - Status = (XST_FAILURE); - } +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- --------------------------------------------------
+* 4.0   adk    02/18/14 First Release.
+*                       Implemented the following functions:
+*                       XOsd_SelfTest.
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xosd.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function reads Version register of OSD core and compares with zero +* as part of self test. +* +* @param InstancePtr is a pointer to the XOsd instance. +* +* @return - XST_SUCCESS if the Version register read test was successful. +* - XST_FAILURE if the Version register read test failed. +* +* @note None. +* +******************************************************************************/ +int XOsd_SelfTest(XOsd *InstancePtr) +{ + u32 Version; + int Status; + + /* Verify argument. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + /* Read OSD core Version register. */ + Version = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_VER_OFFSET)); + + /* Compare Version with zero. */ + if (Version != (u32)0x0) { + Status = (XST_SUCCESS); + } + else { + Status = (XST_FAILURE); + } return Status; } diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_sinit.c b/XilinxProcessorIPLib/drivers/osd/src/xosd_sinit.c index 89e63be1..1056048b 100644 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_sinit.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_sinit.c @@ -1,35 +1,35 @@ -/****************************************************************************** -* -* 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 -* XILINX 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. -* +/****************************************************************************** +* +* 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 +* XILINX 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 xosd_sinit.c @@ -39,74 +39,74 @@ * * This file contains the static initialization method for Xilinx Video * On-Screen-Display (OSD) core. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date     Changes
-* ----- ------ -------- ------------------------------------------------------
-* 1.00a xd     08/18/08 First release
-* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating
-*                       basic types, MB cache functions, exceptions and
-*                       assertions to xil_io format.
-* 4.0   adk    02/18/14 Renamed the following functions:
-*                       XOSD_LookupConfig - > XOsd_LookupConfig
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xosd.h" -#include "xparameters.h" - -/************************** Constant Definitions *****************************/ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/**************************** Type Definitions *******************************/ - - -/************************** Function Prototypes ******************************/ - - -/************************** Variable Definitions *****************************/ - - -/************************** Function Definitions *****************************/ - -/*****************************************************************************/ -/** -* -* This function gets a reference to an XOsd_Config structure based on the -* unique device id, DeviceId. The return value will refer to an entry -* in the core configuration table defined in the xosd_g.c file. -* -* @param DeviceId is the unique core ID of the OSD core for the lookup -* operation. -* -* @return XOsd_Config is a reference to a config record in the -* configuration table (in xosd_g.c) corresponding to -* DeviceId or NULL if no match is found. -* -* @note None. -* -******************************************************************************/ -XOsd_Config *XOsd_LookupConfig(u16 DeviceId) -{ - extern XOsd_Config XOsd_ConfigTable[XPAR_XOSD_NUM_INSTANCES]; - XOsd_Config *CfgPtr = NULL; - u32 Index; - - for (Index = (u32)0x0; Index < (u32)(XPAR_XOSD_NUM_INSTANCES); - Index++) { - if (XOsd_ConfigTable[Index].DeviceId == DeviceId) { - CfgPtr = &XOsd_ConfigTable[Index]; - break; - } - } +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- ------------------------------------------------------
+* 1.00a xd     08/18/08 First release
+* 2.00a cjm    12/18/12 Converted from xio.h to xil_io.h, translating
+*                       basic types, MB cache functions, exceptions and
+*                       assertions to xil_io format.
+* 4.0   adk    02/18/14 Renamed the following functions:
+*                       XOSD_LookupConfig - > XOsd_LookupConfig
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xosd.h" +#include "xparameters.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function gets a reference to an XOsd_Config structure based on the +* unique device id, DeviceId. The return value will refer to an entry +* in the core configuration table defined in the xosd_g.c file. +* +* @param DeviceId is the unique core ID of the OSD core for the lookup +* operation. +* +* @return XOsd_Config is a reference to a config record in the +* configuration table (in xosd_g.c) corresponding to +* DeviceId or NULL if no match is found. +* +* @note None. +* +******************************************************************************/ +XOsd_Config *XOsd_LookupConfig(u16 DeviceId) +{ + extern XOsd_Config XOsd_ConfigTable[XPAR_XOSD_NUM_INSTANCES]; + XOsd_Config *CfgPtr = NULL; + u32 Index; + + for (Index = (u32)0x0; Index < (u32)(XPAR_XOSD_NUM_INSTANCES); + Index++) { + if (XOsd_ConfigTable[Index].DeviceId == DeviceId) { + CfgPtr = &XOsd_ConfigTable[Index]; + break; + } + } return (XOsd_Config *)CfgPtr; } diff --git a/XilinxProcessorIPLib/drivers/rgb2ycrcb/examples/index.html b/XilinxProcessorIPLib/drivers/rgb2ycrcb/examples/index.html index 5993bf5a..37199ff2 100755 --- a/XilinxProcessorIPLib/drivers/rgb2ycrcb/examples/index.html +++ b/XilinxProcessorIPLib/drivers/rgb2ycrcb/examples/index.html @@ -1,21 +1,21 @@ - - - - - -Driver example applications - - - -

Example Applications for the driver rgb2ycrcb_v7_0

-
- - -

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

- - - + + + + + +Driver example applications + + + +

Example Applications for the driver rgb2ycrcb_v7_0

+
+ + +

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

+ + + diff --git a/XilinxProcessorIPLib/drivers/usbps/src/xusbps_intr.c b/XilinxProcessorIPLib/drivers/usbps/src/xusbps_intr.c index fe83156e..96e3448e 100644 --- a/XilinxProcessorIPLib/drivers/usbps/src/xusbps_intr.c +++ b/XilinxProcessorIPLib/drivers/usbps/src/xusbps_intr.c @@ -387,7 +387,7 @@ static void XUsbPs_IntrHandleReset(XUsbPs *InstancePtr, u32 IrqSts) XUSBPS_EPCOMPL_OFFSET)); /* Cancel all endpoint prime status by waiting until all bits - * in XUSBPS_EPPRIME_OFFSET are 0 and then writing 0xFFFFFFFF + * in XUSBPS_EPPRIME_OFFSET are 0 and then writing 0xFFFFFFFF * to XUSBPS_EPFLUSH_OFFSET. * * Avoid hanging here by using a Timeout counter... diff --git a/XilinxProcessorIPLib/drivers/ycrcb2rgb/examples/index.html b/XilinxProcessorIPLib/drivers/ycrcb2rgb/examples/index.html index c4232d9e..9fb5c4c2 100755 --- a/XilinxProcessorIPLib/drivers/ycrcb2rgb/examples/index.html +++ b/XilinxProcessorIPLib/drivers/ycrcb2rgb/examples/index.html @@ -1,22 +1,22 @@ - - - - - -Driver example applications - - - -

Example Applications for the driver ycrcb2rgb_v7_0

-
- - -

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

- - - - + + + + + +Driver example applications + + + +

Example Applications for the driver ycrcb2rgb_v7_0

+
+ + +

Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.

+ + + + diff --git a/XilinxProcessorIPLib/drivers/ycrcb2rgb/src/Makefile b/XilinxProcessorIPLib/drivers/ycrcb2rgb/src/Makefile index 69a9a6d3..7dbc6d92 100644 --- a/XilinxProcessorIPLib/drivers/ycrcb2rgb/src/Makefile +++ b/XilinxProcessorIPLib/drivers/ycrcb2rgb/src/Makefile @@ -1,29 +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 ycrcb2rgb" - $(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES) - $(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS} - make clean - -include: - ${CP} $(INCLUDEFILES) $(INCLUDEDIR) - -clean: - rm -rf ${OUTS} - +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 ycrcb2rgb" + $(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES) + $(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS} + make clean + +include: + ${CP} $(INCLUDEFILES) $(INCLUDEDIR) + +clean: + rm -rf ${OUTS} +