APP下载

基于Win CE的EP9315_SPI驱动程序设计

2009-08-13张东许弟建

现代电子技术 2009年10期

张 东 许弟建

摘 要:编写联系操作系统和相应硬件设备的驱动程序至关重要。在Platform Builder 4.2开发环境下,基于流接口驱动程序模型,详细阐述嵌入式操作系统Win CE下EP9315芯片的SPI接口的驱动程序设计方法,就设计步骤、虚拟地址映射实现和关键程序代码编写等进行具体分析,并论述驱动程序与EVC编程环境下SPI应用程序之间的关系。驱动程序和相应应用程序能正确运行于优龙的FS_EP9315开发平台。实践证明,该方法正确可行。

关键词:嵌入式操作系统;Win CE;SPI;驱动程序

中图分类号:TP311文献标识码:B

文章编号:1004-373X(2009)10-069-04

Design of EP9315-SPI Driver Based on Win CE

ZHANG Dong1,XU Dijian2

(1.Chongqing University of Arts and Sciences,Chongqing,402160,China;2.Chongqing University of Science and Technology,Chongqing,401331,China)

Abstract: It is very important to compile driver connecting operating system with corresponded hardware device.Based on stream interface driver model,the design of SPI driver in embedded operating system Win CE in development environment of platform builder 4.2 and design method are introduced and analysed,realizing virtual address map,key code and the relationship between driver and SPI application program in EVC program environment is discussed.Driver and corresponded application program can be operated on FS_EP9315 development platform of ucdragon rightly.Experience indicates the methord is right and feasible.

Keywords:embedded operating system;Win CE;SPI;driver program

0 引 言

嵌入式是“以应用为中心,以计算机技术为基础,软硬件可裁剪,适合应用系统对功能、可靠性、成本、体积、功耗严格要求的计算机系统”。Windows CE.NET是Microsoft推出的功能强大的紧凑、高效、可伸缩的32位嵌入式操作系统,主要面对各种各样嵌入式系统的产品[1,2]。

该系统具有多线程、多任务、完全抢占式的特点,是为各种具有严格资源限制的硬件系统所设计的。为了将操作系统和硬件设备连接起来,硬件和软件的驱动联系就显得很重要。SPI是一种高速、全双工、同步的通信总线,在芯片的管脚上只占用4根线,节约了芯片的管脚,同时为PCB的布局节省了空间,提供了方便,正是出于这种简单易用的特性,现在越来越多的芯片都集成了这种通信协议。SPI的工作模式有两种:主模式和从模式,SPI总线可以配置成单主单从、单主多从、互为主从。为了充分利用芯片的SPI接口进行相应的驱动程序设计以及应用程序设计,通用方法的研究就显得十分重要。……

登录APP查看全文