CN103051736A - Processing method of control information and I2C (Inter-Integrated Circuit) bus equipment - Google Patents

Processing method of control information and I2C (Inter-Integrated Circuit) bus equipment Download PDF

Info

Publication number
CN103051736A
CN103051736A CN2012103612566A CN201210361256A CN103051736A CN 103051736 A CN103051736 A CN 103051736A CN 2012103612566 A CN2012103612566 A CN 2012103612566A CN 201210361256 A CN201210361256 A CN 201210361256A CN 103051736 A CN103051736 A CN 103051736A
Authority
CN
China
Prior art keywords
touch key
control chip
bus
bus apparatus
device address
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
Application number
CN2012103612566A
Other languages
Chinese (zh)
Other versions
CN103051736B (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.)
SHENZHEN CHIPSBANK TECHNOLOGY Co Ltd
Original Assignee
SHENZHEN CHIPSBANK TECHNOLOGY 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 SHENZHEN CHIPSBANK TECHNOLOGY Co Ltd filed Critical SHENZHEN CHIPSBANK TECHNOLOGY Co Ltd
Priority to CN201210361256.6A priority Critical patent/CN103051736B/en
Publication of CN103051736A publication Critical patent/CN103051736A/en
Application granted granted Critical
Publication of CN103051736B publication Critical patent/CN103051736B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

The embodiment of the invention discloses a processing method of control information and I2C (Inter-Integrated Circuit) bus equipment. The method comprises the following steps of: acquiring, by the I2C bus equipment, an equipment address carried by control information transmitted by an I2C bus host on an I2C bus from the control information, wherein the I2C bus equipment comprises two equipment addresses, i.e., a first equipment address and a second equipment address; configuring, by the I2C bus equipment, an I/O (Input/Output) port of a touch key control chip to be input control so as to perform acquisition control on input data by the touch key control chip according to the control information if the equipment address carried by the control information is the same as the first equipment address; and configuring, by the I2C bus equipment, the I/O (Input/Output) port of the touch key control chip to be output control so as to perform control operation on driven equipment connected to the touch key control chip by the touch key control chip according to the control information if the equipment address carried by the control information is the same as the second equipment address.

Description

A kind of processing method of control information and I2C bus apparatus
Technical field
The present invention relates to touch induction technical field, relate in particular to a kind of processing method and I2C bus apparatus of control information.
Background technology
In present touch key-press control chip, the touch key-press control chip all can have special-purpose input and output (I/O, Input/Output) port address, be used for processing the input/output information of oneself, the output control that the touch key-press control chip carries out usually comprises: directly drive light-emitting diode (LED, Light Emitting Diode) lamp, fan, the control of the switches such as relay, the input control that the touch key-press control chip carries out usually comprises: the keyboard input, timer/sensor detects input.
In the prior art, use the product facility of touch key-press control chip realizing switch control or detecting the I/O port that all needs to use when inputting separately, that is to say, this product facility can't detect input when using the I/O port to carry out switch control, equally also can't carry out switch control when using the I/O port to detect input.But product facility but needs to carry out simultaneously input and output control in the application of some reality, for example uses the product facility of touch key-press control chip not only to need to carry out transducer (sensor) scanning but also need simultaneously to start the LED lamp.
Control in order to carry out simultaneously input and output in the prior art, usually the method that adopts is to set up more I/O port in product facility, so that a plurality of I/O ports carry out respectively input control or output control, also having a kind of method is that two touch key-press control chips are installed in product facility, use respectively different touch key-press control chips to carry out input control or output control, owing to need in product facility, set up I/O port or touch key-press control chip, Costco Wholesale when this dual mode of available technology adopting all can increase product design greatly, as why not setting up the I/O port and use same touch key-press control chip to realize input and output control, how to realize in the situation of the Costco Wholesale that does not increase product facility that namely product facility can carry out switch control and can detect again a difficult problem that is entered as for the industry discussion.
Summary of the invention
The embodiment of the invention provides a kind of processing method and I2C bus apparatus of control information, is used for realizing input and output control by same group of I/O port of a touch key-press control chip.
For solving the problems of the technologies described above, the embodiment of the invention provides following technical scheme:
First aspect, the embodiment of the invention provide a kind of processing method of control information, comprising:
Internal integrated circuit I2C bus apparatus obtains the device address that described control information is carried from the I2C bus host the control information that the I2C bus sends, described I2C bus apparatus includes two device addresses: the first device address and the second device address;
If the device address that described control information is carried is identical with described the first device address, described I2C bus apparatus is input control with the input and output I/O port arrangement of touch key-press control chip, so that described touch key-press control chip is inputted data acquisition control according to described control information;
If the device address that described control information is carried is identical with described the second device address, described I2C bus apparatus is controlled the I/O port arrangement of described touch key-press control chip for output, so that described touch key-press control chip carries out control operation according to the described control information pair driven equipment that links to each other with described touch key-press control chip.
Second aspect, the embodiment of the invention also provide a kind of I2C bus apparatus, comprising:
Address acquisition unit is used for obtaining the device address that described control information is carried from the control information that the I2C bus host sends in the I2C bus, and described I2C bus apparatus includes two device addresses: the first device address and the second device address;
The first dispensing unit, be used for when the device address that described control information is carried is identical with described the first device address, be input control with the input and output I/O port arrangement of touch key-press control chip, so that described touch key-press control chip is inputted data acquisition control according to described control information;
The second dispensing unit, be used for when the device address that described control information is carried is identical with described the second device address, the I/O port arrangement of described touch key-press control chip is controlled for output, so that described touch key-press control chip carries out control operation according to the described control information pair driven equipment that links to each other with described touch key-press control chip.
As can be seen from the above technical solutions, the embodiment of the invention has the following advantages:
In embodiments of the present invention, the I2C bus apparatus includes two device addresses: the first device address and the second device address, if the first device address is carried in the control information that the I2C bus host sends, the I2C bus apparatus is input control with the I/O port arrangement of touch key-press control chip, so that the touch key-press control chip is inputted data acquisition control according to control information, if the second device address is carried in the control information that the I2C bus host sends, the I2C bus apparatus is output control with the I/O port arrangement of touch key-press control chip, so that the touch key-press control chip carries out control operation according to control information to driven equipment, after two device addresses of I2C bus apparatus configuration, just can realize input control and output control by same group of I/O port of a touch key-press control chip, and do not need to set up again the I/O port, do not need to set up the touch key-press control chip, the Costco Wholesale in the time of product design can not being increased yet.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, the accompanying drawing of required use was done to introduce simply during the below will describe embodiment, apparently, accompanying drawing in the following describes only is some embodiments of the present invention, to those skilled in the art, can also obtain according to these accompanying drawings other accompanying drawing.
The process blocks schematic diagram of the processing method of the control information that Fig. 1 provides for the embodiment of the invention;
The I2C that Fig. 2 provides for the embodiment of the invention writes the frame structure schematic diagram of data protocol bag;
The frame structure schematic diagram of the I2C read data protocol package that Fig. 3 provides for the embodiment of the invention;
The realization configuration diagram of the processing method of the control information that Fig. 4 provides for the embodiment of the invention;
The realization flow schematic diagram of the processing method of the control information that Fig. 5 provides for the embodiment of the invention;
The composition structural representation of the I2C bus apparatus that Fig. 6 provides for the embodiment of the invention.
Embodiment
The embodiment of the invention provides a kind of processing method and I2C bus apparatus of control information, is used for realizing input and output control by same group of I/O port of a touch key-press control chip.
For so that goal of the invention of the present invention, feature, advantage can be more obvious and understandable, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, the embodiments described below only are the present invention's part embodiment, but not whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those skilled in the art obtains belongs to the scope of protection of the invention.
The processing method of the control information that the embodiment of the invention provides as shown in Figure 1, comprises the steps:
101, internal integrated circuit (I2C, Inter-Integrated Circuit) bus apparatus obtains the device address that control information is carried from the I2C bus host the control information that the I2C bus sends, wherein, the I2C bus apparatus includes two device addresses: the first device address and the second device address.
An I2C bus apparatus that provides in the embodiment of the invention disposes two device addresses, difference called after the first device address and the second device address, that is to say, in the embodiment of the invention, gather around for an I2C bus apparatus and to have plenty of two different device addresses, an I2C bus apparatus commonly used only disposes a device address in this and the prior art essential distinction, and is not only the increase on the number of device address, but has changed the actual functional capability of I2C bus apparatus.
The I2C bus host is as main frame (English full name is Host), send control information by the I2C bus, in control information, carry the device address that this control information need to be sent to, this device address is the destination device address namely, the I2C bus host carries the I2C bus apparatus that different device addresses need to be sent to represent this control information in control information, the I2C bus apparatus is as slave (English full name is device), for example, the I2C bus host has sent control information a for the data that can access the keyboard input, in control information a, carried device address a, need to be received and process by the equipment of address as device address a take expression control information a, if the I2C bus host is for having sent control information b by closed relay, in control information b, carried device address b, represent that then control information b need to be the equipment reception of device address b by the address and process, control information a represents respectively then that with control information b needing the touch key-press control chip to carry out different control processes, in embodiments of the present invention, device address a and device address b have been had simultaneously if suppose the I2C bus apparatus, control information a or control information b that then no matter the I2C bus host sends, can be received by the I2C bus apparatus, because the I2C bus apparatus has device address a and device address b simultaneously.
Need to prove, in embodiments of the present invention, the I2C bus host is I2C data protocol bag by the control information that the I2C bus sends, in actual applications, carrying out different control according to I2C bus host needs touch key-press control chip processes, the control information that the I2C bus host issues can be that I2C writes the data protocol bag, control information also can be I2C read data protocol package, for example, the I2C bus host need to obtain by the touch key-press control chip scan-data of inductor (English full name is sensor), the control information that need to issue of I2C bus host is I2C read data protocol package so, if the I2C bus host need to drive light-emitting diode (LED by the touch key-press control chip, Light Emitting Diode) lamp is lighted, and then the control information that need to issue of I2C bus host is that I2C writes the data protocol bag.
Write data protocol bag and I2C read data protocol package in order to describe I2C in detail, see also Fig. 2 and Fig. 3, wherein, the I2C that Fig. 2 provides for the embodiment of the invention writes the frame structure schematic diagram of data protocol bag, the frame structure schematic diagram of the I2C read data protocol package that Fig. 3 provides for the embodiment of the invention sees also as in the following table 1 I2C being write the symbol description of data protocol bag and I2C read data protocol package:
Table 1 is the concrete symbol description to the data protocol bag shown in Fig. 2 and Fig. 3
Sequence number Transmission unit Explanation
1 S The start bit
2 SLA+W The device address adds writes bit (bit)
3 MemAddres The device storage address
4 A Confirmation signal
5 P Position of rest
6 SLA+R The device address adds reads bit (bit)
7 Data The transmission of data
Need to prove, the form that I2C writes the data protocol bag shown in figure 2, the I2C that main frame sends to slave writes the data protocol bag from " S " position, " SLA+W " " SLA " wherein is illustrated in I2C, and to write the device address of carrying in the data protocol bag be SLA, " W " expression wherein is used for writing data, the device storage address that the data that " MemAddres " expression is write need to be stored into, the recipient of " A " expression data sends the affirmation signal of data segment to the transmit leg of data, Data0 to Data n represents the content of the transmission of data, the implication of " P " is position of rest, and " P " is corresponding with the start bit.Shown in Figure 3 is the form of I2C read data protocol package, main frame sends to the I2C read data protocol package of slave from " S " position, it is SLA that " SLA+W " " SLA " wherein is illustrated in the device address of carrying in the I2C read data protocol package, " W " expression wherein is used for writing data, the device storage address that " MemAddres " expression data writing need to be stored into, the recipient of " A " expression data sends the affirmation signal of data segment to the transmit leg of data, the implication of " P " is position of rest, " P " is corresponding with the start bit, it is SLA that " SLA+R " " SLA " wherein is illustrated in the device address of carrying in the I2C read data protocol package, " R " wherein represents to be used for read data, Data0 to Data n represents the content of the transmission of data, and " P " is corresponding with the start bit.
Need to prove, description I2C bus apparatus by step 101 has got access to the entrained device address of this control information from control information, then the I2C bus apparatus compares the relation of the device address of the entrained device address of control information and this I2C bus apparatus oneself, if the device address that control information is carried is identical with the first device address, then execution in step 102, if the device address that control information is carried is identical with the second device address, then execution in step 103.Need to prove, what carry in the embodiment of the invention that the control information of the first device address represents is that the I2C bus host need to be controlled touch key-press control chip input image data, that the I2C bus host need to be controlled the touch key-press control chip driven equipment is carried out control operation if control information carries that the second device address represents, the I2C bus host couples together by I2C bus and I2C bus apparatus in embodiments of the present invention, the I2C bus apparatus couples together by one group of I/O port and touch key-press control chip, in the embodiment of the invention, the I2C bus apparatus just can be realized input control and output control by same group of I/O port of this touch key-press control chip, in detail implementation procedure one by one explanation in step 102 and step 103, this with prior art in need two I/O ports or two touch key-press control chips of needs to compare, Costco Wholesale in the time of can reducing product design, and input control and output control can be carried out time division multiplexing by same group of I/O port of a touch key-press control chip in the embodiment of the invention, save touch key-press control chip and I/O port resource, cost economizes on resources.
If the device address that 102 control informations are carried is identical with the first device address, the I2C bus apparatus is with the input and output (I/O of touch key-press control chip, Input/Output) port arrangement is input control, so that the touch key-press control chip is inputted data acquisition control according to control information.
In embodiments of the present invention, the I2C bus apparatus has got access to the entrained device address of control information by step 101, if the I2C bus apparatus finds that the device address of carrying in the control information is the first device address, be that the I2C bus apparatus finds that the device address that control information carries is identical with the first device address, the I2C bus apparatus is input control with the I/O port arrangement of touch key-press control chip, then when the I/O of touch key-press control chip port was configured to input control, the touch key-press control chip just can be inputted data acquisition control according to this control information.
Need to prove, in embodiments of the present invention, be input control for the I2C bus apparatus with the I/O port arrangement of touch key-press control chip, is specifically can comprise as a kind of mode that can realize wherein:
A1, I2C bus apparatus are inputted the I/O port arrangement of touch key-press control chip for gathering keyboard data are so that the touch key-press control chip is to the data of I2C bus apparatus feedback keyboard input;
Or A2, I2C bus apparatus are inputted the I/O port arrangement of touch key-press control chip for detecting timer data are so that the touch key-press control chip is to the data of I2C bus apparatus feedback timer;
Or A3, I2C bus apparatus are the data of detecting sensor (sensor) scanning input with the I/O port arrangement of touch key-press control chip, so that the data that the touch key-press control chip scans to I2C bus apparatus feedback transducer
For steps A 1, the control information indication touch key-press control chip that carries the first device address gathers the data of keyboard input, then the I2C bus apparatus receives after this control information, the data of just the I/O port arrangement of touch key-press control chip being inputted for gathering keyboard, then after the I/O port arrangement is for the data that gather the keyboard input, the touch key-press control chip just can gather the data of peripheral connection device keyboard input, the data that then collect to I2C bus apparatus feedback by I/O port touch key-press control chip.
For steps A 2 and steps A 3, the control information indication touch key-press control chip that carries the first device address detects the data of timer or transducer input, then the I2C bus apparatus receives after this control information, the data of just the I/O port arrangement of touch key-press control chip being inputted for detecting timer or transducer, after the I/O port arrangement is for the data that detect the input of timer or transducer, the touch key-press control chip just can detect scanning to timer or transducer, the data that then detect to I2C bus apparatus feedback by I/O port touch key-press control chip.
Need to prove, in embodiments of the present invention, the I2C bus apparatus is input control with the input and output I/O port arrangement of touch key-press control chip in the step 102, can also comprise the steps: afterwards
B1, I2C bus apparatus receive the data of the input control of touch key-press control chip transmission;
B2, I2C bus apparatus use the first device address that the data of input control are sent to the I2C bus host.
For step B1, the I/O port is configured to after the input control in step 102, the touch key-press control chip is just inputted data acquisition control according to the control information of carrying the first device address, the touch key-press control chip collects after the data of input control, the I2C bus apparatus just can receive by the I/O port that is connected between touch key-press control chip and the I2C bus apparatus data of this input control, because the I2C bus apparatus is based on the control information of having carried the first device address and is input control with the I/O port arrangement of touch key-press control chip in the step 102, in step B2, the I2C bus apparatus uses the first device address that the data of input control are sent to the I2C bus host, with the feedback that realizes that the I2C bus host sends control information and need to receive.
Need to prove, in embodiments of the present invention, the I2C bus apparatus is input control with the input and output I/O port arrangement of touch key-press control chip in the step 102, can also comprise the steps: afterwards
If the failure of I/O port arrangement input control, the I2C bus apparatus feeds back the first miscue information to the I2C bus host.
That is to say, if configuration failure, then the I2C bus apparatus feeds back the first miscue information to the I2C bus host, tells the configuration of I2C bus host to occur unsuccessfully, at this moment, the I2C bus host can repeat to resend control information to the I2C bus apparatus after receiving the first miscue information.
If the device address that 103 control informations are carried is identical with the second device address, the I2C bus apparatus is controlled the I/O port arrangement of touch key-press control chip for output, so that the touch key-press control chip carries out control operation according to the control information pair driven equipment that links to each other with the touch key-press control chip.
In embodiments of the present invention, the I2C bus apparatus has got access to the entrained device address of control information by step 101, if the I2C bus apparatus finds that the device address of carrying in the control information is the second device address, be that the I2C bus apparatus finds that the device address that control information carries is identical with the second device address, the I2C bus apparatus is output control with the I/O port arrangement of touch key-press control chip, then when the I/O of touch key-press control chip port is configured to output control, the touch key-press control chip just can carry out control operation according to this control information pair driven equipment that links to each other with this touch key-press control chip, wherein, driven equipment refers to and is connected with the touch key-press control chip and equipment that the button control chip that need to be touched drives, the equipment that sends instructions and then open or close under the button control chip that for example needs to be touched.
Need to prove, in embodiments of the present invention, for the I2C bus apparatus I/O port arrangement of touch key-press control chip is output control, is specifically can comprise as a kind of mode that can realize wherein:
The I2C bus apparatus is general programmable input and output (GPIO with the I/O port arrangement of touch key-press control chip, General-Purpose IO ports), wherein, GPIO is used for the switch of driving LED lamp, fan, relay, so that the operation that the touch key-press control chip is opened or closed LED lamp, fan, relay according to control information.
Need to prove, in embedded system, have fairly simple external equipment or circuit of structure, the touch key-press control chip that needs that these equipment or circuit have provides control device for it, such equipment or circuit have only required that a position controls, as long as namely there is the ON/OFF two states just much of that, such as the LED lamp light with extinguish, the Push And Release of fan etc. only needs two kinds of control commands of touch key-press control chip output can be referred to as driven equipment.To the control of these equipment and circuit, use traditional serial port or parallel port all improper, a general programmable IO interface can be set on the touch key-press control chip, be simply referred to as GPIO.
Need to prove, in embodiments of the present invention, the I2C bus apparatus for output control, can also comprise the steps: the input and output I/O port arrangement of touch key-press control chip afterwards in the step 103
C1, I2C bus apparatus receive the data of the output control of touch key-press control chip transmission;
The data that C2, I2C bus apparatus use the second device address will export control send to the I2C bus host.
For step C1, the I/O port is configured to after the output control in step 103, the touch key-press control chip is just exported data acquisition control according to the control information of carrying the second device address, the touch key-press control chip collects after the data of output control, the I2C bus apparatus just can be got by the I/O port reads that is connected between touch key-press control chip and the I2C bus apparatus data of this output control, because the I2C bus apparatus is based on the control information of having carried the second device address and the I/O port arrangement of touch key-press control chip is output control in the step 103, in step C2, the data that the I2C bus apparatus uses the second device address will export control send to the I2C bus host, with the feedback that realizes that the I2C bus host sends control information and need to receive.
Need to prove, in embodiments of the present invention, the I2C bus apparatus for output control, can also comprise the steps: the input and output I/O port arrangement of touch key-press control chip afterwards in the step 103
If the output of I/O port arrangement is controlled unsuccessfully, the I2C bus apparatus feeds back the second miscue information to the I2C bus host.
That is to say, if configuration failure, then the I2C bus apparatus feeds back the second miscue information to the I2C bus host, tells the configuration of I2C bus host to occur unsuccessfully, at this moment, the I2C bus host can repeat to resend control information to the I2C bus apparatus after receiving the second miscue information.
Need to prove, description I2C bus apparatus by step 101 has got access to the entrained device address of this control information from control information, then the I2C bus apparatus compares the relation of the device address of the entrained device address of control information and this I2C bus apparatus oneself, and the embodiment of the invention can also comprise the steps:
Simultaneously neither the second device address if the device address that control information is carried is not the first device address, the I2C bus apparatus abandons this control information.
That is to say, in embodiments of the present invention, if the device address that control is carried is identical with the first device address, carried out step 102, if the device address that control information is carried is identical with the second device address, carried out step 103, the realization situation except 102 and 103, the I2C bus apparatus can discard the control information that the I2C bus host sends, and is left intact.
In embodiments of the present invention, the I2C bus apparatus includes two device addresses: the first device address and the second device address, if the first device address is carried in the control information that the I2C bus host sends, the I2C bus apparatus is input control with the I/O port arrangement of touch key-press control chip, so that the touch key-press control chip is inputted data acquisition control according to control information, if the second device address is carried in the control information that the I2C bus host sends, the I2C bus apparatus is output control with the I/O port arrangement of touch key-press control chip, so that the touch key-press control chip carries out control operation according to control information to driven equipment, after two device addresses of I2C bus apparatus configuration, just can realize input control and output control by same group of I/O port of a touch key-press control chip, and do not need to set up again the I/O port, do not need to set up the touch key-press control chip, the Costco Wholesale in the time of product design can not being increased yet.
Above embodiment has introduced the processing method of the control information that the embodiment of the invention provides, next be elaborated with the application scenarios of the reality processing method to control information, see also shown in Figure 4, the realization configuration diagram of the processing method of the control information that provides for the embodiment of the invention, suppose that it is respectively 22 and 23 that I2C bus apparatus that the embodiment of the invention provides includes two device addresses, realizes that mainly framework comprises the steps:
1), the I2C bus host sends control information, the device address that control information is carried is if 22 I2C bus apparatus execution in step 2), the device address that control information is carried is if 23 are carried out 3), if be not then the I2C bus apparatus abandons control information, be left intact;
2), the I/O of I2C bus apparatus configuration touch key-press control chip is that Sensor uses, if configuration successful execution in step 4 then), if configuration failure is then to I2C bus host feedback error information;
3), same group of I/O of I2C bus apparatus configuration touch key-press control chip be that GPIO uses, if configuration successful execution in step 5 then), if configuration failure is then to I2C bus host feedback error information;
4), the touch key-press control chip gathers the Sensor data of touch controlled key, becomes the I2C protocol package to be transferred to the I2C bus apparatus Sensor data encapsulation according to the device address 22 of I2C bus apparatus, sends to the I2C bus host by the I2C bus apparatus afterwards;
5), the touch key-press control chip is according to the control information GP configuring IO lightening LED lamp of resolving the I2C bus apparatus and receiving, the button control chip becomes the I2C protocol package to be transferred to the I2C bus apparatus data encapsulation that GPIO configures according to the device address 23 of I2C bus apparatus, sends to the I2C bus host by the I2C bus apparatus afterwards.
Need to prove, simultaneously becoming the I2C protocol package to send to this step of I2C bus apparatus the data encapsulation of GPIO configuration according to the address 23 of I2C bus apparatus is not to carry out, only has and just need to feed back this I2C protocol package when the I2C bus host need to be known current GPIO configuration status.
After the overall realization framework of the processing method of describing out control information, see also shown in Figure 5, the realization flow schematic diagram of the processing method of the control information that provides for the embodiment of the invention, suppose that it is respectively 22 and 23 that I2C bus apparatus that the embodiment of the invention provides includes two device addresses, the implementation method of system comprises the steps:
501, the I2C bus host sends control information, and then execution in step 502;
502, the I2C bus apparatus is judged the device address that control information is carried, if 22 I2C bus apparatus execution in step 503, the device address that control information is carried is if 23 are carried out 504, if be not then I2C bus apparatus execution 505;
Control information is abandoned, be left intact;
503, the I/O of I2C bus apparatus configuration touch key-press control chip is that Sensor uses, and then execution in step 505;
504, same group of I/O of I2C bus apparatus configuration touch key-press control chip is that GPIO uses, and then execution in step 509;
505, the I2C bus apparatus judges that the I/O of configuration touch key-press control chip is that Sensor uses whether success, if configuration successful execution in step 506 then, if configuration failure execution in step 507 then;
506, the touch key-press control chip gathers the Sensor data of touch controlled key, and then execution in step 508;
507, the I2C bus apparatus is to I2C bus host feedback error information;
508, the touch key-press control chip becomes the I2C protocol package to be transferred to the I2C bus apparatus Sensor data encapsulation according to the device address 22 of I2C bus apparatus, sends to the I2C bus host by the I2C bus apparatus afterwards.
509, the I2C bus apparatus judges that the I/O of configuration touch key-press control chip is that GPIO uses whether success, if configuration successful execution in step 510 then, if configuration failure execution in step 511 then;
510, the touch key-press control chip is according to the control information GP configuring IO lightening LED lamp of resolving the I2C bus apparatus and receiving, and then execution in step 512;
511, the I2C bus apparatus is to I2C bus host feedback error information;
512, the touch controlled key control chip becomes the I2C protocol package to be transferred to the I2C bus apparatus data encapsulation that GPIO configures according to the device address 23 of I2C bus apparatus, sends to the I2C bus host by the I2C bus apparatus afterwards.
Above embodiment has introduced the processing method of the control information that the embodiment of the invention provides, next introduce the I2C bus apparatus of the processing method of using this control information, in actual applications, the I2C bus apparatus that the embodiment of the invention provides specifically can be arranged on the touch key-press control chip, also can dispose with apparatus-form independently, mutual with the touch key-press control chip, the mode by software or hardware integration realizes the processing to control information.To introduce in embodiments of the present invention with said method embodiment in the corresponding device of method introduced, specifically the manner of execution of each unit can referring to said method embodiment, in this content of only describing correlation unit, be described as follows.
The I2C bus apparatus that the embodiment of the invention provides, as shown in Figure 6, I2C bus apparatus 800 comprises:
Address acquisition unit 801 is used for obtaining the device address that described control information is carried from the control information that the I2C bus host sends in the I2C bus, and described I2C bus apparatus includes two device addresses: the first device address and the second device address;
The first dispensing unit 802, be used for when the device address that described control information is carried is identical with described the first device address, be input control with the input and output I/O port arrangement of touch key-press control chip, so that described touch key-press control chip is inputted data acquisition control according to described control information;
The second dispensing unit 803, be used for when the device address that described control information is carried is identical with described the second device address, the I/O port arrangement of described touch key-press control chip is controlled for output, so that described touch key-press control chip carries out control operation according to the described control information pair driven equipment that links to each other with described touch key-press control chip.
Need to prove that the I2C bus apparatus that provides for the embodiment of the invention is that the I2C bus apparatus can also comprise (not shown in Figure 6) as a kind of attainable mode wherein:
The first receiving element is used for receiving the data that described touch key-press control chip transmits described input control;
The first transmitting element is used for using described the first device address that the data of described input control are sent to described I2C bus host.
Need to prove that the I2C bus apparatus that provides for the embodiment of the invention is that the I2C bus apparatus can also comprise (not shown in Figure 6) as another kind of attainable mode wherein:
The second receiving element is used for receiving the data that described touch key-press control chip transmits described output control;
The second transmitting element is used for using described the second device address that the data of described output control are sent to described I2C bus host.
Attainable is that the I2C bus apparatus can also comprise (not shown in Figure 6):
Discarding unit is not that described the first device address simultaneously neither described the second device address if be used for device address that described control information carries, and described control information is abandoned.
Need to prove in addition, the first dispensing unit that provides for the embodiment of the invention, as another kind of attainable mode wherein be, the I/O port arrangement that the first dispensing unit specifically can be used for the touch key-press control chip is the data that gather the keyboard input, so that described touch key-press control chip feeds back the data of described keyboard input to described I2C bus apparatus; Described I2C bus apparatus is inputted the I/O port arrangement of touch key-press control chip for detecting timer data are so that described touch key-press control chip feeds back the data of described timer to described I2C bus apparatus; Or described I2C bus apparatus is the data of detecting sensor sensor scanning input with the I/O port arrangement of touch key-press control chip, so that described touch key-press control chip feeds back the data that described sensor scan arrives to described I2C bus apparatus.
Need to prove in addition, the second dispensing unit that provides for the embodiment of the invention, as another kind of attainable mode wherein be, the I/O port arrangement that the second dispensing unit specifically can be used for described touch key-press control chip is general programmable input and output GPIO, described GPIO is used for driving the switch of LED lamp, fan, relay, so that the operation that described touch key-press control chip is opened or closed LED lamp, fan, relay according to described control information.
Need to prove that the I2C bus apparatus that provides for the embodiment of the invention is that the I2C bus apparatus can also comprise (not shown in Figure 6) as another kind of attainable mode wherein:
The first feedback unit is used for feeding back the first miscue information to described I2C bus host when described the first dispensing unit is described I/O port arrangement input control failure;
The second feedback unit, be used for when described the second dispensing unit be that described I/O port arrangement is exported when controlling unsuccessfully, feed back the second miscue information to described I2C bus host.
Need to prove, the contents such as the information interaction between each module/unit of said apparatus, implementation, since with the inventive method embodiment based on same design, its technique effect that brings is identical with the inventive method embodiment, particular content can referring to the narration in the present invention's embodiment of the method as previously shown, repeat no more herein.
In embodiments of the present invention, the I2C bus apparatus includes two device addresses: the first device address and the second device address, if the first device address is carried in the control information that the I2C bus host sends, the first dispensing unit is input control with the I/O port arrangement of touch key-press control chip, so that the touch key-press control chip is inputted data acquisition control according to control information, if the second device address is carried in the control information that the I2C bus host sends, the second dispensing unit is output control with the I/O port arrangement of touch key-press control chip, so that the touch key-press control chip carries out control operation according to control information to driven equipment, after two device addresses of I2C bus apparatus configuration, just can realize input control and output control by same group of I/O port of a touch key-press control chip, and do not need to set up again the I/O port, do not need to set up the touch key-press control chip, the Costco Wholesale in the time of product design can not being increased yet.
One of ordinary skill in the art will appreciate that all or part of step that realizes in above-described embodiment method is to come the relevant hardware of instruction to finish by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
Above processing method and I2C bus apparatus to a kind of control information provided by the present invention is described in detail, for one of ordinary skill in the art, thought according to the embodiment of the invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (14)

1. the processing method of a control information is characterized in that, comprising:
Internal integrated circuit I2C bus apparatus obtains the device address that described control information is carried from the I2C bus host the control information that the I2C bus sends, described I2C bus apparatus includes two device addresses: the first device address and the second device address;
If the device address that described control information is carried is identical with described the first device address, described I2C bus apparatus is input control with the input and output I/O port arrangement of touch key-press control chip, so that described touch key-press control chip is inputted data acquisition control according to described control information;
If the device address that described control information is carried is identical with described the second device address, described I2C bus apparatus is controlled the I/O port arrangement of described touch key-press control chip for output, so that described touch key-press control chip carries out control operation according to the described control information pair driven equipment that links to each other with described touch key-press control chip.
2. method according to claim 1 is characterized in that, described I2C bus apparatus is input control with the input and output I/O port arrangement of touch key-press control chip, also comprises afterwards:
Described I2C bus apparatus receives the data of the described input control of described touch key-press control chip transmission;
Described I2C bus apparatus uses described the first device address that the data of described input control are sent to described I2C bus host.
3. method according to claim 1 is characterized in that, described I2C bus apparatus is output control with the I/O port arrangement of touch key-press control chip, also comprises afterwards:
Described I2C bus apparatus receives the data of the described output control of described touch key-press control chip transmission;
Described I2C bus apparatus uses described the second device address that the data of described output control are sent to described I2C bus host.
4. method according to claim 1 is characterized in that, described method also comprises:
Simultaneously neither described the second device address if the device address that described control information is carried is not described the first device address, described I2C bus apparatus abandons described control information.
5. method according to claim 1 is characterized in that, described I2C bus apparatus is input control with the I/O port arrangement of touch key-press control chip, comprising:
Described I2C bus apparatus is inputted the I/O port arrangement of touch key-press control chip for gathering keyboard data are so that described touch key-press control chip feeds back the data of described keyboard input to described I2C bus apparatus;
Or described I2C bus apparatus is inputted the I/O port arrangement of touch key-press control chip for detecting timer data are so that described touch key-press control chip feeds back the data of described timer to described I2C bus apparatus;
Or described I2C bus apparatus is the data of detecting sensor sensor scanning input with the I/O port arrangement of touch key-press control chip, so that described touch key-press control chip feeds back the data that described sensor scan arrives to described I2C bus apparatus.
6. method according to claim 1 is characterized in that, described I2C bus apparatus is output control with the I/O port arrangement of described touch key-press control chip, comprising:
Described I2C bus apparatus is general programmable input and output GPIO with the I/O port arrangement of described touch key-press control chip, described GPIO is used for driving the switch of LED lamp, fan, relay, so that the operation that described touch key-press control chip is opened or closed LED lamp, fan, relay according to described control information.
7. method according to claim 1 is characterized in that,
Described I2C bus apparatus is input control with the input and output I/O port arrangement of touch key-press control chip, also comprise afterwards: if the failure of described I/O port arrangement input control, described I2C bus apparatus feeds back the first miscue information to described I2C bus host;
Described I2C bus apparatus is output control with the I/O port arrangement of described touch key-press control chip, and also comprise afterwards: if the output of described I/O port arrangement is controlled unsuccessfully, described I2C bus apparatus feeds back the second miscue information to described I2C bus host.
8. an internal integrated circuit I2C bus apparatus is characterized in that, comprising:
Address acquisition unit is used for obtaining the device address that described control information is carried from the control information that the I2C bus host sends in the I2C bus, and described I2C bus apparatus includes two device addresses: the first device address and the second device address;
The first dispensing unit, be used for when the device address that described control information is carried is identical with described the first device address, be input control with the input and output I/O port arrangement of touch key-press control chip, so that described touch key-press control chip is inputted data acquisition control according to described control information;
The second dispensing unit, be used for when the device address that described control information is carried is identical with described the second device address, the I/O port arrangement of described touch key-press control chip is controlled for output, so that described touch key-press control chip carries out control operation according to the described control information pair driven equipment that links to each other with described touch key-press control chip.
9. I2C bus apparatus according to claim 8 is characterized in that, described I2C bus apparatus also comprises:
The first receiving element is for the data of the described input control that receives described touch key-press control chip transmission;
The first transmitting element is used for using described the first device address that the data of described input control are sent to described I2C bus host.
10. I2C bus apparatus according to claim 8 is characterized in that, described I2C bus apparatus also comprises:
The second receiving element is for the data of the described output control that receives described touch key-press control chip transmission;
The second transmitting element is used for using described the second device address that the data of described output control are sent to described I2C bus host.
11. I2C bus apparatus according to claim 8 is characterized in that, described I2C bus apparatus also comprises:
Discarding unit is not that described the first device address simultaneously neither described the second device address if be used for device address that described control information carries, and described control information is abandoned.
12. I2C bus apparatus according to claim 8, it is characterized in that, the I/O port arrangement that described the first dispensing unit specifically is used for the touch key-press control chip is the data that gather the keyboard input, so that described touch key-press control chip feeds back the data of described keyboard input to described I2C bus apparatus; Described I2C bus apparatus is inputted the I/O port arrangement of touch key-press control chip for detecting timer data are so that described touch key-press control chip feeds back the data of described timer to described I2C bus apparatus; Or described I2C bus apparatus is the data of detecting sensor sensor scanning input with the I/O port arrangement of touch key-press control chip, so that described touch key-press control chip feeds back the data that described sensor scan arrives to described I2C bus apparatus.
13. I2C bus apparatus according to claim 8, it is characterized in that, the I/O port arrangement that described the second dispensing unit specifically is used for described touch key-press control chip is general programmable input and output GPIO, described GPIO is used for driving the switch of LED lamp, fan, relay, so that the operation that described touch key-press control chip is opened or closed LED lamp, fan, relay according to described control information.
14. I2C bus apparatus according to claim 8 is characterized in that, described I2C bus apparatus also comprises:
The first feedback unit is used for feeding back the first miscue information to described I2C bus host when described the first dispensing unit is described I/O port arrangement input control failure;
The second feedback unit, be used for when described the second dispensing unit be that described I/O port arrangement is exported when controlling unsuccessfully, feed back the second miscue information to described I2C bus host.
CN201210361256.6A 2012-09-25 2012-09-25 A kind of processing method of control information and I2C bus apparatus Active CN103051736B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210361256.6A CN103051736B (en) 2012-09-25 2012-09-25 A kind of processing method of control information and I2C bus apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210361256.6A CN103051736B (en) 2012-09-25 2012-09-25 A kind of processing method of control information and I2C bus apparatus

Publications (2)

Publication Number Publication Date
CN103051736A true CN103051736A (en) 2013-04-17
CN103051736B CN103051736B (en) 2015-08-26

Family

ID=48064230

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210361256.6A Active CN103051736B (en) 2012-09-25 2012-09-25 A kind of processing method of control information and I2C bus apparatus

Country Status (1)

Country Link
CN (1) CN103051736B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103698603A (en) * 2013-12-27 2014-04-02 深圳芯邦科技股份有限公司 Chip, chip clock testing method and chip clock testing system
CN111272212A (en) * 2018-12-05 2020-06-12 卓望数码技术(深圳)有限公司 I2C equipment data acquisition method and system thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7849244B2 (en) * 2008-03-12 2010-12-07 Inventec Corporation Apparatus for resolving conflicts happened between two I2C slave devices with the same addressed address in computer system
CN201917898U (en) * 2011-01-20 2011-08-03 电子科技大学 Inter-integrated circuit (I2C) bus interface circuit module
CN102281482A (en) * 2011-07-11 2011-12-14 浙江大学 Function extension method and device thereof for earphone jack of smart phone

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7849244B2 (en) * 2008-03-12 2010-12-07 Inventec Corporation Apparatus for resolving conflicts happened between two I2C slave devices with the same addressed address in computer system
CN201917898U (en) * 2011-01-20 2011-08-03 电子科技大学 Inter-integrated circuit (I2C) bus interface circuit module
CN102281482A (en) * 2011-07-11 2011-12-14 浙江大学 Function extension method and device thereof for earphone jack of smart phone

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103698603A (en) * 2013-12-27 2014-04-02 深圳芯邦科技股份有限公司 Chip, chip clock testing method and chip clock testing system
CN111272212A (en) * 2018-12-05 2020-06-12 卓望数码技术(深圳)有限公司 I2C equipment data acquisition method and system thereof
CN111272212B (en) * 2018-12-05 2021-12-31 卓望数码技术(深圳)有限公司 I2C equipment data acquisition method and system thereof

Also Published As

Publication number Publication date
CN103051736B (en) 2015-08-26

Similar Documents

Publication Publication Date Title
CN102104515B (en) Coupling devices, system comprising a coupling device and method for use in a system comprising a coupling device
CN102576339A (en) Multi-protocol storage device bridge
US20100244848A1 (en) System for testing connections between chips
CN105243044B (en) Management system and management method based on serial ports
CN104199795B (en) Data transferring and receiving method of bus framework
CN110334046A (en) A kind of communication means, the apparatus and system of SPI full duplex
CN104219003B (en) Communicator, test system and method for testing thereof
JP4750905B2 (en) Communication system, test apparatus, and test method
WO2012059066A1 (en) Method and system for locating fault in serial port
CN103186440A (en) Method, device and system for detecting in-place state of sub cards
CN103051736A (en) Processing method of control information and I2C (Inter-Integrated Circuit) bus equipment
CN106155954A (en) The system and method that a kind of module identification and COM1 distribute automatically
CN102394734A (en) RS 485 communication system with nonpolarized connection and control method thereof
CN102355394A (en) Method and device for performing data transmission control for a plurality of paths of controller area network (CAN) buses
CN107370651A (en) A kind of communication means between SPI slaves
CN103425123A (en) Automated testing method for CAN (controller area network) bus based on software script
CN101714104B (en) Firmware burning device of computer
CN204925778U (en) Stage multimode cooperative control system
CN101005379A (en) General controller for control network
CN101420373A (en) Method for switching between two types of network packets and network apparatus therefor
CN105094100B (en) A kind of stage multimode cooperative control system
CN204925762U (en) Stage multimode cooperative system
CN1964300A (en) A readable-writable communication controller of serial interface bus
CN115687190B (en) Multipath interaction control circuit and method
CN202372977U (en) Universal serial bus (USB) main equipment interface structure based on field programmable gate array (FPGA)

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