CN114328314A - Address automatic acquisition method, device, terminal equipment and storage medium - Google Patents
Address automatic acquisition method, device, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN114328314A CN114328314A CN202111675922.9A CN202111675922A CN114328314A CN 114328314 A CN114328314 A CN 114328314A CN 202111675922 A CN202111675922 A CN 202111675922A CN 114328314 A CN114328314 A CN 114328314A
- Authority
- CN
- China
- Prior art keywords
- address
- gpio pin
- obtaining
- searching
- cpu
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000012545 processing Methods 0.000 claims description 5
- 238000011161 development Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Landscapes
- User Interface Of Digital Computer (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of computers, and discloses an automatic address acquisition method, an automatic address acquisition device, terminal equipment and a storage medium. The automatic address acquisition method includes the following steps: determining the type of the current CPU; searching and obtaining a corresponding specification according to the type of the current CPU; aiming at the GPIO pin of the address to be calculated, automatically searching a base address, an affiliated group address and affiliated number address information corresponding to the GPIO pin from the specification; and automatically calculating and obtaining the memory address of the GPIO pin according to the base address, the address of the group to which the GPIO pin belongs and the address information of the serial number to which the GPIO pin belongs. Compared with the traditional manual searching and calculating mode, the embodiment of the invention not only greatly improves the efficiency, but also effectively reduces the error rate, ensures the subsequent normal application of the GPIO pin of the CPU, and ensures the normal operation of the terminal equipment.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for automatically acquiring addresses of GPIO pins (general purpose input/output pins), terminal equipment and a storage medium.
Background
With the development of mobile communication and the continuous improvement of living standard of people, the use of various terminal devices such as mobile phones and computers is more and more popular, and the terminal devices become indispensable communication tools in the life of people.
The CPU (Central Processing Unit) is the most core chip of the terminal device, which is equivalent to the brain of the terminal device, and because the development of the computer field is rapid, the CPU is continuously updated, and after a new generation of CPU is updated, the memory address of the GPIO pin on the CPU needs to be obtained again so as to carry out normal application on the new generation of CPU.
At present, the memory address of the GPIO pin is calculated and obtained in a manual operation mode, and the number of the GPIO pins is large, so that the whole calculation process is complex, the working efficiency is low, the error rate is high, the power consumption of the terminal device is increased, the terminal device cannot be started, and the use experience of a user is greatly influenced.
Disclosure of Invention
The invention aims to provide a method and a device for automatically acquiring the address of a GPIO pin, a terminal device and a storage medium, which are used for solving the problems of low efficiency and low accuracy in the conventional manual operation mode.
In order to achieve the purpose, the invention adopts the following technical scheme:
an automatic address acquisition method for GPIO pins comprises the following steps:
determining the type of the current CPU;
searching and obtaining a corresponding specification according to the type of the current CPU;
aiming at the GPIO pin of the address to be calculated, automatically searching a base address, an affiliated group address and affiliated number address information corresponding to the GPIO pin from the specification;
and automatically calculating and obtaining the memory address of the GPIO pin according to the base address, the address of the group to which the GPIO pin belongs and the address information of the serial number to which the GPIO pin belongs.
Optionally, the method for searching and obtaining the corresponding specification includes:
obtaining and storing a plurality of specifications in advance through a network, wherein each specification corresponds to a CPU of different types;
after the type of the current CPU is determined, the corresponding specification is searched from the stored multiple specifications according to the type of the current CPU.
Optionally, the method further includes: and after the memory address of the GPIO pin is obtained through calculation, the memory address is directly displayed on a display.
Optionally, the method further includes: after the memory address of the GPIO pin is obtained through calculation, a document recorded with the memory address is automatically generated and stored.
An address automatic acquisition device of GPIO pin comprises:
the CPU type determining unit is used for determining the type of the current CPU in the terminal equipment;
the specification searching unit is used for searching and obtaining a corresponding specification according to the type of the current CPU;
and the address searching and calculating unit is used for automatically searching a base address, an affiliated group address and affiliated number address information corresponding to the GPIO pin from the corresponding specification aiming at the GPIO pin of the address to be calculated, and then automatically calculating and obtaining the memory address of the GPIO pin according to the base address, the affiliated group address and the affiliated number address information.
Optionally, the method further includes: the specification storage unit is used for obtaining and storing a plurality of specifications in advance through a network, and each specification corresponds to different types of CPUs;
the specification searching unit is specifically configured to search a corresponding specification from the stored multiple specifications according to the type of the current CPU.
Optionally, the method further includes: and the result processing unit is used for controlling the display to directly display the memory address or automatically generating and storing a document in which the memory address is recorded.
A terminal device comprises a CPU, wherein the CPU comprises a plurality of GPIO pins, and the terminal device further comprises any one address automatic acquisition device of the GPIO pins.
Optionally, the address automatic acquiring apparatus operates in a shell environment.
A storage medium storing a plurality of instructions, the instructions being adapted to be loaded by a processor to execute the steps in the address automatic acquiring method of the GPIO pin as described in any one of the above.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the embodiment of the invention firstly identifies the type of the current CPU, then automatically acquires the specification corresponding to the CPU of the type, further automatically searches each address information corresponding to the GPIO pin from the specification, and finally automatically sums each address information according to the rule set by the specification to obtain the required memory address.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart of an address automatic obtaining method for GPIO pin according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides an automatic address obtaining method for GPIO pin, including the steps of:
and step 101, determining the type of the current CPU.
And 102, searching and obtaining a corresponding specification according to the type of the current CPU.
Wherein, the base address, the group address, the serial address and the memory address have the following meanings:
base address: in the space of the total memory, the memory address starting point belonging to GPIO is allocated, and the normal default address is 0xFD 000000;
the address of the group: GPIO pins are divided into different groups, the GPIO pins placed in the groups 0-5 according to the specification are different, and each group has a group of defined addresses in the specification;
the address of the code: GPIO pin is composed of A, B, C.the number, such as GPIO pin A0-A23, and A number belongs to group 0, each number will define its own starting address;
memory address: is a data concept used in different levels of software and hardware to access data in the main memory of a computer.
The method firstly identifies the type of the current CPU, then automatically acquires the specification corresponding to the CPU of the type, further automatically searches each address information corresponding to the GPIO pin from the specification, and finally automatically sums each address information according to the rule set by the specification to obtain the required memory address.
In the embodiment of the invention, in order to calculate and obtain the memory address of the GPIO pin, firstly, a specification corresponding to the current CPU needs to be obtained; in addition, since the CPU is continuously updated, and the specification describing the related information of the GPIO pin is also updated accordingly, in order to be compatible with terminal devices having different types of CPUs, in an optional implementation manner, the method for searching and obtaining the corresponding specification includes:
obtaining and storing a plurality of specifications in advance through a network, wherein each specification corresponds to a CPU of different types; after the type of the current CPU is determined, the corresponding specification is searched from the stored multiple specifications according to the type of the current CPU.
The method adopts the pre-stored specifications, when the operation of obtaining the memory address needs to be executed, the specification matched with the current CPU is searched from all the pre-stored specifications, and then the related information of the memory address is searched and calculated according to the specification. Therefore, the method can be applied to a plurality of terminal devices with different CPU types.
In addition, the method for automatically acquiring the address provided by the embodiment of the invention further comprises the following steps: after the memory address of the GPIO pin is obtained through calculation, the memory address is directly displayed on a display, or a document recorded with the memory address is automatically generated and stored. The method provides two different processing modes aiming at the calculation result, and a user can select and use the method according to actual requirements so as to conveniently check the calculation result.
Based on the same inventive concept, the embodiment of the present invention further provides an automatic address obtaining device for GPIO pins, including:
the CPU type determining unit is used for determining the type of the current CPU in the terminal equipment;
the specification searching unit is used for searching and obtaining a corresponding specification according to the type of the current CPU;
the address searching and calculating unit is used for automatically searching a base address, an affiliated group address and affiliated number address information corresponding to the GPIO pin from a corresponding specification aiming at the GPIO pin of the address to be calculated, and then automatically calculating and obtaining the memory address of the GPIO pin according to the base address, the affiliated group address and the affiliated number address information.
In an optional implementation manner, the automatic address obtaining apparatus further includes:
the specification storage unit is used for obtaining and storing a plurality of specifications in advance through a network, and each specification corresponds to different types of CPUs; on the basis, the specification searching unit is specifically used for searching the corresponding specification from the stored multiple specifications according to the type of the current CPU.
And the result processing unit is used for controlling the display to directly display the memory address or automatically generating and storing a document in which the memory address is recorded.
In addition, the embodiment of the invention also provides terminal equipment, which comprises a CPU, wherein the CPU comprises a plurality of GPIO pins; the terminal equipment further comprises an automatic address acquisition device of the GPIO pin. The terminal equipment adopts the address automatic acquisition mode of the GPIO pin, so that the accuracy and the high efficiency of the acquired result are effectively ensured, and the foundation is laid for the normal operation of the subsequent CPU.
Compared with the Windows environment, the specific operation environment of the automatic address acquisition device is preferably the shell environment, because the Windows environment can have various factors such as driving, AP and the like to modify the setting information of the GPIO pin, the final calculation result of the memory address is influenced, the shell environment has fewer influencing factors, and the accuracy of the automatic address acquisition result of the GPIO pin can be effectively ensured.
It will be understood by those skilled in the art that all or part of the steps in the above-mentioned GPIO pin address automatic acquiring method may be performed by instructions or by instructions controlling related hardware, and the instructions may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the embodiment of the present invention further provides a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in the address automatic obtaining method for the GPIO pin provided in the embodiment of the present invention.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. An automatic address acquisition method is characterized by comprising the following steps:
determining the type of the current CPU;
searching and obtaining a corresponding specification according to the type of the current CPU;
aiming at the GPIO pin of the address to be calculated, automatically searching a base address, an affiliated group address and affiliated number address information corresponding to the GPIO pin from the specification;
and automatically calculating and obtaining the memory address of the GPIO pin according to the base address, the address of the group to which the GPIO pin belongs and the address information of the serial number to which the GPIO pin belongs.
2. The method according to claim 1, wherein the method for searching and obtaining the corresponding specification comprises:
obtaining and storing a plurality of specifications in advance through a network, wherein each specification corresponds to a CPU of different types;
after the type of the current CPU is determined, the corresponding specification is searched from the stored multiple specifications according to the type of the current CPU.
3. The address automatic acquiring method according to claim 1, further comprising: and after the memory address of the GPIO pin is obtained through calculation, the memory address is directly displayed on a display.
4. The address automatic acquiring method according to claim 1, further comprising: after the memory address of the GPIO pin is obtained through calculation, a document recorded with the memory address is automatically generated and stored.
5. An automatic address acquisition device, comprising:
the CPU type determining unit is used for determining the type of the current CPU in the terminal equipment;
the specification searching unit is used for searching and obtaining a corresponding specification according to the type of the current CPU;
and the address searching and calculating unit is used for automatically searching a base address, an affiliated group address and affiliated number address information corresponding to the GPIO pin from the corresponding specification aiming at the GPIO pin of the address to be calculated, and then automatically calculating and obtaining the memory address of the GPIO pin according to the base address, the affiliated group address and the affiliated number address information.
6. The automatic address acquisition apparatus according to claim 5, further comprising: the specification storage unit is used for obtaining and storing a plurality of specifications in advance through a network, and each specification corresponds to different types of CPUs;
the specification searching unit is specifically configured to search a corresponding specification from the stored multiple specifications according to the type of the current CPU.
7. The automatic address acquisition apparatus according to claim 5, further comprising: and the result processing unit is used for controlling the display to directly display the memory address or automatically generating and storing a document in which the memory address is recorded.
8. A terminal device, comprising a CPU, wherein the CPU comprises a plurality of GPIO pins, characterized in that, the terminal device further comprises the automatic address acquisition device of any claim 5 to 7.
9. The terminal apparatus of claim 8, wherein the automatic address acquisition device operates in a shell environment.
10. A storage medium storing a plurality of instructions, the instructions being adapted to be loaded by a processor to perform the steps of the automatic address obtaining method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111675922.9A CN114328314B (en) | 2021-12-31 | 2021-12-31 | Automatic address acquisition method and device, terminal equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111675922.9A CN114328314B (en) | 2021-12-31 | 2021-12-31 | Automatic address acquisition method and device, terminal equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114328314A true CN114328314A (en) | 2022-04-12 |
CN114328314B CN114328314B (en) | 2024-05-28 |
Family
ID=81022749
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111675922.9A Active CN114328314B (en) | 2021-12-31 | 2021-12-31 | Automatic address acquisition method and device, terminal equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114328314B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102262606A (en) * | 2010-05-28 | 2011-11-30 | 鸿富锦精密工业(深圳)有限公司 | System and method for allocating inter-integrated circuit (I2C) communication address |
CN102467099A (en) * | 2010-11-18 | 2012-05-23 | 上海宝信软件股份有限公司 | Address tag generation method of TDC (Technolegy Drive Control) controller |
US20130132628A1 (en) * | 2011-11-18 | 2013-05-23 | Universal Scientific Industrial (Shanghai) Co.,Ltd | Plug-in module, electronic system, and judging method and querying method thereof |
CN108170622A (en) * | 2017-12-28 | 2018-06-15 | 深圳市亿威尔信息技术股份有限公司 | A kind of multiple CPLD chip address automatic configuration systems and method |
CN110489212A (en) * | 2019-08-20 | 2019-11-22 | 东软集团股份有限公司 | A kind of method, apparatus and vehicle device of universal input/output port virtualization |
CN111966615A (en) * | 2020-09-04 | 2020-11-20 | 苏州浪潮智能科技有限公司 | Hard disk address allocation system and method |
CN111966419A (en) * | 2020-09-24 | 2020-11-20 | 苏州浪潮智能科技有限公司 | Method and device for automatically distributing VPP (virtual private Point) addresses by signal conditioning equipment |
CN112486873A (en) * | 2020-12-14 | 2021-03-12 | 苏州浪潮智能科技有限公司 | Method and system for automatically identifying VPP address |
CN112667544A (en) * | 2020-12-18 | 2021-04-16 | 苏州浪潮智能科技有限公司 | Method, device, system and medium for controlling mainboard slot enabling |
-
2021
- 2021-12-31 CN CN202111675922.9A patent/CN114328314B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102262606A (en) * | 2010-05-28 | 2011-11-30 | 鸿富锦精密工业(深圳)有限公司 | System and method for allocating inter-integrated circuit (I2C) communication address |
CN102467099A (en) * | 2010-11-18 | 2012-05-23 | 上海宝信软件股份有限公司 | Address tag generation method of TDC (Technolegy Drive Control) controller |
US20130132628A1 (en) * | 2011-11-18 | 2013-05-23 | Universal Scientific Industrial (Shanghai) Co.,Ltd | Plug-in module, electronic system, and judging method and querying method thereof |
CN108170622A (en) * | 2017-12-28 | 2018-06-15 | 深圳市亿威尔信息技术股份有限公司 | A kind of multiple CPLD chip address automatic configuration systems and method |
CN110489212A (en) * | 2019-08-20 | 2019-11-22 | 东软集团股份有限公司 | A kind of method, apparatus and vehicle device of universal input/output port virtualization |
CN111966615A (en) * | 2020-09-04 | 2020-11-20 | 苏州浪潮智能科技有限公司 | Hard disk address allocation system and method |
CN111966419A (en) * | 2020-09-24 | 2020-11-20 | 苏州浪潮智能科技有限公司 | Method and device for automatically distributing VPP (virtual private Point) addresses by signal conditioning equipment |
CN112486873A (en) * | 2020-12-14 | 2021-03-12 | 苏州浪潮智能科技有限公司 | Method and system for automatically identifying VPP address |
CN112667544A (en) * | 2020-12-18 | 2021-04-16 | 苏州浪潮智能科技有限公司 | Method, device, system and medium for controlling mainboard slot enabling |
Also Published As
Publication number | Publication date |
---|---|
CN114328314B (en) | 2024-05-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020107920A1 (en) | Method and device for obtaining merged map, storage medium, processor, and terminal | |
CN112434188B (en) | Data integration method, device and storage medium of heterogeneous database | |
CN107766891B (en) | User gender identification method and device, storage medium and electronic equipment | |
CN103970870A (en) | Database query method and server | |
CN116186200B (en) | Model training method, device, electronic equipment and storage medium | |
CN109829073B (en) | Image searching method and device | |
CN106202224B (en) | Search processing method and device | |
CN110222046B (en) | List data processing method, device, server and storage medium | |
CN111402959A (en) | Method, system and equipment for sequence comparison and readable storage medium | |
CN110652728A (en) | Game resource management method and device, electronic equipment and storage medium | |
US20140214826A1 (en) | Ranking method and system | |
CN114328314B (en) | Automatic address acquisition method and device, terminal equipment and storage medium | |
CN111611174B (en) | Method and device for constructing test data, computer equipment and storage medium | |
CN110266834B (en) | Area searching method and device based on internet protocol address | |
US11323873B2 (en) | Method for wireless fidelity connection and related products | |
CN110110010A (en) | Data processing method and device | |
KR102445082B1 (en) | Control method for server providing solution to block puzzle | |
CN110287182A (en) | A kind of data comparison method, apparatus, equipment and the terminal of big data | |
CN108694631A (en) | Method, apparatus, equipment and the storage medium of adjust automatically keyword bid | |
WO2014117566A1 (en) | Ranking method and system | |
CN115578583B (en) | Image processing method, device, electronic equipment and storage medium | |
CN112600946B (en) | Method and device for determining equipment codes, storage medium and electronic device | |
CN113058271B (en) | Game control method, game control device, server and storage medium | |
CN111414452B (en) | Search word matching method and device, electronic equipment and readable storage medium | |
CN113592105B (en) | Drawing method and device of electrical system diagram |
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 |