CN117762832A - I2C device control method and device, electronic device and storage medium - Google Patents

I2C device control method and device, electronic device and storage medium Download PDF

Info

Publication number
CN117762832A
CN117762832A CN202311474166.2A CN202311474166A CN117762832A CN 117762832 A CN117762832 A CN 117762832A CN 202311474166 A CN202311474166 A CN 202311474166A CN 117762832 A CN117762832 A CN 117762832A
Authority
CN
China
Prior art keywords
operating system
state
control chip
main control
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311474166.2A
Other languages
Chinese (zh)
Inventor
刘化冰
张瑜
张菁惠
冯克彬
徐崧哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Lianbao Information Technology Co Ltd
Original Assignee
Hefei Lianbao Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Lianbao Information Technology Co Ltd filed Critical Hefei Lianbao Information Technology Co Ltd
Priority to CN202311474166.2A priority Critical patent/CN117762832A/en
Publication of CN117762832A publication Critical patent/CN117762832A/en
Pending legal-status Critical Current

Links

Landscapes

  • Hardware Redundancy (AREA)

Abstract

The application relates to the field of electronic control, and provides an I2C device control method, an I2C device control device, an electronic device and a storage medium, which are applied to the electronic device and comprise a first body and a second body, wherein the first body is detachably connected with the second body, the first body operates a first operating system, and the second body operates a second operating system; the I2C device is positioned on the second body; the method comprises the following steps: when the first body and the second body are in a disassembly state, controlling a link between the I2C equipment and the first operating system to be in a disconnection state, wherein the I2C equipment is forbidden by the first operating system in the disassembly state; when the first body and the second body are changed from the detached state to the connected state, the link between the I2C device and the first operating system is controlled to be switched from the disconnected state to the connected state, and the I2C device is started by the first operating system. The problem that normal control cannot be performed on the I2C equipment in some scenes at present is solved, and normal control on the I2C equipment is realized.

Description

I2C device control method and device, electronic device and storage medium
Technical Field
The present disclosure relates to the field of electronic control, and in particular, to a method and apparatus for controlling an I2C device, an electronic device, and a storage medium.
Background
In an electronic device such as a notebook computer, an I2C device connected through an I2C interface is controlled to realize a normal function of the electronic device. However, in some scenarios, there may be a problem that the I2C device cannot be controlled normally due to the electronic device itself or other problems. How to realize the normal control of the I2C device, so as to avoid the electronic device from being unable to be used normally due to the failure of the I2C device to be controlled normally, is a technical problem to be solved.
Disclosure of Invention
The application provides an I2C device control method, an I2C device control device, electronic equipment and a storage medium, so as to at least solve the technical problems in the prior art.
According to a first aspect of the present application, there is provided an I2C device control method applied to an electronic device, the electronic device including a first body and a second body, the first body being detachably connected to the second body, the first body being capable of running a first operating system, the second body being capable of running a second operating system; the I2C device is positioned on the second body; the method comprises the following steps:
controlling a link between the I2C device and a first operating system to be in a disconnected state under the condition that the first body and the second body are in a detached state, wherein the I2C device is disabled by the first operating system in the detached state;
And under the condition that the first body and the second body are changed from the detaching state to the connecting state, controlling the link between the I2C equipment and the first operating system to be switched from the disconnecting state to the connecting state, wherein the I2C equipment is started by the first operating system under the condition that the detaching state is changed to the connecting state.
In the above scheme, the method further comprises:
and under the condition that the first body and the second body are in a connection state and one of the first operating system and the second operating system has the control right of the I2C device, responding to the detected switching operation, and switching a link between the I2C device and the other of the first operating system and the second operating system from a disconnection state to a connection state so as to transfer the control right of the I2C device from the one of the systems to the other system.
In the above scheme, the first body comprises a first main control chip and an embedded control chip; the second body comprises a second main control chip and a selector; the first main control chip is used for running a first operating system and a Basic Input Output System (BIOS), and the second main control chip is used for running a second operating system; an output end of the first main control chip is connected with a first input end of the selector, and an output end of the second main control chip is connected with a second input end of the selector; the output end of the selector is connected with I2C equipment; the selector is used for controlling a link between the first operating system or the second operating system and the I2C device to be in a communication state.
In the above scheme, when the first body and the second body are in the detached state, controlling the link between the I2C device and the first operating system to be in the disconnected state includes:
when the first body and the second body are in a disassembly state, acquiring first level information by the embedded control chip and responding to the first level information to generate first event information;
and the BIOS of the basic input/output system running on the first main control chip responds to the first event information, and cuts off the signal connection between the first main control chip and the selector, wherein the link between the I2C equipment and the first operating system is in a disconnection state under the condition that the signal connection between the first main control chip and the selector is cut off.
In the above scheme, the method further comprises:
and the second main control chip acquires second level information and responds to the second level information to control the link between the I2C equipment and the second operating system to be in a communication state, and the I2C equipment is started by the second operating system in the disassembly state.
In the above solution, when the first body and the second body change from the detached state to the connected state, controlling the link between the I2C device and the first operating system to switch from the disconnected state to the connected state includes:
When the first body and the second body are changed from the detaching state to the connecting state, the embedded control chip acquires third level information and responds to the third level information to generate second event information;
and the BIOS of the basic input/output system running on the first main control chip responds to the second event information, and is communicated with the signal connection between the first main control chip and the selector, and the link between the I2C equipment and the first operating system is switched from the disconnection state to the connection state under the condition that the signal connection between the first control chip and the selector is communicated.
The scheme comprises the following steps:
under the condition that the first body and the second body are in a connection state and the first operating system has the control right of the I2C equipment, acquiring first interface information by an embedded control chip;
based on the first interface information, a basic input/output system (BIOS) running on a first main control chip cuts off signal connection between the first main control chip and a selector, and a link between the I2C equipment and a first operating system is in a disconnection state under the condition that the signal connection between the first control chip and the selector is cut off;
the second main control chip acquires second interface information and responds to the second interface information, the signal connection between the second main control chip and the selector is communicated, and the link between the I2C equipment and the second operating system is in a communication state under the condition that the signal connection between the second main control chip and the selector is communicated; control of the I2C device is transferred from a first operating system to the second operating system.
The scheme comprises the following steps:
under the condition that the first body and the second body are in a connection state and the second operating system has the control right of the I2C equipment, acquiring third interface information by an embedded control chip;
based on the third interface information, a Basic Input Output System (BIOS) running on a first main control chip is communicated with signal connection between the first main control chip and a selector, and a link between the I2C equipment and a first operating system is in a communication state under the condition that the signal connection between the first main control chip and the selector is communicated;
acquiring fourth interface information through the second main control chip and responding, and cutting off signal connection between the second main control chip and the selector, wherein a link between the I2C equipment and the second operating system is in a disconnection state under the condition that the signal connection between the second main control chip and the selector is cut off; control of the I2C device is transferred from a second operating system to the first operating system.
According to a second aspect of the present application, there is provided an I2C device control apparatus, the apparatus being applied to an electronic device, the electronic device including a first body and a second body, the first body being detachably connected to the second body, the first body being capable of running a first operating system, the second body being capable of running a second operating system; the I2C device of the electronic device is positioned on the second body; the device comprises:
The first control unit is used for controlling a link between the I2C equipment and the first operating system to be in a disconnected state when the first body and the second body are in a detached state, and the I2C equipment is disabled by the first operating system in the detached state;
and the second control unit is used for controlling the link between the I2C equipment and the first operating system to be switched from the disconnection state to the connection state under the condition that the first body and the second body are changed from the disconnection state to the connection state, and the I2C equipment is started by the first operating system under the condition that the first body and the second body are changed from the disconnection state to the connection state.
According to a third aspect of the present application, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described herein.
According to a fourth aspect of the present application, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method described herein.
In this application, when first body and second body are the dismantlement state and first body and second body become connected state from the dismantlement state, through the link state between control I2C equipment and the first operating system, realized the control to I2C equipment, avoided I2C equipment unable by normal control and lead to the unable problem that normally used of electronic equipment.
It should be understood that the description of this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings, in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Fig. 1 shows a schematic implementation flow chart of a control method of an I2C device according to an embodiment of the present application;
fig. 2 is a schematic diagram showing a hardware composition structure of a first body and a second body according to an embodiment of the present application;
Fig. 3 is an application schematic diagram of an I2C device control method when the first body and the second body in the embodiment of the present application are in a detached state;
fig. 4 is an application schematic diagram of an I2C device control method when the first body and the second body are in a connection state after detachment in the embodiment of the present application;
fig. 5 shows an application schematic diagram of an I2C device control method when a first body and a second body are in a connection state and a first operating system has control rights of the I2C device in the embodiment of the present application;
fig. 6 shows an application schematic diagram of an I2C device control method when a first body and a second body are in a connection state and a second operating system has control rights of the I2C device in the embodiment of the present application;
fig. 7 is a schematic diagram showing the composition and structure of a control device of an I2C apparatus according to an embodiment of the present application;
fig. 8 shows a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, features and advantages of the present application more obvious and understandable, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The embodiment of the application provides an I2C device control method, which can realize normal control of I2C devices so as to avoid the problem that the electronic devices cannot be used normally because the I2C devices cannot be controlled normally.
The following describes in detail the I2C device control method in the embodiment of the present application.
The electronic device in the embodiment of the application has the following modes: the electronic device includes two bodies: a first body and a second body. The first body and the second body are detachably connected. The first body is capable of running a first operating system, and the second body is capable of running a second operating system. The I2C device is located on the second body.
The I2C device control method is applied to the electronic device with the mode. As shown in fig. 1, the method includes:
s101: and under the condition that the first body and the second body are in a detached state, controlling a link between the I2C equipment and the first operating system to be in a disconnected state, wherein the I2C equipment is forbidden by the first operating system in the detached state.
In this application, taking an electronic device as a notebook computer as an example, the notebook computer includes two bodies: the screen body and the keyboard body. The two bodies are detachably connected, and each body runs a respective operating system. The operating systems running by the two bodies can be the same operating system or different operating systems. Preferably a different operating system.
The I2C equipment of the notebook computer comprises a touch screen, a touch pad, a sensor and the like. When the body of the screen of the notebook computer and the body of the keyboard are in a disassembly state, the body of the screen has an own operating system, so that the notebook computer can be independently used as a flat plate. The body where the keyboard is located can be externally connected with a display screen to be used as a notebook computer independently. When the body where the screen of the notebook computer is positioned and the body where the keyboard is positioned are changed from the disassembled state to the connected state, the two can be used as a complete notebook computer. When the connection state of the body where the screen of the notebook computer is positioned and the body where the keyboard is positioned is changed, the control right of the I2C equipment is also changed.
It can be understood that when the body where the screen of the notebook computer is located and the body where the keyboard is located are in a disassembled state or a state where the body is connected after being disassembled, the phenomenon is called hot plug phenomenon, and heat exchange occurs in the hot plug process. While some operating systems, such as Windows operating systems, do not support such hot plug or hot swap, normal control of an I2C device that is shared by two ontologies cannot be achieved. If the USB interface is used to replace the I2C interface, the problem that the I2C equipment cannot be controlled normally can be solved, but the cost is high because a bridge for converting the USB interface into the I2C interface is additionally used.
In this step, the I2C device is a device located on the second body, and the second body is capable of running the second operating system. When the first body and the second body are in a disassembly state, a link between the I2C device and the first operating system is in a disconnection state, the I2C device is disabled by the first operating system in the disassembly state, and the control right of the I2C device belongs to the second operating system.
Taking an electronic device as an example of a notebook computer, when the I2C device is a touch screen (the screen of the notebook computer is a touch screen), the second body is the body where the screen of the notebook computer is located because the I2C device is located on the second body. When the body of the notebook computer where the screen is (used as the second body) and the body of the keyboard is (used as the first body) are in a disassembly state, as the body of the notebook computer where the screen is and the body of the keyboard are in a separation state, a link between the touch screen and a first operating system operated by the body of the keyboard is in a disconnection state, at the moment, the touch screen is set to be disabled by the first operating system, and a second operating system operated by the body of the notebook computer has control right on the touch screen.
When the I2C device is a touch pad (for implementing a mouse function), the I2C device is located on the second body, and the second body is the body where the keyboard of the notebook computer is located. When the body (used as the second body) of the keyboard of the notebook computer and the body (used as the first body) of the screen are in a disassembly state, the link between the touch pad and the first operating system operated by the body of the screen is in a disconnection state because the body of the keyboard and the body of the screen are in a separation state, at this time, the touch pad is set to be disabled by the first operating system, and the second operating system operated by the body of the keyboard of the notebook computer has control right on the touch pad.
S102: and under the condition that the first body and the second body are changed from the detaching state to the connecting state, controlling the link between the I2C equipment and the first operating system to be switched from the disconnecting state to the connecting state, wherein the I2C equipment is started by the first operating system under the condition that the detaching state is changed to the connecting state.
In this step, taking the electronic device as a notebook computer and the I2C device as a touch screen as an example, when the body where the screen of the notebook computer is located and the body where the keyboard is located are in a state of being connected after being detached, at this time, a link between the touch screen and a first operating system running on the body where the keyboard is located is switched from a disconnected state to a connected state by default, and the first operating system has control right on the touch screen.
In the scheme shown in S101 to S102, when the first body and the second body are in a detached state and the first body and the second body are changed from the detached state to a connected state, the I2C device is controlled by controlling the link state between the I2C device and the first operating system, so that the problem that the I2C device cannot be controlled normally and the electronic device cannot be used normally is avoided. In addition, the normal control of the I2C equipment can be realized without additionally using a bridge for converting USB into I2C, so that the cost is saved, and the low-cost control of the I2C equipment is realized.
In an alternative, the method further comprises:
and under the condition that the first body and the second body are in a connection state and one of the first operating system and the second operating system has the control right of the I2C device, responding to the detected switching operation, and switching a link between the I2C device and the other of the first operating system and the second operating system from a disconnection state to a connection state so as to transfer the control right of the I2C device from the one of the systems to the other system.
In this application, the phenomenon of heat exchange occurs also when the first body and the second body are in a connected state, and one of the first operating system and the second operating system has control authority over the I2C device. That is, when responding to the detected switching operation, a heat exchange phenomenon occurs during the switching. Specifically, the detected switching operation may be detecting whether to trigger a switching shortcut key, and if the switching shortcut key is triggered, switching a link between an operating system, which does not have control right of the I2C device, and the I2C device from a disconnected state to a connected state in response to the detected switching operation. Control of the I2C device is switched from the first operating system to the second operating system or from the second operating system to the first operating system.
In the method, the link state between the operating system and the I2C equipment is controlled by responding to the switching operation, the control right of the I2C equipment is switched between the two operating systems, the normal control of the I2C equipment can be realized without an additional bridge or other components, the cost is greatly saved, and the low-cost control of the I2C equipment is realized.
In an alternative scheme, the first body comprises a first main control chip and an embedded control chip; the second body comprises a second main control chip and a selector; the first main control chip is used for running a first operating system and a Basic Input Output System (BIOS), and the second main control chip is used for running a second operating system; an output end of the first main control chip is connected with a first input end of the selector, and an output end of the second main control chip is connected with a second input end of the selector; the output end of the selector is connected with I2C equipment; the selector is used for controlling a link between the first operating system or the second operating system and the I2C device to be in a communication state.
In this application, as shown in fig. 2, the first body includes a first main control chip and an embedded chip, the second body includes a second main control chip and a selector, the first main control chip and the second main control chip are respectively connected with a first input end and a second input end of the selector, the first main control chip is used for running a first operating system and a basic input output system BIOS, and the second main control chip is used for running a second operating system. The output end of the selector is connected with I2C equipment and is used for controlling a link between the first operating system or the second operating system and the I2C equipment to be in a communication state. The resistor in fig. 2 is used for detecting a high-low level signal, and one end of the embedded chip is connected with one end of the second main control chip and used for transmitting system state information.
The first main control Chip and the second main control Chip are preferably two different main control chips, which can be an X86 CPU (Central Processing Unit ) Chip or an ARM (Advanced RISC Machine, advanced reduced instruction set machine) SOC (System on Chip) Chip. When the first/second main control chip is an X86 CPU chip, the first/second operating system which is correspondingly operated is a windows system. When the first/second main control chip is an ARM SOC chip, the first/second operating system which is correspondingly operated is an android system or a linux system. The selector may be a 2-to-1 multiplexer as shown in fig. 2, or a 1-to-1 single-channel selector (the first main control chip and the second main control chip are respectively connected to the respective single-channel selectors, and the link states between the first operating system and the I2C device and the second operating system are controlled by controlling the on and off of the corresponding single-channel selector).
In the application, normal control of the I2C equipment can be realized through connection of chips or devices inside the two main bodies on a hardware level, the hardware architecture is simple, development is simpler, and low-cost control of the I2C equipment can be realized.
In an optional solution, in a case where the first body and the second body are in a detached state, controlling the link between the I2C device and the first operating system to be in a disconnected state includes:
when the first body and the second body are in a disassembly state, acquiring first level information by the embedded control chip and responding to the first level information to generate first event information;
and the BIOS of the basic input/output system running on the first main control chip responds to the first event information, and cuts off the signal connection between the first main control chip and the selector, wherein the link between the I2C equipment and the first operating system is in a disconnection state under the condition that the signal connection between the first main control chip and the selector is cut off.
In the application, taking the I2C device as an example of a touch screen of a notebook computer, the first body is a body where the keyboard is located, and the second body is a body where the screen is located. Specifically, as shown in fig. 2 and fig. 3, when the first body and the second body are in a detached state, the second main control chip is an ARM SOC chip, the second operating system is an android system, the first main control chip is an X86 CPU chip, the first operating system is a windows system, and the embedded control chip obtains first level information through DET (detector) signals, and in general, when the body where the keyboard is located (first body) and the body where the screen is located (second body) are in a detached state, a low level signal (first level information) is generated, and the embedded control chip responds after obtaining the low level signal to generate detachment event information (i.e., first event information). The embedded control chip sends the first event information to the BIOS to respond, and the BIOS cuts off the signal connection between the X86 CPU chip (the first main control chip) and the selector. Specifically, the BIOS sets the state of the touch screen to disable (off), and at this time, the link between the touch screen and the windows system (first operating system) is in an off state when the signal connection between the X86 CPU chip (first main control chip) and the selector is cut off, and the windows system (first operating system) does not control the touch screen. Meanwhile, in order to achieve the purpose of power saving, after the BIOS sets the state of the touch screen to disable (closed), the embedded control chip receives a notification of completion of the BIOS setting, and generally sends out a sleep event message to enable the windows system (first operating system) to enter a sleep state. That is, the first operating system does not control the touch screen at this time.
In the method, through physical and logical connection of each hardware in the first body, signal connection between the first main control chip and the selector can be cut off, and when the first body and the second body are in a disassembly state, a link between the I2C equipment and the first operating system is controlled to be in a disconnection state, so that the control right of the I2C equipment can be removed from the first operating system without extra cost, and the second operating system can obtain the control right of the I2C equipment.
In an alternative, the method further comprises:
and the second main control chip acquires second level information and responds to the second level information to control the link between the I2C equipment and the second operating system to be in a communication state, and the I2C equipment is started by the second operating system in the disassembly state.
In the application, taking the I2C device as an example of a touch screen of a notebook computer, the first body is a body where the keyboard is located, and the second body is a body where the screen is located. In the disassembled state, when the link between the control touch screen and the first operating system is in the disconnected state, the second main control chip (the ARM SOC chip) also acquires a corresponding low-level signal (second level information) to respond. Specifically, the second main control chip controls the selector to connect the signals between the second main control chip and the selector to be in a communication state, so that the control right of the touch screen is enabled by the second operating system (such as the android system).
In the application, through the physical and logical connection of the hardware in the first body and the second body, the control right of the touch screen can be given to the second operating system while the link between the I2C device and the first operating system is in a disconnected state. The method does not need extra cost, is easy to develop and can realize low-cost control of the I2C equipment.
In an optional solution, in a case that the first body and the second body change from the detached state to the connected state, controlling the link between the I2C device and the first operating system to be switched from the disconnected state to the connected state includes:
when the first body and the second body are changed from the detaching state to the connecting state, the embedded control chip acquires third level information and responds to the third level information to generate second event information;
and the BIOS of the basic input/output system running on the first main control chip responds to the second event information, and is communicated with the signal connection between the first main control chip and the selector, and the link between the I2C equipment and the first operating system is switched from the disconnection state to the connection state under the condition that the signal connection between the first control chip and the selector is communicated.
In the application, taking the I2C device as an example of a touch screen of a notebook computer, the first body is a body where the keyboard is located, and the second body is a body where the screen is located. Specifically, as shown in fig. 2 and fig. 4, when the first body and the second body change from the detached state to the connected state, the embedded control chip acquires the third level information through the DET signal, and in general, when the first body and the second body change from the detached state to the connected state, a high level signal (i.e., the third level information) is generated, and after acquiring the high level signal, the embedded control chip responds to generate a connection event information (i.e., the second event information). The embedded control chip sends the second event information to the BIOS for response, and the BIOS is communicated with the signal connection between the first main control chip and the selector. Specifically, the BIOS sets the state of the touch screen to enable (on), and at this time, the link between the touch screen and the first operating system is switched from the off state to the on state under the condition that the signal connection between the first main control chip and the selector is connected.
The link between the touch screen and the first operating system is controlled to be in a communication state, the second main control chip also obtains a corresponding high-level signal (marked as fourth-level information) to respond, specifically, the second main control chip controls the selector to connect the signal between the second main control chip and the selector to be in a disconnection state, the embedded control chip receives a notice of completion of setting of the second main control chip and sends a wake-up event message to wake up the first operating system from a sleep state. At this time, the control right of the touch screen is enabled by the first operating system. That is, the first operating system has control over the touch screen again.
In the application, through the physical and logical connection of the hardware in the first body and the second body, when the link between the I2C device and the first operating system is in a connected state, the control right of the touch screen can be given to the first operating system. The method does not need extra cost, is easy to develop and can realize low-cost control of the I2C equipment.
In an alternative, the method includes:
under the condition that the first body and the second body are in a connection state and the first operating system has the control right of the I2C equipment, acquiring first interface information by an embedded control chip;
Based on the first interface information, a basic input/output system (BIOS) running on a first main control chip cuts off signal connection between the first main control chip and a selector, and a link between the I2C equipment and a first operating system is in a disconnection state under the condition that the signal connection between the first control chip and the selector is cut off;
the second main control chip acquires second interface information and responds to the second interface information, the signal connection between the second main control chip and the selector is communicated, and the link between the I2C equipment and the second operating system is in a communication state under the condition that the signal connection between the second main control chip and the selector is communicated; control of the I2C device is transferred from a first operating system to the second operating system.
In the application, taking the I2C device as an example of a touch screen of a notebook computer, the first body is a body where the keyboard is located, and the second body is a body where the screen is located. Specifically, as shown in fig. 2 and fig. 5, when the first body and the second body are in a connection state and the first operating system has the control right of the touch screen, the embedded control chip obtains the first interface information through a GPIO (General-purpose input/output) interface. In general, when the shortcut key is triggered, an interface information is generated, and after the embedded control chip acquires the interface information, the embedded control chip notifies the BIOS to respond, and after the BIOS receives the interface information, the signal connection between the first main control chip and the selector is cut off. Specifically, the BIOS sets the state of the touch screen to disable (close), and at this time, the link between the touch screen and the first operating system is in a disconnected state under the condition that the signal connection between the first main control chip and the selector is cut off. In order to achieve the purpose of power saving, after the BIOS sets the state of the touch screen to disable (closed), the embedded control chip receives a notification of completion of the BIOS setting, and generally sends a sleep event message to enable the first operating system to enter a sleep state.
Meanwhile, when the link between the touch screen and the first operating system is controlled to be in a disconnected state, the embedded control chip sends second interface information to the second main control chip, the second main control chip responds to the second interface information, and specifically, the second main control chip controls the selector to connect signals between the second main control chip and the selector to be in a connected state, and at the moment, the control right of the touch screen is transferred from the first operating system to the second operating system.
In the application, through the physical and logical connection of each hardware in the first body and the second body, the signal connection between the first main control chip and the selector can be cut off, and the signal connection between the second main control chip and the selector is controlled to be in a communication state by utilizing the second main control chip. The method is easy to develop, and can realize the transfer of the control right of the I2C equipment from the first operating system to the second operating system.
In an alternative, the method includes:
under the condition that the first body and the second body are in a connection state and the second operating system has the control right of the I2C equipment, acquiring third interface information by an embedded control chip;
based on the third interface information, a Basic Input Output System (BIOS) running on a first main control chip is communicated with signal connection between the first main control chip and a selector, and a link between the I2C equipment and a first operating system is in a communication state under the condition that the signal connection between the first main control chip and the selector is communicated;
Acquiring fourth interface information through the second main control chip and responding, and cutting off signal connection between the second main control chip and the selector, wherein a link between the I2C equipment and the second operating system is in a disconnection state under the condition that the signal connection between the second main control chip and the selector is cut off; control of the I2C device is transferred from a second operating system to the first operating system.
In the application, taking the I2C device as an example of a touch screen of a notebook computer, the first body is a body where the keyboard is located, and the second body is a body where the screen is located. Specifically, as shown in fig. 2 and fig. 6, when the first body and the second body are in a connection state and the second operating system has the control right of the touch screen, the embedded control chip obtains the third interface information through the GPIO interface. In general, when the shortcut key is triggered, an interface information is generated, and after the embedded control chip acquires the interface information, the embedded control chip notifies the BIOS to respond, and the BIOS communicates the signal connection between the first main control chip and the selector after receiving the interface information. Specifically, the BIOS sets the state of the touch screen to enable (on), and at this time, the link between the touch screen and the first operating system is in a connected state under the condition that the signal connection between the first main control chip and the selector is connected. The embedded control chip sends out a wake-up event message to wake up the first operating system from the sleep state.
Aiming at the condition that a link between the control touch screen and the first operating system is in a communication state, the embedded control chip sends fourth interface information to the second main control chip, and the second main control chip responds to the fourth interface information. Specifically, the second main control chip controls the selector to connect signals between the second main control chip and the selector to be in a disconnected state, and at the moment, the control right of the touch screen is transferred from the second operating system to the first operating system.
In the application, through the physical and logical connection of each hardware in the first body and the second body, the signal connection between the first main control chip and the selector can be communicated, and the signal connection between the second main control chip and the selector is in a disconnection state by utilizing the second main control chip to control the selector. The method is easy to develop, and can realize the transfer of the control right of the I2C equipment from the second operating system to the first operating system.
The embodiment of the application provides an I2C device control device, which is applied to electronic equipment, wherein the electronic equipment comprises a first body and a second body, the first body is detachably connected with the second body, the first body can run a first operating system, and the second body can run a second operating system; the I2C device of the electronic device is positioned on the second body; as shown in fig. 7, the apparatus includes:
A first control unit 701, configured to control, in a case where the first body and the second body are in a detached state, a link between the I2C device and the first operating system to be in a disconnected state, where the I2C device is disabled by the first operating system in the detached state;
and a second control unit 702, configured to control, when the first body and the second body change from a detached state to a connected state, a link between the I2C device and the first operating system to be switched from a disconnected state to a connected state, where the I2C device is enabled by the first operating system when the detached state changes to the connected state.
In an alternative, the apparatus further comprises: and a switching unit configured to switch, in response to the detected switching operation, a link between the I2C device and the other of the first operating system and the second operating system from a disconnected state to a connected state, so that the control right of the I2C device is transferred from the one of the first operating system and the second operating system to the other system, in a case where the first body and the second body are in a connected state and the one of the first operating system and the second operating system has the control right of the I2C device.
In an alternative scheme, the first body comprises a first main control chip and an embedded control chip; the second body comprises a second main control chip and a selector; the first main control chip is used for running a first operating system and a Basic Input Output System (BIOS), and the second main control chip is used for running a second operating system; an output end of the first main control chip is connected with a first input end of the selector, and an output end of the second main control chip is connected with a second input end of the selector; the output end of the selector is connected with I2C equipment; the selector is used for controlling a link between the first operating system or the second operating system and the I2C device to be in a communication state.
In an alternative solution, the first control unit 701 is configured to obtain, when the first body and the second body are in a detached state, first level information by using an embedded control chip and generate first event information in response to the first level information; and the BIOS of the basic input/output system running on the first main control chip responds to the first event information, and cuts off the signal connection between the first main control chip and the selector, wherein the link between the I2C equipment and the first operating system is in a disconnection state under the condition that the signal connection between the first main control chip and the selector is cut off.
In an optional solution, the first control unit 701 is configured to obtain second level information from a second main control chip and respond to the second level information, and control a link between the I2C device and a second operating system to be in a connected state, where the I2C device is enabled by the second operating system in the detached state.
In an alternative solution, the second control unit 702 is configured to obtain, by the embedded control chip, the third level information and generate the second event information in response to the first body and the second body changing from the detached state to the connected state; and the BIOS of the basic input/output system running on the first main control chip responds to the second event information, and is communicated with the signal connection between the first main control chip and the selector, and the link between the I2C equipment and the first operating system is switched from the disconnection state to the connection state under the condition that the signal connection between the first control chip and the selector is communicated.
In an optional solution, the switching unit is configured to obtain, by using an embedded control chip, first interface information when the first body and the second body are in a connection state and the first operating system has control rights of the I2C device; based on the first interface information, a basic input/output system (BIOS) running on a first main control chip cuts off signal connection between the first main control chip and a selector, and a link between the I2C equipment and a first operating system is in a disconnection state under the condition that the signal connection between the first control chip and the selector is cut off; the second main control chip acquires second interface information and responds to the second interface information, the signal connection between the second main control chip and the selector is communicated, and the link between the I2C equipment and the second operating system is in a communication state under the condition that the signal connection between the second main control chip and the selector is communicated; control of the I2C device is transferred from a first operating system to the second operating system.
In an optional solution, the switching unit is configured to obtain, by using an embedded control chip, third interface information when the first body and the second body are in a connection state and the second operating system has control rights of the I2C device; based on the third interface information, a Basic Input Output System (BIOS) running on a first main control chip is communicated with signal connection between the first main control chip and a selector, and a link between the I2C equipment and a first operating system is in a communication state under the condition that the signal connection between the first main control chip and the selector is communicated; acquiring fourth interface information through the second main control chip and responding, and cutting off signal connection between the second main control chip and the selector, wherein a link between the I2C equipment and the second operating system is in a disconnection state under the condition that the signal connection between the second main control chip and the selector is cut off; control of the I2C device is transferred from a second operating system to the first operating system.
It should be noted that, because the principle of the device for solving the problem is similar to that of the foregoing I2C device control method, the implementation process, implementation principle and beneficial effect of the device can be described with reference to the implementation process, implementation principle and beneficial effect of the foregoing method, and the repetition is omitted.
According to embodiments of the present application, an electronic device and a readable storage medium are also provided.
Fig. 8 shows a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 8, the electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM802, and the RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
Various components in electronic device 800 are connected to I/O interface 805, including: an input unit 806 such as a keyboard, mouse, etc.; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, or the like. The communication unit 809 allows the electronic device 800 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 801 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the respective methods and processes described above, such as the I2C device control method. For example, in some embodiments, the I2C device control method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 800 via the ROM802 and/or the communication unit 809. When a computer program is loaded into RAM803 and executed by computing unit 801, one or more steps of the I2C device control method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the I2C device control method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems-on-a-chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. The integrated circuit bus I2C equipment control method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a first body and a second body, the first body is detachably connected with the second body, the first body can run a first operating system, and the second body can run a second operating system; the I2C device is positioned on the second body; the method comprises the following steps:
controlling a link between the I2C device and a first operating system to be in a disconnected state under the condition that the first body and the second body are in a detached state, wherein the I2C device is disabled by the first operating system in the detached state;
and under the condition that the first body and the second body are changed from the detaching state to the connecting state, controlling the link between the I2C equipment and the first operating system to be switched from the disconnecting state to the connecting state, wherein the I2C equipment is started by the first operating system under the condition that the detaching state is changed to the connecting state.
2. The method according to claim 1, wherein the method further comprises:
and under the condition that the first body and the second body are in a connection state and one of the first operating system and the second operating system has the control right of the I2C device, responding to the detected switching operation, and switching a link between the I2C device and the other of the first operating system and the second operating system from a disconnection state to a connection state so as to transfer the control right of the I2C device from the one of the systems to the other system.
3. The method of claim 1 or 2, wherein the first body comprises a first master control chip and an embedded control chip; the second body comprises a second main control chip and a selector; the first main control chip is used for running a first operating system and a Basic Input Output System (BIOS), and the second main control chip is used for running a second operating system; an output end of the first main control chip is connected with a first input end of the selector, and an output end of the second main control chip is connected with a second input end of the selector; the output end of the selector is connected with I2C equipment; the selector is used for controlling a link between the first operating system or the second operating system and the I2C device to be in a communication state.
4. The method of claim 3, wherein controlling the link between the I2C device and the first operating system to be in a disconnected state with the first and second bodies in a detached state comprises:
when the first body and the second body are in a disassembly state, acquiring first level information by the embedded control chip and responding to the first level information to generate first event information;
and the BIOS of the basic input/output system running on the first main control chip responds to the first event information, and cuts off the signal connection between the first main control chip and the selector, wherein the link between the I2C equipment and the first operating system is in a disconnection state under the condition that the signal connection between the first main control chip and the selector is cut off.
5. The method as recited in claim 4, further comprising:
and the second main control chip acquires second level information and responds to the second level information to control the link between the I2C equipment and the second operating system to be in a communication state, and the I2C equipment is started by the second operating system in the disassembly state.
6. A method according to claim 3, wherein controlling the link between the I2C device and the first operating system to switch from the disconnected state to the connected state in the case where the first body and the second body change from the disconnected state to the connected state comprises:
when the first body and the second body are changed from the detaching state to the connecting state, the embedded control chip acquires third level information and responds to the third level information to generate second event information;
and the BIOS of the basic input/output system running on the first main control chip responds to the second event information, and is communicated with the signal connection between the first main control chip and the selector, and the link between the I2C equipment and the first operating system is switched from the disconnection state to the connection state under the condition that the signal connection between the first control chip and the selector is communicated.
7. A method according to claim 3, comprising:
Under the condition that the first body and the second body are in a connection state and the first operating system has the control right of the I2C equipment, acquiring first interface information by an embedded control chip;
based on the first interface information, a basic input/output system (BIOS) running on a first main control chip cuts off signal connection between the first main control chip and a selector, and a link between the I2C equipment and a first operating system is in a disconnection state under the condition that the signal connection between the first control chip and the selector is cut off;
the second main control chip acquires second interface information and responds to the second interface information, the signal connection between the second main control chip and the selector is communicated, and the link between the I2C equipment and the second operating system is in a communication state under the condition that the signal connection between the second main control chip and the selector is communicated; control of the I2C device is transferred from a first operating system to the second operating system.
8. The method according to claim 7, comprising:
under the condition that the first body and the second body are in a connection state and the second operating system has the control right of the I2C equipment, acquiring third interface information by an embedded control chip;
Based on the third interface information, a Basic Input Output System (BIOS) running on a first main control chip is communicated with signal connection between the first main control chip and a selector, and a link between the I2C equipment and a first operating system is in a communication state under the condition that the signal connection between the first main control chip and the selector is communicated;
acquiring fourth interface information through the second main control chip and responding, and cutting off signal connection between the second main control chip and the selector, wherein a link between the I2C equipment and the second operating system is in a disconnection state under the condition that the signal connection between the second main control chip and the selector is cut off; control of the I2C device is transferred from a second operating system to the first operating system.
9. An integrated circuit bus I2C device control apparatus, wherein the apparatus is applied to an electronic device, the electronic device includes a first body and a second body, the first body is detachably connected with the second body, the first body is capable of running a first operating system, and the second body is capable of running a second operating system; the I2C device of the electronic device is positioned on the second body; the device comprises:
The first control unit is used for controlling a link between the I2C equipment and the first operating system to be in a disconnected state when the first body and the second body are in a detached state, and the I2C equipment is disabled by the first operating system in the detached state;
and the second control unit is used for controlling the link between the I2C equipment and the first operating system to be switched from the disconnection state to the connection state under the condition that the first body and the second body are changed from the disconnection state to the connection state, and the I2C equipment is started by the first operating system under the condition that the first body and the second body are changed from the disconnection state to the connection state.
10. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
11. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-8.
CN202311474166.2A 2023-11-03 2023-11-03 I2C device control method and device, electronic device and storage medium Pending CN117762832A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311474166.2A CN117762832A (en) 2023-11-03 2023-11-03 I2C device control method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311474166.2A CN117762832A (en) 2023-11-03 2023-11-03 I2C device control method and device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN117762832A true CN117762832A (en) 2024-03-26

Family

ID=90324309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311474166.2A Pending CN117762832A (en) 2023-11-03 2023-11-03 I2C device control method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN117762832A (en)

Similar Documents

Publication Publication Date Title
CN102789305B (en) Postponing suspend
US20190220340A1 (en) System and method for remote system recovery
CN103229156A (en) Auto-configuration of a docked system in a multi-OS environment
CN103999066A (en) Automatic downstream to upstream mode switching at a universal serial bus physical layer
CN116257472B (en) Interface control method, device, electronic equipment and storage medium
CN109743105A (en) Intelligent network adapter optical mode block management method, device, system and intelligent network adapter and medium
CN106557362B (en) Task migration method and system applied to intelligent robot
US10419227B2 (en) Network card
CN116467100B (en) Data processing method, device, electronic equipment and storage medium
CN117762832A (en) I2C device control method and device, electronic device and storage medium
WO2023155363A1 (en) Server dynamic hot backup method, apparatus and device, and storage medium
JP6698722B2 (en) Embedded controller chips, systems and devices
CN114461142B (en) Method, system, device and medium for reading and writing Flash data
CN115509333A (en) Server collaborative power-on and power-off device, method, system and medium
CN114281389A (en) Method and device for upgrading SOC (system on chip) and automatic driving vehicle
CN111953720A (en) Electronic device and electronic device remote control system
CN114153388B (en) Hard disk system, hard disk configuration information refreshing method, device and medium
CN114443439B (en) ARM server-based control method, ARM server-based control device, ARM server-based control equipment and storage medium
US11989567B2 (en) Automatic systems devices rediscovery
CN115952004B (en) Resource allocation method, device, electronic equipment and storage medium
US11630732B2 (en) Method of updating firmware of chip stably and effectively, firmware updating apparatus, and computer readable storage medium applying method
CN110362349B (en) Virtual input management device and management method thereof
CN116302754A (en) Solid state disk detection method, system, device and storage medium
CN116679963A (en) Firmware updating method, device and control method
CN117290267A (en) Method and device for closing and starting system, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination