CN108763139A - A kind of control method and device of I2C communications - Google Patents

A kind of control method and device of I2C communications Download PDF

Info

Publication number
CN108763139A
CN108763139A CN201810357762.5A CN201810357762A CN108763139A CN 108763139 A CN108763139 A CN 108763139A CN 201810357762 A CN201810357762 A CN 201810357762A CN 108763139 A CN108763139 A CN 108763139A
Authority
CN
China
Prior art keywords
communications status
communications
equipment
gpio
slave equipment
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.)
Withdrawn
Application number
CN201810357762.5A
Other languages
Chinese (zh)
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.)
Qingdao Hisense Electronics Co Ltd
Original Assignee
Qingdao Hisense Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Hisense Electronics Co Ltd filed Critical Qingdao Hisense Electronics Co Ltd
Priority to CN201810357762.5A priority Critical patent/CN108763139A/en
Publication of CN108763139A publication Critical patent/CN108763139A/en
Withdrawn legal-status Critical Current

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
    • 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/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0016Inter-integrated circuit (I2C)

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a kind of control method and device of I2C communications.This method includes:When the main equipment for receiving the first system carries out the request of I2C communications, judge that communications status of the slave equipment in second system in the first system, the communications status include idle and busy;When communications status is idle, the I2C communications are carried out;When communications status is busy, postpones preset time and judge communications status of the slave equipment in second system in the first system again.It realizes through the control from the working condition of equipment to the terminal equipment in communication logic using at least one I2C communication systems in the first system, it avoids due to abnormal from the busy caused I2C reading/writing datas of equipment state, and then avoid the situation that upper layer software (applications) display is abnormal caused by bottom data communication abnormality, the stability of system is improved, the user experience is improved.

Description

A kind of control method and device of I2C communications
Technical field
The present invention relates to the control method and device that field of communication technology more particularly to a kind of I2C are communicated.
Background technology
I2C(Inter Integrated Circuit, internal integrated circuit)Bus is that microelectronics communication control field is wide A kind of bus standard of general use, for connecting I2C hosts and I2C slaves.Main device is produced for starting bus transmissioning data Raw clock is regarded as with the device of open transmission, the device being addressed any at this time from device.It is only deposited in usual I2C buses In a host.
With being continuously increased for TV functions, the system framework of TV tends to be complicated, and the realization of a complete function needs Multiple systems carry out I2C data communications.Under this kind of framework, data can be caused different due to the uncoordinated of intersystem communications state Often.Specifically, being illustrated with television system architectures shown in FIG. 1.The television system includes two systems main system and secondary system System:Wherein main system for realizing TV main logic and controls peripheral system work, by system level chip SOC(System of chip)With microprocessing unit MCU(Microcontroller Unit)Composition, is communicated by I2C between the two, In its communication process, SOC is main equipment, and MCU is from equipment;Subsystem executes simple function, the instruction that work is issued by SOC Control, such as display system, audio system, by MCU and register REG(Register)Composition, is carried out by I2C between the two Communication, in its communication process, MCU is main equipment, and REG is from equipment.As carried out backlight or image quality under application scenes When adjusting, it may appear that major-minor system is carried out at the same time the situation of I2C communications, and MCU had not only been main equipment but also had been from equipment, to lead at this time It causes SOC to read parameter from MCU and the phenomenon that abnormal, to cause interim card or state entanglement occurs, system stability is influenced, to influence to use It experiences at family.
It would therefore be highly desirable to which a kind of scheme solves the technical problem.
Invention content
In a first aspect, the embodiment of the present invention provides a kind of control method of I2C communications, including:
When the main equipment for receiving the first system carries out the request of I2C communications, judge that the slave equipment in the first system exists Communications status in second system, the communications status include idle and busy;
When the communications status is idle, the I2C communications are carried out;When the communications status is busy, when delay is default Between and judge communications status of the slave equipment in second system in the first system again.
It is described to judge that the slave equipment in the first system is logical in second system in a kind of possible embodiment Before letter state, including:
Communications status of the slave equipment in second system in the first system is monitored, and the communications status is drawn with GPIO The low and high level of foot is identified, wherein the GPIO is set to the main equipment of the first system and between equipment.
It is described to judge in the first system before the communications status of equipment in a kind of possible embodiment, packet It includes:
Communications status of the slave equipment in second system in the first system is monitored, and by the communications status with flag bit Form be stored in register or memory.
It is described to be identified the communications status with the low and high level of GPIO pin in a kind of possible embodiment Including:
When the communications status is idle, the pin level that the GPIO is arranged is high level;When the communications status is busy When commonplace, the pin level that the GPIO is arranged is low level;Or,
When the communications status is idle, the pin level that the GPIO is arranged is low level;When the communications status is busy When commonplace, the pin level that the GPIO is arranged is high level.
It is described to judge that the slave equipment in the first system is logical in second system in a kind of possible embodiment Letter state, including:
The level value for reading the GPIO judges the slave equipment in the first system in second system according to the level value Communications status.
It is described to judge that the slave equipment in the first system is logical in second system in a kind of possible embodiment Letter state, including:
The flag bit that communications status is read from the register or memory, judges the first system according to the flag bit In communications status of the slave equipment in the second system.
Second aspect, an embodiment of the present invention provides a kind of control devices of I2C communications, including:
Judgment module, for when the main equipment for receiving the first system carries out the request of I2C communications, judging the first system In communications status of the slave equipment in second system, the communications status includes idle and busy;
First processing module, for when the communications status is idle, carrying out the I2C communications;
Second processing module, for when the communications status is busy, postponing preset time and judging first system again Communications status of the slave equipment in second system in system.
In a kind of possible embodiment, described device includes mark module, is used for:
Communications status of the slave equipment in second system in the first system is monitored, and the communications status is drawn with GPIO The low and high level of foot is identified, wherein the GPIO is set to the main equipment of the first system and between equipment.
In a kind of possible embodiment, described device includes mark module, is used for:
Communications status of the slave equipment in second system in the first system is monitored, and by the communications status with flag bit Form be stored in register or memory.
In a kind of possible embodiment, the mark module is used for:
When the communications status is idle, the pin level that the GPIO is arranged is high level;When the communications status is busy When commonplace, the pin level that the GPIO is arranged is low level;Or,
When the communications status is idle, the pin level that the GPIO is arranged is low level;When the communications status is busy When commonplace, the pin level that the GPIO is arranged is high level.
In a kind of possible embodiment, the judgment module is used for:
The level value for reading the GPIO judges the slave equipment in the first system in second system according to the level value Communications status.
In a kind of possible embodiment, the judgment module is used for:
The flag bit that communications status is read from the register or memory, judges the first system according to the flag bit In communications status of the slave equipment in second system.
The third aspect provides a kind of terminal, which is characterized in that including:Processor, memory;
The processor, the program for reading the memory, perform claim require the method described in any one of 1 to 6.
Fourth aspect provides a kind of computer readable storage medium, is stored on the computer readable storage medium The executable instruction of computer, the computer executable instructions are for making computer perform claim require any one of 1 to 6 The method.
In embodiment provided by the invention, by when receive the first system main equipment carry out I2C communications request when, Judge that communications status of the slave equipment in second system in the first system, the communications status include idle and busy;When logical When letter state is idle, the I2C communications are carried out;When communications status be it is busy when, delay preset time and again judgement described in Communications status of the slave equipment in second system in the first system.It realizes through the working condition pair from equipment in main system Using the control of the terminal equipment in communication logic of at least one I2C communication systems, avoid due to causing from equipment state is busy I2C reading/writing datas it is abnormal, and then avoid the shape that upper layer software (applications) display is abnormal caused by bottom data communication abnormality Condition improves the stability of system, and the user experience is improved.
Description of the drawings
Fig. 1 is a kind of television system architectures figure provided in an embodiment of the present invention;
Fig. 2 is another television system architectures figure provided in an embodiment of the present invention;
Fig. 3 is a kind of control method flow diagram of I2C communications provided in an embodiment of the present invention;
Fig. 4 is the control method flow diagram of another kind I2C provided in an embodiment of the present invention communications;
Fig. 5 is the control device figure of I2C provided in an embodiment of the present invention communications;
Fig. 6 is the structural schematic diagram of computer equipment provided in an embodiment of the present invention.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
The terminal device that the embodiment of the present invention is suitable for having at least two I2C communication systems, the terminal device can be Smart television, laser television, intelligent advertisement board, smart mobile phone etc., it will be understood that the embodiment of the present invention is to specific terminal device It is without restriction.
For ease of understanding, before to the embodiment of the present invention carrying out that explanation is explained in detail, first to the embodiment of the present invention Application scenarios and the technical issues of being related to, describe in detail.
First, the application scenarios of the embodiment of the present invention are introduced.
Application scenarios one:
Television system frame shown in FIG. 1 in corresponding background of invention, details are not described herein.
Application scenarios two:
As shown in Fig. 2, television system, by wireless controlled making sheet external speaker, SOC is instructed by I2C to wireless controlled making sheet, wirelessly It is to issue control by power amplifier chips that control panel, which controls states, the voice datas such as switching on and shutting down, pairing, the mute, volume of speaker, Plate, control panel are then forwarded to speaker.In actual work, the configuration information of memory is read in wireless controlled making sheet by I2C, at this time Wireless controlled making sheet is main equipment, and memory is from equipment, and the two is subsystem of the present invention.SOC sends I2C control commands When, SOC is main equipment, and wireless controlled making sheet is from equipment.Main system is defined in an embodiment of the present invention for realizing TV master It wants logic and controls peripheral system work, subsystem executes simple function.As a result, under this application scene, main system by SOC and Wireless control board group is at subsystem is made of wireless controlled making sheet and memory.
Secondly, to the present invention relates to the technical issues of describe in detail.Specifically, with television system frame shown in FIG. 1 Structure combination brightness regulation illustrates.
In television system architectures shown in Fig. 1, when user, which carries out brightness, adds an operation, SOC can be first from display system MCU read present intensity value(It is assumed to be 5), the numerical value is added be sent to MCU as parameter together later(Assigned to MCU Brightness is adjusted to 6 order), MCU, which is connected to after order, can send commands to register REG, realize brightness regulation.Since display is Uniting MCU can not timing reading working state of system(That is MCU sends I2C orders to REG), so cause MCU both as SOC from Equipment, and as the main equipment of REG.At this time MCU can probability response timeout, cause MCU readings failure or mistake.When user's tune There is the above problem when saving brightness, the present intensity value that may result in acquisition is abnormal, such as intrinsic brilliance is 6, but gets Brightness value be 30.MCU can be issued as parameter by 31 later and adjust brightness, cause TV brightness to jump to 31 from 6, suddenly It is highlighted.
Therefore the communication logic state between reasonable coordination main system and subsystem is needed.
Fig. 3 is a kind of control method flow diagram of I2C communications provided in an embodiment of the present invention.The flow can be in terminal Side is realized, specifically, can be realized by terminal or be realized by the relevant apparatus in terminal.As shown in figure 3, the flow may include:
S301:When the main equipment for receiving the first system carries out the request of I2C communications, the level value of GPIO pin is read.
Wherein, GPIO(General Purpose Input Output, universal input/output)Positioned at the master of the first system Equipment and between equipment, GPIO pin state may include high level and low level two states, can be respectively with " 0 " or " 1 " It indicates respectively, high level is such as indicated with " 0 ", low level is indicated with " 1 " or high level is indicated with " 1 ", low level is indicated with " 0 ". It can determine whether that the slave equipment Current Communications Status of the first system is busy or idle according to the level numerical value of GPIO pin.
Selectable, the set-up mode of GPIO pin level value is:When detect the main equipment of second system with from equipment I2C communication when, the main equipment of the second system can be by the voltage high of GPIO pin, the master for indicating current second system The Current Communications Status of equipment is busy;When the I2C sign offs of the slave equipment of the main equipment and second system of the second system It afterwards, can be by the voltage pull-down of GPIO pin, for indicating that the current communications status of the main equipment of the second system is the free time.Due to The main equipment of second system is the slave equipment of the first system, it can thus be appreciated that the Current Communications Status of the slave equipment of the first system, after And determine whether the first system can carry out I2C communications.
In the first possible embodiment, the set-up mode of GPIO pin level value is:When detecting second system Main equipment when being communicated with the I2C from equipment, the main equipment of the second system can be by the voltage high of GPIO pin, for indicating The Current Communications Status of the main equipment of current second system is busy;When the second system main equipment and second system from setting After standby I2C sign offs, the pin voltage of GPIO can be dragged down, the communication current for indicating the main equipment of the second system State is the free time.Due to the slave equipment that the main equipment of second system is the first system, it can thus be appreciated that the slave equipment of the first system Current Communications Status then determines whether the first system can carry out I2C communications.
In second of possible embodiment, the set-up mode of GPIO pin level value is:When detecting second system Main equipment when being communicated with the I2C from equipment, the main equipment of the second system can be by the voltage pull-down of GPIO pin, for indicating The Current Communications Status of the main equipment of current second system is busy;When the second system main equipment and second system from setting It, can be by the voltage high of GPIO pin, the communication current for indicating the main equipment of the second system after standby I2C sign offs State is the free time.Due to the slave equipment that the main equipment of second system is the first system, it can thus be appreciated that the slave equipment of the first system Current Communications Status then determines whether the first system can carry out I2C communications.
S302:Judge the communications status of the slave equipment of the first system indicated by the level value.
If indicating GPIO pin state as high level and low level respectively using " 0 " or " 1 ".
In a kind of possible embodiment, if the level value for reading GPIO pin is 0, indicate that GPIO pin level is height Level, the first possible embodiment of corresponding GPIO pin level value set-up mode, then it represents that the slave equipment of the first system is worked as Preceding communications status is busy;Second of possible embodiment of corresponding GPIO pin level value set-up mode, then it represents that the first system The slave equipment Current Communications Status of system is the free time.
Correspondingly, if the level value for reading GPIO pin is 1, expression GPIO pin level is low level, and corresponding GPIO draws The first possible embodiment of foot level value set-up mode, then it represents that the slave equipment Current Communications Status of the first system is sky It is not busy;Second of possible embodiment of corresponding GPIO pin level value set-up mode, then it represents that the slave equipment of the first system is current Communications status is busy.
S303:When communications status is idle, the I2C communications of the first system are carried out.
S304:When communications status is busy, postpones preset time and judge that the slave equipment in the first system exists again Communications status in second system.
In the above embodiment of the present invention, by when receive the first system main equipment carry out I2C communications request when, The level value for reading GIPO pins, the communications status of the main equipment of the first system is judged according to the level value;When communications status is When idle, the I2C communications are carried out;When communications status is busy, postpones preset time and judge the first system again In communications status of the slave equipment in second system.Realize by main system from the working condition of equipment to using at least The control of the terminal equipment in communication logic of one I2C communication system is avoided due to being read from the busy caused I2C of equipment state Data exception is taken/be written, and then avoids the situation that upper layer software (applications) display is abnormal caused by bottom data communication abnormality, is improved The stability of system, the user experience is improved.
Fig. 4 is the control method flow diagram of another kind I2C communications provided in an embodiment of the present invention.The flow can be at end End side is realized, specifically, can be realized by terminal or be realized by the relevant apparatus in terminal.As shown in figure 4, the flow can wrap It includes:
S401:When the main equipment for receiving the first system carries out the request of I2C communications, the slave equipment read in the first system exists Communications status mark in second system.
Wherein, communications status can be stored in register or memory in the form of flag bit.Illustratively, if the first system Communications status of the slave equipment in second system in system is busy, then writes 1 in register designated position;If in the first system It is the free time from communications status of the equipment in second system, then writes 0 in register designated position.As the master for receiving the first system When equipment carries out the request of I2C communications, the mark of the communications status of the slave equipment of the first system is read from the designated position of register Know.
The slave equipment of the first system is the main equipment of second system, can be sentenced by the way that whether second system carries out I2C communications Communications status of the slave equipment of disconnected the first system in second system.Specifically, when detect the main equipment of second system with from When the I2C communications of equipment, then write 1 in register designated position, when detect the main equipment of second system with from device end I2C When communication, then 0 is write in register designated position.
S402:Judge the communications status of the slave equipment of the first system of mark instruction.
S403:When communications status mark is expressed as the free time, the I2C communications of the first system are carried out.
S404:When communications status mark is expressed as busy, postpones preset time and judge again in the first system From communications status of the equipment in second system.
In the above embodiment of the present invention, by when receive the first system main equipment carry out I2C communications request when, Read communications status mark of the slave equipment in the first system in second system.When communications status mark is expressed as the free time, Carry out the I2C communications;When communications status mark is expressed as busy, postpones preset time and judge the first system again In communications status of the slave equipment in second system.Realize by main system from the working condition of equipment to using at least The control of the terminal equipment in communication logic of one I2C communication system is avoided due to being read from the busy caused I2C of equipment state Data exception is taken/be written, and then avoids the situation that upper layer software (applications) display is abnormal caused by bottom data communication abnormality, is improved The stability of system, the user experience is improved.
It is understood that the embodiment of the present invention, in order to realize above-mentioned function, it comprises executing, each function is corresponding Hardware configuration and/or software module.In conjunction with disclosed in this invention embodiment describe each exemplary unit(Device, device)And Algorithm steps, the embodiment of the present invention can be realized with the combining form of hardware or hardware and computer software.Some function is studied carefully Unexpectedly it is executed in a manner of hardware or computer software driving hardware, depends on specific application and the design constraint of technical solution Condition.Those skilled in the art can realize described function to each specific application using different methods, but It is this realize it is not considered that exceeding the range of the technical solution of the embodiment of the present invention.
The embodiment of the present invention can carry out functional unit according to above method example to the device for executing the above method(Device, Device)Division, for example, can correspond to each function divides each functional unit(Device, device), can also be by two or two Above function is integrated in a processing unit(Device, device)In.Above-mentioned integrated unit(Device, device)Both hardware may be used Form realize, SFU software functional unit can also be used(Device, device)Form realize.It should be noted that the present invention is implemented To unit in example(Device, device)Division be schematical, in addition only a kind of division of logic function can have in actual implementation Dividing mode.
Using integrated unit(Device, device)In the case of, Fig. 5 gives a kind of I2C provided in an embodiment of the present invention The control device of communication.Referring to Fig. 5, which includes:
Judgment module 501, for when the main equipment for receiving the first system carries out the request of I2C communications, judging the first system In communications status of the slave equipment in second system.
Wherein, communications status includes idle and busy.
First processing module 502, for when communications status is idle, carrying out the I2C communications.
Second processing module 503, for when communications status is busy, postponing preset time and judging the first system again In communications status of the slave equipment in second system.
In a kind of possible embodiment, which includes mark module, is used for:
Communications status of the slave equipment in the first system in second system is monitored, and by the communications status with the height of GPIO pin Low level is identified, wherein stating GPIO is set to the main equipment of the first system and between equipment.
Specifically, the mark module is used for:
When communications status is idle, the pin level that GPIO is arranged is high level;When communications status is busy, GPIO is set Pin level be low level;Or,
When communications status is idle, the pin level that GPIO is arranged is low level;When communications status is busy, GPIO is set Pin level be high level.
Specifically, judgment module is used for:
The level value for reading GPIO pin, judges communication shape of the slave equipment in the first system in second system according to level value State.
In alternatively possible embodiment, which includes mark module, is used for:
Communications status of the slave equipment in the first system in second system is monitored, and by the communications status in the form of flag bit It is stored in register or memory.
Specifically, judgment module is used for:
From register or memory read communications status flag bit, according to the flag bit judge in the first system from Communications status of the equipment in second system.
Fig. 6 shows the structural schematic diagram of computer equipment 600 provided by the embodiments of the present application, that is, shows that I2C is communicated Control device 600 another structural schematic diagram.As shown in fig.6, computer equipment 500 includes processor 601, network interface 602.Wherein, processor 601 or controller.The processor 601 is configured as supporting the control device of I2C communications 500 execute the function involved in Fig. 3 or Fig. 4.Network interface 602 is configured as 500 messaging of control device of I2C communications Function.Computer equipment 600 can also include memory 603, and memory 603 preserves this and set for being coupled with processor 601 Standby necessary program instruction and data.Wherein, processor 601, network interface 602 are connected with memory 603, the memory 603 For storing instruction, which is used to execute the instruction of the memory 603 storage, is disappeared with controlling the transmitting-receiving of network interface 602 Breath completes the step of control device 500 that I2C is communicated in the above method executes corresponding function.
In the embodiment of the present application, involved by the control device 500 and computer equipment 600 that I2C is communicated and the application The relevant concept of technical solution that embodiment provides is explained and is described in detail and other steps refer to preceding method or other realities The description as described in these contents in example is applied, is not repeated herein.
It should be noted that the above-mentioned processor being related to of the embodiment of the present application can be central processing unit(central Processing unit, CPU), general processor, digital signal processor(Digital signal processor, DSP), Application-specific integrated circuit(Application-specific integrated circuit, ASIC), field programmable gate array (Field programmable gate array, FPGA)Or it is other programmable logic device, transistor logic, hard Part component or its arbitrary combination.It may be implemented or executes illustratively patrols in conjunction with various described in present disclosure Collect box, module and circuit.Processor can also be to realize the combination of computing function, such as include one or more microprocessors Combination, the combination etc. of DSP and microprocessor.Wherein, the memory can be integrated in the processor, can also be with institute Processor is stated to be provided separately.
The embodiment of the present application also provides a kind of computer storage media, and for storing some instructions, these instructions are performed When, any one method involved by the control device of aforementioned I2C communications can be completed.
The embodiment of the present application also provides a kind of computer program product, for storing computer program, the computer program For executing the media playing method involved in above method embodiment.
It should be understood by those skilled in the art that, the embodiment of the present application can be provided as method, system or computer program production Product.Therefore, in terms of the embodiment of the present application can be used complete hardware embodiment, complete software embodiment or combine software and hardware Embodiment form.Moreover, it wherein includes computer available programs generation that the embodiment of the present application, which can be used in one or more, The computer-usable storage medium of code(Including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)The meter of upper implementation The form of calculation machine program product.
The embodiment of the present application is with reference to method, the equipment according to the embodiment of the present application(System)And computer program product Flowchart and/or the block diagram describe.It should be understood that can be realized by computer program instructions in flowchart and/or the block diagram The combination of flow and/or box in each flow and/or block and flowchart and/or the block diagram.These calculating can be provided Processing of the machine program instruction to all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices Device is to generate a machine so that the instruction executed by computer or the processor of other programmable data processing devices generates For realizing the function of being specified in one flow of flow chart or multiple flows and/or one box of block diagram or multiple boxes Device.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.

Claims (14)

1. a kind of control method of I2C communications, which is characterized in that including:
When the main equipment for receiving the first system carries out the request of I2C communications, judge that the slave equipment in the first system exists Communications status in second system, the communications status include idle and busy;
When the communications status is idle, the I2C communications are carried out;When the communications status is busy, when delay is default Between and judge communications status of the slave equipment in second system in the first system again.
2. method according to claim 1, which is characterized in that the slave equipment judged in the first system is in the second system Before communications status in system, including:
Communications status of the slave equipment in second system in the first system is monitored, and by the communications status with general defeated The low and high level for entering/exporting GPIO pin is identified, wherein the GPIO be set to the main equipment of the first system with from Between equipment.
3. method according to claim 1, which is characterized in that the slave equipment judged in the first system is in the second system Before communications status in system, including:
Communications status of the slave equipment in second system in the first system is monitored, and by the communications status with flag bit Form be stored in register or memory.
4. method according to claim 2, which is characterized in that it is described by the communications status with the low and high level of GPIO pin Be identified including:
When the communications status is idle, the pin level that the GPIO is arranged is high level;When the communications status is busy When commonplace, the pin level that the GPIO is arranged is low level;Or,
When the communications status is idle, the pin level that the GPIO is arranged is low level;When the communications status is busy When commonplace, the pin level that the GPIO is arranged is high level.
5. method according to claim 2, which is characterized in that the slave equipment judged in the first system is in the second system Communications status in system, including:
The level value for reading the GPIO judges the slave equipment in the first system in second system according to the level value Communications status.
6. method according to claim 3, which is characterized in that the slave equipment judged in the first system is in the second system Communications status in system, including:
The flag bit that communications status is read from the register or memory, judges the first system according to the flag bit In communications status of the slave equipment in second system.
7. a kind of control device of I2C communications, which is characterized in that including:
Judgment module, for when the main equipment for receiving the first system carries out the request of I2C communications, judging the first system In communications status of the slave equipment in second system, the communications status includes idle and busy;
First processing module, for when the communications status is idle, carrying out the I2C communications;
Second processing module, for when the communications status is busy, postponing preset time and judging first system again Communications status of the slave equipment in second system in system.
8. device according to claim 7, which is characterized in that described device includes mark module, is used for:
Communications status of the slave equipment in second system in the first system is monitored, and the communications status is drawn with GPIO The low and high level of foot is identified, wherein the GPIO is set to the main equipment of the first system and between equipment.
9. device according to claim 7, which is characterized in that described device includes mark module, is used for:
Communications status of the slave equipment in second system in the first system is monitored, and by the communications status with flag bit Form be stored in register or memory.
10. device according to claim 8, which is characterized in that the mark module is used for:
When the communications status is idle, the pin level that the GPIO is arranged is high level;When the communications status is busy When commonplace, the pin level that the GPIO is arranged is low level;Or,
When the communications status is idle, the pin level that the GPIO is arranged is low level;When the communications status is busy When commonplace, the pin level that the GPIO is arranged is high level.
11. device according to claim 8, which is characterized in that the judgment module is used for:
The level value for reading the GPIO judges the slave equipment in the first system in second system according to the level value Communications status.
12. device according to claim 9, which is characterized in that the judgment module is used for:
The flag bit that communications status is read from the register or memory, judges the first system according to the flag bit In communications status of the slave equipment in second system.
13. a kind of terminal, which is characterized in that including:Processor, memory;
The processor, the program for reading the memory, perform claim require the method described in any one of 1 to 6.
14. a kind of computer readable storage medium, the executable finger of computer is stored on the computer readable storage medium It enables, the method that the computer executable instructions are used to that computer perform claim to be made to require described in any one of 1 to 6.
CN201810357762.5A 2018-04-20 2018-04-20 A kind of control method and device of I2C communications Withdrawn CN108763139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810357762.5A CN108763139A (en) 2018-04-20 2018-04-20 A kind of control method and device of I2C communications

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810357762.5A CN108763139A (en) 2018-04-20 2018-04-20 A kind of control method and device of I2C communications

Publications (1)

Publication Number Publication Date
CN108763139A true CN108763139A (en) 2018-11-06

Family

ID=64011208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810357762.5A Withdrawn CN108763139A (en) 2018-04-20 2018-04-20 A kind of control method and device of I2C communications

Country Status (1)

Country Link
CN (1) CN108763139A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502928A (en) * 2019-08-28 2019-11-26 上海金卓网络科技有限公司 Dual operating systems, working state control method, apparatus and storage medium
CN112069103A (en) * 2020-09-07 2020-12-11 歌尔科技有限公司 Method and system for communication between multiple modules and host
CN112463662A (en) * 2020-12-16 2021-03-09 福州创实讯联信息技术有限公司 Method and terminal for controlling I2C equipment by user mode
CN113218050A (en) * 2021-05-12 2021-08-06 海信(山东)空调有限公司 Air conditioner and control method

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1373428A (en) * 2001-02-28 2002-10-09 阿尔卡塔尔公司 Serial peripheral interface main apparatus, serial peripheral interface slave apparatus and serial peripheral interface
CN1731383A (en) * 2005-08-29 2006-02-08 杭州华为三康技术有限公司 A system and method for equipment management
CN101604304A (en) * 2009-01-24 2009-12-16 北京清电华力电气自动化科技有限公司 A kind of method of multi-CPU communication and protective relaying device
CN102023954A (en) * 2009-09-17 2011-04-20 研祥智能科技股份有限公司 Device with multiple I2C buses, processor, system main board and industrial controlled computer
CN102043636A (en) * 2009-10-19 2011-05-04 中兴通讯股份有限公司 Method and device for loading field programmable gate array bit file
US20120005385A1 (en) * 2010-06-30 2012-01-05 Hon Hai Precision Industry Co., Ltd. Communication circuit of inter-integrated circuit device
CN103116563A (en) * 2012-11-09 2013-05-22 瑞斯康达科技发展股份有限公司 Main-machine communication method, main machine and communication system
CN104408000A (en) * 2014-12-05 2015-03-11 浪潮集团有限公司 Method for preventing conflict in health information read of BIOS (Basic Input Output System) and BMC (Baseboard Management Controller) on Feiteng server
CN104834619A (en) * 2015-04-29 2015-08-12 小鸟科技有限公司 I2C (Inter-Integrated Circuit) bus circuit, implementation method and electronic equipment
CN107480090A (en) * 2017-08-01 2017-12-15 晶晨半导体(上海)股份有限公司 A kind of circuit and method that GPIO functions are realized in Serial Peripheral Interface (SPI) equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1373428A (en) * 2001-02-28 2002-10-09 阿尔卡塔尔公司 Serial peripheral interface main apparatus, serial peripheral interface slave apparatus and serial peripheral interface
CN1731383A (en) * 2005-08-29 2006-02-08 杭州华为三康技术有限公司 A system and method for equipment management
CN101604304A (en) * 2009-01-24 2009-12-16 北京清电华力电气自动化科技有限公司 A kind of method of multi-CPU communication and protective relaying device
CN102023954A (en) * 2009-09-17 2011-04-20 研祥智能科技股份有限公司 Device with multiple I2C buses, processor, system main board and industrial controlled computer
CN102043636A (en) * 2009-10-19 2011-05-04 中兴通讯股份有限公司 Method and device for loading field programmable gate array bit file
US20120005385A1 (en) * 2010-06-30 2012-01-05 Hon Hai Precision Industry Co., Ltd. Communication circuit of inter-integrated circuit device
CN103116563A (en) * 2012-11-09 2013-05-22 瑞斯康达科技发展股份有限公司 Main-machine communication method, main machine and communication system
CN104408000A (en) * 2014-12-05 2015-03-11 浪潮集团有限公司 Method for preventing conflict in health information read of BIOS (Basic Input Output System) and BMC (Baseboard Management Controller) on Feiteng server
CN104834619A (en) * 2015-04-29 2015-08-12 小鸟科技有限公司 I2C (Inter-Integrated Circuit) bus circuit, implementation method and electronic equipment
CN107480090A (en) * 2017-08-01 2017-12-15 晶晨半导体(上海)股份有限公司 A kind of circuit and method that GPIO functions are realized in Serial Peripheral Interface (SPI) equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502928A (en) * 2019-08-28 2019-11-26 上海金卓网络科技有限公司 Dual operating systems, working state control method, apparatus and storage medium
CN110502928B (en) * 2019-08-28 2022-03-29 上海金卓科技有限公司 Dual operating system, working state control method, device and storage medium
CN112069103A (en) * 2020-09-07 2020-12-11 歌尔科技有限公司 Method and system for communication between multiple modules and host
CN112463662A (en) * 2020-12-16 2021-03-09 福州创实讯联信息技术有限公司 Method and terminal for controlling I2C equipment by user mode
CN112463662B (en) * 2020-12-16 2024-04-05 福州创实讯联信息技术有限公司 Method and terminal for user mode control of I2C equipment
CN113218050A (en) * 2021-05-12 2021-08-06 海信(山东)空调有限公司 Air conditioner and control method
CN113218050B (en) * 2021-05-12 2023-03-24 海信空调有限公司 Air conditioner and control method

Similar Documents

Publication Publication Date Title
CN108763139A (en) A kind of control method and device of I2C communications
US11750963B2 (en) Communication control method, device and system, charging box and wireless earpiece
US20190213973A1 (en) Low power driving method and electronic device performing thereof
US9785605B2 (en) Predefined static enumeration for dynamic enumeration buses
US20070143512A1 (en) Communication circuit of serial peripheral interface (spi) devices
US10347166B2 (en) Electronic device and operating method thereof
US20150067521A1 (en) Method and apparatus for presenting content using electronic devices
US20150143277A1 (en) Method for changing an input mode in an electronic device
WO2020134566A1 (en) Control method for doze mode of mobile terminal, storage medium and mobile terminal
CN111629304A (en) Loudspeaker control method and device and electronic equipment
US20200341720A1 (en) Electronic device and method of controlling thereof
CN108595362A (en) A kind of electronic equipment and the method for operating electronic equipment
WO2023103599A1 (en) Screen projection method and apparatus, storage medium and electronic device
US10237087B2 (en) Method for controlling transmission speed and electronic device thereof
CN113253877B (en) Electronic whiteboard system and control method thereof
WO2024146242A1 (en) Camera sharing method, system and device, and computer readable storage medium
KR102480327B1 (en) Electronic device using a bluetooth communication and method of operating the same
CN113613226A (en) Connection method and device of Bluetooth equipment, electronic equipment and storage medium
CN105573946B (en) The method and device of Universal Serial Bus Interface multiplexing
CN105204801B (en) Information processing method and electronic equipment
CN110784790A (en) Noise reduction calibration system of noise reduction earphone
US9501116B2 (en) Power integrated device and power control method thereof
WO2017105723A1 (en) Audio bus interrupts
CN113641611A (en) I2C interface circuit, control method thereof and electronic equipment
CN110677602A (en) Channel mode switching method and device of display equipment and display equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20181106