linux识别光模块,一种基于Linux系统读写光模块寄存器的方法 A method based on the Linux system to read and write optical modul...

摘要:

本发明公开了一种基于Linux系统读写光模块寄存器的方法,包括:发消息到内核,内核将信息存在proc文件;若消息格式解析不正确,则异常返回并结束,否则判断是否读取DDMI信息,若是则获取DDMI信息寄存器值,确定I2C访问的寄存器,发消息给I2C总线读写寄存器值并结束;否则,判断是否读写寄存器值,若否,异常返回并结束,否则切换I2C访问的寄存器,循环读写并调整字节序,发消息给I2C总线读写寄存器值. The present invention discloses a Linux-based system to read and write optical module register, comprising: a message to the kernel, there will proc file information; if the message format parsing is not correct, and the end of the abnormal returns, otherwise it is determined whether read DDMI information, if the information is acquired DDMI register values, determined I2C-accessible registers, a message to the I2C bus to read and write register values and ends; otherwise, it is determined whether the read and write register values, if not, and the end of the abnormal returns, otherwise switching I2C access register, read and write cycle and adjust the byte order, a message to the I2C bus to read and write register values. 本发明,内核和用户空间层采用proc文件系统交互方式,针对不同光模块信号批量读写A0,A2寄存器,应用层可移植性强,可屏蔽读写寄存器应用接口的差异,使光模块调试更简单和高效,提升工厂生产效率. The present invention, kernel and user space layer using proc file system interactively, read and write signals A0 optical modules for different batches, A2 register, application portability layer, the shield can read and write registers application interface differences, the optical module and commissioning simple and efficient, improve plant productivity.

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值