CN112559062B - Method for keyboard to be compatible with multiple software - Google Patents

Method for keyboard to be compatible with multiple software Download PDF

Info

Publication number
CN112559062B
CN112559062B CN202011531993.7A CN202011531993A CN112559062B CN 112559062 B CN112559062 B CN 112559062B CN 202011531993 A CN202011531993 A CN 202011531993A CN 112559062 B CN112559062 B CN 112559062B
Authority
CN
China
Prior art keywords
country code
keyboard
value
turning
software
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.)
Active
Application number
CN202011531993.7A
Other languages
Chinese (zh)
Other versions
CN112559062A (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.)
Shenzhne Dns Industries Co ltd
Original Assignee
Shenzhne Dns Industries 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 Shenzhne Dns Industries Co ltd filed Critical Shenzhne Dns Industries Co ltd
Priority to CN202011531993.7A priority Critical patent/CN112559062B/en
Publication of CN112559062A publication Critical patent/CN112559062A/en
Application granted granted Critical
Publication of CN112559062B publication Critical patent/CN112559062B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4434Reducing the memory space required by the program code
    • G06F8/4435Detection or removal of dead or redundant code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Abstract

The invention discloses a keyboard multi-software compatible method. In the invention, 5 pins are reserved in the MCU on the PCBA board, and the pins are pulled up and pulled down through a hardware pull-down mode, wherein 31 combination modes are provided, for example: 00001 represents a key core layout, 00010 a key core layout, 00100 a key core layout, in such a way that compatibility of up to 31 software versions can be supported, thereby satisfying the key core layout supporting 31 out of 35 countries and also satisfying the requirement of the company keyboard country type. The software of 35 kinds of keyboards is used for processing codes, the difference part is correspondingly processed in a branch mode by detecting the values of 5 pins, and the same part is processed uniformly, so that the code redundancy is reduced. The software version is reduced, the production error version caused by confusion of production and version management is avoided, so that the economic loss is avoided, and the software maintenance and upgrading efficiency is greatly improved.

Description

Method for keyboard to be compatible with multiple software
Technical Field
The invention relates to the technical field of software programs, in particular to a method for enabling a keyboard to be compatible with multiple types of software.
Background
With the widespread use of ipads, iphones, and ipods, more and more students use ipads for video learning and lecture, Lightning MFi keys are in the way, and the key core layout of the Lightning MFi keys varies from country to country.
The lighting MFi Keyboard can support 35 countries, and the Keyboard of each country has different key core layouts, so that the software needs 35 versions, and if the software is incompatible, once the defect is modified, a plurality of software versions need to be maintained at the same time, which brings great inconvenience to version management, and in the production process, if the versions are too many, the burnt version and the version are disordered.
Disclosure of Invention
In view of the above-mentioned defects in the prior art, the technical problem to be solved by the present invention is to provide a method for a keyboard to be compatible with multiple types of software, so as to solve the deficiencies of the background art.
In order to achieve the purpose, the invention provides a method for realizing compatibility of a keyboard with multiple software, which comprises the following steps:
step S01: configuring the chip MCU, and then entering step S02;
step S02: configuring a system clock, and then proceeding to step S03;
step S03: configuring a GPIO pin of the MCU, and then entering step S04;
step S04: configuring the UART, the USB and the timer, starting the timer at the same time, and then entering the step S05;
step S05: after the system is started, level values of pins PA0 and PA1 and PA2, and level values of PA3 and PA4 of the chip MCU are read, and then the process goes to step S06;
step S06: the level value is converted into a numerical value, and then the process proceeds to step S07;
step S07: looking up a corresponding country code in a country code table according to the numerical value converted from the level value, and then proceeding to step S08;
step S08: if the corresponding country code is not found, ending the operation, and if the corresponding country code is found, going to step S09;
step S09: recording the value of the found country code using a global variable, and then proceeding to step S10;
step S10: the first step of starting authentication, packaging and reporting the authentication certificate to the iOS device, and then turning to the step S11;
step S11: if the authentication certificate fails, ending, the keyboard cannot be used, otherwise, turning to the step S12;
step S12: the certificate response is further packaged and then reported to the iOS device, and then goes to step S13;
step S13: if the certificate response fails, ending, and the keyboard cannot be used, otherwise, turning to step S14;
step S14: if the country code value is inquired, the step S15 is carried out, otherwise, the inquiry of the country code value is continued;
step S15: packaging the identity information corresponding to the country code value, reporting the identity information to the iOS equipment, and further verifying whether the identity meets the requirements;
step S16: if the identity is confirmed, the step S17 is entered, otherwise, the operation is ended and the keyboard cannot be used;
step S17: firstly, packaging human-computer interface HID information shared by all countries, and then turning to step S18;
step S18: if the country code value is confirmed, proceeding to step S19, otherwise, continuing to confirm the country code value;
step S19: encapsulating StartHID information corresponding to the country code value, reporting the information to the iOS equipment, and then turning to the step S20;
step S20: if the StartHID is successfully sent, the step S21 is carried out, otherwise, the operation is ended, and the keyboard cannot be used;
step S21: detecting whether a key is pressed in real time, and then entering step S22;
step S22: if yes, go to step S23, otherwise continue to detect the key, return to step S21;
step S23: encapsulating the pressed key value into HID Report information, then reporting the HID Report information to the OS equipment, and going to step S24;
step S24: and if the HID Report is successfully reported, returning to the step S21, continuously detecting whether the key is pressed, and if not, ending the operation.
The method of claim 1, wherein the method comprises: the iOS device comprises an iPad, an iPhone or an iPod.
The invention has the beneficial effects that:
the invention reduces the software version, avoids the confusion of production and version management and the production error version, thereby avoiding the economic loss and greatly improving the software maintenance and upgrading efficiency.
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
Drawings
FIG. 1 is a flow chart of a method of an embodiment of the present invention.
Detailed Description
As shown in fig. 1, the present invention provides a method for making a keyboard compatible with multiple types of software, comprising the following steps:
step S01: the configuration of the chip MCU immediately proceeds to step S02;
step S02: the configuration of the system clock is followed by proceeding to step S03;
step S03: the GPIO pin configuration of the MCU immediately enters step S04;
step S04: UART, USB and timer configuration, starting the timer at the same time, and then entering step S05;
step S05: after the system is up, the level values of the pins PA0 and PA1 and PA2 and PA3 and PA4 are read, and then the process proceeds to step S06;
step S06: converts the level value into a numerical value for the subsequent processing, and then proceeds to step S07;
step S07: looking up a corresponding country code in a country code table according to the numerical value converted from the level value, and then proceeding to step S08;
step S08: if the corresponding country code is not found, ending the operation, and if the corresponding country code is found, going to step S09;
step S09: recording the value of the found country code using a global variable, and then proceeding to step S10;
step S10: starting the first step of authentication, packaging and reporting the authentication certificate to the iOS device, such as iPad, iPhone or iPod, and then turning to the step S11;
step S11: if the authentication certificate fails, ending, the keyboard cannot be used, otherwise, turning to the step S12;
step S12: further packaging the certificate response, and then reporting to the iOS device, such as iPad, iPhone, or iPod, and then proceeding to step S13;
step S13: if the certificate response fails, ending, and the keyboard cannot be used, otherwise, turning to step S14;
step S14: if the country code value is US, go to step S15, otherwise go to step S16;
step S15: encapsulating the identity information of the US, reporting the identity information to iOS equipment such as iPad, iPhone or iPod, and then turning to the step S22 to further verify whether the identity meets the requirements;
step S16: if the country code value is Japan, then step S17 is entered, otherwise step S18 is entered;
step S17: packaging the identity information of Japan, reporting the identity information to iOS equipment such as iPad, iPhone or iPod, and then turning to step S22 to further verify whether the identity meets the requirements;
step S18: if the country code value is Swedish, go to step S19, otherwise go to step S20;
step S19: encapsulating the identity information of Swedish, reporting the identity information to iOS equipment, such as iPad, iPhone or iPod, and then turning to the step S22 to further verify whether the identity meets the requirements;
step S20: if the country code value is German, then step S21 is entered, otherwise, it indicates that all country codes are not satisfied, the operation is ended, and the keyboard cannot be used;
step S21: encapsulating the identity information of the German, reporting the identity information to iOS equipment, such as iPad, iPhone or iPod, and then turning to the step S22 to further verify whether the identity meets the requirements;
step S22: if the identity is confirmed, the step S23 is entered, otherwise, the operation is ended and the keyboard cannot be used;
step S23: firstly, packaging human-computer interface HID information shared by all countries, and then turning to step S24;
step S24: if the country code value is US, go to step S25, otherwise go to step S26;
step S25: encapsulating the US StartHID information, reporting the US StartHID information to iOS equipment such as iPad, iPhone or iPod, and then turning to the step S32;
step S26: if the country code value is Japan, then step S27 is entered, otherwise step S28 is entered;
step S27: encapsulating StartHID information of Japan, reporting the information to iOS equipment such as iPad, iPhone or iPod, and then turning to the step S32;
step S28: if the country code value is Swedish, go to step S29, otherwise go to step S30;
step S29: encapsulating the StartHID information of Swedish, reporting the information to iOS equipment such as iPad, iPhone or iPod, and then turning to the step S32;
step S30: if the country code value is German, then step S31 is entered, otherwise the operation is ended and the keyboard cannot be used;
step S31: encapsulating the StartHID information of German, reporting the information to iOS equipment such as iPad, iPhone or iPod, and then turning to the step S32;
step S32: if the StartHID is successfully sent, the step S33 is carried out, otherwise, the operation is ended, and the keyboard cannot be used;
step S33: detecting whether the key is pressed in real time, and then entering step S34;
step S34: if yes, go to step S35, otherwise continue to detect the key, return to step S33;
step S35: packaging HID Report information according to the pressed key value, then reporting the HID Report information to an OS device such as an iPad, an iPhone or an iPod, and turning to the step S36;
step S36: and if the HID Report is successfully reported, returning to the step S33, continuously detecting whether the key is pressed, and if not, ending the operation.
In the invention, 5 pins are reserved in the MCU on the PCBA board, and the pins are pulled up and pulled down through a hardware pull-down mode, wherein 31 combination modes are provided, for example: 00001 represents a key core layout, 00010 a key core layout, 00100 a key core layout, in such a way that compatibility of up to 31 software versions can be supported, thereby satisfying the key core layout supporting 31 out of 35 countries and also satisfying the requirement of the company keyboard country type.
The software of 35 kinds of keyboards is used for processing codes, the difference part is correspondingly processed in a branch mode by detecting the values of 5 pins, and the same part is processed uniformly, so that the code redundancy is reduced.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (2)

1. A method for enabling a keyboard to be compatible with multiple software is characterized by comprising the following steps:
step S01: configuring the chip MCU, and then entering step S02;
step S02: configuring a system clock, and then proceeding to step S03;
step S03: configuring a GPIO pin of the MCU, and then entering step S04;
step S04: configuring the UART, the USB and the timer, starting the timer at the same time, and then entering the step S05;
step S05: after the system is started, the level values of the pins PA0 and PA1 and PA2 and PA3 and PA4 of the chip MCU are read, and then the process goes to step S06;
step S06: the level value is converted into a numerical value, and then the process proceeds to step S07;
step S07: looking up a corresponding country code in a country code table according to the numerical value converted from the level value, and then proceeding to step S08;
step S08: if the corresponding country code is not found, ending the operation, and if the corresponding country code is found, going to step S09;
step S09: recording the value of the found country code using a global variable, and then proceeding to step S10;
step S10: the first step of starting authentication, packaging and reporting the authentication certificate to the iOS device, and then turning to the step S11;
step S11: if the authentication certificate fails, ending, the keyboard cannot be used, otherwise, turning to the step S12;
step S12: the certificate response is further packaged and then reported to the iOS device, and then goes to step S13;
step S13: if the certificate response fails, ending, and the keyboard cannot be used, otherwise, turning to step S14;
step S14: if the country code value is inquired, the step S15 is carried out, otherwise, the inquiry of the country code value is continued;
step S15: packaging the identity information corresponding to the country code value, reporting the identity information to the iOS equipment, and further verifying whether the identity meets the requirements;
step S16: if the identity is confirmed, the step S17 is entered, otherwise, the operation is ended and the keyboard cannot be used;
step S17: firstly, packaging human-computer interface HID information shared by all countries, and then turning to step S18;
step S18: if the country code value is confirmed, proceeding to step S19, otherwise, continuing to confirm the country code value;
step S19: encapsulating StartHID information corresponding to the country code value, reporting the information to the iOS equipment, and then turning to the step S20;
step S20: if the StartHID is successfully sent, the step S21 is carried out, otherwise, the operation is ended, and the keyboard cannot be used;
step S21: detecting whether a key is pressed in real time, and then entering step S22;
step S22: if yes, go to step S23, otherwise continue to detect the key, return to step S21;
step S23: encapsulating the pressed key value into HID Report information, then reporting the HID Report information to the OS equipment, and going to step S24;
step S24: and if the HID Report is successfully reported, returning to the step S21, continuously detecting whether the key is pressed, and if not, ending the operation.
2. The method of claim 1, wherein the method comprises: the iOS device comprises an iPad, an iPhone or an iPod.
CN202011531993.7A 2020-12-22 2020-12-22 Method for keyboard to be compatible with multiple software Active CN112559062B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011531993.7A CN112559062B (en) 2020-12-22 2020-12-22 Method for keyboard to be compatible with multiple software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011531993.7A CN112559062B (en) 2020-12-22 2020-12-22 Method for keyboard to be compatible with multiple software

Publications (2)

Publication Number Publication Date
CN112559062A CN112559062A (en) 2021-03-26
CN112559062B true CN112559062B (en) 2022-03-25

Family

ID=75032220

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011531993.7A Active CN112559062B (en) 2020-12-22 2020-12-22 Method for keyboard to be compatible with multiple software

Country Status (1)

Country Link
CN (1) CN112559062B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1369761A (en) * 2000-11-06 2002-09-18 英业达股份有限公司 Method for automatically testing specification of keyboard
CN106125953A (en) * 2016-05-30 2016-11-16 联想(北京)有限公司 A kind of keyboard display method and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5387042A (en) * 1993-06-04 1995-02-07 Brown; Carl W. Multilingual keyboard system
KR101405284B1 (en) * 2006-12-20 2014-06-10 삼성전자 주식회사 Image forming apparatus and multilingual keyboard indicia method thereof
US8090885B2 (en) * 2008-01-14 2012-01-03 Microsoft Corporation Automatically configuring computer devices wherein customization parameters of the computer devices are adjusted based on detected removable key-pad input devices
WO2011103342A1 (en) * 2010-02-18 2011-08-25 Sulaiman Alkazi Configurable multilingual keyboard
US9977766B2 (en) * 2013-02-21 2018-05-22 Red Hat, Inc. Keyboard input corresponding to multiple languages
CN107509098B (en) * 2014-07-28 2021-05-14 华为技术有限公司 Multi-language character input method and device based on virtual keyboard

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1369761A (en) * 2000-11-06 2002-09-18 英业达股份有限公司 Method for automatically testing specification of keyboard
CN106125953A (en) * 2016-05-30 2016-11-16 联想(北京)有限公司 A kind of keyboard display method and electronic equipment

Also Published As

Publication number Publication date
CN112559062A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
CN107133053A (en) Method for page jump and device, the storage medium and terminal of a kind of application program
CN103139391B (en) Method and device of permission validating installation or unloading of application program in mobile phone
CN103412769A (en) External card parameter configuration method, equipment and system
CN105303097A (en) Verification method of mobile terminal, mobile terminal and verification system
US10311003B2 (en) Detection and identifcation of supported connection protocols in a multi-purpose storage bay
CN112559062B (en) Method for keyboard to be compatible with multiple software
CN103744693A (en) Multi-system switching method and electronic device
CN105930161A (en) Method for automatically adjusting option values of BIOS
CN103744911A (en) Video file scanning method and electronic device
CN104090833B (en) Server and signal resolver thereof
CN103914212A (en) Terminal device and application configuration method thereof
CN106383914B (en) Method and system for realizing configuration of multiple data sources based on cloud call platform
CN105740117A (en) Chip debugging method and apparatus
CN102955699A (en) Software upgrade package creating method and software upgrading method
CN103336241A (en) Method and system for testing Modem module on embedded PCBA (Printed Circuit Board Assembly)
CN110704075A (en) Multi-chip firmware burning method, system, device and storage medium
CN102137417B (en) Carrier frequency mutual assistance method, base station and wireless communication system
CN102567151A (en) SAS (serial attached SCSI (small computer system interface)) hard disc test system and method under EFI (extensible firmware interface) environment
CN108320743A (en) A kind of data entry method and device
WO2017185679A1 (en) Method and apparatus for prompting type of data cable, and terminal device
CN103428745A (en) Test system and test method of Cu interface between UICC (Universal Integrated Circuit Card) and WCDMA (Wideband Code Division Multiple Access) mobile terminal
CN102737087B (en) Real-time misreport removal method
WO2020097863A1 (en) Flashing control method, flashing control apparatus and terminal device
CN202268977U (en) Multimedia processor capable of automatically upgrading and vehicle-mounted entertainment system
CN110659044A (en) Bluetooth device upgrading method

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