The present disclosure relates to electronic devices, particularly to an electronic device for resetting pin function.
System programs of electronic devices with a central processing unit (CPU), such as computers and mobile phones, are burned in a flash storage of the device. The CPU often includes two pins with a Universal Asynchronous Receiver/Transmitter (UART) function for loading the system programs. However, after the system programs are burned in the flash storage through the CPU, the pins with UART function of the CPU are idle.
Many aspects of the embodiments can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the electronic device and function resetting method thereof. Like reference numerals designate corresponding parts throughout the several views of the drawings.
In general, the word “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, for example, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. Modules may comprise connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage system. Embodiments of the present disclosure will be described with reference to the drawings.
The electronic device 100 can include a chip 10, storage 20, and a pin configuration apparatus 30.
The chip 10 includes a plurality of pins 11 with different functions and a plurality of storing modules 12 corresponding to the pins 11 in a one-to-one relationship. The storing modules 12 store parameters for initializing different functions which are different from each other. Each of the storing modules 12 stores parameters related to a same function and includes a plurality of storing unit 120 for storing the corresponding parameters. Each of the pins 11 matches parameters stored in one of the storing units 120 of the corresponding storing module 12, thus the pin 11 is designated to execute a corresponding function based on the parameters of the matched storing module 12. For example, the storing module 12 includes two storing units 120. One of the storing modules 12 stores first parameters related to UART function, and the other storing module 12 stores second parameters related to General Purpose Input/Output (GPIO) function. The pin 11 matches one of the storing units 120 of the storing module 12 with the first parameters for designating the UART function. The pin 11 matches one of the storing units 120 of the storing module 12 with the second parameters for designating the GPIO function. In one embodiment, the chip 10 is a CPU.
The storage 20 is used for storing programs. In one embodiment, the storage 20 is a flash storage.
The pin configuration apparatus 30 is used for resetting pin functions. The pin configuration apparatus 30 includes a searching unit 31, a resetting unit 32, and an initialization unit 34. The searching unit 31, the resetting unit 32, and the initialization unit 34 are executed based on the program stored in the storage 20.
The searching unit 31 is used for searching the pins designated to execute the first function. In one embodiment, the searching unit 31 searches the pins based on the matched first parameters.
The resetting unit 32 can be used for resetting the searched pins. In at least one embodiment, the resetting unit 32 resets the searched pins to match the second parameters. In at least one embodiment, the resetting unit 32 can change the first parameters of the storing unit 120 into the second parameters.
The initialization unit 34 can be used for initializing the reset pins to be enabled for executing the second function based on the matched second parameters.
The searching unit 31 searches the first pin 141 and the second pin 142 with UART function which are connected to the UART interface 14.
The resetting unit 32 respectively resets the first pin 141 and the second pin 142 to be matched with one of the second storing units 124 of the second storing module 12b.
In 401, the searching unit searches the pins designated to execute a first function. In one embodiment, the searching unit searches the pins matching first parameters.
In 403, the resetting unit resets the searched pins. In one embodiment, the resetting unit resets the searched pins to match the second parameters. In other embodiments, the resetting unit can change the first parameters of the storing unit into the second parameters.
In 405, the initialization unit initializes the reset pins to be enabled for executing the second function based on the second parameters.
In use, the idle pins of the chip can be reset for enabling execution of other functions, thus the utilization of the pins of the chip is improved.
While various embodiments have been described, the disclosure is not to be limited thereto. Various modifications and similar arrangements (as would be apparent to those skilled in the art) are also intended to be covered. The embodiments discussed are illustrative only, and are not intended to limit the scope of the following claims.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2013102088084 | May 2013 | CN | national |