CN115562464A - Method for controlling activation mode of electronic device, and storage medium - Google Patents

Method for controlling activation mode of electronic device, and storage medium Download PDF

Info

Publication number
CN115562464A
CN115562464A CN202210134595.4A CN202210134595A CN115562464A CN 115562464 A CN115562464 A CN 115562464A CN 202210134595 A CN202210134595 A CN 202210134595A CN 115562464 A CN115562464 A CN 115562464A
Authority
CN
China
Prior art keywords
sensor
value
stylus
control chip
chip
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.)
Granted
Application number
CN202210134595.4A
Other languages
Chinese (zh)
Other versions
CN115562464B (en
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210134595.4A priority Critical patent/CN115562464B/en
Publication of CN115562464A publication Critical patent/CN115562464A/en
Application granted granted Critical
Publication of CN115562464B publication Critical patent/CN115562464B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03545Pens or stylus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Power Sources (AREA)

Abstract

The application provides a control method of an activation mode of an electronic device, the electronic device and a computer readable storage medium. The electronic equipment comprises a sensor chip and a control chip which are in communication connection, and the control method comprises the following steps: the sensor chip determines that the electronic equipment is in a user use state, and determines a signal state value stored in the electronic equipment as a reset value; the sensor chip sends an interrupt signal to the control chip and changes the signal state value of the electronic equipment from a reset value to a set value; the control chip responds to at least one interrupt signal received within the first time period and controls the electronic equipment to be in an activation mode; and the control chip periodically changes the signal state value from the set value to the reset value by taking the second duration as a period, wherein the first duration is longer than the second duration. The method and the device can ensure that the signal state value is immediately reset, thereby ensuring the smoothness of an interrupt signal sending channel.

Description

Method for controlling activation mode of electronic device, and storage medium
Technical Field
The present application relates to the field of electronic devices, and in particular, to a method for controlling an activation mode of an electronic device, and a computer-readable storage medium.
Background
Electronic devices, such as a stylus, may employ certain low power designs. For example, when the device is in a user use state, the device may be activated; when the device is in an idle state, the device automatically enters a sleep mode to save power consumption.
Specifically, the device determines the current state by a built-in sensor chip. When the sensor chip judges that the current state is the user use state, an interrupt signal is sent to a main control chip of the equipment; and when the sensor chip judges that the current state is the idle state, the interrupt signal is not sent to the main control chip. Correspondingly, after the main control chip receives the interrupt signal, the control device is in an activation mode so as to meet the use requirement of a user; when the main control chip does not receive the interrupt signal for a long time, the control device performs a sleep mode to save the power consumption of the device.
However, the sensor chip sometimes has an abnormality in transmission of the interrupt signal. That is, when the device is in a user use state, the sensor chip cannot immediately send an interrupt signal to the main control chip. At this time, the main control chip may misunderstand that the device is being idle, thereby controlling the device to enter a sleep mode. Therefore, the equipment does not respond to the user operation, and the user experience is influenced.
Disclosure of Invention
The present application provides a method for controlling an activation mode of an electronic device, and a computer-readable storage medium, which are described below in various aspects, and embodiments and advantageous effects of the following aspects are mutually referenced.
In a first aspect, an embodiment of the present application provides a method for controlling an activation mode of an electronic device, where the electronic device includes a sensor chip and a control chip that are communicatively connected, and the method includes: the sensor chip determines that the electronic equipment is in a user use state, and determines that a signal state value stored in the electronic equipment is a reset value; the sensor chip sends an interrupt signal to the control chip and executes a first operation, wherein the first operation is used for changing the state value of the electronic equipment from a reset value to a set value; the control chip responds to at least one interrupt signal received within the first time period and controls the electronic equipment to be in an activation mode; and the control chip responds to the interrupt signal and executes a second operation, and the second operation is used for writing the state value into a reset value; and the control chip periodically executes a second operation by taking a second duration as a period, wherein the first duration is greater than the second duration.
According to the embodiment of the application, the control chip actively resets the signal state value in the electronic device every second time. Thus, the signal state value can be ensured to be reset immediately so as to ensure the smoothness of an interrupt signal sending channel.
In some embodiments, the method further comprises: the control chip controls the electronic equipment to be in the sleep mode based on that the interrupt signal is not received within the first time length.
According to the embodiment of the present application, the first duration may be regarded as a sleep time threshold. In the sleep time threshold, the control chip actively resets the signal state value at least once to ensure that the electronic equipment cannot enter the sleep mode by mistake due to the blockage of the interrupt signal.
In some embodiments, the first duration is greater than 3 times the second duration.
According to the embodiment of the application, within the sleep time threshold, the control chip executes active reset for a plurality of times on the signal state value so as to ensure that the signal state value is reset in time.
In some embodiments, when the electronic device is in the active mode, the first length of time is a first value; when the electronic equipment is in the sleep mode, the first duration is a second value; wherein the second value is more than 3 times of the first value.
In some embodiments, the first time period is 2.5 to 3.5min; the first value is 5-20 s, and the second value is 0.5-1.5 min.
In some embodiments, the sensor chip determining that the electronic device is in a user use state includes: the method comprises the steps that a sensor chip obtains sensor data collected by a state sensor of the electronic equipment, and the duration of the collection period of the sensor data is a third duration; the sensor chip determines that the electronic equipment is in a user use state according to the sensor data; wherein the second duration is more than 100 times the third duration.
According to the embodiment of the application, the period of the control chip for actively resetting the signal state value is far longer than the period of the passive reset, so that the control chip can reset the signal state value in time and hardly increase the burden of a memory of the signal state value.
In some embodiments, the third time period is 1 to 5ms.
In some embodiments, the status sensor is a motion sensor, a temperature sensor, or an image sensor; and/or the status sensor is integrated in the sensor chip.
In some embodiments, the signal state value is stored in a register of the sensor chip.
In some implementations, the electronic device is a stylus.
In a second aspect, an embodiment of the present application provides an electronic device, including: a memory to store instructions for execution by one or more processors of an electronic device; the processor, when executing the instructions in the memory, may cause the electronic device to perform the audio processing method provided in any embodiment of the first aspect of the present application. The beneficial effects that can be achieved by the second aspect can refer to the beneficial effects of any implementation manner of the first aspect of the present application, and are not described herein again.
In a third aspect, the present application provides a computer-readable storage medium, on which instructions are stored, and when executed on a computer, the instructions cause the computer to execute the audio processing method provided in any one of the embodiments of the first aspect of the present application. The beneficial effects that can be achieved by the third aspect can refer to the beneficial effects of any one of the embodiments of the first aspect of the present application, and are not described herein again.
Drawings
FIG. 1 illustrates an exemplary application scenario of an embodiment of the present application;
fig. 2 shows a schematic structural diagram of a stylus provided in an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a circuit structure of a stylus provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of an acceleration sensor provided in an embodiment of the present application;
fig. 5 is a flowchart illustrating a method for sending an interrupt signal according to an embodiment of the present application;
FIG. 6a is a schematic diagram illustrating an idle state of a stylus according to an embodiment of the present disclosure;
FIG. 6b is a schematic diagram illustrating a user usage status of a stylus provided in an embodiment of the present application;
fig. 7 illustrates an exemplary flowchart of an activation state control method provided in an embodiment of the present application;
fig. 8 is a flowchart illustrating an exemplary method for determining an interrupt signal sending condition according to an embodiment of the present application;
fig. 9 is an exemplary flowchart illustrating a method for determining an interrupt signal receiving condition according to an embodiment of the present application;
FIG. 10 is a block diagram of an electronic device provided by an embodiment of the application;
fig. 11 shows a schematic structural diagram of a System On Chip (SOC) provided in an embodiment of the present application.
Detailed Description
Hereinafter, specific embodiments of the present application will be described in detail with reference to the accompanying drawings.
The embodiment of the application is used for providing a control method for an activation mode of an electronic device. In this embodiment, when the device is in a user use state, the sensor chip can reliably send an interrupt signal to the main control chip (or "control chip") to ensure normal use of the device.
Fig. 1 shows an exemplary application scenario of the present application. In fig. 1, a touch pen 100 is included, and a user can conveniently write, draw, annotate and the like on a touch screen 201 of a tablet computer 200 by operating the touch pen 100. When a user operates stylus 100, stylus 100 is in an active mode. When the user does not operate the stylus pen 100 for a long time, the stylus pen 100 automatically enters the sleep mode to save power consumption of the device.
In fig. 1, a stylus pen 100 is illustrated as an example of the electronic device. But the application is not limited thereto. In other embodiments, the electronic device may be any device capable of interacting with a user, for example, an input/output device such as a keyboard, a handheld scanner, a laser pen, a microphone, and a gamepad, a wearable device such as a bracelet, a smart helmet, and smart glasses, a smart home device such as a microwave oven and a smart speaker, or a device with strong computing power such as a mobile phone and a tablet computer, which is not limited in this application.
The electronic device may be in an active mode or a sleep mode. When the electronic device is in the active mode, each software/hardware of the electronic device operates normally, and the electronic device can respond to the user operation normally. For example, when stylus 100 is in the active mode, stylus 100 may write based on a user operating tablet 200. When the gamepad is in the active mode, the gamepad can send user instructions to the game host.
When the electronic device is in the sleep mode, the electronic device turns off the function of part of the hardware (usually most of the hardware), or powers down part of the hardware (for example, powers down the hardware by turning down the clock frequency) to reduce the power consumption of the electronic device. When the electronic device is in the sleep mode, the electronic device is unresponsive to some or all of the user operations. For example, when stylus 100 is in sleep mode, stylus 100 is not responsive to a user writing operation. When the smart speaker is in the sleep mode, the smart speaker does not respond to the voice command of the user.
To meet the requirements of users and energy conservation, electronic devices need to be able to automatically switch between an active mode and a sleep mode. That is, when the user is using the electronic device (this state of the electronic device is referred to herein as a "user use state"), it is necessary to ensure that the electronic device is in an active mode. When the user does not use the electronic device (this state of the electronic device is referred to herein as an "idle state"), the electronic device can immediately enter a sleep mode to save power consumption of the device.
The electronic device can determine its state by means of a built-in sensor chip. Specifically, the sensor chip can acquire sensor data acquired by the state sensor and analyze and process the data, so as to judge whether the device is in a user use state. For ease of understanding, the meaning of the condition sensor in this application is described below.
In the present application, the state sensor is a sensor capable of sensing a user use state of the electronic device. In other words, the sensor data collected by the status sensor is associated with whether the user is using the electronic device. On this basis, the present application does not limit the specific form of the state sensor, and several examples are given below.
For example, in some examples, the state sensor is a motion sensor (e.g., a displacement sensor, a velocity sensor, an acceleration sensor). For some electronic devices, some spatial motion may occur when the electronic device is in a user-use state (e.g., the stylus 100 may shake when the user uses the stylus 100). When it is in the idle state, the electronic device is stationary. Therefore, whether the electronic equipment is in the user use state or not can be judged through the motion data collected by the motion sensor.
As another example, in some examples, the condition sensor is a temperature sensor. For some electronic devices (e.g., wearable devices), when they are in a user-use state, their ambient temperature is human body temperature. When it is in an idle state, its ambient temperature is other temperatures (e.g., room temperature). Therefore, whether the electronic equipment is in a user use state or not can be judged through the temperature data collected by the temperature sensor.
As another example, in some examples, the state sensor is an image sensor. The image sensor may acquire image data of objects surrounding the electronic device. By the image data, whether the electronic equipment faces the user can be judged, so that whether the electronic equipment is in the user use state can be judged.
In other examples, the state sensor may also be a sound sensor, a force sensor, or the like, which is not described herein again as long as the acquired sensor data can be used to determine whether the electronic device is in the user use state.
After the sensor chip processes the sensor data acquired by the state sensor, the current state of the electronic equipment can be obtained. When the electronic device is in a user use state, the sensor chip notifies a main control chip (also called a "control chip") of the electronic device of the state information by sending an interrupt signal. When the electronic equipment is in an idle state, the sensor chip does not send signals to the main control chip. Therefore, the main control chip can determine the state of the electronic device according to the frequency of receiving the interrupt signals. For example, when the main control chip continuously receives the interrupt signal, it is determined that the electronic device is in the user use state, and thus the electronic device is controlled to be in the active mode. When the main control chip does not receive the interrupt signal for a long time, the electronic equipment is determined to be in an idle state, and therefore the electronic equipment is controlled to enter a sleep mode.
In addition to the interrupt signals from the sensor chip, the main control chip receives various interrupt signals from other interrupt sources, such as timer interrupt, button interrupt, data exception interrupt, and the like. The identification of each interrupt signal is stored in an interrupt vector table of the master chip, and the master chip processes each interrupt signal according to a set order (e.g., a priority order). When an interrupt signal is processed, the master control chip deletes the identifier of the interrupt signal from the interrupt vector table. In addition, unless otherwise specified, the interrupt signal referred to herein is an interrupt signal transmitted from the sensor chip.
In order to make the sensor chip know the processing state of the interrupt signal sent by the sensor chip, a signal state value (simply referred to as "state value") of the interrupt signal is stored in the electronic device. Before sending an interrupt signal to the main control chip, the sensor chip sets the state value to a set value (specifically 1). And after the main control chip processes the interrupt signal, changing the state value into a reset value (specifically 0). The sensor chip firstly inquires the state value before sending the interrupt signal next time, if the state value is reset to 0, the interrupt signal sent last time is considered to be processed, and the interrupt signal can be normally sent to the main control chip. When the state value is still 1, the sensor chip considers that the interrupt signal sent last time is not processed, and the main control chip does not need a new interrupt signal, so that the interrupt signal is not sent to the main control chip.
However, in some cases, a state value reset failure may occur. For example, if the main control chip performs a reset operation on the state value (an operation of changing the state value from a set value to a reset value is used as a first operation), and the sensor chip performs an inquiry operation or a set operation on the state value at the same time (an operation of changing the state value from a reset value to a set value is used as a second operation), the main control chip and the sensor chip operate the same storage region at the same time, and a behavior conflict occurs, resulting in an operation failure.
If the reset operation of the main control chip on the state value fails, the sensor chip finds that the state value is still a set value when inquiring the state value, namely, the main control chip does not need a new interrupt signal, and therefore the interrupt signal is not sent to the main control chip. This condition is referred to herein as "blocked signal path". When the interrupt signal channel is blocked, the sensor chip does not send an interrupt signal to the main control chip even if the device is in a user use state, so that the main control chip controls the device to enter a sleep mode. Therefore, the equipment can not normally respond to the user operation, and the user experience is influenced.
Therefore, the application provides a control method for the activation mode of the electronic equipment. In this application, main control chip can regularly carry out initiative to the state value and reset to guarantee that the state value is in time reset, avoid causing the unable normal response of equipment because interrupt signal channel is blockked up. The following describes a technical solution of the present embodiment by taking the stylus 100 as an example of an electronic device. It is to be understood that the present application is not so limited.
Fig. 2 shows a schematic structural diagram of the stylus 100. Fig. 2 (a) is a perspective view of the stylus 100, and fig. 2 (b) is an exploded view of the stylus 100. Referring to fig. 2, a stylus 100 may include a pen tip 10, a pen barrel 20, and a rear cap 30. The inside of the barrel 20 is hollow, the nib 10 and the rear end 30 are respectively located at two ends of the barrel 20, the rear cap 30 and the barrel 20 can be inserted or engaged, and the matching relationship between the nib 10 and the barrel 20 will be described with reference to fig. 2 (b).
Referring to fig. 2 (b), the stylus 100 further includes a spindle assembly 50, the spindle assembly 50 is located in the barrel 20, and the spindle assembly 50 is slidably disposed in the barrel 20. The spindle assembly 50 has an external thread 51 thereon, and the nib 10 includes a writing end 11 and a connecting end 12, wherein the connecting end 12 of the nib 10 has an internal thread (not shown) that is engaged with the external thread 51.
When the spindle assembly 50 is assembled into the cartridge 20, the connection end 12 of the nib 10 protrudes into the cartridge 20 and is threadedly connected with the external thread 51 of the spindle assembly 50. In some other examples, the connection end 12 of the pen tip 10 and the spindle assembly 50 may be detachably connected by a snap fit or the like. Replacement of the nib 10 is achieved by the removable connection between the connecting end 12 of the nib 10 and the spindle assembly 50.
In order to detect the pressure applied to the writing end 11 of the pen tip 10, referring to fig. 2 (a), a gap 10a is formed between the pen tip 10 and the pen barrel 20, so that when the writing end 11 of the pen tip 10 is subjected to an external force, the pen tip 10 can move towards the pen barrel 20, and the movement of the pen tip 10 drives the spindle assembly 50 to move in the pen barrel 20. For detecting the external force, referring to fig. 2 (b), the main shaft assembly 50 is provided with a pressure sensing assembly 170, a portion of the pressure sensing assembly 170 is fixedly connected with a fixing structure in the pen holder 20, and a portion of the pressure sensing assembly 170 is fixedly connected with the main shaft assembly 50. Thus, when the main shaft assembly 50 moves along with the pen tip 10, since the part of the pressure sensing assembly 170 is fixedly connected with the fixing structure in the pen holder 20, the movement of the main shaft assembly 50 drives the deformation of the pressure sensing assembly 170, the deformation of the pressure sensing assembly 170 is transmitted to the main control chip 110 (for example, the pressure sensing assembly 170 and the main control chip 110 can be electrically connected through a wire or a flexible circuit board), the main control chip 110 detects the pressure of the writing end 11 of the pen tip 10 according to the deformation of the pressure sensing assembly 170, and the thickness of the writing end 11 is controlled according to the pressure of the writing end 11 of the pen tip 10.
It should be noted that the pressure detection of the pen tip 10 includes, but is not limited to, the above method. For example, a pressure sensor may be provided in writing end 11 of pen tip 10, and the pressure of pen tip 10 may be detected by the pressure sensor.
In this embodiment, referring to fig. 2 (b), the stylus pen 100 further includes a plurality of electrodes, which may be, for example, a first transmitting electrode 151, a ground electrode 153, and a second transmitting electrode 152. The first emitter electrode 151, the ground electrode 153, and the second emitter electrode 152 are electrically connected to the main control chip 110. The first transmitting electrode 151 may be located in the pen tip 10 and near the writing end 11, the main control chip 110 may be configured as a control board that can provide signals to the first transmitting electrode 151 and the second transmitting electrode 152, respectively, the first transmitting electrode 151 is used for transmitting a first signal, and when the first transmitting electrode 151 is close to the touch screen 201 of the tablet computer 200, a coupling capacitor may be formed between the first transmitting electrode 151 and the touch screen 201 of the tablet computer 200, so that the tablet computer 200 can receive the first signal. The second transmitting electrode 152 is configured to transmit a second signal, and the tablet computer 200 can determine the tilt angle of the stylus pen 100 according to the received second signal. In the embodiment of the present application, the second emitter electrode 152 may be located on the inner wall of the barrel 20. In one example, the second emitter electrode 152 may also be located on the spindle assembly 50.
The ground electrode 153 may be located between the first and second emitter electrodes 151 and 152, or the ground electrode 153 may be located at the outer circumferences of the first and second emitter electrodes 151 and 152, the ground electrode 153 serving to reduce the coupling of the first and second emitter electrodes 151 and 152 to each other.
When the tablet computer 200 receives the first signal from the stylus pen 100, the capacitance value at the corresponding position of the touch screen 201 changes. Accordingly, tablet computer 200 can determine the location of stylus 100 (or the tip of stylus 100) on touch screen 201 based on changes in capacitance values on touch screen 201. In addition, the tablet pc 200 may obtain the tilt angle of the stylus pen 100 by using a dual-tip projection method in the tilt angle detection algorithm. Since the positions of the first transmitting electrode 151 and the second transmitting electrode 152 in the stylus pen 100 are different, when the tablet computer 200 receives the first signal and the second signal from the stylus pen 100, capacitance values at two positions on the touch screen 201 are changed. The tablet pc 200 may obtain the tilt angle of the stylus 100 according to the distance between the first emitting electrode 151 and the second emitting electrode 152 and the distance between two positions where the capacitance value on the touch screen 201 changes, and for more details, refer to the related description of the dual-tip projection method in the prior art to obtain the tilt angle of the stylus 100.
In the embodiment of the present application, referring to fig. 2 (b), the stylus 100 further includes: the battery assembly 80, the battery assembly 80 is used for providing the power to the main control chip 110. The battery assembly 80 may include a lithium ion battery, or the battery assembly 80 may include a nickel-chromium battery, an alkaline battery, a nickel-hydrogen battery, or the like. In one embodiment, the battery assembly 80 may include a rechargeable battery or a disposable battery, wherein when the battery assembly 80 includes a rechargeable battery, the stylus 100 may charge the battery in the battery assembly 80 by a wireless charging method.
It should be noted that fig. 2 is an exemplary illustration of the structure of the stylus 100. Other components, such as status indicators, buttons, sensing circuits, charging modules, acceleration sensor chips (also referred to as "ACC chips"), and other electronic components, may also be included in stylus 100. The electronic components may constitute a circuit structure of the stylus pen 100, which is described in detail below.
Fig. 3 shows a schematic circuit structure diagram of the stylus 100. Referring to fig. 3, the circuit structure of the stylus pen 100 includes a main control chip 110, a bluetooth module 120, a status indicator 130, a button 140, one or more electrodes 150, a sensing circuit 160, a pressure sensing assembly 170, a charging module 180, and a sensor chip 190.
It is understood that fig. 3 is an exemplary illustration of the circuit configuration of stylus 100. Stylus 100 may also include a microphone, speaker, tone generator, vibrator, camera, data port, and other devices, as desired. A user can control the operation of stylus 100 and tablet 200 interacting with stylus 100 by providing commands with these devices, as well as receive status information and other outputs.
Master chip 110 may include storage and processing circuitry to support operation of stylus 100. The storage and processing circuitry may include storage devices such as non-volatile memory (e.g., flash memory or other electrically programmable read-only memory configured as a solid state drive), volatile memory (e.g., static or dynamic random access memory), and so forth. Processing circuitry in the master control chip 110 may be used to control the operation of the stylus 110. The processing circuitry may be based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio chips, application specific integrated circuits, and the like.
Master control chip 110 may be used to run software on stylus 100 that controls the operation of stylus 100. During operation of stylus 100, software running on main control chip 110 may process sensor inputs, button inputs, and inputs from other devices to monitor movement of stylus 100 and other user inputs. Software running on the master control chip 110 may detect the user command and may communicate with the tablet 200.
The stylus pen 100 may wirelessly communicate with the tablet pc 200 through a wireless module. In fig. 3, a wireless module is taken as an example of the bluetooth module 120. The wireless module can also be a WI-FI hotspot module, a WI-FI point-to-point module and the like. Bluetooth module 120 may include a radio frequency transceiver, such as a transceiver. Bluetooth module 120 may also include one or more antennas. The transceiver may transmit and/or receive wireless signals, which may be bluetooth signals, wireless local area network signals, long range signals such as cellular telephone signals, near field communication signals, or other wireless signals, based on the type of wireless module, using the antenna.
Status indicators 130 (e.g., light emitting diodes) are used to alert the user of the status of stylus 100. The buttons 140 may include mechanical and non-mechanical buttons, and the buttons 140 may be used to collect button press information from the user. Charging module 180 can support charging of stylus 100 to provide power to stylus 100.
In an embodiment of the present application, one or more electrodes 150 may be included in stylus 100. Specifically, referring to the description of fig. 2, the electrode 150 includes a first emission electrode 151, a ground electrode 153, and a second emission electrode 152. The function of the electrode 150 can be referred to the description of fig. 2 above, and will not be described.
With continued reference to fig. 3, sensing circuitry 160 can be included in stylus 100. Sensing circuitry 160 can sense capacitive coupling between electrodes 160 and drive lines of a capacitive touch sensor panel interacting with stylus 100. The sensing circuit 160 can include an amplifier to receive capacitance readings from the capacitive touch sensor panel, a clock to generate a demodulation signal, a phase shifter to generate a phase shifted demodulation signal, a mixer to demodulate the capacitance readings using an in-phase demodulation frequency component, and a mixer to demodulate the capacitance readings using a quadrature demodulation frequency component, among others. The results of the mixer demodulation can be used to determine an amplitude proportional to the capacitance so that stylus 100 can sense contact with the capacitive touch sensor panel.
The pressure sensing assembly 170 is used to sense pressure acting on the pen tip 10. The pressure sensing component 170 can be disposed at the writing end 11 of the stylus 100 (as shown in fig. 2 (b)). Of course, the pressure-sensitive member 170 may be disposed in the shaft 20 of the stylus 100, such that when one end of the tip 10 of the stylus 100 is forced, the other end of the tip 10 moves to apply a force to the pressure-sensitive member 170. In one embodiment, the main control chip 110 can adjust the line thickness of the stylus pen 100 when writing by the pen tip 10 according to the pressure detected by the pressure sensing component 170.
The sensor chip 190 is used to sense the state (user use state or idle state) of the stylus 100. Referring to fig. 3, the sensor chip 190 includes a status sensor 192, an Analog-to-Digital Converter 193 (ADC), a processor 191, and a status register 194. It should be noted that the processor 191 is a processor inside the sensor chip 190, and is a different device from a processor (also referred to as a "processing circuit") in the main control chip 110. In addition, in the present embodiment, the state sensor 192 is integrated in the sensor chip 190 to simplify the structure of the electronic device. In other embodiments, the status sensor 192 and the sensor chip 190 may be two physical devices that are spatially separated from each other.
Status sensor 192 is used to collect sensor data for stylus 100. As described above, the state sensor 192 may be a motion sensor (e.g., a displacement sensor, a gyroscope, a velocity sensor, an acceleration sensor, etc.), a temperature sensor, an image sensor, or the like.
Fig. 4 shows an exemplary block diagram of the status sensor 192. In fig. 4, the state sensor 192 is an acceleration sensor (hereinafter referred to as "ACC sensor 192"). Referring to fig. 4, the acc sensor 192 includes 3 piezoelectric patches (e.g., piezoceramic patches) orthogonal to each other, respectively piezoelectric patches 191a, 191b, 191c. When a user uses the stylus pen 100, the stylus pen 100 generates acceleration in one or more directions, a potential difference is generated inside the piezoelectric sheet in the corresponding direction, and a current is generated on a lead wire led out from the piezoelectric sheet. For example, when the stylus pen 100 generates acceleration in the x direction, a current signal I is generated on a wire led from the piezoelectric sheet 191a a Current signal I a Is proportional to the acceleration of stylus 100 in the x-direction. Therefore, the current signal (current signal I) generated at the ACC sensor 192 a 、I b 、I c ) As an acceleration signal (analog signal) of the stylus 100. In the example shown in fig. 4, the ACC sensor 192 is a piezoelectric sensor. In other examples, the ACC sensor 192 may be a capacitive sensor, an inductive sensor, a strain gauge sensor, etc., but the present embodiment is not limited thereto as long as the ACC sensor can acquire acceleration data of the stylus pen 100.
The ADC 193 is electrically connected to the state sensor 192, and is configured to sample, quantize, etc. the analog signal generated by the state sensor 192 to convert the analog signal into a digital signal. For example, when the state sensor 192 is the ACC sensor 192 shown in fig. 4, the ADC 193 outputs a digitized acceleration signal (referred to as "acceleration data", as an example of sensor data) at a set frequency (e.g., 2000 Hz), the acceleration data at each time including acceleration values of the stylus pen 100 in three directions of x, y, and z.
The processor 191 is coupled to the ADC 193 and is configured to process the sensor data output by the ADC 193 to determine the current state of the stylus 100. Illustratively, the sensor chip 190 stores therein an algorithm program (referred to as a "sniff logic program") for determining the current state of the stylus 100, and the processor determines the current state of the stylus 100 by running the sniff logic program.
An example method of the sensor chip 190 for determining the current state will be described below with reference to the ACC sensor shown in fig. 4 as an example of the state sensor. In this example, the sensor chip 190 determines the current state of the stylus pen 100 according to the acceleration data at a plurality of times, and the duration of the acquisition cycle of the plurality of acceleration data is Δ T3 (as the third duration). Illustratively, Δ T3 is 1 to 5ms, e.g., 2ms,4ms. It should be noted that, herein, each data range includes an end value, for example, 1 to 5ms includes 1ms and 5ms.
Illustratively, the sensor chip 190 determines the current state of the stylus 100 by calculating an average of a plurality of sets of acceleration data. When the average value of the acceleration in one direction (for example, the x direction) is greater than the set threshold, the ACC chip 190 determines that the stylus pen 100 is in the user use state. When the average values of the accelerations in the three directions (x direction, y direction, and z direction) are all smaller than the set threshold, the sensor chip 190 determines that the stylus 100 is in an idle state. In other embodiments, the sensor chip 190 may determine whether the stylus 100 is in the user-use state by other methods, which are not limited in this application.
With continued reference to FIG. 3, the status register 194 is used to store the status value of the interrupt signal. That is, in the present embodiment, the state value is stored in the sensor chip 190, so that the query operation and the set operation of the sensor chip 190 on the state value are facilitated, thereby improving the processing efficiency of the sensor chip 190. In other embodiments, the state values may be stored in other locations, such as in a memory of the control chip 110.
In addition, in the present embodiment, 0 is taken as an example of a reset value, and 1 is taken as an example of a position value. The present application is not limited thereto. In other embodiments, the reset value may be other values, for example, 01 B . The set value may also be other values, for example, 10 B
The sensor chip 190 is communicatively connected to the main control chip 110. Specifically, the ACC chip 190 includes a pin P21, a pin P22, and a pin P23, and the main control chip 110 includes a pin P11, a pin P12, and a pin P13. An interrupt signal line is connected between the pin P12 and the pin P22, and the ACC chip 190 may send an interrupt signal to the main control chip 110 through the interrupt signal line. The interrupt signal may be a pulse signal, a rising edge signal, or the like, and the present application is not limited thereto.
Further, an inter-integrated circuit (I2C) data line (SDA) is connected between the pin P21 and the pin P11, and an I2C clock line (SCL) is connected between the pin P22 and the pin P12. Thus, communication between the ACC chip 190 and the main control chip 110 may be performed through an I2C protocol.
In this embodiment, the main control chip 110 may perform a reset operation on the state value through the I2C bus. Specifically, the main control chip 110 sends the address of the status register 194 to the sensor chip through the I2C bus, asserts the write mode, and sends the reset value, that is, the status value can be reset.
It should be noted that the present embodiment is an exemplary illustration of the circuit structure of the stylus 100, and those skilled in the art may make other modifications.
For example, in this embodiment, the main control chip 110 and the sensor chip 190 communicate via an I2C bus. In other embodiments, the main control chip 110 and the sensor chip 190 may communicate via other types of buses, such as Serial Peripheral Interface (SPI) bus, universal asynchronous receiver/transmitter (UART), and the like.
The following describes a method for sending an interrupt signal from the sensor chip 190 to the main control chip 110 in the stylus 100, with reference to the structure of the stylus 100 shown in fig. 3. Fig. 5 is a flowchart illustrating a method for sending an interrupt signal. From time t0 to t1, the user does not operate the stylus pen 100 (for example, referring to fig. 5a, the stylus pen 100 is attached to the tablet pc 200 which is standing still). After time t1, the user starts operating stylus 100 (e.g., referring to fig. 5b, the user writes on tablet 200 with stylus 100). Before the method shown in fig. 5 begins, the stylus 100 is in the sleep mode, and the signal state value is a reset value (specifically 0).
Referring to fig. 5, the interrupt signal transmission method includes the following steps (in the following description, the ACC sensor 192 shown in fig. 4 is taken as an example of the state sensor):
s11: the ACC sensor 192 collects acceleration Data0 (as an example of sensor Data) of the stylus pen 100. In the on state of the stylus pen 100, the ACC sensor 192 constantly collects acceleration data of the stylus pen 100. After time t0, the ACC sensor 192 acquires acceleration Data0.
The sensor Data0 includes Data acquired by the ACC sensor 192 for a set length of time period (also referred to as "acquisition period"). In this embodiment, the time duration corresponding to one acquisition period is Δ T3 (as the third time duration), and for example, Δ T3 is 1 to 5ms.
As described above, the acceleration Data0 acquired by the ACC sensor 192 is specifically the current signal I generated by the ACC sensor 192 in the current acquisition cycle a 、I b 、I c (analog quantity). Further, in the acquisition period of the acceleration Data0, since the stylus pen 100 is in an idle state, no current signal is generated in the ACC sensor 192, and thus each current signal I a 、I b 、I c All the current values of (1) are 0.
S12: the ACC sensor 192 transmits the acceleration Data0 to the processor 191 of the sensor chip 190.
The ACC sensor 192 converts the analog acceleration Data0 (i.e., the current signal I) a 、I b 、I c ) The acceleration Data0 is sent to the ADC 193, and the ADC 193 performs analog-to-digital conversion on the acceleration Data0 to obtain the acceleration Data0 in the form of digital quantity. The ADC 193 transmits the acceleration Data0 in the form of digital quantity to the processor 191 of the sensor chip 190 so that the sensor chip 190 acquires the acceleration Data0.
The acceleration Data0 acquired by the sensor chip 190 includes a plurality of sets of acceleration values. Illustratively, data0 includes 5 sets of acceleration values, denoted Data01, data02, \8230;, data05, respectively. The 5 sets of acceleration values respectively represent acceleration of the stylus pen 100 at times t01, t02, \8230;, t05, and t01 to t05 are respectively 5 different times in the acquisition period of the acceleration Data0. Each set of acceleration values includes accelerations of the stylus 100 in 3 directions (x, y, z directions), for example, the acceleration value Data01 at time t01 is (Data 01_ x, data01_ y, data01_ z), where Data01_ x, data01_ y, data01_ z respectively represent accelerations of the stylus 100 in x, y, z directions at time t 01. It can be understood that 5 sets of acceleration values Data01, data02, \8230, 8230, and 8230are 0 for the stylus 100 in the stationary state.
In other embodiments, data0 may also include other numbers of acceleration values, e.g., 10 sets, 20 sets, etc.
S13: the sensor chip 190 determines that the current state of the stylus pen 100 is the idle state according to the acceleration Data0. Illustratively, the sensor chip 190 determines the current state of the stylus 100 by running a preset sniff logic program on the processor 191.
In this embodiment, the sensor chip 190 determines the current state of the stylus 100 according to the average value of the multiple sets of acceleration values. That is, the sensor chip 190 calculates the acceleration average values of the stylus pen 100 in the x, y, and z directions according to the plurality of sets of acceleration values, and compares the acceleration average values in each direction with the set threshold value. When the average acceleration in a certain direction is larger than a set threshold (for example, 10 mm/s) 2 ) At this time, sensor chip 190 determines that stylus 100 is in a user use state. When the average acceleration values in the three directions are smaller than the set threshold, the sensor chip 190 determines that the stylus 100 is in an idle state.
It can be understood that, for the acceleration Data0, since each acceleration value is 0 (smaller than the set threshold), the average value of the accelerations in each direction is smaller than the set threshold, and the sensor chip 190 determines that the stylus pen 100 is in the idle state.
In addition, the state determination method provided in the present embodiment is an exemplary method, and those skilled in the art may make other modifications.
When the sensor chip 190 determines that the stylus 100 is in the idle state, the interrupt signal is not sent to the main control chip 110, and the process returns to step S20, and the state of the stylus 100 is determined again according to the subsequent acceleration data. Through the above steps S10 to S30, the sensor chip 190 completes a state determination cycle. Between time t0 and time t1, sensor chip 190 may complete a plurality of state determination cycles. For example, when the time period from time t0 to time t1 is 5min, the sensor chip 190 may complete thousands of state determination cycles.
From time t0 to time t1, the stylus 100 is always in an idle state (for example, referring to fig. 5a, the stylus 100 is attached to the tablet 200 which is still standing). Therefore, in each state determination cycle, the sensor chip 190 does not send an interrupt signal to the main control chip 110. The main control chip 110 controls the stylus pen 100 to remain in the sleep mode when the interrupt signal is not received.
From time t1, the user begins to operate stylus 100 (e.g., referring to fig. 5b, the user writes on tablet 200 with stylus 100). From time t1, stylus 100 continues to perform the following steps:
s21: the ACC sensor 192 collects acceleration Data1 (as an example of sensor Data) of the stylus pen 100. After time t0, the ACC sensor 192 acquires acceleration Data1.
The implementation details of this step are substantially the same as step S11, and only differ in the acquisition timing of the acceleration data. In this step, the acquisition period of the acceleration Data1 is after t1, and at this time, the user is using the stylus pen 100, so that the current signal I having a current value greater than 0 is generated in the ACC sensor 192 a 、I b 、I c That is, at least part of the acceleration Data1 is not 0.
S22: the sensor chip 190 acquires acceleration Data1 acquired by the ACC sensor 192.
The implementation details of this step are substantially the same as step S12. The acceleration Data1 (acceleration Data in the form of digital quantity) obtained by the sensor chip 190 also includes a plurality of sets (for example, 5 sets) of acceleration values acquired in the current acquisition cycle of the ACC sensor 192, and the time length corresponding to the acquisition cycle of the Data1 is also Δ T3. Except that at least part of the acceleration Data1 is not 0.
S23: the sensor chip 190 determines the current state of the stylus pen 100 as the user use state according to the acceleration Data1.
The method for determining the current state of the stylus pen 100 according to the acceleration data by the sensor chip 190 is substantially the same as step S13. The difference is that in this step, the average value of the accelerations calculated according to the acceleration Data1 is greater than the set threshold, and therefore, the sensor chip 190 determines that the stylus pen 100 is in the user use state.
S24: the sensor chip 190 determines that the state value is 0. Processor 191 of sensor chip 190 determines that the status value is 0 by reading status register 194.
S25: the sensor chip 190 changes the state value from 0 (as a reset value) to 1 (as a set value). Processor 191 of sensor chip 190 sends an instruction to write 1 to status register 194 to change the status value from 0 to 1.
S26: the sensor chip 190 sends an interrupt signal to the main control chip 110. The processor 191 of the sensor chip 190 sends an interrupt signal to the main control chip 110 by changing the level value of the pin P23. For example, when the interrupt signal is a rising edge signal, the processor 191 controls the P23 level of the pin to jump from a low level to a high level to transmit the interrupt signal to the main control chip 110. The sensor chip 190 may restore the level of the pin P23 to the low level after sending the interrupt signal.
After the sensor chip 190 sends the interrupt signal to the main control chip 110 (i.e., after step S25 is executed), the process returns to step S21 to enter the next state judgment loop.
S27: the main control chip 110 writes the state value to 0 in response to receiving the interrupt signal.
Since the pin P23 of the sensor chip 190 is connected to the pin P13 of the main control chip 110 through the interrupt signal line, the interrupt signal generated by the sensor chip 190 can be transmitted to the pin P13 through the interrupt signal line. After the pin P13 senses the interrupt signal, the identification of the interrupt signal is added to the interrupt vector table of the master chip 110. After the main control chip 110 reads the identifier of the interrupt signal from the interrupt vector table, the main control chip 110 receives the interrupt signal.
After receiving the interrupt signal, the main control chip 110 writes the state value to 0. Specifically, the main control chip 110 sends the address of the status register 194 to the sensor chip 190 through the I2C bus, asserts the write mode, and sends the reset value 0, that is, the status value may be written as 0.
S28: the main control chip 110 controls the stylus pen 100 to be in the active mode in response to receiving the interrupt signal. For example, the main control chip 110 controls the stylus pen 100 to switch from the sleep mode to the active mode.
Through steps S21 to S27, the stylus pen 100 can complete an interrupt signal processing cycle. In the first interrupt signal processing cycle, when the main control chip 110 receives the interrupt signal for the first time, the stylus pen 100 is switched from the sleep mode to the active mode. When the user subsequently continues to operate stylus 100, stylus 100 completes approximately hundreds of interrupt signal processing cycles per second. The master control chip 110 may receive an interrupt signal once per interrupt signal processing cycle. The main control chip 110 controls the stylus pen 100 to be kept in the active mode when the interrupt signal is continuously received.
The following describes a method for controlling the active mode of the electronic device provided in this embodiment. In the present embodiment, the stylus pen 100 is taken as an example of an electronic device. It is to be understood that the present application is not so limited.
Referring to fig. 7, the control method includes the steps of:
s110: the sensor chip 190 determines that the stylus pen 100 is in the user use state, and determines that the state value stored in the state register 194 is a reset value (specifically, 0).
"the stylus pen 100 is in the user use state" and "the state value is the reset value" are two conditions that the sensor chip 190 transmits the terminal signal to the main control chip 110.
Because it is only necessary to put stylus 100 in the active mode when stylus 100 is in a user-used state (hereinafter referred to as a "use condition"). Only when the state value is a reset value (hereinafter referred to as a "state value condition"), it indicates that the interrupt signal transmitted last time has been processed by the master chip 110.
Sensor chip 190 determines the current state (idle state or user use state) of stylus 100 from the sensor data collected by state sensor 192. As mentioned above, the status sensor 192 may be a motion sensor, a temperature sensor, an image sensor, or the like, as exemplary described below.
In some examples, the status sensor 192 is a motion sensor, such as a velocity sensor, a displacement sensor, an acceleration sensor (e.g., the ACC sensor 192 shown in fig. 4), or the like. The motion sensor can collect motion data (e.g., displacement data, acceleration data) of stylus 100. When the user does not operate the stylus 100 (for example, referring to fig. 6a, the stylus 100 is attached to a tablet computer which is standing still), the motion data collected by the motion sensor is 0, and the sensor chip 190 determines that the stylus 100 is static according to the motion data, so as to determine that the stylus 100 is in an idle state.
When the user operates the stylus 100 (for example, referring to fig. 6b, the user writes on the tablet pc 200 through the stylus 100), the stylus 100 generates shaking. The motion sensor may acquire motion data greater than 0, and the sensor chip 190 may determine that the stylus 100 is in motion according to the motion data, so as to determine that the stylus 100 is being operated by a user, that is, determine that the stylus 100 is in a user use state.
In some cases, the stylus 100 may also be moved by a reason other than the user operation. For example, stylus 100 is blown by wind. In these cases, the motion sensor will also collect motion data greater than 0. At this time, the sensor chip 190 also keeps the stylus pen 100 in a user-operated state. That is, in the present embodiment, when state sensor 192 is a motion sensor, "stylus 100 is in the user state" includes a case where stylus 100 is moved due to a cause other than a user operation.
In other examples, status sensor 192 is a temperature sensor that can collect ambient temperature data of stylus 100. When the user operates the stylus pen 100 (for example, referring to fig. 6b, when the user writes with the stylus pen 100 in hand), the temperature data collected by the temperature sensor is a human body temperature (for example, about 36.5 ℃). The sensor chip 190 determines that the stylus pen 100 is being held by the user according to the temperature data, thereby determining that the stylus pen 100 is in the user use state.
When the user does not operate the stylus pen 100 (for example, referring to fig. 6a, the stylus pen 100 is attached to the tablet pc 200 which is standing still), the temperature collected by the temperature sensor is a temperature other than the human body temperature, for example, room temperature 20 ℃. The sensor chip 190 determines that the stylus pen 100 is not close to the user according to the temperature data, thereby determining that the stylus pen 100 is in an idle state.
When the temperature sensor is used as the state sensor 192, the influence of interference factors can be reduced, which is beneficial for the sensor chip 190 to accurately determine the current state of the stylus 100.
In this step, the sensor chip 190 determines whether the two conditions are satisfied. Referring to fig. 8, this step specifically includes the following sub-steps:
s111: the sensor chip 190 acquires sensor data collected by the status sensor 192.
The sensor data collected by the status sensor 192 is analog-to-digital converted and then transmitted to the sensor chip 190, so that the sensor chip 190 can acquire the sensor data (e.g., motion data, temperature data, etc.).
In some examples, the state sensor is an ACC sensor 192 as shown in fig. 4. In this example, acceleration data (as an example of sensor data) collected by the ACC sensor 192 is analog/digital converted by the ADC 193 and transmitted to the processor 191 of the sensor chip 190, so that the sensor chip 190 acquires the acceleration data. Illustratively, in the on state of the stylus 100, the ACC sensor 192 continuously collects acceleration data and transmits it to the processor 191 of the sensor chip 190.
S112: the sensor chip 190 determines whether the stylus pen 100 is in a user-use state according to the sensor data. Wherein the duration of the acquisition period of the sensor data is Δ T3 (as the third duration). That is, the sensor chip 190 determines the state of the stylus pen 100 according to a plurality of sensor data collected by the state sensor 192 within the time period of Δ T3, so as to improve the accuracy of the determination.
In some examples, the state sensor 192 is the ACC sensor 192 shown in fig. 4. In this example, the method for determining the device state by the sensor chip 190 may refer to the descriptions in steps S11 to S13 and steps S21 to S23, which are not described again.
When the sensor chip 190 determines that the stylus pen 100 is in the user use state, it is determined that the use condition is satisfied, and the sensor chip 190 performs step S113 to further determine whether the state value condition is satisfied. When the sensor chip 190 determines that the stylus 100 is in the idle state, the sensor chip 190 determines that the usage condition is not satisfied, and the sensor chip 190 returns to perform step S111 to re-determine the state of the stylus 100 according to the sensor data of the next acquisition cycle.
S113: the sensor chip 190 determines whether the state value is a reset value.
The sensor chip 190 determines whether the status value is reset by querying the status register 194. When the state value is the reset value, the sensor chip 190 determines that the state value condition is satisfied, and thus continues to perform the subsequent steps. When the state value is the set value, the sensor chip 190 returns to execute step S111.
In this embodiment, the sensor chip 190 will send an interrupt signal to the main control chip 110 when determining that both the "use condition" and the "state value condition" are satisfied (i.e. execute step S130 below). In other embodiments, the sensor chip 190 may send an interrupt signal to the main control chip 110 upon determining that one of the "usage condition" and the "status value condition" is satisfied.
The following description will be continued with reference to fig. 7, returning to step S110.
S120: the sensor chip 190 sets the state value to 1. After determining that both the use condition and the state value condition are satisfied, the sensor chip 190 performs a state value setting operation (as a first operation), that is, the sensor chip 190 changes the state value from 0 to 1.
S130: the sensor chip 190 sends an interrupt signal to the main control chip 110. The sensor chip 190 sends an interrupt signal to the main control chip 110 through an interrupt signal line. The interrupt signal may be a pulse signal, a rising edge signal, or the like, and the embodiment is not limited.
S140: the main control chip 110 determines whether an interrupt signal is received within a time period Δ T1 (as a first time period), and if so, controls the stylus pen 100 to be in the active mode. If not, the stylus pen 100 is controlled to be in the sleep mode.
It is contemplated that a user may not operate stylus 100 temporarily, rather than continuously and uninterruptedly operating stylus 100 while using stylus 100. To avoid frequent switching of the stylus 100 between the sleep mode and the active mode, in the embodiment, the main control chip 110 controls the stylus 100 to be in the sleep mode only when the interrupt signal is not received for a long time (specifically, for the duration Δ T1). As long as an interrupt signal is received once at the time duration Δ T1, the stylus 100 is considered to be in the user use state, and thus the stylus 100 is controlled to be in the active mode. The main control chip 110 may set the state value to 0 after receiving the interrupt signal. In this embodiment, Δ T1 is also referred to as a "sleep time threshold".
In this embodiment, it is considered that if the stylus 100 is left standing for more than 3min, the stylus 100 is usually in an idle state. Therefore, Δ T1 is set to 2.5 to 3.5min, for example, 2.5min,3min. When Δ T1 is within the range, the stylus pen 100 can be prevented from frequently switching between the sleep mode and the active mode, and the stylus pen 100 can enter the sleep mode in time.
In addition, the phrase "controlling stylus 100 to be in an active mode" may refer to controlling stylus 100 to remain in the active mode, or may refer to controlling stylus 100 to switch from a sleep mode to an active mode. Likewise, the phrase "controlling stylus 100 to be in sleep mode" may refer to controlling stylus 100 to remain in sleep mode, or may refer to controlling stylus 100 to switch from active mode to sleep mode.
In addition, for consistency of description, details of the step S140 will be described later.
Generally, when the user is operating the stylus pen 100, the transmission period of the interrupt signal is on the same order of magnitude (millisecond order) as the acquisition period of the sensor data. That is, the sensor chip 190 sends an interrupt signal to the main control chip 110 at least once every several milliseconds (e.g., 2 ms). Since the state value in the state register 194 is set and reset once per interrupt signal transmission cycle, there is a high possibility that the sensor chip 190 and the main control chip 110 operate the state register 194 at the same time, and an operation conflict occurs. As described above, at this time, the interrupt signal transmission channel may be blocked, and the stylus pen 100 may enter the sleep mode by mistake, which may affect the user experience.
For this reason, in this embodiment, the main control chip 110 periodically performs an active reset operation on the state value (the reset operation of the main control chip 110 on the state value after receiving the interrupt signal is a "passive reset operation"), so as to ensure that the state value is reset in time, thereby ensuring that the interrupt signal transmission channel is unblocked. The following is specifically described in step S150.
S150: the main control chip 110 periodically sets the state value to 0 with the time length Δ T2 (as a second time length) as a period. That is, the main control chip 110 will actively reset the status value every Δ T2. Thus, the state value can be ensured to be reset immediately so as to ensure the smoothness of the interrupt signal sending channel. Specifically, the master control chip 110 writes a value of 0 in the status register 194 through the I2C bus to reset the status value.
The main control chip 110 includes a timer a, and the timer a is used for setting the second duration Δ T2. Illustratively, the timing duration of the timer a is Δ T2. After the stylus 100 is started for the first time or each time it is restarted, the main control chip 110 starts a timer a, and the timer a starts to count time from 0. When the timing time of the timer a reaches, the main control chip 110 actively resets the state value, restarts the timer a, and the timer a starts to count again from 0, and so on. In other embodiments, the timing duration of timer A may also be less than Δ T2, e.g., Δ T2/2. In this example, the timer a times out every two times, and the main control chip 110 performs an active reset on the state value.
The relationship between the time periods Δ T1, Δ T2, Δ T3 is described below. As described above, Δ T1 is a sleep time threshold, Δ T2 is a period of actively resetting the state value by the main control chip 110, and Δ T3 is a period of collecting sensor data.
In this embodiment, Δ T2 is smaller than Δ T1. Thus, within the sleep time threshold, the main control chip 110 can actively reset the state value at least once to ensure that the stylus pen 100 does not mistakenly enter the sleep mode due to the blocking of the interrupt signal channel. Illustratively, Δ T1 is more than 3 times Δ T2 to further ensure that the state value is reset in time to ensure that the interrupt signal transmission channel is clear.
Further, Δ T2 is different values when the stylus 100 is in the active mode and the sleep mode. Specifically, Δ T2 is a first value when stylus 100 is in the active mode. When the stylus pen 100 is in the sleep mode, Δ T2 is a second value, which is more than 3 times the first value. This is because, when the stylus pen 100 is in the active mode, the status register 194 is frequently read and written, and a failure in resetting the status value is likely to occur. Therefore, Δ T2 is a small value when stylus 100 is in the active mode. When the stylus 100 is in the sleep mode, the status register 194 is read and written less frequently, so Δ T2 can be set to a larger value.
In the present embodiment, Δ T2 is 100 times or more as large as Δ T3. That is, the period of the master control chip 110 actively resetting the state value is much longer than the acquisition period of the sensor data. As mentioned above, the sending period of the interrupt signal is of the same order of magnitude (milliseconds) as the acquisition period of the sensor data. In addition, the main control chip 110 performs a passive reset operation on the state value every interrupt signal transmission cycle. That is to say, the period of the master control chip 110 actively resetting the state value is much longer than the period of the passive reset, so that the master control chip 110 can reset the state value in time and hardly increase the burden of the state register 194.
In view of the above, in this embodiment, Δ T1 is 2.5 to 3.5min. Delta T3 is 1-5 ms. When the stylus pen 100 is in the sleep mode, Δ T2 is 0.5 to 1.5min, for example, 1min,1.5min. When the stylus 100 is in the active mode, Δ T2 is 5 to 20s, e.g., 5s,10s, and 10 s.
Details of the implementation of step S140 will be described below. The main control chip 110 includes a timer B, and the timer B is used for setting the first time length Δ T1. In this embodiment, the timing duration of the timer B is Δ T1. In other embodiments, the timing duration of the timer B may be less than Δ T1.
Specifically, referring to fig. 9, step S140 includes the following sub-steps:
s141: the main control chip 110 starts a timer B. After the stylus 100 is started for the first time or each time it is restarted, the main control chip 110 starts a timer B, and the timer B starts to count from 0.
S142: the main control chip 110 determines whether an interrupt signal is received before the timer B expires.
The main control chip 110 listens for an interrupt signal after starting the timer B. If the main control chip 110 receives the interrupt signal before the timer B expires, it is determined that the interrupt signal is received within the time duration Δ T1, thereby controlling the stylus pen 100 to be in the active mode. If the main control chip 110 does not receive the interrupt signal before the timer B expires, it is determined that the interrupt signal is not received within the time period T1, and thus the stylus pen 100 is controlled to be in the sleep mode. When the timer B expires, the master chip 110 restarts the timer B.
S143: the main control chip 110 resets the timer B.
The main control chip 110 resets and restarts the timer B after determining that the interrupt signal is received within the time duration Δ T1. After the timer B is restarted, the timer starts to count again from 0. The main control chip 110 enters the next interrupt signal listening period.
The technical solution of the present embodiment is described above. The embodiment can ensure that the state value is timely reset so as to ensure the smoothness of the interrupt signal sending channel. It should be noted that this embodiment is an exemplary description of the technical solution of the present application, and those skilled in the art may make other modifications. For example, the order of step S120 and step S130 is exchanged.
Referring now to FIG. 10, shown is a block diagram of an electronic device 400 in accordance with one embodiment of the present application. The electronic device 400 may include one or more processors 401 coupled to a controller hub 403. For at least one embodiment, the controller hub 403 communicates with the processor 401 via a multi-drop Bus such as a Front Side Bus (FSB), a point-to-point interface such as a QuickPath Interconnect (QPI), or similar connection 406. Processor 401 executes instructions that control general types of data processing operations. In one embodiment, controller Hub 403 includes, but is not limited to, a Graphics Memory Controller Hub (GMCH) (not shown) and an Input Output Hub (IOH) (which may be on separate chips) (not shown), where the GMCH includes a Memory and a Graphics Controller and is coupled to the IOH.
The electronic device 400 may also include a coprocessor 402 and memory 404 coupled to the controller hub 403. Alternatively, one or both of the memory and GMCH may be integrated within the processor (as described herein), with the memory 404 and coprocessor 402 coupled directly to the processor 401 and controller hub 403, with the controller hub 403 and IOH in a single chip.
The Memory 404 may be, for example, a Dynamic Random Access Memory (DRAM), a Phase Change Memory (PCM), or a combination of the two. Memory 404 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions therein. A computer-readable storage medium has stored therein instructions, and in particular, temporary and permanent copies of the instructions. The instructions may include: instructions that, when executed by at least one of the processors, cause the electronic device 400 to perform the method illustrated in fig. 5, 7, 8, 9. When the instructions are run on a computer, the instructions cause the computer to perform the method disclosed by the above embodiment.
In one embodiment, the coprocessor 402 is a special-purpose processor, such as, for example, a high-throughput Integrated Core (MIC) processor, a network or communication processor, compression engine, graphics processor, general-purpose computing on graphics processing unit (GPGPU), embedded processor, or the like. The optional nature of coprocessor 402 is represented in FIG. 10 by dashed lines.
In one embodiment, electronic device 400 may further include a Network Interface Controller (NIC) 406. Network interface 406 may include a transceiver to provide a radio interface for electronic device 400 to communicate with any other suitable device (e.g., front end module, antenna, etc.). In various embodiments, the network interface 406 may be integrated with other components of the electronic device 400. The network interface 406 may implement the functions of the communication unit in the above-described embodiments.
The electronic device 400 may further include an Input/Output (I/O) device 405.I/O405 may include: a user interface designed to enable a user to interact with the electronic device 400. The design of the peripheral component interface enables peripheral components to also interact with the electronic device 400. And/or sensors may be configured to determine environmental conditions and/or location information associated with electronic device 400.
It is noted that fig. 10 is merely exemplary. That is, although fig. 10 shows that the electronic device 400 includes a plurality of components, such as the processor 401, the controller hub 403, the memory 404, etc., in practical applications, the device using the methods of the present application may include only a part of the components of the electronic device 400, for example, only the processor 401 and the network interface 406 may be included. The nature of the alternative device in fig. 10 is shown in dashed lines.
Referring now to fig. 11, shown is a block diagram of a System on Chip (SoC) 500 in accordance with an embodiment of the present application. In fig. 11, like parts have the same reference numerals. In addition, the dashed box is an optional feature of more advanced socs. In fig. 11, soC500 includes: an interconnect unit 550 coupled to the processor 510; a system agent unit 580; a bus controller unit 590; an integrated memory controller unit 540; a set or one or more coprocessors 520 which may include integrated graphics logic, an image processor, an audio processor, and a video processor; a Static Random Access Memory (SRAM) unit 530; a Direct Memory Access (DMA) unit 560. In one embodiment, coprocessor 520 comprises a special-purpose processor, such as, for example, a network or communication processor, compression engine, general-purpose computing on graphics processing units (GPGPU), a high-throughput MIC processor, or an embedded processor, among others.
Static Random Access Memory (SRAM) unit 530 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions. The computer readable storage medium has stored therein instructions, in particular, temporary and permanent copies of the instructions. The instructions may include: instructions that when executed by at least one of the processors cause the SoC to implement the method illustrated in fig. 5, 7, 8, 9. The instructions, when executed on a computer, cause the computer to perform the methods disclosed in the embodiments described above.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The method embodiments of the present application may be implemented in software, magnetic, firmware, etc.
Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a Processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor.
The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. Program code may also be implemented in assembly or machine language, if desired. Indeed, the mechanisms described herein are not limited in scope to any particular programming language. In any case, the language may be a compiled or interpreted language.
One or more aspects of at least one embodiment may be implemented by representative instructions stored on a computer-readable storage medium, which represent various logic in a processor, which when read by a machine causes the machine to fabricate logic to perform the techniques described herein. These representations, known as "Intellectual Property (IP) cores," may be stored on a tangible computer-readable storage medium and provided to customers or production facilities to load into the manufacturing machines that actually manufacture the logic or processor.
In some cases, an instruction converter may be used to convert instructions from a source instruction set to a target instruction set. For example, the instruction converter may transform (e.g., using static binary transformations, dynamic binary transformations including dynamic compilation), morph, emulate, or otherwise convert an instruction into one or more other instructions to be processed by the core. The instruction converter may be implemented in software, hardware, firmware, or a combination thereof. The instruction converter may be on the processor, off-processor, or partially on and partially off-processor.

Claims (13)

1. A method of controlling an active mode of an electronic device, the electronic device comprising a sensor chip and a control chip communicatively coupled, the method comprising:
the sensor chip determines that the electronic equipment is in a user use state, and determines that a signal state value stored in the electronic equipment is a reset value;
the sensor chip sends an interrupt signal to the control chip and executes a first operation, wherein the first operation is used for changing the signal state value from a reset value to a set value;
the control chip responds to at least one interrupt signal received in a first time period and controls the electronic equipment to be in an activated mode; and (c) a second step of,
the control chip responds to the interrupt signal and executes a second operation, and the second operation is used for writing the signal state value into a reset value; and the control chip periodically executes the second operation by taking a second duration as a period, wherein the first duration is longer than the second duration.
2. The method of claim 1, further comprising:
and the control chip controls the electronic equipment to be in a sleep mode based on that the interrupt signal is not received within the first time length.
3. The method according to claim 1 or 2, wherein the first period of time is more than 3 times the second period of time.
4. The method according to any one of claims 1 to 3, wherein when the electronic device is in an active mode, the first duration is a first value; when the electronic equipment is in a sleep mode, the first duration is a second value; wherein the second value is more than 3 times the first value.
5. The method of claim 4, wherein the first time period is 2.5 to 3.5min; the first value is 5-20 s, and the second value is 0.5-1.5 min.
6. The method according to any one of claims 1 to 5, wherein a timer is included in the control chip, and the timer is used for setting the first time length and the second time length.
7. The method of any one of claims 1-6, wherein the sensor chip determining that the electronic device is in a user use state comprises:
the sensor chip acquires sensor data acquired by a state sensor of the electronic equipment, wherein the time length of the acquisition cycle of the sensor data is a third time length;
the sensor chip determines that the electronic equipment is in a user use state according to the sensor data;
wherein the second duration is more than 100 times the third duration.
8. The method of claim 7, wherein the third duration is 1-5 ms.
9. The method of claim 7, wherein the status sensor is a motion sensor, a temperature sensor, or an image sensor; and/or the status sensor is integrated in the sensor chip.
10. The method of any one of claims 1 to 9, wherein the signal state value is stored in a register of the sensor chip.
11. The method of any one of claims 1-10, wherein the electronic device is a stylus.
12. An electronic device, comprising:
a memory to store instructions for execution by one or more processors of the electronic device;
a processor that, when executing the instructions in the memory, causes the electronic device to perform the method of any of claims 1-11.
13. A computer-readable storage medium having instructions stored thereon, which when executed on a computer, cause the computer to perform the method of any one of claims 1 to 11.
CN202210134595.4A 2022-02-14 2022-02-14 Control method for activation mode of electronic device, electronic device and storage medium Active CN115562464B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210134595.4A CN115562464B (en) 2022-02-14 2022-02-14 Control method for activation mode of electronic device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210134595.4A CN115562464B (en) 2022-02-14 2022-02-14 Control method for activation mode of electronic device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN115562464A true CN115562464A (en) 2023-01-03
CN115562464B CN115562464B (en) 2023-09-12

Family

ID=84737157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210134595.4A Active CN115562464B (en) 2022-02-14 2022-02-14 Control method for activation mode of electronic device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115562464B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5954813A (en) * 1994-11-10 1999-09-21 Motorola, Inc. Data processor with transparent operation during a background mode and method therefor
US20200050350A1 (en) * 2018-08-08 2020-02-13 Samsung Electronics Co., Ltd. Electronic device and method for recognizing stylus pen
CN110989822A (en) * 2019-11-27 2020-04-10 Tcl移动通信科技(宁波)有限公司 Sensor control method, sensor control device, storage medium and electronic equipment
CN112486309A (en) * 2020-11-27 2021-03-12 广东小天才科技有限公司 Method for determining duration corresponding to idle state, control chip and electronic equipment
CN113220154A (en) * 2021-03-15 2021-08-06 荣耀终端有限公司 Control method and system of refresh rate and electronic equipment
US20220011839A1 (en) * 2019-03-29 2022-01-13 Samsung Electronics Co., Ltd. Method for keyless reset, and electronic device therefor

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5954813A (en) * 1994-11-10 1999-09-21 Motorola, Inc. Data processor with transparent operation during a background mode and method therefor
US20200050350A1 (en) * 2018-08-08 2020-02-13 Samsung Electronics Co., Ltd. Electronic device and method for recognizing stylus pen
US20220011839A1 (en) * 2019-03-29 2022-01-13 Samsung Electronics Co., Ltd. Method for keyless reset, and electronic device therefor
CN110989822A (en) * 2019-11-27 2020-04-10 Tcl移动通信科技(宁波)有限公司 Sensor control method, sensor control device, storage medium and electronic equipment
CN112486309A (en) * 2020-11-27 2021-03-12 广东小天才科技有限公司 Method for determining duration corresponding to idle state, control chip and electronic equipment
CN113220154A (en) * 2021-03-15 2021-08-06 荣耀终端有限公司 Control method and system of refresh rate and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄涛 等: ""Linux系统基于PIC中断实现的分析"", 《攀枝花学院学报》, vol. 23, no. 3, pages 94 - 98 *

Also Published As

Publication number Publication date
CN115562464B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
EP3830677B1 (en) Changing a mode of operation of a computing device by a pen device
JP5952486B2 (en) Terminal control method and apparatus, and terminal
EP3834055B1 (en) Transitioning a computing device from a low power state based on sensor input of a pen device
US11048399B2 (en) Electronic device and method for recognizing stylus pen
US20140378052A1 (en) Communication apparatus, control method for communication apparatus, communication system, and program
RU2010145919A (en) POWER MANAGEMENT USING AT LEAST, ONE OF THE SPECIALIZED PROCESSOR AND PERCEPTION OF MOTION
CN110113449B (en) Terminal equipment and device retraction method
WO2017049552A1 (en) Terminal device and charging control method
CN114415850A (en) Control method and device, touch control pen and computer readable storage medium
CN114286433B (en) Method for reducing power consumption of equipment and electronic equipment
CN114217700B (en) Touch pen switching method and input device
CN115562464B (en) Control method for activation mode of electronic device, electronic device and storage medium
CN113015051A (en) Method and device for waking up earphone
JP6194716B2 (en) Remote controller
US20240053880A1 (en) Handwriting drawing method and apparatus, electronic device, and readable storage medium
CN112035050B (en) Control method, control device, storage medium and terminal device
CN111142958B (en) Active pen sleep awakening method, device, equipment and readable storage medium
JP7478608B2 (en) Position detection device and program
CN104536556B (en) Information processing method and electronic equipment
WO2017049551A1 (en) Terminal device and charging control method
CN111566593B (en) Zero-delay input device for machine learning
KR20210128118A (en) Electronic device for reducing power consumption associated with distance measurement and operating method thereof
CN112925404B (en) Power saving method, device, electronic equipment, storage medium and computer equipment
CN115599229B (en) Control method of touch pen and touch pen equipment
US12001619B2 (en) Electronic device for performing correction for stylus, and operation method therefor

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
GR01 Patent grant
GR01 Patent grant