Key on-off circuit, control method and control device thereof, equipment and medium
By using the button state detection to control the on/off of the power module and the LCD power supply circuit in the key switch circuit, the problem of high power consumption and cost in the prior art is solved, and low power consumption and low cost power management is achieved.
Patent Information
- Application Number
- CN202411330264.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-20
AI Technical Summary
Existing key switch circuits increase system power consumption and cost in low-power applications, mainly due to the need to use frequently powered voltage conversion chips.
A circuit including buttons, power control circuits, button detection circuits, power modules and controllers is designed. The power modules and LCD power supply circuits are controlled through button status detection, avoiding the use of voltage conversion chips.
It reduces standby power consumption and system cost, and at the same time realizes the normal operation of the key switch function.
Smart Images

Figure CN119165937A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of circuit technology, and in particular to a key switch circuit and a control method, a control device, equipment and a medium thereof. Background Art
[0002] In order to prevent the device from being unable to shut down and continuing to consume energy when the current electronic devices are powered on, a key switch circuit is required. The current common key switch circuit requires a voltage conversion chip that is powered on all the time. Through the output of this voltage conversion chip, the key detection circuit realizes the system's power on and off function.
[0003] However, this voltage conversion chip consumes some current, which will increase the power consumption of the system in low-power applications and increase the cost of the system. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a key switch circuit and a control method, a control device, a device and a medium thereof, so as to reduce standby power consumption and system cost.
[0005] In the first aspect, an embodiment of the present invention provides a key switch circuit, the circuit comprising: a key, a power control circuit, a key detection circuit, a power module, a controller, and an LCD power supply circuit; the key is connected to the power control circuit, the key is connected to the key detection circuit, the power control circuit is connected to the power module, the power module is connected to the controller, and the controller is respectively connected to the power control circuit, the key detection circuit and the LCD power supply circuit; the power control circuit is used to control the power module, the key detection circuit is used to detect the state of the key, the key state includes a long press state and a short press state, the power module is used to supply power, and the controller is used to control the power control circuit based on the state of the key, and control the LCD power supply circuit based on the state of the key.
[0006] In a preferred embodiment of the present invention, the above-mentioned key detection circuit includes: a first resistor, a second resistor, a transistor, and a third resistor; the first end of the first resistor is connected to the key and to the power control circuit, the second end of the first resistor is connected to the first end of the second resistor and to the base of the transistor; the second end of the second resistor is grounded; the emitter of the transistor is grounded, and the collector of the transistor is connected to the first end of the third resistor; the second end of the third resistor is connected to the power supply voltage.
[0007] In a preferred embodiment of the present invention, the above-mentioned power control circuit includes: a first diode, a second diode, a fourth resistor, a fifth resistor, a sixth resistor and a capacitor; the anode of the first diode is connected to the button, and the cathode of the first diode is connected to the first end of the fourth resistor; the anode of the second diode is connected to the controller, and the cathode of the second diode is connected to the first end of the fifth resistor; the second end of the fourth resistor and the second end of the fifth resistor are both connected to the first end of the sixth resistor; the second end of the fourth resistor and the second end of the fifth resistor are both connected to the first end of the capacitor; the second end of the fourth resistor and the second end of the fifth resistor are both connected to the power module; the second end of the sixth resistor and the second end of the capacitor are both grounded.
[0008] In a second aspect, an embodiment of the present invention further provides a control method for a key switch circuit, which is used to control the key switch circuit of the first aspect, wherein the key switch circuit includes: a key, a power module, a controller, and an LCD power supply circuit; the method includes: pressing the key, starting the controller; detecting the state of the key to obtain a detection result; wherein the detection result is: the key is in one of a long press state and a short press state; the controller controls the circuit based on the detection result and the on / off status of the power module.
[0009] In a preferred embodiment of the present invention, the above-mentioned controller performs circuit control based on the detection result and the on-off status of the power module, including: if the on-off status of the power module is that the power module is disconnected, and the detection result is that the button is in a long-pressed state, the PWR_ON of the controller outputs a high level so that the power module can work after the button is released; if the on-off status of the power module is that the power module is connected, and the detection result is that the button is in a long-pressed state, the PWR_ON of the controller outputs a low level so that the power module can be cut off after the button is released.
[0010] In a preferred embodiment of the present invention, the above-mentioned controller performs circuit control based on the detection result and the on-off status of the power module, and also includes: if the on-off status of the power module is that the power module is disconnected, and the detection result is that the button is in a short press state, then it is determined that the power module does not work after the button is released; if the on-off status of the power module is that the power module is connected, and the detection result is that the button is in a short press state, then the circuit control is performed based on the on-off status of the LCD power supply circuit.
[0011] In a preferred embodiment of the present invention, the above-mentioned circuit control based on the on-off condition of the LCD power supply circuit includes: if the on-off condition of the LCD power supply circuit is that the LCD power supply circuit is connected, the PWR_ON of the controller maintains a high level output, and the LCD_ON of the controller and the LCD_PWM of the controller output corresponding logic levels to cut off the LCD power supply circuit; if the on-off condition of the LCD power supply circuit is that the LCD power supply circuit is disconnected, the LCD_ON of the controller and the LCD_PWM of the controller output corresponding logic levels to connect the LCD power supply circuit.
[0012] In a third aspect, an embodiment of the present invention further provides a control device for a key switch circuit, which is used to control the key switch circuit of the first aspect, wherein the key switch circuit includes: a key, a power module, a controller, and an LCD power supply circuit; the device includes: a controller startup module, which is used to press the key to start the controller; a key status detection module, which is used to detect the status of the key to obtain a detection result; wherein the detection result is: the key is in one of a long press state and a short press state; and a circuit control module, which is used for the controller to control the circuit based on the detection result and the on / off status of the power module.
[0013] In a fourth aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the control method of the key switch circuit of the second aspect mentioned above.
[0014] In a fifth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the control method of the key switch circuit of the second aspect mentioned above.
[0015] The embodiments of the present invention bring the following beneficial effects:
[0016] The embodiment of the present invention provides a key switch circuit and its control method, control device, equipment and medium, the circuit includes: a key, a power control circuit, a key detection circuit, a power module, a controller, and an LCD power supply circuit; the key is connected to the power control circuit, the key is connected to the key detection circuit, the power control circuit is connected to the power module, the power module is connected to the controller, and the controller is respectively connected to the power control circuit, the key detection circuit and the LCD power supply circuit; the power control circuit is used to control the power module, the key detection circuit is used to detect the state of the key, the key state includes a long press state and a short press state, the power module is used to supply power, and the controller is used to control the power control circuit based on the state of the key, and control the LCD power supply circuit based on the state of the key. The circuit not only reduces the standby power consumption, but also reduces the cost of the system.
[0017] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0018] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1a A structural diagram of a key switch circuit provided by an embodiment of the present invention;
[0021] Figure 1b A structural diagram of a key detection circuit provided by an embodiment of the present invention;
[0022] Figure 1c A structural diagram of a power control circuit provided by an embodiment of the present invention;
[0023] Figure 2 A flow chart of a control method of a key switch circuit provided by an embodiment of the present invention;
[0024] Figure 3 A schematic diagram of the structure of a control device for a key switch circuit provided by an embodiment of the present invention;
[0025] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0026] Diagram:
[0027] 101-button; 102-power control circuit; 103-button detection circuit; 104-power module; 105-controller; 106-LCD power supply circuit; R1-first resistor; R2-second resistor; T1-transistor; R3-third resistor; D1-first diode; D2-second diode; R4-fourth resistor; R5-fifth resistor; R6-sixth resistor; C1-capacitor; 301-starting module; 302-detection module; 303-circuit control module; 400-memory; 401-processor; 402-bus; 403-communication interface; DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] In order to prevent the device from being unable to shut down and continuing to consume energy when the current electronic devices are always powered, a key switch circuit is required. The current common key switch circuit requires a voltage conversion chip that is always powered. The output of this voltage conversion chip is used in conjunction with the key detection circuit to realize the system's power on and off function. However, this voltage conversion chip consumes some current, which will increase the system's power consumption in low-power applications and increase the system's cost.
[0030] Based on this, the embodiment of the present invention provides a key switch circuit and its control method, control device, equipment and medium, the circuit includes: a key, a power control circuit, a key detection circuit, a power module, a controller, and an LCD power supply circuit; the key is connected to the power control circuit, the key is connected to the key detection circuit, the power control circuit is connected to the power module, the power module is connected to the controller, and the controller is respectively connected to the power control circuit, the key detection circuit and the LCD power supply circuit; the power control circuit is used to control the power module, the key detection circuit is used to detect the state of the key, the key state includes a long press state and a short press state, the power module is used to supply power, and the controller is used to control the power control circuit based on the state of the key, and control the LCD power supply circuit based on the state of the key. The circuit not only reduces the standby power consumption, but also reduces the cost of the system.
[0031] To facilitate understanding of this embodiment, a key switch circuit disclosed in an embodiment of the present invention is first introduced in detail.
[0032] Example 1
[0033] The embodiment of the present invention provides a key switch circuit. Figure 1a This is a structural diagram of a key switch circuit provided by an embodiment of the present invention. Figure 1a As shown, the key switch circuit may include the following structures: a key 101 , a power control circuit 102 , a key detection circuit 103 , a power module 104 , a controller 105 , and an LCD power supply circuit 106 .
[0034] Among them, the button 101 is connected to the power control circuit 102, the button 101 is connected to the button detection circuit 103, the power control circuit 102 is connected to the power module 104, the power module 104 is connected to the controller 105, and the controller 105 is respectively connected to the power control circuit 102, the button detection circuit 103 and the LCD power supply circuit 106.
[0035] Specifically, the key detection circuit 103 is connected to GPIO1 of the controller 105, the power control circuit 102 is connected to GPIO2 of the controller 105, the LCD power supply circuit 106 is connected to GPIO3 of the controller 105 and GPIO4 of the controller 105, GPIO3 outputs LCD_ON, and GPIO4 outputs LCD PWM.
[0036] Specifically, Figure 1b A structural diagram of a key detection circuit provided by an embodiment of the present invention, such as Figure 1b As shown, the key detection circuit 103 includes: a first resistor R1, a second resistor R2, a transistor T1, and a third resistor R3.
[0037] Among them, the first end of the first resistor R1 is connected to the button 101 and to the power control circuit 102, the second end of the first resistor R1 is connected to the first end of the second resistor R2 and to the base of the transistor T1; the second end of the second resistor R2 is grounded; the emitter of the transistor T1 is grounded, and the collector of the transistor T1 is connected to the first end of the third resistor R3; the second end of the third resistor R3 is connected to the power supply voltage VCC_CPU.
[0038] The button 101 is connected to the power input VIN.
[0039] Specifically, Figure 1c A structural diagram of a power control circuit 102 provided in an embodiment of the present invention, such as Figure 1c As shown, the power control circuit 102 includes: a first diode D1, a second diode D2, a fourth resistor R4, a fifth resistor R5, a sixth resistor R6 and a capacitor C1;
[0040] Among them, the anode of the first diode D1 is connected to the button 101, and the cathode of the first diode D1 is connected to the first end of the fourth resistor R4; the anode of the second diode D2 is connected to the controller 105, and the cathode of the second diode D2 is connected to the first end of the fifth resistor R5; the second end of the fourth resistor R4 and the second end of the fifth resistor R5 are both connected to the first end of the sixth resistor R6; the second end of the fourth resistor R4 and the second end of the fifth resistor R5 are both connected to the first end of the capacitor C1; the second end of the fourth resistor R4 and the second end of the fifth resistor R5 are both connected to the power module 104; the second end of the sixth resistor R6 and the second end of the capacitor C1 are both grounded.
[0041] Among them, the power control circuit 102 is used to control the power module 104, the button detection circuit 103 is used to detect the state of the button 101, the button 101 state includes a long press state and a short press state, the power module 104 is used to supply power, and the controller 105 is used to control the power control circuit 102 based on the state of the button 101, and control the LCD power supply circuit 106 based on the state of the button 101.
[0042] In actual applications, when the power input VIN is normally powered and the button 101 is in the state of long pressing, the KEY_PWR of the button 101 outputs the power supply voltage VIN, and through the circuit composed of the first diode D1, the fourth resistor R4, the sixth resistor R6 and the first capacitor C1, the PWR_SYS of the power control circuit 102 outputs a suitable voltage, so that the power module 104 works normally, and the controller 105 starts working normally. At this time, the base voltage of the transistor T1 is: VIN*R2 / (R1+R2), and the transistor T1 is turned on. At this time, the KEY_ON of the key detection circuit 103 is a low level, and the controller 105 compares the duration of the KEY_ON low level with the duration preset by the controller 105. If the duration of the KEY_ON low level is within the preset duration range, the PWR_ON of the controller 105 outputs a high level, and the LCD_ON and LCD_PWM of the controller 105 output suitable logic levels, turn on the LCD power supply circuit 106, and light up the LCD screen. After the key 101 is long pressed and released, KEY_PWR is disconnected. At this time, PWR_ON outputs a high level to maintain PWR_SYS outputting a suitable voltage, maintaining the normal operation of the power module 104, and further maintaining the normal operation of the controller 105.
[0043] After the whole system works normally, when the key 101 is in the short-press state, the controller 105 compares the duration of the low level of KEY_ON with the single trigger duration set by the controller 105. If it is within the set single trigger duration, the PWR_ON of the controller 105 outputs a high level, and the LCD_ON and LCD_PWM of the controller 105 output a suitable logic level, and the LCD power supply circuit 106 is cut off to realize the LCD screen off. When the key 101 is short-pressed again, the LCD_ON and LCD_PWM of the controller 105 output a suitable logic level, and the LCD power supply circuit 106 is turned on again to realize the LCD wake-up.
[0044] After the system works normally, when button 101 is in long-press state, it means that the system is going to shut down. Controller 105 compares the duration of the KEY_ON low level with the duration set by controller 105. If the duration of the KEY_ON low level is within the normal range of the set duration, PWR_ON of controller 105 outputs a low level. After button 101 is released, PWR_SYS outputs a low level, the power module 104 cannot supply power normally, and the entire system shuts down.
[0045] Specifically, VIN can be 24V, 12V, 5V, etc., and the power supply module 104 can be adjusted according to different power supply voltages. VCC_CPU can be 3.3V, 1.8V, etc., and a suitable selection can be made according to different main controls.
[0046] Specifically, the first resistor R1 is used to limit the current to prevent the base of the transistor T1 from being damaged by overcurrent; the second resistor R2 is used to set the default state of the transistor T1 to be cut off to prevent the transistor T1 from being triggered by mistake; the third resistor R3 is used for collector current limiting and is also used to set the initial state of KEY_ON to a high level. The transistor T1 can also be replaced by a MOS tube.
[0047] Specifically, the first diode D1 and the second diode D2 are used to select KEY_PWR or PWR_ON to control the power supply module 104 to work normally. When KEY_PWR outputs the power supply voltage, the second diode D2 is used to prevent the current from flowing back to the controller 105. When PWR_ON outputs a high level, the first diode D1 is used to prevent the current from flowing back to the power supply.
[0048] Specifically, the fourth resistor R4 and the fifth resistor R5 are used for current limiting, the sixth resistor R6 and the capacitor C1 form a filter circuit, and the fourth resistor R4 and the capacitor C1 form a short delay circuit to prevent the system from failing to start normally after the button 101 is released when the power needs to be turned on.
[0049] The key switch circuit provided by the embodiment of the present invention includes: a key, a power control circuit, a key detection circuit, a power module, a controller, and an LCD power supply circuit; the key is connected to the power control circuit, the key is connected to the key detection circuit, the power control circuit is connected to the power module, the power module is connected to the controller, and the controller is respectively connected to the power control circuit, the key detection circuit, and the LCD power supply circuit; the power control circuit is used to control the power module, the key detection circuit is used to detect the state of the key, and the key state includes a long press state and a short press state, the power module is used to supply power, and the controller is used to control the power control circuit based on the state of the key, and control the LCD power supply circuit based on the state of the key. The circuit not only reduces the standby power consumption, but also reduces the cost of the system.
[0050] Example 2
[0051] The embodiment of the present invention further provides a control method of a key switch circuit; the method is used to control the key switch circuit mentioned above.
[0052] Figure 2 A flowchart of a control method for a key switch circuit provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the control method of the key switch circuit may include the following steps:
[0053] Step S201, press the button and start the controller.
[0054] Among them, at the beginning, the power input VIN is powered normally, VIN is connected to the KEY_PWR network of the button, the power control circuit outputs a high level, and the power module outputs a normal voltage to ensure that the controller starts after the button is pressed.
[0055] Step S202, detecting the state of the key to obtain a detection result.
[0056] The state of a button may include a long press state and a short press state.
[0057] The detection result may be one of: the key is in a long press state and the key is in a short press state.
[0058] Step S203: The controller performs circuit control based on the detection result and the on / off status of the power module.
[0059] Specifically, if the on / off status of the power module is that the power module is disconnected and the detection result is that the button is in a long-pressed state, the PWR_ON of the controller outputs a high level so that the power module can work after the button is released.
[0060] Specifically, if the on / off status of the power module is that the power module is connected, and the detection result is that the button is in a long-pressed state, the PWR_ON of the controller outputs a low level so that the power module is cut off after the button is released.
[0061] Among them, in this case, the entire system is shut down.
[0062] Specifically, if the on-off status of the power module is that the power module is disconnected and the detection result is that the button is in a short-press state, it is determined that the power module does not work after the button is released.
[0063] Among them, in this case, the entire system cannot work.
[0064] Specifically, if the on-off status of the power module is that the power module is connected and the detection result is that the key is in a short-press state, circuit control is performed based on the on-off status of the LCD power supply circuit.
[0065] Specifically, if the on / off status of the LCD power supply circuit is that the LCD power supply circuit is connected, the PWR_ON of the controller maintains a high level output, and the LCD_ON of the controller and the LCD_PWM of the controller output corresponding logic levels to cut off the LCD power supply circuit.
[0066] In this case, it is characterized by cutting off the LCD power supply circuit to cut off the power supply voltage and backlight voltage of the LCD screen, thereby realizing the screen off of the LCD screen.
[0067] Specifically, if the on-off condition of the LCD power supply circuit is that the LCD power supply circuit is disconnected, LCD_ON of the controller and LCD_PWM of the controller output corresponding logic levels to connect the LCD power supply circuit.
[0068] In this case, it is necessary to connect the LCD power supply circuit to ensure that the power supply voltage and backlight voltage of the LCD screen are output normally, thereby waking up the LCD screen.
[0069] The control method of the key switch circuit provided in the embodiment of the present invention controls the power module and the LCD power supply circuit through the status of different keys. Without the need for a voltage conversion chip, the system power supply can be completely cut off when the key is turned off, thereby reducing standby power consumption and system costs.
[0070] Example 3
[0071] Corresponding to the above method embodiment, the present invention provides a control device for a key switch circuit, which is used to control the above-mentioned key switch circuit. Figure 3 A schematic diagram of a control device for a key switch circuit according to an embodiment of the present invention is shown in FIG. Figure 3 As shown, the control device of the key switch circuit may include:
[0072] The controller startup module 301 is used to start the controller by pressing a button.
[0073] The key state detection module 302 is used to detect the state of the key to obtain a detection result; wherein the detection result is: the key is in a long press state and the key is in a short press state.
[0074] The circuit control module 303 is used for the controller to control the circuit based on the detection result and the on / off status of the power module.
[0075] The control device of the key switch circuit provided in the embodiment of the present invention controls the power module and the LCD power supply circuit through the status of different keys. It can completely cut off the system power supply when the key is turned off without the need for a voltage conversion chip, thereby reducing standby power consumption and system costs.
[0076] In some embodiments, the circuit control module is also used to, if the on-off condition of the power module is that the power module is disconnected and the detection result is that the button is in a long-pressed state, then the PWR_ON of the controller outputs a high level so that the power module can work after the button is released; if the on-off condition of the power module is that the power module is connected and the detection result is that the button is in a long-pressed state, then the PWR_ON of the controller outputs a low level so that the power module can be cut off after the button is released.
[0077] In some embodiments, the circuit control module is also used to determine that the power module does not work after the button is released if the on-off condition of the power module is that the power module is disconnected and the detection result is that the button is in a short press state; if the on-off condition of the power module is that the power module is connected and the detection result is that the button is in a short press state, the circuit is controlled based on the on-off condition of the LCD power supply circuit.
[0078] In some embodiments, the circuit control module is further used for, if the on-off condition of the LCD power supply circuit is that the LCD power supply circuit is connected, the PWR_ON of the controller maintains a high level output, and the LCD_ON of the controller and the LCD_PWM of the controller output corresponding logic levels to cut off the LCD power supply circuit. If the on-off condition of the LCD power supply circuit is that the LCD power supply circuit is disconnected, the LCD_ON of the controller and the LCD_PWM of the controller output corresponding logic levels to connect the LCD power supply circuit.
[0079] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0080] Example 4
[0081] The embodiment of the present invention also provides an electronic device for operating the control method of the key switch circuit; see Figure 4 A structural schematic diagram of an electronic device is shown, which includes a memory 400 and a processor 401, wherein the memory 400 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 401 to implement the control method of the above-mentioned key switch circuit.
[0082] Further, Figure 4 The electronic device shown further includes a bus 402 and a communication interface 403 , and the processor 401 , the communication interface 403 and the memory 400 are connected via the bus 402 .
[0083] The memory 400 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 403 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 402 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0084] The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 401. The above processor 401 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 400, and the processor 401 reads the information in the memory 400 and completes the steps of the method of the above embodiment in combination with its hardware.
[0085] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the control method of the above-mentioned key switch circuit. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0086] The computer program product of the method for controlling a key switch circuit provided in an embodiment of the present invention includes a computer-readable storage medium storing a non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.
[0087] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0088] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0089] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0090] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0091] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0092] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A key switch circuit, It is characterized in that The circuit comprises: a button, a power control circuit, a button detection circuit, a power module, a controller, and an LCD power supply circuit; the button is connected to the power control circuit, the button is connected to the button detection circuit, the power control circuit is connected to the power module, the power module is connected to the controller, and the controller is respectively connected to the power control circuit, the button detection circuit, and the LCD power supply circuit; The power control circuit is used to control the power module, the key detection circuit is used to detect the state of the key, the key state includes a long press state and a short press state, the power module is used to supply power, and the controller is used to control the power control circuit based on the state of the key, and control the LCD power supply circuit based on the state of the key.
2. The key switch circuit according to claim 1, It is characterized in that The key detection circuit comprises: a first resistor, a second resistor, a triode, and a third resistor; The first end of the first resistor is connected to the button and to the power control circuit, the second end of the first resistor is connected to the first end of the second resistor and to the base of the transistor; the second end of the second resistor is grounded; the emitter of the transistor is grounded, and the collector of the transistor is connected to the first end of the third resistor; the second end of the third resistor is connected to the supply voltage.
3. The key switch circuit according to claim 1, It is characterized in that The power control circuit comprises: a first diode, a second diode, a fourth resistor, a fifth resistor, a sixth resistor and a capacitor; The anode of the first diode is connected to the button, and the cathode of the first diode is connected to the first end of the fourth resistor; the anode of the second diode is connected to the controller, and the cathode of the second diode is connected to the first end of the fifth resistor; the second end of the fourth resistor and the second end of the fifth resistor are both connected to the first end of the sixth resistor; the second end of the fourth resistor and the second end of the fifth resistor are both connected to the first end of the capacitor; the second end of the fourth resistor and the second end of the fifth resistor are both connected to the power module; the second end of the sixth resistor and the second end of the capacitor are both grounded.
4. A control method for a key switch circuit, It is characterized in that Used to control the key switch circuit according to any one of claims 1 to 3, wherein the key switch circuit comprises: a key, a power module, a controller, and an LCD power supply circuit; The method comprises: Press the button to start the controller; Detecting the state of the button to obtain a detection result; wherein the detection result is: the button is in a long-press state and the button is in a short-press state; The controller performs circuit control based on the detection result and the on / off status of the power module.
5. The method according to claim 4, It is characterized in that The controller performs circuit control based on the detection result and the on / off status of the power module, including: If the on / off status of the power module is that the power module is disconnected, and the detection result is that the button is in a long-pressed state, the PWR_ON of the controller outputs a high level so that the power module can work after the button is released; If the on / off status of the power module is that the power module is connected, and the detection result is that the button is in a long-press state, the PWR_ON of the controller outputs a low level so that the power module is cut off after the button is released.
6. The method according to claim 5, It is characterized in that The controller performs circuit control based on the detection result and the on / off status of the power module, and further includes: If the on / off status of the power module is that the power module is disconnected, and the detection result is that the button is in a short-press state, it is determined that the power module does not work after the button is released; If the on / off status of the power module is that the power module is connected, and the detection result is that the button is in a short-press state, circuit control is performed based on the on / off status of the LCD power supply circuit.
7. The method according to claim 6, It is characterized in that The circuit control based on the on / off status of the LCD power supply circuit includes: If the on / off condition of the LCD power supply circuit is that the LCD power supply circuit is connected, the PWR_ON of the controller maintains a high level output, and the LCD_ON of the controller and the LCD_PWM of the controller output corresponding logic levels to cut off the LCD power supply circuit; If the on / off condition of the LCD power supply circuit is that the LCD power supply circuit is disconnected, LCD_ON of the controller and LCD_PWM of the controller output corresponding logic levels to connect the LCD power supply circuit.
8. A control device for a key switch circuit, It is characterized in that Used to control the key switch circuit according to any one of claims 1 to 3, wherein the key switch circuit comprises: a key, a power module, a controller, and an LCD power supply circuit; The device comprises: A controller start module, used to start the controller by pressing the button; A key state detection module, used to detect the state of the key to obtain a detection result; wherein the detection result is: the key is in a long press state and the key is in a short press state; A circuit control module is used for the controller to perform circuit control based on the detection result and the on / off status of the power module.
9. An electronic device, It is characterized in that It comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the control method of the key switch circuit according to any one of claims 4 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the control method of the key switch circuit according to any one of claims 4 to 7.
