The Universal Serial Bus,as a kind of peripheral bus standard,has won a marketplace approve and been popularized promptly with its obvious benefits,such as high speed,robustness,ease—to-use,low-cost and easy-to-use solution.USB has become the most inclined standard for the interconnection between PC and peripheral devices , such as portable storage devices , digital products and portable communication devices.There are several USB projects in the Beijing Embedded System Lab. In this thesis, the firmware on the device controller and a universal driver are developed. The target is that the firmware can be easily extended and the driver can be used in different projects.The thesis analyzes the requirements about the firmware and designs the basic architecture. And then, modules are separated by the concept that whether it can be extensional. The structure and the design of each module are introduced in detail. Later, the paper introduces the architecture of the driver, some kernel structure. Modules including PNP module which is the most import module are realized. The interfaces between the application and the driver are also introduced. At last, a test solution for the whole system is designed. The paper analyzes the test results, finds where the bottleneck is and optimizes the code of driver.The firmware implemented by the paper has an extensible architecture. A special mechanism for extending the functions has been done for the firmware. Developers can easily add the function they define to the firmware. The firmware is used in some projects in the lab. And so is the driver. The driver is standard and can deal with many boundary conditions. This paper reaches its targets: much development & test time can be saved and the cost of the projects can be lower. |