基于飛思卡爾MCU的USB設(shè)備協(xié)議棧的研究與實(shí)現(xiàn)
發(fā)布時(shí)間:2019-06-21 11:04
【摘要】:隨著USB協(xié)議規(guī)范的不斷完善和USB接口的眾多優(yōu)點(diǎn),現(xiàn)在越來越多的數(shù)碼設(shè)備都采用USB接口與主機(jī)進(jìn)行數(shù)據(jù)傳輸,如只需傳輸小數(shù)據(jù)量的鼠標(biāo)、游戲柄設(shè)備,需要傳輸大數(shù)據(jù)量的U盤、數(shù)碼照相機(jī)、數(shù)碼攝像機(jī)等設(shè)備,USB接口的“觸角”幾乎已經(jīng)伸向每一種計(jì)算機(jī)的外設(shè)。在當(dāng)前的USB應(yīng)用中,主機(jī)大多還是由PC擔(dān)任,而PC端的USB驅(qū)動已經(jīng)非常成熟,很多PC端的操作系統(tǒng)中就包含了絕大多數(shù)的USB設(shè)備類的驅(qū)動程序。但是形形色色的USB設(shè)備端的驅(qū)動和協(xié)議棧卻非常缺乏。本文正是出于這樣的考慮,基于FreeScale S08系列MCU設(shè)計(jì)了一個(gè)通用的USB設(shè)備協(xié)議棧,這樣可以大大減少USB設(shè)備開發(fā)人員的工作的量,有效的縮短開發(fā)周期,降低開發(fā)風(fēng)險(xiǎn),保證開發(fā)質(zhì)量。 本文首先介紹了USB接口的應(yīng)用現(xiàn)狀,并對其數(shù)據(jù)傳輸原理做了較為詳細(xì)的闡述,包括USB系統(tǒng)的拓?fù)浣Y(jié)構(gòu)、主/從機(jī)傳輸?shù)臄?shù)據(jù)流結(jié)構(gòu)、USB傳輸中用到的數(shù)據(jù)模型和數(shù)據(jù)結(jié)構(gòu)以及USB2.0規(guī)范中的三種常用的傳輸方式等內(nèi)容。 其后是本文的重點(diǎn),在介紹了本協(xié)議棧設(shè)計(jì)的基本框架結(jié)構(gòu)和思路之后,開始闡述各層各部分功能是如何用C語言實(shí)現(xiàn)的,各層之間是如何傳遞數(shù)據(jù)的,各層之間是如何通過回調(diào)函數(shù)相互傳遞消息的,建立了哪些數(shù)據(jù)結(jié)構(gòu),設(shè)置了哪些全局變量,以及如何本協(xié)議棧的用戶應(yīng)該如何使用本協(xié)議棧。 最后,在Freescale HCS08JS16平臺上分析了如何管理USB設(shè)備控制器的內(nèi)存,并通過跟蹤設(shè)備驅(qū)動中最重要的枚舉過程對本協(xié)議棧進(jìn)行了驗(yàn)證,分析了設(shè)備各種描述符的返回過程。同時(shí)對協(xié)議棧中存在的問題及需要改進(jìn)的技術(shù)做了論述,并展望了USB接口的應(yīng)用前景。
[Abstract]:With the continuous improvement of USB protocol specification and the many advantages of USB interface, more and more digital devices use USB interface to transmit data to host computer, such as mouse with small amount of data, handle device, U disk, digital camera, digital camera and other devices that need to transmit large amount of data. The "tentacles" of USB interface have extended to the peripherals of almost every kind of computer. In the current USB applications, most of the hosts are still PC, and the USB driver on the PC side has been very mature. Most of the USB device drivers are included in many PC operating systems. However, all kinds of USB device drivers and protocol stacks are very scarce. In this paper, based on FreeScale S08 series MCU, a general USB device protocol stack is designed, which can greatly reduce the amount of work of USB device developers, effectively shorten the development cycle, reduce the development risk and ensure the development quality. In this paper, the application status of USB interface is introduced, and its data transmission principle is described in detail, including the topology of USB system, the data flow structure of master / slave transmission, the data model and data structure used in USB transmission, and three common transmission modes in USB2.0 specification. After introducing the basic framework structure and train of thought of this protocol stack design, this paper begins to explain how the functions of each layer are realized in C language, how to transfer data between layers, how to transfer messages to each other through callback functions, what data structures are established, which global variables are set up, and how the users of this protocol stack should use this protocol stack. Finally, how to manage the memory of USB device controller is analyzed on Freescale HCS08JS16 platform, and the protocol stack is verified by tracking the most important enumerating process in device driver, and the return process of various descriptive characters of the device is analyzed. At the same time, the problems existing in the protocol stack and the technologies that need to be improved are discussed, and the application prospect of USB interface is prospected.
【學(xué)位授予單位】:安徽大學(xué)
【學(xué)位級別】:碩士
【學(xué)位授予年份】:2012
【分類號】:TP334.7
本文編號:2504029
[Abstract]:With the continuous improvement of USB protocol specification and the many advantages of USB interface, more and more digital devices use USB interface to transmit data to host computer, such as mouse with small amount of data, handle device, U disk, digital camera, digital camera and other devices that need to transmit large amount of data. The "tentacles" of USB interface have extended to the peripherals of almost every kind of computer. In the current USB applications, most of the hosts are still PC, and the USB driver on the PC side has been very mature. Most of the USB device drivers are included in many PC operating systems. However, all kinds of USB device drivers and protocol stacks are very scarce. In this paper, based on FreeScale S08 series MCU, a general USB device protocol stack is designed, which can greatly reduce the amount of work of USB device developers, effectively shorten the development cycle, reduce the development risk and ensure the development quality. In this paper, the application status of USB interface is introduced, and its data transmission principle is described in detail, including the topology of USB system, the data flow structure of master / slave transmission, the data model and data structure used in USB transmission, and three common transmission modes in USB2.0 specification. After introducing the basic framework structure and train of thought of this protocol stack design, this paper begins to explain how the functions of each layer are realized in C language, how to transfer data between layers, how to transfer messages to each other through callback functions, what data structures are established, which global variables are set up, and how the users of this protocol stack should use this protocol stack. Finally, how to manage the memory of USB device controller is analyzed on Freescale HCS08JS16 platform, and the protocol stack is verified by tracking the most important enumerating process in device driver, and the return process of various descriptive characters of the device is analyzed. At the same time, the problems existing in the protocol stack and the technologies that need to be improved are discussed, and the application prospect of USB interface is prospected.
【學(xué)位授予單位】:安徽大學(xué)
【學(xué)位級別】:碩士
【學(xué)位授予年份】:2012
【分類號】:TP334.7
【參考文獻(xiàn)】
相關(guān)期刊論文 前1條
1 晁建剛 ,魏安陽 ,邱淑范;通用串行總線(USB)設(shè)備的驅(qū)動[J];電子技術(shù)應(yīng)用;2001年05期
相關(guān)碩士學(xué)位論文 前3條
1 宋鵬;嵌入式系統(tǒng)中USB接口技術(shù)應(yīng)用研究與開發(fā)[D];揚(yáng)州大學(xué);2005年
2 卞廷波;USB Mass Storage類設(shè)備固件的設(shè)計(jì)與實(shí)現(xiàn)[D];電子科技大學(xué);2006年
3 曹國飛;嵌入式USB主機(jī)接口的設(shè)計(jì)[D];哈爾濱理工大學(xué);2006年
,本文編號:2504029
本文鏈接:http://sikaile.net/kejilunwen/jisuanjikexuelunwen/2504029.html
最近更新
教材專著