CN106126465A - A kind of data transmission method and device - Google Patents

A kind of data transmission method and device Download PDF

Info

Publication number
CN106126465A
CN106126465A CN201610459821.0A CN201610459821A CN106126465A CN 106126465 A CN106126465 A CN 106126465A CN 201610459821 A CN201610459821 A CN 201610459821A CN 106126465 A CN106126465 A CN 106126465A
Authority
CN
China
Prior art keywords
signal
data
machine
transmission
clock
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
CN201610459821.0A
Other languages
Chinese (zh)
Other versions
CN106126465B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610459821.0A priority Critical patent/CN106126465B/en
Publication of CN106126465A publication Critical patent/CN106126465A/en
Application granted granted Critical
Publication of CN106126465B publication Critical patent/CN106126465B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4291Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a clocked protocol

Abstract

The present invention provides a kind of data transmission method and device, and its method includes: send checking information to from machine;Judge in the first Preset Time, whether receive described the first response message fed back from machine according to described checking information;If it is not, the clock signal of the data signal then data line ports transmitted and clock line port transmission is exchanged, and send described checking information to described from machine according to exchanging result;If receiving described the second response message fed back according to described checking information from machine in the second Preset Time, then carry out data transmission from machine with described.Data transmission method and device that the present invention provides can make main frame carry out data transmission from machine with reversal connection, the most do not affect main frame simultaneously and correctly access carrying out data transmission from machine of bus with other, solving in prior art, the device because causing from machine reversal connection such as scraps at the problem.

Description

A kind of data transmission method and device
Technical field
The present invention relates to technical field of data transmission, particularly relate to a kind of data transmission method and device.
Background technology
Bus is a kind of common communication main line in electronic device, and it can be with the multiple device of carry, at a certain communication process In, certain device is main frame, and other device is from machine, and main frame is carried out data transmission from machine with each by bus.Bus is pressed Mode according to data transmission can be divided into universal serial bus and parallel bus, and common universal serial bus such as I2C etc., these serials are total With the multiple device of carry, line not only can also have that control method is simple, device packing forms is little, communication speed is high, interface line is few Etc. advantage, it is widely used in substantial amounts of electronic product.
But in actual mechanical process, it is easy to the one or more device reversal connections that will be articulated on universal serial bus, example FPDP such as certain device is received on clock line, and clock port is received on data wire, so causes connecing anti-device base Cannot use on Ben, become useless device, cause waste.
Summary of the invention
The embodiment of the present invention provides a kind of data transmission method and device;With solve existing from machine reversal connection time cannot be with master The problem that machine carries out data transmission.
The preferred embodiment of the present invention provides a kind of data transmission method, comprising:
Xiang Congji sends checking information;
Judge in the first Preset Time, whether receive described the first response fed back from machine according to described checking information Information;
If it is not, the clock signal of the data signal then data line ports transmitted and clock line port transmission is exchanged, and root Described checking information is sent to described from machine according to exchanging result;
If receiving described the second response message fed back according to described checking information from machine in the second Preset Time, then Carry out data transmission from machine with described.
In data transmission method described in the preferred embodiment of the present invention, described before sending checking information from machine, also wrap Include:
Call the communications protocol of the universal serial bus preset of universal input/output simulation;
According to described communications protocol, the transmission port arranging data signal is corresponding with described clock line port, and clock is believed Number transmission port corresponding with described data line ports, with generate first signal exchange program;
The clock signal of described data signal data line ports transmitted and clock line port transmission is exchanged, including: adjust Exchanging program with described first signal, data signal data line ports transmitted and the clock signal of clock line port transmission are mutual Change.
In data transmission method described in the preferred embodiment of the present invention, described before sending checking information from machine, also wrap Include:
The transmission port arranging data signal is corresponding with described clock line port, and the transmission port of clock signal is with described Data line ports is corresponding, to generate secondary signal exchange program;
The clock signal of described data signal data line ports transmitted and clock line port transmission is exchanged, including: adjust Exchanging program by described secondary signal, data signal data line ports transmitted and the clock signal of clock line port transmission are mutual Change.
In data transmission method described in the preferred embodiment of the present invention, carry out data transmission it described and described from machine After, also include:
Judge whether to transmit from the data of machine with described;
Described first signal the most then terminating calling exchanges program or described secondary signal exchanges program, and makes to preset Universal serial bus be in idle condition.
In data transmission method described in the preferred embodiment of the present invention, if described do not receive described first response message it After, also include: preserve described checking information so that data line ports transmission data signal and clock line port transmission time After clock signal exchanges, read described checking information and described checking information is sent to described from machine.
The preferred embodiment of the present invention also provides for a kind of data transmission device, comprising:
First transmitting element, for sending checking information to from machine;
Whether the first judging unit, described believe according to described checking from machine for judging to receive in the first Preset Time First response message of breath feedback;
Signal exchange unit, if not receiving described first response message, then by data for described first judging unit The data signal of line cap transmission and the clock signal of clock line port transmission are exchanged;
Second transmitting element, for sending described checking information to described from machine;
Data transmission unit, if feed back according to described checking information from machine described in receiving in the second Preset Time The second response message, then carry out data transmission from machine with described.
In data transmission device described in the preferred embodiment of the present invention, described data transmission device also includes that the first signal is mutual Change signal generating unit, specifically for:
Call the communications protocol of the universal serial bus preset of universal input/output simulation;
According to described communications protocol, the transmission port arranging data signal is corresponding with described clock line port, and clock is believed Number transmission port corresponding with described data line ports, with generate first signal exchange program;
Described signal exchange unit specifically for: if described first judging unit does not receives described first response message, Then call described first signal and exchange program, the data signal that data line ports is transmitted and the clock letter of clock line port transmission Number exchange.
In data transmission device described in the preferred embodiment of the present invention, described data transmission device also includes that secondary signal is mutual Change signal generating unit, specifically for: the transmission port arranging data signal is corresponding with described clock line port, the biography of clock signal Defeated port is corresponding with described data line ports, to generate secondary signal exchange program;
Described signal exchange unit specifically for: if described first judging unit does not receives described first response message, Then call described secondary signal and exchange program, the data signal that data line ports is transmitted and the clock letter of clock line port transmission Number exchange.
In data transmission device described in the preferred embodiment of the present invention, described data transmission device also includes the second judgement list Unit, specifically for: judge whether to transmit from the data of machine with described;Described first signal the most then terminating calling is mutual Change program or described secondary signal exchanges program, and make the universal serial bus preset be in idle condition.
In data transmission device described in the preferred embodiment of the present invention, described data transmission device also includes memory element, Specifically for: preserve described checking information so that data line ports transmission data signal and clock line port transmission time After clock signal exchanges, the second transmitting element reads described checking information and sends described checking information to described from machine.
Compared with prior art, the data transmission method that the present invention provides, by a certain being in reversal connection from machine judging During state, exchanged by the clock signal of the data signal that the data line ports of main frame is transmitted and clock line port transmission, make The wiring condition that is articulated in bus from machine of main frame and reversal connection matches, thus realize main frame and reversal connection carries out data biography from machine Defeated, when main frame and reversal connection are after machine completes data transmission, recover data line ports and the signal of clock line port transmission of main frame, Make main frame can correctly access carrying out data transmission from machine of bus with other, solve in prior art, because of from machine reversal connection And the device caused such as scraps at the problem.
The present invention also provides for a kind of data transmission device, calls the first signal by signal exchange unit and exchanges program or the Binary signal exchanges program and is exchanged by the signal of the data line ports of main frame and the output of clock line port, so that main frame can be with Reversal connection carries out normal data transfer from machine, and after data are transmitted, the second judging unit will terminate the first signal and exchange program Or secondary signal exchanges program, recover the data line ports of main frame and the signal of clock line port output so that main frame can be with Carrying out data transmission from machine of correct access bus, solves in prior art, because the device caused from machine reversal connection is scrapped Problem, simultaneously ensure main frame and reversal connection in the case of machine can be with normal data transfer, do not affect main frame correct with other Access carrying out data transmission from machine of bus.
Accompanying drawing explanation
Fig. 1 is the flow chart of the data transmission method in the preferred embodiment of the present invention;
Fig. 2 is the flow chart of another data transmission method in the preferred embodiment of the present invention;
Fig. 3 is the structural representation of the data transmission device in the preferred embodiment of the present invention.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Describe, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments wholely.Based on Embodiment in the present invention, the every other enforcement that those skilled in the art are obtained under not making creative work premise Example, broadly falls into the scope of protection of the invention.
Refer to the flow chart that Fig. 1, Fig. 1 are the data transmission method in the preferred embodiment of the present invention.This preferred embodiment The data transmission method provided can apply to personal computer, server computer, hand-held or laptop devices, movement sets In the electronic products such as standby, multicomputer system, consumer electronic devices, minicomputer, mainframe computer, do not do concrete at this Limit.
Data transmission method in this preferred embodiment includes:
Step S101: send checking information to from machine;
Step S102: judge whether to receive in the first Preset Time and described feed back according to described checking information from machine First response message;
Step S103: if it is not, the data signal then data line ports transmitted and the clock signal of clock line port transmission Exchange, and send described checking information to described from machine according to exchanging result;
Step S104: described second answer according to what described checking information feed back from machine if receiving in the second Preset Time Answer information, then carry out data transmission from machine with described.
Data transmission method in this preferred embodiment is applicable to the universal serial bus preset with data wire and clock line On main frame and data transmission between machine, the universal serial bus preset includes I2C bus etc., will be described in detail this below Data transmission method in preferred embodiment.
In step S101, main frame sends checking information to from machine, and in the present embodiment, checking information is by from the address of machine Code and read-write position composition, if can receive this checking information from machine, i.e. correctly access default universal serial bus from machine, then Will determine that the address code this checking information is the most identical, if it is different, then ignore this checking with the address code of storage in it from machine Information, if identical, then sends response message to main frame, and notice main frame can carry out data transmission with it;But, when from machine reversal connection When default universal serial bus, i.e. from the clock line that the FPDP of machine receives default universal serial bus, and clock port connects On the data wire of default universal serial bus, so when main frame sends checking information to this from machine, will be unable to from machine of reversal connection Receive this checking information, response message can not be generated according to this checking information simultaneously.The most in other embodiments, checking Information can also only include the address code from machine, or other can uniquely identify the checking information from identity, at this The concrete form of checking information is not limited.
In step S102 and S103, whether main frame receives in judging the first Preset Time is fed back according to checking information from machine The first response message, if it is not, total in default serial from machine reversal connection corresponding to the address code then illustrated in this checking information Line, now, main frame is by this checking information of preservation, and by the data signal of transmission in the data line ports of main frame and clock line port The clock signal of transmission is exchanged, and will data signal export from the clock line port of main frame, and clock signal is defeated from data line ports Go out, thus can complete data signal and clock signal with the matching from the two of machine port connection situations of reversal connection After the exchange of output port, main frame is by this checking information of reading, and checking information is exported in advance by its clock line cap If universal serial bus in, now can receive checking information from machine, and by the address code in checking information with its in store Address code compare, if the address code in the checking information received with its in storage address code match, then this reversal connection The second response message will be produced from machine, and be sent to main frame.
The port of main frame can be divided into able to programme and non-programmable two classes, when data line ports and the clock line port of main frame are Time non-programmable, when i.e. the attribute of two port output signals is non-programmable, program can be exchanged by calling the first signal Realize data signal and the exchange of clock signal of clock line port transmission of the data line ports transmission of main frame, wherein, the One signal exchanges program and generated before step S101.
First signal exchanges the generation method of program and includes: call the universal serial bus preset of universal input/output simulation Communications protocol;According to described communications protocol, the transmission port arranging data signal is corresponding with the clock line port of main frame, time The transmission port of clock signal is corresponding with the data line ports of main frame, to generate the first signal exchange program.When main frame does not receives After first response message, by call first signal exchange program realize main frame data line ports transmission data signal and The exchange of the clock signal of clock line port transmission so that main frame be articulated in the wiring condition default universal serial bus from machine Match.
When the data line ports of main frame and clock line port are able to programme, i.e. the attribute of two port output signals is can During programming, can by call secondary signal exchange program realize main frame data line ports transmission data signal and clock The exchange of the clock signal of line cap transmission, wherein, secondary signal is exchanged program and was generated before step S101.
Secondary signal is exchanged the generation method of program and is included: arrange the transmission port of data signal and described clock line port Corresponding, the transmission port of clock signal is corresponding with described data line ports, to generate secondary signal exchange program.Second letter Number exchange program is without exchanging the data line ports of main frame by the way of the universal serial bus that universal input/output simulation is preset With the signal of clock line port output, its data line ports having only to reset main frame and the signal of clock line port output Content, therefore, when main frame does not receives the first response message, it is only necessary to the most permissible by calling secondary signal exchange program Realize the exchange of the signal of the data line ports of main frame and the output of clock line port so that main frame be articulated in from machine default Universal serial bus on wiring condition match.
First signal exchanges program and secondary signal is exchanged program and can be stored concurrently in main frame, it is also possible to according to master Whether the port of machine is programmable to is selected, and one of both is stored in main frame, in the case of both of which is stored in main frame, when When main frame does not receives the first response message, main frame first calls secondary signal and exchanges program to realize the data line ports biography of main frame The exchange of the clock signal of defeated data signal and clock line port transmission, now, main frame retransmit checking information to reversal connection from Machine, if main frame cannot receive the response message that reversal connection is fed back from machine, then illustrates that the port of main frame is non-programmable, now adjusts Data signal and the clock of clock line port transmission of the data line ports transmission of main frame is realized by the first signal exchange program The exchange of signal, main frame retransmits checking information and exchanges program to reversal connection and exchange program from machine, the first signal with secondary signal Concrete existing way is not specifically limited, can be according to the demand of the equipment of reality application depending on.
In step S104, if main frame have received the second response letter that reversal connection sends from machine in the second Preset Time Breath, then main frame can carry out normal data transfer with this reversal connection from machine.In the preferred embodiment, the first Preset Time and second Preset Time is identical, and the checking information that main frame sends includes the address code of seven and a reading writing information, and main frame will send simultaneously Eight clock signals, each clock signal correspondence a data byte, during therefore main frame needs the 9th clock in receive From the response message of machine.Certainly, in other embodiments, the first Preset Time can also be different from the second Preset Time, at this It is not particularly limited.Meanwhile, the first response message and the second response message that do according to the checking information that main frame sends from machine can With identical can also be different, when being constantly in idle condition from machine, the first response message and the second response message can be identical, It is all the response message for pointing out main frame to carry out data transmission, and when being in busy state from machine, the second response letter Breath could be for pointing out main frame to wait or prompting main frame is currently not suitable for the information such as data transmission, does not do concrete limit at this System.
Refer to the flow chart that Fig. 2, Fig. 2 are another data transmission method in the preferred embodiment of the present invention.In order to not Affect other and normally access transmitting from the data between machine and main frame of default universal serial bus, the most also include Step S105, when main frame and reversal connection are after machine carries out data transmission, and main frame needs to have judged whether with reversal connection from the data of machine Transmission, if completing data transmission, then the first signal that termination is called by main frame exchanges program or secondary signal exchanges program, recovers The data line ports of main frame and the signal of clock line port output, i.e. recover the data line ports outputting data signals of main frame, time Clock line cap output clock signal, discharges default universal serial bus so that the data wire of default universal serial bus and clock simultaneously Line is in high level state, keeps the universal serial bus preset to be in idle condition, and the aft engine that so can ensure that is with other just Often access carrying out data transmission from machine of default universal serial bus.
The data transmission method that the preferred embodiment of the present invention provides, exchanges program by the first signal or secondary signal is exchanged The signal of the data line ports of main frame and the output of clock line port is exchanged by program so that main frame can with reversal connection from machine Carry out normal data transfer, after data are transmitted, terminate the first signal and exchange program or secondary signal exchange program, recover The data line ports of main frame and the signal of clock line port output so that main frame can be with the correct universal serial bus accessing and presetting Carry out data transmission from machine, solve in prior art because the device caused from machine reversal connection such as scraps at the problem, it is achieved that main frame Can carry out data transmission from machine with reversal connection, the most do not affect that main frame correctly accesses buses with other carries out data biography from machine simultaneously Defeated.
In order to the data transmission method in the present invention is described further, will come in detail with concrete application scenarios below Explain.
In this application scene, the universal serial bus preset is I2C bus, and data line ports and the clock line port of main frame are Non-programmable.
After Host Detection is in idle condition to I2C bus, send an initial signal so that supervisor I2C is total for this main frame Line;Rear to from machine send checking information, wherein, checking information includes the address code from machine and reading instruction position;Main frame will determine that The response message produced from machine whether is received according to described checking information, if it is not, then illustrate and test in during the 9th clock What address code in card information was corresponding is in reversal connection state from machine, and now main frame first preserves this checking information, and calls first Signal exchanges program, and the data signal and the clock signal of clock line port transmission that complete the transmission of the data line ports to main frame are mutual Changing, wherein, it is the communications protocol using universal input/output to carry out analogue I2C bus that the first signal exchanges program, and arranges simulation Communications protocol in data signal transmission port corresponding with the clock line port of main frame, the transmission port of clock signal and master The data line ports of machine is corresponding and generates.
After the data line ports and clock line port output signal completing main frame is exchanged, main frame mounts from machine with reversal connection Wiring condition in I2C bus matches, the checking information of main frame reading and saving, and by checking information by clock line port Being sent to reversal connection and can receive checking information by the clock line I2C bus from machine, now reversal connection from machine, reversal connection is received from machine After checking information, will determine that the address code in checking information whether with its in the address code of storage match, if coupling, then send out Send response message to notify that it can be carried out reading data manipulation by main frame, after main frame receives this response message, start to receive instead Connect the data message sent from machine, when main frame completes, to during from the data read operation of machine, to send a stopping signal, terminate simultaneously Calling the first signal and exchange program, recover the data line ports outputting data signals of main frame, clock line port exports clock signal, So that follow-up main frame correctly accesses carrying out data transmission from machine in I2C bus with other.Thus realize from machine reversal connection in Time in I2C bus, main frame by call the first signal exchange data signal that the data line ports of main frame transmitted by program and The clock signal of clock line port transmission is exchanged so that the wiring condition phase that main frame is articulated in I2C bus from machine with reversal connection Join, thus ensure that main frame can carry out data transmission from machine with reversal connection, when after DTD, mutual by terminating the first signal Program of changing is to recover the signal of host data line cap and the output of clock line port so that follow-up main frame correctly can connect with other Enter carrying out data transmission from machine of I2C bus.
One application scenarios of above-mentioned only data transmission method of the present invention, this application scenarios is to be explained further What this method was described realizes process, it is impossible to be used for limiting the present invention.
Refer to the structural representation that Fig. 3, Fig. 3 are the data transmission device in the preferred embodiment of the present invention.This is the most real Execute the data transmission device 11 in example to be applicable to be articulated on the universal serial bus preset with data wire SDA and clock line SCL Main frame 10 in, preset universal serial bus include I2C bus etc., main frame 10 can apply to personal computer, server calculate Machine, hand-held or laptop devices, mobile device, multicomputer system, consumer electronic devices, minicomputer, large-scale meter In the electronic products such as calculation machine, it is not specifically limited at this.
Data transmission device 11 in this preferred embodiment includes:
First transmitting element 111, for sending checking information to from machine;
First judging unit 112, described in judge whether to receive in the first Preset Time from machine according to described in test First response message of card information feedback;
Signal exchange unit 113, if not receiving described first response message, then for described first judging unit 112 Data signal data line ports transmitted and the clock signal of clock line port transmission are exchanged;
Second transmitting element 114, for sending described checking information to described from machine;
Data transmission unit 115, if for receive in the second Preset Time described from machine according to described checking information Second response message of feedback, then carry out data transmission from machine with described.
The data transmission device 11 in this preferred embodiment is explained below in conjunction with Fig. 3.
In Fig. 3, data transmission device 11 is arranged in main frame 10, and the data line ports 12 of main frame 10 is connected to I2C bus Data wire SDA on, the clock line port 13 of main frame 10 is connected on the clock line SCL of I2C bus, and n is also articulated in from machine In I2C bus, it can be seen that connect instead from machine 2, i.e. the FPDP from machine 2 is received the clock line of I2C bus, And clock port is received on the data wire of I2C bus.In the present embodiment, main frame be articulated in I2C bus from machine, the most also Can be articulated in other buses, be not specifically limited at this.
When main frame 10 needs with when carrying out data transmission from machine 2, and the first transmitting element 111 of main frame 10 is by transmission checking letter Breath is exported to data wire SDA by data line ports 12, and in the present embodiment, checking information is by from the address code of machine 2 and reading Write bit forms, and the most in other embodiments, checking information can also only include the address code from machine, or other are permissible Unique checking information identified from identity, does not limits the concrete form of checking information at this.
Owing to from machine 2 reversal connection, it can not receive checking information, the most also cannot produce the first response according to checking information Information.First judging unit 112 judges whether receive the first response message sent from machine in the first Preset Time, if it is not, Then illustrating to be in reversal connection state from machine 2, now, the memory element in data transmission device is by this checking information of preservation, and believes The clock signal that the data signal of transmission in the data line ports 12 of main frame is transmitted by number exchange unit 113 with clock line port 13 Exchanging, will data signal export from the clock line port 13 of main frame, clock signal exports from data line ports 12, thus may be used So that main frame 10 matches from two port connection situations of machine 2 with reversal connection.
After the exchange that signal exchange unit 113 completes data signal and clock signal output terminal mouth, second sends Unit 114 is by this checking information of reading, and checking information is exported to I2C bus by the clock line port 13 of main frame 10, Now can receive checking information from machine 2, and by the address code in checking information with its in the address code of storage compare, If the address code in the checking information received matches with the address code of its interior storage, then will produce the second response letter from machine 2 Breath, and it is transferred to main frame 10 by clock line SCL.
The data line ports 12 of main frame 10 and clock line port 13 can be divided into able to programme and non-programmable, work as data line ports 12 and clock line port 13 when being non-programmable, when i.e. the attribute of two port output signals is non-programmable, data transmission dress Putting 11 and also include that the first signal exchanges signal generating unit, the first signal exchanges signal generating unit for by calling universal input/output The communications protocol of the I2C bus of simulation;According to communications protocol, the transmission port arranging data signal is relative with clock line port 13 Should, the transmission port of clock signal is corresponding with data line ports 12, to generate the first signal exchange program.When main frame 10 does not connects When receiving the first response message, signal exchange unit 113 is by mutual for the first signal calling the first signal exchange signal generating unit generation Changing program, the clock signal that data signal data line ports 12 transmitted and clock line port 13 transmit is exchanged so that main frame 10 wiring condition being articulated in I2C bus from machine 2 with reversal connection match.
When data line ports 12 and clock line port 13 are able to programme, i.e. the attribute of two port output signals is for compiling Cheng Shi, data transmission device 11 also includes that secondary signal exchanges signal generating unit, and secondary signal is exchanged signal generating unit and is used for arranging number The transmission port of the number of it is believed that is corresponding with clock line port 13, and the transmission port of clock signal is corresponding with data line ports 12, To generate secondary signal exchange program.When main frame 10 does not receives the first response message, signal exchange unit 113 will call Binary signal exchanges the secondary signal exchange program that signal generating unit generates, data signal data line ports 12 transmitted and clock line The clock signal of port 13 transmission is exchanged so that the wiring condition phase that main frame 10 is articulated in I2C bus from machine 2 with reversal connection Join.
When main frame 10 have received the second response message that reversal connection sends from machine 2 in the second Preset Time, then illustrate main Machine 10 can carry out normal data transfer with this reversal connection from machine 2, and data transmission unit 115 is by the read-write position according to checking information Instruction is written and read data to from machine 2.In the preferred embodiment, the first Preset Time and the second Preset Time are identical, main frame The 10 checking information sent include the address code of seven and a reading writing information, and main frame 10 will send eight clock signals simultaneously, Each clock signal correspondence a data byte, therefore main frame 10 receives the response from machine in needing during the 9th clock Information.Certainly, in other embodiments, the first Preset Time can also be different from the second Preset Time, do not do concrete limit at this System.Meanwhile, the first response message and the second response message can be the same or different, when being constantly in idle condition from machine 2 Time, the first response message and the second response message can be identical, are all should for point out that main frame 10 can carry out data transmission Answer information, and when being in busy state from machine 2, the second response message could be for pointing out main frame 10 wait or point out master Machine 10 is currently not suitable for the information such as data transmission, is not particularly limited at this.
Normally access transmitting from the data between machine and main frame 10 of I2C buses to not affect other, when main frame 10 with Reversal connection after machine 2 carries out data transmission, the second judging unit in data transmission device 11 will determine that whether complete with reversal connection from The data transmission of machine 2, if completing data transmission, then the first signal termination called exchanges program or secondary signal exchanges journey Sequence, recovers data line ports 12 and the signal of clock line port 13 output of main frame, and the data line ports 12 i.e. recovering main frame is defeated Going out data signal, clock line port 13 exports clock signal, simultaneously release I2C bus so that data wire SDA and clock line SCL It is in high level state, so can ensure that main frame normally accesses carrying out data transmission from machine of I2C bus with other.
In the preferred embodiment, only illustrate one from machine reversal connection, certainly in actual operating process, having very much can Can occur in an I2C bus multiple reversal connection from machine, the process carried out data transmission from machine of main frame and each reversal connection with Only exist a reversal connection identical from the process of machine, do not repeat them here.
The data transmission device that the preferred embodiment of the present invention provides, calls the first signal by signal exchange unit 113 mutual Change program or secondary signal exchanges the signal exchange that data line ports 12 and the clock line port 13 of main frame are exported by program, thus Make main frame 10 can with reversal connection carry out normal data transfer from machine 2, after data are transmitted, the second judging unit will eventually Only the first signal exchanges program or secondary signal exchanges program, and the data line ports 12 and the clock line port 13 that recover main frame export Signal so that main frame can access carrying out data transmission from machine of bus with correct, can from machine ensure main frame and reversal connection While normal data transfer, main frame can also carry out data transmission from machine be normally connected.
Each functional unit in the embodiment of the present invention can be integrated in a processing module, it is also possible to is unit list Solely it is physically present, it is also possible to two or more unit are integrated in a module.Above-mentioned integrated module both can use The form of hardware realizes, it would however also be possible to employ the form of software function module realizes.If described integrated module is with software function The form of module realizes and as independent production marketing or when using, it is also possible to is stored in an embodied on computer readable storage and is situated between In matter.Storage medium mentioned above can be read only memory, disk or CD etc..Above-mentioned each device or system are permissible Perform the method in correlation method embodiment.
In sum, although the present invention is disclosed above with preferred embodiment, but above preferred embodiment and be not used to limit The present invention processed, those of ordinary skill in the art, without departing from the spirit and scope of the present invention, all can make various change and profit Decorations, therefore protection scope of the present invention defines in the range of standard with claim.

Claims (10)

1. a data transmission method, it is characterised in that including:
Xiang Congji sends checking information;
Judge in the first Preset Time, whether receive described the first response message fed back from machine according to described checking information;
If it is not, the clock signal of the data signal then data line ports transmitted and clock line port transmission is exchanged, and according to mutually Change result and send described checking information to described from machine;
If receiving described the second response message fed back according to described checking information from machine in the second Preset Time, then with institute State and carry out data transmission from machine.
Data transmission method the most according to claim 1, it is characterised in that described before sending checking information from machine, Also include:
Call the communications protocol of the universal serial bus preset of universal input/output simulation;
According to described communications protocol, the transmission port arranging data signal is corresponding with described clock line port, clock signal Transmission port is corresponding with described data line ports, to generate the first signal exchange program;
The clock signal of described data signal data line ports transmitted and clock line port transmission is exchanged, including: call institute Stating the first signal and exchange program, data signal data line ports transmitted and the clock signal of clock line port transmission are exchanged.
Data transmission method the most according to claim 1, it is characterised in that described before sending checking information from machine, Also include:
The transmission port arranging data signal is corresponding with described clock line port, the transmission port of clock signal and described data Line cap is corresponding, to generate secondary signal exchange program;
The clock signal of described data signal data line ports transmitted and clock line port transmission is exchanged, including: call institute Stating secondary signal and exchange program, data signal data line ports transmitted and the clock signal of clock line port transmission are exchanged.
4. according to the data transmission method described in Claims 2 or 3, it is characterised in that carry out data described and described from machine After transmission, also include:
Judge whether to transmit from the data of machine with described;
Described first signal the most then terminating calling exchanges program or described secondary signal exchanges program, and makes the string preset Row bus is in idle condition.
Data transmission method the most according to claim 1, it is characterised in that do not receive described first response letter if described After breath, also include: preserve described checking information so that in data signal and the clock line port transmission of data line ports transmission Clock signal exchange after, read described checking information and described checking information sent to the most described from machine.
6. a data transmission device, it is characterised in that including:
First transmitting element, for sending checking information to from machine;
First judging unit, anti-according to described checking information from machine described in judge whether to receive in the first Preset Time First response message of feedback;
Signal exchange unit, if not receiving described first response message, then by data line end for described first judging unit The data signal of port transmission and the clock signal of clock line port transmission are exchanged;
Second transmitting element, for sending described checking information to described from machine;
Data transmission unit, if for receive in the second Preset Time described feed back according to described checking information from machine the Two response messages, then carry out data transmission from machine with described.
Data transmission device the most according to claim 6, it is characterised in that described data transmission device also includes the first letter Number exchange signal generating unit, specifically for:
Call the communications protocol of the universal serial bus preset of universal input/output simulation;
According to described communications protocol, the transmission port arranging data signal is corresponding with described clock line port, clock signal Transmission port is corresponding with described data line ports, to generate the first signal exchange program;
Described signal exchange unit specifically for: if described first judging unit does not receives described first response message, then adjust Exchanging program with described first signal, data signal data line ports transmitted and the clock signal of clock line port transmission are mutual Change.
Data transmission device the most according to claim 6, it is characterised in that described data transmission device also includes the second letter Number exchange signal generating unit, specifically for: the transmission port arranging data signal is corresponding with described clock line port, clock signal Transmission port corresponding with described data line ports, with generate secondary signal exchange program;
Described signal exchange unit specifically for: if described first judging unit does not receives described first response message, then adjust Exchanging program by described secondary signal, data signal data line ports transmitted and the clock signal of clock line port transmission are mutual Change.
9. according to the data transmission device described in claim 7 or 8, it is characterised in that described data transmission device also includes Two judging units, specifically for: judge whether to transmit from the data of machine with described;The most then terminate described called One signal exchanges program or described secondary signal exchanges program, and makes the universal serial bus preset be in idle condition.
Data transmission device the most according to claim 6, it is characterised in that described data transmission device also includes storage Unit, specifically for: preserve described checking information so that in data signal and the clock line port transmission of data line ports transmission Clock signal exchange after, second transmitting element read described checking information and by described checking information send to the most described from Machine.
CN201610459821.0A 2016-06-21 2016-06-21 A kind of data transmission method and device Active CN106126465B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610459821.0A CN106126465B (en) 2016-06-21 2016-06-21 A kind of data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610459821.0A CN106126465B (en) 2016-06-21 2016-06-21 A kind of data transmission method and device

Publications (2)

Publication Number Publication Date
CN106126465A true CN106126465A (en) 2016-11-16
CN106126465B CN106126465B (en) 2017-09-12

Family

ID=57268475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610459821.0A Active CN106126465B (en) 2016-06-21 2016-06-21 A kind of data transmission method and device

Country Status (1)

Country Link
CN (1) CN106126465B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871344A (en) * 2017-12-05 2019-06-11 炬芯(珠海)科技有限公司 Communication system, interface circuit and its method for transmitting signal
CN109871343A (en) * 2017-12-05 2019-06-11 炬芯(珠海)科技有限公司 Interface circuit, electronic device and method for transmitting signals
CN109871342A (en) * 2017-12-05 2019-06-11 炬芯(珠海)科技有限公司 The serial interface circuit and its adaptive connection method of adaptive connection
CN111371533A (en) * 2020-03-09 2020-07-03 腾讯科技(深圳)有限公司 Data transmission method, device, storage medium and equipment
CN117370258A (en) * 2023-11-02 2024-01-09 珠海电科星拓科技有限公司 Multipath low-speed I2C expansion method and device for high-speed I2C bus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102253914A (en) * 2011-06-02 2011-11-23 福建星网锐捷网络有限公司 Data transmitting and processing method and device and equipment interface
CN103460201A (en) * 2011-02-15 2013-12-18 北欧半导体公司 Serial interface
CN104298637A (en) * 2014-09-29 2015-01-21 深圳市爱普特微电子有限公司 Communication method and system
CN105446837A (en) * 2015-04-02 2016-03-30 北京天诚盛业科技有限公司 Method, device and system for detecting whether IIC (inter-integrated circuit) interface device is connected

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103460201A (en) * 2011-02-15 2013-12-18 北欧半导体公司 Serial interface
CN102253914A (en) * 2011-06-02 2011-11-23 福建星网锐捷网络有限公司 Data transmitting and processing method and device and equipment interface
CN104298637A (en) * 2014-09-29 2015-01-21 深圳市爱普特微电子有限公司 Communication method and system
CN105446837A (en) * 2015-04-02 2016-03-30 北京天诚盛业科技有限公司 Method, device and system for detecting whether IIC (inter-integrated circuit) interface device is connected

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871344A (en) * 2017-12-05 2019-06-11 炬芯(珠海)科技有限公司 Communication system, interface circuit and its method for transmitting signal
CN109871343A (en) * 2017-12-05 2019-06-11 炬芯(珠海)科技有限公司 Interface circuit, electronic device and method for transmitting signals
CN109871342A (en) * 2017-12-05 2019-06-11 炬芯(珠海)科技有限公司 The serial interface circuit and its adaptive connection method of adaptive connection
CN109871344B (en) * 2017-12-05 2021-08-31 炬芯科技股份有限公司 Communication system, interface circuit and signal transmission method thereof
CN109871342B (en) * 2017-12-05 2024-02-09 炬芯科技股份有限公司 Self-adaptive connection serial interface circuit and self-adaptive connection method thereof
CN111371533A (en) * 2020-03-09 2020-07-03 腾讯科技(深圳)有限公司 Data transmission method, device, storage medium and equipment
CN111371533B (en) * 2020-03-09 2022-02-22 腾讯科技(深圳)有限公司 Data transmission method, device, storage medium and equipment
CN117370258A (en) * 2023-11-02 2024-01-09 珠海电科星拓科技有限公司 Multipath low-speed I2C expansion method and device for high-speed I2C bus
CN117370258B (en) * 2023-11-02 2024-03-29 珠海电科星拓科技有限公司 Multipath low-speed I2C expansion method and device for high-speed I2C bus

Also Published As

Publication number Publication date
CN106126465B (en) 2017-09-12

Similar Documents

Publication Publication Date Title
CN106126465B (en) A kind of data transmission method and device
WO2021244194A1 (en) Register reading/writing method, chip, subsystem, register group, and terminal
KR20110010707A (en) Direct data transfer between slave devices
CN113301568B (en) Network distribution method and device and intelligent household equipment
CN105068955A (en) Local bus structure and data interaction method
CN204117142U (en) Electronic device for providing instant switching and sharing of universal serial bus electronic equipment by host
CN102884515B (en) Serial ports re-orientation processes method, apparatus and system
CN110659143B (en) Communication method and device between containers and electronic equipment
CN104484260A (en) Simulation monitoring circuit based on GJB289 bus interface SoC (system on a chip)
CN109992556A (en) A kind of I2C driving method and device
CN112422485A (en) Communication method and device of transmission control protocol
CN107885674B (en) Bluetooth device simulator, working method thereof and Bluetooth device operating system
CN103973534A (en) Analog U disk sharing method and analog U disk sharing equipment
CN105117353A (en) FPGA with general data interaction module and information processing system using same
CN105068962A (en) I2C controller access method and I2C controller access system
CN111444129B (en) Method for transmitting MDB data and terminal equipment
CN106940684B (en) Method and device for writing data according to bits
CN111371799B (en) Method, device and equipment for controlling data receiving and transmitting of MCTP (Multi-channel media Port) controller
US20130067130A1 (en) Bus control apparatus and bus control method
CN216014148U (en) Server and server backboard
CN113886297A (en) SPI concurrent communication SE device and method based on DMA
JP3750467B2 (en) USB simulation apparatus and storage medium
CN106325377A (en) External device expansion card and input/output external device data processing method
CN108132900A (en) Interconnecting device, telecommunication system and data transmission method
CN112987690B (en) Espi controller verification system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: Guangdong Opel Mobile Communications Co., Ltd.

CP01 Change in the name or title of a patent holder