#!/mnt/run/tools/loran
print("-- Test i2c tools --")
local tmp = nil
local detect_bus = function(bus)
for chip = 0x0, 0x7F do
tmp = driver.i2cdev(bus, chip)
if tmp:init() == 0 then
if tmp:read_byte() >= 0 then
print(string.format("find i2c chip device %x ack: %d", chip,tmp:read_byte()))
tmp:release()
end
end
end
end
for bus = 0,1 do
bus = "/dev/i2c-"..bus
print("detect bus: "..bus)
detect_bus(bus)
end
linux 嵌入式 开发 lua 调试 i2c 脚本 i2c 总线
与本文相关的文章
- 制作ghost的linux系统安装方法,Linux下用GHOST来做系统备份
- wireguard windowslinux版本clientserver的配置
- windows装linux
- 大白菜制作windows和linux多系统启动U盘
- 服务器系统通用串行总线控制器,win7系统usb设备不能用通用串行总线控制器无法启动的解决方法...
- windows和linux系统下tomcat指定jdk路径
- Windows 10 linux 子系统 WSL 使用串口
- win10子系统ubuntu文件夹位置_Win10安装linux子系统
- Windows和linux双系统——修改默认启动顺序
- windows10安装linux子系统(WSL)
- Curl【实例 01】curl下载使用及cmd实例脚本分享(通过请求下载文件)
- SCP 从Linux下载文件到Windows本地
- 【Linux】Windows和Deepin双系统安装,共存硬盘以及u盘内安装两种方式
- Linux Ubuntu 开机自启动浏览器
- python语言+selenium自动化,编写脚本调用Chrome、Firefox浏览器打开百度网站
- 浏览器访问Linux的Tomcat
- 浏览器自动注入js脚本
- 格式化Windows10并安装Linux单系统
- Linux和windows的区别是什么
- windows10与Linux子系统文件目录相互访问
评论列表(0)
- 暂无评论