Patent Description:
At present, 3C devices such as Android mobile devices, laptop computers, desktop computers, and even game consoles are equipped with interfaces. When connecting an external device, a user does not need to distinguish the front face and the back face of a male connector of the external device, which improves the user experience.

An interface in the prior art includes two pins. One pin is connected with a cable for transmitting information, and the other pin is connected with another cable connected with a main board to supply power to external devices. Before connecting the male connector of the external device with the interface, the user does not know in advance a cable used to supply power and a cable used to transmit information. Therefore, widths of the two cables need to be designed to be larger than a preset threshold, so that both cables can be used for power supply. For example, the widths of the two cables are required to reach <NUM> to <NUM> according to power of electricity supply. Usually, two cables need to be routed from a top chip to a PCB according to a cable width of <NUM> to <NUM>, then pass through an FPC, and then reach a connector on a sub-board. For some electronic device projects with small cable areas, cable design is usually difficult.

Embodiments of the present application provide an interface circuit and an electronic device to solve the problem of a large area occupied by a cable of the interface circuit.

To resolve the foregoing technical problem, the present application is implemented as follows:.

In a first aspect, an interface circuit provided by an embodiment of the present application includes an interface, a detection control module, a switch module, a first data line, and a second data line, where a width of the second data line is smaller than that of the first data line, the interface is electrically connected to the detection control module and a movable end of the switch module, a first fixed end of the switch module is electrically connected to the first data line, and a second fixed end of the switch module is electrically connected to the second data line;.

In a second aspect, an embodiment of the present application further provides an electronic device, where the electronic device is installed with the interface circuit described in the first aspect of the embodiments of the present application, and the first data line and the second data line are respectively electrically connected to a main control chip of the electronic device.

In the embodiments of the present application, in the interface circuit, the width of the second data line is set to be smaller than the width of the first data line, the interface is electrically connected to the detection control module and the movable end of the switch module, the first fixed end of the switch module is electrically connected to the first data line, and the second fixed end of the switch module is electrically connected to the second data line. When the detection control module detects that the signal from the interface is a power supply signal, the movable end is connected to the first fixed end. When the detection control module detects that the signal of the interface is a data signal, the movable end is connected to the second fixed end. This ensures that regardless of a pin of the interface to which an external signal is connected, a pin for data signal transmission is connected to the second data line. Since a voltage value that needs to be carried by the data cable used to transmit a data signal is generally smaller than a voltage value that needs to be carried by the data cable used to transmit a power supply signal, at the beginning of cable width design, the cable width of the cable used to transmit the data signal is designed to be smaller than the width of the cable used for power supply, to reduce the area of the cables on the circuit board, thereby reducing the cable design difficulty in electronic device projects.

The accompanying drawings illustrated herein are provided to further understand this application and form a part of this application. The exemplary embodiments of this application and the descriptions thereof are used to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:.

The following clearly and completely describes the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.

<FIG> is a circuit connection block diagram of an interface circuit provided by an embodiment of the present application. As shown in <FIG>, an interface circuit provided by an embodiment of the present application includes an interface <NUM>, a detection control module <NUM>, a switch module <NUM>, a first data line <NUM>, and a second data line <NUM>. A width of the second data line <NUM> is smaller than that of the first data line <NUM>. Specifically, the width of the first data line <NUM> may be between <NUM> and <NUM>. The width of the second data line <NUM> is between <NUM> and <NUM>. In some embodiments, the width of the second data line may be <NUM> to ensure the convenience of material acquisition and reduce material costs. The width of the second data line <NUM> is smaller than the width of the first data line <NUM>. The interface <NUM> is electrically connected to the detection control module <NUM> and the movable end of the switch module <NUM>, the first fixed end of the switch module <NUM> is electrically connected with the first data line <NUM>, and the second fixed end of the switch module <NUM> is electrically connected with the second data line <NUM>.

The interface <NUM> can implement that the external device and the electronic device installed with the interface circuit perform communication interaction, and the electronic device installed with the interface circuit can supply power to the external device while the user does not need to distinguish the male connector of the external device. For example, the interface <NUM> can be a female socket of a TYPE-C interface. Of course, those skilled in the art can understand that the interface can also be other types of interfaces, such as a USB interface. In addition, the external device may be an earphone, a storage disk, or the like including a TYPE-C male connector.

When the detection control module <NUM> detects that the signal of the interface <NUM> is a power supply signal, the movable end is connected to the first fixed end.

When the detection control module <NUM> detects that the signal of the interface <NUM> is a data signal, the movable end is connected to the second fixed end.

In the interface circuit, the width of the second data line is set to be smaller than the width of the first data line, the interface is electrically connected to the detection control module and the movable end of the switch module, the first fixed end of the switch module is electrically connected to the first data line, and the second fixed end of the switch module is electrically connected to the second data line. When the detection control module detects that the signal from the interface is a power supply signal, the movable end is connected to the first fixed end. When the detection control module detects that the signal of the interface is a data signal, the movable end is connected to the second fixed end. This ensures that regardless of a pin of the interface to which an external signal is connected, a pin for data signal transmission is connected to the second data line. Since a voltage value that needs to be carried by the data cable used to transmit a data signal is generally smaller than a voltage value that needs to be carried by the data cable used to transmit a power supply signal, at the beginning of cable width design, the cable width of the cable used to transmit the data signal is designed to be smaller than the width of the cable used for power supply, to reduce the area of the cables on the circuit board.

The interface <NUM> includes a first pin and a second pin. When the detection control module <NUM> detects that an input voltage of the first pin is higher than a threshold, the detection control module determines that a signal received by the interface <NUM> is a data signal, and the detection control module <NUM> controls the movable end of the switch module <NUM> to connect to the second fixed end, so that the first pin is electrically connected to the second data line, and the data signal is received by a subsequent processing circuit through the second data line. When the detection control module <NUM> detects that an input voltage of the second pin is lower than a threshold, the detection control module determines that a signal received by the interface <NUM> is a power supply signal, and the detection control module <NUM> controls the movable end of the switch module <NUM> to connect to the first fixed end, so that the second pin is electrically connected to the first data line, and the power supply signal is received by a subsequent processing circuit through the first data line.

Optionally, one end of the first data line is electrically connected to the fixed end of the switch module, and the other end of the first data line is electrically connected to the processing circuit; one end of the second data line is electrically connected to the fixed end of the switch module, and the other end of the second data line is electrically connected to the processing circuit. The processing circuit is a main control chip on the main board, such as a central processing unit (CPU). The main control chip can be configured to internally process data on the first data line and the second data line, and transmit the data to a designated device through a connector. In some embodiments of the present application, when the signal received by the pin of the interface is a power supply signal, the main control chip transmits the power supply signal from a processing main control end to the interface through the second data line, to complete power supply.

Optionally, the switch module <NUM> is a double-pole double-throw switch or at least two single-pole single-throw switches.

Optionally, the switch module <NUM> uses a double-pole double-throw switch, the first data line <NUM> includes a first connection end and a second connection end, and the second data line <NUM> includes a third connection end and a fourth connection end. The first pin of the interface <NUM> is connected to a first movable end of the double-pole double-throw switch, and the second pin of the interface <NUM> is connected to a second movable end of the double-pole double-throw switch. A first fixed end of the double-pole double-throw switch is connected to the third connection end, a second fixed end of the double-pole double-throw switch is connected to the second connection end, a third fixed end of the double-pole double-throw switch is connected to the first connection end, and a fourth fixed end of the double-pole double-throw switch is connected to the fourth connection end.

Specifically, as shown in <FIG>, as an implementation manner, the detection control module <NUM> is further configured to: when detecting that an input voltage of the first pin is higher than a preset threshold and an input voltage of the second pin is lower than a preset threshold (that is, the external electronic device is inserted into the interface in a forward direction), control the first movable end of the double-pole double-throw switch to connect to the third connection end of the second data line, that is, the first fixed end of the switch module, and control the second movable end of the double-pole double-throw switch to connect to the second connection end of the first data line, that is, the second fixed end of the switch module.

Specifically, as shown in <FIG>, as another implementation manner, the detection control module <NUM> is further configured to: when detecting that an input voltage of the first pin is lower than a preset threshold and an input voltage of the second pin is higher than a preset threshold (that is, the external electronic device is inserted into the interface in a reverse direction), control the first movable end of the double-pole double-throw switch to connect to the first connection end of the first data line, that is, the third fixed end of the switch module, and control the second movable end of the double-pole double-throw switch to connect to the fourth connection end of the second data line, that is, the fourth fixed end of the switch module.

It should be noted that, in some embodiments of the present application, when the switch module <NUM> uses two single-pole single-throw switches, since the data line determined as the power supply cable needs to supply power from the processing chip to the interface, when the detection control module detects that the signal of the interface is a data signal, the single-pole single-throw switch connected to the pin is preferentially electrically connected to the second data line, and the other single-pole single-throw switch is then connected to the first data line.

Optionally, as shown in <FIG>, the detection control module <NUM> includes a voltage change detection unit <NUM> and a control unit <NUM>, and the interface <NUM>, the voltage change detection unit <NUM>, and the control unit <NUM> are electrically connected to each other in sequence. The voltage change detection unit <NUM> is configured to detect whether the voltages of the two pins of the interface <NUM> are greater than preset thresholds when the interface <NUM> is connected to an external device, and output a detection result to the control unit <NUM>. The control unit <NUM> is configured to control, according to the detection result, the switch module <NUM> to be turned on.

Specifically, as shown in <FIG>, as an implementation manner, the voltage change detection unit <NUM> includes a first comparator <NUM> and a second comparator <NUM>. A first input end of the first comparator <NUM> is electrically connected to the one pin of the interface <NUM>, a second input end of the first comparator <NUM> is connected to a reference voltage input end, and an output end of the first comparator <NUM> is electrically connected to the control unit <NUM>; a first input end of the second comparator <NUM> is electrically connected to the other pin of interface <NUM>, a second input end of the second comparator <NUM> is connected to the reference voltage input terminal, and an output end of the second comparator <NUM> is electrically connected to the control unit <NUM>.

The first comparator <NUM> is configured to compare a voltage input by the pin and a reference voltage to obtain a difference, and compare whether the difference is greater than a preset threshold, and if the difference is greater than the preset threshold, output a high level to the control unit <NUM>. The control unit controls, according to a level change, a condition of turning on or off the switch module. The second comparator <NUM> is also configured to compare a voltage input by the pin and a reference voltage to obtain a difference, and compare whether the difference is greater than a preset threshold, and if the difference is lower than the preset threshold, output a low level to the control unit <NUM>. The control unit controls, according to a level change, a condition of turning on or off the switch module.

Specifically, as shown in <FIG>, as another implementation manner, the voltage change detection unit <NUM> includes a first ADC unit <NUM> and a second ADC unit <NUM>. An input end of the first ADC unit <NUM> is electrically connected to one pin of the interface <NUM>, an output end of the first ADC unit <NUM> is electrically connected to the control unit <NUM>; an input end of the second ADC unit <NUM> is electrically connected to the other pin of the interface <NUM>, and an output end of the second ADC unit <NUM> is electrically connected to the control unit <NUM>.

The first ADC unit <NUM> is configured to compare whether a voltage input by the pin is greater than a preset threshold, and if the difference is greater than the preset threshold, output a high level to the control unit <NUM>. The control unit controls, according to a level change, a condition of turning on or off the switch module. The second ADC unit <NUM> is also configured to compare whether a voltage input by the pin is lower than a preset threshold, and if the difference is lower than the preset threshold, output a low level to the control unit <NUM>. The control unit controls, according to a level change, a condition of turning on or off the switch module.

<FIG> is a schematic structural diagram of hardware of an electronic device implementing the embodiments of the present invention. The electronic device includes but is not limited to: a radio frequency unit <NUM>, a network module <NUM>, an audio output unit <NUM>, an input unit <NUM>, a sensor <NUM>, a display unit <NUM>, a user input unit <NUM>, an interface unit <NUM>, a memory <NUM>, a processor <NUM>, a power supply <NUM>, and other components. The electronic device further includes: an interface, a detection control module, a switch module, a first data line, and a second data line (not shown in <FIG>). A width of the second data line is smaller than a width of the first data line and is lower than a preset threshold, and an interface is respectively electrically connected to the detection control module and the switch module. A person skilled in the art may understand that a structure of the electronic device shown in <FIG> constitutes no limitation on the electronic device, and the electronic device may include more or fewer components than those shown in the figure, or have a combination of some components, or have a different component arrangement. In this embodiment of this application, the electronic device includes but is not limited to a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle-mounted terminal, a wearable device, a pedometer, or the like. The second data line and the first data line are electrically connected to the processor.

When the detection control module detects that the signal of the interface is a power supply signal, the movable end is connected to the first fixed end; when the detection control module detects that the signal of the interface is a data signal, the movable end is connected to the second fixed end connect.

It should be understood that, in this embodiment of this application, the radio frequency unit <NUM> may be configured to receive and send information or a signal in a call process. Specifically, after receiving downlink data from a base station, the radio frequency unit sends the downlink data to the processor <NUM> for processing. In addition, the radio frequency unit sends uplink data to the base station. Usually, the radio frequency unit <NUM> includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit <NUM> may communicate with a network and another device through a wireless communication system.

The electronic device provides users with wireless broadband Internet access through the network module <NUM>, for example, helps users receive and send e-mails, browse web pages, and access streaming media.

The audio output unit <NUM> may convert audio data received by the radio frequency unit <NUM> or the network module <NUM> or stored in the memory <NUM> into an audio signal and output the audio signal as a sound. Moreover, the audio output unit <NUM> can further provide audio output related to a specific function performed the electronic device (for example, call signal receiving sound and message receiving sound). The audio output unit <NUM> includes a speaker, a buzzer, a telephone receiver, and the like.

The input unit <NUM> is configured to receive an audio signal or a video signal. The input unit <NUM> may include a graphics processing unit (Graphics Processing Unit, GPU) <NUM> and a microphone <NUM>. The graphics processing unit <NUM> is used to process image data of a static picture or a video obtained by an image capturing device (for example, a camera) in a video capturing mode or an image capturing mode. A processed image frame may be displayed on the display unit <NUM>. The image frame processed by the graphics processing unit <NUM> may be stored in the memory <NUM> (or another storage medium) or sent via the radio frequency unit <NUM> or the network module <NUM>. The microphone <NUM> can receive sound and can process such sound into audio data. The processed audio data may be output by being converted into a format that may be sent to a mobile communications base station by using the radio frequency unit <NUM> in a telephone call mode.

The electronic device also includes at least one sensor <NUM>, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor may adjust luminance of a display panel <NUM> according to ambient light luminance. The proximity sensor may switch off the display panel <NUM> and/or backlight when the electronic device moves close to an ear. As a type of the motion sensor, an accelerometer sensor may detect an acceleration value in each direction (generally, three axes), and detect a value and a direction of gravity when the accelerometer sensor is static, and may be used for recognizing a posture of the electronic device (such as screen switching between landscape and portrait modes, a related game, or magnetometer posture calibration), a function related to vibration recognition (such as a pedometer or a knock), and the like. The sensor <NUM> may further include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like.

The display unit <NUM> is configured to display information entered by a user or information provided for a user. The display unit <NUM> may include the display panel <NUM>, and the display panel <NUM> may be configured in a form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), or the like.

The user input unit <NUM> may be configured to: receive input digital or character information, and generate key signal input related to a user setting and function control of the electronic device. Specifically, the user input unit <NUM> includes a touch panel <NUM> and another input device <NUM>. The touch panel <NUM>, also called a touch screen, may collect touch operation on or near the touch panel by users (for example, operation on the touch panel <NUM> or near the touch panel <NUM> by fingers or any suitable objects or accessories such as a touch pen by the users). The touch panel <NUM> may include two parts: a touch detection apparatus and a touch controller. The touch detection apparatus detects a touch location of the user, detects a signal brought by the touch operation, and sends the signal to the touch controller. The touch controller receives touch information from the touch detection apparatus, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor <NUM>, and receives and executes a command sent by the processor <NUM>. In addition, the touch panel <NUM> may be implemented in various types such as a resistor, a capacitor, an infrared ray, or a surface acoustic wave. The user input unit <NUM> may further include another input device <NUM> in addition to the touch panel <NUM>. Specifically, the another input device <NUM> may include but is not limited to a physical keyboard, a functional button (such as a volume control button or a power on/off button), a trackball, a mouse, and a joystick.

Further, the touch panel <NUM> may cover the display panel <NUM>. When detecting the touch operation on or near the touch panel, the touch panel <NUM> transmits the touch operation to the processor <NUM> to determine a type of a touch event, and then the processor <NUM> provides corresponding visual output on the display panel <NUM> based on the type of the touch event. Although in <FIG>, the touch panel <NUM> and the display panel <NUM> are configured as two independent components to implement input and output functions of the electronic device, in some embodiments, the touch panel <NUM> and the display panel <NUM> can be integrated to implement the input and output functions of the electronic device. Details are not limited herein.

The interface circuit <NUM> is an interface for connecting an external apparatus to the electronic device. For example, the external apparatus may include a wired or wireless headphone port, an external power supply (or a battery charger) port, a wired or wireless data port, a storage card port, a port used to connect to an apparatus having an identity module, an audio input/output (I/O) port, a video I/O port, a headset port, and the like. The interface circuit <NUM> may be configured to receive input (for example, data information and power) from an external apparatus and transmit the received input to one or more elements in the electronic device or may be configured to transmit data between the electronic device and an external apparatus.

The memory <NUM> may be configured to store a software program and various data. The memory <NUM> may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application required by at least one function (such as a sound play function or an image play function), and the like. The data storage area may store data (such as audio data or an address book) created based on use of the mobile phone, and the like. In addition, the memory <NUM> may include a high-speed random access memory, and may further include a nonvolatile memory, for example, at least one magnetic disk storage device, a flash storage device, or another volatile solid-state storage device.

The processor <NUM> is a control center of the electronic device, connects all parts of the entire electronic device by using various interfaces and lines, and performs various functions of the electronic device and data processing by running or executing a software program and/or a module that are/is stored in the memory <NUM> and by invoking data stored in the memory <NUM>, to overall monitor the electronic device. The processor <NUM> may include one or more processing units. Preferably, an application processor and a modem processor may be integrated into the processor <NUM>. The application processor mainly processes an operating system, a user interface, an application, and the like. The modem processor mainly processes wireless communications. It can be understood that, alternatively, the modem processor may not be integrated into the processor <NUM>.

The electronic device may further include the power supply <NUM> (such as a battery) supplying power to each component. Preferably, the power supply <NUM> may be logically connected to the processor <NUM> by using a power management system, so as to implement functions such as charging management, discharging management and power consumption management by using the power management system.

In addition, the electronic device includes some functional modules not shown.

It should be noted that, in this specification, the terms "include", "comprise", or their any other variant is intended to cover a non-exclusive inclusion, so that a process, a method, an article, or an apparatus that includes a list of elements not only includes those elements but also includes other elements which are not expressly listed, or further includes elements inherent to such process, method, article, or apparatus. In the absence of more restrictions, an element defined by the statement "including a. " does not preclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

Based on the descriptions of the foregoing implementations, a person skilled in the art may clearly understand that the method in the foregoing embodiment may be implemented by software in addition to a necessary universal hardware platform or by hardware only. In most circumstances, the former is a preferred implementation. Based on such an understanding, the technical solutions of the present application essentially, or the part contributing to the prior art may be implemented in a form of a software product. The computer software product is stored in a storage medium (for example, a ROM/RAM, a magnetic disk, or a compact disc), and includes a plurality of instructions for instructing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, a network device, or the like) to perform the method described in the embodiments of the present application.

Claim 1:
An interface circuit, comprising: an interface (<NUM>), a detection control module (<NUM>), a switch module (<NUM>), a first data line (<NUM>), and a second data line (<NUM>), wherein the width of the first data line (<NUM>) is between <NUM> and <NUM>, the width of the second data line (<NUM>) is between <NUM> and <NUM>, the interface (<NUM>) is electrically connected to the detection control module (<NUM>) and a movable end of the switch module (<NUM>), a first fixed end of the switch module (<NUM>) is electrically connected to the first data line (<NUM>), and a second fixed end of the switch module (<NUM>) is electrically connected to the second data line (<NUM>),
wherein the interface (<NUM>) comprises a first pin and a second pin;
when the detection control module (<NUM>) detects that an input voltage of the first pin is higher than a threshold, a signal received by the interface (<NUM>) is a data signal, and the detection control module (<NUM>) controls the movable end of the switch module (<NUM>) to connect to the second fixed end, so that the first pin is electrically connected to the second data line (<NUM>); and
when the detection control module (<NUM>) detects that an input voltage of the second pin is lower than a threshold, a signal received by the interface (<NUM>) is a power supply signal, and the detection control module (<NUM>) controls the movable end of the switch module (<NUM>) to connect to the first fixed end, so that the second pin is electrically connected to the first data line (<NUM>).