A method for detecting GPIO ports
The invention provides a method for detectin GPIO ports. The method comprises the following steps: setting the GPIO port as an output high-level mode; after a first setting time, setting the GPIO portas a high-impedance input mode; detecting the level of the GPIO port to obtain a first level; settin...
Saved in:
Main Author | |
---|---|
Format | Patent |
Language | Chinese English |
Published |
14.12.2018
|
Subjects | |
Online Access | Get full text |
Cover
Loading…
Summary: | The invention provides a method for detectin GPIO ports. The method comprises the following steps: setting the GPIO port as an output high-level mode; after a first setting time, setting the GPIO portas a high-impedance input mode; detecting the level of the GPIO port to obtain a first level; setting the GPIO port to an output low level mode, setting the GPIO port to a high-impedance input mode after the first setting time, detecting the level of the GPIO port, and obtaining a second level; obtaining the recognition status of GPIO port according to the two detection results. GPIO ports do notneed to be connected to other devices, only the output/input mode of the GPIO ports needs to be changed; the level of the CPU pins is detected And, according to the detection result, the recognitionstate of GPIO ports is obtained, the detection method is simple and the detection result can be obtained quickly. In addition, the detection method utilizes the characteristics of GPIO port, and doesnot need to input additional |
---|---|
Bibliography: | Application Number: CN20181709655 |