阅读:1605回复:3
询问关于WINNT下PCI视频采集卡的驱动程序中一些代码的问题
我现在手里有一个基于PCI的视频采集卡的驱动,但是有一点不明白的地方,就是如下:
在DriverEntry例程中有这么一些代码: //This function must be called before ReInit7111 OpenIIC(pDevExt); //Read EEPROM Information GetBoardInformation(pDevExt); //Config audio channel ConfigAudio(pDevExt); //Load code to DSP LoadDSPCode(pDevExt); //Initialize video decoder ReInit7111(pDevExt); // // Make sure device interrupts are OFF // DisableInterrupts( pDevExt ); 在一个另外的文件中有这些函数的单独定义。 如ReInit7111(pDevExt)的定义为: void ReInit7111(PDEVICE_EXTENSION pDE) { unsigned char i; for(i=0; i<sizeof(Reg7111)/sizeof(unsigned char); i++){ IICWrite(pDE,IIC_SUB_VIP, i, Reg7111); if(bIICError) return ; } } #else struct IICReg { unsigned char bySub; unsigned char byData; }Reg7113[]={ //{0, 0xff}, {1, 0x08}, {2, 0xf2}, {3, 0x23}, {4, 0x00}, {5, 0xff}, {6, 0xeb}, {7, 0xe0}, {8, 0xb8}, {9, 0x01}, {0x0a, 0x80}, {0x0b, 0x47}, {0x0c, 0x40}, {0x0d, 0x00}, {0x0e, 0x01}, {0x0f, 0x00}, {0x10, 0x00}, {0x11, 0x0c}, {0x12, 0xc7},//c7 {0x13 ,0x00}, {0x14 ,0x00}, {0x15 ,0x00}, {0x16 ,0x00}, {0x17 ,0x00}, {0x18 ,0x00}, {0x19 ,0x00}, {0x1a ,0x00}, {0x1b ,0x00}, {0x1c ,0x00}, {0x1d ,0x00}, {0x1e ,0x00}, {0x1f ,0xa1}, {0x40 ,0x02}, {0x41 ,0xff}, {0x42 ,0xff}, {0x44 ,0xff}, {0x45 ,0xff}, {0x46 ,0xff}, {0x47 ,0xff}, {0x48 ,0xff}, {0x49 ,0xff}, {0x4a ,0xff}, {0x4b ,0xff}, {0x4c ,0xff}, {0x4d ,0xff}, {0x4e ,0xff}, {0x4f ,0xff}, {0x50 ,0xff}, {0x51 ,0xff}, {0x52 ,0xff}, {0x53 ,0xff}, {0x54 ,0xff}, {0x55 ,0xff}, {0x56 ,0xff}, {0x57 ,0xff}, {0x58 ,0x00}, {0x59 ,0x00}, {0x5a ,0x07}, {0x5b ,0x00}, {0x5c ,0x00}, {0x5d ,0x00}, {0x5e ,0x00}, {0x5f ,0x00}, {0x60 ,0x04}, {0x61 ,0x0f}, {0x62 ,0x91}}; 我想问一下,如OpenIIC(pDevExt);ConfigAudio(pDevExt)和ReInit7111(pDevExt)和LoadDSPCode(pDevExt)函数定义中的代码,主要是参照哪些资料才能写出。是关于芯片的代码吗?如果要理解这些代码,要看什么方面的内容?希望高手指点。 [编辑 - 1/25/05 by zhongjie] |
|
沙发#
发布于:2005-01-26 01:22
对主要要看看芯片资料
|
|
|
板凳#
发布于:2005-01-26 21:56
谢谢上面仁兄,我再请教一个问题就是:
这些芯片资料网上可以免费下载吧!如7113,7146,DSP等 [编辑 - 1/26/05 by zhongjie] |
|
地板#
发布于:2005-07-12 22:16
eeprom 的内容厂商会提供的,譬如以下是atheros一个无线产品的eeprom的信息:
你说你有 nt 下的driverentry的代码,可以发给我看看吗,我太想看看 nt 下的driver 代码了, 可通常只有2000下的。 llllllllg@126.com #$Id: //depot/sw/branches/ART_V52/bringup/ar5k/config/ar5004g_mb43g.eep#1 $ #EEPROM file for AR5004g 802.11a/b/g MiniPCI Reference Design card @cal_section_begin # begin @cal section TARGET_POWER_FILENAME = calTrgtPwr_ar5004g_mb43g.txt ; # target power file for calibration SUBSYSTEM_ID = 0x2043; # Subsystem ID in hex EEPROM_MAP_TYPE = 1; # Flag indicating eeprom layout type TURBO_DISABLE = 0; # Prevents software from using TURBO modes RF_SILENT = 0; # Cards enabled with RFSilent can be easily silenced DEVICE_TYPE = 3; # 1=>Cardbus, 2=>PCI, 3=>miniPCI, 4=>AP TURBO_MAXPOWER_5G = 16.0; # Recommended max power in turbo mode to consume less than 2W. TURBO_MAXPOWER_2p5G = 16.0; # Recommended max power in turbo mode at 2.5 GHz to consume less than 2W. A_MODE = 0; # Whether the adapter supports 802.11a functionality B_MODE = 1; # Whether the adapter supports 802.11b functionality G_MODE = 1; # Whether the adapter supports 802.11g functionality ANTENNA_GAIN_5G = 4; # Antenna gain at 5.5GHz. 8-bit signed val in 0.5dB steps. ANTENNA_GAIN_2p5G = 1.5; # Antenna gain at 2.5GHz. 8-bit signed val in 0.5dB steps. XLNA_GAIN = 13; # xLNA gain in dB (per AS 6/14/02) NOISE_FLOOR_THRESHOLD = -54; # noise floor threshold value (per JHfmn 6/14/02) 11b_XLNA_GAIN = 13; # xLNA gain in dB 11b_NOISE_FLOOR_THRESHOLD = -1; # noise floor threshold value 11g_XLNA_GAIN = 13; # xLNA gain in dB 11g_NOISE_FLOOR_THRESHOLD = -1; # noise floor threshold value 11a_FALSE_DETECT_BACKOFF = 0; # in dB. only affects channels w/ clock harmonic overlap. 11b_FALSE_DETECT_BACKOFF = 0; # in dB. only affects channels w/ clock harmonic overlap. 11g_FALSE_DETECT_BACKOFF = 0; # in dB. only affects channels w/ clock harmonic overlap. 11g_TURBO_DISABLE = 0; # Set to 1 to disable TURBO mode in 11g CCK_OFDM_DELTA = 1; # in dB with 0.1dB resolution. In 11g, delta in output power for 1mbps and 6mbps # for any given pcdac. CH14_FILTER_CCK_DELTA = 1.5; # in dB with 0.1dB resolution. In 11g & 11b, delta in output power for ch14 and ch1 - ch13 # for any given pcdac. This delta arises due to special filter requirement for ch14 (2484). ENABLE_32KHZ = 1; # Flag indicating the presence of the 32kHz sleep crystal @cal_section_end # end @cal section @config_section_begin # begin @config section #Antenna Switch Table #6 bit (msb:lsb) value are mapped to [atten5, atten2, antD, antC, antB, antA] #----------------------------------------------------------------------------------- @MODE: MODE_SPECIFIC 11a 11a_turbo 11b 11g 11g_turbo #----------------------------------------------------------------------------------- bb_switch_table_r1x12 0x00 0x00 0x02 0x02 0x02 #(AntCtl 5) bb_switch_table_r1x2 0x00 0x00 0x02 0x02 0x02 #(AntCtl 4) bb_switch_table_r1x1 0x00 0x00 0x02 0x02 0x02 #(AntCtl 3) bb_switch_table_r1 0x01 0x01 0x12 0x12 0x12 #(AntCtl 2) bb_switch_table_t1 0x02 0x02 0x01 0x01 0x01 #(AntCtl 1) bb_switch_table_r2x12 0x00 0x00 0x01 0x01 0x01 #(AntCtl 10) bb_switch_table_r2x2 0x00 0x00 0x01 0x01 0x01 #(AntCtl 9) bb_switch_table_r2x1 0x00 0x00 0x01 0x01 0x01 #(AntCtl 8) bb_switch_table_r2 0x02 0x02 0x11 0x11 0x11 #(AntCtl 7) bb_switch_table_t2 0x01 0x01 0x02 0x02 0x02 #(AntCtl 6) bb_rxtx_margin_2ghz 11 11 33 33 33 bb_switch_settling 0x2d 0x5a 0x28 0x28 0x28 bb_txrxatten 15 15 30 30 30 bb_pga_desired_size -80 -80 -80 -80 -80 bb_adc_desired_size -32 -32 -38 -32 -32 rf_ob 2 2 2 2 2 rf_db 2 2 2 2 2 rf_b_ob 2 2 2 2 2 rf_b_db 2 2 2 2 2 rf_xpdsel 1 1 1 1 1 rf_pdgain_lo 0x0 0x0 0x0 0x0 0x0 rf_pdgain_hi 0x0 0x0 0x0 0x0 0x0 #rf_pdgain_hi 0x3 0x3 0x3 0x3 0x3 bb_thresh62 15 15 28 28 28 bb_tx_end_to_xpab_off 0 0 0 0 0 bb_tx_end_to_xpaa_off 0 0 0 0 0 bb_tx_frame_to_xpab_on 0x0e 0xe 0x7 0xe 0xe bb_tx_frame_to_xpaa_on 0x0e 0xe 0x7 0xe 0xe bb_tx_end_to_xlna_on 2 2 2 2 2 rf_gain_I 0x0a 0x0a 0x0a 0x0a 0x0a @config_section_end # end @config section |
|
|