CN115033518A - USB protocol data communication method based on OTG controller - Google Patents

USB protocol data communication method based on OTG controller Download PDF

Info

Publication number
CN115033518A
CN115033518A CN202210733712.9A CN202210733712A CN115033518A CN 115033518 A CN115033518 A CN 115033518A CN 202210733712 A CN202210733712 A CN 202210733712A CN 115033518 A CN115033518 A CN 115033518A
Authority
CN
China
Prior art keywords
usb
slave
loongson
descriptor
host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210733712.9A
Other languages
Chinese (zh)
Inventor
王遥
沈飞
王剑秋
谭健
徐锋
罗梓桂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Lemote Information Technology Co ltd
Original Assignee
Jiangsu Lemote Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Lemote Information Technology Co ltd filed Critical Jiangsu Lemote Information Technology Co ltd
Priority to CN202210733712.9A priority Critical patent/CN115033518A/en
Publication of CN115033518A publication Critical patent/CN115033518A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)

Abstract

The invention discloses a USB data communication scheme based on a Loongson OTG controller, which comprises the following steps: step 1: constructing equipment conforming to the USB protocol based on an OTG controller interface of a SLAVE computer of the SLAVE Loongson, and constructing a USB equipment descriptor, a USB configuration descriptor, a USB interface descriptor and a USB endpoint descriptor conforming to the USB protocol by software; step 2: connecting the SLAVE of SLAVE Loongson with HOST X86 or the USB controller interface of the Loongson HOST through a USB data line; and step 3: HOST (X86/Loongson) completes bidirectional USB protocol communication by reading and writing its USB controller interface and SLAVE (Loove) by reading and writing its OTG controller interface. When the Loongson platform is used as a SLAVE, the Loongson platform can perform bidirectional data communication based on the USB protocol with the HOST HOST.

Description

USB protocol data communication method based on OTG controller
Technical Field
The invention relates to the technical field of computers, in particular to a scheme for data communication based on a USB protocol of a Loongson OTG controller.
Background
At present, USB protocol-based bidirectional communication between SLAVE and HOST based on Loongson is very important, and the technical scheme of using OTG controller interface of Loongson is very few. How to adopt a Loongson LS2K1000 chip on hardware and adopt LINUX operating system kernel and drive on a Loongson LS2K1000 platform on software is a problem which needs to be solved urgently at present.
Disclosure of Invention
The invention aims to solve the problem of bidirectional data communication based on a USB protocol with a HOST HOST when a Loongson is used as a SLAVE.
The technical scheme adopted by the invention for solving the technical problems is as follows: a USB protocol data communication method based on an OTG controller comprises the following steps:
step 1: the method comprises the steps that equipment conforming to the USB protocol is constructed on the basis of an OTG controller interface of a SLAVE Loongson SLAVE machine, and USB equipment descriptors, USB configuration descriptors, USB interface descriptors and USB endpoint descriptors conforming to the USB protocol are constructed by software, so that corresponding functions of the equipment can be enabled.
Step 2: connecting the SLAVE of SLAVE Loongson with HOST X86 or the USB controller interface of the Loongson HOST through a USB data line;
and step 3: HOST (X86/Loongson) completes bidirectional USB protocol communication by reading and writing its USB controller interface and SLAVE (Loove) by reading and writing its OTG controller interface.
Further, in step 1 of the present invention, the SLAVE godson-based OTG controller is configured to conform to the USB protocol standard device by software, and the specific method is that the software constructs a USB device descriptor, a USB configuration descriptor, a USB interface descriptor, and a USB endpoint descriptor conforming to the USB protocol, so as to enable corresponding functions thereof.
Further, in step 3 of the present invention, the HOST (X86/Loongson) completes bidirectional USB protocol communication by reading and writing its USB controller interface and SLAVE (Loove) and reading and writing its OTG controller interface.
Further, the configuration of the software construction process is completed by a LINUX operating system and a driver.
Has the beneficial effects that:
when the Loongson platform is used as a SLAVE, the Loongson platform can perform bidirectional data communication based on the USB protocol with the HOST HOST.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention more clearly apparent, the present invention is described in detail below with reference to the accompanying drawings and embodiments. It should be noted that the specific embodiments described herein are only for explaining the present invention and are not used to limit the present invention.
As shown in fig. 1, the present invention provides a USB protocol data communication method based on an OTG controller, which uses a Loongson LS2K1000 chip on hardware; and a LINUX operating system kernel and a drive are adopted on a software upper Loongson LS2K1000 platform. The method specifically comprises the following steps:
step 1: the method comprises the steps that equipment conforming to the USB protocol is constructed on the basis of an OTG controller interface of a SLAVE Loongson SLAVE machine, and USB equipment descriptors, USB configuration descriptors, USB interface descriptors and USB endpoint descriptors conforming to the USB protocol are constructed by software, so that corresponding functions of the equipment can be enabled.
And 2, step: connecting the SLAVE with HOST X86 or the USB controller interface of the Loongson master HOST through a USB data line;
and 3, step 3: HOST (X86/Loongson) completes bidirectional USB protocol communication by reading and writing its USB controller interface and SLAVE (Loove) by reading and writing its OTG controller interface.
In the step 1 of the present invention, the SLAVE godson based SLAVE OTG controller is configured to comply with the USB protocol standard device by software, and the specific method is that the software constructs a USB device descriptor, a USB configuration descriptor, a USB interface descriptor, and a USB endpoint descriptor according to the USB protocol, so as to enable the corresponding functions.
In the step 3 of the present invention, the HOST (X86/Loongson) completes the bidirectional USB protocol communication by reading and writing the USB controller interface and SLAVE (Loove) interface and reading and writing the OTG controller interface.
The software construction process of the invention is completed by the LINUX operating system and the driver.
While the preferred embodiments of the present invention have been described in detail, it will be understood by those skilled in the art that the invention is not limited thereto, and that various changes and modifications may be made without departing from the spirit of the invention, and the scope of the invention is defined in the appended claims.

Claims (3)

1. An OTG controller-based USB protocol data communication method is characterized by comprising the following steps:
step 1: constructing equipment conforming to a USB protocol based on an OTG controller interface of a SLAVE Loongson SLAVE machine, and constructing a USB equipment descriptor, a USB configuration descriptor, a USB interface descriptor and a USB endpoint descriptor conforming to the USB protocol by software;
step 2: connecting the SLAVE with HOST X86 or the USB controller interface of the Loongson master HOST through a USB data line;
and step 3: HOST (X86/Loongson) completes bidirectional USB protocol communication by reading and writing its USB controller interface and SLAVE (Loove) by reading and writing its OTG controller interface.
2. The method according to claim 1, wherein the method comprises: in the step 1, the SLAVE Loose-based OTG controller is configured into the USB protocol standard equipment by software, and the software constructs a USB equipment descriptor, a USB configuration descriptor, a USB interface descriptor and a USB endpoint descriptor which accord with the USB protocol.
3. The method according to claim 1, wherein the method comprises: in the step S3, the HOST (X86/Loongson) completes bidirectional USB protocol communication by reading and writing its USB controller interface and SLAVE (Loove) and reading and writing its OTG controller interface.
CN202210733712.9A 2022-06-27 2022-06-27 USB protocol data communication method based on OTG controller Pending CN115033518A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210733712.9A CN115033518A (en) 2022-06-27 2022-06-27 USB protocol data communication method based on OTG controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210733712.9A CN115033518A (en) 2022-06-27 2022-06-27 USB protocol data communication method based on OTG controller

Publications (1)

Publication Number Publication Date
CN115033518A true CN115033518A (en) 2022-09-09

Family

ID=83127397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210733712.9A Pending CN115033518A (en) 2022-06-27 2022-06-27 USB protocol data communication method based on OTG controller

Country Status (1)

Country Link
CN (1) CN115033518A (en)

Similar Documents

Publication Publication Date Title
US7921244B2 (en) Data sharing and transfer systems and methods
CN1987843B (en) Self adapting method for USB protocol
US6618788B1 (en) ATA device control via a packet-based interface
US8001304B2 (en) Portable memory device with multiple I/O interfaces wherein each I/O interface has respective protocol and device parameters are requested from one I/O interface using only respective protocol
EP2474913A1 (en) USB device switching working mode
US20160224493A1 (en) Universal serial bus (usb) kvm switch using virtual usb for switching among multiple hosts
US20070162679A1 (en) Bus device
US6654843B1 (en) Hot swapping
CN106407145A (en) An interface access method and system and a memory card
CN104615556A (en) EDID burning device and method
CN106066842A (en) A kind of method of switch mode, SOC(system on a chip) and base station
CN105302763A (en) USB 3.0 protocol based read-only control system and method
US20160077986A1 (en) Electronic apparatus providing real-time switching and sharing of usb electronic devices among hosts
CN102981675B (en) A kind of multiple point touching data processing method and system thereof
US8452883B2 (en) Method for data transmission
CN115033518A (en) USB protocol data communication method based on OTG controller
CN112416447A (en) Method for realizing multiple composite function devices by one USB port and composite device
CN112347017A (en) PS/2 keyboard dual-host plug-in system with LPC bus interface and switching method
CN107562676B (en) Method for communicating with generator set controller through USB (universal serial bus) based on VB
CN112416829B (en) Method for transmitting data to HMI (human machine interface) and USB HID (Universal Serial bus) equipment
US8214569B2 (en) Method for reading and writing non-standard register of serial advanced technology attachment (SATA) device
CN112346665A (en) Communication method, device, equipment, system and storage medium of solid state disk
CN110045967B (en) Serial graphical interface interaction method and device of firmware layer
CN109522056B (en) Host controller driving implementation method of large-capacity storage equipment under VxWorks system
US20150095540A1 (en) External device and a transmission system and the method of the heterogeneous device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication