WO2021073480A1 - 一种接口电路及其接口通信的方法、装置 - Google Patents

一种接口电路及其接口通信的方法、装置 Download PDF

Info

Publication number
WO2021073480A1
WO2021073480A1 PCT/CN2020/120437 CN2020120437W WO2021073480A1 WO 2021073480 A1 WO2021073480 A1 WO 2021073480A1 CN 2020120437 W CN2020120437 W CN 2020120437W WO 2021073480 A1 WO2021073480 A1 WO 2021073480A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
conversion unit
usb
control unit
slave
Prior art date
Application number
PCT/CN2020/120437
Other languages
English (en)
French (fr)
Inventor
陈华明
陆宏华
Original Assignee
深圳市道通科技股份有限公司
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 深圳市道通科技股份有限公司 filed Critical 深圳市道通科技股份有限公司
Priority to EP20877873.8A priority Critical patent/EP4030250A4/en
Publication of WO2021073480A1 publication Critical patent/WO2021073480A1/zh
Priority to US17/658,859 priority patent/US20220327087A1/en

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
    • G05B23/0213Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
    • 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
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
    • G05B23/0216Human interface functionality, e.g. monitoring system providing help to the user in the selection of tests or in its configuration
    • 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/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output 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/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • 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/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/387Information transfer, e.g. on bus using universal interface adapter for adaptation of different data processing systems to different peripheral devices, e.g. protocol converters for incompatible systems, open system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24065Real time diagnostics
    • 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]
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C2205/00Indexing scheme relating to group G07C5/00
    • G07C2205/02Indexing scheme relating to group G07C5/00 using a vehicle scan tool

Definitions

  • This application relates to the technical fields of automobiles and software, and in particular to an interface circuit and a method and device for interface communication.
  • automobile diagnostic equipment sets up multiple expansion interfaces to connect to multiple external devices through multiple expansion interfaces for data collection and enrich diagnostic data.
  • the expansion interface of the automobile diagnostic equipment establishes communication with the micro control unit by directly connecting with the output interface of the micro control unit.
  • the output interface of the micro-control unit is gradually reduced, which reduces the number of expansion interfaces that the micro-control unit can connect to, which in turn makes the automobile diagnostic equipment face the dilemma of insufficient expansion interfaces, and it is difficult to meet the diagnostic needs of the automobile diagnostic equipment.
  • the embodiment of the present invention aims to provide an interface circuit and a method and device for interface communication, the interface circuit can effectively prevent the number of expansion interfaces from decreasing as the number of output interfaces of the micro control unit decreases.
  • a technical solution adopted in the embodiments of the present invention is to provide an interface circuit, including: a USB HOST interface, a USB SLAVE interface, an HDMI interface, a first conversion unit, a second conversion unit, and a micro control unit;
  • the output interface of the micro control unit is respectively connected to the input terminal of the first conversion unit and the input terminal of the second conversion unit, and the output terminal of the first conversion unit is respectively connected to the USB HOST interface and the The USB SLAVE interface is connected, and the output end of the second conversion unit is connected to the HDMI interface;
  • the micro control unit is configured to control the first conversion unit to be set to the HOST mode when receiving the trigger signal of the USB HOST interface, so as to establish communication between the micro control unit and the USB HOST interface;
  • the micro control unit is also used to control the first conversion unit to be set to the SLAVE mode when receiving the trigger signal of the USB SLAVE interface, so as to establish communication between the micro control unit and the USB SLAVE interface ;
  • the micro control unit is further configured to control the second conversion unit to output a TMDS signal when receiving a trigger signal of the HDMI interface, so as to establish communication between the micro control unit and the HDMI interface.
  • the output interface of the micro control unit includes a USB3.1 interface
  • the USB3.1 interface includes a USB2.0 DRD pin and a USB3.1 DATA pin
  • the micro control unit is connected to the input terminal of the first conversion unit through the USB2.0 DRD pin.
  • the micro control unit controls The USB2.0 DRD pin works in the HOST mode
  • the micro control unit controls the USB2.0 DRD pin to work in the SLAVE mode;
  • the micro control unit is connected to the input end of the second conversion unit through the USB3.1 DATA pin.
  • the micro control unit controls the The USB3.1 DATA pin outputs a DP signal to the second conversion unit.
  • the first conversion unit includes: USB SWITCH;
  • the input end of the USB SWITCH is connected to the USB2.0 DRD pin, and the output end of the USB SWITCH is respectively connected to the USB HOST interface and the USB SLAVE interface.
  • the number of the USB HOST interface is at least 2; then,
  • the first conversion unit further includes:
  • the input end of the USB HUB is connected to the output end of the USB SWITCH, and the output end of the USB HUB is respectively connected to the at least two USB HOST interfaces.
  • the second conversion unit includes: a protocol converter
  • the input end of the protocol converter is connected to the USB3.1 DATA pin, and the output end of the protocol converter is connected to the HDMI interface.
  • the USB SWITCH includes: a SWITCH chip, a power supply circuit, a switch enable circuit, and a control circuit;
  • the power terminal of the SWITCH chip is connected to the power circuit
  • the switch enable terminal of the SWITCH chip is connected to the switch enable circuit through a logic NOT;
  • the control end of the SWITCH chip is connected to one end of the control circuit, and the other end of the control circuit is connected to the USB2.0 DRD pin;
  • the data input positive pole and the data input negative pole of the SWITCH chip are connected to the USB2.0 DRD pin;
  • the first data output anode and the first data output cathode of the SWITCH chip are connected to the USB HOST interface;
  • the second data output anode and the second data output cathode of the SWITCH chip are connected to the USB SLAVE interface;
  • the ground terminal of the SWITCH chip is grounded.
  • the power supply circuit includes: a first resistor, a first capacitor, and a second capacitor;
  • a first end of the first resistor is connected to a voltage, and a second end of the first resistor is connected to a first node;
  • the first end of the first capacitor is connected to the first node, and the second end of the first capacitor is grounded;
  • the first end of the second capacitor is connected to the first node, and the second end of the second capacitor is grounded;
  • the first node is connected to the power terminal of the SWITCH chip.
  • the switch enabling circuit includes: a second resistor
  • the first end of the second resistor is logically disconnected from the switch enable end of the SWITCH chip, and the second end of the second resistor is grounded.
  • control circuit includes: a third resistor, a fourth resistor, a fifth resistor, a sixth resistor, and a third capacitor;
  • the first end of the third resistor is connected to OTG_VBUS, and the second end of the third resistor is connected to the second node;
  • the first end of the fourth resistor is connected to the second node, and the second end of the fourth resistor is connected to the third node;
  • the first end of the fifth resistor is connected to the third node, and the second end of the fifth resistor is grounded;
  • the first end of the sixth resistor is connected to the third node, and the second end of the sixth resistor is connected to the USB2.0 DRD pin;
  • the first end of the third capacitor is connected to the third node, and the second end of the third capacitor is grounded;
  • the second node accesses the control end of the SWITCH chip.
  • an interface communication method applied to the above interface circuit including:
  • the trigger signal being generated by plugging an external device into the interface circuit
  • the interfaces include: USB HOST interface, USB SLAVE interface and HDMI interface; then,
  • the establishing a communication connection with the interface specifically includes:
  • the interface is the USB HOST interface, controlling the first conversion unit to be set to the HOST mode to establish a communication connection with the USB HOST interface;
  • the interface is the USB SLAVE interface, controlling the first conversion unit to be set to the SLAVE mode to establish a communication connection with the USB SLAVE interface;
  • the interface is the HDMI interface
  • controlling the second conversion unit to output a TMDS signal to establish a communication connection with the HDMI interface.
  • the method before the step of controlling the first conversion unit to be set to the HOST mode, the method further includes:
  • the method before the step of controlling the first conversion unit to be set to the SLAVE mode, the method further includes:
  • an interface communication device which is applied to the above interface circuit, and includes:
  • An acquisition module for acquiring a trigger signal, the trigger signal is generated by an external device plugged into the interface circuit;
  • a determining module configured to determine the interface to which the external device is plugged in according to the trigger signal
  • the establishment module is used to establish a communication connection with the interface.
  • the interfaces include: USB HOST interface, USB SLAVE interface and HDMI interface; then,
  • the establishment module is specifically used for:
  • the interface is the USB HOST interface, controlling the first conversion unit to be set to the HOST mode to establish a communication connection with the USB HOST interface;
  • the interface is the USB SLAVE interface, controlling the first conversion unit to be set to the SLAVE mode to establish a communication connection with the USB SLAVE interface;
  • the interface is the HDMI interface
  • controlling the second conversion unit to output a TMDS signal to establish a communication connection with the HDMI interface.
  • the determining module is further configured to:
  • the determining module is further configured to:
  • another technical solution adopted by the embodiment of the present invention is to provide an automobile diagnostic equipment, including the above-mentioned interface circuit;
  • micro control unit is used to execute the aforementioned method of interface communication.
  • another technical solution adopted by the embodiments of the present invention is to provide a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores computer-executable instructions.
  • the computer-executable instructions are used to make the automobile diagnostic equipment execute the above-mentioned method of interface communication.
  • the beneficial effect of the embodiments of the present invention is that different from the prior art, the embodiments of the present invention provide an interface circuit and a method and device for interface communication.
  • the interface circuit includes a USB HOST interface and a USB SLAVE interface , HDMI interface, the first conversion unit, the second conversion unit and the micro-control unit, wherein, since the first conversion unit includes the HOST mode and the SLAVE mode, the second conversion unit can output the TMDS signal, so the output interface of the micro-control unit passes
  • the first conversion unit can be connected to the USB HOST interface and the USB SLAVE interface, and can be connected to the HDMI interface through the second conversion unit, that is, after one output interface of the micro control unit is connected to the conversion unit, the conversion unit can connect to multiple Expansion interface connection, based on this, even if the number of output interfaces of the micro control unit is reduced, the micro control unit can still be connected with multiple expansion interfaces, which effectively prevents the number of expansion interfaces from being reduced as the number of output interfaces of the micro control unit
  • FIG. 1 is a schematic structural diagram of an automobile diagnostic equipment provided by an embodiment of the present invention
  • Figure 2 is a connection diagram of an automobile diagnostic equipment provided by an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of an interface circuit provided by another embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an interface circuit provided by another embodiment of the present invention.
  • FIG. 5 is a circuit connection diagram of an interface circuit provided by another embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an interface circuit provided by still another embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an interface circuit provided by still another embodiment of the present invention.
  • FIG. 8 is a schematic flowchart of an interface communication method provided by an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of an interface communication device provided by an embodiment of the present invention.
  • Fig. 10 is a schematic diagram of the hardware structure of a micro-control unit provided by an embodiment of the present invention.
  • the present invention provides an interface circuit and a method and device for interface communication.
  • the interface circuit can be applied to automotive diagnostic equipment, automotive ADAS testing equipment, automotive four-wheel alignment testing equipment, industrial video endoscopes, etc.
  • the integration of the unit is required in electronic equipment with high requirements, so that the electronic equipment using the interface circuit can still have a wealth of expansion interfaces under the condition that the number of output interfaces of the micro-control unit is reduced, so as to meet the needs of product use.
  • the automotive diagnostic equipment includes: an equipment main body 100 and an interface circuit 200.
  • the interface circuit 200 is provided in the equipment main body 100, and the interface circuit 200 The interface is embedded in the side wall of the device body 100. Wherein, when the interface of the interface circuit 200 is embedded in the side wall of the device main body 100, the interface is connected to the outside, and the automobile diagnostic equipment can be connected with the external device through the interface. At this time, the interface of the interface circuit 200 is also an expansion interface.
  • the device body 100 is provided with an interaction unit 110, which is used to interact with a user, including displaying content to the user, receiving a trigger operation from the user, and the like.
  • the interaction unit 110 may be a touch display screen, or a combination of a display screen and keys.
  • the interaction unit 110 can display content to the user through the touch screen, and can also receive user trigger operations through the touch screen; when the interaction unit 110 is a combination of a display screen and keys, it can display content through the display screen. The user displays the content and receives the user's trigger operation through the button.
  • the interaction unit 110 is communicatively connected with the interface circuit 200, and can display the interface conversion prompt sent by the interface circuit 200 to the user, and when the interaction unit 110 displays the interface conversion prompt to the user, the interaction unit 110 can receive the user's trigger for the interface conversion prompt Operation, the trigger operation includes an interface conversion authorization instruction or an interface conversion prohibition instruction.
  • the interaction unit 110 can send the interface conversion authorization instruction or the interface conversion prohibition instruction carried by the trigger operation to the interface circuit 200.
  • the interactive unit 110 can also display car diagnostic functions and car diagnostic data to the user.
  • the interface circuit 200 includes: a USB HOST interface 210, a USB SLAVE interface 220, an HDMI interface 230, a first conversion unit 240, a second conversion unit 250, and a micro control unit 260.
  • the interface circuit 200 is communicatively connected with the interaction unit 110 through the micro-control unit 260.
  • the micro-control unit 260 is used to send an interface conversion prompt to the interaction unit 110 and receive an interface conversion authorization instruction or an interface conversion prohibition instruction returned according to a user's trigger operation.
  • the micro-control unit 110 communicates with the interaction unit 110 through other interfaces.
  • the micro-control unit 260 is respectively connected to the input end of the first conversion unit 240 and the input end of the second conversion unit 250 through an output interface, and the output end of the first conversion unit 240 is respectively connected to the USB HOST interface 210 is connected to the USB SLAVE interface 220, and the output end of the second conversion unit 250 is connected to the HDMI interface 230.
  • the first conversion unit 240 and the second conversion unit 250 one output interface of the micro control unit 260 can also be connected to multiple extensions. Interfaces (including USB HOST interface 210, USB SLAVE interface 220 and HAMI interface 230).
  • the micro control unit 260 can still be connected to multiple expansion interfaces, which can effectively prevent expansion of the interface
  • the number of output interfaces of the micro control unit 260 decreases as the number of output interfaces decreases.
  • the USB HOST interface 210 is used to connect a USB slave device, and the USB slave device includes but is not limited to: a U disk, a keyboard, a mouse, a mobile hard disk, and the like.
  • the USB HOST interface 210 will generate a trigger signal and send it to the micro control unit 260.
  • the USB SLAVE interface 220 is used to connect to a USB host device, and the USB host device includes but is not limited to: a PC computer, etc.
  • the USB host device includes but is not limited to: a PC computer, etc.
  • the USB SLAVE interface 220 will generate a trigger signal and send it to the micro control unit 260.
  • the HDMI interface 230 is a high-definition multimedia interface capable of sending digitized video and sound.
  • the HDMI interface 230 is used to connect a device capable of playing video and/or sound, such as a high-definition display.
  • a device capable of playing video and/or sound is plugged into the HAMI interface 230, the HDMI interface 230 will generate a trigger signal and send it to the micro control unit 260.
  • the first conversion unit 240 includes HOST mode and SLAVE mode.
  • the first conversion unit 240 transmits data to the USB HOST interface 210; when the first conversion unit 240 is set to the SLAVE mode, The first conversion unit 240 transmits data to the USB SLAVE interface 220.
  • the HOST mode and SLAVE mode of the first conversion unit 240 are set by the micro control unit 260.
  • the second conversion unit 250 can output a TMDS signal.
  • the HDMI interface 230 can realize data transmission through the TMDS signal.
  • the TMDS signal output of the second conversion unit 250 is controlled by the micro control unit 260.
  • the micro control unit 260 controls the first conversion unit 240 to be set to the HOST mode, so that communication can be established between the micro control unit 260 and the USB HOST interface 210; the micro control unit After receiving the trigger signal of the USB SALVE interface 220, the 260 controls the first conversion unit 240 to be set to the SLAVE mode, so that communication can be established between the micro control unit 260 and the USB SLAVE interface 220; the micro control unit 260 receives the HDMI interface After the trigger signal 230, the second conversion unit 250 is controlled to output the TMDS signal, and then the communication between the micro control unit 260 and the HDMI interface 230 can be established.
  • the micro control unit 260 is used to control the first conversion unit 240 to be set to the HOST mode when the trigger signal of the USB HOST interface 210 is received, so as to establish communication between the micro control unit 260 and the USB HOST interface 210;
  • the first conversion unit 240 is controlled to be set to the SLAVE mode to establish communication between the micro control unit 260 and the USB SLAVE interface 220;
  • the second conversion unit is controlled
  • the conversion unit 250 outputs the TMDS signal to establish communication between the micro-control unit 260 and the HDMI interface 230. At this time, no matter which one of the multiple expansion interfaces connected to the micro-control unit 260 is plugged in, it can work normally.
  • the output interface of the micro control unit 260 is a USB 3.1 interface. Since the USB3.1 interface is backward compatible with USB2.0, and the 10Gbps rate of the USB3.1 interface can realize the transmission of high-definition multimedia signals, the pins of the USB3.1 interface are divided into USB2 that can realize USB master-slave control. 0 DRD pin, and USB3.1 DATA pin, which can realize high-definition multimedia signal transmission.
  • the micro-control unit 260 since the first conversion unit 240 is respectively connected to the USB HOST interface 210 and the USB SLAVE interface 220, and the USB2.0 DRD pin can implement USB master-slave control, therefore, the micro-control unit 260 through USB2. 0
  • the DRD pin is connected to the input terminal of the first conversion unit 240 to implement the USB HOST interface function and the USB SALVE interface function according to the USB master-slave control of the USB2.0 DRD pin; since the second conversion unit 250 is connected to the HDMI interface 230 , And the USB3.1 DATA pin can realize high-definition multimedia signal transmission. Therefore, the micro-control unit 260 is connected to the input terminal of the second conversion unit 250 through the USB3.1 DATA pin to achieve high-definition multimedia signal transmission based on the USB3.1 DATA pin. The signal transmission realizes the HAMI interface function.
  • the micro control unit 260 controls the USB2.0 DRD pin to work in the HOST mode, that is, makes the USB2.0 DRD pin realize the host device function;
  • the micro control unit 260 controls the USB2.0 DRD pin to work in the SLAVE mode, that is, the USB2.0 DRD pin realizes the slave device function;
  • the micro control unit controls the USB3.1 DATA pin to output the DP signal to the second conversion unit 250.
  • the first conversion unit 240 includes: USB SWITCH, the input end of the USB SWITCH is connected to the USB2.0 DRD pin, and the output end of the USB SWITCH is connected to the USB 2.0 DRD pin respectively.
  • the USB HOST interface 210 and the USB SLAVE interface 220 are connected.
  • the USB SWITCH specifically includes: SWITCH chip 241, power circuit 242, switch enable circuit 243, and control circuit 244.
  • the power circuit 242 is connected to the power terminal VCC of the SWITCH chip 241, and the switch enable circuit 243 is connected to the SWITCH chip 241 through logic NOT.
  • the switch enable terminal OE is connected, the control circuit 244 is connected to the control terminal S of the SWITCH chip 241, and the ground terminal GND of the SWITCH chip is grounded.
  • the USB SWITCH is connected to the USB2.0 DRD pin through the data input positive D+ of the SWITCH chip 241, the data input negative D-, and the control circuit 244, and the first data output positive 1D+ and the first data output negative 1D- of the SWITCH chip 241 are connected. It is connected to the USB HOST interface 210, and is connected to the USB SLAVE interface 220 through the second data output positive 2D+ and the second data output negative 2D- of the SWITCH chip 241.
  • the power circuit 242 is used to supply power to the SWITCH chip 241.
  • the power circuit 242 includes a first resistor R1, a first capacitor C1, and a second capacitor C2.
  • the first end of the first resistor R1 is connected to the voltage, the second end of the first resistor R1 is connected to the first node A; the first end of the first capacitor C1 is connected to the first node A, and the second end of the first capacitor C1 is grounded The first end of the second capacitor C2 is connected to the first node A, and the second end of the second capacitor C2 is grounded; the first node A is connected to the power terminal VCC of the SWITCH chip 241.
  • the power circuit 242 when a voltage is input, the power circuit 242 filters the voltage before outputting to the power terminal VCC.
  • the switch enabling circuit 243 is used to enable the SWITCH chip 241, and the switch enabling circuit 243 includes a second resistor.
  • the first end of the second resistor R2 is connected to the switch enable end OE of the SWITCH chip 241 through a logic negation, and the second end of the second resistor R2 is grounded.
  • the control circuit 244 is used to control the data transmission path of the SWITCH chip 241.
  • the control circuit 244 includes a third resistor R3, a fourth resistor R4, a fifth resistor R5, a sixth resistor R6, and a third capacitor C3.
  • the first end of the third resistor R3 is connected to OTG_VBUS, the second end of the third resistor R3 is connected to the second node B; the first end of the fourth resistor R4 is connected to the second node B, and the second end of the fourth resistor R4 is connected to The third node C is connected; the first end of the fifth resistor R5 is connected to the third node C, and the second end of the fifth resistor R5 is grounded; the first end of the sixth resistor R6 is connected to the third node C, and the sixth resistor R6
  • the second end of the third capacitor C3 is connected to the USB2.0 DRD pin; the first end of the third capacitor C3 is connected to the third node C, and the second end of the third capacitor C3 is grounded; the second node B is connected to the control end of the SWITCH chip 241 S.
  • the SWITCH chip 241 When the input of the control circuit 244 to the control terminal S is low, the SWITCH chip 241 performs data transmission through the first data output positive 1D+ and the first data output negative 1D-. At this time, the USB SWITCH is in the HOST mode; when the control circuit 244 inputs When the control terminal S is at a high level, the SWITCH chip 241 performs data transmission through the second data output positive 2D+ and the second data output negative 2D-. At this time, the USB SWITCH is in the SLAVE mode.
  • the micro control unit 260 controls the control circuit 244 to output a low level to the control terminal S of the SWITCH chip 241, and controls the SWITCH chip 241 to output the positive electrode through the first data.
  • the micro control unit 260 controls the control circuit 244 to output a high level To the control terminal S of the SWITCH chip 241, the SWITCH chip 241 is controlled to perform data transmission through the second data output positive 2D+ and the second data output negative 2D-, so that the USB SWITCH is set to the SLAVE mode.
  • the second conversion unit 250 includes: a protocol converter, the input end of the protocol converter is connected to the USB3.1 DATA pin, and the output end of the protocol converter is connected to the HDMI The interface 230 is connected.
  • the protocol converter can convert DP signals into TMDS signals for output.
  • USB HOST interfaces 210 when there is a large demand for USB slave devices, it is necessary to provide at least 2 USB HOST interfaces 210. Based on this, please refer to FIG. 7.
  • the first conversion unit 240 It also includes the USB HUB, the input end of the USB HUB is connected to the output end of the USB SWITCH, and the output end of the USB HUB is respectively connected to at least two USB HOST interfaces, and data can be transmitted to multiple different USB HOST interfaces through the USB HUB 210 .
  • an output interface of the micro control unit is connected to the first conversion unit and the second conversion unit, and then connected to the expansion interface through the first conversion unit and the second conversion unit,
  • One output interface of the micro control unit can also be connected to multiple expansion interfaces. Based on this, even if the number of output interfaces of the micro control unit is reduced, the micro control unit can still be connected to multiple expansion interfaces, which can effectively prevent the number of expansion interfaces from following The number of output interfaces of the micro-control unit is reduced.
  • FIG. 8 is a schematic flowchart of an interface communication method provided by an embodiment of the present invention.
  • the interface communication method is applied to the above-mentioned interface circuit 200 and is executed by the above-mentioned micro-control unit 260 to ensure that the interface The normal operation of each interface in the circuit 200.
  • the interface communication method includes:
  • S200 Determine the interface to which the external device is plugged in according to the trigger signal.
  • the trigger signal is a signal generated when an external device is plugged into the interface of the interface circuit 200.
  • This interface includes USB HOST interface, USB SLAVE interface and HDMI interface.
  • the micro control unit 260 can receive the trigger signal sent by the USB HOST interface; when the external device is plugged into the USB SLAVE interface, the micro control unit 260 can receive the trigger sent by the USB SLAVE interface Signal; when the external device is plugged into the HDMI interface, the micro control unit 260 can receive the trigger signal sent by the HDMI interface.
  • the interface identifier contained in the trigger signal can be used to determine the interface to which the trigger signal belongs, and the interface to which the trigger signal belongs is the interface to which the external device is plugged in.
  • the interface identification can be a signal type or an interface ID.
  • the micro control unit 260 can determine the interface to which the external device is plugged in according to the type of the received trigger signal.
  • the signal type of the HDMI interface is HPD high-level signal.
  • the trigger signal received by the control unit 260 is the HPD high-level signal, and it is determined that the interface to which the external device is plugged in is the HDMI interface.
  • the micro control unit 260 can determine the interface to which the external device is plugged in according to the interface ID contained in the received trigger signal. For example, when the interface ID of the HDMI interface is HDMI1, if the trigger signal received by the micro-control unit 260 includes HDMI1, it is determined that the interface to which the external device is plugged in is the HDMI interface.
  • the first conversion unit is controlled to be set to the HOST mode to establish a communication connection with the USB HOST interface; if the interface to which the external device is plugged in is a USB SLAVE interface, The first conversion unit is controlled to be set to SLAVE mode to establish a communication connection with the USB SLAVE interface; if the interface to which the external device is plugged in is an HDMI interface, the second conversion unit is controlled to output the TMDS signal to establish communication with the HDMI interface connection.
  • the micro control unit 260 controls the control circuit to output a low level to the control terminal of the SWITCH chip to control
  • the SWITCH chip performs data transmission through the positive pole of the first data output and the negative pole of the first data output, so that the USB SWITCH is set to the HOST mode;
  • the control circuit output is high Level to the control terminal of the SWITCH chip, and control the SWITCH chip to perform data transmission through the second data output positive electrode and the second data output negative electrode, so that the USB SWITCH is set to the SLAVE mode.
  • the first conversion unit can be set to work in the HOST mode or the SLAVE mode by default.
  • the first conversion unit is set to work in HOST mode by default, when the interface to which the external device is plugged in is the USB HOST interface, the communication connection with the USB HOST interface can be directly established, only when the interface to which the external device is plugged in is USB
  • the first conversion unit is controlled to be set to the SLAVE mode to establish a communication connection with the USB SLAVE interface; when the first conversion unit is set to work in the SLAVE mode by default, the interface that the external device is plugged into is the USB SLAVE interface
  • the communication connection with the USB SLAVE interface can be established directly, and only when the interface to which the external device is plugged in is the USB HOST interface, the first conversion unit is controlled to be set to the HOST mode to establish the communication connection with the USB HOST interface.
  • the USB HOST interface and the USB SLAVE interface implemented according to the USB master-slave control cannot work at the same time. Therefore, in order to ensure that the USB HOST interface and the USB SLAVE interface work normally and orderly, the first conversion is controlled. Before the step of setting the unit to the HOST mode, it is also determined whether the first conversion unit is in the SLAVE mode. If so, the first interface conversion prompt is sent to the user, and after receiving the first interface conversion authorization instruction returned by the user, the first interface conversion authorization instruction is controlled.
  • the conversion unit is set to the HOST mode; before the step of controlling the first conversion unit to be set to the SLAVE mode, it is also determined whether the first conversion unit is in the HOST mode, and if so, the second interface conversion prompt is sent to the user, and the user returns After the second interface converts the authorization instruction, the first conversion unit is controlled to be set to the SLAVE mode.
  • the first interface conversion prompt is used to determine to the user whether to suspend the work of the USB SLAVE interface and switch to the USB HOST interface; the first interface conversion prompt is used to determine to the user whether to suspend the work of the USB HOST interface and switch to USB The SLAVE interface works.
  • the first interface conversion authorization command characterization allows the work of the USB SLAVE interface to be suspended and switch to the USB HOST interface work; the second interface conversion authorization command characterization allows the work of the USB HOST interface to be suspended and switch to the USB SLAVE interface work.
  • a communication connection with the plug-in interface of the external device is established, and the resulting plug-in interface of the external device can perform data transmission with the external device, ensuring The normal operation of the interface circuit.
  • FIG. 9 is a schematic structural diagram of an interface communication device provided by an embodiment of the present invention.
  • the interface communication device is applied to the above-mentioned interface circuit 200, and the functions of each module of the interface communication device are determined by the above-mentioned micro
  • the control unit 260 is executed to ensure the normal operation of each interface in the interface circuit 200.
  • module used in the embodiments of the present invention is a combination of software and/or hardware that can implement predetermined functions.
  • devices described in the following embodiments can be implemented by software, implementation by hardware or a combination of software and hardware may also be conceived.
  • the interface communication device includes:
  • the acquiring module 10 is configured to acquire a trigger signal, which is generated by an external device plugged into the interface circuit;
  • the determining module 20 is configured to determine the interface to which the external device is plugged in according to the trigger signal
  • the establishment module 30 is used to establish a communication connection with the interface.
  • the interfaces include: USB HOST interface, USB SLAVE interface and HDMI interface; then,
  • the establishment module 30 is specifically used for:
  • the interface is the USB HOST interface, controlling the first conversion unit to be set to the HOST mode to establish a communication connection with the USB HOST interface;
  • the interface is the USB SLAVE interface, controlling the first conversion unit to be set to the SLAVE mode to establish a communication connection with the USB SLAVE interface;
  • the interface is the HDMI interface
  • controlling the second conversion unit to output a TMDS signal to establish a communication connection with the HDMI interface.
  • the determining module 20 is further configured to:
  • the determining module 20 is further configured to:
  • the content of the device embodiment can be quoted from the method embodiment on the premise that the content does not conflict with each other, which will not be repeated here.
  • the above-mentioned acquisition module 10, determination module 20, and establishment module 30 may be processing chips of the micro-control unit 260.
  • a communication connection with the plug-in interface of the external device is established, and the resulting plug-in interface of the external device can perform data transmission with the external device, ensuring The normal operation of the interface circuit.
  • FIG. 10 is a schematic diagram of the hardware structure of a micro-control unit 260 according to an embodiment of the present invention, including:
  • the processor 261 and the memory 262 may be connected by a bus or in other ways. In FIG. 10, the connection by a bus is taken as an example.
  • the memory 262 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs and modules, such as an interface communication method in the above-mentioned embodiment of the present invention Corresponding program instructions and modules corresponding to an interface communication device (for example, the acquisition module 10, the determination module 20, and the establishment module 30, etc.).
  • the processor 261 executes various functional applications and data processing of an interface communication method by running the non-volatile software programs, instructions, and modules stored in the memory 262, that is, implements an interface in the above method embodiment.
  • the communication method and the function of each module in the above-mentioned device embodiment can be used to store non-volatile software programs, non-volatile computer-executable programs and modules, such as an interface communication method in the above-mentioned embodiment of the present invention Corresponding program instructions and modules corresponding to an interface communication device (for example, the acquisition module 10, the determination module 20, and the establishment module 30, etc.).
  • the memory 262 may include a storage program area and a storage data area, where the storage program area can store an operating system and an application program required by at least one function; the storage data area can store data created according to the use of an interface communication device, etc. .
  • the memory 262 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 262 may optionally include a memory remotely provided with respect to the processor 261, and these remote memories may be connected to the processor 261 via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the program instructions and one or more modules are stored in the memory 262, and when executed by the one or more processors 261, each step of an interface communication method in any of the foregoing method embodiments is executed, Or, realize the functions of each module of an interface communication device in any of the foregoing device embodiments.
  • the above-mentioned product can execute the method provided in the above-mentioned embodiment of the present invention, and has corresponding functional modules and beneficial effects for the execution method.
  • the method provided in the foregoing embodiment of the present invention please refer to the method provided in the foregoing embodiment of the present invention.
  • the embodiment of the present invention also provides a non-volatile computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, FIG. 10
  • a processor 261 in any of the foregoing method embodiments may enable a computer to execute each step of an interface communication method in any of the foregoing method embodiments, or implement the functions of various modules of an interface communication device in any of the foregoing device embodiments.
  • the embodiment of the present invention also provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are Or multiple processors, such as a processor 261 in FIG. 10, can cause a computer to execute each step of an interface communication method in any of the foregoing method embodiments, or implement any of the foregoing device embodiments.
  • the device embodiments described above are merely illustrative.
  • the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each embodiment can be implemented by software plus a general hardware platform, and of course, it can also be implemented by hardware.
  • a person of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by computer programs instructing relevant hardware.
  • the programs can be stored in a computer readable storage medium. At the time, it may include the flow of the implementation method of each method as described above.
  • the storage medium may be a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.

Abstract

一种接口电路及其接口通信的方法、装置,在接口电路中,微控制单元(260)的输出接口与第一转换单元(240)以及第二转换单元(250)连接,第一转换单元(240)与USB HOST接口(210)以及USB SLAVE接口(220)连接,第二转换单元(250)与HDMI接口(230)连接;微控制单元(260)用于在接收到USB HOST接口(210)的触发信号时,控制第一转换单元(240)设置为HOST模式,以与USB HOST接口(210)建立通信;在接收到USB SLAVE接口(220)的触发信号时,控制第一转换单元(240)设置为SLAVE模式,以与USB SLAVE接口(220)建立通信;在接收到HDMI接口(230)的触发信号时,控制第二转换单元(250)输出TMDS信号,以与HDMI接口(230)建立通信。

Description

一种接口电路及其接口通信的方法、装置
本申请要求于2019年10月18日提交中国专利局、申请号为201910996120.4、申请名称为“一种接口电路及其接口通信的方法、装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及汽车和软件技术领域,特别是涉及一种接口电路及其接口通信的方法、装置。
背景技术
汽车诊断设备为了提高维修作业的完成质量,设置多个拓展接口,以通过多个拓展接口与多个外部设备连接进行数据采集,丰富诊断数据。
但发明人在实现本发明的过程中发现:目前,汽车诊断设备的拓展接口通过与微控制单元的输出接口直接连接来建立与微控制单元的通信,但随着微控制单元集成度的提高,微控制单元的输出接口逐渐减少,使得微控制单元能够连接的拓展接口数量减少,进而使得汽车诊断设备面临拓展接口数量不够的困境,难以满足汽车诊断设备的诊断需求。
因此,如何在微控制单元的输出接口减少的情况下保证汽车诊断设备的拓展接口数量是目前亟待解决的技术问题。
发明内容
本发明实施例旨在提供一种接口电路及其接口通信的方法、装置,该接口电路能够有效防止拓展接口的数量随着微控制单元输出接口数量的减少而减少。
为解决上述技术问题,本发明实施例采用的一个技术方案是:提供一种接口电路,包括:USB HOST接口、USB SLAVE接口、HDMI接口、第一转换单元、第二转换单元以及微控制单元;
所述微控制单元的输出接口分别与所述第一转换单元的输入端以及所述第二转换单元的输入端连接,所述第一转换单元的输出端分别与所述USB HOST接口以及所述USB SLAVE接口连接,所述第二转换单元的输出端则与所述HDMI接口连接;
所述微控制单元用于在接收到所述USB HOST接口的触发信号时,控制所述第一转换单元设置为HOST模式,以在所述微控制单元和所述USB HOST接口之间建立通信;
所述微控制单元还用于在接收到所述USB SLAVE接口的触发信号时,控制所述第一转换单元设置为SLAVE模式,以在所述微控制单元和所述USB SLAVE接口之间建立通信;
所述微控制单元还用于在接收到所述HDMI接口的触发信号时,控制所述第二转换单元输出TMDS信号,以在所述微控制单元和所述HDMI接口之间建立通信。
可选地,所述微控制单元的输出接口包括USB3.1接口,所述USB3.1接口包括USB2.0 DRD引脚以及USB3.1 DATA引脚;
所述微控制单元通过所述USB2.0 DRD引脚与所述第一转换单元的输入端连接,当所述微控制单元接收到所述USB HOST接口的触发信号时,所述微控制单元控制所述USB2.0 DRD引脚工作在HOST模式,当所述微控制单元接收到所述USB SLAVE接口的触发信号时,所述微控制单元控制所述USB2.0 DRD引脚工作在SLAVE模式;
所述微控制单元通过所述USB3.1 DATA引脚与所述第二转换单元的输入端连接,当所述微控制单元接收到所述HDMI接口的触发信号时,所述微控制单元控制所述USB3.1 DATA引脚输出DP信号至所述第二转换单元。
可选地,所述第一转换单元包括:USB SWITCH;
所述USB SWITCH的输入端与所述USB2.0 DRD引脚连接,所述USB SWITCH的输出端分别与所述USB HOST接口以及所述USB SLAVE接口连接。
可选地,所述USB HOST接口的数量至少为2;则,
所述第一转换单元还包括:
USB HUB,所述USB HUB的输入端与所述USB SWITCH的输出端连接,所述USB HUB的输出端分别与所述至少2个USB HOST接口连接。
可选地,所述第二转换单元包括:协议转换器;
所述协议转换器的输入端与所述USB3.1 DATA引脚连接,所述协议转换器的输出端与所述HDMI接口连接。
可选地,所述USB SWITCH包括:SWITCH芯片、电源电路、开关启用电路以及控制电路;
所述SWITCH芯片的电源端与所述电源电路连接;
所述SWITCH芯片的开关启用端通过逻辑非与所述开关启用电路连接;
所述SWITCH芯片的控制端与所述控制电路的一端连接,所述控制电路的另一端与所述USB2.0 DRD引脚连接;
所述SWITCH芯片的数据输入正极和数据输入负极与所述USB2.0 DRD引脚连接;
所述SWITCH芯片的第一数据输出正极和第一数据输出负极与所述USB HOST接口连接;
所述SWITCH芯片的第二数据输出正极和第二数据输出负极与所述USB SLAVE接口连接;
所述SWITCH芯片的接地端接地。
可选地,所述电源电路包括:第一电阻、第一电容以及第二电容;
所述第一电阻的第一端连接电压,所述第一电阻的第二端与第一节点连 接;
所述第一电容的第一端与所述第一节点连接,所述第一电容的第二端接地;
所述第二电容的第一端与所述第一节点连接,所述第二电容的第二端接地;
所述第一节点接入所述SWITCH芯片的电源端。
可选地,所述开关启用电路包括:第二电阻;
所述第二电阻的第一端与所述SWITCH芯片开关启用端的逻辑非连接,所述第二电阻的第二端接地。
可选地,所述控制电路包括:第三电阻、第四电阻、第五电阻、第六电阻以及第三电容;
所述第三电阻的第一端连接OTG_VBUS,所述第三电阻的第二端与第二节点连接;
所述第四电阻的第一端与所述第二节点连接,所述第四电阻的第二端与第三节点连接;
所述第五电阻的第一端与所述第三节点连接,所述第五电阻的第二端接地;
所述第六电阻的第一端与所述第三节点连接,所述第六电阻的第二端与所述USB2.0 DRD引脚连接;
所述第三电容的第一端与所述第三节点连接,所述第三电容的第二端接地;
所述第二节点接入所述SWITCH芯片的控制端。
为解决上述技术问题,本发明实施例采用的另一个技术方案是:提供一种接口通信的方法,应用于上述接口电路,包括:
获取触发信号,所述触发信号由外部设备插接于所述接口电路产生;
根据所述触发信号确定所述外部设备所插接的接口;
建立与所述接口的通信连接。
可选地,所述接口包括:USB HOST接口、USB SLAVE接口和HDMI接口;则,
所述建立与所述接口的通信连接,具体包括:
若所述接口为所述USB HOST接口,则控制所述第一转换单元设置为HOST模式,以建立与所述USB HOST接口的通信连接;
若所述接口为所述USB SLAVE接口,则控制所述第一转换单元设置为SLAVE模式,以建立与所述USB SLAVE接口的通信连接;
若所述接口为所述HDMI接口,则控制所述第二转换单元输出TMDS信号,以建立与所述HDMI接口的通信连接。
可选地,在所述控制所述第一转换单元设置为HOST模式的步骤之前,所述方法还包括:
确定所述第一转换单元是否为SLAVE模式;
若是,则向用户发送第一接口转换提示,并在接收到所述用户返回的第一接口转换授权指令后,控制所述第一转换单元设置为HOST模式。
可选地,在所述控制所述第一转换单元设置为SLAVE模式的步骤之前,所述方法还包括:
确定所述第一转换单元是否为HOST模式;
若是,则向用户发送第二接口转换提示,并在接收到所述用户返回的第二接口转换授权指令后,控制所述第一转换单元设置为SLAVE模式。
为解决上述技术问题,本发明实施例采用的另一个技术方案是:提供一种接口通信的装置,应用于上述接口电路,包括:
获取模块,用于获取触发信号,所述触发信号由外部设备插接于所述接口电路产生;
确定模块,用于根据所述触发信号确定所述外部设备所插接的接口;
建立模块,用于建立与所述接口的通信连接。
可选地,所述接口包括:USB HOST接口、USB SLAVE接口和HDMI接口;则,
所述建立模块具体用于:
若所述接口为所述USB HOST接口,则控制所述第一转换单元设置为HOST模式,以建立与所述USB HOST接口的通信连接;
若所述接口为所述USB SLAVE接口,则控制所述第一转换单元设置为SLAVE模式,以建立与所述USB SLAVE接口的通信连接;
若所述接口为所述HDMI接口,则控制所述第二转换单元输出TMDS信号,以建立与所述HDMI接口的通信连接。
可选地,在所述控制所述第一转换单元设置为HOST模式的步骤之前,所述确定模块还用于:
确定所述第一转换单元是否为SLAVE模式;
若是,则向用户发送第一接口转换提示,并在接收到所述用户返回的第一接口转换授权指令后,控制所述第一转换单元设置为HOST模式。
可选地,在所述控制所述第一转换单元设置为SLAVE模式的步骤之前,所述确定模块还用于:
确定所述第一转换单元是否为HOST模式;
若是,则向用户发送第二接口转换提示,并在接收到所述用户返回的第二接口转换授权指令后,控制所述第一转换单元设置为SLAVE模式。
为解决上述技术问题,本发明实施例采用的另一个技术方案是:提供一种汽车诊断设备,包括上述所述的接口电路;
其中,所述微控制单元用于执行上述所述的一种接口通信的方法。
为解决上述技术问题,本发明实施例采用的另一个技术方案是:提供一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质存储有计算 机可执行指令,所述计算机可执行指令用于使汽车诊断设备执行以上所述的一种接口通信的方法。
本发明实施例的有益效果是:区别于现有技术的情况下,本发明实施例提供一种接口电路及其接口通信的方法、装置,在该接口电路中,包括USB HOST接口、USB SLAVE接口、HDMI接口、第一转换单元、第二转换单元以及微控制单元,其中,由于第一转换单元包括HOST模式和SLAVE模式,第二转换单元能够输出TMDS信号,因此,微控制单元的输出接口通过第一转换单元能够与USB HOST接口和USB SLAVE接口连接,通过第二转换单元能够与HDMI接口连接,亦即,微控制单元的一个输出接口与转换单元连接后,通过转换单元就能够与多个拓展接口连接,基于此,即使微控制单元的输出接口数量减少,微控制单元仍能够与多个拓展接口连接,有效地防止了拓展接口的数量随着微控制单元输出接口数量的减少而减少。
附图说明
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是本发明实施例提供的一种汽车诊断设备的结构示意图;
图2是本发明实施例提供的一种汽车诊断设备的连接图;
图3是本发明另一实施例提供的一种接口电路的结构示意图;
图4是本发明又一实施例提供的一种接口电路的结构示意图;
图5是本发明又一实施例提供的一种接口电路的电路连接图;
图6是本发明再一实施例提供的一种接口电路的结构示意图;
图7是本发明再再一实施例提供的一种接口电路的结构示意图;
图8是本发明实施例提供的一种接口通信的方法的流程示意图;
图9是本发明实施例提供的一种接口通信的装置的结构示意图;
图10是本发明实施例提供的一种微控制单元的硬件结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整的描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
需要说明的是,当元件被表述“固定于”另一个元件,它可以直接在另一 个元件上、或者其间可以存在一个或多个居中的元件。当一个元件被表述“连接”另一个元件,它可以是直接连接到另一个元件、或者其间可以存在一个或多个居中的元件。本说明书所使用的术语“垂直的”、“水平的”、“左”、“右”以及类似的表述只是为了说明的目的。
此外,下面所描述的本发明各个实施例中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。
本发明提供了一种接口电路及其接口通信的方法和装置,其中,该接口电路能够应用于汽车诊断设备、汽车ADAS检测设备、汽车四轮定位检测设备、工业视频内窥镜等对微控制单元的集成度要求较高的电子设备中,从而使得应用该接口电路的电子设备能够在微控制单元的输出接口数量减少的情况下,仍具备丰富的拓展接口,满足产品使用需求。
下面,将以接口电路应用于汽车诊断设备为例对本发明进行具体阐述。
请参阅图1和图2,是本发明实施例提供的一种汽车诊断设备,该汽车诊断设备包括:设备主体100和接口电路200,接口电路200设置于设备主体100内,并且该接口电路200的接口嵌于设备主体100的侧壁。其中,当接口电路200的接口嵌于设备主体100的侧壁时,该接口与外部连通,汽车诊断设备能够通过该接口与外部设备连接,此时,接口电路200的接口亦为拓展接口。
具体地,该设备主体100设置有交互单元110,该交互单元110用于与用户进行交互,包括向用户显示内容、接收用户的触发操作等。
该交互单元110可以为触摸显示屏,也可以为显示屏幕与按键的组合。当交互单元110为触摸显示屏时,能够通过触摸显示屏向用户显示内容,也能够通过触摸显示屏接收用户的触发操作;当交互单元110为显示屏幕与按键的组合时,能够通过显示屏幕向用户显示内容,通过按键接收用户的触发操作。
该交互单元110与接口电路200通信连接,能够向用户显示接口电路200发送的接口转换提示,并且,当交互单元110向用户显示接口转换提示时,交互单元110能够接收用户对接口转换提示的触发操作,该触发操作包括接口转换授权指令或者接口转换禁止指令。
交互单元110在接收到用户对接口转换提示的触发操作后,能够将触发操作携带的接口转换授权指令或者接口转换禁止指令发送给接口电路200。
可以理解的是,该交互单元110还能够向用户显示汽车诊断功能和汽车诊断数据等。
接口电路200则包括:USB HOST接口210、USB SLAVE接口220、HDMI接口230、第一转换单元240、第二转换单元250以及微控制单元260。
该接口电路200通过微控制单元260与交互单元110通信连接,微控制单元260用于向交互单元110发送接口转换提示,并接收根据用户的触发操作返回的接口转换授权指令或者接口转换禁止指令。其中,微控制单元110通过其 他接口与交互单元110通信连接。
而在该接口电路200中,微控制单元260通过一个输出接口分别与第一转换单元240的输入端以及第二转换单元250的输入端连接,第一转换单元240的输出端分别与USB HOST接口210和USB SLAVE接口220连接,第二转换单元250的输出端则与HDMI接口230连接,通过第一转换单元240和第二转换单元250,微控制单元260的一个输出接口也能够连接多个拓展接口(包括USB HOST接口210、USB SLAVE接口220和HAMI接口230),基于此,即使微控制单元260输出接口的数量减少,微控制单元260仍能够与多个拓展接口连接,能够有效防止拓展接口的数量随着微控制单元260输出接口数量的减少而减少。
其中,USB HOST接口210用于连接USB从设备,该USB从设备包括但不限于:U盘、键盘、鼠标、移动硬盘等。当USB从设备插接于USB HOST接口210时,USB HOST接口210会产生触发信号并发送给微控制单元260。
USB SLAVE接口220则用于连接USB主设备,该USB主设备包括但不限于:PC电脑等。当USB主设备插接于USB SLAVE接口220时,USB SLAVE接口220会产生触发信号并发送给微控制单元260。
HDMI接口230则为能够发送数字化视频和声音的高清多媒体接口,该HDMI接口230用于连接能够播放视频和/或声音的设备,比如:高清显示器等。当能够播放视频和/或声音的设备插接于HAMI接口230时,HDMI接口230会产生触发信号并发送给微控制单元260。
第一转换单元240则包括HOST模式和SLAVE模式,当第一转换单元240设置为HOST模式时,第一转换单元240向USB HOST接口210传输数据;当第一转换单元240设置为SLAVE模式时,第一转换单元240向USB SLAVE接口220传输数据。其中,第一转换单元240的HOST模式和SLAVE模式通过微控制单元260进行设置。
第二转换单元250则能够输出TMDS信号,当第二转换单元250输出TMDS信号时,HDMI接口230能够通过TMDS信号实现数据传输。其中,第二转换单元250的TMDS信号输出通过微控制单元260控制。
基于此,微控制单元260在接收到USB HOST接口210的触发信号后,控制第一转换单元240设置为HOST模式,则能够在微控制单元260和USB HOST接口210之间建立通信;微控制单元260在接收到USB SALVE接口220的触发信号后,控制第一转换单元240设置为SLAVE模式,则能够在微控制单元260和USB SLAVE接口220之间建立通信;微控制单元260在接收到HDMI接口230的触发信号后,控制第二转换单元250输出TMDS信号,则能够在微控制单元260和HDMI接口230之间建立通信。因此,微控制单元260用于在接收到USB HOST接口210的触发信号时,控制第一转换单元240设置为HOST模式,以在微控制单元260和USB HOST接口210之间建立通信;在接收到USB SALVE接口220的触发信号时,控制第一转换单元240设置为SLAVE模式,以在微控制 单元260和USB SLAVE接口220之间建立通信;在接收到HDMI接口230的触发信号时,控制第二转换单元250输出TMDS信号,以在微控制单元260和HDMI接口230之间建立通信,此时,微控制单元260连接的多个拓展接口无论哪个被插接,均能进行正常工作。
在一些实施例中,该微控制单元260的输出接口为USB3.1接口。由于USB3.1接口能够向下兼容USB2.0,且USB3.1接口10Gbps的速率能够实现高清多媒体信号的传输,因此,将USB3.1接口的引脚分为能够实现USB主从控制的USB2.0 DRD引脚,以及,能够实现高清多媒体信号传输的USB3.1 DATA引脚。
基于此,请参阅图3,由于第一转换单元240分别与USB HOST接口210以及USB SLAVE接口220连接,而USB2.0 DRD引脚能够实现USB主从控制,因此,微控制单元260通过USB2.0 DRD引脚与第一转换单元240的输入端连接,以根据USB2.0 DRD引脚的USB主从控制实现USB HOST接口功能和USB SALVE接口功能;由于第二转换单元250与HDMI接口230连接,而USB3.1 DATA引脚能够实现高清多媒体信号传输,因此,微控制单元260通过USB3.1 DATA引脚与第二转换单元250的输入端连接,以根据USB3.1 DATA引脚的高清多媒体信号传输实现HAMI接口功能。
其中,当微控制单元260接收到USB HOST接口210的触发信号时,微控制单元260控制USB2.0 DRD引脚工作在HOST模式,亦即,使USB2.0 DRD引脚实现主设备功能;当微控制单元260接收到USB SLAVE接口220的触发信号时,微控制单元260控制USB2.0 DRD引脚工作在SLAVE模式,亦即,使USB2.0 DRD引脚实现从设备功能;当微控制单元260接收到HDMI接口230的触发信号时,微控制单元260控制USB3.1 DATA引脚输出DP信号至第二转换单元250。
进一步地,请参阅图4和图5,在一些实施例中,第一转换单元240包括:USB SWITCH,该USB SWITCH的输入端与USB2.0 DRD引脚连接,该USB SWITCH的输出端分别与USB HOST接口210以及USB SLAVE接口220连接。
其中,该USB SWITCH具体包括:SWITCH芯片241、电源电路242、开关启用电路243以及控制电路244,电源电路242与SWITCH芯片241的电源端VCC连接,开关启用电路243通过逻辑非与SWITCH芯片241的开关启用端OE连接,控制电路244则与SWITCH芯片241的控制端S连接,SWITCH芯片的接地端GND接地。
该USB SWITCH通过SWITCH芯片241的数据输入正极D+、数据输入负极D-以及控制电路244与USB2.0 DRD引脚连接,通过SWITCH芯片241的第一数据输出正极1D+和第一数据输出负极1D-与USB HOST接口210连接,通过SWITCH芯片241的第二数据输出正极2D+和第二数据输出负极2D-与USB SLAVE接口220连接。
其中,电源电路242用于为SWITCH芯片241供电,该电源电路242包括:第一电阻R1、第一电容C1以及第二电容C2。
第一电阻R1的第一端连接电压,第一电阻R1的第二端与第一节点A连接;第一电容C1的第一端与第一节点A连接,第一电容C1的第二端接地;第二电容C2的第一端与第一节点A连接,第二电容C2的第二端接地;第一节点A接入SWITCH芯片241的电源端VCC。
在该电源电路242中,当电压输入时,该电源电路242对电压进行滤波处理后才输出至电源端VCC。
开关启用电路243则用于启用SWITCH芯片241,该开关启用电路243包括:第二电阻。
第二电阻R2的第一端通过逻辑非与SWITCH芯片241的开关启用端OE连接,第二电阻R2的第二端接地。
控制电路244则用于控制SWITCH芯片241的数据传输路径,该控制电路244包括:第三电阻R3、第四电阻R4、第五电阻R5、第六电阻R6以及第三电容C3。
第三电阻R3的第一端连接OTG_VBUS,第三电阻R3的第二端与第二节点B连接;第四电阻R4的第一端与第二节点B连接,第四电阻R4的第二端与第三节点C连接;第五电阻R5的第一端与第三节点C连接,第五电阻R5的第二端接地;第六电阻R6的第一端与第三节点C连接,第六电阻R6的第二端与USB2.0 DRD引脚连接;第三电容C3的第一端与第三节点C连接,第三电容C3的第二端接地;第二节点B接入SWITCH芯片241的控制端S。
当控制电路244输入控制端S的为低电平时,SWITCH芯片241通过第一数据输出正极1D+和第一数据输出负极1D-进行数据传输,此时,USB SWITCH为HOST模式;当控制电路244输入控制端S的为高电平时,SWITCH芯片241通过第二数据输出正极2D+和第二数据输出负极2D-进行数据传输,此时,USB SWITCH为SLAVE模式。
基于此,当微控制单元260接收到USB HOST接口210的触发信号时,微控制单元260控制控制电路244输出低电平至SWITCH芯片241的控制端S,控制SWITCH芯片241通过第一数据输出正极1D+和第一数据输出负极1D-进行数据传输,以使USB SWITCH设置为HOST模式;当微控制单元260接收到USB SLAVE接口220的触发信号时,微控制单元260控制控制电路244输出高电平至SWITCH芯片241的控制端S,控制SWITCH芯片241通过第二数据输出正极2D+和第二数据输出负极2D-进行数据传输,以使USB SWITCH设置为SLAVE模式。
进一步地,请参阅图6,在一些实施例中,第二转换单元250包括:协议转换器,该协议转换器的输入端与USB3.1 DATA引脚连接,该协议转换器的输出端与HDMI接口230连接。
其中,该协议转换器能够将DP信号转换成TMDS信号输出。
进一步地,当对USB从设备的需求较多时,需要设置数量至少为2的USB HOST接口210,基于此,请参阅图7,当USB HOST接口210的数量至少为2 时,第一转换单元240还包括USB HUB,该USB HUB的输入端与USB SWITCH的输出端连接,该USB HUB的输出端分别与至少2个USB HOST接口连接,通过USB HUB能够将数据传输至多个不同的USB HOST接口210。
在本发明实施例提供的一种接口电路中,微控制单元的一个输出接口通过与第一转换单元和第二转换单元连接后,再通过第一转换单元和第二转换单元与拓展接口连接,使得微控制单元的一个输出接口也能够连接多个拓展接口,基于此,即使微控制单元输出接口的数量减少,微控制单元仍能够与多个拓展接口连接,能够有效防止拓展接口的数量随着微控制单元输出接口数量的减少而减少。
进一步地,请参阅图8,是本发明实施例提供的一种接口通信的方法的流程示意图,该接口通信的方法应用于上述接口电路200,并由上述微控制单元260执行,用于保证接口电路200中各个接口的正常运行。
具体地,该接口通信的方法包括:
S100:获取触发信号;
S200:根据触发信号确定外部设备所插接的接口。
其中,触发信号为外部设备插接于接口电路200的接口时产生的信号。该接口包括USB HOST接口、USB SLAVE接口和HDMI接口。
当外部设备插接于USB HOST接口时,微控制单元260能够接收到USB HOST接口发送的触发信号;当外部设备插接于USB SLAVE接口时,微控制单元260能够接收到USB SLAVE接口发送的触发信号;当外部设备插接于HDMI接口时,微控制单元260能够接收到HDMI接口发送的触发信号。
由于各个接口发送的触发信号中,包含接口标识,因此,能够通过触发信号中包含的接口标识确定触发信号所属接口,该触发信号所属接口即为外部设备所插接的接口。
该接口标识可以为信号类型,也可以为接口ID。
当接口标识为信号类型时,微控制单元260能够根据所接收到的触发信号的类型确定外部设备所插接的接口,比如:HDMI接口的信号类型为HPD高电平信号,此时,若微控制单元260接收到的触发信号为HPD高电平信号,则确定外部设备所插接的接口为HDMI接口。
当接口标识为接口ID时,微控制单元260能够根据所接收到的触发信号中包含的接口ID确定外部设备所插接的接口。比如:HDMI接口的接口ID为HDMI1时,若微控制单元260接收到的触发信号包含HDMI1,则确定外部设备所插接的接口为HDMI接口。
S300:建立与接口的通信连接。
具体地,若外部设备所插接的接口为USB HOST接口,则控制第一转换单元设置为HOST模式,以建立与USB HOST接口的通信连接;若外部设备所插接的接口为USB SLAVE接口,则控制第一转换单元设置为SLAVE模式,以建立与 USB SLAVE接口的通信连接;若外部设备所插接的接口为HDMI接口,则控制第二转换单元输出TMDS信号,以建立与HDMI接口的通信连接。
在一种实施方式中,若第一转换单元包括USB SWITCH,则微控制单元260在外部设备所插接的接口为USB HOST接口时,控制控制电路输出低电平至SWITCH芯片的控制端,控制SWITCH芯片通过第一数据输出正极和第一数据输出负极进行数据传输,以使USB SWITCH设置为HOST模式;微控制单元260在外部设备所插接的接口为USB SLAVE接口时,控制控制电路输出高电平至SWITCH芯片的控制端,控制SWITCH芯片通过第二数据输出正极和第二数据输出负极进行数据传输,以使USB SWITCH设置为SLAVE模式。
在一些实施例中,能够设置第一转换单元默认工作在HOST模式或者SLAVE模式。当设置第一转换单元默认工作在HOST模式时,在外部设备所插接的接口为USB HOST接口时,直接就能建立与USB HOST接口的通信连接,只有在外部设备所插接的接口为USB SLAVE接口时,才控制第一转换单元设置为SLAVE模式,以建立与USB SLAVE接口的通信连接;当设置第一转换单元默认工作在SLAVE模式时,在外部设备所插接的接口为USB SLAVE接口时,直接就能建立与USB SLAVE接口的通信连接,只有在外部设备所插接的接口为USB HOST接口时,才控制第一转换单元设置为HOST模式,以建立与USB HOST接口的通信连接。
进一步地,在一些实施例中,由于根据USB主从控制实现的USB HOST接口和USB SLAVE接口无法同时工作,因此,为了保证USB HOST接口和USB SLAVE接口正常有序地工作,在控制第一转换单元设置为HOST模式的步骤之前,还确定第一转换单元是否为SLAVE模式,若是,则向用户发送第一接口转换提示,并在接收到用户返回的第一接口转换授权指令后,控制第一转换单元设置为HOST模式;在控制第一转换单元设置为SLAVE模式的步骤之前,还确定第一转换单元是否为HOST模式,若是,则向用户发送第二接口转换提示,并在接收到用户返回的第二接口转换授权指令后,控制第一转换单元设置为SLAVE模式。
其中,第一接口转换提示用于向用户确定是否将USB SLAVE接口的工作暂停,切换为USB HOST接口工作;第一接口转换提示用于向用户确定是否将USB HOST接口的工作暂停,切换为USB SLAVE接口工作。
第一接口转换授权指令表征允许将USB SLAVE接口的工作暂停,切换为USB HOST接口工作;第二接口转换授权指令表征允许将USB HOST接口的工作暂停,切换为USB SLAVE接口工作。
在本发明实施例中,通过触发信号识别外部设备所插接的接口后,建立与外部设备所插接的接口的通信连接,所得外部设备所插接的接口能够与外部设备进行数据传输,保证接口电路的正常运行。
进一步地,请参阅图9,是本发明实施例提供的一种接口通信的装置的结 构示意图,该接口通信的装置应用于上述接口电路200,并且该接口通信的装置各个模块的功能由上述微控制单元260执行,用于保证接口电路200中各个接口的正常运行。
值得注意的是,本发明实施例所使用的术语“模块”为可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置可以以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能被构想的。
具体地,该接口通信的装置包括:
获取模块10,用于获取触发信号,所述触发信号由外部设备插接于所述接口电路产生;
确定模块20,用于根据所述触发信号确定所述外部设备所插接的接口;
建立模块30,用于建立与所述接口的通信连接。
在一些实施例中,所述接口包括:USB HOST接口、USB SLAVE接口和HDMI接口;则,
所述建立模块30具体用于:
若所述接口为所述USB HOST接口,则控制所述第一转换单元设置为HOST模式,以建立与所述USB HOST接口的通信连接;
若所述接口为所述USB SLAVE接口,则控制所述第一转换单元设置为SLAVE模式,以建立与所述USB SLAVE接口的通信连接;
若所述接口为所述HDMI接口,则控制所述第二转换单元输出TMDS信号,以建立与所述HDMI接口的通信连接。
在一些实施例中,在所述控制所述第一转换单元设置为HOST模式的步骤之前,所述确定模块20还用于:
确定所述第一转换单元是否为SLAVE模式;
若是,则向用户发送第一接口转换提示,并在接收到所述用户返回的第一接口转换授权指令后,控制所述第一转换单元设置为HOST模式。
在一些实施例中,在所述控制所述第一转换单元设置为SLAVE模式的步骤之前,所述确定模块20还用于:
确定所述第一转换单元是否为HOST模式;
若是,则向用户发送第二接口转换提示,并在接收到所述用户返回的第二接口转换授权指令后,控制所述第一转换单元设置为SLAVE模式。
由于装置实施例和方法实施例是基于同一构思,在内容不互相冲突的前提下,装置实施例的内容可以引用方法实施例的,在此不再一一赘述。
在其他一些可替代实施例中,上述获取模块10、确定模块20以及建立模块30可以为微控制单元260的处理芯片。
在本发明实施例中,通过触发信号识别外部设备所插接的接口后,建立与外部设备所插接的接口的通信连接,所得外部设备所插接的接口能够与外部设备进行数据传输,保证接口电路的正常运行。
进一步地,请参阅图10,是本发明实施例提供的一种微控制单元260的硬件结构示意图,包括:
一个或多个处理器261以及存储器262。其中,图10中以一个处理器261为例。
处理器261和存储器262可以通过总线或者其他方式连接,图10中以通过总线连接为例。
存储器262作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本发明上述实施例中的一种接口通信的方法对应的程序指令以及一种接口通信的装置对应的模块(例如,获取模块10、确定模块20和建立模块30等)。处理器261通过运行存储在存储器262中的非易失性软件程序、指令以及模块,从而执行一种接口通信的方法的各种功能应用以及数据处理,即实现上述方法实施例中的一种接口通信的方法以及上述装置实施例的各个模块的功能。
存储器262可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据一种接口通信的装置的使用所创建的数据等。
此外,存储器262可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器262可选包括相对于处理器261远程设置的存储器,这些远程存储器可以通过网络连接至处理器261。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
所述程序指令以及一个或多个模块存储在所述存储器262中,当被所述一个或者多个处理器261执行时,执行上述任意方法实施例中的一种接口通信的方法的各个步骤,或者,实现上述任意装置实施例中的一种接口通信的装置的各个模块的功能。
上述产品可执行本发明上述实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本发明上述实施例所提供的方法。
本发明实施例还提供了一种非易失性计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令被一个或多个处理器执行,例如图10中的一个处理器261,可使得计算机执行上述任意方法实施例中的一种接口通信的方法的各个步骤,或者,实现上述任意装置实施例中的一种接口通信的装置的各个模块的功能。
本发明实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非易失性计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被一个或多个处理器执行,例如图10中的一个处理器261,可使得计算机执行上述任意方法实施例中的一种接口通信的方法的各个步骤,或者,实现上述任意装置实施例中的一种接口通信的装置的各个模块的 功能。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
通过以上的实施例的描述,本领域普通技术人员可以清楚地了解到各实施例可借助软件加通用硬件平台的方式来实现,当然也可以通过硬件。本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程是可以通过计算机程序指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施方法的流程。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(RandomAccessMemory,RAM)等。
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;在本发明的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本发明的不同方面的许多其它变化,为了简明,它们没有在细节中提供;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (19)

  1. 一种接口电路,其特征在于,包括:USB HOST接口、USB SLAVE接口、HDMI接口、第一转换单元、第二转换单元以及微控制单元;
    所述微控制单元的输出接口分别与所述第一转换单元的输入端以及所述第二转换单元的输入端连接,所述第一转换单元的输出端分别与所述USB HOST接口以及所述USB SLAVE接口连接,所述第二转换单元的输出端则与所述HDMI接口连接;
    所述微控制单元用于在接收到所述USB HOST接口的触发信号时,控制所述第一转换单元设置为HOST模式,以在所述微控制单元和所述USB HOST接口之间建立通信;
    所述微控制单元还用于在接收到所述USB SLAVE接口的触发信号时,控制所述第一转换单元设置为SLAVE模式,以在所述微控制单元和所述USB SLAVE接口之间建立通信;
    所述微控制单元还用于在接收到所述HDMI接口的触发信号时,控制所述第二转换单元输出TMDS信号,以在所述微控制单元和所述HDMI接口之间建立通信。
  2. 根据权利要求1所述的接口电路,其特征在于,所述微控制单元的输出接口包括USB3.1接口,所述USB3.1接口包括USB2.0 DRD引脚以及USB3.1DATA引脚;
    所述微控制单元通过所述USB2.0 DRD引脚与所述第一转换单元的输入端连接,当所述微控制单元接收到所述USB HOST接口的触发信号时,所述微控制单元控制所述USB2.0 DRD引脚工作在HOST模式,当所述微控制单元接收到所述USB SLAVE接口的触发信号时,所述微控制单元控制所述USB2.0 DRD引脚工作在SLAVE模式;
    所述微控制单元通过所述USB3.1 DATA引脚与所述第二转换单元的输入端连接,当所述微控制单元接收到所述HDMI接口的触发信号时,所述微控制单元控制所述USB3.1 DATA引脚输出DP信号至所述第二转换单元。
  3. 根据权利要求2所述的接口电路,其特征在于,所述第一转换单元包括:USB SWITCH;
    所述USB SWITCH的输入端与所述USB2.0 DRD引脚连接,所述USB SWITCH的输出端分别与所述USB HOST接口以及所述USB SLAVE接口连接。
  4. 根据权利要求3所述的接口电路,其特征在于,所述USB HOST接口的数量至少为2;则,
    所述第一转换单元还包括:
    USB HUB,所述USB HUB的输入端与所述USB SWITCH的输出端连接,所述USB HUB的输出端分别与所述至少2个USB HOST接口连接。
  5. 根据权利要求3或4所述的接口电路,其特征在于,所述第二转换单元包括:协议转换器;
    所述协议转换器的输入端与所述USB3.1 DATA引脚连接,所述协议转换器的输出端与所述HDMI接口连接。
  6. 根据权利要求5所述的接口电路,其特征在于,所述USB SWITCH包括:SWITCH芯片、电源电路、开关启用电路以及控制电路;
    所述SWITCH芯片的电源端与所述电源电路连接;
    所述SWITCH芯片的开关启用端通过逻辑非与所述开关启用电路连接;
    所述SWITCH芯片的控制端与所述控制电路的一端连接,所述控制电路的另一端与所述USB2.0 DRD引脚连接;
    所述SWITCH芯片的数据输入正极和数据输入负极与所述USB2.0 DRD引脚连接;
    所述SWITCH芯片的第一数据输出正极和第一数据输出负极与所述USB HOST接口连接;
    所述SWITCH芯片的第二数据输出正极和第二数据输出负极与所述USB SLAVE接口连接;
    所述SWITCH芯片的接地端接地。
  7. 根据权利要求6所述的接口电路,其特征在于,所述电源电路包括:第一电阻、第一电容以及第二电容;
    所述第一电阻的第一端连接电压,所述第一电阻的第二端与第一节点连接;
    所述第一电容的第一端与所述第一节点连接,所述第一电容的第二端接地;
    所述第二电容的第一端与所述第一节点连接,所述第二电容的第二端接地;
    所述第一节点接入所述SWITCH芯片的电源端。
  8. 根据权利要求6所述的接口电路,其特征在于,所述开关启用电路包括:第二电阻;
    所述第二电阻的第一端与所述SWITCH芯片开关启用端的逻辑非连接,所述第二电阻的第二端接地。
  9. 根据权利要求6所述的接口电路,其特征在于,所述控制电路包括: 第三电阻、第四电阻、第五电阻、第六电阻以及第三电容;
    所述第三电阻的第一端连接OTG_VBUS,所述第三电阻的第二端与第二节点连接;
    所述第四电阻的第一端与所述第二节点连接,所述第四电阻的第二端与第三节点连接;
    所述第五电阻的第一端与所述第三节点连接,所述第五电阻的第二端接地;
    所述第六电阻的第一端与所述第三节点连接,所述第六电阻的第二端与所述USB2.0 DRD引脚连接;
    所述第三电容的第一端与所述第三节点连接,所述第三电容的第二端接地;
    所述第二节点接入所述SWITCH芯片的控制端。
  10. 一种接口通信的方法,应用于如权利要求1至9中任一项所述的接口电路,其特征在于,包括:
    获取触发信号,所述触发信号由外部设备插接于所述接口电路产生;
    根据所述触发信号确定所述外部设备所插接的接口;
    建立与所述接口的通信连接。
  11. 根据权利要求10所述的方法,其特征在于,所述接口包括:USB HOST接口、USB SLAVE接口和HDMI接口;则,
    所述建立与所述接口的通信连接,具体包括:
    若所述接口为所述USB HOST接口,则控制所述第一转换单元设置为HOST模式,以建立与所述USB HOST接口的通信连接;
    若所述接口为所述USB SLAVE接口,则控制所述第一转换单元设置为SLAVE模式,以建立与所述USB SLAVE接口的通信连接;
    若所述接口为所述HDMI接口,则控制所述第二转换单元输出TMDS信号,以建立与所述HDMI接口的通信连接。
  12. 根据权利要求11所述的方法,其特征在于,在所述控制所述第一转换单元设置为HOST模式的步骤之前,所述方法还包括:
    确定所述第一转换单元是否为SLAVE模式;
    若是,则向用户发送第一接口转换提示,并在接收到所述用户返回的第一接口转换授权指令后,控制所述第一转换单元设置为HOST模式。
  13. 根据权利要求12所述的方法,其特征在于,在所述控制所述第一转换单元设置为SLAVE模式的步骤之前,所述方法还包括:
    确定所述第一转换单元是否为HOST模式;
    若是,则向用户发送第二接口转换提示,并在接收到所述用户返回的第二接口转换授权指令后,控制所述第一转换单元设置为SLAVE模式。
  14. 一种接口通信的装置,应用于如权利要求1至9中任一项所述的接口电路,其特征在于,包括:
    获取模块,用于获取触发信号,所述触发信号由外部设备插接于所述接口电路产生;
    确定模块,用于根据所述触发信号确定所述外部设备所插接的接口;
    建立模块,用于建立与所述接口的通信连接。
  15. 根据权利要求14所述的装置,其特征在于,所述接口包括:USB HOST接口、USB SLAVE接口和HDMI接口;则,
    所述建立模块具体用于:
    若所述接口为所述USB HOST接口,则控制所述第一转换单元设置为HOST模式,以建立与所述USB HOST接口的通信连接;
    若所述接口为所述USB SLAVE接口,则控制所述第一转换单元设置为SLAVE模式,以建立与所述USB SLAVE接口的通信连接;
    若所述接口为所述HDMI接口,则控制所述第二转换单元输出TMDS信号,以建立与所述HDMI接口的通信连接。
  16. 根据权利要求15所述的装置,其特征在于,在所述控制所述第一转换单元设置为HOST模式的步骤之前,所述确定模块还用于:
    确定所述第一转换单元是否为SLAVE模式;
    若是,则向用户发送第一接口转换提示,并在接收到所述用户返回的第一接口转换授权指令后,控制所述第一转换单元设置为HOST模式。
  17. 根据权利要求16所述的装置,其特征在于,在所述控制所述第一转换单元设置为SLAVE模式的步骤之前,所述确定模块还用于:
    确定所述第一转换单元是否为HOST模式;
    若是,则向用户发送第二接口转换提示,并在接收到所述用户返回的第二接口转换授权指令后,控制所述第一转换单元设置为SLAVE模式。
  18. 一种汽车诊断设备,其特征在于,包括如权利要求1至9中任一项所述的接口电路;
    其中,所述微控制单元用于执行如权利要求10至13中任一项所述的一种接口通信的方法。
  19. 一种非易失性计算机可读存储介质,其特征在于,所述非易失性计算 机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使汽车诊断设备执行如权利要求10至13中任一项所述的一种接口通信的方法。
PCT/CN2020/120437 2019-10-18 2020-10-12 一种接口电路及其接口通信的方法、装置 WO2021073480A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20877873.8A EP4030250A4 (en) 2019-10-18 2020-10-12 INTERFACE CIRCUIT AND ASSOCIATED INTERFACE COMMUNICATION METHOD AND DEVICE
US17/658,859 US20220327087A1 (en) 2019-10-18 2022-04-12 Interface circuit, and method and apparatus for interface communication thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910996120.4 2019-10-18
CN201910996120.4A CN110618672A (zh) 2019-10-18 2019-10-18 一种接口电路及其接口通信的方法、装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/658,859 Continuation US20220327087A1 (en) 2019-10-18 2022-04-12 Interface circuit, and method and apparatus for interface communication thereof

Publications (1)

Publication Number Publication Date
WO2021073480A1 true WO2021073480A1 (zh) 2021-04-22

Family

ID=68926046

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/120437 WO2021073480A1 (zh) 2019-10-18 2020-10-12 一种接口电路及其接口通信的方法、装置

Country Status (4)

Country Link
US (1) US20220327087A1 (zh)
EP (1) EP4030250A4 (zh)
CN (1) CN110618672A (zh)
WO (1) WO2021073480A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722120A (zh) * 2021-07-30 2021-11-30 龙芯中科(太原)技术有限公司 集成电路及其实现程序开发的方法
CN114546918A (zh) * 2022-02-07 2022-05-27 合肥联宝信息技术有限公司 电子设备、转接设备、信号切换方法及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7437220B2 (ja) * 2020-04-01 2024-02-22 株式会社東芝 アダプタ装置及び通信方法
CN114595174B (zh) * 2021-08-30 2023-12-12 浪潮(山东)计算机科技有限公司 一种pcie接口与串口并口的转换电路
CN113934661A (zh) * 2021-09-30 2022-01-14 青岛海信移动通信技术股份有限公司 一种电子设备、控制方法、装置及介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101989246A (zh) * 2009-07-29 2011-03-23 鸿富锦精密工业(深圳)有限公司 可自动切换usb主从设备模式的电子装置
CN202694324U (zh) * 2012-03-29 2013-01-23 深圳市宇恒互动科技开发有限公司 可独立升级的usb装置及usb系统
US20130048372A1 (en) * 2011-08-31 2013-02-28 Nvidia Corporation Hdmi-muxed debug cable methods and apparatuses
CN103365388A (zh) * 2012-04-09 2013-10-23 华为终端有限公司 一种终端设备的供电方法及其终端设备
CN207909114U (zh) * 2018-03-07 2018-09-25 深圳市显盈科技股份有限公司 多功能信号转换电路和转换器
CN208188819U (zh) * 2018-04-19 2018-12-04 广州视源电子科技股份有限公司 接口复用电路和装置
CN209030353U (zh) * 2017-10-13 2019-06-25 广东高普达集团股份有限公司 接口转接电路及装置
CN110209620A (zh) * 2019-07-04 2019-09-06 深圳昆仑通态科技有限责任公司 一种多接口电子设备

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7000057B1 (en) * 2002-02-11 2006-02-14 Cypress Semiconductor Corp. Method and apparatus for adding OTG dual role device capability to a USB peripheral
EP2088780B1 (en) * 2006-11-07 2015-11-04 Sony Corporation Electronic device, content reproducing method, and content decoding method
US7644217B2 (en) * 2007-03-02 2010-01-05 Microchip Technology Incorporated Detecting connection to a USB host or hub without using an extra status input
US7921231B2 (en) * 2008-01-04 2011-04-05 Silicon Image, Inc. Discovery of electronic devices utilizing a control bus
CN101430557B (zh) * 2008-12-05 2012-08-08 中国汽车技术研究中心 用于汽车故障诊断的多协议数据转换器及诊断处理方法
TWI479320B (zh) * 2010-12-09 2015-04-01 Hon Hai Prec Ind Co Ltd 一體機觸控模組切換電路
US8332545B1 (en) * 2011-05-31 2012-12-11 Smsc Holdings S.A.R.L. USB switch which allows primary USB connection in response to USB signaling
CN103064489B (zh) * 2011-10-21 2016-03-30 华为终端有限公司 一种根据usb接口状态进行内部电路选择的方法及终端
CN102662431B (zh) * 2012-03-14 2015-05-27 华为终端有限公司 一种扩展坞、利用该扩展坞进行的外接设备控制方法及系统
US8959272B2 (en) * 2012-07-06 2015-02-17 Blackberry Limited Interposer and intelligent multiplexer to provide a plurality of peripherial buses
US9460037B2 (en) * 2013-09-26 2016-10-04 Delphi Technologies, Inc. Flexible mobile device connectivity to automotive systems with USB hubs
US9665525B2 (en) * 2014-06-09 2017-05-30 High Sec Labs Ltd. Multi-host docking device
US10691470B2 (en) * 2015-06-18 2020-06-23 Kenneth Mark Woog Personal computer system with remotely-configured hardware-enforced usage limits
US9529758B1 (en) * 2015-10-05 2016-12-27 Nanoport Technology Inc. Multiple port configuration
TWI620068B (zh) * 2016-05-13 2018-04-01 景相科技股份有限公司 支援多主機的通用序列匯流排集線設備及使用其之車用主機
US10083147B2 (en) * 2016-12-30 2018-09-25 Intel Corporation Apparatuses and methods for multilane universal serial bus (USB2) communication over embedded universal serial bus (eUSB2)
WO2019015681A1 (zh) * 2017-07-20 2019-01-24 青岛海信电器股份有限公司 一种终端设备及其控制方法
US10862730B2 (en) * 2018-09-27 2020-12-08 Intel Corporation Selective connection for interface circuitry
CN210895119U (zh) * 2019-10-18 2020-06-30 深圳市道通科技股份有限公司 一种接口电路及其汽车诊断设备

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101989246A (zh) * 2009-07-29 2011-03-23 鸿富锦精密工业(深圳)有限公司 可自动切换usb主从设备模式的电子装置
US20130048372A1 (en) * 2011-08-31 2013-02-28 Nvidia Corporation Hdmi-muxed debug cable methods and apparatuses
CN202694324U (zh) * 2012-03-29 2013-01-23 深圳市宇恒互动科技开发有限公司 可独立升级的usb装置及usb系统
CN103365388A (zh) * 2012-04-09 2013-10-23 华为终端有限公司 一种终端设备的供电方法及其终端设备
CN209030353U (zh) * 2017-10-13 2019-06-25 广东高普达集团股份有限公司 接口转接电路及装置
CN207909114U (zh) * 2018-03-07 2018-09-25 深圳市显盈科技股份有限公司 多功能信号转换电路和转换器
CN208188819U (zh) * 2018-04-19 2018-12-04 广州视源电子科技股份有限公司 接口复用电路和装置
CN110209620A (zh) * 2019-07-04 2019-09-06 深圳昆仑通态科技有限责任公司 一种多接口电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4030250A4 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722120A (zh) * 2021-07-30 2021-11-30 龙芯中科(太原)技术有限公司 集成电路及其实现程序开发的方法
CN113722120B (zh) * 2021-07-30 2024-04-05 龙芯中科(太原)技术有限公司 集成电路及其实现程序开发的方法
CN114546918A (zh) * 2022-02-07 2022-05-27 合肥联宝信息技术有限公司 电子设备、转接设备、信号切换方法及存储介质

Also Published As

Publication number Publication date
EP4030250A1 (en) 2022-07-20
EP4030250A4 (en) 2022-11-02
CN110618672A (zh) 2019-12-27
US20220327087A1 (en) 2022-10-13

Similar Documents

Publication Publication Date Title
WO2021073480A1 (zh) 一种接口电路及其接口通信的方法、装置
US9952986B2 (en) Power delivery and data transmission using PCIe protocol via USB type-C port
US20070180181A1 (en) USB interface provided with host/device function and its control method
JP2016505915A (ja) 表示インターフェースを介するシリアルバスサポートの柔軟な実装
EP2692118A2 (en) Method. apparatus and system for transitioning an audio/video device between a source and a sink mode
TWM525481U (zh) 於不同通訊介面間相互傳輸訊號之系統及裝置
US20160224493A1 (en) Universal serial bus (usb) kvm switch using virtual usb for switching among multiple hosts
US10866915B2 (en) Method for increasing the compatibility of displayport
CN111031371B (zh) 单线投屏系统及方法
JP6661342B2 (ja) ポート接続回路、ポート接続制御方法、電子機器
CN104967806B (zh) 基于hdmi接口的切换电路
CN109474853A (zh) 一种电视机唤醒电路及具有其的电视机
US20210224216A1 (en) Configurable usb-c alternate mode for multi-level controller communication
WO2024078172A1 (zh) 一种屏幕显示方法、装置、设备及可读存储介质
WO2020233575A1 (zh) 一种实现usb otg功能的方法
WO2017071285A1 (zh) 移动终端的控制方法和装置
CN203632785U (zh) 一种edid视频管理器
CN204810421U (zh) 基于hdmi接口的切换电路
CN201349268Y (zh) 一种液晶电视的接口电路及液晶电视
CN108536633A (zh) 一种即插即用otg设备的接口电路及终端
CN104239257A (zh) 接口装置及信息处理装置
CN203760209U (zh) 一种mhl线缆及mhl线缆热插拔检测系统
CN204967957U (zh) 视频输入扩展卡和led显示控制系统
CN216211018U (zh) 一种支持硬件加密功能的智能硬件主板
TWI779273B (zh) 電子裝置與多螢幕顯示方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20877873

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020877873

Country of ref document: EP

Effective date: 20220412