Disclosure of Invention
The invention aims to provide a peripheral processing device, a peripheral processing method and an electronic device, which can enable the electronic device to have a plurality of peripheral interfaces and facilitate the use of the electronic device by a user.
Embodiments of the invention may be implemented as follows:
in a first aspect, an embodiment provides a peripheral processing apparatus, including a main control chip, a plurality of interface control modules and a plurality of peripheral interfaces, where the plurality of interface control modules are respectively electrically connected to the plurality of peripheral interfaces in a one-to-one correspondence, the main control chip is electrically connected to the plurality of interface control modules and the plurality of peripheral interfaces, and the plurality of peripheral interfaces are connected to a peripheral in a pluggable manner;
the peripheral interface is used for sending type identification information of the peripheral to the main control chip when the peripheral is inserted;
the main control chip is used for determining the equipment type of the peripheral equipment according to the type identification information and performing data interaction with the peripheral equipment inserted into the peripheral equipment interface in a data format corresponding to the equipment type through the target interface control module, wherein the target interface control module is electrically connected with the peripheral equipment interface.
In an optional implementation manner, when the type identification information represents an audio device and the data format is audio data, the main control chip is further configured to perform data interaction between the audio data and the peripheral device through the target interface control module.
In an optional embodiment, the peripheral interface is further configured to send positive and negative insertion identification information to the main control chip through the target interface control module;
the main control chip is used for judging the insertion mode of the peripheral according to the positive and negative insertion identification information, and if the peripheral is set to be positively inserted, audio data interaction is carried out with the peripheral inserted into the peripheral interface through the target interface control module.
In an optional embodiment, the main control chip is configured to determine whether the positive and negative insertion identification information is within a preset voltage range, and if the positive and negative insertion identification information is within the preset voltage range, determine that the external device is a positive insertion.
In an optional implementation manner, the type identification information includes a first CC signal and a second CC signal, and the main control chip is configured to determine the device type of the peripheral according to logic states of the first CC signal and the second CC signal.
In an optional implementation manner, when the type identification information represents a non-audio data device and the data format is non-audio data, the main control chip is further configured to perform data interaction between the non-audio data and the peripheral device through the target interface control module.
In an optional embodiment, the interface control module includes an audio switch, and the main control chip is electrically connected to the peripheral interface through the audio switch;
the main control chip is used for controlling an audio switch of the target interface control module to be in a conducting state after determining the equipment type of the peripheral equipment according to the type identification information, and performing data interaction with the peripheral equipment inserted into the peripheral equipment interface through the audio switch.
In an optional embodiment, the peripheral processing apparatus further includes a plurality of logic control modules, the plurality of logic control modules are respectively electrically connected to the plurality of peripheral interfaces in a one-to-one correspondence, and the plurality of logic control modules are electrically connected to the main control chip;
the logic control module is used for generating target determination information according to type identification information sent by a peripheral interface electrically connected with the logic control module and transmitting the target determination information to the main control chip;
the main control chip is used for determining the target interface control module according to the target determination information.
In a second aspect, an embodiment provides a peripheral processing method, which is applied to a main control chip, where the main control chip is electrically connected to a plurality of interface control modules and a plurality of peripheral interfaces, the plurality of peripheral interfaces are electrically connected to the plurality of peripheral interfaces in a one-to-one correspondence, and the plurality of peripheral interfaces are connected to a peripheral in a pluggable manner, where the method includes:
when the peripheral is inserted into the peripheral interface, acquiring the type identification information of the peripheral sent by the peripheral interface;
and determining the equipment type of the peripheral equipment according to the type identification information, and performing data interaction with the peripheral equipment inserted into the peripheral equipment interface through the target interface control module in a data format corresponding to the equipment type, wherein the target interface control module is electrically connected with the peripheral equipment interface.
In a third aspect, an embodiment provides an electronic device, including the peripheral processing apparatus according to any of the foregoing embodiments.
The peripheral processing device comprises a main control chip, a plurality of interface control modules and a plurality of peripheral interfaces, wherein the plurality of interface control modules are respectively and correspondingly electrically connected with the plurality of peripheral interfaces one by one, the main control chip is electrically connected with the plurality of interface control modules and the plurality of peripheral interfaces, and the plurality of peripheral interfaces are connected with the peripheral in a pluggable manner. When a peripheral is inserted into the peripheral interface, the peripheral interface sends the type identification information of the peripheral to the main control chip; the main control chip determines the equipment type of the peripheral equipment according to the type identification information, and performs data interaction with the peripheral equipment inserted into the peripheral equipment interface through the target interface control module in a data format corresponding to the equipment type, wherein the target interface control module is electrically connected with the peripheral equipment interface. It can be seen that through the identification of the type identification information by the main control chip and the selection of the interface control module, the data interaction can be performed by selecting the peripheral interfaces inserted with the peripherals from the plurality of peripheral interfaces according to the number of data corresponding to the device type, so that the electronic device can support the work of the plurality of peripheral interfaces, can also support peripherals of different device types, and is convenient to use.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. indicate an orientation or a positional relationship based on that shown in the drawings or that the product of the present invention is used as it is, this is only for convenience of description and simplification of the description, and it does not indicate or imply that the device or the element referred to must have a specific orientation, be constructed in a specific orientation, and be operated, and thus should not be construed as limiting the present invention.
Furthermore, the appearances of the terms "first," "second," and the like, if any, are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
It should be noted that the features of the embodiments of the present invention may be combined with each other without conflict.
Referring to fig. 1, a schematic diagram of an applicable environment of anelectronic device 100 according to an embodiment of the present invention is provided, in which theelectronic device 100 includes aperipheral processing apparatus 110, and theperipheral processing apparatus 110 is connected to at least one peripheral 200 in a pluggable manner. Theperipheral processing device 110 is configured to perform data interaction with at least one peripheral 200, and may perform data interaction withperipherals 200 of different data formats.
Theelectronic device 100 may be a notebook, a mobile phone, a tablet computer, a VR (Virtual Reality technology), and the like. The peripheral 200 may be an audio peripheral, a non-audio peripheral, a charging peripheral, or the like, wherein the audio peripheral may be an earphone, the non-audio peripheral may be a USB, and the charging peripheral may be a power bank.
Referring to fig. 2, which is a schematic structural diagram of an implementation of theperipheral processing apparatus 110 shown in fig. 1, theperipheral processing apparatus 110 includes amain control chip 111, a plurality ofinterface control modules 112 and a plurality ofperipheral interfaces 113, the plurality ofinterface control modules 112 are respectively electrically connected to the plurality ofperipheral interfaces 113 in a one-to-one correspondence manner, themain control chip 111 is electrically connected to both the plurality ofinterface control modules 112 and the plurality ofperipheral interfaces 113, and the plurality ofperipheral interfaces 113 are connected to a peripheral 200 in a pluggable manner.
In this embodiment, theperipheral interface 113 is configured to send type identification information of the peripheral 200 to themain control chip 111 when the peripheral 200 is inserted; themain control chip 111 is configured to determine a device type of theperipheral device 200 according to the type identification information, and perform data interaction with theperipheral device 200 inserted into theperipheral interface 113 in a data format corresponding to the device type through the targetinterface control module 112, where the targetinterface control module 112 is electrically connected to theperipheral interface 113.
It is understood that the type identification information is generated by theperipheral device 200 inserted into theperipheral interface 113, and theperipheral interface 113 transmits the type identification information generated by theperipheral device 200 directly to themain control chip 111. And eachperipheral interface 113 is electrically connected to the same input terminal of themain control chip 111, that is, the type identification information transmitted by eachperipheral interface 113 is transmitted to the same input terminal of themain control chip 111. After determining the device type of theperipheral device 200 according to the type identification information, themain control chip 111 controls the targetinterface control module 112 to be in a conducting state, thereby implementing communication with theperipheral device 200 inserted into theperipheral interface 113. The targetinterface control module 112 is aninterface control module 112 electrically connected to aperipheral interface 113 into which the peripheral 200 is inserted.
In the present embodiment, the number of theinterface control modules 112 is the same as the number of theperipheral interfaces 113. The number of theinterface control modules 112 and the number of theperipheral interfaces 113 may be set according to an actual situation, which is not limited herein, and in this embodiment, the number of theinterface control modules 112 and the number of theperipheral interfaces 113 are 2 for example. When the number of the plurality ofinterface control modules 112 and the number of theperipheral interfaces 113 are two, theinterface control module 112 includes a first interface control module and a second interface control module, theperipheral interfaces 113 includes a first peripheral interface and a second peripheral interface, the first interface control module is electrically connected to the first peripheral interface, and the second interface control module is electrically connected to the second peripheral interface. If the first peripheral interface has the peripheral 200 inserted therein, the first peripheral interface transmits the type identification information generated by the peripheral 200 to themain control chip 111, and themain control chip 111 determines the device type of the peripheral 200 according to the similar identification information, determines that the first interface control module is the targetinterface control module 112, and controls the first interface control module to be in a conducting state, thereby realizing communication with the peripheral 200 inserted in the first peripheral interface.
In this embodiment, when the type identification information represents an audio device and the data format is audio data, themain control chip 111 is further configured to perform audio data interaction with theperipheral device 200 through the targetinterface control module 112.
It is understood that when theperipheral device 200 inserted into theperipheral interface 113 is an audio device (e.g., a headset), themain control chip 111 interacts audio data with theperipheral device 200 inserted into theperipheral interface 113 through the targetinterface control module 112.
For example, if the first peripheral interface is inserted into the audio device, themain control chip 111 controls the first interface control module to be in a conducting state, so as to implement audio data interaction with the audio device.
In this embodiment, when the type identification information represents a non-audio data device and the data format is non-audio data, themain control chip 111 is further configured to perform data interaction between the non-audio data and theperipheral device 200 through the targetinterface control module 112.
It is understood that when theperipheral device 200 inserted into theperipheral interface 113 is a non-audio data device (e.g., a usb disk), themain control chip 111 performs non-audio data interaction with theperipheral device 200 inserted into theperipheral interface 113 through the targetinterface control module 112.
In this embodiment, when the type identification information represents a charging device (e.g., a charger), themain control chip 111 is further configured to control the charging module of theelectronic device 100 to charge the charging device.
The type identification information includes a first CC signal and a second CC signal, and themain control chip 111 is configured to determine the device type of the peripheral 200 according to the logic states of the first CC signal and the second CC signal. Theperipheral interface 113 includes a first CC pin and a second CC pin, when the peripheral 200 is inserted into theperipheral interface 113, the first CC pin and the second CC pin of theperipheral interface 113 may receive a first CC signal and a second CC signal generated by the peripheral 200, the first CC pin and the second CC pin of theperipheral interface 113 may transmit the received first CC signal and the received second CC signal to themain control chip 111, and themain control chip 111 determines the device type of the peripheral 200 according to the logic states of the first CC signal and the second CC signal. For example, if the first CC signal and the second CC signal are both low level, the device type is characterized as an audio device; if the first CC signal is high level and the second CC signal is low level, the device type is characterized to be non-audio data device; and if the first CC signal is in a low level and the second CC signal is in a high level, the device type is characterized to be the charging device.
In this embodiment, theperipheral interface 113 is further configured to send positive and negative insertion identification information to themain control chip 111 through the targetinterface control module 112; themain control chip 111 is configured to determine an insertion manner of theperipheral device 200 according to the positive and negative insertion identification information, and perform audio data interaction with theperipheral device 200 inserted into theperipheral interface 113 through the targetinterface control module 112 if theperipheral device 200 is inserted in the positive direction.
It can be understood that themain control chip 111 is configured to determine whether the positive and negative insertion identification information is within a preset voltage range, and if the positive and negative insertion identification information is within the preset voltage range, determine that the peripheral 200 is a positive insertion.
Theperipheral interface 113 includes a first SUB pin and a second SUB pin, and the positive and negative insertion identification information includes first SUB information and second SUB information. After themain control chip 111 performs device type identification according to the type identification information, the first SUB pin and the second SUB pin of theperipheral interface 113 send the first SUB information and the second SUB information to themain control chip 111 through the targetinterface control module 112. If the first SUB pin is an MIC pin, themain control chip 111 may determine whether the first SUB information and the second SUB information are within a preset voltage range, and if the first SUB information is within the preset voltage range and the second SUB information is not within the preset voltage range, determine that theperipheral device 200 is a forward plug. If the first SUB information is not within the predetermined voltage range and the second SUB information is within the predetermined voltage range, it is determined that theperipheral device 200 is reverse-plugged. Themain control chip 111 will perform audio data interaction with the peripheral 200 inserted into theperipheral interface 113 through the targetinterface control module 112 after determining that the peripheral 200 is being inserted.
In this embodiment, theinterface control module 112 includes an audio switch, and themain control chip 111 is electrically connected to theperipheral interface 113 through the audio switch. Themain control chip 111 is configured to control the audio switch of the targetinterface control module 112 to be in a conducting state after determining the device type of theperipheral device 200 according to the type identification information, and perform data interaction with theperipheral device 200 inserted into theperipheral interface 113 through the audio switch.
It is understood that the audio switch may employ the FSA44 series of audio switches. Theperipheral interface 113 may employ a Type-C interface.
Referring to fig. 3, which is another implementable structural schematic diagram of theperipheral processing device 110 according to the embodiment of the present invention, theperipheral processing device 110 shown in fig. 3 further includes a plurality oflogic control modules 114 on the basis of theperipheral processing device 110 shown in fig. 2, the plurality oflogic control modules 114 are respectively electrically connected to the plurality ofperipheral interfaces 113 in a one-to-one correspondence, and the plurality oflogic control modules 114 are electrically connected to themain control chip 111.
In this embodiment, thelogic control module 114 is configured to generate target determination information according to the type identification information sent by theperipheral interface 113 electrically connected to thelogic control module 114, and transmit the target determination information to themain control chip 111; themain control chip 111 is configured to determine the targetinterface control module 112 according to the target determination information.
It can be understood that the number of the plurality oflogic control modules 114 is the same as the number of the plurality ofperipheral interfaces 113, and when the plurality ofinterface control modules 112, the plurality ofperipheral interfaces 113 and the plurality oflogic control modules 114 are two, the plurality oflogic control modules 114 include a first logic control module and a second logic control module, the first logic control module is electrically connected with themain control chip 111 and the first peripheral interface, and the second logic control module is electrically connected with themain control chip 111 and the second peripheral interface. If the first peripheral interface has the peripheral 200 inserted therein, the first peripheral interface transmits the type identification information generated by the peripheral 200 to the first logic control module, the first logic control module generates first target determination information according to the type identification information sent by the first peripheral interface, and transmits the first target determination information to themain control chip 111, and themain control chip 111 determines that the first interface control module is the targetinterface control module 112 according to the first target determination information. If the second external interface has the peripheral 200 inserted therein, the second external interface transmits the type identification information generated by the peripheral 200 to the second logic control module, the second logic control module generates second target determination information according to the type identification information sent by the second external interface, and transmits the second target determination information to themain control chip 111, and themain control chip 111 determines that the second interface control module is the targetinterface control module 112 according to the second target determination information.
In this embodiment, thelogic control module 114 may adopt a logic control chip of ANX74 series.
As shown in fig. 3, theperipheral processing device 110 further includes an interrupt control module 115 and anaudio processing module 116, themain control chip 111 is electrically connected to theaudio processing module 116, theaudio processing module 116 is electrically connected to the interrupt control module 115 and the plurality ofinterface control modules 112, and the interrupt control module 115 is electrically connected to the plurality ofinterface control modules 112. The interrupt control module 115 is configured to convert an interrupt signal sent by theinterface control module 112 into an interrupt detection signal, and send the interrupt detection signal to theaudio processing module 116, where the interrupt signal is sent by theperipheral interface 113 into which the peripheral 200 is inserted. Theaudio processing module 116 is configured to initiate an audio device identification function according to the interrupt detection signal. It can be seen that the peripheral processing means 110 may also enable identification of the device type of the peripheral 200 by means of the interrupt control module 115 and theaudio processing module 116.
In this embodiment,audio processing module 116 may employ a WCD93 family chip. Themain control chip 111 is a system chip of theelectronic device 100, and may adopt a CPU. Theperipheral processing device 110 may be applied to a high-pass platform, or may be applied to other platforms that only support the limitation of oneperipheral interface 113.
Fig. 4 is a schematic flow chart of a peripheral processing method according to an embodiment of the present invention. The peripheral processing method can be applied to themain control chip 111 shown in fig. 2, and it should be noted that the peripheral processing method according to the present invention is not limited by the specific sequence shown in fig. 4 and described below. It should be understood that in other embodiments, the order of some steps in the peripheral processing method according to the present invention may be interchanged according to actual needs, or some steps may be omitted or deleted. The specific flow shown in fig. 4 will be described in detail below.
Step S101, when a peripheral is inserted into the peripheral interface, obtaining the type identification information of the peripheral sent by the peripheral interface.
And S102, determining the equipment type of the peripheral equipment according to the type identification information, and performing data interaction with the peripheral equipment inserted into the peripheral equipment interface in a data format corresponding to the equipment type through a target interface control module, wherein the target interface control module is electrically connected with the peripheral equipment interface.
It is understood that the descriptions of themain control chip 111 in the above steps S101 and S102 can be referred to.
In summary, embodiments of the present invention provide a peripheral processing apparatus, a peripheral processing method, and an electronic device, where the peripheral processing apparatus includes a main control chip, a plurality of interface control modules, and a plurality of peripheral interfaces, the plurality of interface control modules are respectively electrically connected to the plurality of peripheral interfaces in a one-to-one correspondence, the main control chip is electrically connected to the plurality of interface control modules and the plurality of peripheral interfaces, and the plurality of peripheral interfaces are connected to a peripheral in a pluggable manner. When a peripheral is inserted into the peripheral interface, the peripheral interface sends the type identification information of the peripheral to the main control chip; the main control chip determines the equipment type of the peripheral equipment according to the type identification information, and performs data interaction with the peripheral equipment inserted into the peripheral equipment interface through the target interface control module in a data format corresponding to the equipment type, wherein the target interface control module is electrically connected with the peripheral equipment interface. It is visible, through main control chip to type identification information's discernment, and interface control module's selection, can realize selecting from a plurality of peripheral hardware interfaces to insert the peripheral hardware interface that is equipped with the peripheral hardware and carry out data interaction with the data number that equipment type corresponds, make electronic equipment not only can support the work of a plurality of peripheral hardware interfaces, and can also support the peripheral hardware of different equipment types, when using audio equipment, can also charge to battery charging outfit, make electronic equipment's function more complete, convenience of customers's use more.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.