基于STM32的USB简易鼠标设计 - 图文

2019-02-16 01:37

毕 业 设 计 [论 文]

题 目: 基于STM32的USB简易鼠标设计 学 院: 电气与信息工程学院 专 业: 电子信息工程 姓 名: 学 号: 指导老师:

完成时间: 2015年06月01日

河南城建学院本科毕业设计(论文) 摘要

摘 要

随着设备的越来越智能化,嵌入式计算机大量应用到各种电子设备中,基于嵌入式系统的USB鼠标及键盘的应用也变得越来越广泛。在本次设计中,研究的是一款基于STM32的USB鼠标,即插即用,免驱动自动识别,很好的解决了鼠标设备智能化和低延迟的设计要求。由于是基于HID的USB设备,所以编程非常方便,贴近工程实践,应用前景广阔。

嵌入式系统HID,即人机接口设备,是Human Interface Device的缩写。HID是计算机周边设备中非常常见的设备类型,是可以直接与进行人交互的USB设备,例如鼠标、摄像头、U盘等。在种类繁多USB设备中,HID类设备的成本一般情况下是比较低的。实际上,只要是符合HID标准的设备都是HID设备,不一定非要具有人机交互功能。 最早支持HID设备的计算机操作系统是Windows98系统。 HID设备的驱动程序内置在这些系统中,不需要单独开发与安装驱动,应用程序可以直接使用这些驱动程序来与设备通信。

近年来,受计算机性能提升和游戏软件等的影响,人们对鼠标的要求越来越高,特别是一些即时作战游戏,人们希望能达到“零”延迟,这就对原来的鼠标技术提出了挑战。老式的圆孔鼠标早已不再适用,特别是笔记本电脑根本不再设计老式插孔。随着USB2.0以及USB3.0的不断完善,再加上高速而价廉的单片机,一款基于STM32的USB简易鼠标正是本课题的研究内容。本文主要研究基于STM32的USB简易鼠标系统的功能、设计思想和实现,以及基于STM32的USB简易鼠标的组成及工作原理,描述了研究该课题的意义和应用价值。本设计的重点在于USB协议的HID部分,精通此协议并植入单片机才能实现计算机与鼠标的沟通。 关键词: USB 技术; HID 协议; STM32单片机;鼠标

I

河南城建学院本科毕业设计(论文) Abstract

Abstract

As more and more intelligent devices, embedded computers applied to the large variety of electronic devices, embedded systems USB mouse and keyboard applications are becoming more and more widespread. In this design, the study is a based on the STM32 USB mouse, plug and play, driver-free automatic identification, a good solution to the mouse device intelligence and low-latency design requirements. Because it is based on HID USB device, so the programming is very convenient, close to the engineering practice, the application prospects.

Embedded systems HID, namely human interface devices, is an abbreviation for Human Interface Device. HID is a computer peripheral device in a very common device types, people can interact directly with the conduct of USB devices, such as a mouse,camera, U disk and so on.In a wide range of USB devices, under HID class devices generally cost is relatively low.In fact, as long as a HID-compliant devices are HID device does not necessarily have to have interactive features.The earliest HID devices supported computer operating system is Windows98 system. HID device drivers built into these systems, the need for separate development and install the driver, an application can use these drivers to communicate with the device.

In recent years, the impact of computer and game software performance by, people have become increasingly demanding of the mouse, especially some instant combat game, people want to be able to achieve \delay, which the original mouse technology presents a challenge . Old-fashioned mouse the hole is no longer applicable, especially notebook computers designed simply no longer the old jack. With the continuous improvement USB2.0 and USB3.0, coupled with high speed and low cost microcontroller, a research based on the STM32 USB simple mouse precisely this topic. This article is mainly based on the STM32 USB simple mouse systems design and implementation, as well as easy on the STM32 USB mouse and work principle, it describes the subject of research and practical value. The design focuses on some USB HID protocol, proficient in this agreement and in order to achieve single-chip implanted communication computer mouse.

Keywords: USB technology; HID protocol; STM32 microcontroller; mouse

II

河南城建学院本科毕业设计(论文) 目录

目录

摘 要 ................................................................ I Abstract ............................................................ II 目录 ............................................................... III 第1章 引言 .......................................................... 1

1.1 课题背景 ...................................................... 1 1.2 基于STM32的USB鼠标的设计研究方法及目标 ...................... 1 1.3 USB鼠标国内外研究现状 ........................................ 2 第2章 USB协议概述 ................................................... 3

2.1 USB简介 ...................................................... 3 2.2 USB的拓扑结构 ................................................ 3 2.3 USB的电气特性 ................................................ 4 2.4 USB描述符 .................................................... 4 2.5 USB的包结构 .................................................. 5

2.5.1令牌包 ................................................... 5 2.5.2数据包 ................................................... 6 2.5.3握手包 ................................................... 6 2.5.4特殊包 ................................................... 6 2.6 USB的传输类型 ................................................ 7 第3章 STM32及MDK简介 ............................................... 8

3.1 STM32简介 .................................................... 8 3.2 MDK的使用 .................................................... 8 第4章 USB鼠标的实现 ................................................ 10

4.1 USB简易鼠标的程序编写 ....................................... 10 4.2 USB鼠标的运行 ............................................... 12 4.3 硬件实现 ..................................................... 12 设计总结 ............................................................ 14 附 录 ............................................................... 15

附录A main.c .................................................... 15 附录B usb_desc.c ................................................ 19 附录C hw_config.c ............................................... 26 附录D usb_prop.c ................................................ 38

III

河南城建学院本科毕业设计(论文) 目录

参考文献 ............................................................ 51 致 谢 ............................................................... 52

IV


基于STM32的USB简易鼠标设计 - 图文.doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:无梁楼盖设计注意事项

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: