diff --git a/XilinxProcessorIPLib/drivers/osd/data/osd.mdd b/XilinxProcessorIPLib/drivers/osd/data/osd.mdd index 3ee93f7d..30fb3f42 100755 --- a/XilinxProcessorIPLib/drivers/osd/data/osd.mdd +++ b/XilinxProcessorIPLib/drivers/osd/data/osd.mdd @@ -1,9 +1,9 @@ -############################################################################### +############################################################################## # # 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 +# 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 @@ -28,22 +28,22 @@ # 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[456]_[0-9][0-9]_[a-z] v_osd_v[6]_[0-9]); + OPTION supported_peripherals = (v_osd_v[6-9]_[0-9]); OPTION driver_state = ACTIVE; OPTION copyfiles = all; OPTION NAME = osd; - - BEGIN ARRAY interrupt_handler - PROPERTY desc = "Interrupt Handler Information"; - PROPERTY size = 1, permit = none; - PARAM name = int_handler, default = XNullHandler, desc = "Name of Interrupt Handler", type = string; - PARAM name = int_port, default = irq, desc = "Interrupt pin associated with the interrupt handler", permit = none; - END ARRAY END driver diff --git a/XilinxProcessorIPLib/drivers/osd/data/osd.tcl b/XilinxProcessorIPLib/drivers/osd/data/osd.tcl index b70b8d62..cc1d1b63 100755 --- a/XilinxProcessorIPLib/drivers/osd/data/osd.tcl +++ b/XilinxProcessorIPLib/drivers/osd/data/osd.tcl @@ -1,125 +1,37 @@ -############################################################### -# (c) Copyright 2008-2014 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. +# Copyright (C) 2008 - 2014 Xilinx, Inc. All rights reserved. # -# 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. +# 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: # -# 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. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -# PART OF THIS FILE AT ALL TIMES. -# MODIFICATION HISTORY: -# Ver Who Date Changes -# -------- ------ -------- ------------------------------------ -# 3.0 adk 12/10/13 Updated as per the New Tcl API's -############################################################### +# Use of the Software is limited solely to applications: +# (a) running on a Xilinx device, or +# (b) that interact with a Xilinx device through a bus or interconnect. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Except as contained in this notice, the name of the Xilinx shall not be used +# in advertising or otherwise to promote the sale, use or other dealings in +# this Software without prior written authorization from Xilinx. +############################################################################### +#uses "xillib.tcl" proc generate {drv_handle} { xdefine_include_file $drv_handle "xparameters.h" "XOSD" "NUM_INSTANCES" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_NUM_LAYERS" "C_S_AXIS_VIDEO_DATA_WIDTH" "C_LAYER0_TYPE" "C_LAYER1_TYPE" "C_LAYER2_TYPE" "C_LAYER3_TYPE" "C_LAYER4_TYPE" "C_LAYER5_TYPE" "C_LAYER6_TYPE" "C_LAYER7_TYPE" "C_LAYER0_IMEM_SIZE" "C_LAYER0_INS_BOX_EN" "C_LAYER0_INS_LINE_EN" "C_LAYER0_INS_TEXT_EN" "C_LAYER0_CLUT_SIZE" "C_LAYER0_CLUT_MEMTYPE" "C_LAYER0_FONT_NUM_CHARS" "C_LAYER0_FONT_WIDTH" "C_LAYER0_FONT_HEIGHT" "C_LAYER0_FONT_BPP" "C_LAYER0_FONT_ASCII_OFFSET" "C_LAYER0_TEXT_NUM_STRINGS" "C_LAYER0_TEXT_MAX_STRING_LENGTH" "C_LAYER1_IMEM_SIZE" "C_LAYER1_INS_BOX_EN" "C_LAYER1_INS_LINE_EN" "C_LAYER1_INS_TEXT_EN" "C_LAYER1_CLUT_SIZE" "C_LAYER1_CLUT_MEMTYPE" "C_LAYER1_FONT_NUM_CHARS" "C_LAYER1_FONT_WIDTH" "C_LAYER1_FONT_HEIGHT" "C_LAYER1_FONT_BPP" "C_LAYER1_FONT_ASCII_OFFSET" "C_LAYER1_TEXT_NUM_STRINGS" "C_LAYER1_TEXT_MAX_STRING_LENGTH" "C_LAYER2_IMEM_SIZE" "C_LAYER2_INS_BOX_EN" "C_LAYER2_INS_LINE_EN" "C_LAYER2_INS_TEXT_EN" "C_LAYER2_CLUT_SIZE" "C_LAYER2_CLUT_MEMTYPE" "C_LAYER2_FONT_NUM_CHARS" "C_LAYER2_FONT_WIDTH" "C_LAYER2_FONT_HEIGHT" "C_LAYER2_FONT_BPP" "C_LAYER2_FONT_ASCII_OFFSET" "C_LAYER2_TEXT_NUM_STRINGS" "C_LAYER2_TEXT_MAX_STRING_LENGTH" "C_LAYER3_IMEM_SIZE" "C_LAYER3_INS_BOX_EN" "C_LAYER3_INS_LINE_EN" "C_LAYER3_INS_TEXT_EN" "C_LAYER3_CLUT_SIZE" "C_LAYER3_CLUT_MEMTYPE" "C_LAYER3_FONT_NUM_CHARS" "C_LAYER3_FONT_WIDTH" "C_LAYER3_FONT_HEIGHT" "C_LAYER3_FONT_BPP" "C_LAYER3_FONT_ASCII_OFFSET" "C_LAYER3_TEXT_NUM_STRINGS" "C_LAYER3_TEXT_MAX_STRING_LENGTH" "C_LAYER4_IMEM_SIZE" "C_LAYER4_INS_BOX_EN" "C_LAYER4_INS_LINE_EN" "C_LAYER4_INS_TEXT_EN" "C_LAYER4_CLUT_SIZE" "C_LAYER4_CLUT_MEMTYPE" "C_LAYER4_FONT_NUM_CHARS" "C_LAYER4_FONT_WIDTH" "C_LAYER4_FONT_HEIGHT" "C_LAYER4_FONT_BPP" "C_LAYER4_FONT_ASCII_OFFSET" "C_LAYER4_TEXT_NUM_STRINGS" "C_LAYER4_TEXT_MAX_STRING_LENGTH" "C_LAYER5_IMEM_SIZE" "C_LAYER5_INS_BOX_EN" "C_LAYER5_INS_LINE_EN" "C_LAYER5_INS_TEXT_EN" "C_LAYER5_CLUT_SIZE" "C_LAYER5_CLUT_MEMTYPE" "C_LAYER5_FONT_NUM_CHARS" "C_LAYER5_FONT_WIDTH" "C_LAYER5_FONT_HEIGHT" "C_LAYER5_FONT_BPP" "C_LAYER5_FONT_ASCII_OFFSET" "C_LAYER5_TEXT_NUM_STRINGS" "C_LAYER5_TEXT_MAX_STRING_LENGTH" "C_LAYER6_IMEM_SIZE" "C_LAYER6_INS_BOX_EN" "C_LAYER6_INS_LINE_EN" "C_LAYER6_INS_TEXT_EN" "C_LAYER6_CLUT_SIZE" "C_LAYER6_CLUT_MEMTYPE" "C_LAYER6_FONT_NUM_CHARS" "C_LAYER6_FONT_WIDTH" "C_LAYER6_FONT_HEIGHT" "C_LAYER6_FONT_BPP" "C_LAYER6_FONT_ASCII_OFFSET" "C_LAYER6_TEXT_NUM_STRINGS" "C_LAYER6_TEXT_MAX_STRING_LENGTH" "C_LAYER7_IMEM_SIZE" "C_LAYER7_INS_BOX_EN" "C_LAYER7_INS_LINE_EN" "C_LAYER7_INS_TEXT_EN" "C_LAYER7_CLUT_SIZE" "C_LAYER7_CLUT_MEMTYPE" "C_LAYER7_FONT_NUM_CHARS" "C_LAYER7_FONT_WIDTH" "C_LAYER7_FONT_HEIGHT" "C_LAYER7_FONT_BPP" "C_LAYER7_FONT_ASCII_OFFSET" "C_LAYER7_TEXT_NUM_STRINGS" "C_LAYER7_TEXT_MAX_STRING_LENGTH" - xdefine_config_file $drv_handle "xosd_g.c" "XOSD" "DEVICE_ID" "C_BASEADDR" "C_NUM_LAYERS" "C_S_AXIS_VIDEO_DATA_WIDTH" "C_LAYER0_TYPE" "C_LAYER1_TYPE" "C_LAYER2_TYPE" "C_LAYER3_TYPE" "C_LAYER4_TYPE" "C_LAYER5_TYPE" "C_LAYER6_TYPE" "C_LAYER7_TYPE" "C_LAYER0_IMEM_SIZE" "C_LAYER0_INS_BOX_EN" "C_LAYER0_INS_LINE_EN" "C_LAYER0_INS_TEXT_EN" "C_LAYER0_CLUT_SIZE" "C_LAYER0_CLUT_MEMTYPE" "C_LAYER0_FONT_NUM_CHARS" "C_LAYER0_FONT_WIDTH" "C_LAYER0_FONT_HEIGHT" "C_LAYER0_FONT_BPP" "C_LAYER0_FONT_ASCII_OFFSET" "C_LAYER0_TEXT_NUM_STRINGS" "C_LAYER0_TEXT_MAX_STRING_LENGTH" "C_LAYER1_IMEM_SIZE" "C_LAYER1_INS_BOX_EN" "C_LAYER1_INS_LINE_EN" "C_LAYER1_INS_TEXT_EN" "C_LAYER1_CLUT_SIZE" "C_LAYER1_CLUT_MEMTYPE" "C_LAYER1_FONT_NUM_CHARS" "C_LAYER1_FONT_WIDTH" "C_LAYER1_FONT_HEIGHT" "C_LAYER1_FONT_BPP" "C_LAYER1_FONT_ASCII_OFFSET" "C_LAYER1_TEXT_NUM_STRINGS" "C_LAYER1_TEXT_MAX_STRING_LENGTH" "C_LAYER2_IMEM_SIZE" "C_LAYER2_INS_BOX_EN" "C_LAYER2_INS_LINE_EN" "C_LAYER2_INS_TEXT_EN" "C_LAYER2_CLUT_SIZE" "C_LAYER2_CLUT_MEMTYPE" "C_LAYER2_FONT_NUM_CHARS" "C_LAYER2_FONT_WIDTH" "C_LAYER2_FONT_HEIGHT" "C_LAYER2_FONT_BPP" "C_LAYER2_FONT_ASCII_OFFSET" "C_LAYER2_TEXT_NUM_STRINGS" "C_LAYER2_TEXT_MAX_STRING_LENGTH" "C_LAYER3_IMEM_SIZE" "C_LAYER3_INS_BOX_EN" "C_LAYER3_INS_LINE_EN" "C_LAYER3_INS_TEXT_EN" "C_LAYER3_CLUT_SIZE" "C_LAYER3_CLUT_MEMTYPE" "C_LAYER3_FONT_NUM_CHARS" "C_LAYER3_FONT_WIDTH" "C_LAYER3_FONT_HEIGHT" "C_LAYER3_FONT_BPP" "C_LAYER3_FONT_ASCII_OFFSET" "C_LAYER3_TEXT_NUM_STRINGS" "C_LAYER3_TEXT_MAX_STRING_LENGTH" "C_LAYER4_IMEM_SIZE" "C_LAYER4_INS_BOX_EN" "C_LAYER4_INS_LINE_EN" "C_LAYER4_INS_TEXT_EN" "C_LAYER4_CLUT_SIZE" "C_LAYER4_CLUT_MEMTYPE" "C_LAYER4_FONT_NUM_CHARS" "C_LAYER4_FONT_WIDTH" "C_LAYER4_FONT_HEIGHT" "C_LAYER4_FONT_BPP" "C_LAYER4_FONT_ASCII_OFFSET" "C_LAYER4_TEXT_NUM_STRINGS" "C_LAYER4_TEXT_MAX_STRING_LENGTH" "C_LAYER5_IMEM_SIZE" "C_LAYER5_INS_BOX_EN" "C_LAYER5_INS_LINE_EN" "C_LAYER5_INS_TEXT_EN" "C_LAYER5_CLUT_SIZE" "C_LAYER5_CLUT_MEMTYPE" "C_LAYER5_FONT_NUM_CHARS" "C_LAYER5_FONT_WIDTH" "C_LAYER5_FONT_HEIGHT" "C_LAYER5_FONT_BPP" "C_LAYER5_FONT_ASCII_OFFSET" "C_LAYER5_TEXT_NUM_STRINGS" "C_LAYER5_TEXT_MAX_STRING_LENGTH" "C_LAYER6_IMEM_SIZE" "C_LAYER6_INS_BOX_EN" "C_LAYER6_INS_LINE_EN" "C_LAYER6_INS_TEXT_EN" "C_LAYER6_CLUT_SIZE" "C_LAYER6_CLUT_MEMTYPE" "C_LAYER6_FONT_NUM_CHARS" "C_LAYER6_FONT_WIDTH" "C_LAYER6_FONT_HEIGHT" "C_LAYER6_FONT_BPP" "C_LAYER6_FONT_ASCII_OFFSET" "C_LAYER6_TEXT_NUM_STRINGS" "C_LAYER6_TEXT_MAX_STRING_LENGTH" "C_LAYER7_IMEM_SIZE" "C_LAYER7_INS_BOX_EN" "C_LAYER7_INS_LINE_EN" "C_LAYER7_INS_TEXT_EN" "C_LAYER7_CLUT_SIZE" "C_LAYER7_CLUT_MEMTYPE" "C_LAYER7_FONT_NUM_CHARS" "C_LAYER7_FONT_WIDTH" "C_LAYER7_FONT_HEIGHT" "C_LAYER7_FONT_BPP" "C_LAYER7_FONT_ASCII_OFFSET" "C_LAYER7_TEXT_NUM_STRINGS" "C_LAYER7_TEXT_MAX_STRING_LENGTH" + xdefine_config_file $drv_handle "xosd_g.c" "XOsd" "DEVICE_ID" "C_BASEADDR" "C_NUM_LAYERS" "C_S_AXIS_VIDEO_DATA_WIDTH" "C_LAYER0_TYPE" "C_LAYER1_TYPE" "C_LAYER2_TYPE" "C_LAYER3_TYPE" "C_LAYER4_TYPE" "C_LAYER5_TYPE" "C_LAYER6_TYPE" "C_LAYER7_TYPE" "C_LAYER0_IMEM_SIZE" "C_LAYER0_INS_BOX_EN" "C_LAYER0_INS_LINE_EN" "C_LAYER0_INS_TEXT_EN" "C_LAYER0_CLUT_SIZE" "C_LAYER0_CLUT_MEMTYPE" "C_LAYER0_FONT_NUM_CHARS" "C_LAYER0_FONT_WIDTH" "C_LAYER0_FONT_HEIGHT" "C_LAYER0_FONT_BPP" "C_LAYER0_FONT_ASCII_OFFSET" "C_LAYER0_TEXT_NUM_STRINGS" "C_LAYER0_TEXT_MAX_STRING_LENGTH" "C_LAYER1_IMEM_SIZE" "C_LAYER1_INS_BOX_EN" "C_LAYER1_INS_LINE_EN" "C_LAYER1_INS_TEXT_EN" "C_LAYER1_CLUT_SIZE" "C_LAYER1_CLUT_MEMTYPE" "C_LAYER1_FONT_NUM_CHARS" "C_LAYER1_FONT_WIDTH" "C_LAYER1_FONT_HEIGHT" "C_LAYER1_FONT_BPP" "C_LAYER1_FONT_ASCII_OFFSET" "C_LAYER1_TEXT_NUM_STRINGS" "C_LAYER1_TEXT_MAX_STRING_LENGTH" "C_LAYER2_IMEM_SIZE" "C_LAYER2_INS_BOX_EN" "C_LAYER2_INS_LINE_EN" "C_LAYER2_INS_TEXT_EN" "C_LAYER2_CLUT_SIZE" "C_LAYER2_CLUT_MEMTYPE" "C_LAYER2_FONT_NUM_CHARS" "C_LAYER2_FONT_WIDTH" "C_LAYER2_FONT_HEIGHT" "C_LAYER2_FONT_BPP" "C_LAYER2_FONT_ASCII_OFFSET" "C_LAYER2_TEXT_NUM_STRINGS" "C_LAYER2_TEXT_MAX_STRING_LENGTH" "C_LAYER3_IMEM_SIZE" "C_LAYER3_INS_BOX_EN" "C_LAYER3_INS_LINE_EN" "C_LAYER3_INS_TEXT_EN" "C_LAYER3_CLUT_SIZE" "C_LAYER3_CLUT_MEMTYPE" "C_LAYER3_FONT_NUM_CHARS" "C_LAYER3_FONT_WIDTH" "C_LAYER3_FONT_HEIGHT" "C_LAYER3_FONT_BPP" "C_LAYER3_FONT_ASCII_OFFSET" "C_LAYER3_TEXT_NUM_STRINGS" "C_LAYER3_TEXT_MAX_STRING_LENGTH" "C_LAYER4_IMEM_SIZE" "C_LAYER4_INS_BOX_EN" "C_LAYER4_INS_LINE_EN" "C_LAYER4_INS_TEXT_EN" "C_LAYER4_CLUT_SIZE" "C_LAYER4_CLUT_MEMTYPE" "C_LAYER4_FONT_NUM_CHARS" "C_LAYER4_FONT_WIDTH" "C_LAYER4_FONT_HEIGHT" "C_LAYER4_FONT_BPP" "C_LAYER4_FONT_ASCII_OFFSET" "C_LAYER4_TEXT_NUM_STRINGS" "C_LAYER4_TEXT_MAX_STRING_LENGTH" "C_LAYER5_IMEM_SIZE" "C_LAYER5_INS_BOX_EN" "C_LAYER5_INS_LINE_EN" "C_LAYER5_INS_TEXT_EN" "C_LAYER5_CLUT_SIZE" "C_LAYER5_CLUT_MEMTYPE" "C_LAYER5_FONT_NUM_CHARS" "C_LAYER5_FONT_WIDTH" "C_LAYER5_FONT_HEIGHT" "C_LAYER5_FONT_BPP" "C_LAYER5_FONT_ASCII_OFFSET" "C_LAYER5_TEXT_NUM_STRINGS" "C_LAYER5_TEXT_MAX_STRING_LENGTH" "C_LAYER6_IMEM_SIZE" "C_LAYER6_INS_BOX_EN" "C_LAYER6_INS_LINE_EN" "C_LAYER6_INS_TEXT_EN" "C_LAYER6_CLUT_SIZE" "C_LAYER6_CLUT_MEMTYPE" "C_LAYER6_FONT_NUM_CHARS" "C_LAYER6_FONT_WIDTH" "C_LAYER6_FONT_HEIGHT" "C_LAYER6_FONT_BPP" "C_LAYER6_FONT_ASCII_OFFSET" "C_LAYER6_TEXT_NUM_STRINGS" "C_LAYER6_TEXT_MAX_STRING_LENGTH" "C_LAYER7_IMEM_SIZE" "C_LAYER7_INS_BOX_EN" "C_LAYER7_INS_LINE_EN" "C_LAYER7_INS_TEXT_EN" "C_LAYER7_CLUT_SIZE" "C_LAYER7_CLUT_MEMTYPE" "C_LAYER7_FONT_NUM_CHARS" "C_LAYER7_FONT_WIDTH" "C_LAYER7_FONT_HEIGHT" "C_LAYER7_FONT_BPP" "C_LAYER7_FONT_ASCII_OFFSET" "C_LAYER7_TEXT_NUM_STRINGS" "C_LAYER7_TEXT_MAX_STRING_LENGTH" xdefine_canonical_xpars $drv_handle "xparameters.h" "OSD" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_NUM_LAYERS" "C_LAYER0_TYPE" "C_LAYER1_TYPE" "C_LAYER2_TYPE" "C_LAYER3_TYPE" "C_LAYER4_TYPE" "C_LAYER5_TYPE" "C_LAYER6_TYPE" "C_LAYER7_TYPE" "C_LAYER0_IMEM_SIZE" "C_LAYER0_INS_BOX_EN" "C_LAYER0_INS_LINE_EN" "C_LAYER0_INS_TEXT_EN" "C_LAYER0_CLUT_SIZE" "C_LAYER0_CLUT_MEMTYPE" "C_LAYER0_FONT_NUM_CHARS" "C_LAYER0_FONT_WIDTH" "C_LAYER0_FONT_HEIGHT" "C_LAYER0_FONT_BPP" "C_LAYER0_FONT_ASCII_OFFSET" "C_LAYER0_TEXT_NUM_STRINGS" "C_LAYER0_TEXT_MAX_STRING_LENGTH" "C_LAYER1_IMEM_SIZE" "C_LAYER1_INS_BOX_EN" "C_LAYER1_INS_LINE_EN" "C_LAYER1_INS_TEXT_EN" "C_LAYER1_CLUT_SIZE" "C_LAYER1_CLUT_MEMTYPE" "C_LAYER1_FONT_NUM_CHARS" "C_LAYER1_FONT_WIDTH" "C_LAYER1_FONT_HEIGHT" "C_LAYER1_FONT_BPP" "C_LAYER1_FONT_ASCII_OFFSET" "C_LAYER1_TEXT_NUM_STRINGS" "C_LAYER1_TEXT_MAX_STRING_LENGTH" "C_LAYER2_IMEM_SIZE" "C_LAYER2_INS_BOX_EN" "C_LAYER2_INS_LINE_EN" "C_LAYER2_INS_TEXT_EN" "C_LAYER2_CLUT_SIZE" "C_LAYER2_CLUT_MEMTYPE" "C_LAYER2_FONT_NUM_CHARS" "C_LAYER2_FONT_WIDTH" "C_LAYER2_FONT_HEIGHT" "C_LAYER2_FONT_BPP" "C_LAYER2_FONT_ASCII_OFFSET" "C_LAYER2_TEXT_NUM_STRINGS" "C_LAYER2_TEXT_MAX_STRING_LENGTH" "C_LAYER3_IMEM_SIZE" "C_LAYER3_INS_BOX_EN" "C_LAYER3_INS_LINE_EN" "C_LAYER3_INS_TEXT_EN" "C_LAYER3_CLUT_SIZE" "C_LAYER3_CLUT_MEMTYPE" "C_LAYER3_FONT_NUM_CHARS" "C_LAYER3_FONT_WIDTH" "C_LAYER3_FONT_HEIGHT" "C_LAYER3_FONT_BPP" "C_LAYER3_FONT_ASCII_OFFSET" "C_LAYER3_TEXT_NUM_STRINGS" "C_LAYER3_TEXT_MAX_STRING_LENGTH" "C_LAYER4_IMEM_SIZE" "C_LAYER4_INS_BOX_EN" "C_LAYER4_INS_LINE_EN" "C_LAYER4_INS_TEXT_EN" "C_LAYER4_CLUT_SIZE" "C_LAYER4_CLUT_MEMTYPE" "C_LAYER4_FONT_NUM_CHARS" "C_LAYER4_FONT_WIDTH" "C_LAYER4_FONT_HEIGHT" "C_LAYER4_FONT_BPP" "C_LAYER4_FONT_ASCII_OFFSET" "C_LAYER4_TEXT_NUM_STRINGS" "C_LAYER4_TEXT_MAX_STRING_LENGTH" "C_LAYER5_IMEM_SIZE" "C_LAYER5_INS_BOX_EN" "C_LAYER5_INS_LINE_EN" "C_LAYER5_INS_TEXT_EN" "C_LAYER5_CLUT_SIZE" "C_LAYER5_CLUT_MEMTYPE" "C_LAYER5_FONT_NUM_CHARS" "C_LAYER5_FONT_WIDTH" "C_LAYER5_FONT_HEIGHT" "C_LAYER5_FONT_BPP" "C_LAYER5_FONT_ASCII_OFFSET" "C_LAYER5_TEXT_NUM_STRINGS" "C_LAYER5_TEXT_MAX_STRING_LENGTH" "C_LAYER6_IMEM_SIZE" "C_LAYER6_INS_BOX_EN" "C_LAYER6_INS_LINE_EN" "C_LAYER6_INS_TEXT_EN" "C_LAYER6_CLUT_SIZE" "C_LAYER6_CLUT_MEMTYPE" "C_LAYER6_FONT_NUM_CHARS" "C_LAYER6_FONT_WIDTH" "C_LAYER6_FONT_HEIGHT" "C_LAYER6_FONT_BPP" "C_LAYER6_FONT_ASCII_OFFSET" "C_LAYER6_TEXT_NUM_STRINGS" "C_LAYER6_TEXT_MAX_STRING_LENGTH" "C_LAYER7_IMEM_SIZE" "C_LAYER7_INS_BOX_EN" "C_LAYER7_INS_LINE_EN" "C_LAYER7_INS_TEXT_EN" "C_LAYER7_CLUT_SIZE" "C_LAYER7_CLUT_MEMTYPE" "C_LAYER7_FONT_NUM_CHARS" "C_LAYER7_FONT_WIDTH" "C_LAYER7_FONT_HEIGHT" "C_LAYER7_FONT_BPP" "C_LAYER7_FONT_ASCII_OFFSET" "C_LAYER7_TEXT_NUM_STRINGS" "C_LAYER7_TEXT_MAX_STRING_LENGTH" } - - -# -# Given a list of arguments, define each as a canonical constant name, using -# the driver name, in an include file. -# -proc xdefine_canonical_xpars {drv_handle file_name drv_string args} { - # Open include file - set file_handle [::hsm::utils::open_include_file $file_name] - - # Get all the peripherals connected to this driver - set periphs [::hsm::utils::get_common_driver_ips $drv_handle] - - # Get the names of all the peripherals connected to this driver - foreach periph $periphs { - set peripheral_name [string toupper [get_property NAME $periph]] - lappend peripherals $peripheral_name - } - - # Get possible canonical names for all the peripherals connected to this driver - set device_id 0 - foreach periph $periphs { - set canonical_name [string toupper [format "%s_%s" $drv_string $device_id]] - lappend canonicals $canonical_name - - # Create a list of IDs of the peripherals whose hardware instance name - # doesn't match the canonical name. These IDs can be used later to - # generate canonical definitions - if { [lsearch $peripherals $canonical_name] < 0 } { - lappend indices $device_id - } - incr device_id - } - - set i 0 - foreach periph $periphs { - set periph_name [string toupper [get_property NAME $periph]] - - # Generate canonical definitions only for the peripherals whose - # canonical name is not the same as hardware instance name - if { [lsearch $canonicals $periph_name] < 0 } { - puts $file_handle "/* Canonical definitions for peripheral $periph_name */" - set canonical_name [format "%s_%s" $drv_string [lindex $indices $i]] - - foreach arg $args { - set lvalue [::hsm::utils::get_driver_param_name $canonical_name $arg] - - # The commented out rvalue is the name of the instance-specific constant - # set rvalue [::hsm::utils::get_ip_param_name $periph $arg] - - # The rvalue set below is the actual value of the parameter - set rvalue [get_property CONFIG.$arg $periph] - if {[llength $rvalue] == 0} { - set rvalue 0 - } - set rvalue [::hsm::utils::format_addr_string $rvalue $arg] - - puts $file_handle "#define $lvalue $rvalue" - - } - puts $file_handle "" - incr i - } - } - - puts $file_handle "\n/******************************************************************/\n" - close $file_handle -} diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/annotated.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/annotated.html new file mode 100644 index 00000000..d6053cbb --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/annotated.html @@ -0,0 +1,29 @@ + +
+ +XOsd | |
XOsd_Config | |
XOsd_Layer |
xosd.c | |
xosd.h | |
xosd_g.c | |
xosd_hw.h | |
xosd_intr.c | |
xosd_selftest.c | |
xosd_sinit.c |
+Here is a list of all class members with links to the classes they belong to: +
+
+ +
+
+Here is a list of all file members with links to the files they belong to: +
+
+ +
+
+
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/globals_func.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/globals_func.html new file mode 100644 index 00000000..1b2df95a --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/globals_func.html @@ -0,0 +1,62 @@ + + + ++
+
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/globals_vars.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/globals_vars.html new file mode 100644 index 00000000..3ef28235 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/globals_vars.html @@ -0,0 +1,39 @@ + + + ++
+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:
+
+For a full description of OSD features, please see the hardware spec.
+Interrupt Service
+Three interrupt types are supported:
+
+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. +Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/struct_x_osd-members.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/struct_x_osd-members.html new file mode 100644 index 00000000..27f24770 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/struct_x_osd-members.html @@ -0,0 +1,37 @@ + + + +
#include <xosd.h>
++
Public Attributes | |
XOsd_Config | Config |
u32 | IsReady |
u32 | InstructionInExternalMem |
u32 | ScreenHeight |
u32 | ScreenWidth |
XOsd_Layer | Layers [(XOSD_MAX_NUM_OF_LAYERS)] |
XOsd_CallBack | ProcStartCallBack |
void * | ProcStartRef |
XOsd_CallBack | FrameDoneCallBack |
void * | FrameDoneRef |
XOsd_ErrorCallBack | ErrCallBack |
void * | ErrRef |
XOsd_Config XOsd::Config | +
+Hardware configuration +
XOsd_ErrorCallBack XOsd::ErrCallBack | +
+Call back for Error interrupt +
void* XOsd::ErrRef | +
+To be passed to the Error interrupt callback +
XOsd_CallBack XOsd::FrameDoneCallBack | +
+Call back for Frame Done interrupt +
void* XOsd::FrameDoneRef | +
+To be passed to the Frame Done interrupt callback +
u32 XOsd::InstructionInExternalMem | +
+Flag indicating if the instruction list is from external memory +
u32 XOsd::IsReady | +
+Core instance is initialized +
XOsd_Layer XOsd::Layers[(XOSD_MAX_NUM_OF_LAYERS)] | +
+Properties of layers +
XOsd_CallBack XOsd::ProcStartCallBack | +
+Call back for Processing Start interrupt +
void* XOsd::ProcStartRef | +
+To be passed to the Process Start interrupt callback +
u32 XOsd::ScreenHeight | +
+Screen Height of the OSD output +
u32 XOsd::ScreenWidth | +
+Screen Width of the OSD output +
+
#include <xosd.h>
++
u32 XOsd_Config::BaseAddress | +
+BaseAddress is the physical base address of the OSD core registers +
u16 XOsd_Config::DeviceId | +
+DeviceId is the unique ID of the core +
u16 XOsd_Config::Layer0ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Config::Layer0ColorLutSize | +
+Color Look Up Table (LUT) Size +
u16 XOsd_Config::Layer0FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Config::Layer0FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Config::Layer0FontHeight | +
+Font: Height +
u16 XOsd_Config::Layer0FontNumChars | +
+Font: Number of characters +
u16 XOsd_Config::Layer0FontWidth | +
+Font: Width +
u16 XOsd_Config::Layer0InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Config::Layer0InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Config::Layer0InstructionMemSize | +
+Instruction Memory Size +
u16 XOsd_Config::Layer0InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Config::Layer0TextMaxStringLength | +
+Text: Maximum length of a String Layer 1 +
u16 XOsd_Config::Layer0TextNumStrings | +
+Text: Number of Strings +
u16 XOsd_Config::Layer0Type | +
+Type of Layer #0 +
u16 XOsd_Config::Layer1ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Config::Layer1ColorLutSize | +
+Color LUT Size +
u16 XOsd_Config::Layer1FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Config::Layer1FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Config::Layer1FontHeight | +
+Font: Height +
u16 XOsd_Config::Layer1FontNumChars | +
+Font: Number of characters +
u16 XOsd_Config::Layer1FontWidth | +
+Font: Width +
u16 XOsd_Config::Layer1InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Config::Layer1InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Config::Layer1InstructionMemSize | +
+Instruction Memory Size +
u16 XOsd_Config::Layer1InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Config::Layer1TextMaxStringLength | +
+Text: Maximum length of a String Layer 2 +
u16 XOsd_Config::Layer1TextNumStrings | +
+Text: Number of Strings +
u16 XOsd_Config::Layer1Type | +
+Type of Layer #1 +
u16 XOsd_Config::Layer2ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Config::Layer2ColorLutSize | +
+Color LUT Size +
u16 XOsd_Config::Layer2FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Config::Layer2FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Config::Layer2FontHeight | +
+Font: Height +
u16 XOsd_Config::Layer2FontNumChars | +
+Font: Number of characters +
u16 XOsd_Config::Layer2FontWidth | +
+Font: Width +
u16 XOsd_Config::Layer2InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Config::Layer2InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Config::Layer2InstructionMemSize | +
+Instruction Memory Size +
u16 XOsd_Config::Layer2InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Config::Layer2TextMaxStringLength | +
+Text: Maximum length of a String Layer 3 +
u16 XOsd_Config::Layer2TextNumStrings | +
+Text: Number of Strings +
u16 XOsd_Config::Layer2Type | +
+Type of Layer #2 +
u16 XOsd_Config::Layer3ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Config::Layer3ColorLutSize | +
+Color LUT Size +
u16 XOsd_Config::Layer3FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Config::Layer3FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Config::Layer3FontHeight | +
+Font: Height +
u16 XOsd_Config::Layer3FontNumChars | +
+Font: Number of characters +
u16 XOsd_Config::Layer3FontWidth | +
+Font: Width +
u16 XOsd_Config::Layer3InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Config::Layer3InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Config::Layer3InstructionMemSize | +
+Instruction Memory Size +
u16 XOsd_Config::Layer3InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Config::Layer3TextMaxStringLength | +
+Text: Maximum length of a String Layer 4 +
u16 XOsd_Config::Layer3TextNumStrings | +
+Text: Number of Strings +
u16 XOsd_Config::Layer3Type | +
+Type of Layer #3 +
u16 XOsd_Config::Layer4ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Config::Layer4ColorLutSize | +
+Color LUT Size +
u16 XOsd_Config::Layer4FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Config::Layer4FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Config::Layer4FontHeight | +
+Font: Height +
u16 XOsd_Config::Layer4FontNumChars | +
+Font: Number of characters +
u16 XOsd_Config::Layer4FontWidth | +
+Font: Width +
u16 XOsd_Config::Layer4InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Config::Layer4InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Config::Layer4InstructionMemSize | +
+Instruction Memory Size +
u16 XOsd_Config::Layer4InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Config::Layer4TextMaxStringLength | +
+Text: Maximum length of a String Layer 5 +
u16 XOsd_Config::Layer4TextNumStrings | +
+Text: Number of Strings +
u16 XOsd_Config::Layer4Type | +
+Type of Layer #4 +
u16 XOsd_Config::Layer5ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Config::Layer5ColorLutSize | +
+Color LUT Size +
u16 XOsd_Config::Layer5FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Config::Layer5FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Config::Layer5FontHeight | +
+Font: Height +
u16 XOsd_Config::Layer5FontNumChars | +
+Font: Number of characters +
u16 XOsd_Config::Layer5FontWidth | +
+Font: Width +
u16 XOsd_Config::Layer5InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Config::Layer5InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Config::Layer5InstructionMemSize | +
+Instruction Memory Size +
u16 XOsd_Config::Layer5InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Config::Layer5TextMaxStringLength | +
+Text: Maximum length of a String Layer 6 +
u16 XOsd_Config::Layer5TextNumStrings | +
+Text: Number of Strings +
u16 XOsd_Config::Layer5Type | +
+Type of Layer #5 +
u16 XOsd_Config::Layer6ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Config::Layer6ColorLutSize | +
+Color LUT Size +
u16 XOsd_Config::Layer6FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Config::Layer6FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Config::Layer6FontHeight | +
+Font: Height +
u16 XOsd_Config::Layer6FontNumChars | +
+Font: Number of characters +
u16 XOsd_Config::Layer6FontWidth | +
+Font: Width +
u16 XOsd_Config::Layer6InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Config::Layer6InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Config::Layer6InstructionMemSize | +
+Instruction Memory Size +
u16 XOsd_Config::Layer6InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Config::Layer6TextMaxStringLength | +
+Text: Maximum length of a String Layer 7 +
u16 XOsd_Config::Layer6TextNumStrings | +
+Text: Number of Strings +
u16 XOsd_Config::Layer6Type | +
+Type of Layer #6 +
u16 XOsd_Config::Layer7ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Config::Layer7ColorLutSize | +
+Color LUT Size +
u16 XOsd_Config::Layer7FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Config::Layer7FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Config::Layer7FontHeight | +
+Font: Height +
u16 XOsd_Config::Layer7FontNumChars | +
+Font: Number of characters +
u16 XOsd_Config::Layer7FontWidth | +
+Font: Width +
u16 XOsd_Config::Layer7InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Config::Layer7InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Config::Layer7InstructionMemSize | +
+Instruction Memory Size +
u16 XOsd_Config::Layer7InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Config::Layer7TextMaxStringLength | +
+Text: Maximum length of a String +
u16 XOsd_Config::Layer7TextNumStrings | +
+Text: Number of Strings +
u16 XOsd_Config::Layer7Type | +
+Type of Layer #7 Layer 0 +
u16 XOsd_Config::LayerNum | +
+The number of Layers +
u16 XOsd_Config::SlaveAxisVideoDataWidth | +
+Slave Axis Video Data Width +
+
#include <xosd.h>
++
Public Attributes | |
u16 | LayerType |
u16 | InstructionNum |
u16 | InstructionBoxEnable |
u16 | InstructionLineEnable |
u16 | InstructionTextEnable |
u16 | ColorLutSize |
u16 | ColorLutMemoryType |
u16 | FontNumChars |
u16 | FontWidth |
u16 | FontHeight |
u16 | FontBitsPerPixel |
u16 | FontAsciiOffset |
u16 | TextNumStrings |
u16 | TextMaxStringLength |
u16 XOsd_Layer::ColorLutMemoryType | +
+Color LUT Memory Type +
u16 XOsd_Layer::ColorLutSize | +
+Color LUT Size +
u16 XOsd_Layer::FontAsciiOffset | +
+Font: ASCII offset of 1st character +
u16 XOsd_Layer::FontBitsPerPixel | +
+Font: Number of bits per pixel +
u16 XOsd_Layer::FontHeight | +
+Font: Height +
u16 XOsd_Layer::FontNumChars | +
+Font: Number of characters +
u16 XOsd_Layer::FontWidth | +
+Font: Width +
u16 XOsd_Layer::InstructionBoxEnable | +
+Instruction Box Enable +
u16 XOsd_Layer::InstructionLineEnable | +
+Instruction Line Enable +
u16 XOsd_Layer::InstructionNum | +
+The Number of Instructions +
u16 XOsd_Layer::InstructionTextEnable | +
+Instruction Text Enable +
u16 XOsd_Layer::LayerType | +
+Type of the layer +
u16 XOsd_Layer::TextMaxStringLength | +
+Text: Maximum length of a String +
u16 XOsd_Layer::TextNumStrings | +
+Text: Number of Strings +
+
+
+ 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 "xosd.h"
+
Functions | |
int | XOsd_CfgInitialize (XOsd *InstancePtr, XOsd_Config *CfgPtr, u32 EffectiveAddr) |
void | XOsd_SetActiveSize (XOsd *InstancePtr, u32 Width, u32 Height) |
void | XOsd_GetActiveSize (XOsd *InstancePtr, u32 *WidthPtr, u32 *HeightPtr) |
void | XOsd_SetBackgroundColor (XOsd *InstancePtr, u16 Red, u16 Blue, u16 Green) |
void | XOsd_GetBackgroundColor (XOsd *InstancePtr, u16 *RedPtr, u16 *BluePtr, u16 *GreenPtr) |
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) |
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) |
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) |
u32 | XOsd_GetVersion (XOsd *InstancePtr) |
int XOsd_CfgInitialize | +( | +XOsd * | +InstancePtr, | +|
+ | + | XOsd_Config * | +CfgPtr, | +|
+ | + | u32 | +EffectiveAddr | + |
+ | ) | ++ |
+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.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
CfgPtr | points to the configuration structure associated with the OSD core. | |
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. |
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 | + |
+ | ) | ++ |
+This function creates an instruction for the OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
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. | |
ObjType | indicates the type of object to draw. Use one of XOSD_INS_OPCODE_* constants defined in xosd_hw.h. | |
ObjSize | indicates line width of boxes and lines and the text scale factor for text boxes. | |
XStart | indicates the horizontal start pixel of the Object. | |
YStart | indicates the vertical start line of the Object. | |
XEnd | indicates the horizontal end pixel of the Object. | |
YEnd | indicates the vertical end line of the Object. | |
TextIndex | indicates the string index. | |
ColorIndex | indicates the color index. |
void XOsd_DisableLayer | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex | + |
+ | ) | ++ |
+This function disables an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). |
void XOsd_EnableLayer | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex | + |
+ | ) | ++ |
+This function enables an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). |
void XOsd_GetActiveSize | +( | +XOsd * | +InstancePtr, | +|
+ | + | u32 * | +WidthPtr, | +|
+ | + | u32 * | +HeightPtr | + |
+ | ) | ++ |
+This function gets the screen size of the OSD Output.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
WidthPtr | will point to the width of the OSD output after this function returns. | |
HeightPtr | will point to the height of the OSD output after this function returns. |
void XOsd_GetBackgroundColor | +( | +XOsd * | +InstancePtr, | +|
+ | + | u16 * | +RedPtr, | +|
+ | + | u16 * | +BluePtr, | +|
+ | + | u16 * | +GreenPtr | + |
+ | ) | ++ |
+This function gets the background color used by the OSD output.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
RedPtr | will point to the red value used in the background color after this function returns. | |
BluePtr | will point to the blue value used in the background color after this function returns. | |
GreenPtr | will point to the green value used in the background color after this function returns. |
void XOsd_GetLayerAlpha | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u16 * | +GlobalAlphaEnablePtr, | +|
+ | + | u16 * | +GlobalAlphaValuePtr | + |
+ | ) | ++ |
+This function gets the alpha value and mode of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
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. | |
GlobalAlphaValuePtr | will point to the transparent level after this function returns. 0 for 100% transparent, 255 (8bit) for 0% transparent (100% opaque). |
void XOsd_GetLayerDimension | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u16 * | +XStartPtr, | +|
+ | + | u16 * | +YStartPtr, | +|
+ | + | u16 * | +XSizePtr, | +|
+ | + | u16 * | +YSizePtr | + |
+ | ) | ++ |
+This function gets the start position and size of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
XStartPtr | will point to the horizontal start pixel value of origin of the layer after this function returns. | |
YStartPtr | will point to the vertical start line of origin of the layer after this function returns. | |
XSizePtr | will point to the horizontal size value of the layer after this function returns. | |
YSizePtr | will point to the vertical size value of the layer after this function returns. |
void XOsd_GetLayerPriority | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u8 * | +PriorityPtr | + |
+ | ) | ++ |
+This function gets the priority of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
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. |
u32 XOsd_GetVersion | +( | +XOsd * | +InstancePtr | +) | ++ |
+This function returns the Version of the OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
void XOsd_LoadCharacterSetBank | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +BankIndex, | +|
+ | + | u32 | +CharSetData[] | + |
+ | ) | ++ |
+This function loads character set data (font) into an OSD Graphics Controller bank.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
BankIndex | indicates which GC bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
CharSetData | points to the character set data to be loaded. |
void XOsd_LoadColorLUTBank | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +BankIndex, | +|
+ | + | u32 | +ColorData[] | + |
+ | ) | ++ |
+This function loads color look up table data into an OSD Graphics Controller bank.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
BankIndex | indicates which GC Bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
ColorData | points to the color LUT data to be loaded. |
void XOsd_LoadInstructionList | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +BankIndex, | +|
+ | + | u32 | +InstSetPtr[], | +|
+ | + | u32 | +InstNum | + |
+ | ) | ++ |
+This function load an instruction list to be used by an Graphic Controller in the OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
BankIndex | indicates which GC Bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM. | |
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. | |
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. |
void XOsd_LoadTextBank | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +BankIndex, | +|
+ | + | u32 | +TextData[] | + |
+ | ) | ++ |
+This function loads text data into an OSD Graphics Controller bank.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
BankIndex | indicates which GC bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
TextData | points to the text data to be loaded. |
void XOsd_SetActiveBank | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +ColorBankIndex, | +|
+ | + | u8 | +CharBankIndex, | +|
+ | + | u8 | +TextBankIndex, | +|
+ | + | u8 | +InstructionBankIndex | + |
+ | ) | ++ |
+This function chooses active banks for a GC in the OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
ColorBankIndex | indicates the color LUT bank to be choose as active. | |
CharBankIndex | indicates the character set bank to be chosen as active. | |
TextBankIndex | indicates the text data bank to be chosen as active. | |
InstructionBankIndex | indicates the instruction bank to be chosen as active. |
void XOsd_SetActiveSize | +( | +XOsd * | +InstancePtr, | +|
+ | + | u32 | +Width, | +|
+ | + | u32 | +Height | + |
+ | ) | ++ |
+This function sets the screen size of the OSD Output.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
Width | defines the width of the OSD output. | |
Height | defines the height of the OSD output. |
void XOsd_SetBackgroundColor | +( | +XOsd * | +InstancePtr, | +|
+ | + | u16 | +Red, | +|
+ | + | u16 | +Blue, | +|
+ | + | u16 | +Green | + |
+ | ) | ++ |
+This function sets the background color used by the OSD output.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
Red | indicates the red value to be used in the background color. | |
Blue | indicates the blue value to be used in the background color. | |
Green | indicates the green value to be used in the background color. |
void XOsd_SetLayerAlpha | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u16 | +GlobalAlphaEnable, | +|
+ | + | u16 | +GlobalAlphaValue | + |
+ | ) | ++ |
+This function sets the alpha value and mode of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
GlobalAlphaEnable | indicates whether to enable the global alpha. Use any non-0 value to enable the global alpha, and 0 to disable it. | |
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. |
void XOsd_SetLayerDimension | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u16 | +XStart, | +|
+ | + | u16 | +YStart, | +|
+ | + | u16 | +XSize, | +|
+ | + | u16 | +YSize | + |
+ | ) | ++ |
+This function sets the start position and size of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
XStart | indicates the horizontal start pixel of origin of the layer. | |
YStart | indicates the vertical start line of origin of the layer. | |
XSize | indicates the horizontal size of the layer. | |
YSize | indicates the vertical size of the layer. |
void XOsd_SetLayerPriority | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u8 | +Priority | + |
+ | ) | ++ |
+This function sets the priority of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
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. |
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd_8h.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd_8h.html new file mode 100644 index 00000000..ef776ddb --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd_8h.html @@ -0,0 +1,2487 @@ + +
+ +
+#include "xosd_hw.h"
+#include "xil_assert.h"
+#include "xstatus.h"
+
Classes | |
struct | XOsd_Config |
struct | XOsd_Layer |
struct | XOsd |
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 |
#define | XOSD_LoadInstructionList XOsd_LoadInstructionList |
#define | XOSD_LookupConfig XOsd_LookupConfig |
#define | XOSD_IntrHandler XOsd_IntrHandler |
#define | XOSD_SetCallBack XOsd_SetCallBack |
Interrupt types for setting up callbacks | |
enum | { XOSD_HANDLER_PROCSTART = 1, +XOSD_HANDLER_FRAMEDONE, +XOSD_HANDLER_ERROR + } |
Defines | |
#define | XOSD_H_ |
#define | XOsd_Enable(InstancePtr) |
#define | XOsd_Disable(InstancePtr) |
#define | XOsd_RegUpdateEnable(InstancePtr) |
#define | XOsd_RegUpdateDisable(InstancePtr) |
#define | XOsd_Reset(InstancePtr) |
#define | XOsd_IntrEnable(InstancePtr, IntrType) |
#define | XOsd_IntrDisable(InstancePtr, IntrType) |
#define | XOsd_IntrGetPending(InstancePtr) |
#define | XOsd_IntrClear(InstancePtr, IntrType) |
#define | XOsd_StatusGetPending(InstancePtr) |
#define | XOsd_SyncReset(InstancePtr) |
#define | XOsd_FSyncReset XOsd_SyncReset |
#define | XOsd_Start XOsd_Enable |
#define | XOsd_Stop XOsd_Disable |
Typedefs | |
typedef void(*) | XOsd_CallBack (void *CallBackRef) |
typedef void(*) | XOsd_ErrorCallBack (void *CallBackRef, u32 ErrorMask) |
typedef u32 | XOsd_Instruction [XOSD_INS_SIZE] |
Functions | |
int | XOsd_CfgInitialize (XOsd *InstancePtr, XOsd_Config *CfgPtr, u32 EffectiveAddr) |
void | XOsd_SetActiveSize (XOsd *InstancePtr, u32 Width, u32 Height) |
void | XOsd_GetActiveSize (XOsd *InstancePtr, u32 *WidthPtr, u32 *HeightPtr) |
void | XOsd_SetBackgroundColor (XOsd *InstancePtr, u16 Red, u16 Blue, u16 Green) |
void | XOsd_GetBackgroundColor (XOsd *InstancePtr, u16 *RedPtr, u16 *BluePtr, u16 *GreenPtr) |
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) |
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) |
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) |
u32 | XOsd_GetVersion (XOsd *InstancePtr) |
XOsd_Config * | XOsd_LookupConfig (u16 DeviceId) |
void | XOsd_IntrHandler (void *InstancePtr) |
int | XOsd_SetCallBack (XOsd *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef) |
int | XOsd_SelfTest (XOsd *InstancePtr) |
#define XOSD XOsd | +
+ +
#define XOSD_CallBack XOsd_CallBack | +
+ +
#define XOSD_CfgInitialize XOsd_CfgInitialize | +
+ +
#define XOSD_Config XOsd_Config | +
+ +
#define XOSD_CreateInstruction XOsd_CreateInstruction | +
+ +
#define XOsd_Disable | +( | +InstancePtr | ++ | ) | ++ |
+Value:
XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_CTL_OFFSET))) & (~(XOSD_CTL_EN_MASK)))) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOSD_Disable XOsd_Disable | +
+ +
#define XOSD_DisableLayer XOsd_DisableLayer | +
+ +
#define XOsd_Enable | +( | +InstancePtr | ++ | ) | ++ |
+Value:
XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_CTL_OFFSET))) | (XOSD_CTL_EN_MASK))) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOSD_Enable XOsd_Enable | +
+ +
#define XOSD_EnableLayer XOsd_EnableLayer | +
+ +
#define XOSD_ErrorCallBack XOsd_ErrorCallBack | +
+ +
#define XOsd_FSyncReset XOsd_SyncReset | +
+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_GetBackgroundColor XOsd_GetBackgroundColor | +
+ +
#define XOSD_GetLayerAlpha XOsd_GetLayerAlpha | +
+ +
#define XOSD_GetLayerDimension XOsd_GetLayerDimension | +
+ +
#define XOSD_GetLayerPriority XOsd_GetLayerPriority | +
+ +
#define XOSD_GetScreenSize XOsd_GetActiveSize | +
+ +
#define XOSD_H_ | +
+Prevent circular inclusions by using protection macros +
#define XOSD_Instruction XOsd_Instruction | +
+ +
#define XOsd_IntrClear | +( | +InstancePtr, | |||
+ | + | IntrType | ++ | ) | ++ |
+Value:
XOsd_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_STATUS_OFFSET), ((IntrType) & (XOSD_IXR_ALLINTR_MASK))) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. |
#define XOSD_IntrClear XOsd_IntrClear | +
+ +
#define XOsd_IntrDisable | +( | +InstancePtr, | |||
+ | + | IntrType | ++ | ) | ++ |
+Value:
XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET), \ + (((~(IntrType)) & (XOSD_IXR_ALLINTR_MASK)) & \ + (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_IER_OFFSET))))) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. |
#define XOSD_IntrDisable XOsd_IntrDisable | +
+ +
#define XOsd_IntrEnable | +( | +InstancePtr, | |||
+ | + | IntrType | ++ | ) | ++ |
+Value:
XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET), \ + (((IntrType) & (XOSD_IXR_ALLINTR_MASK)) | \ + (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_IER_OFFSET))))) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. |
#define XOSD_IntrEnable XOsd_IntrEnable | +
+ +
#define XOsd_IntrGetPending | +( | +InstancePtr | ++ | ) | ++ |
+Value:
XOsd_ReadReg((InstancePtr)->Config.BaseAddress, (XOSD_IER_OFFSET)) & \ + (XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_STATUS_OFFSET))) & (XOSD_IXR_ALLINTR_MASK) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOSD_IntrGetPending XOsd_IntrGetPending | +
+ +
#define XOSD_IntrHandler XOsd_IntrHandler | +
+ +
#define XOSD_Layer XOsd_Layer | +
+ +
#define XOSD_LoadCharacterSetBank XOsd_LoadCharacterSetBank | +
+ +
#define XOSD_LoadColorLUTBank XOsd_LoadColorLUTBank | +
+ +
#define XOSD_LoadInstructionList XOsd_LoadInstructionList | +
+ +
#define XOSD_LoadTextBank XOsd_LoadTextBank | +
+ +
#define XOSD_LookupConfig XOsd_LookupConfig | +
+ +
#define XOsd_RegUpdateDisable | +( | +InstancePtr | ++ | ) | ++ |
+Value:
XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_CTL_OFFSET))) & (~(XOSD_CTL_RUE_MASK)))) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOSD_RegUpdateDisable XOsd_RegUpdateDisable | +
+ +
#define XOsd_RegUpdateEnable | +( | +InstancePtr | ++ | ) | ++ |
+Value:
XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + ((XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_CTL_OFFSET))) | (XOSD_CTL_RUE_MASK))) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOSD_RegUpdateEnable XOsd_RegUpdateEnable | +
+ +
#define XOsd_Reset | +( | +InstancePtr | ++ | ) | ++ |
+Value:
{ \ + 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; \ +} +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOSD_Reset XOsd_Reset | +
+ +
#define XOSD_SetActiveBank XOsd_SetActiveBank | +
+ +
#define XOSD_SetBackgroundColor XOsd_SetBackgroundColor | +
+ +
#define XOSD_SetCallBack XOsd_SetCallBack | +
+ +
#define XOSD_SetLayerAlpha XOsd_SetLayerAlpha | +
+ +
#define XOSD_SetLayerDimension XOsd_SetLayerDimension | +
+ +
#define XOSD_SetLayerPriority XOsd_SetLayerPriority | +
+ +
#define XOSD_SetScreenSize XOsd_SetActiveSize | +
+ +
#define XOsd_Start XOsd_Enable | +
+This function macro stops an OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOsd_StatusGetPending | +( | +InstancePtr | ++ | ) | ++ |
+Value:
XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_STATUS_OFFSET)) & (XOSD_IXR_ALLINTR_MASK) +
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOsd_Stop XOsd_Disable | +
+This function macro stops an OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
#define XOsd_SyncReset | +( | +InstancePtr | ++ | ) | ++ |
+Value:
XOsd_WriteReg((InstancePtr)->Config.BaseAddress, (XOSD_CTL_OFFSET), \ + (XOSD_CTL_FSYNC_MASK)) +
+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.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
+
typedef void(*) XOsd_CallBack(void *CallBackRef) | +
+This function callback type for all interrupts except error interrupt.
+
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(*) XOsd_ErrorCallBack(void *CallBackRef, u32 ErrorMask) | +
+This function callback type for error interrupt.
+
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. | |
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. |
typedef u32 XOsd_Instruction[XOSD_INS_SIZE] | +
+The XOsd_Instruction data structure for holding one GC instruction. +
+
anonymous enum | +
+
int XOsd_CfgInitialize | +( | +XOsd * | +InstancePtr, | +|
+ | + | XOsd_Config * | +CfgPtr, | +|
+ | + | u32 | +EffectiveAddr | + |
+ | ) | ++ |
+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.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
CfgPtr | points to the configuration structure associated with the OSD core. | |
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. |
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 | + |
+ | ) | ++ |
+This function creates an instruction for the OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
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. | |
ObjType | indicates the type of object to draw. Use one of XOSD_INS_OPCODE_* constants defined in xosd_hw.h. | |
ObjSize | indicates line width of boxes and lines and the text scale factor for text boxes. | |
XStart | indicates the horizontal start pixel of the Object. | |
YStart | indicates the vertical start line of the Object. | |
XEnd | indicates the horizontal end pixel of the Object. | |
YEnd | indicates the vertical end line of the Object. | |
TextIndex | indicates the string index. | |
ColorIndex | indicates the color index. |
void XOsd_DisableLayer | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex | + |
+ | ) | ++ |
+This function disables an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). |
void XOsd_EnableLayer | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex | + |
+ | ) | ++ |
+This function enables an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). |
void XOsd_GetActiveSize | +( | +XOsd * | +InstancePtr, | +|
+ | + | u32 * | +WidthPtr, | +|
+ | + | u32 * | +HeightPtr | + |
+ | ) | ++ |
+This function gets the screen size of the OSD Output.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
WidthPtr | will point to the width of the OSD output after this function returns. | |
HeightPtr | will point to the height of the OSD output after this function returns. |
void XOsd_GetBackgroundColor | +( | +XOsd * | +InstancePtr, | +|
+ | + | u16 * | +RedPtr, | +|
+ | + | u16 * | +BluePtr, | +|
+ | + | u16 * | +GreenPtr | + |
+ | ) | ++ |
+This function gets the background color used by the OSD output.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
RedPtr | will point to the red value used in the background color after this function returns. | |
BluePtr | will point to the blue value used in the background color after this function returns. | |
GreenPtr | will point to the green value used in the background color after this function returns. |
void XOsd_GetLayerAlpha | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u16 * | +GlobalAlphaEnablePtr, | +|
+ | + | u16 * | +GlobalAlphaValuePtr | + |
+ | ) | ++ |
+This function gets the alpha value and mode of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
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. | |
GlobalAlphaValuePtr | will point to the transparent level after this function returns. 0 for 100% transparent, 255 (8bit) for 0% transparent (100% opaque). |
void XOsd_GetLayerDimension | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u16 * | +XStartPtr, | +|
+ | + | u16 * | +YStartPtr, | +|
+ | + | u16 * | +XSizePtr, | +|
+ | + | u16 * | +YSizePtr | + |
+ | ) | ++ |
+This function gets the start position and size of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
XStartPtr | will point to the horizontal start pixel value of origin of the layer after this function returns. | |
YStartPtr | will point to the vertical start line of origin of the layer after this function returns. | |
XSizePtr | will point to the horizontal size value of the layer after this function returns. | |
YSizePtr | will point to the vertical size value of the layer after this function returns. |
void XOsd_GetLayerPriority | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u8 * | +PriorityPtr | + |
+ | ) | ++ |
+This function gets the priority of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
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. |
u32 XOsd_GetVersion | +( | +XOsd * | +InstancePtr | +) | ++ |
+This function returns the Version of the OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. |
void XOsd_IntrHandler | +( | +void * | +InstancePtr | +) | ++ |
+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.
+
InstancePtr | is a pointer to the XOsd instance that just interrupted. |
void XOsd_LoadCharacterSetBank | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +BankIndex, | +|
+ | + | u32 | +CharSetData[] | + |
+ | ) | ++ |
+This function loads character set data (font) into an OSD Graphics Controller bank.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
BankIndex | indicates which GC bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
CharSetData | points to the character set data to be loaded. |
void XOsd_LoadColorLUTBank | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +BankIndex, | +|
+ | + | u32 | +ColorData[] | + |
+ | ) | ++ |
+This function loads color look up table data into an OSD Graphics Controller bank.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
BankIndex | indicates which GC Bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
ColorData | points to the color LUT data to be loaded. |
void XOsd_LoadInstructionList | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +BankIndex, | +|
+ | + | u32 | +InstSetPtr[], | +|
+ | + | u32 | +InstNum | + |
+ | ) | ++ |
+This function load an instruction list to be used by an Graphic Controller in the OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
BankIndex | indicates which GC Bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM. | |
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. | |
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. |
void XOsd_LoadTextBank | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +BankIndex, | +|
+ | + | u32 | +TextData[] | + |
+ | ) | ++ |
+This function loads text data into an OSD Graphics Controller bank.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
BankIndex | indicates which GC bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
TextData | points to the text data to be loaded. |
XOsd_Config* XOsd_LookupConfig | +( | +u16 | +DeviceId | +) | ++ |
+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.
+
DeviceId | is the unique core ID of the OSD core for the lookup operation. |
int XOsd_SelfTest | +( | +XOsd * | +InstancePtr | +) | ++ |
+This function reads Version register of OSD core and compares with zero as part of self test.
+
InstancePtr | is a pointer to the XOsd instance. |
void XOsd_SetActiveBank | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +GcIndex, | +|
+ | + | u8 | +ColorBankIndex, | +|
+ | + | u8 | +CharBankIndex, | +|
+ | + | u8 | +TextBankIndex, | +|
+ | + | u8 | +InstructionBankIndex | + |
+ | ) | ++ |
+This function chooses active banks for a GC in the OSD core.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
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. | |
ColorBankIndex | indicates the color LUT bank to be choose as active. | |
CharBankIndex | indicates the character set bank to be chosen as active. | |
TextBankIndex | indicates the text data bank to be chosen as active. | |
InstructionBankIndex | indicates the instruction bank to be chosen as active. |
void XOsd_SetActiveSize | +( | +XOsd * | +InstancePtr, | +|
+ | + | u32 | +Width, | +|
+ | + | u32 | +Height | + |
+ | ) | ++ |
+This function sets the screen size of the OSD Output.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
Width | defines the width of the OSD output. | |
Height | defines the height of the OSD output. |
void XOsd_SetBackgroundColor | +( | +XOsd * | +InstancePtr, | +|
+ | + | u16 | +Red, | +|
+ | + | u16 | +Blue, | +|
+ | + | u16 | +Green | + |
+ | ) | ++ |
+This function sets the background color used by the OSD output.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
Red | indicates the red value to be used in the background color. | |
Blue | indicates the blue value to be used in the background color. | |
Green | indicates the green value to be used in the background color. |
int XOsd_SetCallBack | +( | +XOsd * | +InstancePtr, | +|
+ | + | u32 | +HandlerType, | +|
+ | + | void * | +CallBackFunc, | +|
+ | + | void * | +CallBackRef | + |
+ | ) | ++ |
+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
+
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
HandlerType | specifies which callback is to be attached. | |
CallBackFunc | is the address of the callback function. | |
CallBackRef | is a user data item that will be passed to the callback function when it is invoked. |
void XOsd_SetLayerAlpha | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u16 | +GlobalAlphaEnable, | +|
+ | + | u16 | +GlobalAlphaValue | + |
+ | ) | ++ |
+This function sets the alpha value and mode of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
GlobalAlphaEnable | indicates whether to enable the global alpha. Use any non-0 value to enable the global alpha, and 0 to disable it. | |
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. |
void XOsd_SetLayerDimension | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u16 | +XStart, | +|
+ | + | u16 | +YStart, | +|
+ | + | u16 | +XSize, | +|
+ | + | u16 | +YSize | + |
+ | ) | ++ |
+This function sets the start position and size of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
XStart | indicates the horizontal start pixel of origin of the layer. | |
YStart | indicates the vertical start line of origin of the layer. | |
XSize | indicates the horizontal size of the layer. | |
YSize | indicates the vertical size of the layer. |
void XOsd_SetLayerPriority | +( | +XOsd * | +InstancePtr, | +|
+ | + | u8 | +LayerIndex, | +|
+ | + | u8 | +Priority | + |
+ | ) | ++ |
+This function sets the priority of an OSD layer.
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the core - 1). | |
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. |
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__g_8c.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__g_8c.html new file mode 100644 index 00000000..8edb0658 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__g_8c.html @@ -0,0 +1,50 @@ + +
+ +
+#include "xparameters.h"
+#include "xosd.h"
+
Variables | |
XOsd_Config | XOsd_ConfigTable [] |
XOsd_Config XOsd_ConfigTable[] | +
+ +
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__hw_8h.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__hw_8h.html new file mode 100644 index 00000000..28f198c8 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__hw_8h.html @@ -0,0 +1,4009 @@ + +
+ ++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. ++
+#include "xil_io.h"
+
Register Offsets | |
#define | XOSD_CTL_OFFSET 0x000 |
#define | XOSD_ACTIVE_SIZE_OFFSET 0x020 |
#define | XOSD_BC0_OFFSET 0x100 |
#define | XOSD_BC1_OFFSET 0x104 |
#define | XOSD_BC2_OFFSET 0x108 |
#define | XOSD_L0C_OFFSET 0x110 |
#define | XOSD_L0P_OFFSET 0x114 |
#define | XOSD_L0S_OFFSET 0x118 |
#define | XOSD_L1C_OFFSET 0x120 |
#define | XOSD_L1P_OFFSET 0x124 |
#define | XOSD_L1S_OFFSET 0x128 |
#define | XOSD_L2C_OFFSET 0x130 |
#define | XOSD_L2P_OFFSET 0x134 |
#define | XOSD_L2S_OFFSET 0x138 |
#define | XOSD_L3C_OFFSET 0x140 |
#define | XOSD_L3P_OFFSET 0x144 |
#define | XOSD_L3S_OFFSET 0x148 |
#define | XOSD_L4C_OFFSET 0x150 |
#define | XOSD_L4P_OFFSET 0x154 |
#define | XOSD_L4S_OFFSET 0x158 |
#define | XOSD_L5C_OFFSET 0x160 |
#define | XOSD_L5P_OFFSET 0x164 |
#define | XOSD_L5S_OFFSET 0x168 |
#define | XOSD_L6C_OFFSET 0x170 |
#define | XOSD_L6P_OFFSET 0x174 |
#define | XOSD_L6S_OFFSET 0x178 |
#define | XOSD_L7C_OFFSET 0x180 |
#define | XOSD_L7P_OFFSET 0x184 |
#define | XOSD_L7S_OFFSET 0x188 |
#define | XOSD_GCWBA_OFFSET 0x190 |
#define | XOSD_GCABA_OFFSET 0x194 |
#define | XOSD_GCD_OFFSET 0x198 |
#define | XOSD_VER_OFFSET 0x010 |
#define | XOSD_RST_OFFSET XOSD_CTL_OFFSET |
#define | XOSD_ISR_OFFSET XOSD_STATUS |
#define | XOSD_IER_OFFSET 0x00C |
#define | XOSD_STATUS_OFFSET 0x004 |
#define | XOSD_ERROR_OFFSET 0x008 |
#define | XOSD_OPENC_OFFSET 0x028 |
Memory footprint of layers | |
#define | XOSD_LAYER_SIZE 0x10 |
#define | XOSD_LXC 0x00 |
#define | XOSD_LXP 0x04 |
#define | XOSD_LXS 0x08 |
Graphics Controller Bank related constants | |
#define | XOSD_GC_BANK_NUM 2 |
Active Size Register bit definition and Shift | |
#define | XOSD_ACTSIZE_NUM_PIXEL_MASK 0x00000FFF |
#define | XOSD_ACTSIZE_NUM_LINE_MASK 0x0FFF0000 |
#define | XOSD_ACTSIZE_NUM_LINE_SHIFT 16 |
Background Color Channel 0 Mask | |
#define | XOSD_BC0_YG_MASK 0x00000FFF |
Background Color Channel 1 Mask | |
#define | XOSD_BC1_UCBB_MASK 0x00000FFF |
Background Color Channel 2 Mask | |
#define | XOSD_BC2_VCRR_MASK 0x00000FFF |
Maximum number of the layers | |
#define | XOSD_MAX_NUM_OF_LAYERS 8 |
Layer Control (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit | |
definition and Shifts | |
#define | XOSD_LXC_ALPHA_MASK 0x1FFF0000 |
#define | XOSD_LXC_ALPHA_SHIFT 16 |
#define | XOSD_LXC_PRIORITY_MASK 0x00000700 |
#define | XOSD_LXC_PRIORITY_SHIFT 8 |
#define | XOSD_LXC_GALPHAEN_MASK 0x00000002 |
#define | XOSD_LXC_EN_MASK 0x00000001 |
Layer Position (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit | |
definition and Shifts | |
#define | XOSD_LXP_YSTART_MASK 0x0FFF0000 |
#define | XOSD_LXP_YSTART_SHIFT 16 |
#define | XOSD_LXP_XSTART_MASK 0x00000FFF |
Layer Size (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit | |
definition and Shift | |
#define | XOSD_LXS_YSIZE_MASK 0x0FFF0000 |
#define | XOSD_LXS_YSIZE_SHIFT 16 |
#define | XOSD_LXS_XSIZE_MASK 0x00000FFF |
Graphics Controller Write Bank Address bit definition and Shift | |
#define | XOSD_GCWBA_GCNUM_MASK 0x00000700 |
#define | XOSD_GCWBA_GCNUM_SHIFT 8 |
#define | XOSD_GCWBA_BANK_MASK 0x00000007 |
#define | XOSD_GCWBA_INS0 0x00000000 |
#define | XOSD_GCWBA_INS1 0x00000001 |
#define | XOSD_GCWBA_COL0 0x00000002 |
#define | XOSD_GCWBA_COL1 0x00000003 |
#define | XOSD_GCWBA_TXT0 0x00000004 |
#define | XOSD_GCWBA_TXT1 0x00000005 |
#define | XOSD_GCWBA_CHR0 0x00000006 |
#define | XOSD_GCWBA_CHR1 0x00000007 |
Graphics Controller Active Bank Address bit definition and Shifts | |
#define | XOSD_GCABA_CHR_MASK 0xFF000000 |
#define | XOSD_GCABA_CHR_SHIFT 24 |
#define | XOSD_GCABA_TXT_MASK 0x00FF0000 |
#define | XOSD_GCABA_TXT_SHIFT 16 |
#define | XOSD_GCABA_COL_MASK 0x0000FF00 |
#define | XOSD_GCABA_COL_SHIFT 8 |
#define | XOSD_GCABA_INS_MASK 0x000000FF |
Version Register bit definition and Shifts | |
#define | XOSD_VER_MAJOR_MASK 0xFF000000 |
#define | XOSD_VER_MAJOR_SHIFT 24 |
#define | XOSD_VER_MINOR_MASK 0x00FF0000 |
#define | XOSD_VER_MINOR_SHIFT 16 |
#define | XOSD_VER_REV_MASK 0x0000F000 |
#define | XOSD_VER_REV_SHIFT 12 |
Software Reset | |
#define | XOSD_RST_RESET XOSD_CTL_SW_RST_MASK |
Interrupt Register Bit Masks. It is applicable for ISR and IER. | |
#define | XOSD_IXR_LAYER0_ERROR_MASK 0x00000010 |
#define | XOSD_IXR_LAYER1_ERROR_MASK 0x00000020 |
#define | XOSD_IXR_LAYER2_ERROR_MASK 0x00000040 |
#define | XOSD_IXR_LAYER3_ERROR_MASK 0x00000080 |
#define | XOSD_IXR_LAYER4_ERROR_MASK 0x00000100 |
#define | XOSD_IXR_LAYER5_ERROR_MASK 0x00000200 |
#define | XOSD_IXR_LAYER6_ERROR_MASK 0x00000400 |
#define | XOSD_IXR_LAYER7_ERROR_MASK 0x00000800 |
#define | XOSD_IXR_PROC_STARTED_MASK 0x00000001 |
#define | XOSD_IXR_EOF_MASK 0x00000002 |
#define | XOSD_IXR_ALLERR_MASK |
#define | XOSD_IXR_ALLINTR_MASK |
Layer Types | |
#define | XOSD_LAYER_TYPE_DISABLE 0 |
#define | XOSD_LAYER_TYPE_GPU 1 |
#define | XOSD_LAYER_TYPE_VFBC 2 |
Supported instruction numbers given an instruction memory size | |
#define | XOSD_INS_MEM_SIZE_TO_NUM 1 |
GC instruction word offset definition | |
#define | XOSD_INS0 0 |
#define | XOSD_INS1 1 |
#define | XOSD_INS2 2 |
#define | XOSD_INS3 3 |
#define | XOSD_INS_SIZE 4 |
GC Instruction word 0 definition and Shifts | |
#define | XOSD_INS0_OPCODE_MASK 0xF0000000 |
#define | XOSD_INS0_OPCODE_SHIFT 28 |
#define | XOSD_INS0_GCNUM_MASK 0x07000000 |
#define | XOSD_INS0_GCNUM_SHIFT 24 |
#define | XOSD_INS0_XEND_MASK 0x00FFF000 |
#define | XOSD_INS0_XEND_SHIFT 12 |
#define | XOSD_INS0_XSTART_MASK 0x00000FFF |
GC Instruction word 1 definition | |
#define | XOSD_INS1_TXTINDEX_MASK 0x0000000F |
GC Instruction word 2 definition and Shifts | |
#define | XOSD_INS2_OBJSIZE_MASK 0xFF000000 |
#define | XOSD_INS2_OBJSIZE_SHIFT 24 |
#define | XOSD_INS2_YEND_MASK 0x00FFF000 |
#define | XOSD_INS2_YEND_SHIFT 12 |
#define | XOSD_INS2_YSTART_MASK 0x00000FFF |
GC Instruction word 3 definition | |
#define | XOSD_INS3_COL_MASK 0x0000000F |
GC Instruction Operation Code definition (used in Instruction word 0) | |
#define | XOSD_INS_OPCODE_END 0x0 |
#define | XOSD_INS_OPCODE_NOP 0x8 |
#define | XOSD_INS_OPCODE_BOX 0xA |
#define | XOSD_INS_OPCODE_LINE 0xC |
#define | XOSD_INS_OPCODE_TXT 0xE |
#define | XOSD_INS_OPCODE_BOXTXT 0xF |
GC color size | |
#define | XOSD_COLOR_ENTRY_SIZE 4 |
GC font unit size | |
#define | XOSD_FONT_BIT_TO_BYTE 8 |
Layer priority | |
#define | XOSD_LAYER_PRIORITY_0 0 |
#define | XOSD_LAYER_PRIORITY_1 1 |
#define | XOSD_LAYER_PRIORITY_2 2 |
#define | XOSD_LAYER_PRIORITY_3 3 |
#define | XOSD_LAYER_PRIORITY_4 4 |
#define | XOSD_LAYER_PRIORITY_5 5 |
#define | XOSD_LAYER_PRIORITY_6 6 |
#define | XOSD_LAYER_PRIORITY_7 7 |
Output Encoding Register bit definition | |
#define | XOSD_OPENC_VID_FORMAT_MASK 0x0000000F |
#define | XOSD_OPENC_NBITS_MASK 0x00000030 |
Error Register bit definition | |
#define | XOSD_ERR_LAYER7_SOF_LATE_MASK 0x80000000 |
#define | XOSD_ERR_LAYER7_SOF_EARLY_MASK 0x40000000 |
#define | XOSD_ERR_LAYER7_EOL_LATE_MASK 0x20000000 |
#define | XOSD_ERR_LAYER7_EOL_EARLY_MASK 0x10000000 |
#define | XOSD_ERR_LAYER6_SOF_LATE_MASK 0x08000000 |
#define | XOSD_ERR_LAYER6_SOF_EARLY_MASK 0x04000000 |
#define | XOSD_ERR_LAYER6_EOL_LATE_MASK 0x02000000 |
#define | XOSD_ERR_LAYER6_EOL_EARLY_MASK 0x01000000 |
#define | XOSD_ERR_LAYER5_SOF_LATE_MASK 0x00800000 |
#define | XOSD_ERR_LAYER5_SOF_EARLY_MASK 0x00400000 |
#define | XOSD_ERR_LAYER5_EOL_LATE_MASK 0x00200000 |
#define | XOSD_ERR_LAYER5_EOL_EARLY_MASK 0x00100000 |
#define | XOSD_ERR_LAYER4_SOF_LATE_MASK 0x00080000 |
#define | XOSD_ERR_LAYER4_SOF_EARLY_MASK 0x00040000 |
#define | XOSD_ERR_LAYER4_EOL_LATE_MASK 0x00020000 |
#define | XOSD_ERR_LAYER4_EOL_EARLY_MASK 0x00010000 |
#define | XOSD_ERR_LAYER3_SOF_LATE_MASK 0x00008000 |
#define | XOSD_ERR_LAYER3_SOF_EARLY_MASK 0x00004000 |
#define | XOSD_ERR_LAYER3_EOL_LATE_MASK 0x00002000 |
#define | XOSD_ERR_LAYER3_EOL_EARLY_MASK 0x00001000 |
#define | XOSD_ERR_LAYER2_SOF_LATE_MASK 0x00000800 |
#define | XOSD_ERR_LAYER2_SOF_EARLY_MASK 0x00000400 |
#define | XOSD_ERR_LAYER2_EOL_LATE_MASK 0x00000200 |
#define | XOSD_ERR_LAYER2_EOL_EARLY_MASK 0x00000100 |
#define | XOSD_ERR_LAYER1_SOF_LATE_MASK 0x00000080 |
#define | XOSD_ERR_LAYER1_SOF_EARLY_MASK 0x00000040 |
#define | XOSD_ERR_LAYER1_EOL_LATE_MASK 0x00000020 |
#define | XOSD_ERR_LAYER1_EOL_EARLY_MASK 0x00000010 |
#define | XOSD_ERR_LAYER0_SOF_LATE_MASK 0x00000008 |
#define | XOSD_ERR_LAYER0_SOF_EARLY_MASK 0x00000004 |
#define | XOSD_ERR_LAYER0_EOL_LATE_MASK 0x00000002 |
#define | XOSD_ERR_LAYER0_EOL_EARLY_MASK 0x00000001 |
#define | XOSD_ERR_ALL_ERR_MASK 0xFFFFFFFF |
Control Register bit definition | |
#define | XOSD_CTL_EN_MASK 0x00000001 |
#define | XOSD_CTL_RUE_MASK 0x00000002 |
#define | XOSD_CTL_FSYNC_MASK 0x40000000 |
#define | XOSD_CTL_SW_RST_MASK 0x80000000 |
Constants. It is defined as constants to use instead magic numbers. | |
#define | XOSD_DATA_8 8 |
#define | XOSD_DATA_2 2 |
Compatibility Macros | |
#define | XOSD_CTL XOSD_CTL_OFFSET |
#define | XOSD_STATUS XOSD_STATUS_OFFSET |
#define | XOSD_ERROR XOSD_ERROR_OFFSET |
#define | XOSD_VER XOSD_VER_OFFSET |
#define | XOSD_SS XOSD_ACTIVE_SIZE_OFFSET |
#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_ISR XOSD_ISR_OFFSET |
#define | XOSD_IER XOSD_IER_OFFSET |
#define | XOSD_In32 XOsd_In32 |
#define | XOSD_Out32 XOsd_Out32 |
#define | XOSD_ReadReg XOsd_ReadReg |
#define | XOSD_WriteReg XOsd_WriteReg |
Core register I/O APIs | |
#define | XOsd_In32 Xil_In32 |
#define | XOsd_Out32 Xil_Out32 |
#define | XOsd_ReadReg(BaseAddress, RegOffset) XOsd_In32((BaseAddress) + (u32)(RegOffset)) |
#define | XOsd_WriteReg(BaseAddress, RegOffset, Data) XOsd_Out32((BaseAddress) + (u32)(RegOffset), (Data)) |
Defines | |
#define | XOSD_HW_H_ |
#define XOSD_ACTIVE_SIZE_OFFSET 0x020 | +
+Screen Size / Output Active_Size Offset +
#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 +
#define XOSD_ACTSIZE_NUM_PIXEL_MASK 0x00000FFF | +
+Horizontal Width of OSD Output Mask +
#define XOSD_BC0 XOSD_BC0_OFFSET | +
+ +
#define XOSD_BC0_OFFSET 0x100 | +
+Background Color Channel 0 Offset +
#define XOSD_BC0_YG_MASK 0x00000FFF | +
+Y (luma) or Green Mask +
#define XOSD_BC1 XOSD_BC1_OFFSET | +
+ +
#define XOSD_BC1_OFFSET 0x104 | +
+Background Color Channel 1 Offset +
#define XOSD_BC1_UCBB_MASK 0x00000FFF | +
+U (Cb) or Blue Mask +
#define XOSD_BC2 XOSD_BC2_OFFSET | +
+ +
#define XOSD_BC2_OFFSET 0x108 | +
+Background Color Channel 2 Offset +
#define XOSD_BC2_VCRR_MASK 0x00000FFF | +
+V(Cr) or Red Mask +
#define XOSD_COLOR_ENTRY_SIZE 4 | +
+Size of each color entry in bytes +
#define XOSD_CTL XOSD_CTL_OFFSET | +
+ +
#define XOSD_CTL_EN_MASK 0x00000001 | +
+Enable / SW Enable Mask +
#define XOSD_CTL_FSYNC_MASK 0x40000000 | +
+Frame Sync Reset Mask +
#define XOSD_CTL_OFFSET 0x000 | +
+Control Offset +
#define XOSD_CTL_RUE_MASK 0x00000002 | +
+Register Update Enable Mask +
#define XOSD_CTL_SW_RST_MASK 0x80000000 | +
+Core Reset Mask +
#define XOSD_DATA_2 2 | +
+ +
#define XOSD_DATA_8 8 | +
+ +
#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 +
#define XOSD_ERR_LAYER0_EOL_EARLY_MASK 0x00000001 | +
+OSD Layer 0 error for EOL early Mask +
#define XOSD_ERR_LAYER0_EOL_LATE_MASK 0x00000002 | +
+OSD Layer 0 error for EOL late Mask +
#define XOSD_ERR_LAYER0_SOF_EARLY_MASK 0x00000004 | +
+OSD Layer 0 error for SOF early Mask +
#define XOSD_ERR_LAYER0_SOF_LATE_MASK 0x00000008 | +
+OSD Layer 0 error for SOF late Mask +
#define XOSD_ERR_LAYER1_EOL_EARLY_MASK 0x00000010 | +
+OSD Layer 1 error for EOL early Mask +
#define XOSD_ERR_LAYER1_EOL_LATE_MASK 0x00000020 | +
+OSD Layer 1 error for EOL late Mask +
#define XOSD_ERR_LAYER1_SOF_EARLY_MASK 0x00000040 | +
+OSD Layer 1 error for SOF early Mask +
#define XOSD_ERR_LAYER1_SOF_LATE_MASK 0x00000080 | +
+OSD Layer 1 error for SOF late Mask +
#define XOSD_ERR_LAYER2_EOL_EARLY_MASK 0x00000100 | +
+OSD Layer 2 error for EOL early Mask +
#define XOSD_ERR_LAYER2_EOL_LATE_MASK 0x00000200 | +
+OSD Layer 2 error for EOL late Mask +
#define XOSD_ERR_LAYER2_SOF_EARLY_MASK 0x00000400 | +
+OSD Layer 2 error for SOF early Mask +
#define XOSD_ERR_LAYER2_SOF_LATE_MASK 0x00000800 | +
+OSD Layer 2 error for SOF late Mask +
#define XOSD_ERR_LAYER3_EOL_EARLY_MASK 0x00001000 | +
+OSD Layer 3 error for EOL early Mask +
#define XOSD_ERR_LAYER3_EOL_LATE_MASK 0x00002000 | +
+OSD Layer 3 error for EOL late Mask +
#define XOSD_ERR_LAYER3_SOF_EARLY_MASK 0x00004000 | +
+OSD Layer 3 error for SOF early Mask +
#define XOSD_ERR_LAYER3_SOF_LATE_MASK 0x00008000 | +
+OSD Layer 3 error for SOF late Mask +
#define XOSD_ERR_LAYER4_EOL_EARLY_MASK 0x00010000 | +
+OSD Layer 4 error for EOL early Mask +
#define XOSD_ERR_LAYER4_EOL_LATE_MASK 0x00020000 | +
+OSD Layer 4 error for EOL late Mask +
#define XOSD_ERR_LAYER4_SOF_EARLY_MASK 0x00040000 | +
+OSD Layer 4 error for SOF early Mask +
#define XOSD_ERR_LAYER4_SOF_LATE_MASK 0x00080000 | +
+OSD Layer 4 error for SOF late Mask +
#define XOSD_ERR_LAYER5_EOL_EARLY_MASK 0x00100000 | +
+OSD Layer 5 error for EOL early Mask +
#define XOSD_ERR_LAYER5_EOL_LATE_MASK 0x00200000 | +
+OSD Layer 5 error for EOL late Mask +
#define XOSD_ERR_LAYER5_SOF_EARLY_MASK 0x00400000 | +
+OSD Layer 5 error for SOF early Mask +
#define XOSD_ERR_LAYER5_SOF_LATE_MASK 0x00800000 | +
+OSD Layer 5 error for SOF late Mask +
#define XOSD_ERR_LAYER6_EOL_EARLY_MASK 0x01000000 | +
+OSD Layer 6 error for EOL early Mask +
#define XOSD_ERR_LAYER6_EOL_LATE_MASK 0x02000000 | +
+OSD Layer 6 error for EOL late Mask +
#define XOSD_ERR_LAYER6_SOF_EARLY_MASK 0x04000000 | +
+OSD Layer 6 error for SOF early Mask +
#define XOSD_ERR_LAYER6_SOF_LATE_MASK 0x08000000 | +
+OSD Layer 6 error for SOF late Mask +
#define XOSD_ERR_LAYER7_EOL_EARLY_MASK 0x10000000 | +
+OSD Layer 7 error for EOL early +
#define XOSD_ERR_LAYER7_EOL_LATE_MASK 0x20000000 | +
+OSD Layer 7 error for EOL late Mask +
#define XOSD_ERR_LAYER7_SOF_EARLY_MASK 0x40000000 | +
+OSD Layer 7 error for SOF early Mask +
#define XOSD_ERR_LAYER7_SOF_LATE_MASK 0x80000000 | +
+OSD Layer 7 error for SOF late Mask +
#define XOSD_ERROR XOSD_ERROR_OFFSET | +
+ +
#define XOSD_ERROR_OFFSET 0x008 | +
+Error Offset +
#define XOSD_FONT_BIT_TO_BYTE 8 | +
+Ratio to convert font size to byte +
#define XOSD_GC_BANK_NUM 2 | +
+The number of Banks in each Graphics controller +
#define XOSD_GCABA XOSD_GCABA_OFFSET | +
+ +
#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_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 +
#define XOSD_GCABA_OFFSET 0x194 | +
+GPU Active Bank Address Offset +
#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_GCD XOSD_GCD_OFFSET | +
+ +
#define XOSD_GCD_OFFSET 0x198 | +
+GPU Data Offset +
#define XOSD_GCWBA XOSD_GCWBA_OFFSET | +
+ +
#define XOSD_GCWBA_BANK_MASK 0x00000007 | +
+Controls which bank to write GPU instructions and Color LUT data into +
#define XOSD_GCWBA_CHR0 0x00000006 | +
+Character Set RAM 0 +
#define XOSD_GCWBA_CHR1 0x00000007 | +
+Character Set RAM 1 +
#define XOSD_GCWBA_COL0 0x00000002 | +
+Color LUT RAM 0 +
#define XOSD_GCWBA_COL1 0x00000003 | +
+Color LUT RAM 1 +
#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_INS0 0x00000000 | +
+Instruction RAM 0 +
#define XOSD_GCWBA_INS1 0x00000001 | +
+Instruction RAM 1 +
#define XOSD_GCWBA_OFFSET 0x190 | +
+GPU Write Bank Address Offset +
#define XOSD_GCWBA_TXT0 0x00000004 | +
+Text RAM 0 +
#define XOSD_GCWBA_TXT1 0x00000005 | +
+Text RAM 1 +
#define XOSD_HW_H_ | +
+Prevent circular inclusions by using protection macros. +
#define XOSD_IER XOSD_IER_OFFSET | +
+ +
#define XOSD_IER_OFFSET 0x00C | +
+Interrupt Enable Register Offset +
#define XOsd_In32 Xil_In32 | +
+ +
#define XOSD_In32 XOsd_In32 | +
+ +
#define XOSD_INS0 0 | +
+Instruction word 0 offset +
#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_OPCODE_MASK 0xF0000000 | +
+Operation Code (OpCode) Mask +
#define XOSD_INS0_OPCODE_SHIFT 28 | +
+Bit shift number of OpCode +
#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 +
#define XOSD_INS1 1 | +
+Instruction word 1 offset +
#define XOSD_INS1_TXTINDEX_MASK 0x0000000F | +
+String Index +
#define XOSD_INS2 2 | +
+Instruction word 2 offset +
#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 +
#define XOSD_INS3 3 | +
+Instruction word 3 offset +
#define XOSD_INS3_COL_MASK 0x0000000F | +
+Color Index for Box/Text Mask +
#define XOSD_INS_MEM_SIZE_TO_NUM 1 | +
+Conversion to the number of instructions from the instruction memory size +
#define XOSD_INS_OPCODE_BOX 0xA | +
+Box +
#define XOSD_INS_OPCODE_BOXTXT 0xF | +
+Box Text +
#define XOSD_INS_OPCODE_END 0x0 | +
+End of instruction list +
#define XOSD_INS_OPCODE_LINE 0xC | +
+Line +
#define XOSD_INS_OPCODE_NOP 0x8 | +
+NOP +
#define XOSD_INS_OPCODE_TXT 0xE | +
+Text +
#define XOSD_INS_SIZE 4 | +
+Size of an instruction in words +
#define XOSD_ISR XOSD_ISR_OFFSET | +
+ +
#define XOSD_ISR_OFFSET XOSD_STATUS | +
+Interrupt status register generates a interrupt if the corresponding bits of interrupt enable register bits are set. Interrupt Status Register Offset +
#define XOSD_IXR_ALLERR_MASK | +
+Value:
(XOSD_IXR_LAYER0_ERROR_MASK | \ + XOSD_IXR_LAYER1_ERROR_MASK | \0x00FF0000 +
#define XOSD_IXR_ALLINTR_MASK | +
+Value:
(XOSD_IXR_PROC_STARTED_MASK | \ + XOSD_IXR_EOF_MASK | \ + XOSD_IXR_ALLERR_MASK) +
#define XOSD_IXR_EOF_MASK 0x00000002 | +
+OSD End of frame mask +
#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_L0C XOSD_L0C_OFFSET | +
+ +
#define XOSD_L0C_OFFSET 0x110 | +
+Layer 0 Control Offset +
#define XOSD_L0P XOSD_L0P_OFFSET | +
+ +
#define XOSD_L0P_OFFSET 0x114 | +
+Layer 0 Position Offset +
#define XOSD_L0S XOSD_L0S_OFFSET | +
+ +
#define XOSD_L0S_OFFSET 0x118 | +
+Layer 0 Size Offset +
#define XOSD_L1C XOSD_L1C_OFFSET | +
+ +
#define XOSD_L1C_OFFSET 0x120 | +
+Layer 1 Control Offset +
#define XOSD_L1P XOSD_L1P_OFFSET | +
+ +
#define XOSD_L1P_OFFSET 0x124 | +
+Layer 1 Position Offset +
#define XOSD_L1S XOSD_L1S_OFFSET | +
+ +
#define XOSD_L1S_OFFSET 0x128 | +
+Layer 1 Size Offset +
#define XOSD_L2C XOSD_L2C_OFFSET | +
+ +
#define XOSD_L2C_OFFSET 0x130 | +
+Layer 2 Control Offset +
#define XOSD_L2P XOSD_L2P_OFFSET | +
+ +
#define XOSD_L2P_OFFSET 0x134 | +
+Layer 2 Position Offset +
#define XOSD_L2S XOSD_L2S_OFFSET | +
+ +
#define XOSD_L2S_OFFSET 0x138 | +
+Layer 2 Size Offset +
#define XOSD_L3C XOSD_L3C_OFFSET | +
+ +
#define XOSD_L3C_OFFSET 0x140 | +
+Layer 3 Control Offset +
#define XOSD_L3P XOSD_L3P_OFFSET | +
+ +
#define XOSD_L3P_OFFSET 0x144 | +
+Layer 3 Position Offset +
#define XOSD_L3S XOSD_L3S_OFFSET | +
+ +
#define XOSD_L3S_OFFSET 0x148 | +
+Layer 3 Size Offset +
#define XOSD_L4C XOSD_L4C_OFFSET | +
+ +
#define XOSD_L4C_OFFSET 0x150 | +
+Layer 4 Control Offset +
#define XOSD_L4P XOSD_L4P_OFFSET | +
+ +
#define XOSD_L4P_OFFSET 0x154 | +
+Layer 4 Position Offset +
#define XOSD_L4S XOSD_L4S_OFFSET | +
+ +
#define XOSD_L4S_OFFSET 0x158 | +
+Layer 4 Size Offset +
#define XOSD_L5C XOSD_L5C_OFFSET | +
+ +
#define XOSD_L5C_OFFSET 0x160 | +
+Layer 5 Control Offset +
#define XOSD_L5P XOSD_L5P_OFFSET | +
+ +
#define XOSD_L5P_OFFSET 0x164 | +
+Layer 5 Position Offset +
#define XOSD_L5S XOSD_L5S_OFFSET | +
+ +
#define XOSD_L5S_OFFSET 0x168 | +
+Layer 5 Size Offset +
#define XOSD_L6C XOSD_L6C_OFFSET | +
+ +
#define XOSD_L6C_OFFSET 0x170 | +
+Layer 6 Control Offset +
#define XOSD_L6P XOSD_L6P_OFFSET | +
+ +
#define XOSD_L6P_OFFSET 0x174 | +
+Layer 6 Position Offset +
#define XOSD_L6S XOSD_L6S_OFFSET | +
+ +
#define XOSD_L6S_OFFSET 0x178 | +
+Layer 6 Size Offset +
#define XOSD_L7C XOSD_L7C_OFFSET | +
+ +
#define XOSD_L7C_OFFSET 0x180 | +
+Layer 7 Control Offset +
#define XOSD_L7P XOSD_L7P_OFFSET | +
+ +
#define XOSD_L7P_OFFSET 0x184 | +
+Layer 7 Position Offset +
#define XOSD_L7S XOSD_L7S_OFFSET | +
+ +
#define XOSD_L7S_OFFSET 0x188 | +
+Layer 7 Size Offset +
#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 +
#define XOSD_LAYER_SIZE 0x10 | +
+Total number of Layers +
#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 +
#define XOSD_LXC 0x00 | +
+Layer Control +
#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_EN_MASK 0x00000001 | +
+Layer Enable Mask +
#define XOSD_LXC_GALPHAEN_MASK 0x00000002 | +
+Global Alpha Enable Mask +
#define XOSD_LXC_PRIORITY_MASK 0x00000700 | +
+Layer Priority Mask +
#define XOSD_LXC_PRIORITY_SHIFT 8 | +
+Bit shift number of Layer Priority +
#define XOSD_LXP 0x04 | +
+Layer Position +
#define XOSD_LXP_XSTART_MASK 0x00000FFF | +
+Horizontal start pixel of origin of layer Mask +
#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_LXS 0x08 | +
+Layer Size +
#define XOSD_LXS_XSIZE_MASK 0x00000FFF | +
+Horizontal size of layer Mask +
#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_MAX_NUM_OF_LAYERS 8 | +
+The max number of layers +
#define XOSD_OPENC XOSD_OPENC_OFFSET | +
+ +
#define XOSD_OPENC_NBITS_MASK 0x00000030 | +
+Vertical Height of OSD Output Mask +
#define XOSD_OPENC_OFFSET 0x028 | +
+Output Encoding Offset +
#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_Out32 Xil_Out32 | +
+ +
#define XOSD_Out32 XOsd_Out32 | +
+ +
#define XOsd_ReadReg | +( | +BaseAddress, | |||
+ | + | RegOffset | ++ | ) | +XOsd_In32((BaseAddress) + (u32)(RegOffset)) | +
+This function reads the given register.
+
BaseAddress | is the base address of the OSD core. | |
RegOffset | is the register offset of the OSD core. |
#define XOSD_ReadReg XOsd_ReadReg | +
+ +
#define XOSD_RST XOSD_RST_OFFSET | +
+ +
#define XOSD_RST_OFFSET XOSD_CTL_OFFSET | +
+Software Reset Offset +
#define XOSD_RST_RESET XOSD_CTL_SW_RST_MASK | +
+Software Reset +
#define XOSD_SS XOSD_ACTIVE_SIZE_OFFSET | +
+ +
#define XOSD_STATUS XOSD_STATUS_OFFSET | +
+ +
#define XOSD_STATUS_OFFSET 0x004 | +
+Status Offset +
#define XOSD_VER XOSD_VER_OFFSET | +
+ +
#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_OFFSET 0x010 | +
+Version Offset +
#define XOSD_VER_REV_MASK 0x0000F000 | +
+Revision Version Mask +
#define XOSD_VER_REV_SHIFT 12 | +
+Revision Bit Shift +
#define XOsd_WriteReg | +( | +BaseAddress, | |||
+ | + | RegOffset, | |||
+ | + | Data | ++ | ) | +XOsd_Out32((BaseAddress) + (u32)(RegOffset), (Data)) | +
+This function writes the given register.
+
BaseAddress | is the base address of the OSD core. | |
RegOffset | is the register offset of the OSD core. | |
Data | is the 32-bit value to write into the core register. |
#define XOSD_WriteReg XOsd_WriteReg | +
+ +
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__intr_8c.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__intr_8c.html new file mode 100644 index 00000000..e5f02cde --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__intr_8c.html @@ -0,0 +1,143 @@ + +
+ ++
+ 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 "xosd.h"
+
Functions | |
void | XOsd_IntrHandler (void *InstancePtr) |
int | XOsd_SetCallBack (XOsd *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef) |
void XOsd_IntrHandler | +( | +void * | +InstancePtr | +) | ++ |
+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.
+
InstancePtr | is a pointer to the XOsd instance that just interrupted. |
int XOsd_SetCallBack | +( | +XOsd * | +InstancePtr, | +|
+ | + | u32 | +HandlerType, | +|
+ | + | void * | +CallBackFunc, | +|
+ | + | void * | +CallBackRef | + |
+ | ) | ++ |
+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
+
+
InstancePtr | is a pointer to the XOsd instance to be worked on. | |
HandlerType | specifies which callback is to be attached. | |
CallBackFunc | is the address of the callback function. | |
CallBackRef | is a user data item that will be passed to the callback function when it is invoked. |
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__selftest_8c.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__selftest_8c.html new file mode 100644 index 00000000..d9a04af0 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__selftest_8c.html @@ -0,0 +1,73 @@ + +
+ ++
+ MODIFICATION HISTORY:
+
Ver Who Date Changes + ----- ------ -------- -------------------------------------------------- + 4.0 adk 02/18/14 First Release. + Implemented the following functions: + XOsd_SelfTest. ++
+#include "xosd.h"
+
Functions | |
int | XOsd_SelfTest (XOsd *InstancePtr) |
int XOsd_SelfTest | +( | +XOsd * | +InstancePtr | +) | ++ |
+This function reads Version register of OSD core and compares with zero as part of self test.
+
InstancePtr | is a pointer to the XOsd instance. |
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__sinit_8c.html b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__sinit_8c.html new file mode 100644 index 00000000..31a155ae --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/doc/html/api/xosd__sinit_8c.html @@ -0,0 +1,75 @@ + +
+ ++
+ 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 "xosd.h"
+#include "xparameters.h"
+
Functions | |
XOsd_Config * | XOsd_LookupConfig (u16 DeviceId) |
XOsd_Config* XOsd_LookupConfig | +( | +u16 | +DeviceId | +) | ++ |
+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.
+
DeviceId | is the unique core ID of the OSD core for the lookup operation. |
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/osd/examples/index.html b/XilinxProcessorIPLib/drivers/osd/examples/index.html index 5f0f10d5..aac00b53 100755 --- a/XilinxProcessorIPLib/drivers/osd/examples/index.html +++ b/XilinxProcessorIPLib/drivers/osd/examples/index.html @@ -7,11 +7,11 @@
-Copyright © 1995-2014 Xilinx, Inc. All rights reserved.
+Copyright ? 1995-2014 Xilinx, Inc. All rights reserved.
- \ No newline at end of file + diff --git a/XilinxProcessorIPLib/drivers/osd/examples/osd_selftest_example.c b/XilinxProcessorIPLib/drivers/osd/examples/osd_selftest_example.c new file mode 100755 index 00000000..63d2ec2b --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/examples/osd_selftest_example.c @@ -0,0 +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 THE +* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file 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/xosd.c b/XilinxProcessorIPLib/drivers/osd/src/xosd.c index 53df6c48..f3cb0d4e 100755 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd.c @@ -34,22 +34,62 @@ * * @file xosd.c * -* This is main code of Xilinx MVI Video On-Screen-Display (OSD) device driver. +* 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. +* 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. ** ******************************************************************************/ @@ -57,1267 +97,1319 @@ /***************************** Include Files *********************************/ #include "xosd.h" -#include "xenv.h" /************************** Constant Definitions *****************************/ -/**************************** Type Definitions *******************************/ - - /***************** Macros (Inline Functions) Definitions *********************/ +/**************************** Type Definitions *******************************/ + + /************************** Function Prototypes ******************************/ -static void PopulateLayerProperty(XOSD *InstancePtr, XOSD_Config *CfgPtr); +static void PopulateLayerProperty(XOsd *InstancePtr, XOsd_Config *CfgPtr); static void StubCallBack(void *CallBackRef); static void StubErrCallBack(void *CallBackRef, u32 ErrorMask); -/************************** Function Definition ******************************/ +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ /*****************************************************************************/ /** - * This function initializes an OSD device. This function must be called - * prior to using an OSD device. 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 OSD device instance to be worked on. - * @param CfgPtr points to the configuration structure associated with the - * OSD device. - * @param EffectiveAddr is the base address of the device. If address - * translation is being used, then this parameter must reflect the - * virtual base address. Otherwise, the physical address should be - * used. - * @return XST_SUCCESS - * - *****************************************************************************/ -int XOSD_CfgInitialize(XOSD *InstancePtr, XOSD_Config *CfgPtr, +* +* 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 */ - Xil_AssertNonvoid(InstancePtr != NULL); + /* Verify arguments. */ Xil_AssertNonvoid(CfgPtr != NULL); - Xil_AssertNonvoid(CfgPtr->LayerNum <= XOSD_MAX_NUM_OF_LAYERS); - Xil_AssertNonvoid(EffectiveAddr != (u32)NULL); + Xil_AssertNonvoid(CfgPtr->LayerNum <= (XOSD_MAX_NUM_OF_LAYERS)); + Xil_AssertNonvoid(EffectiveAddr != (u32)0x0U); /* Setup the instance */ - memset((void *)InstancePtr, 0, sizeof(XOSD)); - - memcpy((void *)&(InstancePtr->Config), (const void *)CfgPtr, - sizeof(XOSD_Config)); + (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 + /* Set all handlers to stub values, let user configure this + * data later */ - InstancePtr->VbiStartCallBack = (XOSD_CallBack) StubCallBack; - InstancePtr->VbiEndCallBack = (XOSD_CallBack) StubCallBack; - InstancePtr->FrameDoneCallBack = (XOSD_CallBack) StubCallBack; - InstancePtr->ErrCallBack = (XOSD_ErrorCallBack) StubErrCallBack; + 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 + /* 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 + /* Reset the hardware and set the flag to indicate the + * driver is ready */ - XOSD_Reset(InstancePtr); - InstancePtr->IsReady = XIL_COMPONENT_IS_READY; + XOsd_Reset(InstancePtr); + InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY); - return XST_SUCCESS; + return (XST_SUCCESS); } /*****************************************************************************/ /** - * This function chooses the type of Vertical and Horizontal Blank Input - * Polarities. - * - * @param InstancePtr is a pointer to the OSD device instance to be - * worked on. - * @param VerticalBlankPolarity indicates the type of vertical blank input - * polarity. Use any non-0 value for Active High and 0 for Active Low. - * @param HorizontalBlankPolarity indicates the type of horizontal blank input - * polarity. Use any non-0 value for Active High and 0 for Active Low. - * @return NONE. - * - *****************************************************************************/ -void XOSD_SetBlankPolarity(XOSD *InstancePtr, int VerticalBlankPolarity, - int HorizontalBlankPolarity) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - - /* Read control register and clear the current polarity setup leftover - */ - RegValue = XOSD_ReadReg(InstancePtr->Config.BaseAddress, XOSD_CTL); - RegValue &= ~(XOSD_CTL_VBP_MASK | XOSD_CTL_HBP_MASK); - - /* Set up new blank polarities */ - if (VerticalBlankPolarity) - RegValue |= XOSD_CTL_VBP_MASK; - - if (HorizontalBlankPolarity) - RegValue |= XOSD_CTL_HBP_MASK; - - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_CTL, RegValue); - - return; -} - -/*****************************************************************************/ -/** - * This function sets the screen size of the OSD Output. - * - * @param InstancePtr is a pointer to the OSD device 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. - * - *****************************************************************************/ -void XOSD_SetScreenSize(XOSD *InstancePtr, u32 Width, u32 Height) -{ - u32 RegValue; - - /* Verify arguments */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(Width > 0); - Xil_AssertVoid(Height > 0); - Xil_AssertVoid(Width <= XOSD_SS_XSIZE_MASK); - Xil_AssertVoid(Height <= (XOSD_SS_YSIZE_MASK >> XOSD_SS_YSIZE_SHIFT)); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid(Width > (u32)0x0U); + Xil_AssertVoid(Height > (u32)0x0U); + 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 */ + /* Update the screen size register */ RegValue = Width; - RegValue |= (Height << XOSD_SS_YSIZE_SHIFT) & XOSD_SS_YSIZE_MASK; - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_SS, RegValue); - - return; + 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 OSD device 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. - * - *****************************************************************************/ -void XOSD_GetScreenSize(XOSD *InstancePtr, u32 *WidthPtr, u32 *HeightPtr) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); + 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_SS); - *WidthPtr = RegValue & XOSD_SS_XSIZE_MASK; - *HeightPtr = (RegValue & XOSD_SS_YSIZE_MASK) >> XOSD_SS_YSIZE_SHIFT; - - return; + 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 OSD device instance to be - * worked on. - * @param Red indicates the red value used in the background color. - * @param Blue indicates the blue value used in the background color. - * @param Green indicates the green value used in the background color. - * @return NONE. - * - *****************************************************************************/ -void XOSD_SetBackgroundColor(XOSD *InstancePtr, u16 Red, u16 Blue, u16 Green) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - /* Update the Background Color register */ - RegValue = Green & XOSD_BC0_YG_MASK; - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_BC0, RegValue); - - RegValue = Blue & XOSD_BC1_UCBB_MASK; - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_BC1, RegValue); - - RegValue = Red & XOSD_BC2_VCRR_MASK; - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_BC2, RegValue); - - return; + /* 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 OSD device 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. - * - *****************************************************************************/ -void XOSD_GetBackgroundColor(XOSD *InstancePtr, u16 *RedPtr, u16 *BluePtr, - u16 *GreenPtr) +* +* 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) { - u32 RegValue; - - /* Verify arguments */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); + 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 */ - RegValue = XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_BC0); - *GreenPtr = (u16)(RegValue & XOSD_BC0_YG_MASK); - - RegValue = XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_BC1); - *BluePtr = (u16)(RegValue & XOSD_BC1_UCBB_MASK); - - RegValue = XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_BC2); - *RedPtr = (u16)(RegValue & XOSD_BC2_VCRR_MASK); - - return; + *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 OSD device 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 device - 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. - * - *****************************************************************************/ -void XOSD_SetLayerDimension(XOSD *InstancePtr, u8 LayerIndex, u16 XStart, +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != \ - XOSD_LAYER_TYPE_DISABLE); - Xil_AssertVoid(XSize > 0); - Xil_AssertVoid(YSize > 0); - Xil_AssertVoid((XStart + XSize) <= InstancePtr->ScreenWidth); - Xil_AssertVoid((YStart + YSize) <= InstancePtr->ScreenHeight); + 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(XSize > (u16)0x0U); + Xil_AssertVoid(YSize > (u16)0x0U); + 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 = XOSD_L0C + (LayerIndex * XOSD_LAYER_SIZE); + LayerBaseRegAddr = (u32)(XOSD_L0C_OFFSET) + (((u32)LayerIndex) * + ((u32)(XOSD_LAYER_SIZE))); /* Set the origin of the layer */ - RegValue = 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); + 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 = 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); - - return; + 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 OSD device 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 device - 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. - * - *****************************************************************************/ -void XOSD_GetLayerDimension(XOSD *InstancePtr, u8 LayerIndex, u16 *XStartPtr, +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != \ - XOSD_LAYER_TYPE_DISABLE); + 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 = XOSD_L0C + (LayerIndex * XOSD_LAYER_SIZE); + 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); - *YStartPtr = (u16) ((RegValue & XOSD_LXP_YSTART_MASK) >> - XOSD_LXP_YSTART_SHIFT); + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXP))); + *XStartPtr = (u16)((RegValue) & (XOSD_LXP_XSTART_MASK)); + *YStartPtr = (u16)((RegValue) & (XOSD_LXP_YSTART_MASK)) >> + (XOSD_LXP_YSTART_SHIFT); /* 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); - - return; + 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 OSD device 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 device - 1). - * @param GlobalAlphaEnble 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. - * - *****************************************************************************/ -void XOSD_SetLayerAlpha(XOSD *InstancePtr, u8 LayerIndex, u16 GlobalAlphaEnble, - u16 GlobalAlphaValue) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != \ - XOSD_LAYER_TYPE_DISABLE); + 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 = XOSD_L0C + (LayerIndex * XOSD_LAYER_SIZE); + 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); + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC))); - /* Update the Global Alpha Enable and the Global Alpha Value fields */ - if (GlobalAlphaEnble) - RegValue |= XOSD_LXC_GALPHAEN_MASK; - else - RegValue &= ~XOSD_LXC_GALPHAEN_MASK; - - RegValue &= ~XOSD_LXC_ALPHA_MASK; - RegValue |= (((u32)GlobalAlphaValue) << XOSD_LXC_ALPHA_SHIFT) & - XOSD_LXC_ALPHA_MASK; - XOSD_WriteReg(InstancePtr->Config.BaseAddress, - LayerBaseRegAddr + XOSD_LXC, RegValue); - - return; + /* Update the global alpha enable and the global alpha value fields */ + if (GlobalAlphaEnable != (u16)0x0U) { + 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 OSD device 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 device - 1). - * @param GlobalAlphaEnblePtr 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. - * - *****************************************************************************/ -void XOSD_GetLayerAlpha(XOSD *InstancePtr, u8 LayerIndex, - u16 *GlobalAlphaEnblePtr, u16 *GlobalAlphaValuePtr) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != \ - XOSD_LAYER_TYPE_DISABLE); - Xil_AssertVoid(GlobalAlphaEnblePtr != 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 = XOSD_L0C + (LayerIndex * XOSD_LAYER_SIZE); + 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); + /* 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 + /* Get the info of the global alpha enable and the global alpha value * fields */ - *GlobalAlphaEnblePtr = (u16) - ((RegValue & XOSD_LXC_GALPHAEN_MASK) ? 1 : 0); - *GlobalAlphaValuePtr = (u16) ((RegValue & XOSD_LXC_ALPHA_MASK) >> - XOSD_LXC_ALPHA_SHIFT); - - return; + *GlobalAlphaEnablePtr = (u16)((((RegValue) & + ((u32)(XOSD_LXC_GALPHAEN_MASK))) == + (XOSD_LXC_GALPHAEN_MASK)) ? 1U : 0U); + *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 OSD device 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 device - 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. - * - *****************************************************************************/ -void XOSD_SetLayerPriority(XOSD *InstancePtr, u8 LayerIndex, u8 Priority) +* +* 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 == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != \ - XOSD_LAYER_TYPE_DISABLE); - Xil_AssertVoid(Priority <= XOSD_LAYER_PRIORITY_7); + 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 = XOSD_L0C + (LayerIndex * XOSD_LAYER_SIZE); + 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); + /* Read the current layer control register value */ + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC))); - /* Update the Priority field */ - RegValue &= ~XOSD_LXC_PRIORITY_MASK; - RegValue |= (((u32)Priority) << XOSD_LXC_PRIORITY_SHIFT) - & XOSD_LXC_PRIORITY_MASK; - XOSD_WriteReg(InstancePtr->Config.BaseAddress, - LayerBaseRegAddr + XOSD_LXC, RegValue); - - return; + /* 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 OSD device 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 device - 1). - * @param PriorityPtr will point to the priority used on the layer after this - * function returns. Use XOSD_LAYER_PRIORITY_... defined in xosd_hw.h - * to interpret the value. - * @return NONE. - * - *****************************************************************************/ -void XOSD_GetLayerPriority(XOSD *InstancePtr, u8 LayerIndex, u8 *PriorityPtr) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != \ - XOSD_LAYER_TYPE_DISABLE); + 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 = XOSD_L0C + (LayerIndex * XOSD_LAYER_SIZE); + 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); + /* 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); - - return; + /* 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 OSD device 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 device - 1). - * @return NONE. - * - *****************************************************************************/ -void XOSD_EnableLayer(XOSD *InstancePtr, u8 LayerIndex) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != \ - XOSD_LAYER_TYPE_DISABLE); + 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 = XOSD_L0C + (LayerIndex * XOSD_LAYER_SIZE); + 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); + /* 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); - - return; + /* 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 OSD device 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 device - 1). - * @return NONE. - * - *****************************************************************************/ -void XOSD_DisableLayer(XOSD *InstancePtr, u8 LayerIndex) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(LayerIndex < InstancePtr->Config.LayerNum); - Xil_AssertVoid(InstancePtr->Layers[LayerIndex].LayerType != \ - XOSD_LAYER_TYPE_DISABLE); + 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 = XOSD_L0C + (LayerIndex * XOSD_LAYER_SIZE); + 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); + /* Read the current layer control register value */ + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC))); - /* Clear the Layer Enable field */ - RegValue &= ~XOSD_LXC_EN_MASK; - XOSD_WriteReg(InstancePtr->Config.BaseAddress, - LayerBaseRegAddr + XOSD_LXC, - RegValue); + /* Clear the layer enable field */ + RegValue &= (u32)(~(XOSD_LXC_EN_MASK)); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + ((LayerBaseRegAddr) + (XOSD_LXC)), RegValue); } /*****************************************************************************/ /** - * This function loads color LUT data into an OSD Graphics Controller Bank. - * - * @param InstancePtr is a pointer to the OSD device 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. - * - *****************************************************************************/ -void XOSD_LoadColorLUTBank(XOSD *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 *ColorData) +* +* 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 i; + u32 Index; u32 RegValue; - /* Verify arguments */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(GcIndex < InstancePtr->Config.LayerNum); + 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); + (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, RegValue); + 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.S_AXIS_VIDEO_DATA_WIDTH == 8) - { - for (i = 0; - i < (InstancePtr->Layers[GcIndex].ColorLutSize * XOSD_COLOR_ENTRY_SIZE) - / sizeof(u32); - i++) { - XOSD_WriteReg(InstancePtr->Config.BaseAddress, - XOSD_GCD, ColorData[i]); - } - } - else // for video channel size of 10 or 12, the color size is 64bits - { - for (i = 0; - i < (InstancePtr->Layers[GcIndex].ColorLutSize * 2 * XOSD_COLOR_ENTRY_SIZE) - / sizeof(u32); - i++) { - XOSD_WriteReg(InstancePtr->Config.BaseAddress, - XOSD_GCD, ColorData[i]); - } - - } + if(InstancePtr->Config.SlaveAxisVideoDataWidth == (u16)(XOSD_DATA_8)) { + for(Index = 0x0U; + Index < ((InstancePtr->Layers[GcIndex].ColorLutSize * + (XOSD_COLOR_ENTRY_SIZE)) / sizeof(u32)); + 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 { + for (Index = 0U; + 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]); + } + } /* Set the active color LUT bank */ - RegValue = XOSD_ReadReg(InstancePtr->Config.BaseAddress, XOSD_GCABA); - RegValue &= ~(1 << (XOSD_GCABA_COL_SHIFT + GcIndex)); - RegValue |= ((u32)BankIndex) << (XOSD_GCABA_COL_SHIFT + (u32)GcIndex); - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_GCABA, RegValue); + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_GCABA_OFFSET)); + RegValue &= ((u32)(~1U) << (((u32)(XOSD_GCABA_COL_SHIFT)) + + ((u32)GcIndex))); - return; + 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 OSD device 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. - * - *****************************************************************************/ -void XOSD_LoadCharacterSetBank(XOSD *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 *CharSetData) +* +* 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 i; + u32 Index; - /* Verify arguments */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(GcIndex < InstancePtr->Config.LayerNum); + 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); + (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, RegValue); + 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 /= XOSD_FONT_BIT_TO_BYTE; - FontWriteNum *= ((u32)InstancePtr->Layers[GcIndex].FontNumChars); - FontWriteNum /= sizeof(u32); + 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 */ - for (i = 0; i < FontWriteNum; i++) { - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_GCD, - CharSetData[i]); + for (Index = 0x0U; Index < FontWriteNum; Index++) { + 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); - RegValue &= ~(1 << (XOSD_GCABA_CHR_SHIFT + GcIndex)); - RegValue |= ((u32)BankIndex) << (XOSD_GCABA_CHR_SHIFT + (u32)GcIndex); - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_GCABA, RegValue); + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_GCABA_OFFSET)); + RegValue &= (u32)((~((u32)1U << (XOSD_GCABA_CHR_SHIFT)) + + ((u32)GcIndex))); + 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 OSD device 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. - * - *****************************************************************************/ -void XOSD_LoadTextBank(XOSD *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 *TextData) +* +* 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 i; + u32 Index; u32 RegValue; - u32 Data; - /* Verify arguments */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(GcIndex < InstancePtr->Config.LayerNum); + 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); + (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, RegValue); + 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 */ - for (i = 0; - i < (u32)(InstancePtr->Layers[GcIndex].TextNumStrings) * - (u32)(InstancePtr->Layers[GcIndex].TextMaxStringLength) / - sizeof(u32); - i++) { - XOSD_WriteReg(InstancePtr->Config.BaseAddress, - XOSD_GCD, TextData[i]); + for (Index = 0x0U; + 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]); } /* Set the active text bank */ - RegValue = XOSD_ReadReg(InstancePtr->Config.BaseAddress, XOSD_GCABA); - RegValue &= ~(1 << (XOSD_GCABA_TXT_SHIFT + GcIndex)); - RegValue |= ((u32)BankIndex) << (XOSD_GCABA_TXT_SHIFT + (u32)GcIndex); - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_GCABA, RegValue); + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_GCABA_OFFSET)); + RegValue &= ~(1U << ((XOSD_GCABA_TXT_SHIFT) + GcIndex)); - return; + 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 an OSD device. - * - * @param InstancePtr is a pointer to the OSD device 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 choose as - * active. - * @param TextBankIndex indicates the Text Data bank to be choose as active. - * @param InstructionBankIndex indicates the Instruction bank to be choose as - * active. - * @return NONE. - * - *****************************************************************************/ -void XOSD_SetActiveBank(XOSD *InstancePtr, u8 GcIndex, u8 ColorBankIndex, - u8 CharBankIndex, u8 TextBankIndex, - u8 InstructionBankIndex) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(GcIndex < InstancePtr->Config.LayerNum); + 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_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); - RegValue &= ~(1 << GcIndex) & XOSD_GCABA_INS_MASK; - RegValue &= ~(1 << (XOSD_GCABA_COL_SHIFT + GcIndex)) & - XOSD_GCABA_COL_MASK; - RegValue &= ~(1 << (XOSD_GCABA_TXT_SHIFT + GcIndex)) & - XOSD_GCABA_TXT_MASK; - RegValue &= ~(1 << (XOSD_GCABA_CHR_SHIFT + GcIndex)) & - XOSD_GCABA_CHR_MASK; + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_GCABA_OFFSET)); + RegValue &= ~(1U << GcIndex) & (XOSD_GCABA_INS_MASK); + RegValue &= ~(1U << ((XOSD_GCABA_COL_SHIFT) + (GcIndex))) & + (XOSD_GCABA_COL_MASK); + RegValue &= ~(1U << ((XOSD_GCABA_TXT_SHIFT) + (GcIndex))) & + (XOSD_GCABA_TXT_MASK); + RegValue &= ~(1U << ((XOSD_GCABA_CHR_SHIFT) + (GcIndex))) & + (XOSD_GCABA_CHR_MASK); /* Choose the active banks */ - RegValue |= (((u32)InstructionBankIndex) << 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, RegValue); - - return; + 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 an OSD. - * - * @param InstancePtr is a pointer to the OSD device 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. - * - *****************************************************************************/ -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) +* +* 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 */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); + Xil_AssertVoid(InstancePtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); Xil_AssertVoid(InstructionPtr != NULL); - Xil_AssertVoid(GcIndex < InstancePtr->Config.LayerNum); + 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_BOX) || - (ObjType == XOSD_INS_OPCODE_LINE) || - (ObjType == XOSD_INS_OPCODE_TXT) || - (ObjType == XOSD_INS_OPCODE_BOXTXT)); - Xil_AssertVoid(XEnd < InstancePtr->ScreenWidth); - Xil_AssertVoid(YEnd < InstancePtr->ScreenHeight); - Xil_AssertVoid(TextIndex < InstancePtr->Layers[GcIndex].TextNumStrings); + (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 */ - memset((void *)InstructionPtr, 0, XOSD_INS_SIZE * sizeof(u32)); + (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; + 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; + 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; + 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; + Value = ((u32)ColorIndex) & (XOSD_INS3_COL_MASK); InstructionPtr[XOSD_INS3] = Value; - - return; } /*****************************************************************************/ /** - * This function load an instruction list to be used by an Graphic Controller - * in an OSD device. - * - * @param InstancePtr is a pointer to the OSD device 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 device. 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. - * - *****************************************************************************/ -void XOSD_LoadInstructionList(XOSD *InstancePtr, u8 GcIndex, u8 BankIndex, - u32 *InstSetPtr, u32 InstNum) +* +* 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 i; + u32 Index; - /* Verify arguments */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertVoid(GcIndex < InstancePtr->Config.LayerNum); + 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); + (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, RegValue); + 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); + for (Index = 0U; Index < (InstNum * (XOSD_INS_SIZE)); Index++) { + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + (XOSD_GCD_OFFSET), InstSetPtr[Index]); + } - for (i = 0; i < InstNum * XOSD_INS_SIZE; i++) - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_GCD, - InstSetPtr[i]); - - /* - * 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) - for (i = 0; i < XOSD_INS_SIZE; i++) - XOSD_WriteReg(InstancePtr->Config.BaseAddress, - XOSD_GCD, 0); - + if (InstNum < InstancePtr->Layers[GcIndex].InstructionNum) { + for (Index = 0x0U; Index < (XOSD_INS_SIZE); Index++) { + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + (XOSD_GCD_OFFSET), 0x0U); + } + } /* Set the active instruction bank */ - RegValue = XOSD_ReadReg(InstancePtr->Config.BaseAddress, XOSD_GCABA); - RegValue &= ~(1 << GcIndex); - RegValue |= BankIndex << GcIndex; - XOSD_WriteReg(InstancePtr->Config.BaseAddress, XOSD_GCABA, RegValue); - - return; + RegValue = XOsd_ReadReg(InstancePtr->Config.BaseAddress, + (XOSD_GCABA_OFFSET)); + RegValue &= ~(1U << GcIndex); + RegValue |= ((u32)BankIndex << (u32)GcIndex); + XOsd_WriteReg(InstancePtr->Config.BaseAddress, + (XOSD_GCABA_OFFSET), RegValue); } /*****************************************************************************/ /* - * This function populates the Layer array in the OSD driver instance with - * the properties of all layers. This is to help fetch the info faster later. - * - * @param InstancePtr is a pointer to the OSD device instance to be worked on. - * @param CfgPtr points to the configuration structure associated with the - * OSD device. - * @return None - * - *****************************************************************************/ -static void PopulateLayerProperty(XOSD *InstancePtr, XOSD_Config *CfgPtr) +* +* 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 *IP; - XOSD_Config *Cfg; + XOsd *IpTemp = NULL; + XOsd_Config *Cfg = NULL; - /* Verify arguments */ + /* Verify arguments. */ Xil_AssertVoid(InstancePtr != NULL); Xil_AssertVoid(CfgPtr != NULL); /* Use short variable names to keep the lines in this function * shorter */ - IP = InstancePtr; + IpTemp = InstancePtr; + Xil_AssertVoid(IpTemp != NULL); Cfg = CfgPtr; + Xil_AssertVoid(Cfg != NULL); /* Layer #0 */ - IP->Layers[0].LayerType = Cfg->Layer0Type; - IP->Layers[0].InstructionNum = Cfg->Layer0InstructionMemSize; - IP->Layers[0].InstructionBoxEnable = Cfg->Layer0InstructionBoxEnable; - IP->Layers[0].InstructionLineEnable = Cfg->Layer0InstructionLineEnable; - IP->Layers[0].InstructionTextEnable = Cfg->Layer0InstructionTextEnable; - IP->Layers[0].ColorLutSize = Cfg->Layer0ColorLutSize; - IP->Layers[0].ColorLutMemoryType = Cfg->Layer0ColorLutMemoryType; - IP->Layers[0].FontNumChars = Cfg->Layer0FontNumChars; - IP->Layers[0].FontWidth = Cfg->Layer0FontWidth; - IP->Layers[0].FontHeight = Cfg->Layer0FontHeight; - IP->Layers[0].FontBitsPerPixel = Cfg->Layer0FontBitsPerPixel; - IP->Layers[0].FontAsciiOffset = Cfg->Layer0FontAsciiOffset; - IP->Layers[0].TextNumStrings = Cfg->Layer0TextNumStrings; - IP->Layers[0].TextMaxStringLength = Cfg->Layer0TextMaxStringLength; + 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 */ - IP->Layers[1].LayerType = Cfg->Layer1Type; - IP->Layers[1].InstructionNum = Cfg->Layer1InstructionMemSize; - IP->Layers[1].InstructionBoxEnable = Cfg->Layer1InstructionBoxEnable; - IP->Layers[1].InstructionLineEnable = Cfg->Layer1InstructionLineEnable; - IP->Layers[1].InstructionTextEnable = Cfg->Layer1InstructionTextEnable; - IP->Layers[1].ColorLutSize = Cfg->Layer1ColorLutSize; - IP->Layers[1].ColorLutMemoryType = Cfg->Layer1ColorLutMemoryType; - IP->Layers[1].FontNumChars = Cfg->Layer1FontNumChars; - IP->Layers[1].FontWidth = Cfg->Layer1FontWidth; - IP->Layers[1].FontHeight = Cfg->Layer1FontHeight; - IP->Layers[1].FontBitsPerPixel = Cfg->Layer1FontBitsPerPixel; - IP->Layers[1].FontAsciiOffset = Cfg->Layer1FontAsciiOffset; - IP->Layers[1].TextNumStrings = Cfg->Layer1TextNumStrings; - IP->Layers[1].TextMaxStringLength = Cfg->Layer1TextMaxStringLength; + 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 */ - IP->Layers[2].LayerType = Cfg->Layer2Type; - IP->Layers[2].InstructionNum = Cfg->Layer2InstructionMemSize; - IP->Layers[2].InstructionBoxEnable = Cfg->Layer2InstructionBoxEnable; - IP->Layers[2].InstructionLineEnable = Cfg->Layer2InstructionLineEnable; - IP->Layers[2].InstructionTextEnable = Cfg->Layer2InstructionTextEnable; - IP->Layers[2].ColorLutSize = Cfg->Layer2ColorLutSize; - IP->Layers[2].ColorLutMemoryType = Cfg->Layer2ColorLutMemoryType; - IP->Layers[2].FontNumChars = Cfg->Layer2FontNumChars; - IP->Layers[2].FontWidth = Cfg->Layer2FontWidth; - IP->Layers[2].FontHeight = Cfg->Layer2FontHeight; - IP->Layers[2].FontBitsPerPixel = Cfg->Layer2FontBitsPerPixel; - IP->Layers[2].FontAsciiOffset = Cfg->Layer2FontAsciiOffset; - IP->Layers[2].TextNumStrings = Cfg->Layer2TextNumStrings; - IP->Layers[2].TextMaxStringLength = Cfg->Layer2TextMaxStringLength; + 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 */ - IP->Layers[3].LayerType = Cfg->Layer3Type; - IP->Layers[3].InstructionNum = Cfg->Layer3InstructionMemSize; - IP->Layers[3].InstructionBoxEnable = Cfg->Layer3InstructionBoxEnable; - IP->Layers[3].InstructionLineEnable = Cfg->Layer3InstructionLineEnable; - IP->Layers[3].InstructionTextEnable = Cfg->Layer3InstructionTextEnable; - IP->Layers[3].ColorLutSize = Cfg->Layer3ColorLutSize; - IP->Layers[3].ColorLutMemoryType = Cfg->Layer3ColorLutMemoryType; - IP->Layers[3].FontNumChars = Cfg->Layer3FontNumChars; - IP->Layers[3].FontWidth = Cfg->Layer3FontWidth; - IP->Layers[3].FontHeight = Cfg->Layer3FontHeight; - IP->Layers[3].FontBitsPerPixel = Cfg->Layer3FontBitsPerPixel; - IP->Layers[3].FontAsciiOffset = Cfg->Layer3FontAsciiOffset; - IP->Layers[3].TextNumStrings = Cfg->Layer3TextNumStrings; - IP->Layers[3].TextMaxStringLength = Cfg->Layer3TextMaxStringLength; + 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 */ - IP->Layers[4].LayerType = Cfg->Layer4Type; - IP->Layers[4].InstructionNum = Cfg->Layer4InstructionMemSize; - IP->Layers[4].InstructionBoxEnable = Cfg->Layer4InstructionBoxEnable; - IP->Layers[4].InstructionLineEnable = Cfg->Layer4InstructionLineEnable; - IP->Layers[4].InstructionTextEnable = Cfg->Layer4InstructionTextEnable; - IP->Layers[4].ColorLutSize = Cfg->Layer4ColorLutSize; - IP->Layers[4].ColorLutMemoryType = Cfg->Layer4ColorLutMemoryType; - IP->Layers[4].FontNumChars = Cfg->Layer4FontNumChars; - IP->Layers[4].FontWidth = Cfg->Layer4FontWidth; - IP->Layers[4].FontHeight = Cfg->Layer4FontHeight; - IP->Layers[4].FontBitsPerPixel = Cfg->Layer4FontBitsPerPixel; - IP->Layers[4].FontAsciiOffset = Cfg->Layer4FontAsciiOffset; - IP->Layers[4].TextNumStrings = Cfg->Layer4TextNumStrings; - IP->Layers[4].TextMaxStringLength = Cfg->Layer4TextMaxStringLength; + 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 */ - IP->Layers[5].LayerType = Cfg->Layer5Type; - IP->Layers[5].InstructionNum = Cfg->Layer5InstructionMemSize; - IP->Layers[5].InstructionBoxEnable = Cfg->Layer5InstructionBoxEnable; - IP->Layers[5].InstructionLineEnable = Cfg->Layer5InstructionLineEnable; - IP->Layers[5].InstructionTextEnable = Cfg->Layer5InstructionTextEnable; - IP->Layers[5].ColorLutSize = Cfg->Layer5ColorLutSize; - IP->Layers[5].ColorLutMemoryType = Cfg->Layer5ColorLutMemoryType; - IP->Layers[5].FontNumChars = Cfg->Layer5FontNumChars; - IP->Layers[5].FontWidth = Cfg->Layer5FontWidth; - IP->Layers[5].FontHeight = Cfg->Layer5FontHeight; - IP->Layers[5].FontBitsPerPixel = Cfg->Layer5FontBitsPerPixel; - IP->Layers[5].FontAsciiOffset = Cfg->Layer5FontAsciiOffset; - IP->Layers[5].TextNumStrings = Cfg->Layer5TextNumStrings; - IP->Layers[5].TextMaxStringLength = Cfg->Layer5TextMaxStringLength; + 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 */ - IP->Layers[6].LayerType = Cfg->Layer6Type; - IP->Layers[6].InstructionNum = Cfg->Layer6InstructionMemSize; - IP->Layers[6].InstructionBoxEnable = Cfg->Layer6InstructionBoxEnable; - IP->Layers[6].InstructionLineEnable = Cfg->Layer6InstructionLineEnable; - IP->Layers[6].InstructionTextEnable = Cfg->Layer6InstructionTextEnable; - IP->Layers[6].ColorLutSize = Cfg->Layer6ColorLutSize; - IP->Layers[6].ColorLutMemoryType = Cfg->Layer6ColorLutMemoryType; - IP->Layers[6].FontNumChars = Cfg->Layer6FontNumChars; - IP->Layers[6].FontWidth = Cfg->Layer6FontWidth; - IP->Layers[6].FontHeight = Cfg->Layer6FontHeight; - IP->Layers[6].FontBitsPerPixel = Cfg->Layer6FontBitsPerPixel; - IP->Layers[6].FontAsciiOffset = Cfg->Layer6FontAsciiOffset; - IP->Layers[6].TextNumStrings = Cfg->Layer6TextNumStrings; - IP->Layers[6].TextMaxStringLength = Cfg->Layer6TextMaxStringLength; + 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 */ - IP->Layers[7].LayerType = Cfg->Layer7Type; - IP->Layers[7].InstructionNum = Cfg->Layer7InstructionMemSize; - IP->Layers[7].InstructionBoxEnable = Cfg->Layer7InstructionBoxEnable; - IP->Layers[7].InstructionLineEnable = Cfg->Layer7InstructionLineEnable; - IP->Layers[7].InstructionTextEnable = Cfg->Layer7InstructionTextEnable; - IP->Layers[7].ColorLutSize = Cfg->Layer7ColorLutSize; - IP->Layers[7].ColorLutMemoryType = Cfg->Layer7ColorLutMemoryType; - IP->Layers[7].FontNumChars = Cfg->Layer7FontNumChars; - IP->Layers[7].FontWidth = Cfg->Layer7FontWidth; - IP->Layers[7].FontHeight = Cfg->Layer7FontHeight; - IP->Layers[7].FontBitsPerPixel = Cfg->Layer7FontBitsPerPixel; - IP->Layers[7].FontAsciiOffset = Cfg->Layer7FontAsciiOffset; - IP->Layers[7].TextNumStrings = Cfg->Layer7TextNumStrings; - IP->Layers[7].TextMaxStringLength = Cfg->Layer7TextMaxStringLength; + 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 */ - IP->Layers[0].InstructionNum /= XOSD_INS_MEM_SIZE_TO_NUM; - IP->Layers[1].InstructionNum /= XOSD_INS_MEM_SIZE_TO_NUM; - IP->Layers[2].InstructionNum /= XOSD_INS_MEM_SIZE_TO_NUM; - IP->Layers[3].InstructionNum /= XOSD_INS_MEM_SIZE_TO_NUM; - IP->Layers[4].InstructionNum /= XOSD_INS_MEM_SIZE_TO_NUM; - IP->Layers[5].InstructionNum /= XOSD_INS_MEM_SIZE_TO_NUM; - IP->Layers[6].InstructionNum /= XOSD_INS_MEM_SIZE_TO_NUM; - IP->Layers[7].InstructionNum /= XOSD_INS_MEM_SIZE_TO_NUM; - return; + 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 an OSD device. +* This function returns the Version of the OSD core. * -* @param InstancePtr is a pointer to the OSD device instance to be -* worked on. -* @param Major points to an unsigned 16-bit variable that will be assigned -* with the major version number after this function returns. Value -* range is from 0x0 to 0xF. -* @param Minor points to an unsigned 16-bit variable that will be assigned -* with the minor version number after this function returns. Value -* range is from 0x00 to 0xFF. -* @param Revision points to an unsigned 16-bit variable that will be assigned -* with the revision version number after this function returns. Value -* range is from 0xA to 0xF. -* @return None. -* @note Example: Device version should read v2.01.c if major version number -* is 0x2, minor version number is 0x1, and revision version number is -* 0xC. +* @param InstancePtr is a pointer to the XOsd instance to be worked on. +* +* @return Contents of the Version register. +* +* @note None. * ******************************************************************************/ -void XOSD_GetVersion(XOSD *InstancePtr, u16 *Major, u16 *Minor, u16 *Revision) +u32 XOsd_GetVersion(XOsd *InstancePtr) { - u32 Version; + u32 Data; - /* Verify arguments */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(Major != NULL); - Xil_AssertVoid(Minor != NULL); - Xil_AssertVoid(Revision != NULL); + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); - /* Read device version */ - Version = XOSD_ReadReg(InstancePtr->Config.BaseAddress, XOSD_VER); + /* Read core version */ + Data = XOsd_ReadReg(InstancePtr->Config.BaseAddress, XOSD_VER_OFFSET); - /* Parse the version and pass the info to the caller via output - * parameters - */ - *Major = (u16) - ((Version & XOSD_VER_MAJOR_MASK) >> XOSD_VER_MAJOR_SHIFT); - - *Minor = (u16) - ((Version & XOSD_VER_MINOR_MASK) >> XOSD_VER_MINOR_SHIFT); - - *Revision = (u16) - ((Version & XOSD_VER_REV_MASK) >> XOSD_VER_REV_SHIFT); - - return; + return Data; } /*****************************************************************************/ -/* - * 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. - * - *****************************************************************************/ +/** +* +* 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. - * - *****************************************************************************/ +/** +* +* 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 feccf66f..075e8adf 100755 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd.h +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd.h @@ -34,34 +34,32 @@ * * @file xosd.h * -* This is main header file of the Xilinx MVI On-Screen-Display (OSD) device -* driver. +* 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 MVI OSD has the following main features: +* Xilinx OSD core has the following main features: * -* - Read Video Data one of three sources -* - VFBC/Frame Buffer -* - VideoBus -* - 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 +* - 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 +* - VideoBus. * * For a full description of OSD features, please see the hardware spec. * * Interrupt Service * -* Four interrupt types are supported: +* Three interrupt types are supported: * -* - Vertical Blank Interval Start Interrupt -* - Vertical Blank Interval End Interrupt +* - Processing Start Interrupt * - Frame Done Interrupt * - Error Interrupt * @@ -81,26 +79,133 @@ *
* 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 -* +* 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 /* prevent circular inclusions */ -#define XOSD_H /* by using protection macros */ +#ifndef XOSD_H_ +#define XOSD_H_ /**< Prevent circular inclusions by + * using protection macros */ #ifdef __cplusplus extern "C" { @@ -117,578 +222,680 @@ extern "C" { /** @name Interrupt types for setting up callbacks * @{ */ -#define XOSD_HANDLER_FRAMEDONE 1 /**< Frame Done interrupt */ -#define XOSD_HANDLER_VBISTART 2 /**< Vertical Blank Interval Start - * interrupt */ -#define XOSD_HANDLER_VBIEND 3 /**< Vertical Blank Interval End - * interrupt */ -#define XOSD_HANDLER_ERROR 4 /**< Error condition interrupt */ +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 +#define XOSD_LoadInstructionList XOsd_LoadInstructionList +#define XOSD_LookupConfig XOsd_LookupConfig +#define XOSD_IntrHandler XOsd_IntrHandler +#define XOSD_SetCallBack XOsd_SetCallBack /*@}*/ /**************************** Type Definitions *******************************/ /** - * OSD device configuration structure. - * Each OSD device should have a configuration structure associated - */ +* OSD core configuration structure. +* Each OSD 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 device's registers */ - u16 LayerNum; /**< The number of Layers */ - u16 S_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 */ + 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 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 */ + 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 */ + 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 */ + 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 */ + 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 */ + 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 */ + 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 */ + 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; + 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 XOSD Layer info structure - */ +* 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 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 FontAsciiOffset; /**< Font: ASCII offset of + * 1st character */ u16 TextNumStrings; /**< Text: Number of Strings */ - u16 TextMaxStringLength; /**< Text: Maximum length of a - * String */ + u16 TextMaxStringLength; /**< Text: Maximum length of + * a String */ +} XOsd_Layer; -} 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); /** - * 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 (*XOSD_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 XOSD_IXR_* values defined in - * xosd_hw.h - */ -typedef void (*XOSD_ErrorCallBack) (void *CallBackRef, u32 ErrorMask); - -/** - * The XOSD driver instance data. An instance must be allocated for each - * OSD device in use. - */ +* The XOsd instance data. An instance must be allocated for each +* OSD core in use. +*/ typedef struct { - XOSD_Config Config; /**< Hardware configuration */ - u32 IsReady; /**< Device and the driver instance are - * initialized */ - int InstructionInExternalMem; /**< Flag indicating if the instruction - list is from external memory */ + 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 */ + XOsd_Layer Layers[(XOSD_MAX_NUM_OF_LAYERS)]; /**< Properties of + * layers */ - XOSD_CallBack VbiStartCallBack; /**< Call back for Vertical Blank - * Interval (VBI) Start interrupt */ - void *VbiStartRef; /**< To be passed to the VBI Start + /* + * IRQ Callbacks + */ + XOsd_CallBack ProcStartCallBack; /**< Call back for Processing + * Start interrupt */ + void *ProcStartRef; /**< To be passed to the + * Process Start * interrupt callback */ - - XOSD_CallBack VbiEndCallBack; /**< Call back for Vertical Blank - * Interval (VBI) End interrupt */ - void *VbiEndRef; /**< To be passed to the VBI End - * 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; + 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]; +* The XOsd_Instruction data structure for holding one GC instruction. +*/ +typedef u32 XOsd_Instruction[XOSD_INS_SIZE]; /***************** Macros (Inline Functions) Definitions *********************/ /*****************************************************************************/ /** * -* This macro enables an OSD device. +* This function macro enables an OSD core. * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* @param InstancePtr is a pointer to the XOsd instance to be worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XOSD_Enable(XOSD *InstancePtr); +* @note C-style signature: +* void XOsd_Enable(XOsd *InstancePtr) * ******************************************************************************/ -#define XOSD_Enable(InstancePtr) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_CTL, \ - XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_CTL) | \ - XOSD_CTL_EN_MASK) +#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 macro disables an OSD device. +* This function macro disables an OSD core. * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* @param InstancePtr is a pointer to the XOsd instance to be worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XOSD_Disable(XOSD *InstancePtr); +* @note C-style signature: +* void XOsd_Disable(XOsd *InstancePtr) * ******************************************************************************/ -#define XOSD_Disable(InstancePtr) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_CTL, \ - XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_CTL) & \ - (~XOSD_CTL_EN_MASK)) +#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 macro tell an OSD device to pick up the register updates. +* 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 OSD device instance to be worked on. +* @param InstancePtr is a pointer to the XOsd instance to be worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XOSD_RegUpdateEnable(XOSD *InstancePtr); +* @note C-style signature: +* void XOsd_RegUpdateEnable(XOsd *InstancePtr) * ******************************************************************************/ -#define XOSD_RegUpdateEnable(InstancePtr) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_CTL, \ - XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_CTL) | \ - XOSD_CTL_RUE_MASK) +#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 macro tell an OSD device to ignore the register updates. +* 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 OSD device instance to be worked on. +* @param InstancePtr is a pointer to the XOsd instance to be worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XOSD_RegUpdateDisable(XOSD *InstancePtr); +* @note C-style signature: +* void XOsd_RegUpdateDisable(XOsd *InstancePtr) * ******************************************************************************/ -#define XOSD_RegUpdateDisable(InstancePtr) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_CTL, \ - XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_CTL) & \ - (~XOSD_CTL_RUE_MASK)) +#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 macro resets an OSD device. +* This function macro resets an OSD core This effects the core immediately, and +* may cause image tearing. * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* @param InstancePtr is a pointer to the XOsd instance to be worked on. * -* @return None. +* @return None. * -* @note -* C-style signature: -* void XOSD_Reset(XOSD *InstancePtr); +* @note C-style signature: +* void XOsd_Reset(XOsd *InstancePtr) +* This bit automatically clears when reset complete. * ******************************************************************************/ -#define XOSD_Reset(InstancePtr) \ +#define XOsd_Reset(InstancePtr) \ { \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_RST, \ - XOSD_RST_RESET); \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_CTL, 0); \ - (InstancePtr)->InstructionInExternalMem = 0; \ - (InstancePtr)->ScreenHeight = 0; \ - (InstancePtr)->ScreenWidth = 0; \ + 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 macro enables the global interrupt on an OSD device. +* This function macro enables the given individual interrupt(s) on the +* OSD core. * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* @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. +* @return None. * -* @note -* C-style signature: -* void XOSD_IntrEnableGlobal(XOSD *InstancePtr); +* @note The existing enabled interrupt(s) will remain enabled. +* C-style signature: +* void XOsd_IntrEnable(XOsd *InstancePtr, u32 IntrType) * ******************************************************************************/ -#define XOSD_IntrEnableGlobal(InstancePtr) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_GIER, \ - XOSD_GIER_GIE_MASK) +#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 macro disables the global interrupt on an OSD device. +* This function macro disables the given individual interrupt(s) on the +* OSD core. * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* @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. +* @return None. * -* @note -* C-style signature: -* void XOSD_IntrDisableGlobal(XOSD *InstancePtr); +* @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_IntrDisableGlobal(InstancePtr) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_GIER, 0) +#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 macro enables the given individual interrupt(s) on an OSD device. +* This function macro returns the pending interrupts of the OSD core. * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* @param InstancePtr is a pointer to the XOsd instance to be worked on. * -* @param IntrType is the type of the interrupts to enable. Use OR'ing of -* XOSD_IXR_* constants defined in xosd_hw.h to create this parameter -* value. +* @return The pending interrupts of the OSD core. Use XOSD_IXR_*_MASK +* constants defined in xosd_hw.h to interpret this value. * -* @return None -* -* @note -* -* The existing enabled interrupt(s) will remain enabled. -* -* C-style signature: -* void XOSD_IntrEnable(XOSD *InstancePtr, u32 IntrType) +* @note C-style signature: +* u32 XOsd_IntrGetPending(XOsd *InstancePtr) * ******************************************************************************/ -#define XOSD_IntrEnable(InstancePtr, IntrType) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_IER, \ - ((IntrType) & XOSD_IXR_ALLINTR_MASK) | \ - XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_IER)) +#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 macro disables the given individual interrupt(s) on an OSD device. +* This function macro clears/acknowledges pending interrupts of the +* OSD core. * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* @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. * -* @param IntrType is the type of the interrupts to disable. Use OR'ing of -* XOSD_IXR_* constants defined in xosd_hw.h to create this parameter -* value. +* @return None * -* @return None -* -* @note -* -* Any other interrupt not covered by parameter IntrType, if enabled before -* this macro is called, will remain enabled. -* -* C-style signature: -* void XOSD_IntrDisable(XOSD *InstancePtr, u32 IntrType) +* @note C-style signature: +* void XOsd_IntrClear(XOsd *InstancePtr, u32 IntrType) * ******************************************************************************/ -#define XOSD_IntrDisable(InstancePtr, IntrType) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_IER, \ - ((~(IntrType)) & XOSD_IXR_ALLINTR_MASK) & \ - XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_IER)) +#define XOsd_IntrClear(InstancePtr, IntrType) \ + XOsd_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_STATUS_OFFSET), ((IntrType) & (XOSD_IXR_ALLINTR_MASK))) /*****************************************************************************/ /** * -* This macro returns the pending interrupts of an OSD device. +* This function macro returns the pending status of the OSD core. * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* @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. +* @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_IntrGetPending(XOSD *InstancePtr) +* @note C-style signature: +* u32 XOsd_StatusGePending(XOsd *InstancePtr) * ******************************************************************************/ -#define XOSD_IntrGetPending(InstancePtr) \ - (XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_IER) & \ - XOSD_ReadReg((InstancePtr)->Config.BaseAddress, XOSD_ISR) & \ - XOSD_IXR_ALLINTR_MASK) +#define XOsd_StatusGetPending(InstancePtr) \ + XOsd_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XOSD_STATUS_OFFSET)) & (XOSD_IXR_ALLINTR_MASK) + /*****************************************************************************/ /** * -* This macro clears/acknowledges pending interrupts of an OSD device. +* 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(). * -* @param InstancePtr is a pointer to the OSD device instance to be worked on. +* 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 IntrType is the pending interrupts to clear/acknowledge. Use OR'ing -* of XOSD_IXR_* constants defined in xosd_hw.h to create this -* parameter value. +* @param InstancePtr is a pointer to the XOsd instance to be worked on. * -* @return None +* @return None. * -* @note -* -* C-style signature: -* void XOSD_IntrClear(XOSD *InstancePtr, u32 IntrType) +* @note C-style signature: +* void XOsd_SyncReset(XOsd *InstancePtr) +* This bit automatically clears when reset complete. * ******************************************************************************/ -#define XOSD_IntrClear(InstancePtr, IntrType) \ - XOSD_WriteReg((InstancePtr)->Config.BaseAddress, XOSD_ISR, \ - (IntrType) & XOSD_IXR_ALLINTR_MASK) +#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 and control functions in xosd.c */ /* Initialization */ -int XOSD_CfgInitialize(XOSD *InstancePtr, XOSD_Config *CfgPtr, - u32 EffectiveAddr); +int XOsd_CfgInitialize(XOsd *InstancePtr, XOsd_Config *CfgPtr, + u32 EffectiveAddr); -/* Set Vertical and Horizontal Blank Input Polarity Types */ -void XOSD_SetBlankPolarity(XOSD *InstancePtr, int VerticalBlankPolarity, - int HorizontalBlankPolarity); - -/* Set/Get Screen Size of the OSD Output */ -void XOSD_SetScreenSize(XOSD *InstancePtr, u32 Width, u32 Height); -void XOSD_GetScreenSize(XOSD *InstancePtr, u32 *WidthPtr, u32 *HeightPtr); +/* 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); +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, +void XOsd_SetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 XStart, u16 YStart, u16 XSize, u16 YSize); -void XOSD_GetLayerDimension(XOSD *InstancePtr, u8 LayerIndex, u16 *XStartPtr, +void XOsd_GetLayerDimension(XOsd *InstancePtr, u8 LayerIndex, u16 *XStartPtr, u16 *YStartPtr, u16 *XSizePtr, u16 *YSizePtr); -void XOSD_SetLayerAlpha(XOSD *InstancePtr, u8 LayerIndex, - u16 GlobalAlphaEnble, u16 GlobalAlphaValue); -void XOSD_GetLayerAlpha(XOSD *InstancePtr, u8 LayerIndex, - u16 *GlobalAlphaEnblePtr, - u16 *GlobalAlphaValuePtr); +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_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); +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); +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); +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 */ -void XOSD_GetVersion(XOSD *InstancePtr, u16 *Major, u16 *Minor, u16 *Revision); +u32 XOsd_GetVersion(XOsd *InstancePtr); -/* - * Initialization functions in xosd_sinit.c - */ -XOSD_Config *XOSD_LookupConfig(u16 DeviceId); +/* 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 IntrType, - void *CallBackFunc, void *CallBackRef); +/* 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 */ +#endif /* End of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_g.c b/XilinxProcessorIPLib/drivers/osd/src/xosd_g.c index d9d9b282..ad5372c9 100755 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_g.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_g.c @@ -29,163 +29,134 @@ * this Software without prior written authorization from Xilinx. * ******************************************************************************/ -/*****************************************************************************/ -/** -* -* @file xosd_g.c -* -* This file contains a template for configuration table of Xilinx MVI Video -* On-Screen-Display (OSD) devices. For a real hardware system, Xilinx Platform -* Studio (XPS) will automatically generate a real configuration table to match -* the configuration of the OSD devices. -* -*
-* MODIFICATION HISTORY: -* -* Ver Who Date Changes -* ----- ---- -------- ------------------------------------------------------- -* 1.00a xd 08/18/08 First release -*-* -******************************************************************************/ - - -/***************************** Include Files *********************************/ - #include "xparameters.h" #include "xosd.h" -/** - * The configuration table for On-Screen-Display devices - */ -XOSD_Config XOSD_ConfigTable[] = +/* +* The configuration table for devices +*/ + +XOsd_Config XOsd_ConfigTable[] = { { - XPAR_OSD_0_DEVICE_ID, - XPAR_OSD_0_BASEADDR, - XPAR_OSD_0_NUM_LAYERS, - XPAR_OSD_0_S_AXIS_VIDEO_DATA_WIDTH, - - XPAR_OSD_0_LAYER0_TYPE, - XPAR_OSD_0_LAYER1_TYPE, - XPAR_OSD_0_LAYER2_TYPE, - XPAR_OSD_0_LAYER3_TYPE, - XPAR_OSD_0_LAYER4_TYPE, - XPAR_OSD_0_LAYER5_TYPE, - XPAR_OSD_0_LAYER6_TYPE, - XPAR_OSD_0_LAYER7_TYPE, - - XPAR_OSD_0_LAYER0_IMEM_SIZE, - XPAR_OSD_0_LAYER0_INS_BOX_EN, - XPAR_OSD_0_LAYER0_INS_LINE_EN, - XPAR_OSD_0_LAYER0_INS_TEXT_EN, - XPAR_OSD_0_LAYER0_CLUT_SIZE, - XPAR_OSD_0_LAYER0_CLUT_MEMTYPE, - XPAR_OSD_0_LAYER0_FONT_NUM_CHARS, - XPAR_OSD_0_LAYER0_FONT_WIDTH, - XPAR_OSD_0_LAYER0_FONT_HEIGHT, - XPAR_OSD_0_LAYER0_FONT_BPP, - XPAR_OSD_0_LAYER0_FONT_ASCII_OFFSET, - XPAR_OSD_0_LAYER0_TEXT_NUM_STRINGS, - XPAR_OSD_0_LAYER0_TEXT_MAX_STRING_LENGTH, - - XPAR_OSD_0_LAYER1_IMEM_SIZE, - XPAR_OSD_0_LAYER1_INS_BOX_EN, - XPAR_OSD_0_LAYER1_INS_LINE_EN, - XPAR_OSD_0_LAYER1_INS_TEXT_EN, - XPAR_OSD_0_LAYER1_CLUT_SIZE, - XPAR_OSD_0_LAYER1_CLUT_MEMTYPE, - XPAR_OSD_0_LAYER1_FONT_NUM_CHARS, - XPAR_OSD_0_LAYER1_FONT_WIDTH, - XPAR_OSD_0_LAYER1_FONT_HEIGHT, - XPAR_OSD_0_LAYER1_FONT_BPP, - XPAR_OSD_0_LAYER1_FONT_ASCII_OFFSET, - XPAR_OSD_0_LAYER1_TEXT_NUM_STRINGS, - XPAR_OSD_0_LAYER1_TEXT_MAX_STRING_LENGTH, - - XPAR_OSD_0_LAYER2_IMEM_SIZE, - XPAR_OSD_0_LAYER2_INS_BOX_EN, - XPAR_OSD_0_LAYER2_INS_LINE_EN, - XPAR_OSD_0_LAYER2_INS_TEXT_EN, - XPAR_OSD_0_LAYER2_CLUT_SIZE, - XPAR_OSD_0_LAYER2_CLUT_MEMTYPE, - XPAR_OSD_0_LAYER2_FONT_NUM_CHARS, - XPAR_OSD_0_LAYER2_FONT_WIDTH, - XPAR_OSD_0_LAYER2_FONT_HEIGHT, - XPAR_OSD_0_LAYER2_FONT_BPP, - XPAR_OSD_0_LAYER2_FONT_ASCII_OFFSET, - XPAR_OSD_0_LAYER2_TEXT_NUM_STRINGS, - XPAR_OSD_0_LAYER2_TEXT_MAX_STRING_LENGTH, - - XPAR_OSD_0_LAYER3_IMEM_SIZE, - XPAR_OSD_0_LAYER3_INS_BOX_EN, - XPAR_OSD_0_LAYER3_INS_LINE_EN, - XPAR_OSD_0_LAYER3_INS_TEXT_EN, - XPAR_OSD_0_LAYER3_CLUT_SIZE, - XPAR_OSD_0_LAYER3_CLUT_MEMTYPE, - XPAR_OSD_0_LAYER3_FONT_NUM_CHARS, - XPAR_OSD_0_LAYER3_FONT_WIDTH, - XPAR_OSD_0_LAYER3_FONT_HEIGHT, - XPAR_OSD_0_LAYER3_FONT_BPP, - XPAR_OSD_0_LAYER3_FONT_ASCII_OFFSET, - XPAR_OSD_0_LAYER3_TEXT_NUM_STRINGS, - XPAR_OSD_0_LAYER3_TEXT_MAX_STRING_LENGTH, - - XPAR_OSD_0_LAYER4_IMEM_SIZE, - XPAR_OSD_0_LAYER4_INS_BOX_EN, - XPAR_OSD_0_LAYER4_INS_LINE_EN, - XPAR_OSD_0_LAYER4_INS_TEXT_EN, - XPAR_OSD_0_LAYER4_CLUT_SIZE, - XPAR_OSD_0_LAYER4_CLUT_MEMTYPE, - XPAR_OSD_0_LAYER4_FONT_NUM_CHARS, - XPAR_OSD_0_LAYER4_FONT_WIDTH, - XPAR_OSD_0_LAYER4_FONT_HEIGHT, - XPAR_OSD_0_LAYER4_FONT_BPP, - XPAR_OSD_0_LAYER4_FONT_ASCII_OFFSET, - XPAR_OSD_0_LAYER4_TEXT_NUM_STRINGS, - XPAR_OSD_0_LAYER4_TEXT_MAX_STRING_LENGTH, - - XPAR_OSD_0_LAYER5_IMEM_SIZE, - XPAR_OSD_0_LAYER5_INS_BOX_EN, - XPAR_OSD_0_LAYER5_INS_LINE_EN, - XPAR_OSD_0_LAYER5_INS_TEXT_EN, - XPAR_OSD_0_LAYER5_CLUT_SIZE, - XPAR_OSD_0_LAYER5_CLUT_MEMTYPE, - XPAR_OSD_0_LAYER5_FONT_NUM_CHARS, - XPAR_OSD_0_LAYER5_FONT_WIDTH, - XPAR_OSD_0_LAYER5_FONT_HEIGHT, - XPAR_OSD_0_LAYER5_FONT_BPP, - XPAR_OSD_0_LAYER5_FONT_ASCII_OFFSET, - XPAR_OSD_0_LAYER5_TEXT_NUM_STRINGS, - XPAR_OSD_0_LAYER5_TEXT_MAX_STRING_LENGTH, - - XPAR_OSD_0_LAYER6_IMEM_SIZE, - XPAR_OSD_0_LAYER6_INS_BOX_EN, - XPAR_OSD_0_LAYER6_INS_LINE_EN, - XPAR_OSD_0_LAYER6_INS_TEXT_EN, - XPAR_OSD_0_LAYER6_CLUT_SIZE, - XPAR_OSD_0_LAYER6_CLUT_MEMTYPE, - XPAR_OSD_0_LAYER6_FONT_NUM_CHARS, - XPAR_OSD_0_LAYER6_FONT_WIDTH, - XPAR_OSD_0_LAYER6_FONT_HEIGHT, - XPAR_OSD_0_LAYER6_FONT_BPP, - XPAR_OSD_0_LAYER6_FONT_ASCII_OFFSET, - XPAR_OSD_0_LAYER6_TEXT_NUM_STRINGS, - XPAR_OSD_0_LAYER6_TEXT_MAX_STRING_LENGTH, - - XPAR_OSD_0_LAYER7_IMEM_SIZE, - XPAR_OSD_0_LAYER7_INS_BOX_EN, - XPAR_OSD_0_LAYER7_INS_LINE_EN, - XPAR_OSD_0_LAYER7_INS_TEXT_EN, - XPAR_OSD_0_LAYER7_CLUT_SIZE, - XPAR_OSD_0_LAYER7_CLUT_MEMTYPE, - XPAR_OSD_0_LAYER7_FONT_NUM_CHARS, - XPAR_OSD_0_LAYER7_FONT_WIDTH, - XPAR_OSD_0_LAYER7_FONT_HEIGHT, - XPAR_OSD_0_LAYER7_FONT_BPP, - XPAR_OSD_0_LAYER7_FONT_ASCII_OFFSET, - XPAR_OSD_0_LAYER7_TEXT_NUM_STRINGS, - XPAR_OSD_0_LAYER7_TEXT_MAX_STRING_LENGTH + 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 9269cf0d..c3cafcec 100755 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_hw.h +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_hw.h @@ -35,30 +35,41 @@ * @file xosd_hw.h * * This header file contains identifiers and register-level driver functions (or -* macros) that can be used to access the Xilinx MVI Video On-Screen-Display -* (OSD) device. +* macros) that can be used to access the Xilinx Video On-Screen-Display +* (OSD) core. * -* For more information about the operation of this device, see the hardware +* 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. +* 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 /* prevent circular inclusions */ -#define XOSD_HW_H /* by using protection macros */ +#ifndef XOSD_HW_H_ +#define XOSD_HW_H_ /**< Prevent circular inclusions by using + * protection macros. */ #ifdef __cplusplus extern "C" { @@ -73,60 +84,74 @@ extern "C" { /** @name Register Offsets * @{ */ -#define XOSD_CTL 0x000 /**< Control */ -#define XOSD_SS 0x020 /**< Screen Size */ -#define XOSD_BC0 0x100 /**< Background Color Channel 0 */ -#define XOSD_BC1 0x104 /**< Background Color Channel 1 */ -#define XOSD_BC2 0x108 /**< Background Color Channel 2 */ +#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 0x110 /**< Layer 0 Control */ -#define XOSD_L0P 0x114 /**< Layer 0 Position */ -#define XOSD_L0S 0x118 /**< Layer 0 Size */ +#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 0x120 /**< Layer 1 Control */ -#define XOSD_L1P 0x124 /**< Layer 1 Position */ -#define XOSD_L1S 0x128 /**< Layer 1 Size */ +#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 0x130 /**< Layer 2 Control */ -#define XOSD_L2P 0x134 /**< Layer 2 Position */ -#define XOSD_L2S 0x138 /**< Layer 2 Size */ +#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 0x140 /**< Layer 3 Control */ -#define XOSD_L3P 0x144 /**< Layer 3 Position */ -#define XOSD_L3S 0x148 /**< Layer 3 Size */ +#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 0x150 /**< Layer 4 Control */ -#define XOSD_L4P 0x154 /**< Layer 4 Position */ -#define XOSD_L4S 0x158 /**< Layer 4 Size */ +#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 0x160 /**< Layer 5 Control */ -#define XOSD_L5P 0x164 /**< Layer 5 Position */ -#define XOSD_L5S 0x168 /**< Layer 5 Size */ +#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 0x170 /**< Layer 6 Control */ -#define XOSD_L6P 0x174 /**< Layer 6 Position */ -#define XOSD_L6S 0x178 /**< Layer 6 Size */ +#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 0x180 /**< Layer 7 Control */ -#define XOSD_L7P 0x184 /**< Layer 7 Position */ -#define XOSD_L7S 0x188 /**< Layer 7 Size */ +#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 0x190 /**< GPU Write Bank Address */ -#define XOSD_GCABA 0x194 /**< GPU Active Bank Address */ -#define XOSD_GCD 0x198 /**< GPU Data */ +#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 0x010 /**< Version Register */ -#define XOSD_RST 0x000 /**< Software Reset */ +#define XOSD_VER_OFFSET 0x010 /**< Version Offset */ +#define XOSD_RST_OFFSET XOSD_CTL_OFFSET /**< Software Reset Offset */ -#define XOSD_GIER 0x010 /**< Global Interrupt Enable Register */ -#define XOSD_ISR 0x004 /**< Interrupt Status Register */ -#define XOSD_IER 0x00c /**< Interrupt Enable Register */ +/** + * Interrupt status register generates a interrupt if the corresponding bits + * of interrupt enable register bits are set. + */ +#define XOSD_ISR_OFFSET XOSD_STATUS /**< Interrupt Status + * Register Offset */ +#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 +#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 */ @@ -139,186 +164,201 @@ extern "C" { * Graphics controller */ /*@}*/ -/** @name OSD Control Register bit definition +/** @name Active Size Register bit definition and Shift * @{ */ -#define XOSD_CTL_VBP_MASK 0x00000020 /**< Vertical Blank Polarity */ -#define XOSD_CTL_HBP_MASK 0x00000010 /**< Horizontal Blank Polarity */ -#define XOSD_CTL_RUE_MASK 0x00000002 /**< OSD Register Update Enable */ -#define XOSD_CTL_EN_MASK 0x00000001 /**< OSD Enable */ +#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 OSD Screen Size Register bit definition +/** @name Background Color Channel 0 Mask * @{ */ -#define XOSD_SS_YSIZE_MASK 0x0FFF0000 /**< Vertical Height of OSD Output */ -#define XOSD_SS_YSIZE_SHIFT 16 /**< Bit shift of XOSD_SS_YSIZE_MASK */ -#define XOSD_SS_XSIZE_MASK 0x00000FFF /**< Horizontal Width of OSD Output */ +#define XOSD_BC0_YG_MASK 0x00000FFF /**< Y (luma) or Green Mask */ /*@}*/ -/** @name OSD Background Color Channel 0 +/** @name Background Color Channel 1 Mask * @{ */ -#define XOSD_BC0_YG_MASK 0x00000FFF /**< Y (luma) or Green */ +#define XOSD_BC1_UCBB_MASK 0x00000FFF /**< U (Cb) or Blue Mask */ /*@}*/ -/** @name OSD Background Color Channel 1 +/** @name Background Color Channel 2 Mask * @{ */ -#define XOSD_BC1_UCBB_MASK 0x00000FFF /**< U (Cb) or Blue */ -/*@}*/ - -/** @name OSD Background Color Channel 2 - * @{ - */ -#define XOSD_BC2_VCRR_MASK 0x00000FFF /**< V(Cr) or Red */ +#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 */ +#define XOSD_MAX_NUM_OF_LAYERS 8 /**< The max number of + * layers */ /*@}*/ -/** @name OSD Layer Control (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) +/** @name Layer Control (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) bit + * definition and Shifts * @{ */ -#define XOSD_LXC_ALPHA_MASK 0x0FFF0000 /**< Global Alpha Value */ -#define XOSD_LXC_ALPHA_SHIFT 16 /**< Bit shift number of Global - * Alpha Value */ -#define XOSD_LXC_PRIORITY_MASK 0x00000700 /**< Layer Priority */ -#define XOSD_LXC_PRIORITY_SHIFT 8 /**< Bit shift number of Layer - * Priority */ -#define XOSD_LXC_GALPHAEN_MASK 0x00000002 /**< Global Alpha Enable */ -#define XOSD_LXC_EN_MASK 0x00000001 /**< Layer Enable */ +#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 OSD Layer Position (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) +/** @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 */ -#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 */ +#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 OSD Layer Size (Layer 0 through (XOSD_MAX_NUM_OF_LAYERS - 1)) +/** @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 */ -#define XOSD_LXS_YSIZE_SHIFT 16 /**< Bit shift number of vertical - * size of layer */ -#define XOSD_LXS_XSIZE_MASK 0x00000FFF /**< Horizontal size of layer */ +#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 OSD Graphics Controller Write Bank Address +/** @name Graphics Controller Write Bank Address bit definition and Shift * @{ */ -#define XOSD_GCWBA_GCNUM_MASK 0x00000700 /**< Graphics Controller Number */ -#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 */ +#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 OSD Graphics Controller Active Bank Address +/** @name Graphics Controller Active Bank Address bit definition and Shifts * @{ */ -#define XOSD_GCABA_CHR_MASK 0xFF000000 /**< Set the active Character Bank*/ -#define XOSD_GCABA_CHR_SHIFT 24 /**< Bit shift of active Character - * Bank */ -#define XOSD_GCABA_TXT_MASK 0x00FF0000 /**< Set the active Text Bank */ -#define XOSD_GCABA_TXT_SHIFT 16 /**< Bit shift of active Text Bank*/ -#define XOSD_GCABA_COL_MASK 0x0000FF00 /**< Set the active Color Table - * Bank */ -#define XOSD_GCABA_COL_SHIFT 8 /**< Bit shift of active Color Table - * Bank */ -#define XOSD_GCABA_INS_MASK 0x000000FF /**< Set the active instruction Bank - */ +#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 +/** @name Version Register bit definition and Shifts * @{ */ -#define XOSD_VER_MAJOR_MASK 0xFF000000 /**< Major Version*/ -#define XOSD_VER_MAJOR_SHIFT 24 /**< Major Version Bit Shift*/ -#define XOSD_VER_MINOR_MASK 0x00FF0000 /**< Minor Version */ -#define XOSD_VER_MINOR_SHIFT 16 /**< Minor Version Bit Shift*/ -#define XOSD_VER_REV_MASK 0x0000F000 /**< Revision Version */ -#define XOSD_VER_REV_SHIFT 12 /**< Revision Bit Shift*/ +#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 OSD Software Reset +/** @name Software Reset * @{ */ -#define XOSD_RST_RESET 0x80000000 /**< Software Reset */ +#define XOSD_RST_RESET XOSD_CTL_SW_RST_MASK /**< Software Reset */ /*@}*/ -/** @name Global Interrupt Enable Register bit definition +/** @name Interrupt Register Bit Masks. It is applicable for ISR and IER. * @{ */ -#define XOSD_GIER_GIE_MASK 0x80000000 /**< Global interrupt enable */ -/*@}*/ +#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 */ -/** @name Interrupt Status/Enable Register bit definition - * @{ - */ -#define XOSD_IXR_GAO_MASK 0xFF000000 /**< Graphics Controller Instruction - * Overflow */ -#define XOSD_IXR_GIE_MASK 0x00FF0000 /**< Graphics Controller Instruction - * Error */ -#define XOSD_IXR_OOE_MASK 0x00000010 /**< OSD Output Overflow Error */ -#define XOSD_IXR_IUE_MASK 0x00ff0000 /**< OSD Input Underflow Error */ -#define XOSD_IXR_VBIE_MASK 0x00000004 /**< Vertical Blank Interval End */ -#define XOSD_IXR_VBIS_MASK 0x00000002 /**< Vertical Blank Interval Start*/ -#define XOSD_IXR_FE_MASK 0x00000008 /**< OSD did not complete - * processing frame before next - * Vblank */ -#define XOSD_IXR_FD_MASK 0x00000001 /**< OSD completed processing - * Frame */ -#define XOSD_IXR_ALLIERR_MASK (XOSD_IXR_GAO_MASK | \ - XOSD_IXR_GIE_MASK | \ - XOSD_IXR_OOE_MASK | \ - XOSD_IXR_IUE_MASK | \ - XOSD_IXR_FE_MASK) /**< Mask for all error - * interrupts */ - -#define XOSD_IXR_ALLINTR_MASK (XOSD_IXR_VBIE_MASK | \ - XOSD_IXR_VBIS_MASK | \ - XOSD_IXR_FD_MASK | \ - XOSD_IXR_ALLIERR_MASK) /**< Mask for all - * interrupts */ +#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_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 +/** @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 */ +#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 +/** @name GC instruction word offset definition * @{ */ #define XOSD_INS0 0 /**< Instruction word 0 offset */ @@ -328,46 +368,52 @@ extern "C" { #define XOSD_INS_SIZE 4 /**< Size of an instruction in words */ /*@}*/ -/** @name GC Instruction word 0 definition +/** @name GC Instruction word 0 definition and Shifts * @{ */ -#define XOSD_INS0_OPCODE_MASK 0xF0000000 /**< Operation Code (OpCode) */ -#define XOSD_INS0_OPCODE_SHIFT 28 /**< Bit shift number of OpCode */ -#define XOSD_INS0_GCNUM_MASK 0x07000000 /**< Graphics controller number - * (GC#) */ -#define XOSD_INS0_GCNUM_SHIFT 24 /**< Bit shift number of GC# */ -#define XOSD_INS0_XEND_MASK 0x00FFF000 /**< Horizontal end pixel of the - * object */ -#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 */ +#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 */ +#define XOSD_INS1_TXTINDEX_MASK 0x0000000F /**< String Index */ /*@}*/ -/** @name GC Instruction word 2 definition +/** @name GC Instruction word 2 definition and Shifts * @{ */ -#define XOSD_INS2_OBJSIZE_MASK 0xFF000000 /**< Object Size */ -#define XOSD_INS2_OBJSIZE_SHIFT 24 /**< Bit shift number of Object - * Size */ -#define XOSD_INS2_YEND_MASK 0x00FFF000 /**< Vertical end line of the - * object */ -#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 */ +#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 */ +#define XOSD_INS3_COL_MASK 0x0000000F /**< Color Index for + * Box/Text Mask */ /*@}*/ /** @name GC Instruction Operation Code definition (used in Instruction word 0) @@ -384,8 +430,8 @@ extern "C" { /** @name GC color size * @{ */ -#define XOSD_COLOR_ENTRY_SIZE 4 /**< Size of each color entry in - * bytes */ +#define XOSD_COLOR_ENTRY_SIZE 4 /**< Size of each color entry + * in bytes */ /*@}*/ /** @name GC font unit size @@ -408,60 +454,265 @@ extern "C" { #define XOSD_LAYER_PRIORITY_7 7 /**< Priority 7 --- Highest */ /*@}*/ -/**************************** Type Definitions *******************************/ +/** @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 +#define XOSD_STATUS XOSD_STATUS_OFFSET +#define XOSD_ERROR XOSD_ERROR_OFFSET +#define XOSD_VER XOSD_VER_OFFSET +#define XOSD_SS XOSD_ACTIVE_SIZE_OFFSET +#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_ISR XOSD_ISR_OFFSET +#define XOSD_IER XOSD_IER_OFFSET + +#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 Device register I/O APIs +/** @name Core register I/O APIs * @{ */ -#define XOSD_In32 Xil_In32 -#define XOSD_Out32 Xil_Out32 +#define XOsd_In32 Xil_In32 +#define XOsd_Out32 Xil_Out32 /*****************************************************************************/ /** * -* Read the given register. +* This function reads the given register. * -* @param BaseAddress is the base address of the device -* @param RegOffset is the register offset to be read +* @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 +* @return The 32-bit value of the register. * -* @note -* C-style signature: -* u32 XOSD_ReadReg(u32 BaseAddress, u32 RegOffset) +* @note C-style signature: +* u32 XOsd_ReadReg(u32 BaseAddress, u32 RegOffset) * ******************************************************************************/ -#define XOSD_ReadReg(BaseAddress, RegOffset) \ - XOSD_In32((BaseAddress) + (RegOffset)) +#define XOsd_ReadReg(BaseAddress, RegOffset) \ + XOsd_In32((BaseAddress) + (u32)(RegOffset)) /*****************************************************************************/ /** * -* Write the given register. +* This function writes the given register. * -* @param BaseAddress is the base address of the device -* @param RegOffset is the register offset to be written -* @param Data is the 32-bit value to write to the 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) +* @note C-style signature: +* void XOsd_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data) * ******************************************************************************/ -#define XOSD_WriteReg(BaseAddress, RegOffset, Data) \ - XOSD_Out32((BaseAddress) + (RegOffset), (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 */ +#endif /* End of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_intr.c b/XilinxProcessorIPLib/drivers/osd/src/xosd_intr.c index b873fb97..fdd6bccd 100755 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_intr.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_intr.c @@ -34,25 +34,47 @@ * * @file xosd_intr.c * -* This code contains interrupt related functions of Xilinx MVI Video -* On-Screen-Display device driver. Please see xosd.h for more details of +* 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. +* 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 *****************************/ + /*****************************************************************************/ /** * @@ -64,57 +86,53 @@ * * 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. An example delivered with -* this driver demonstrates how this could be done. +* 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. +* @param InstancePtr is a pointer to the XOsd instance that just +* interrupted. +* +* @return None. +* +* @note None. * ******************************************************************************/ -void XOSD_IntrHandler(void *InstancePtr) +void XOsd_IntrHandler(void *InstancePtr) { u32 PendingIntr; u32 ErrorStatus; - XOSD *XOSDPtr; + XOsd *XOsdPtr = NULL; - XOSDPtr = (XOSD *)InstancePtr; + XOsdPtr = (XOsd *)((void *)InstancePtr); - /* Validate parameters */ - Xil_AssertVoid(XOSDPtr != NULL); - Xil_AssertVoid(XOSDPtr->IsReady == XIL_COMPONENT_IS_READY); + /* Validate arguments. */ + Xil_AssertVoid(XOsdPtr != NULL); + Xil_AssertVoid(XOsdPtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); - /* Get pending interrupts */ - PendingIntr = XOSD_IntrGetPending(XOSDPtr); + /* Get pending interrupts. */ + PendingIntr = (u32)(XOsd_IntrGetPending(XOsdPtr)); - /* Clear pending interrupts */ - XOSD_IntrClear(XOSDPtr, PendingIntr); - - /* Error interrupt is occurring or spurious interrupt */ - if ((0 == (PendingIntr & XOSD_IXR_ALLINTR_MASK)) || - (PendingIntr & XOSD_IXR_ALLIERR_MASK)) { - - ErrorStatus = PendingIntr & XOSD_IXR_ALLIERR_MASK; - XOSDPtr->ErrCallBack(XOSDPtr->ErrRef, ErrorStatus); - - /* The Error CallBack should reset the device and so - * there is no need to handle other interrupts - */ - return; + /* Error interrupt is occurring or spurious interrupt. */ + if (((PendingIntr) & (XOSD_IXR_ERR_MASK)) == + ((XOSD_IXR_ERR_MASK))) { + ErrorStatus = (PendingIntr) & (XOSD_IXR_ERR_MASK); + XOsdPtr->ErrCallBack(XOsdPtr->ErrRef, ErrorStatus); } - /* A VBI Start has happened */ - if ((PendingIntr & XOSD_IXR_VBIS_MASK)) - XOSDPtr->VbiStartCallBack(XOSDPtr->VbiStartRef); + /* A Processing start interrupt has occurred. */ + if (((PendingIntr) & (XOSD_IXR_PROC_STARTED_MASK)) == + (XOSD_IXR_PROC_STARTED_MASK)) { + XOsdPtr->ProcStartCallBack(XOsdPtr->ProcStartRef); + } - /* A VBI End has happened */ - if ((PendingIntr & XOSD_IXR_VBIE_MASK)) - XOSDPtr->VbiEndCallBack(XOSDPtr->VbiEndRef); + /* A frame done interrupt has occurred. */ + if (((PendingIntr) & (XOSD_IXR_EOF_MASK)) == + (XOSD_IXR_EOF_MASK)) { + XOsdPtr->FrameDoneCallBack(XOsdPtr->FrameDoneRef); + } - /* A Frame Done interrupt has happened */ - if ((PendingIntr & XOSD_IXR_FD_MASK)) - XOSDPtr->FrameDoneCallBack(XOSDPtr->FrameDoneRef); + /* Clear pending interrupts. */ + XOsd_IntrClear(XOsdPtr, PendingIntr); } @@ -125,69 +143,68 @@ void XOSD_IntrHandler(void *InstancePtr) * HandlerType: * *
-* HandlerType Callback Function Type -* ----------------------- --------------------------- -* XOSD_HANDLER_VBISTART XOSD_CallBack -* XOSD_HANDLER_VBIEND XOSD_CallBack -* XOSD_HANDLER_FRAMEDONE XOSD_CallBack -* XOSD_HANDLER_ERROR XOSD_ErrCallBack -* -* HandlerType Invoked by this driver when: -* ----------------------- -------------------------------------------------- -* XOSD_HANDLER_VBISTART A Vertical Blank Interval Start Interrupt happens -* XOSD_HANDLER_VBIEND A Vertical Blank Interval End Interrupt happens -* XOSD_HANDLER_FRAMEDONE A Frame Done Interrupt happens -* XOSD_HANDLER_ERROR An error condition happens +* 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 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 +* @param CallBackFunc is the address of the callback function. +* @param CallBackRef is a user data item that will be passed to the * callback function when it is invoked. * -* @return -* - XST_SUCCESS when handler is installed. -* - XST_INVALID_PARAM when HandlerType is invalid. +* @return - 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. +* @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 XOsd_SetCallBack(XOsd *InstancePtr, u32 HandlerType, + void *CallBackFunc, void *CallBackRef) { + int Status; + + /* Verify arguments. */ Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); + 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_VBISTART: - InstancePtr->VbiStartCallBack = (XOSD_CallBack)CallBackFunc; - InstancePtr->VbiStartRef = CallBackRef; - break; + case XOSD_HANDLER_PROCSTART: + InstancePtr->ProcStartCallBack = + (XOsd_CallBack)((void *)CallBackFunc); + InstancePtr->ProcStartRef = CallBackRef; + Status = (XST_SUCCESS); + break; - case XOSD_HANDLER_VBIEND: - InstancePtr->VbiEndCallBack = (XOSD_CallBack)CallBackFunc; - InstancePtr->VbiEndRef = CallBackRef; - break; + case XOSD_HANDLER_FRAMEDONE: + InstancePtr->FrameDoneCallBack = + (XOsd_CallBack)((void *)CallBackFunc); + InstancePtr->FrameDoneRef = CallBackRef; + Status = (XST_SUCCESS); + break; - case XOSD_HANDLER_FRAMEDONE: - InstancePtr->FrameDoneCallBack = (XOSD_CallBack)CallBackFunc; - InstancePtr->FrameDoneRef = CallBackRef; - break; - - case XOSD_HANDLER_ERROR: - InstancePtr->ErrCallBack = (XOSD_ErrorCallBack)CallBackFunc; - InstancePtr->ErrRef = CallBackRef; - break; - - default: - return XST_INVALID_PARAM; + case XOSD_HANDLER_ERROR: + InstancePtr->ErrCallBack = + (XOsd_ErrorCallBack)((void *)CallBackFunc); + InstancePtr->ErrRef = CallBackRef; + Status = (XST_SUCCESS); + break; + default: + Status = (XST_INVALID_PARAM); + break; } - return XST_SUCCESS; + + return Status; } diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_selftest.c b/XilinxProcessorIPLib/drivers/osd/src/xosd_selftest.c new file mode 100755 index 00000000..744eaa95 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_selftest.c @@ -0,0 +1,107 @@ +/****************************************************************************** +* +* 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 THE +* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xosd_selftest.c +* +* 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); + } + + return Status; +} diff --git a/XilinxProcessorIPLib/drivers/osd/src/xosd_sinit.c b/XilinxProcessorIPLib/drivers/osd/src/xosd_sinit.c index 26ec97d3..8bc0d95c 100755 --- a/XilinxProcessorIPLib/drivers/osd/src/xosd_sinit.c +++ b/XilinxProcessorIPLib/drivers/osd/src/xosd_sinit.c @@ -31,24 +31,26 @@ ******************************************************************************/ /*****************************************************************************/ /** - * - * @file xosd_sinit.c - * - * This file contains the static initialization method for Xilinx MVI Video - * On-Screen-Display (OSD) device 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. - *- * - ******************************************************************************/ +* +* @file xosd_sinit.c +* +* 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 *********************************/ @@ -58,41 +60,50 @@ /************************** Constant Definitions *****************************/ -/**************************** Type Definitions *******************************/ - - /***************** Macros (Inline Functions) Definitions *********************/ +/**************************** Type Definitions *******************************/ + + /************************** Function Prototypes ******************************/ + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + /*****************************************************************************/ /** - * XOSD_LookupConfig returns a reference to an XOSD_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 xosd_g.c - * file. - * - * @param DeviceId is the unique device ID of the device for the lookup - * operation. - * - * @return XOSD_LookupConfig returns a reference to a config record in the - * configuration table (in xosd_g.c) corresponding to DeviceId, - * or NULL if no match is found. - * - ******************************************************************************/ -XOSD_Config *XOSD_LookupConfig(u16 DeviceId) +* +* 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[]; - XOSD_Config *CfgPtr = NULL; - int i; + extern XOsd_Config XOsd_ConfigTable[XPAR_XOSD_NUM_INSTANCES]; + XOsd_Config *CfgPtr = NULL; + u32 Index; - for (i = 0; i < XPAR_XOSD_NUM_INSTANCES; i++) { - if (XOSD_ConfigTable[i].DeviceId == DeviceId) { - CfgPtr = &XOSD_ConfigTable[i]; + for (Index = (u32)0x0; Index < (u32)(XPAR_XOSD_NUM_INSTANCES); + Index++) { + if (XOsd_ConfigTable[Index].DeviceId == DeviceId) { + CfgPtr = &XOsd_ConfigTable[Index]; break; } } - return (CfgPtr); + return (XOsd_Config *)CfgPtr; }