Portable device for communicating with keyboard

The Hall sensor and processor detect keyboard access, establish UART interface communication, and receive keyboard data, solve the problem that the keyboard and portable devices require a built-in MCU in the prior art communication, and achieve cost reduction and complexity simplification.

CN222167592UActive Publication Date: 2024-12-13YIBIN TINNO COMM CO LT +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202323296080.3
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Priority Date
2022-12-28
Filing Date
2023-12-03
Publication Date
2024-12-13
Estimated Expiration
2033-12-03

AI Technical Summary

Technical Problem

In the prior art, communication between the keyboard and portable Android device requires a built-in dedicated MCU, resulting in the specialization of the device architecture and increasing cost and complexity.

Method used

Using Hall sensors and processors, the keyboard is detected through the UART interface, and a communication connection is established during access, keyboard data is received, the MCU on the portable device side is eliminated, and data transfer and transmission delay is reduced.

Benefits of technology

Reduces the cost and complexity of portable devices, improves flexibility and scalability, and reduces unnecessary data transfer and transmission delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN222167592U_ABST
    Figure CN222167592U_ABST
Patent Text Reader

Abstract

The utility model discloses a portable device used for communicating with a keyboard, comprising a sensor used for detecting the connection or disconnection of the keyboard and sending the detection state to the portable device; and the processor is used for directly establishing communication connection with the keyboard through the UART interface when the access of the keyboard is detected, and receiving keyboard data sent by the keyboard. According to the method provided by the invention, an MCU (Microprogrammed Control Unit) of a portable equipment end can be omitted, the cost and complexity of the portable equipment are reduced, the flexibility and expandability of the portable equipment are improved, unnecessary data transfer can be reduced, and the transmission time delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The utility model belongs to the field of data communication, and in particular relates to a portable device used for communicating with a keyboard.

[0002] CROSS-REFERENCE TO RELATED APPLICATIONS

[0003] This application claims priority to invention patent application application number CN202211701252.8 filed on December 28, 2022, the entire contents of which are incorporated herein by reference Background Art

[0004] Generally speaking, a PAD (Portable Android Device) refers to a device that can be carried by a user and can provide the user with various functions such as calls, message sending and receiving, schedule management, games, audio / video reproduction, etc., such as a mobile phone, a tablet computer, a digital multimedia player, etc. With the development of electronic and communication technologies, the internal architecture of the PAD and the keyboard has become more and more specialized for the communication between the keyboard and the PAD. For example, for a keyboard that supports a probe connector, a dedicated MCU needs to be built in the PAD to realize data transmission between the PAD and the keyboard. Summary of the invention

[0005] The purpose of this application is to provide a portable device for communicating with a keyboard to solve the technical problems in the prior art.

[0006] To achieve the above objectives, this application is implemented through the following technical solutions:

[0007] The present application provides a portable device for communicating with a keyboard, the portable device being connected to the keyboard and comprising: a Hall sensor for detecting the connection or disconnection of the keyboard; a processor connected to the Hall sensor and communicating with the keyboard via a UART interface, for receiving keyboard data sent by the keyboard when the connection of the keyboard is detected.

[0008] In some embodiments, the keyboard includes: a probe connector, connected to the processor of the portable device through the UART interface; an MCU, communicatively connected to the processor through the UART interface and through the probe connector; a key circuit, connected to the MCU through a GPIO interface; wherein the key circuit is used to receive a key signal input by a user and transmit it to the MCU through the GPIO interface, and the MCU is used to process the key signal to obtain corresponding keyboard data, and send the corresponding keyboard data to the processor through the probe connector, or receive a corresponding keyboard control signal from the processor.

[0009] In some embodiments, the probe connector is also used to provide power supply to the processor.

[0010] In some embodiments, the probe connector is also used to provide power supply to the MCU; the keyboard also includes a low voltage difference linear stabilizer, which is connected to the MCU and the probe connector and is used to reduce the voltage value of the power supply provided by the probe connector to a preset value for use by the MCU.

[0011] In some embodiments, the probe connector is further used to provide a first power supply to the processor and a second power supply to the MCU, wherein the voltage value of the first power supply is the same as that of the second power supply.

[0012] In some embodiments, the keyboard further comprises an electromagnetic component for indicating connection or disconnection of the keyboard so as to be detected by the Hall sensor.

[0013] The present application also provides a communication method, wherein the portable device is a portable device as described above, and the method comprises: detecting the connection or disconnection of the keyboard through the Hall sensor; when the connection of the keyboard is detected, the processor establishes a communication connection with the keyboard through the UART interface, and receives keyboard data sent by the keyboard from the keyboard through the communication connection.

[0014] In some embodiments, when access to the keyboard is detected, the processor establishes a communication connection with the keyboard through a UART interface, and receives keyboard data sent by the keyboard from the keyboard through the communication connection, including: when the processor receives an interrupt response to access to the keyboard, establishing a communication connection with the keyboard through the UART interface; and receiving keyboard data sent by the keyboard through the communication connection.

[0015] In some embodiments, when receiving an interrupt response to keyboard access, the processor also stops the currently executing task and executes a specific interrupt handler to access the keyboard.

[0016] In some embodiments, the keyboard data is data obtained by encoding the original data by the MCU of the keyboard; receiving the keyboard data sent by the keyboard through the communication connection also includes: decoding the keyboard data, thereby performing corresponding processing according to the decoded data.

[0017] The present application further provides a portable device for communicating with a keyboard, the portable device being connected to the keyboard and comprising: a sensor for detecting the connection or disconnection of the keyboard; a processor connected to the sensor and communicating with the keyboard via a UART interface, for receiving keyboard data sent by the keyboard when the connection of the keyboard is detected; wherein the sensor comprises a pressure sensor, a position sensor, a Hall sensor, a magnetoresistive sensor, or an inductive sensor, etc.

[0018] In some embodiments, the keyboard includes: a probe connector, connected to the processor of the portable device through the UART interface; an MCU, communicatively connected to the processor through the UART interface and through the probe connector; a key circuit, connected to the MCU through a GPIO interface; wherein the key circuit is used to receive a key signal input by a user and transmit it to the MCU through the GPIO interface, and the MCU is used to process the key signal to obtain corresponding keyboard data, and send the corresponding keyboard data to the processor through the probe connector, or receive a corresponding keyboard control signal from the processor.

[0019] In some embodiments, the probe connector is also used to provide power supply to the processor.

[0020] In some embodiments, the probe connector is also used to provide power supply to the MCU; the keyboard also includes a low voltage difference linear stabilizer, which is connected to the MCU and the probe connector and is used to reduce the voltage value of the power supply provided by the probe connector to a preset value for use by the MCU.

[0021] In some embodiments, the probe connector is further used to provide a first power supply to the processor and a second power supply to the MCU, wherein the voltage value of the first power supply is the same as that of the second power supply.

[0022] In some embodiments, the keyboard further comprises an electromagnetic component for indicating connection or disconnection of the keyboard so as to be detected by the sensor.

[0023] The present application also provides a communication method, wherein the portable device is a portable device as described above, and the method comprises: detecting the connection or disconnection of the keyboard through the sensor; when the connection of the keyboard is detected, the processor establishes a communication connection with the keyboard through a UART interface, and receives keyboard data sent by the keyboard from the keyboard through the communication connection.

[0024] In some embodiments, when access to the keyboard is detected, the processor establishes a communication connection with the keyboard through a UART interface, and receives keyboard data sent by the keyboard from the keyboard through the communication connection, including: when the processor receives an interrupt response to access to the keyboard, establishing a communication connection with the keyboard through the UART interface; and receiving keyboard data sent by the keyboard through the communication connection.

[0025] In some embodiments, when receiving an interrupt response to keyboard access, the processor also stops the currently executing task and executes a specific interrupt handler to access the keyboard.

[0026] In some embodiments, the keyboard data is data obtained by encoding the original data by the MCU of the keyboard; receiving the keyboard data sent by the keyboard through the communication connection also includes: decoding the keyboard data, thereby performing corresponding processing according to the decoded data.

[0027] Compared with the prior art, the above technical solution adopted in this application has the following beneficial effects: the portable device includes a sensor and a processor, wherein the sensor is used to detect the connection or disconnection of the keyboard; when the processor detects the connection of the keyboard, it establishes a communication connection with the keyboard through the UART interface, and receives keyboard data sent by the keyboard from the keyboard through the communication connection. The method provided in this application can save the MCU on the portable device side, save costs, and can reduce unnecessary data transfer and reduce transmission delay. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 is a schematic diagram of the framework of a portable device according to an embodiment of the present application;

[0029] Figure 2 It is a schematic diagram of the framework of the keyboard of the embodiment of the present application;

[0030] Figure 3 is a schematic diagram of the framework of a portable device and a keyboard according to an embodiment of the present application;

[0031] Figure 4 is another schematic diagram of a keyboard according to an embodiment of the present application;

[0032] Figure 5 is another schematic diagram of a keyboard according to an embodiment of the present application;

[0033] Figure 6 is a schematic diagram of a communication method according to an embodiment of the present application;

[0034] Figure 7 is a schematic diagram of a communication method for keyboard access according to an embodiment of the present application;

[0035] Figure 8 is a schematic diagram of the communication connection of an embodiment of the present application;

[0036] Fig. 9 is a schematic diagram of a framework of a portable device according to another embodiment of the present application;

[0037] Fig.10 is a schematic diagram of a keyboard framework according to another embodiment of the present application;

[0038] Fig.11 It is a schematic diagram of a communication method according to another embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0040] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0041] Embodiment 1: A portable device of the present application.

[0042] See also Figure 1 , Figure 1 1 is a schematic diagram of a portable device 100 according to an embodiment of the present application. The portable device 100 is connected to a keyboard 200, which may be a keyboard supporting a specific probe connector, for example, a keyboard supporting a POGO PIN. The portable device 100 includes a Hall sensor 110 and a processor 120.

[0043] The Hall sensor 110 is used to detect whether the keyboard 200 is connected or disconnected.

[0044] The processor 120 is connected to the Hall sensor 110 and is in communication connection with the keyboard 200 via a UART interface, and is used for receiving keyboard data sent by the keyboard when access to the keyboard 200 is detected.

[0045] The Hall sensor 110 detects the connection or disconnection of the keyboard 200 and may generate a corresponding interrupt response.

[0046] The processor 120 may also be referred to as a CPU (Central Processing Unit). The processor 120 may be an integrated circuit chip having the ability to process signals. The processor 120 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 120 may be implemented by an integrated circuit chip.

[0047] The Hall sensor 110 detects the connection or disconnection of the keyboard 200 and generates a corresponding interrupt response. When the processor 120 detects the interrupt response, it knows the state of the keyboard 200, whether it is connected or disconnected. When the processor 120 of the portable device 100 detects the interrupt response indicating that the keyboard 200 is connected, the processor 120 starts to receive input from the keyboard 200. If the keyboard 200 is disconnected, the Hall sensor 110 generates a corresponding interrupt response. The processor 120 of the portable device 100 detects the interrupt response, and the portable device 100 knows that the keyboard 200 has been disconnected, and stops receiving input from the keyboard 200.

[0048] In this embodiment, the portable device includes a Hall sensor and a processor, wherein the Hall sensor is used to detect the connection or disconnection of the keyboard and send the detection status to the portable device, and the processor is used to directly establish a communication connection with the keyboard through the UART interface when the keyboard connection is detected, and receive keyboard data sent by the keyboard, thereby eliminating the MCU on the portable device side, reducing the cost and complexity of the portable device, improving the flexibility and scalability of the portable device, and reducing unnecessary data transfer and transmission delay.

[0049] See also Figure 2 , Figure 2 2 is a schematic diagram of a keyboard 200 according to an embodiment of the present application. The keyboard 200 includes a probe connector 210 , an MCU 220 , and a key circuit 230 .

[0050] The probe connector 210 is connected to the processor 120 of the portable device 100 via a UART interface, and is used to implement function expansion and status monitoring of the keyboard 200. The probe connector 210 may be a POGO PIN connector.

[0051] The MCU 220 is connected to the processor 120 through the UART interface and the probe connector 210 to process input information of the keys on the keyboard 200 .

[0052] The key circuit 230 is connected to the MCU 220 via a GPIO interface, wherein the GPIO interface is used to transmit key signals, status and other information of the key circuit 230 to the MCU 220 .

[0053] Specifically, the key circuit 230 is used to receive the key signal input by the user and transmit it to the MCU220 through the GPIO interface. The MCU 220 is used to process the key signal to obtain corresponding keyboard data, and send the corresponding keyboard data to the processor 120 through the probe connector 210, or receive the corresponding keyboard control signal from the processor 120.

[0054] As described above, the probe connector 210 is connected to the processor 120 of the portable device 100 via a UART interface. Figure 3 As shown, Figure 3 2 is a schematic diagram of the framework of the portable device and the keyboard of the embodiment of the present application. In some embodiments, the probe connector 210 is also used to provide power supply to the processor 120. The probe connector 210 can connect the power supply to the circuit board inside the keyboard 200 through corresponding wires.

[0055] In some other embodiments, the probe connector 210 is also used to provide power supply to the MCU 220 .

[0056] See also Figure 4 , Figure 4 2 is another schematic diagram of a keyboard 200 according to an embodiment of the present application. When the probe connector 210 is used to provide power supply to the MCU 220, the keyboard 200 further includes a low voltage difference linear stabilizer 240. The low voltage difference linear stabilizer 240 is connected to the MCU 220 and the probe connector 210, and is used to reduce the voltage value of the power supply provided by the probe connector 210 to a preset value for use by the MCU 220. For example, the voltage value of the power supply provided by the probe connector 210 is reduced from 3.3V to a preset value of 1.8V for use by the MCU 220.

[0057] Specifically, the probe connector 210 provides a power supply voltage value, but this voltage value may be too high or unstable, and a low voltage drop linear stabilizer 240 is used to reduce the power supply voltage to a preset value to provide a stable power supply. In this way, the MCU 220 can be used normally and will not be affected by voltage fluctuations.

[0058] In some further embodiments, the probe connector 210 is further used to provide a first power supply to the processor 120 and a second power supply to the MCU 220, wherein the voltage value of the first power supply is the same as the voltage value of the second power supply. That is, the probe connector 210 is used to provide power supply to the processor 120 and the MCU 220 of the portable device 100, wherein the voltage of the power supply is the same, for example, it can be 3.3V.

[0059] The processor 120 uses the first power supply to work, and the MCU 220 uses the second power supply to work. Because the voltage values ​​of the two are the same, the processor 120 and the MCU 220 are powered simultaneously through the probe connector 210. In this way, the processor 120 and the MCU 220 can work with a stable voltage and will not be affected by external power supply voltage fluctuations.

[0060] See also Figure 5 , Figure 5 2 is another schematic diagram of a keyboard 200 according to an embodiment of the present application. The keyboard 200 further includes an electromagnetic component 250 for indicating the connection or disconnection of the keyboard so that the Hall sensor 110 can detect it.

[0061] Specifically, the electromagnetic component 250 can be a small magnetic ring, which is located at the interface of the keyboard 200. When the keyboard 200 is connected to the portable device 100, the electromagnetic component 250 will sense the magnetic field and generate current. This current can be detected by the Hall sensor 110, so that the portable device 100 can recognize the connection of the keyboard 200.

[0062] When the keyboard 200 is disconnected, the electromagnetic assembly 250 no longer generates current, and the Hall sensor 110 cannot detect the existence of the keyboard 200. This allows the portable device 100 to know that the keyboard 200 has been disconnected and stop interacting with it.

[0063] See also Figure 6 , Figure 6 is a schematic diagram of a communication method according to an embodiment of the present application. The method is applied to a portable device and comprises the following steps:

[0064] S610 : Detecting the connection or disconnection of the keyboard 200 through the Hall sensor 110 .

[0065] Specifically, the Hall sensor 110 may generally be composed of a coil and a magnet. When the magnetic field around the coil changes, the coil generates current, thereby causing the magnet to move. When the keyboard 200 is connected or disconnected, the magnetic field of the keyboard 200 affects the coil of the Hall sensor 110, and then causes the magnet to move, so that the Hall sensor 110 detects the connection or disconnection of the keyboard 200.

[0066] S620: The processor 120 establishes a communication connection with the keyboard 200 through the UART interface, and receives keyboard data sent by the keyboard 200 from the keyboard 200 through the communication connection.

[0067] The keyboard data sent by the keyboard 200 usually includes status information of keys of the keyboard 200, such as whether the keys are pressed or released.

[0068] As described above, when the keyboard 200 is detected, the processor 120 establishes a communication connection with the keyboard 200 via the UART interface. Figure 7 , Figure 7 Schematic diagram of a communication method for keyboard 200 access according to an embodiment of the present application. The method comprises the following steps:

[0069] S710: When the processor 120 receives an interrupt response indicating access of the keyboard 200, a communication connection with the keyboard 200 is established through the UART interface.

[0070] Specifically, when the Hall sensor 110 detects the access of the keyboard 200, an interrupt response is usually sent through a line connected to an interrupt controller of the portable device 100. The interrupt controller is a special circuit that is responsible for receiving an interrupt response from an external device and forwarding it to the processor 120. When the Hall sensor 110 sends an interrupt response, the interrupt controller forwards the signal to the processor 120. The processor 120 usually receives the interrupt response through an interrupt request line.

[0071] When the processor 120 receives an interrupt response, it executes an interrupt handler. The interrupt handler is a special program that is responsible for processing interrupt responses from external devices. The interrupt handler uses the UART interface to establish a communication connection with the keyboard 200 and read data from the keyboard 200.

[0072] S720: Receive keyboard data sent by the keyboard 200 through the communication connection.

[0073] The processor 120 may update the state of the keyboard 200 according to the received keyboard data and respond to the input of the keyboard 200 .

[0074] In some embodiments, when receiving an interrupt response to access of the keyboard 200 , the processor 120 also stops the currently executing task and executes a specific interrupt handler to access the keyboard 200 .

[0075] The function of this interrupt handler is to establish a communication connection with the keyboard 200 and process data from the keyboard 200.

[0076] Specifically, when receiving the access interrupt of the keyboard 200, the processor 120 stops the currently executing task and jumps to a specific memory address to execute the interrupt processing program. This memory address is usually set when the operating system is started and is used to process all interrupts.

[0077] Before jumping to the interrupt handler, the processor 120 saves the current state, including the program counter and stack pointer, etc. This is done to restore the original task after the interrupt handler is executed. The interrupt handler reads the data in the keyboard 200 buffer and converts it into appropriate input events, such as key presses or key releases. Then, it sends these events to the operating system or other applications for corresponding processing.

[0078] After completing the interrupt handling procedure, the processor 120 will restore the original state and continue to execute the original task.

[0079] In some embodiments, keyboard data sent by keyboard 200 is received through a communication connection, see Figure 8 , Figure 8 This is a schematic diagram of the communication connection of the embodiment of the present application. The process includes the following steps:

[0080] S810: The keyboard 200 encodes the data to be transmitted, and sends the encoded data to the portable device 100 through the UART interface.

[0081] Specifically, the keyboard 200 encodes the data to be sent into a serial data stream in a format that complies with the requirements of the UART protocol, and then sends the data stream to the portable device 100 through the UART interface.

[0082] S820: The portable device 100 receives and decodes the encoded data, thereby performing corresponding processing according to the decoded data.

[0083] Specifically, after the portable device 100 receives the data stream from the keyboard 200 through the UART interface, a UART interrupt is generated and the data stream is transmitted to the processor 120 to notify the processor 120 to process the keyboard data. After receiving the data stream, the processor 120 decodes it into original data, thereby performing corresponding operations according to the original data.

[0084] Embodiment 2: Another portable device of the present application.

[0085] See also Fig. 9 , Fig. 9 1 is a schematic diagram of a portable device 100 according to another embodiment of the present invention. The portable device 100 is connected to a keyboard 200 , which may be a keyboard supporting a specific probe connector, such as a keyboard supporting a POGO PIN. The portable device 100 includes a sensor 130 and a processor 120 .

[0086] The sensor 130 is used to detect whether the keyboard 200 is connected or disconnected.

[0087] The processor 120 is connected to the sensor 130 and is in communication connection with the keyboard 200 via a UART interface, and is used for receiving keyboard data sent by the keyboard when access to the keyboard 200 is detected.

[0088] The sensor 130 detects the connection or disconnection of the keyboard 200 and may generate a corresponding interrupt response.

[0089] The processor 120 may also be referred to as a CPU (Central Processing Unit). The processor 120 may be an integrated circuit chip having the ability to process signals. The processor 120 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 120 may be implemented by an integrated circuit chip.

[0090] The sensor 130 detects the connection or disconnection of the keyboard 200 and generates a corresponding interrupt response. When the processor 120 detects the interrupt response, it knows the state of the keyboard 200, whether it is connected or disconnected. When the processor 120 of the portable device 100 detects the interrupt response indicating that the keyboard 200 is connected, the processor 120 starts to receive input from the keyboard 200. If the keyboard 200 is disconnected, the sensor 130 generates a corresponding interrupt response. The processor 120 of the portable device 100 detects the interrupt response, and the portable device 100 knows that the keyboard 200 has been disconnected, and stops receiving input from the keyboard 200.

[0091] In this embodiment, the portable device includes a sensor and a processor, wherein the sensor is used to detect the connection or disconnection of the keyboard and send the detection status to the portable device, and the processor is used to directly establish a communication connection with the keyboard through the UART interface when the connection of the keyboard is detected, and receive keyboard data sent by the keyboard, thereby eliminating the MCU on the portable device side, reducing the cost and complexity of the portable device, improving the flexibility and scalability of the portable device, and reducing unnecessary data transfer and transmission delay.

[0092] See also Fig.10 , Fig.10 2 is a schematic diagram of a keyboard 200 according to another embodiment of the present invention. The keyboard 200 includes a probe connector 210 , an MCU 220 , and a key circuit 230 .

[0093] The probe connector 210 is connected to the processor 120 of the portable device 100 via a UART interface, and is used to implement function expansion and status monitoring of the keyboard 200. The probe connector 210 may be a POGO PIN connector.

[0094] The MCU 220 is connected to the processor 120 through the UART interface and the probe connector 210 to process input information of the keys on the keyboard 200 .

[0095] The key circuit 230 is connected to the MCU 220 via a GPIO interface, wherein the GPIO interface is used to transmit key signals, status and other information of the key circuit 230 to the MCU 220 .

[0096] Specifically, the key circuit 230 is used to receive the key signal input by the user and transmit it to the MCU220 through the GPIO interface. The MCU 220 is used to process the key signal to obtain corresponding keyboard data, and send the corresponding keyboard data to the processor 120 through the probe connector 210, or receive the corresponding keyboard control signal from the processor 120.

[0097] See also Fig.11 , Fig.11 is a schematic diagram of a communication method according to another embodiment of the present application. The method is applied to a portable device and comprises the following steps:

[0098] S1110 : Detecting the connection or disconnection of the keyboard 200 through the sensor 130 .

[0099] Specifically, the sensor 130 includes a pressure sensor, a position sensor, an inductance sensor, a capacitance sensor, a displacement sensor, a rotary encoding sensor, an angle sensor, a thermal relay sensor, a motor integrated protection sensor, a piezomagnetic sensor, a radar sensor, a coil sensor, a capacitance sensor, an inductance sensor, an infrared sensor, a transformer sensor, a resistance sensor, a Hall sensor, an ultrasonic sensor, a grating sensor, a magnetic grating sensor, a thermal release infrared sensor, a magnetoelectric sensor, a Doppler sensor, a variable reluctance sensor, a differential transformer sensor, an optical fiber sensor, a strain sensor, a resonant sensor, a piezoelectric sensor, a ceramic sensor, a diffused silicon sensor or a sapphire sensor, so that the sensor 130 detects the connection or disconnection of the keyboard 200.

[0100] Specifically, the sensor 130 is composed of a magnetic sensor, especially a Hall sensor, a magnetoresistive sensor, or an inductive sensor.

[0101] S1120: The processor 120 establishes a communication connection with the keyboard 200 through the UART interface, and receives keyboard data sent by the keyboard 200 from the keyboard 200 through the communication connection.

[0102] The keyboard data sent by the keyboard 200 usually includes status information of keys of the keyboard 200, such as whether the keys are pressed or released.

[0103] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A portable device, characterized in that: Connect with keyboard, including: A sensor for detecting the connection or disconnection of the keyboard; A processor connected to the sensor and connected to the keyboard through a UART interface, and configured to receive keyboard data sent by the keyboard when access to the keyboard is detected; Wherein, the sensor includes a pressure sensor, a position sensor, a Hall sensor, a magnetoresistive sensor, or an inductive sensor.

2. The portable device according to claim 1, characterized in that The keyboard comprises: a probe connector connected to the processor of the portable device via the UART interface; MCU, connected to the processor through the UART interface and the probe connector; A key circuit is connected to the MCU via a GPIO interface; Among them, the key circuit is used to receive the key signal input by the user and transmit it to the MCU through the GPIO interface. The MCU is used to process the key signal to obtain corresponding keyboard data, and send the corresponding keyboard data to the processor through the probe connector, or receive the corresponding keyboard control signal from the processor.

3. The portable device according to claim 2, characterized in that The probe connector is also used to provide power supply to the processor.

4. The portable device according to claim 2, characterized in that The probe connector is also used to provide power supply to the MCU; The keyboard also includes a low voltage difference linear stabilizer, which is connected to the MCU and the probe connector and is used to reduce the voltage value of the power supply provided by the probe connector to a preset value for use by the MCU.

5. The portable device according to claim 2, characterized in that The probe connector is also used to provide a first power supply to the processor and a second power supply to the MCU, wherein the voltage value of the first power supply is the same as that of the second power supply.

6. The portable device according to any one of claims 1 to 5, characterized in that: The keyboard also includes an electromagnetic component for indicating the connection or disconnection of the keyboard so that the sensor can detect it.