pd6710.rar

  • DFGFHGFH
    了解作者
  • C/C++
    开发工具
  • 13KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 12
    下载次数
  • 2007-07-24 16:07
    上传日期
介绍一款无线通讯芯片在嵌入式linux中的使用 包括原理图和相应程序.
pd6710.rar
  • 第11章
  • 11章_PCMCIA.Sch
    33.1KB
  • pd6710.h
    3.1KB
  • pd6710.c
    11.9KB
  • www.pudn.com.txt
    218B
内容介绍
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style type="text/css"> <!-- body,td,p,th{font-size:14px;} input{font-size:12px;} --> </style> <title></title> <script language=javascript src="http://mimg.163.com/jsstyle/js/readletter.js"></script> </head> <body leftmargin="5" topmargin="5" marginwidth="0" marginheight="0" border="0"> <pre style="width:100%;word-wrap:break-word">#include &quot;pd6710.h&quot; /* A24=1, I/O A24=0, 存储 AEN=nGCS2, 绝对地址: 0x10000000~0x10FFFFFF: 存储区域 0x11000000~0x11FFFFFF: I/O区域 */ int PD6710_Init(void); void PD6710_InitBoard(void); void PD6710_InitInterrupt(void); void PD6710_CardEnable(void); void PD6710_Wr(U8 index, U8 data); U8 PD6710_Rd(U8 index); void PD6710_Modify(U8 index,U8 mask,U8 data); void PD6710_CommonMemAccess(void); void PD6710_AttrMemAccess(void); U8 Card_RdAttrMem(U32 memaddr); U8 Card_RdIO(U32 ioaddr); void Card_WrIO(U32 ioaddr,U8 data); void PrintCIS(void); void __irq IsrPD6710Card(void); void __irq IsrPD6710Management(void); volatile int isCardInsert=0; void _dbg(int i) { Uart_Printf(&quot;&lt;%d&gt;&quot;,i); } void Test_PD6710(void) { Uart_Printf(&quot;[PD6710 test for reading pc_card CIS]\n&quot;); Uart_Printf(&quot;Insert PC card!!!\n&quot;); PD6710_InitBoard(); PD6710_Init(); PD6710_InitInterrupt(); //如果nCD1,2为低, 说明PCMCIA插入. //这种情况下, 不出现中断管理. if((PD6710_Rd(INTERFACE_STATUS)&amp;0xc)==0xc) { Uart_Printf(&quot;Card is inserted.\n&quot;); Delay(2000); //为了保持系统稳定,需要一定时延 //如果没有时延,一些 CF card可能检测不到 PD6710_CardEnable(); PrintCIS(); } Uart_Printf(&quot;Waiting now.\n&quot;); while(1) { Uart_Printf(&quot;.&quot;); Delay(10000); } } //IRQ堆栈扩展到4096 byte. void PrintCIS(void) { int i,j; U32 cisEnd=0; static U8 str[16]; U8 c; Uart_Printf(&quot;[Card Information Structure]\n&quot;); PD6710_AttrMemAccess(); //查找CIS尾部 while(1) { c=Card_RdAttrMem((cisEnd)*2); Uart_Printf(&quot;c=%x,cisEnd=%d&quot;,c,cisEnd); if(c==0xff) //0xff= 终止 break; cisEnd++; cisEnd+=Card_RdAttrMem((cisEnd)*2)+1; } Uart_Printf(&quot;cisEnd=0~%x\n&quot;,cisEnd); for(i=0;i&lt;=cisEnd*2;i+=2) { c=Card_RdAttrMem(i); str[(i%0x20)/2]=c; Uart_Printf(&quot;%2x,&quot;,c); if((i%0x20)&gt;=0x1e) { Uart_Printf(&quot;//&quot;); for(j=0;j&lt;0x10;j++) if(str[j]&gt;=' ' &amp;&amp; str[j]&lt;=127)Uart_Printf(&quot;%c&quot;,str[j]); else Uart_Printf(&quot;.&quot;); Uart_Printf(&quot;\n&quot;); } } Uart_Printf(&quot;\n&quot;); } #define B6710_Tacs (0x0) // 0clk #define B6710_Tcos (0x3) // 4clk #define B6710_Tacc (0x7) // 14clk #define B6710_Tcoh (0x1) // 1clk #define B6710_Tah (0x0) // 0clk #define B6710_Tacp (0x3) // 6clk #define B6710_PMC (0x0) // 正常(1data) void PD6710_InitBoard(void) { //硬件板上初始化PD6710 rGPFCON=rGPFCON&amp;~(3&lt;&lt;6)|(2&lt;&lt;6); rGPGCON=rGPGCON&amp;~(3&lt;&lt;0)|(2&lt;&lt;0); rBWSCON=rBWSCON&amp;~(0xf&lt;&lt;8)|(0xd&lt;&lt;8); //nGCS2=nUB/nLB(nSBHE),nWAIT,16bit rBANKCON2=((B6710_Tacs&lt;&lt;13)+(B6710_Tcos&lt;&lt;11)+(B6710_Tacc&lt;&lt;8)+(B6710_Tcoh&lt;&lt;6)\ +(B6710_Tah&lt;&lt;4)+(B6710_Tacp&lt;&lt;2)+(B6710_PMC)); } void PD6710_InitInterrupt(void) { rEXTINT0=rEXTINT0&amp;~(7&lt;&lt;12)|(2&lt;&lt;12); //EINT3(GPF3)下降沿 rEXTINT1=rEXTINT1&amp;~(7&lt;&lt;0)|(4&lt;&lt;0); //EINT8(GPG0)上升沿 pISR_EINT3=(U32)IsrPD6710Management; //nINT_P_CON pISR_EINT8_23=(U32)IsrPD6710Card; //nINT_P_DEV rSRCPND = BIT_EINT3|BIT_EINT8_23; //清除 pending状态 rINTPND = BIT_EINT3|BIT_EINT8_23; rINTMSK=~(BIT_EINT3|BIT_EINT8_23); rEINTMASK=rEINTMASK&amp;~(1&lt;&lt;8)|(0&lt;&lt;8); //EINTMASK[8]=中断使能 } int PD6710_Init(void) { //初始化PD-6710 PD6710_Wr(POWER_CTRL,(0&lt;&lt;7)|(1&lt;&lt;5)|(0&lt;&lt;4)|(0&lt;&lt;0)); //电源Vpp1=0V PD6710_Wr(INT_GENERAL_CTRL,(1&lt;&lt;7)|(0&lt;&lt;5)|(1&lt;&lt;4)|(3&lt;&lt;0)); //manage_int=-INTR pin, nINT_P_DEV=IRQ3 PD6710_Wr(MANAGEMENT_INT_CONFIG,(1&lt;&lt;0)|(1&lt;&lt;3)|(3&lt;&lt;4)); PD6710_Wr(IO_WINDOW_CTRL,0|(0&lt;&lt;3)); //IO0=8bit,timing_set_0 // I/O窗口不能包括 3e0h and 3e1h // IO内容=0x3f8~0x3ff(COM1) -&gt;0x3f8~0x3ff PD6710_Wr(SYS_IO_MAP0_START_L,0xf8); PD6710_Wr(SYS_IO_MAP0_START_H,0x3); PD6710_Wr(SYS_IO_MAP0_END_L,0xff); PD6710_Wr(SYS_IO_MAP0_END_H,0x3); PD6710_Wr(CARD_IO_MAP0_OFFSET_L,0x0); PD6710_Wr(CARD_IO_MAP0_OFFSET_H,0x0); //内存窗口, 最小64KB PD6710_Wr(SYS_MEM_MAP0_START_L,0x0); //MEM0=8bit数据宽度 PD6710_Wr(SYS_MEM_MAP0_START_H,0x0); PD6710_Wr(SYS_MEM_MAP0_END_L,0x0f); //0x0 ~ 0xffff PD6710_Wr(SYS_MEM_MAP0_END_H,0x0|(0&lt;&lt;6)); //timing_set_0 PD6710_Wr(CARD_MEM_MAP0_OFFSET_L,0x0); PD6710_Wr(CARD_MEM_MAP0_OFFSET_H,0x0|(1&lt;&lt;6)); //nREG=active //MEM AREA=0x0~0xFFFF -&gt;0x0~0xFFFFFF PD6710_Wr(MAPPING_ENABLE,1|(1&lt;&lt;6)); //memory map 0,使能I/O map 0使能 PD6710_Wr(MISC_CTRL1,(0&lt;&lt;7)|(1&lt;&lt;4)|(1&lt;&lt;3)|(1&lt;&lt;2)|(1&lt;&lt;1)); // nVCC_3_使能(暂时) PD6710_Wr(MISC_CTRL2,1|(1&lt;&lt;1)|(1&lt;&lt;4)); //25Mhz,IRQ12=drive_LED PD6710_Wr(FIFO_CTRL,0x80); // FIFO //配置时钟寄存器前,FIFO应清零 //默认访问时间为300ns PD6710_Wr(SETUP_TIMING0,0x2); PD6710_Wr(CMD_TIMING0,0x8); //25Mhz 时钟 PD6710_Wr(RECOVERY_TIMING0,0x2); Delay(1000); Uart_Printf(&quot;INT_GENERAL_CTRL=%x\n&quot;,PD6710_Rd(INT_GENERAL_CTRL)); Uart_Printf(&quot;MANAGEMENT_INT_CONFIG=%x\n&quot;,PD6710_Rd(MANAGEMENT_INT_CONFIG)); Uart_Printf(&quot;SYS_IO_MAP0_END_L=%x\n&quot;,PD6710_Rd(SYS_IO_MAP0_END_L)); Uart_Printf(&quot;POWER_CTRL=%x\n&quot;,PD6710_Rd(POWER_CTRL)); Uart_Printf(&quot;MISC_CTRL1=%x\n&quot;,PD6710_Rd(MISC_CTRL1)); Uart_Printf(&quot;SYS_IO_MAP0_START_L=%x\n&quot;,PD6710_Rd(SYS_IO_MAP0_START_L)); Uart_Printf(&quot;IO_WINDOW_CTRL=%x\n&quot;,PD6710_Rd(IO_WINDOW_CTRL)); Uart_Printf(&quot;CARD_IO_MAP0_OFFSET_H=%x\n&quot;,PD6710_Rd(CARD_IO_MAP0_OFFSET_H)); Uart_Printf(&quot;CARD_IO_MAP0_OFFSET_L=%x\n&quot;,PD6710_Rd(CARD_IO_MAP0_OFFSET_L)); Uart_Printf(&quot;SYS_IO_MAP0_END_H=%x\n&quot;,PD6710_Rd(SYS_IO_MAP0_END_H)); Uart_Printf(&quot;SYS_IO_MAP0_START_H=%x\n&quot;,PD6710_Rd(SYS_IO_MAP0_START_H)); Uart_Printf(&quot;SYS_MEM_MAP0_START_L=%x\n&quot;,PD6710_Rd(SYS_MEM_MAP0_START_L)); Uart_Printf(&quot;SYS_MEM_MAP0_END_L=%x\n&quot;,PD6710_Rd(SYS_MEM_MAP0_END_L)); Uart_Printf(&quot;SYS_MEM_MAP0_END_H=%x\n&quot;,PD6710_Rd(SYS_MEM_MAP0_END_H)); Uart_Printf(&quot;SYS_MEM_MAP0_START_H=%x\n&quot;,PD6710_Rd(SYS_MEM_MAP0_START_H)); Uart_Printf(&quot;CARD_MEM_MAP0_OFFSET_L=%x\n&quot;,PD6710_Rd(CARD_MEM_MAP0_OFFSET_L)); Uart_Printf(&quot;CARD_MEM_MAP0_OFFSET_H=%x\n&quot;,PD6710_Rd(CARD_MEM_MAP0_OFFSET_H)); Uart_Printf(&quot;MAPPING_ENABLE=%x\n&quot;,PD6710_Rd(MAPPING_ENABLE)); Uart_Printf(&quot;MISC_CTRL2=%x\n&quot;,PD6710_Rd(MISC_CTRL2)); Uart_Printf(&quot;FIFO_CTRL=%x\n&quot;,PD6710_Rd(FIFO_CTRL)); Uart_Printf(&quot;SETUP_TIMING0=%x\n&quot;,PD6710_Rd(SETUP_TIMING0)); Uart_Printf(&quot;CMD_TIMING0=%x\n&quot;,PD6710_Rd(CMD_TIMING0)); Uart_Printf(&quot;RECOVERY_TIMING0=%x\n&quot;,PD6710
评论
    相关推荐
    • pd6710.rar
      基于PCMCIA接口代码,主要实现读取存储卡寄存器配置,确定PC Card所需要的资源并对他进行配置。软件设计主要包括两方面,一是PCcard侧的ARM控制器对CIS的初始化程序;另一方面是PC侧的驱动程序。
    • pd6710.rar
      无线网络数据传输系统代码,基于PCMCIA的
    • CLPD6710.rar
      CF卡及pcmcia 口控制芯片资料,也可以扩展成IDE接口,在做外设扩展时需要
    • pd6700_driver.rar
      嵌入式linux 开发板驱动程序,本驱动可直接驱动PDB设备
    • zedboard原理图和指导手册.zip
      ZedBoard_RevD.2_Schematic and ZedBoard_HW_User's Guide_v1_6 zedboard的原理图和指导手册
    • S3C2440最全面的裸机测试程序
      S3C2440最全面的裸机测试程序,如果IDE不合适,直接看源码无大碍。...PD6710.c memtest.c k9k2g16.c IrDA.c iotest.c Eint.c flash.c dvstest.c cpuspeed.c int.c camproset.c IrDA.c Adcts.c ac97.c IIC.c iis.c
    • ADS 下S3C440a 编程
      ADS 下S3C440a 编程 里面有ARM驱动的例子
    • 2440三星测试程序
      (void *)Test_PD6710, "PCMCIA test ", (void *)Test_ISram, "Stepping stone ", //(void *)Test_WaitPin, "nWAIT test ", (void *)Test_Nand, "Nand test ", (void *)ProgramFlash, "Program Flash ",...
    • BAP6710H.86A.0083.BI.zip
      intel pd67ba 最新bios文件
    • Proteus7.12.rar
      Proteus7.12完美破解版.rar电路仿真软件很好用可以仿真单片数字模拟电路