CN102609382B - Method for sequentially controlling GPIO (general purpose input/output) interface and system - Google Patents

Method for sequentially controlling GPIO (general purpose input/output) interface and system Download PDF

Info

Publication number
CN102609382B
CN102609382B CN201210033278.XA CN201210033278A CN102609382B CN 102609382 B CN102609382 B CN 102609382B CN 201210033278 A CN201210033278 A CN 201210033278A CN 102609382 B CN102609382 B CN 102609382B
Authority
CN
China
Prior art keywords
gpio interface
equipment
signal
control line
gpio
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
CN201210033278.XA
Other languages
Chinese (zh)
Other versions
CN102609382A (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.)
DALIAN JIECHENG TECHNOLOGY CO., LTD.
Original Assignee
DALIAN GIGATEC ELECTRONICS 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 DALIAN GIGATEC ELECTRONICS Co Ltd filed Critical DALIAN GIGATEC ELECTRONICS Co Ltd
Priority to CN201210033278.XA priority Critical patent/CN102609382B/en
Publication of CN102609382A publication Critical patent/CN102609382A/en
Application granted granted Critical
Publication of CN102609382B publication Critical patent/CN102609382B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

The invention discloses a method for sequentially controlling a GPIO (general purpose input/output) interface and a system. The method includes steps: storing control sequence mapping table of equipment in advance; calling the sequence mapping table according to an equipment selection signal inputted by a user, and searching an equipment sequence array corresponding to the equipment selection signal; and analyzing each sequence datum in the equipment sequence array, obtaining signal types corresponding to control lines in the GPIO interface, and controlling each control line of the GPIO interface in a GPIO controller to transmit signals in the same type to the corresponding controlled equipment. Accordingly, by the aid of the method, the controlled equipment with different requirements on GPIO interface sequence is controlled, an implementation mode is simple, development labor is saved, and follow-up maintenance cost is low.

Description

GPIO interface sequence control method and system
Technical field
The invention belongs to GPIO technical field of interface control, relate in particular to a kind of GPIO interface sequence control method and system being mainly used in broadcasting and TV equipment.
Background technology
In broadcasting and TV field, control interface between various matrixes, control panel or other broadcasting and TV equipment is versatile and flexible, as RS-232 interface, RS-422 interface, RS-485 interface, CAN interface, TCP/IP interface, UDP interface, universal input/output (General Purpose Input Output, GPIO) interface etc.
GPIO interface is wherein in the occasion of non-data transmission, and instrument operation circuit is simple, connect the advantages such as reliable, is applied to applying on a lot of broadcasting and TV equipment.Because the GPIO interface control sequential on each equipment is not quite similar, various controlled devices have definition separately, for this reason, the GPIO interface sequence control method that prior art provides is the difference for the actual sequential of GPIO interface on controlled device by developer, and write different drivers or design that different circuit realizes the control of equipment, labor intensive is larger, and when running into the interpolation, deletion of controlled device or the change of controlled device sequential, need to remodify driver or control circuit, further improve maintenance cost.
Summary of the invention
The object of the embodiment of the present invention is to provide GPIO interface sequence control method and system, to solve prior art, provide GPIO interface sequence control method realizing when thering is the control of equipment of GPIO interface of different sequential, labor intensive is large, and the high problem of follow-up maintenance cost.
The embodiment of the present invention is achieved in that a kind of GPIO interface sequence control method, said method comprising the steps of:
The equipment that prestores is controlled the sequential table of comparisons;
According to the equipment of user's input, select signal, call the described sequential table of comparisons, search described equipment and select equipment sequential array corresponding to signal;
Each time series data in described equipment sequential array is resolved, obtain every signal type that control line is corresponding in GPIO interface, and control signal that every control line of GPIO interface described in GPIO controller sends respective type to corresponding controlled device.
Wherein, the step that the described equipment that prestores is controlled the sequential table of comparisons can be: according to the number of controlled device, and the number of described GPIO interface control line, set up a two-dimensional array, the line number of described two-dimensional array equals the number of described controlled device, the columns of described two-dimensional array equals the number of the control line of described GPIO interface, and in described two-dimensional array, each element has characterized the time series data of the GPIO interface control line that control, that column index is corresponding to controlled device corresponding to line index; Described element comprises one in order to store the byte of control line and the signal type thereof of GPIO interface, the Gao Siwei of this byte is in order to represent the numbering of the control line of described GPIO interface, described byte low four in order to represent the numbering of signal type of the control line of described GPIO interface.
Further, the time interval between the signal that in described GPIO interface, the signal of every current transmission of control line and next time send can be the scheduling time of described GPIO controller.
The present invention also provides a kind of GPIO interface sequence control system, and described system comprises:
Presetting module, controls the sequential table of comparisons for equipment is set;
Memory module, controls the sequential table of comparisons for storing described equipment;
Signal receiving module, selects signal for receiving the equipment of user's input;
Search module, for selecting signal according to described equipment, call the described control sequential table of comparisons, search described equipment and select equipment sequential array corresponding to signal;
Parsing module, for each time series data of the described equipment sequential array finding is resolved, obtains every signal type that control line is corresponding in GPIO interface;
Control sending module, for controlling signal that every control line of GPIO interface described in GPIO controller sends respective type to corresponding controlled device.
Wherein, described presetting module arranges equipment and controls the step of the sequential table of comparisons and can be:
Described presetting module is according to the number of controlled device, and the number of described GPIO interface control line, set up a two-dimensional array, the line number of described two-dimensional array equals the number of described controlled device, the columns of described two-dimensional array equals the number of the control line of described GPIO interface, and in described two-dimensional array, each element has characterized the time series data of the GPIO interface control line that control, that column index is corresponding to controlled device corresponding to line index; Described element comprises one in order to store the byte of control line and the signal type thereof of GPIO interface, the Gao Siwei of this byte is in order to represent the numbering of the control line of described GPIO interface, described byte low four in order to represent the numbering of signal type of the control line of described GPIO interface.
Further, the time interval between the signal that in described GPIO interface, the signal of every current transmission of control line and next time send can be the scheduling time of described GPIO controller.
In said system, described memory module, signal receiving module, search module, parsing module, control sending module and can be integrated in described GPIO controller; Described presetting module can be placed in the host computer of the described GPIO controller of a connection.
GPIO that GPIO interface sequence control method provided by the invention may be used various controlled devices controls and sets in advance in a period of time order table of comparisons, in control procedure, user transfers equipment sequential group corresponding in the sequential table of comparisons and resolves according to controlled device, obtain the signal type of control line of each GPIO interface of the GPIO interface of GPIO controller, and send the signal of respective type, thereby realize thering is the control of the controlled device of different sequential requirements, implementation is simple, saved exploitation manpower, and follow-up maintenance cost is low.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of GPIO interface sequence control method provided by the invention;
Fig. 2 is in the present invention, a kind of sequential chart of the control line output of the GPIO interface of GPIO interface;
Fig. 3 is the schematic diagram of GPIO interface sequence control system provided by the invention.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Fig. 1 shows the flow process of GPIO interface sequence control method provided by the invention.
In step S101, the equipment that prestores is controlled the sequential table of comparisons.
Particularly, step S101 is further comprising the steps of: according to the number of controlled device, and the number of GPIO interface control line, set up a two-dimensional array, the line number of this two-dimensional array equals the number of controlled device, the columns of this two-dimensional array equals the number of GPIO interface control line, and in this two-dimensional array, each element has characterized the time series data of the GPIO interface control line that control, that column index is corresponding to controlled device corresponding to line index; This element comprises one in order to store the byte of control line and the signal type thereof of GPIO interface, and the Gao Siwei of this byte is in order to represent the numbering of the control line of GPIO interface, this byte low four in order to represent the numbering of signal type of the control line of GPIO interface.
Usually, the signal of control line has three kinds of high level, low level, high resistant, variation combination by signal can produce multi-signal, and the signal type that the present invention may use is encoded, as following table one shows several convectional signals types and coding and explanation:
Table one
A signal type of the correspondence that a series of actions can also be combined during specific implementation, to save storage space.
Take the number of controlled device as 8, the number of GPIO interface control line is as 16 being example, the process that adopts C language to set up two-dimensional array can be expressed as: unsigned char TBL_GPIO_CONTROL[8] [16]; Now, as following table two shows the storage organization of this two-dimensional array, element Ox11 wherein represents when being numbered 1 controlled device and controlling, be numbered the time series data of the control line of 1 GPIO interface in GPIO interface, 11 bytes that are to store control line and the signal type thereof of GPIO interface wherein.
Table two
In step S102, according to the equipment of user's input, select signal, call the sequential table of comparisons, the equipment of searching is selected equipment sequential array corresponding to signal.Equipment wherein selects signal in order to characterize controlled device; Equipment sequential array is wherein in the sequential table of comparisons, selects the combination of element in the definite corresponding whole column indexes of line index of signal according to equipment.
In step S103, each time series data in equipment sequential array is resolved, obtain every signal type that control line is corresponding in GPIO interface, and the signal of controlling every control line transmission respective type of GPIO interface in GPIO controller is to corresponding controlled device.
In the present invention, the time interval between the signal that in GPIO interface, the signal of every current transmission of control line and next time send is preferably the scheduling time tick of GPIO controller, in reality, also can apply other timer or counting mode and build the required time interval.
Take GPIO Application of Interface three control line GPO1, GPO2, GPO3 is below example, and above-mentioned GPIO interface sequence control method is described, as shown in Figure 2 when controlled device is controlled, need three sequential charts that control line GPO1, GPO2, GPO3 export respectively:
When GPO3 is rising edge, GPO1 is low level, GPO2 is high level, and the equipment sequential array finding can be expressed as: 0x12,0x21,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00; Afterwards each time series data in this equipment sequential array is resolved, obtain byte of low level of corresponding time sequence data, thereby recognize three control line GPO1, GPO2, GPO3 corresponding signal type respectively, the signal type of control line GPO1 is 2, the signal type of control line GPO2 is 1, the signal type of control line GPO3 is 4; Corresponding table one, can control the signal type that three control line GPO1, GPO2, GPO3 export respectively, and the signal that sends respective type is to controlled device.
Fig. 3 shows the principle of GPIO interface sequence control system provided by the invention.
GPIO interface sequence control system provided by the invention comprises: presetting module 11, and for being set, equipment controls the sequential table of comparisons; Memory module 12, controls the sequential table of comparisons for storing this equipment; Signal receiving module 13, selects signal for receiving the equipment of user's input; Search module 14, for selecting signal according to equipment, call and control the sequential table of comparisons, the equipment of searching is selected equipment sequential array corresponding to signal; Parsing module 15, resolves for each time series data of the equipment sequential array to finding, obtains every signal type that control line is corresponding in GPIO interface; Control sending module 16, for controlling signal that every control line of GPIO controller GPIO interface sends respective type to corresponding controlled device.Wherein, presetting module 11 arranges the step that equipment is controlled the sequential table of comparisons, and to the explanation of this equipment sequential table of comparisons as mentioned above, does not repeat them here.
Wherein, presetting module 11, memory module 12, signal receiving module 13, search module 14, parsing module 15, control in the one or more GPIO of the being integrated in controllers in sending module 16, in the present invention, memory module 12, signal receiving module 13, search module 14, parsing module 15, control sending module 16 and be integrated in GPIO controller, and presetting module 11 is placed in to the host computer of this GPIO controller of a connection.
GPIO that GPIO interface sequence control method provided by the invention may be used various controlled devices controls and sets in advance in a period of time order table of comparisons, in control procedure, user transfers equipment sequential group corresponding in the sequential table of comparisons and resolves according to controlled device, obtain the signal type of control line of each GPIO interface of the GPIO interface of GPIO controller, and send the signal of respective type, thereby realize thering is the control of the controlled device of different sequential requirements, implementation is simple, saved exploitation manpower, and follow-up maintenance cost is low.
The above; it is only preferably embodiment of the present invention; but protection scope of the present invention is not limited to this; anyly be familiar with those skilled in the art in the technical scope that the present invention discloses; according to technical scheme of the present invention and inventive concept thereof, be equal to replacement or changed, within all should being encompassed in protection scope of the present invention.

Claims (5)

1. a GPIO interface sequence control method, is characterized in that, said method comprising the steps of:
The equipment that prestores is controlled the sequential table of comparisons;
According to the equipment of user's input, select signal, call described equipment and control the sequential table of comparisons, search described equipment and select equipment sequential array corresponding to signal;
Each time series data in described equipment sequential array is resolved, obtain every signal type that control line is corresponding in GPIO interface, and control signal that every control line of GPIO interface described in GPIO controller sends respective type to corresponding controlled device;
Wherein, the step that the described equipment that prestores is controlled the sequential table of comparisons is: according to the number of controlled device, and the number of described GPIO interface control line, set up a two-dimensional array, the line number of described two-dimensional array equals the number of described controlled device, the columns of described two-dimensional array equals the number of the control line of described GPIO interface, and in described two-dimensional array, each element has characterized the time series data of the GPIO interface control line that control, that column index is corresponding to controlled device corresponding to line index; Described element comprises one in order to store the byte of control line and the signal type thereof of GPIO interface, the Gao Siwei of this byte is in order to represent the numbering of the control line of described GPIO interface, described byte low four in order to represent the numbering of signal type of the control line of described GPIO interface.
2. GPIO interface sequence control method as claimed in claim 1, is characterized in that, the time interval between the signal that in described GPIO interface, the signal of every current transmission of control line and next time send is the scheduling time of described GPIO controller.
3. a GPIO interface sequence control system, is characterized in that, described system comprises:
Presetting module, controls the sequential table of comparisons for equipment is set;
Memory module, controls the sequential table of comparisons for storing described equipment;
Signal receiving module, selects signal for receiving the equipment of user's input;
Search module, for selecting signal according to described equipment, call described equipment and control the sequential table of comparisons, search described equipment and select equipment sequential array corresponding to signal;
Parsing module, for each time series data of the described equipment sequential array finding is resolved, obtains every signal type that control line is corresponding in GPIO interface;
Control sending module, for controlling signal that every control line of GPIO interface described in GPIO controller sends respective type to corresponding controlled device;
Wherein, described presetting module arranges equipment and controls the step of the sequential table of comparisons and be:
Described presetting module is according to the number of controlled device, and the number of described GPIO interface control line, set up a two-dimensional array, the line number of described two-dimensional array equals the number of described controlled device, the columns of described two-dimensional array equals the number of the control line of described GPIO interface, and in described two-dimensional array, each element has characterized the time series data of the GPIO interface control line that control, that column index is corresponding to controlled device corresponding to line index; Described element comprises one in order to store the byte of control line and the signal type thereof of GPIO interface, the Gao Siwei of this byte is in order to represent the numbering of the control line of described GPIO interface, described byte low four in order to represent the numbering of signal type of the control line of described GPIO interface.
4. GPIO interface sequence control system as claimed in claim 3, is characterized in that, the time interval between the signal that in described GPIO interface, the signal of every current transmission of control line and next time send is the scheduling time of described GPIO controller.
5. the GPIO interface sequence control system as described in claim 3 or 4, is characterized in that, described memory module, signal receiving module, searches module, parsing module, control sending module and is integrated in described GPIO controller; Described presetting module is placed in the host computer of the described GPIO controller of a connection.
CN201210033278.XA 2011-11-01 2012-02-14 Method for sequentially controlling GPIO (general purpose input/output) interface and system Active CN102609382B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210033278.XA CN102609382B (en) 2011-11-01 2012-02-14 Method for sequentially controlling GPIO (general purpose input/output) interface and system

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201110339970.0 2011-11-01
CN201110339970 2011-11-01
CN201210033278.XA CN102609382B (en) 2011-11-01 2012-02-14 Method for sequentially controlling GPIO (general purpose input/output) interface and system

Publications (2)

Publication Number Publication Date
CN102609382A CN102609382A (en) 2012-07-25
CN102609382B true CN102609382B (en) 2014-12-10

Family

ID=46526770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210033278.XA Active CN102609382B (en) 2011-11-01 2012-02-14 Method for sequentially controlling GPIO (general purpose input/output) interface and system

Country Status (1)

Country Link
CN (1) CN102609382B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2909731Y (en) * 2006-06-19 2007-06-06 海信集团有限公司 On-off sequential control circuit of liquid crystal TV. set
CN201540533U (en) * 2009-11-16 2010-08-04 英业达股份有限公司 Computer system
CN102034411A (en) * 2009-09-29 2011-04-27 群康科技(深圳)有限公司 Gamma correction control device and method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006235994A (en) * 2005-02-24 2006-09-07 Nec Electronics Corp Bridge system, bridge system control method, information processing apparatus, peripheral equipment, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2909731Y (en) * 2006-06-19 2007-06-06 海信集团有限公司 On-off sequential control circuit of liquid crystal TV. set
CN102034411A (en) * 2009-09-29 2011-04-27 群康科技(深圳)有限公司 Gamma correction control device and method thereof
CN201540533U (en) * 2009-11-16 2010-08-04 英业达股份有限公司 Computer system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
剖析媒体矩阵GPIO接口;符传富;《音响技术》;20081201(第12期);第28-30页 *
符传富.剖析媒体矩阵GPIO接口.《音响技术》.2008,(第12期),28-30. *

Also Published As

Publication number Publication date
CN102609382A (en) 2012-07-25

Similar Documents

Publication Publication Date Title
CN101894042B (en) Realization method for sharing application among a plurality of operating systems, system and mobile terminal
CN102736565B (en) Communication method of automatic control equipment based on upper and lower computer structures
US20150228220A1 (en) Method and System for Writing Address Codes Into LED Display Devices
CN103927331A (en) Data querying method, data querying device and data querying system
CN106648408A (en) Touch data processing method, device, touch screen and splicing display system
CN112328172A (en) Data storage method and device and data reading method and device
CN109697035B (en) Writing method of address data of cascade equipment, writing equipment and storage medium
CN103744587A (en) Method of adjusting function menus and dynamic menu system
CN102769726A (en) Method for adjusting image effects and intelligent device
CN103716056A (en) Data compression method, data decompression method and devices
EP4102354A1 (en) Method, circuit, and soc for performing matrix multiplication operation
CN105808193A (en) Distributed spliced-wall display method, device, server and system
CN103593445A (en) Data filling method and device
CN102609382B (en) Method for sequentially controlling GPIO (general purpose input/output) interface and system
CN103338391A (en) Method, device, and system for realizing connection of mobile terminal and television terminal
US9563592B2 (en) Remote terminal device and method of operating the same
US9923669B2 (en) Distributed Reed-Solomon codes for simple multiple access networks
CN105718414A (en) Addressable bus structure
EP3238075A1 (en) Method for accessing a number of slave devices with registers by a master device over a network
CN102354304A (en) Data transmission method, data transmission device and SOC (system on chip)
CN110930684A (en) Infrared control method and system supporting multiple coding formats
CN105354166A (en) Robot and applicable data transmission method
US20150009860A1 (en) Setting system and method for setting interfaces of connection apparatus connected to electronic device
CN104253729A (en) Method for transferring data between master unit and slave units through register interfaces
US9645961B2 (en) Virtual media apparatus of a server and access method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20160330

Address after: Hi Tech Park Kehai street Dalian city Liaoning province 116023 No. 3 office building A block 3 layer

Patentee after: DALIAN JIECHENG TECHNOLOGY CO., LTD.

Address before: Hi Tech Park Kehai street Dalian city Liaoning province 116023 No. 3

Patentee before: Dalian GigaTec Electronics Co., Ltd.