WO2012097569A1 - Method and apparatus for accessing i2c device - Google Patents

Method and apparatus for accessing i2c device Download PDF

Info

Publication number
WO2012097569A1
WO2012097569A1 PCT/CN2011/076424 CN2011076424W WO2012097569A1 WO 2012097569 A1 WO2012097569 A1 WO 2012097569A1 CN 2011076424 W CN2011076424 W CN 2011076424W WO 2012097569 A1 WO2012097569 A1 WO 2012097569A1
Authority
WO
WIPO (PCT)
Prior art keywords
access
module
specific
automatic polling
devices
Prior art date
Application number
PCT/CN2011/076424
Other languages
French (fr)
Chinese (zh)
Inventor
李建锋
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012097569A1 publication Critical patent/WO2012097569A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to an access method and apparatus for an Inter-Integrated Circuit (I2C) device.
  • I2C Inter-Integrated Circuit
  • the I2C (also denoted C or IIC ) bus is a two-wire serial bus used to connect the microcontroller to its peripherals.
  • the I2C bus is primarily used in server management, including communication of individual component states. For example, an administrator can query individual components to manage the configuration of the system or to master the functional status of the components, such as power supplies and system fans. It can monitor multiple parameters such as memory, hard disk, network, system temperature, etc. at any time, which increases the security of the system and facilitates management.
  • I2C device the device managed by the I2C bus is called an I2C device.
  • I2C devices In the field of current communication technologies, I2C devices have become more and more widely used.
  • So-called I2C devices such as: Small Form Factor Pluggable (SFP) in PON (Passive Optical Networks)
  • SFP Small Form Factor Pluggable
  • PON Passive Optical Networks
  • SFP optical modules need to be frequently performed. Access, in order to get timely information on the received light power, current voltage, temperature, etc.
  • real-time monitoring of signal loss (LOS, Loss of Signal) signals and so on.
  • the embodiments of the present invention provide an access method and device for an I2C device, which can improve the access efficiency of the I2C device, stability of access, and reduce the burden on the CPU.
  • An access method of an I2C device provided by an embodiment of the present invention includes:
  • the automatic polling module periodically accesses a predetermined specific I2C device that needs frequent access according to a preset access period, and caches and updates the access result for each specific I2C device in real time;
  • the active access module reads data of a specific I2C device directly from the buffer area according to a user request, or accesses an I2C device other than a specific I2C device.
  • An access device for an I2C device provided by an embodiment of the present invention includes:
  • the automatic polling module is configured to periodically access a predetermined specific I2C device that needs frequent access according to a preset access period, and cache and update the access result for each specific I2C device in real time;
  • the active access module is configured to read data of a specific I2C device directly from a buffer area according to a user request, or access an I2C device other than a specific I2C device.
  • the automatic polling module periodically accesses a predetermined specific I2C device that needs frequent access according to a preset access period, and caches and updates the access result for each specific I2C device in real time;
  • the user requests to read the data of a specific I2C device directly from the buffer area or access the I2C device other than the specific I2C device.
  • the invention avoids simply accessing the I2C device by the CPU or the programmable logic device alone, but combines the characteristics of both, and accesses the frequently accessed device registers to the automatic polling module, thereby greatly reducing the access.
  • the burden of active access module (CPU), improved access efficiency to I2C devices, and stability of access ensure efficient and stable operation of the entire system.
  • FIG. 1 is a schematic diagram of a connection relationship between modules according to an embodiment of the present invention
  • 2 is a schematic structural diagram of an access device of an I2C device according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of logic implementation of a CPLD as an I2C timing implementation module according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of state transitions when each module is switched by using a CPLD according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart diagram of an access method of an I2C device according to an embodiment of the present invention. detailed description
  • the embodiments of the present invention provide an access method and device for an I2C device, which are used to improve the access efficiency of the I2C device, the stability of the access, and the burden on the CPU.
  • the technical solution provided by the embodiment of the present invention is applied to an access to an I2C device, and requires a system device with high stability, high reliability, and high efficiency.
  • the technical solution provided by the embodiment of the present invention provides a flexible, efficient, and reliable access method and device for a system including multiple I2C devices and requiring frequent access to the I2C devices to obtain a large amount of real-time data, thereby reducing the system.
  • the device provided by the embodiment of the present invention is mainly composed of an active access module, an automatic polling module, and an I2C timing implementation module.
  • the connection relationship between the modules in the device and the connection relationship with the I2C device are shown in FIG. 1 . among them,
  • the active access module can be implemented by a CPU, a single chip microcomputer, a digital signal processing (DSP) device, etc., and is used to access an I2C device by calling an I2C timing realization module according to a user request.
  • DSP digital signal processing
  • the automatic polling module which can be implemented by programmable logic devices, is mainly used to automatically poll some I2C devices to obtain real-time data information of these I2C devices.
  • the I2C device that the module needs to access frequently and the registers in the I2C device can be flexibly configured according to user requirements, so that frequent accesses of these registers are implemented by the automatic polling module.
  • the I2C device accessed by the automatic polling module is referred to as a specific I2C device.
  • the I2C device can be called a normal I2C device.
  • the I2C timing implementation module is an implementation module of the specific timing of the I2C protocol specification, and is used to access the I2C device according to the control of the automatic polling module or the active access module. Access to all I2C devices is ultimately done through the I2C timing implementation module.
  • the user has the flexibility to select the specific I2C device in the automatic polling module that needs to be polled, as well as the specific registers in the particular I2C device, ie, which of the I2C devices need to be automatically accessed by the automatic polling module. For example, some frequently accessed registers can be set to be accessed by the auto-poll module.
  • the auto-polling module continuously polls the specific I2C devices identified by the user that require frequent access and feeds the results back into a specific data buffer.
  • the active access module needs to access these I2C devices accessed by the automatic polling module, the corresponding access result can be obtained directly from the data buffer in the automatic polling module.
  • the automatic polling module can release the I2C bus, hand the I2C bus to the active access module, and access the active access module. Once completed, the auto-poll module takes over the I2C bus again and continues polling. This allows flexible switching between the active access module and the automatic polling module.
  • an access device of an I2C device includes: an automatic polling module 101, configured to perform periodicity on a predetermined specific I2C device that needs frequent access according to a preset access period. Sexual access, cache and update the access results for each specific I2C device in real time.
  • the active access module 102 is configured to read data of a specific I2C device directly from a buffer area according to a user request, or access an I2C device other than a specific I2C device.
  • the active access module 102 includes:
  • the normal I2C device access unit 201 is configured to be outside the specific I2C device according to the user request.
  • the I2C device is accessed.
  • the specific I2C device access unit 202 is configured to access a specific I2C device according to a user request.
  • the specific I2C device access unit 202 obtains the access result of the specific I2C device from the cache of the automatic polling module 101 according to the user request, and feeds back to the user.
  • the device further comprises:
  • the I2C timing implementation module 103 is configured to access the I2C device according to the control of the automatic polling module 101 or the active access module 102.
  • the normal I2C device access unit 201 notifies the automatic polling module 101 to release the I2C bus, and determines that the automatic polling module 101 suspends the access of the I2C timing implementation module to all the specific I2C devices; and calls the I2C timing implementation module 103 through the I2C bus.
  • the I2C device other than the specific I2C device that the user needs to access is accessed, and the access result is obtained; the automatic polling module 101 is notified that the I2C bus is available;
  • the automatic polling module 101 when receiving the notification of releasing the I2C bus sent by the active access module 102, suspends the access of the I2C timing implementation module 103 to all the specific I2C devices; when receiving the I2C bus sent by the active access module 102 When the notification is available, the access to the I2C timing implementation module 103 is invoked for all specific I2C devices.
  • the active access module 102 is a CPU, a single chip microcomputer or a digital signal processor; the automatic polling module 101 and the I2C timing implementation module 103 are programmable logic devices.
  • the access method of the I2C device provided by the embodiment of the present invention will be described in detail below by taking the access to the multi-channel SFP optical module in the PON system as an example.
  • the active access module is implemented by the CPU
  • the automatic polling module and the I2C timing implementation module according to the embodiment of the present invention are implemented by a Complex Programmable Logic Device (CPLD).
  • CPLD Complex Programmable Logic Device
  • the I2C device that needs to be accessed is an SFP optical module.
  • the automatic polling module is mainly used to poll the LOS alarm information of the SFP optical module.
  • the access module and the I2C timing implementation module can access the registers of the corresponding SFP optical modules, and the flow is similar to the existing process.
  • the automatic polling module can pre-configure the SFP optical module number to be accessed, the SFP optical module register address, the SFP optical module address AO or A2, the read operation code and the write operation code, and Access period.
  • the automatic polling module determines information such as the start register address of this access, the data length of this access, and the data value to be written (only for write operations).
  • the automatic polling module determines whether the access is a read operation or a write operation
  • the automatic polling module determines the SFP optical module address AO or A2 that is accessed this time, and the read operation flag;
  • the I2C timing implementation module is enabled to access the SFP optical module.
  • the automatic polling module determines whether the current access is complete. If yes, it determines whether the current access is successful. If successful, the data information of the SFP optical module is read. If not, the failure reason is obtained, and the failed result is returned to the user. Cause; if the access is not completed, continue to wait; if it is a write operation, the automatic polling module determines the SFP optical module address AO or A2 that is accessed this time, and the write operation flag;
  • the automatic polling module determines the data to be written
  • the I2C timing implementation module is enabled to access the SFP optical module.
  • the automatic polling module determines whether the current access is completed. If yes, it determines whether the current access is successful. If successful, the current access is ended. If the access is not successful, the reason for the failure is obtained, and the reason for the failure is returned to the user; If the visit is not completed, continue to wait.
  • a CPLD register can be specifically set to store information about whether the access is successful, and if the access fails, the reason for the access failure is recorded.
  • the automatic polling module When the user wants to access the LOS information of the SFP optical module, the automatic polling module is configured to poll the LOS alarm information of the SFP optical module. Therefore, you can directly access the automatic wheel Query the cache in the module. Because the automatic polling module accesses the SFP optical module without interruption, and updates the access result data to the corresponding cache, that is, each SFP optical module corresponds to one cache, and the automatic polling module reads the LOS information of each SFP optical module. And write the read data to the cache corresponding to the SFP optical module.
  • the state transition between the automatic polling module and the active access module specifically includes:
  • the I2C bus is occupied by the automatic polling module, and the automatic polling module is in the automatic working state (STATE_AUTO_WORK).
  • the automatic polling module stops all access actions and releases the I2C bus. At this time, the automatic polling module is in the automatic stop state (STATE_AUTO-STOP).
  • the active access module After the active access module obtains the I2C bus usage right, it enters the main working state (STATE MAIN WORK) and starts to access the I2C device.
  • the active access module re-delivers the I2C bus to the auto-poll module and proceeds to step one. This cycle.
  • an access method of an I2C device includes the following steps:
  • Step 501 The automatic polling module periodically accesses a predetermined specific I2C device that needs frequent access according to a preset access period, and caches and updates the access result for each specific I2C device in real time.
  • Step 502 The active access module directly reads data of a specific I2C device (for example, directly reads a value of a specific register of a specific optical module) from a buffer according to a user request, or accesses an I2C device other than a specific I2C device.
  • a specific I2C device for example, directly reads a value of a specific register of a specific optical module
  • the method further includes:
  • the active access module accesses specific I2C devices based on user requests.
  • the active access module accesses a specific I2C device according to a user request, include:
  • the active access module obtains the access result of the specific I2C device from the cache of the automatic polling module according to the user request, and feeds back to the user.
  • the active access module accesses the I2C device other than the specific I2C device according to the user request, including:
  • the active access module notifies the automatic polling module to release the I2C bus, and determines that the automatic polling module suspends access to the I2C timing implementation module for access to all specific I2C devices;
  • the active access module invokes the I2C timing implementation module through the I2C bus to access the I2C device other than the specific I2C device that the user needs to access, and obtains the access result;
  • the active access module notifies the automatic polling module that the I2C bus is available.
  • the active access module is a CPU, a single chip microcomputer or a digital signal processor; the automatic polling module and the I2C timing implementation module are programmable logic devices.
  • the technical solution provided by the embodiment of the present invention avoids simply accessing the I2C device by the CPU or the programmable logic device alone, but combines the characteristics of the two to transfer the frequently accessed device registers to the programmable logic device. Access, which greatly reduces the burden on the CPU, improves the access efficiency of the I2C device, and the stability of the access, ensuring efficient and stable operation of the entire system.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can be embodied in the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Small-Scale Networks (AREA)
  • Stored Programmes (AREA)

Abstract

A method and an apparatus for accessing I2C devices are provided to improve efficiency and stability of the access to the I2C devices and reduce the load of a CPU. The method for accessing the I2C devices includes: an automatic polling module accesses periodically for specific I2C devices which are predetermined to need frequent access according to a preset access period, and buffers and updates access results for each of the specific I2C devices in real time; and an active access module reads the data of the specific I2C devices from a buffer region directly or accesses the I2C devices except the specific I2C devices according to a user request.

Description

一种 I2C设备的访问方法及装置 技术领域  Method and device for accessing I2C device
本发明涉及通讯技术领域,尤其涉及一种集成线路( I2C, Inter-Integrated Circuit )设备的访问方法及装置。 背景技术  The present invention relates to the field of communications technologies, and in particular, to an access method and apparatus for an Inter-Integrated Circuit (I2C) device. Background technique
I2C (也可以表示为 C或者 IIC )总线是一种两线式串行总线, 用于连 接微控制器及其外围设备。 目前, I2C总线主要在服务器管理中使用, 其中 包括单个组件状态的通信。 例如, 管理员可对各个组件进行查询, 以管理 系统的配置或掌握组件的功能状态, 如电源和系统风扇。 可随时监控内存、 硬盘、 网络、 系统温度等多个参数, 增加了系统的安全性, 方便了管理。 The I2C (also denoted C or IIC ) bus is a two-wire serial bus used to connect the microcontroller to its peripherals. Currently, the I2C bus is primarily used in server management, including communication of individual component states. For example, an administrator can query individual components to manage the configuration of the system or to master the functional status of the components, such as power supplies and system fans. It can monitor multiple parameters such as memory, hard disk, network, system temperature, etc. at any time, which increases the security of the system and facilitates management.
其中, 釆用 I2C总线管理的设备, 称为 I2C设备。 在目前的通讯技术 等领域中, I2C设备得到了越来越广泛的应用。  Among them, the device managed by the I2C bus is called an I2C device. In the field of current communication technologies, I2C devices have become more and more widely used.
所谓 I2C设备, 例如: 无源光网络( PON , Passive Optical Networks ) 中的可拔插光模块( SFP, Small Form Factor Pluggable )„ 在很多 PON系统 中, 有多个 SFP光模块需要被进行频繁的访问, 以便及时获取收发光功率、 电流电压、 温度等信息, 另外, 还需要实时监控信号丟失(LOS , Loss of Signal )信号, 等等。  So-called I2C devices, such as: Small Form Factor Pluggable (SFP) in PON (Passive Optical Networks) „ In many PON systems, multiple SFP optical modules need to be frequently performed. Access, in order to get timely information on the received light power, current voltage, temperature, etc. In addition, real-time monitoring of signal loss (LOS, Loss of Signal) signals, and so on.
而现有技术中, 仅仅是简单地通过 CPU, 或者仅通过可编程逻辑器件, 来实现对 I2C设备的访问。 因此, 上述对 SFP光模块等进行频繁地访问操 作, 无疑会给 I2C设备的访问系统造成不小的负担, 从而减弱了系统的访 问效率、 可靠性以及其他性能等。 发明内容 In the prior art, access to the I2C device is simply implemented by the CPU or only by the programmable logic device. Therefore, the above-mentioned frequent access operations on the SFP optical module and the like undoubtedly impose a heavy burden on the access system of the I2C device, thereby reducing the access efficiency, reliability, and other performance of the system. Summary of the invention
本发明实施例提供了一种 I2C设备的访问方法及装置,能够提高对 I2C 设备的访问效率, 以及访问的稳定性, 降低 CPU的负担。  The embodiments of the present invention provide an access method and device for an I2C device, which can improve the access efficiency of the I2C device, stability of access, and reduce the burden on the CPU.
本发明实施例提供的一种 I2C设备的访问方法包括:  An access method of an I2C device provided by an embodiment of the present invention includes:
自动轮询模块按照预设的访问周期, 对预先确定的需要频繁访问的特 定 I2C设备进行周期性访问, 緩存并实时更新对每一特定 I2C设备的访问 结果;  The automatic polling module periodically accesses a predetermined specific I2C device that needs frequent access according to a preset access period, and caches and updates the access result for each specific I2C device in real time;
主动访问模块根据用户请求, 直接从緩存区读取特定 I2C设备的数据, 或者对特定 I2C设备之外的 I2C设备进行访问。  The active access module reads data of a specific I2C device directly from the buffer area according to a user request, or accesses an I2C device other than a specific I2C device.
本发明实施例提供的一种 I2C设备的访问装置包括:  An access device for an I2C device provided by an embodiment of the present invention includes:
自动轮询模块, 用于按照预设的访问周期, 对预先确定的需要频繁访 问的特定 I2C设备进行周期性访问, 緩存并实时更新对每一特定 I2C设备 的访问结果;  The automatic polling module is configured to periodically access a predetermined specific I2C device that needs frequent access according to a preset access period, and cache and update the access result for each specific I2C device in real time;
主动访问模块, 用于根据用户请求, 直接从緩存区读取特定 I2C设备 的数据, 或者对特定 I2C设备之外的 I2C设备进行访问。  The active access module is configured to read data of a specific I2C device directly from a buffer area according to a user request, or access an I2C device other than a specific I2C device.
本发明实施例, 自动轮询模块按照预设的访问周期, 对预先确定的需 要频繁访问的特定 I2C设备进行周期性访问, 緩存并实时更新对每一特定 I2C设备的访问结果; 主动访问模块根据用户请求, 直接从緩存区读取特定 I2C设备的数据, 或者对特定 I2C设备之外的 I2C设备进行访问。通过本发 明避免了简单地单靠 CPU或者可编程逻辑器件来实现对 I2C设备的访问, 而是结合两者的特点, 将访问频繁的设备寄存器交由自动轮询模块来访问, 从而大大降低了主动访问模块(CPU ) 的负担, 提高对 I2C设备的访问效 率, 以及访问的稳定性, 保证了整个系统的高效、 稳定地运作。 附图说明  In the embodiment of the present invention, the automatic polling module periodically accesses a predetermined specific I2C device that needs frequent access according to a preset access period, and caches and updates the access result for each specific I2C device in real time; The user requests to read the data of a specific I2C device directly from the buffer area or access the I2C device other than the specific I2C device. The invention avoids simply accessing the I2C device by the CPU or the programmable logic device alone, but combines the characteristics of both, and accesses the frequently accessed device registers to the automatic polling module, thereby greatly reducing the access. The burden of active access module (CPU), improved access efficiency to I2C devices, and stability of access ensure efficient and stable operation of the entire system. DRAWINGS
图 1为本发明实施例提供的各个模块之间的连接关系示意图; 图 2为本发明实施例提供的一种 I2C设备的访问装置的结构示意图; 图 3为本发明实施例提供的用 CPLD作为 I2C时序实现模块的逻辑实 现示意图; FIG. 1 is a schematic diagram of a connection relationship between modules according to an embodiment of the present invention; 2 is a schematic structural diagram of an access device of an I2C device according to an embodiment of the present invention; FIG. 3 is a schematic diagram of logic implementation of a CPLD as an I2C timing implementation module according to an embodiment of the present invention;
图 4为本发明实施例提供的用 CPLD实现的各个模块工作切换时的状 态转换示意图;  FIG. 4 is a schematic diagram of state transitions when each module is switched by using a CPLD according to an embodiment of the present invention; FIG.
图 5为本发明实施例提供的一种 I2C设备的访问方法的流程示意图。 具体实施方式  FIG. 5 is a schematic flowchart diagram of an access method of an I2C device according to an embodiment of the present invention. detailed description
本发明实施例提供了一种 I2C设备的访问方法及装置,用以提高对 I2C 设备的访问效率, 以及访问的稳定性, 降低 CPU的负担。  The embodiments of the present invention provide an access method and device for an I2C device, which are used to improve the access efficiency of the I2C device, the stability of the access, and the burden on the CPU.
本发明实施例提供的技术方案, 应用于对 I2C设备的访问, 要求稳定 性高、 可靠性高, 高效性的系统设备中。  The technical solution provided by the embodiment of the present invention is applied to an access to an I2C device, and requires a system device with high stability, high reliability, and high efficiency.
本发明实施例提供的技术方案, 针对包括多个 I2C设备, 并且需要频 繁访问这些 I2C设备, 以获取大量实时数据的系统, 提供一种灵活、 高效、 可靠的访问方法和装置, 从而减小系统的复杂度, 节约 CPU资源, 更好地 保证系统的高效、 稳定和可靠性。  The technical solution provided by the embodiment of the present invention provides a flexible, efficient, and reliable access method and device for a system including multiple I2C devices and requiring frequent access to the I2C devices to obtain a large amount of real-time data, thereby reducing the system. The complexity, save CPU resources, and better ensure the system's efficiency, stability and reliability.
本发明实施例提供的装置, 主要由主动访问模块、 自动轮询模块、 I2C 时序实现模块组成, 该装置中各模块相互之间的连接关系, 以及与 I2C设 备的连接关系, 参见图 1。 其中,  The device provided by the embodiment of the present invention is mainly composed of an active access module, an automatic polling module, and an I2C timing implementation module. The connection relationship between the modules in the device and the connection relationship with the I2C device are shown in FIG. 1 . among them,
主动访问模块,可以由 CPU、单片机、数字信号处理( DSP, Digital Signal Processing )器等实现,用于根据用户请求,调用 I2C时序实现模块访问 I2C 设备。  The active access module can be implemented by a CPU, a single chip microcomputer, a digital signal processing (DSP) device, etc., and is used to access an I2C device by calling an I2C timing realization module according to a user request.
自动轮询模块, 可以由可编程逻辑器件实现, 主要用于自动轮询一些 I2C设备, 获取这些 I2C设备的实时数据信息。 可根据用户需求, 灵活配置 该模块需要频繁访问的 I2C设备, 以及 I2C设备中的寄存器, 从而使得这 些寄存器的频繁访问都由自动轮询模块实现。 本发明实施例中, 将自动轮询模块访问的 I2C设备, 称为特定 I2C设 备。 除此之外的 I2C设备, 可以称为普通 I2C设备。 The automatic polling module, which can be implemented by programmable logic devices, is mainly used to automatically poll some I2C devices to obtain real-time data information of these I2C devices. The I2C device that the module needs to access frequently and the registers in the I2C device can be flexibly configured according to user requirements, so that frequent accesses of these registers are implemented by the automatic polling module. In the embodiment of the present invention, the I2C device accessed by the automatic polling module is referred to as a specific I2C device. Other than this, the I2C device can be called a normal I2C device.
I2C时序实现模块, 是 I2C协议规范具体时序的实现模块, 用于根据自 动轮询模块或主动访问模块的控制, 访问 I2C设备。 所有 I2C设备的访问 最终都是通过 I2C时序实现模块进行。  The I2C timing implementation module is an implementation module of the specific timing of the I2C protocol specification, and is used to access the I2C device according to the control of the automatic polling module or the active access module. Access to all I2C devices is ultimately done through the I2C timing implementation module.
用户可以灵活选择上述自动轮询模块中需要轮询的特定 I2C设备, 以 及特定 I2C设备中的特定寄存器, 即确定哪些 I2C设备中的哪些寄存器需 要由自动轮询模块自动访问。 例如, 一些访问频繁的寄存器, 都可以设置 由自动轮询模块进行访问。  The user has the flexibility to select the specific I2C device in the automatic polling module that needs to be polled, as well as the specific registers in the particular I2C device, ie, which of the I2C devices need to be automatically accessed by the automatic polling module. For example, some frequently accessed registers can be set to be accessed by the auto-poll module.
一般情况下, 自动轮询模块会不间断地轮询用户确定的需要频繁访问 的特定 I2C设备, 并将访问结果反馈到特定的数据緩存(buffer ) 中。 主动 访问模块当需要访问自动轮询模块访问的这些 I2C设备时, 则可以直接从 自动轮询模块中的数据 buffer中获取相应的访问结果。  In general, the auto-polling module continuously polls the specific I2C devices identified by the user that require frequent access and feeds the results back into a specific data buffer. When the active access module needs to access these I2C devices accessed by the automatic polling module, the corresponding access result can be obtained directly from the data buffer in the automatic polling module.
另外, 主动访问模块如果需要访问自动轮询模块访问的特定 I2C设备 的特定寄存器以外的其他寄存器时, 则自动轮询模块可以释放 I2C 总线, 将 I2C 总线交给主动访问模块, 等主动访问模块访问完成以后, 自动轮询 模块再次接管 I2C 总线, 并继续进行轮询。 这样就可以实现主动访问模块 和自动轮询模块的灵活切换。  In addition, if the active access module needs to access a register other than the specific register of the specific I2C device accessed by the automatic polling module, the automatic polling module can release the I2C bus, hand the I2C bus to the active access module, and access the active access module. Once completed, the auto-poll module takes over the I2C bus again and continues polling. This allows flexible switching between the active access module and the automatic polling module.
具体地,参见图 2 ,本发明实施例提供的一种 I2C设备的访问装置包括: 自动轮询模块 101 , 用于按照预设的访问周期,对预先确定的需要频繁 访问的特定 I2C设备进行周期性访问, 緩存并实时更新对每一特定 I2C设 备的访问结果。  Specifically, referring to FIG. 2, an access device of an I2C device according to an embodiment of the present invention includes: an automatic polling module 101, configured to perform periodicity on a predetermined specific I2C device that needs frequent access according to a preset access period. Sexual access, cache and update the access results for each specific I2C device in real time.
主动访问模块 102, 用于根据用户请求, 直接从緩存区读取特定 I2C设 备的数据, 或者对特定 I2C设备之外的 I2C设备进行访问。  The active access module 102 is configured to read data of a specific I2C device directly from a buffer area according to a user request, or access an I2C device other than a specific I2C device.
较佳地, 所述主动访问模块 102包括:  Preferably, the active access module 102 includes:
普通 I2C设备访问单元 201 , 用于根据用户请求, 对特定 I2C设备之外 的 I2C设备进行访问。 The normal I2C device access unit 201 is configured to be outside the specific I2C device according to the user request. The I2C device is accessed.
特定 I2C设备访问单元 202, 用于根据用户请求, 对特定 I2C设备进行 访问。  The specific I2C device access unit 202 is configured to access a specific I2C device according to a user request.
较佳地, 所述特定 I2C设备访问单元 202, 根据用户请求, 从自动轮询 模块 101的緩存中获取特定 I2C设备的访问结果, 并反馈给用户。  Preferably, the specific I2C device access unit 202 obtains the access result of the specific I2C device from the cache of the automatic polling module 101 according to the user request, and feeds back to the user.
较佳地, 该装置还包括:  Preferably, the device further comprises:
I2C时序实现模块 103 ,用于根据自动轮询模块 101或主动访问模块 102 的控制, 访问 I2C设备。  The I2C timing implementation module 103 is configured to access the I2C device according to the control of the automatic polling module 101 or the active access module 102.
所述普通 I2C设备访问单元 201 ,通知自动轮询模块 101释放 I2C总线, 并确定自动轮询模块 101暂停调用 I2C时序实现模块对所有特定 I2C设备 的访问; 通过 I2C总线调用 I2C时序实现模块 103对用户需要访问的特定 I2C设备之外的 I2C设备进行访问, 并获取访问结果; 通知自动轮询模块 101 I2C总线可用;  The normal I2C device access unit 201 notifies the automatic polling module 101 to release the I2C bus, and determines that the automatic polling module 101 suspends the access of the I2C timing implementation module to all the specific I2C devices; and calls the I2C timing implementation module 103 through the I2C bus. The I2C device other than the specific I2C device that the user needs to access is accessed, and the access result is obtained; the automatic polling module 101 is notified that the I2C bus is available;
所述自动轮询模块 101 ,当收到主动访问模块 102发送的释放 I2C总线 的通知时, 暂停调用 I2C时序实现模块 103对所有特定 I2C设备的访问; 当收到主动访问模块 102发送的 I2C总线可用的通知时, 恢复调用 I2C时 序实现模块 103对所有特定 I2C设备的访问。  The automatic polling module 101, when receiving the notification of releasing the I2C bus sent by the active access module 102, suspends the access of the I2C timing implementation module 103 to all the specific I2C devices; when receiving the I2C bus sent by the active access module 102 When the notification is available, the access to the I2C timing implementation module 103 is invoked for all specific I2C devices.
较佳地, 所述主动访问模块 102, 为 CPU、 单片机或数字信号处理器; 所述自动轮询模块 101和 I2C时序实现模块 103 , 为可编程逻辑器件。  Preferably, the active access module 102 is a CPU, a single chip microcomputer or a digital signal processor; the automatic polling module 101 and the I2C timing implementation module 103 are programmable logic devices.
下面结合附图, 以 PON系统中对多路 SFP光模块的访问为例, 对本发 明实施例提供的 I2C设备的访问方法进行详细说明。  The access method of the I2C device provided by the embodiment of the present invention will be described in detail below by taking the access to the multi-channel SFP optical module in the PON system as an example.
例如, 由 CPU实现主动访问模块, 由复合的可编程逻辑器件(CPLD, Complex Programmable Logic Device ) 实现本发明实施例所述的自动轮询模 块和 I2C时序实现模块。 需要访问的 I2C设备, 为 SFP光模块。 其中, 自 动轮询模块主要用于轮询 SFP光模块的 LOS告警信息。  For example, the active access module is implemented by the CPU, and the automatic polling module and the I2C timing implementation module according to the embodiment of the present invention are implemented by a Complex Programmable Logic Device (CPLD). The I2C device that needs to be accessed is an SFP optical module. The automatic polling module is mainly used to poll the LOS alarm information of the SFP optical module.
当用户想获取一些普通 SFP光模块的寄存器信息的时候, 只需通过主 动访问模块和 I2C时序实现模块对相应的 SFP光模块的寄存器进行访问即 可, 其流程与现有流程相类似。 When the user wants to obtain the register information of some ordinary SFP optical modules, it only needs to pass the main The access module and the I2C timing implementation module can access the registers of the corresponding SFP optical modules, and the flow is similar to the existing process.
当自动轮询模块访问 SFP光模块时, 自动轮询模块可以预先配置好需 要访问的 SFP光模块编号、 SFP光模块寄存器地址、 SFP光模块地址 AO或 A2、 读操作码和写操作码、 以及访问周期。  When the automatic polling module accesses the SFP optical module, the automatic polling module can pre-configure the SFP optical module number to be accessed, the SFP optical module register address, the SFP optical module address AO or A2, the read operation code and the write operation code, and Access period.
对于每一次的访问, 参见图 3 , 具体包括:  For each visit, see Figure 3, which specifically includes:
自动轮询模块确定本次访问的起始寄存器地址、 本次访问的数据长度、 要写入的数据值(仅用于写操作中)等信息。  The automatic polling module determines information such as the start register address of this access, the data length of this access, and the data value to be written (only for write operations).
自动轮询模块判断本次访问是读操作还是写操作;  The automatic polling module determines whether the access is a read operation or a write operation;
如果是读操作, 则自动轮询模块确定本次访问的 SFP 光模块地址 AO 或 A2 , 以及读操作标志;  If it is a read operation, the automatic polling module determines the SFP optical module address AO or A2 that is accessed this time, and the read operation flag;
启动 I2C时序实现模块对 SFP光模块访问;  The I2C timing implementation module is enabled to access the SFP optical module.
自动轮询模块判断本次访问是否完成, 如果是, 则判断本次访问是否 成功, 如果成功, 则读取 SFP光模块的数据信息, 若没有成功, 则获取失 败原因, 并向用户返回失败的原因; 若本次访问没有完成, 则继续等待; 如果是写操作, 则自动轮询模块确定本次访问的 SFP 光模块地址 AO 或 A2 , 以及写操作标志;  The automatic polling module determines whether the current access is complete. If yes, it determines whether the current access is successful. If successful, the data information of the SFP optical module is read. If not, the failure reason is obtained, and the failed result is returned to the user. Cause; if the access is not completed, continue to wait; if it is a write operation, the automatic polling module determines the SFP optical module address AO or A2 that is accessed this time, and the write operation flag;
自动轮询模块确定要写入的数据;  The automatic polling module determines the data to be written;
启动 I2C时序实现模块对 SFP光模块访问;  The I2C timing implementation module is enabled to access the SFP optical module.
自动轮询模块判断本次访问是否完成, 如果是, 则判断本次访问是否 成功, 如果成功, 则结束本次访问, 若没有成功, 则获取失败原因, 并向 用户返回失败的原因; 若本次访问没有完成, 则继续等待。  The automatic polling module determines whether the current access is completed. If yes, it determines whether the current access is successful. If successful, the current access is ended. If the access is not successful, the reason for the failure is obtained, and the reason for the failure is returned to the user; If the visit is not completed, continue to wait.
其中, 可以专门设置一个 CPLD寄存器, 用于存储本次访问是否成功 的信息, 以及如果访问失败的话, 记录访问失败的原因。  Among them, a CPLD register can be specifically set to store information about whether the access is successful, and if the access fails, the reason for the access failure is recorded.
当用户想访问 SFP光模块的 LOS信息时, 由于预先配置了自动轮询模 块主要用于轮询 SFP光模块的 LOS告警信息。 因此, 可以直接访问自动轮 询模块中的緩存。 因为自动轮询模块会不间断的访问 SFP光模块, 并将访 问结果数据更新到对应的緩存中, 即每一 SFP光模块对应一个緩存, 自动 轮询模块读取每一 SFP光模块的 LOS信息, 并将读取到的数据写入该 SFP 光模块对应的緩存中。 When the user wants to access the LOS information of the SFP optical module, the automatic polling module is configured to poll the LOS alarm information of the SFP optical module. Therefore, you can directly access the automatic wheel Query the cache in the module. Because the automatic polling module accesses the SFP optical module without interruption, and updates the access result data to the corresponding cache, that is, each SFP optical module corresponds to one cache, and the automatic polling module reads the LOS information of each SFP optical module. And write the read data to the cache corresponding to the SFP optical module.
自动轮询模块和主动访问模块之间的状态转换, 如图 4所示, 具体包 括:  The state transition between the automatic polling module and the active access module, as shown in Figure 4, specifically includes:
首先, 一般状态下, I2C总线被自动轮询模块占用, 自动轮询模块处于 自动工作状态 ( STATE_AUTO_WORK )。  First, in the normal state, the I2C bus is occupied by the automatic polling module, and the automatic polling module is in the automatic working state (STATE_AUTO_WORK).
接着, 当用户启动主动访问模块进行访问的时候, 自动轮询模块停止 一切访问动作, 释放 I2C 总线, 此时自动轮询模块处于自动停止状态 ( STATE— AUTO— STOP )。  Then, when the user initiates the active access module for access, the automatic polling module stops all access actions and releases the I2C bus. At this time, the automatic polling module is in the automatic stop state (STATE_AUTO-STOP).
之后, 主动访问模块得到 I2C 总线使用权以后, 就进入主要工作状态 ( STATE MAIN WORK ), 开始访问 I2C设备。  After the active access module obtains the I2C bus usage right, it enters the main working state (STATE MAIN WORK) and starts to access the I2C device.
最后, 主动访问模块重新将 I2C 总线交给自动轮询模块, 又进入步骤 一。 如此循环。  Finally, the active access module re-delivers the I2C bus to the auto-poll module and proceeds to step one. This cycle.
综上所述, 参见图 5 , 本发明实施例提供的一种 I2C设备的访问方法包 括步骤:  In summary, referring to FIG. 5, an access method of an I2C device provided by an embodiment of the present invention includes the following steps:
步骤 501、 自动轮询模块按照预设的访问周期,对预先确定的需要频繁 访问的特定 I2C设备进行周期性访问, 緩存并实时更新对每一特定 I2C设 备的访问结果。  Step 501: The automatic polling module periodically accesses a predetermined specific I2C device that needs frequent access according to a preset access period, and caches and updates the access result for each specific I2C device in real time.
步骤 502、主动访问模块根据用户请求, 直接从緩存区读取特定 I2C设 备的数据(例如直接读取特定光模块的特定寄存器的值), 或者对特定 I2C 设备之外的 I2C设备进行访问。  Step 502: The active access module directly reads data of a specific I2C device (for example, directly reads a value of a specific register of a specific optical module) from a buffer according to a user request, or accesses an I2C device other than a specific I2C device.
较佳地, 该方法还包括:  Preferably, the method further includes:
主动访问模块根据用户请求, 对特定 I2C设备进行访问。  The active access module accesses specific I2C devices based on user requests.
较佳地, 所述主动访问模块根据用户请求, 对特定 I2C设备进行访问, 包括: Preferably, the active access module accesses a specific I2C device according to a user request, include:
主动访问模块根据用户请求, 从自动轮询模块的緩存中获取特定 I2C 设备的访问结果, 并反馈给用户。  The active access module obtains the access result of the specific I2C device from the cache of the automatic polling module according to the user request, and feeds back to the user.
较佳地, 所述主动访问模块根据用户请求,对特定 I2C设备之外的 I2C 设备进行访问, 包括:  Preferably, the active access module accesses the I2C device other than the specific I2C device according to the user request, including:
主动访问模块通知自动轮询模块释放 I2C 总线, 并确定自动轮询模块 暂停调用 I2C时序实现模块对所有特定 I2C设备的访问;  The active access module notifies the automatic polling module to release the I2C bus, and determines that the automatic polling module suspends access to the I2C timing implementation module for access to all specific I2C devices;
主动访问模块通过 I2C总线调用 I2C时序实现模块对用户需要访问的 特定 I2C设备之外的 I2C设备进行访问, 并获取访问结果;  The active access module invokes the I2C timing implementation module through the I2C bus to access the I2C device other than the specific I2C device that the user needs to access, and obtains the access result;
主动访问模块通知自动轮询模块 I2C总线可用。  The active access module notifies the automatic polling module that the I2C bus is available.
较佳地, 所述主动访问模块, 为 CPU、 单片机或数字信号处理器; 所述自动轮询模块和 I2C时序实现模块, 为可编程逻辑器件。  Preferably, the active access module is a CPU, a single chip microcomputer or a digital signal processor; the automatic polling module and the I2C timing implementation module are programmable logic devices.
本发明实施例提供的技术方案, 避免了简单地单靠 CPU或者可编程逻 辑器件来实现对 I2C设备的访问, 而是结合两者的特点, 将访问频繁的设 备寄存器交由可编程逻辑器件来访问, 从而大大降低了 CPU的负担, 提高 对 I2C设备的访问效率, 以及访问的稳定性, 保证了整个系统的高效、 稳 定地运作。  The technical solution provided by the embodiment of the present invention avoids simply accessing the I2C device by the CPU or the programmable logic device alone, but combines the characteristics of the two to transfer the frequently accessed device registers to the programmable logic device. Access, which greatly reduces the burden on the CPU, improves the access efficiency of the I2C device, and the stability of the access, ensuring efficient and stable operation of the entire system.
本领域内的技术人员应明白, 本发明的实施例可提供为方法、 系统、 或计算机程序产品。 因此, 本发明可釆用完全硬件实施例、 完全软件实施 例、 或结合软件和硬件方面的实施例的形式。 而且, 本发明可釆用在一个 或多个其中包含有计算机可用程序代码的计算机可用存储介质 (包括但不 限于磁盘存储器和光学存储器等 )上实施的计算机程序产品的形式。  Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can be embodied in the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、 设备(系统)、 和计算机程序 产品的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流 程图和 /或方框图中的每一流程和 /或方框、 以及流程图和 /或方框图中 的流程和 /或方框的结合。 可提供这些计算机程序指令到通用计算机、 专 用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器以产生一个 机器, 使得通过计算机或其他可编程数据处理设备的处理器执行的指令产 生用于实现在流程图一个流程或多个流程和 /或方框图一个方框或多个方 框中指定的功能的装置。 The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to general purpose computers, Using a processor of a computer, embedded processor or other programmable data processing device to generate a machine such that instructions executed by a processor of a computer or other programmable data processing device are generated for implementing one or more of the flowcharts A flow and/or block diagram of a device in a box or a plurality of functions specified in a plurality of blocks.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理 设备以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存 储器中的指令产生包括指令装置的制造品, 该指令装置实现在流程图一个 流程或多个流程和 /或方框图一个方框或多个方框中指定的功能。  The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备 上, 使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机 实现的处理, 从而在计算机或其他可编程设备上执行的指令提供用于实现 在流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的 功能的步骤。 本发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权 利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在 内。  These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram. The spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims

权利要求书 Claim
1、 一种 I2C设备的访问方法, 其特征在于, 该方法包括:  A method for accessing an I2C device, the method comprising:
自动轮询模块按照预设的访问周期, 对预先确定的需要频繁访问的特 定 I2C设备进行周期性访问, 緩存并实时更新对每一特定 I2C设备的访问 结果;  The automatic polling module periodically accesses a predetermined specific I2C device that needs frequent access according to a preset access period, and caches and updates the access result for each specific I2C device in real time;
主动访问模块根据用户请求, 直接从緩存区读取特定 I2C设备的数据, 或者对特定 I2C设备之外的 I2C设备进行访问。  The active access module reads data of a specific I2C device directly from the buffer area according to a user request, or accesses an I2C device other than a specific I2C device.
2、 根据权利要求 1所述的方法, 其特征在于, 该方法还包括: 所述主 动访问模块根据用户请求, 对特定 I2C设备进行访问。  2. The method according to claim 1, wherein the method further comprises: the active access module accessing a specific I2C device according to a user request.
3、 根据权利要求 2所述的方法, 其特征在于, 所述主动访问模块根据 用户请求, 对特定 I2C设备进行访问, 包括:  The method according to claim 2, wherein the active access module accesses the specific I2C device according to the user request, including:
主动访问模块根据用户请求, 从自动轮询模块的緩存中获取特定 I2C 设备的访问结果, 并反馈给用户。  The active access module obtains the access result of the specific I2C device from the cache of the automatic polling module according to the user request, and feeds back to the user.
4、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述主动访问 模块根据用户请求, 对特定 I2C设备之外的 I2C设备进行访问, 包括: 主动访问模块通知自动轮询模块释放 I2C 总线, 并确定自动轮询模块 暂停调用 I2C时序实现模块对所有特定 I2C设备的访问;  The method according to claim 1, 2 or 3, wherein the active access module accesses an I2C device other than the specific I2C device according to the user request, including: the active access module notifies the automatic polling module Release the I2C bus and determine that the auto-poll module suspends access to the I2C timing implementation module for access to all specific I2C devices;
主动访问模块通过 I2C总线调用 I2C时序实现模块对用户需要访问的 特定 I2C设备之外的 I2C设备进行访问, 并获取访问结果;  The active access module invokes the I2C timing implementation module through the I2C bus to access the I2C device other than the specific I2C device that the user needs to access, and obtains the access result;
主动访问模块通知自动轮询模块 I2C总线可用。  The active access module notifies the automatic polling module that the I2C bus is available.
5、 根据权利要求 4所述的方法, 其特征在于,  5. The method of claim 4, wherein
所述主动访问模块, 为 CPU、 单片机或数字信号处理器;  The active access module is a CPU, a single chip microcomputer or a digital signal processor;
所述自动轮询模块和 I2C时序实现模块, 为可编程逻辑器件。  The automatic polling module and the I2C timing implementation module are programmable logic devices.
6、 一种 I2C设备的访问装置, 其特征在于, 该装置包括:  6. An access device for an I2C device, the device comprising:
自动轮询模块, 用于按照预设的访问周期, 对预先确定的需要频繁访 问的特定 I2C设备进行周期性访问, 緩存并实时更新对每一特定 I2C设备 的访问结果; Automatic polling module, used for frequent visits to predetermined needs according to a preset access period Asking specific I2C devices for periodic access, caching and updating the access results for each particular I2C device in real time;
主动访问模块, 用于根据用户请求, 直接从緩存区读取特定 I2C设备 的数据, 或者对特定 I2C设备之外的 I2C设备进行访问。  The active access module is configured to read data of a specific I2C device directly from a buffer area according to a user request, or access an I2C device other than a specific I2C device.
7、根据权利要求 6所述的装置, 其特征在于, 所述主动访问模块包括: 普通 I2C设备访问单元, 用于根据用户请求, 对特定 I2C设备之外的 The device according to claim 6, wherein the active access module comprises: a normal I2C device access unit, configured to access a specific I2C device according to a user request
I2C设备进行访问; I2C device access;
特定 I2C设备访问单元, 用于根据用户请求, 对特定 I2C设备进行访 问。  A specific I2C device access unit for accessing a specific I2C device according to a user request.
8、 根据权利要求 7所述的装置, 其特征在于, 所述特定 I2C设备访问 单元, 具体用于根据用户请求, 从自动轮询模块的緩存中获取特定 I2C设 备的访问结果, 并反馈给用户。  The device according to claim 7, wherein the specific I2C device access unit is configured to obtain an access result of the specific I2C device from the cache of the automatic polling module according to the user request, and feed back to the user. .
9、 根据权利要求 7或 8所述的装置, 其特征在于, 该装置还包括: I2C时序实现模块, 用于根据自动轮询模块或主动访问模块的控制,访 问 I2C设备;  The device according to claim 7 or 8, wherein the device further comprises: an I2C timing implementation module, configured to access the I2C device according to the control of the automatic polling module or the active access module;
所述普通 I2C设备访问单元, 具体用于通知自动轮询模块释放 I2C总 线, 并确定自动轮询模块暂停调用 I2C时序实现模块对所有特定 I2C设备 的访问; 通过 I2C总线调用 I2C时序实现模块对用户需要访问的特定 I2C 设备之外的 I2C设备进行访问, 并获取访问结果; 通知自动轮询模块 I2C 总线可用;  The common I2C device access unit is specifically configured to notify the automatic polling module to release the I2C bus, and determine that the automatic polling module suspends calling the I2C timing implementation module to access all the specific I2C devices; and the I2C timing is used to implement the module to the user through the I2C bus. Accessing I2C devices other than the specific I2C device that needs to be accessed, and obtaining access results; notifying the automatic polling module that the I2C bus is available;
所述自动轮询模块, 具体用于当收到主动访问模块发送的释放 I2C 总 线的通知时, 暂停调用 I2C时序实现模块对所有特定 I2C设备的访问; 当 收到主动访问模块发送的 I2C总线可用的通知时, 恢复调用 I2C时序实现 模块对所有特定 I2C设备的访问。  The automatic polling module is specifically configured to: when receiving the notification of releasing the I2C bus sent by the active access module, suspending the access of the I2C timing implementation module to all the specific I2C devices; when receiving the I2C bus sent by the active access module At the time of notification, the call to the I2C timing implementation module is restored to access all of the specific I2C devices.
10、 根据权利要求 9所述的装置, 其特征在于,  10. Apparatus according to claim 9 wherein:
所述主动访问模块, 为 CPU、 单片机或数字信号处理器; 所述自动轮询模块和 I2C时序实现模块, 为可编程逻辑器件。 The active access module is a CPU, a single chip microcomputer or a digital signal processor; The automatic polling module and the I2C timing implementation module are programmable logic devices.
PCT/CN2011/076424 2011-01-21 2011-06-27 Method and apparatus for accessing i2c device WO2012097569A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110024049.7A CN102081570B (en) 2011-01-21 2011-01-21 A kind of access method of I2C equipment and device
CN201110024049.7 2011-01-21

Publications (1)

Publication Number Publication Date
WO2012097569A1 true WO2012097569A1 (en) 2012-07-26

Family

ID=44087543

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076424 WO2012097569A1 (en) 2011-01-21 2011-06-27 Method and apparatus for accessing i2c device

Country Status (2)

Country Link
CN (1) CN102081570B (en)
WO (1) WO2012097569A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081570B (en) * 2011-01-21 2016-01-20 中兴通讯股份有限公司 A kind of access method of I2C equipment and device
CN106155971A (en) * 2016-07-04 2016-11-23 锐捷网络股份有限公司 The referee method of I2C bus and device
CN108399137B (en) * 2018-03-07 2021-07-23 广州芯德通信科技股份有限公司 I2C switching method of PON module based on CPLD
CN109240966A (en) * 2018-08-20 2019-01-18 郑州云海信息技术有限公司 A kind of accelerator card based on CPLD, collecting method and device
CN111405213B (en) 2020-03-24 2022-08-09 京东方科技集团股份有限公司 Interface access method, display device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140556A (en) * 2007-09-11 2008-03-12 中兴通讯股份有限公司 Method and device for realizing accessing multiple I2C slave device by programmable device
CN101309257A (en) * 2008-07-08 2008-11-19 中兴通讯股份有限公司 Single board communication method and system based on internal integrated circuit bus
CN101719110A (en) * 2009-12-18 2010-06-02 烽火通信科技股份有限公司 Real-time monitoring method of multipath I2C device in optical communication device
CN102081570A (en) * 2011-01-21 2011-06-01 中兴通讯股份有限公司 Access method and device of I2C (Inter-Integrated Circuit) equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7010639B2 (en) * 2003-06-12 2006-03-07 Hewlett-Packard Development Company, L.P. Inter integrated circuit bus router for preventing communication to an unauthorized port
CN100573382C (en) * 2006-01-26 2009-12-23 中控科技集团有限公司 Based on I 2The communication system of C and communication means

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140556A (en) * 2007-09-11 2008-03-12 中兴通讯股份有限公司 Method and device for realizing accessing multiple I2C slave device by programmable device
CN101309257A (en) * 2008-07-08 2008-11-19 中兴通讯股份有限公司 Single board communication method and system based on internal integrated circuit bus
CN101719110A (en) * 2009-12-18 2010-06-02 烽火通信科技股份有限公司 Real-time monitoring method of multipath I2C device in optical communication device
CN102081570A (en) * 2011-01-21 2011-06-01 中兴通讯股份有限公司 Access method and device of I2C (Inter-Integrated Circuit) equipment

Also Published As

Publication number Publication date
CN102081570B (en) 2016-01-20
CN102081570A (en) 2011-06-01

Similar Documents

Publication Publication Date Title
US10997093B2 (en) NVME data processing method and NVME device
KR101951072B1 (en) Inter-core communication apparatus and method
US10346156B2 (en) Single microcontroller based management of multiple compute nodes
US9411646B2 (en) Booting secondary processors in multicore system using kernel images stored in private memory segments
TWI257575B (en) Method of managing power state transitions, and associated apparatus and system thereof
JP2005301442A (en) Storage device
WO2012097569A1 (en) Method and apparatus for accessing i2c device
TW201740270A (en) Server rack power management
JP2015537307A (en) Component-oriented hybrid cloud operating system architecture and communication method thereof
CN103164256A (en) Processing method and system capable of achieving one machine supporting high concurrency
JP2016508647A5 (en)
WO2018054079A1 (en) Method for storing file, first virtual machine and namenode
WO2014101361A1 (en) Method for controlling multiple can interfaces by using single-spi bus
JP2004302837A (en) Parallel processing system and program by os for single processor
JP2005267118A (en) Interprocessor communication system and program in parallel processing system using os for single processor
JP4394298B2 (en) Multiprocessor system, shared memory control method thereof, and shared memory control program
EP3803663A1 (en) Watchdog timer hierarchy
US11888690B2 (en) System and method for subscription limitation enforcement in distributed system
CN110990325A (en) Data transmission method and device based on I2C bus
US20140297966A1 (en) Operation processing apparatus, information processing apparatus and method of controlling information processing apparatus
US10671453B1 (en) Data storage system employing two-level scheduling of processing cores
WO2018209513A1 (en) Hard drive operation method and hard drive manager
US10331563B2 (en) Adaptively enabling and disabling snooping bus commands
CN116521324B (en) Interrupt virtualization processing method and device and electronic equipment
JP6189545B2 (en) Network application parallel scheduling to reduce power consumption

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11856015

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11856015

Country of ref document: EP

Kind code of ref document: A1