00001 /* $Id: */ 00002 /****************************************************************************** 00003 * (c) Copyright 2009 Xilinx, Inc. All rights reserved. 00004 * 00005 * This file contains confidential and proprietary information 00006 * of Xilinx, Inc. and is protected under U.S. and 00007 * international copyright and other intellectual property 00008 * laws. 00009 * 00010 * DISCLAIMER 00011 * This disclaimer is not a license and does not grant any 00012 * rights to the materials distributed herewith. Except as 00013 * otherwise provided in a valid license issued to you by 00014 * Xilinx, and to the maximum extent permitted by applicable 00015 * law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND 00016 * WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES 00017 * AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING 00018 * BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- 00019 * INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and 00020 * (2) Xilinx shall not be liable (whether in contract or tort, 00021 * including negligence, or under any other theory of 00022 * liability) for any loss or damage of any kind or nature 00023 * related to, arising under or in connection with these 00024 * materials, including for any direct, or any indirect, 00025 * special, incidental, or consequential loss or damage 00026 * (including loss of data, profits, goodwill, or any type of 00027 * loss or damage suffered as a result of any action brought 00028 * by a third party) even if such damage or loss was 00029 * reasonably foreseeable or Xilinx had been advised of the 00030 * possibility of the same. 00031 * 00032 * CRITICAL APPLICATIONS 00033 * Xilinx products are not designed or intended to be fail- 00034 * safe, or for use in any application requiring fail-safe 00035 * performance, such as life-support or safety devices or 00036 * systems, Class III medical devices, nuclear facilities, 00037 * applications related to the deployment of airbags, or any 00038 * other applications that could lead to death, personal 00039 * injury, or severe property or environmental damage 00040 * (individually and collectively, "Critical 00041 * Applications"). Customer assumes the sole risk and 00042 * liability of any use of Xilinx products in Critical 00043 * Applications, subject only to applicable laws and 00044 * regulations governing limitations on product liability. 00045 * 00046 * THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS 00047 * PART OF THIS FILE AT ALL TIMES. 00048 * 00049 * All rights reserved. 00050 * 00051 ******************************************************************************/ 00052 /*****************************************************************************/ 00053 /** 00054 * 00055 * @file xtimebase_sinit.c 00056 * 00057 * This file contains static initialization methods for Xilinx MVI Video 00058 * Timebase device driver. 00059 * 00060 * <pre> 00061 * MODIFICATION HISTORY: 00062 * 00063 * Ver Who Date Changes 00064 * ----- ---- -------- ----------------------------------------------- 00065 * 1.00a xd 08/05/08 First release 00066 * 1.01a xd 07/23/10 Added GIER; Added more h/w generic info into 00067 * xparameters.h; Feed callbacks with pending 00068 * interrupt info. Added Doxygen & Version support 00069 * </pre> 00070 * 00071 ******************************************************************************/ 00072 00073 /***************************** Include Files *********************************/ 00074 00075 #include "xtimebase.h" 00076 #include "xparameters.h" 00077 00078 /************************** Constant Definitions *****************************/ 00079 00080 00081 /**************************** Type Definitions *******************************/ 00082 00083 00084 /***************** Macros (Inline Functions) Definitions *********************/ 00085 00086 00087 /************************** Function Prototypes ******************************/ 00088 00089 /*****************************************************************************/ 00090 /** 00091 * XTimeBase_LookupConfig returns a reference to an XTimeBase_Config structure 00092 * based on the unique device id, <i>DeviceId</i>. The return value will refer 00093 * to an entry in the device configuration table defined in the xtimebase_g.c 00094 * file. 00095 * 00096 * @param DeviceId is the unique device ID of the device for the lookup 00097 * operation. 00098 * 00099 * @return XTimeBase_LookupConfig returns a reference to a config record in the 00100 * configuration table (in xtimebase_g.c) corresponding to 00101 * <i>DeviceId</i>, or NULL if no match is found. 00102 * 00103 ******************************************************************************/ 00104 XTimeBase_Config *XTimeBase_LookupConfig(u16 DeviceId) 00105 { 00106 extern XTimeBase_Config XTimeBase_ConfigTable[]; 00107 XTimeBase_Config *CfgPtr = NULL; 00108 int i; 00109 00110 for (i = 0; i < XPAR_XTB_NUM_INSTANCES; i++) { 00111 if (XTimeBase_ConfigTable[i].DeviceId == DeviceId) { 00112 CfgPtr = &XTimeBase_ConfigTable[i]; 00113 break; 00114 } 00115 } 00116 00117 return CfgPtr; 00118 }