i2c设置时钟频率. Radxa Rock Pro [英] i2c set clock freq. Radxa rock pro

查看:706
本文介绍了i2c设置时钟频率. Radxa Rock Pro的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更改时钟频率.到400 kHz(快速模式),但找不到文件.
问题是,
read(file,buf,1)耗时0.3毫秒
read(file,buf,count)count> 1将为i<返回相同的buf [i].数数.如果我使用read(file,buf,1),它将得到buf [0]值.我认为这是由传感器引起的,因为它希望SUB的第一位等于内核不提供的1.
浑蛋.表示,f = 88kHz,它显示一个持续时间"的18个峰值,两个持续时间"之间的延迟为0.2到0.3毫秒
它应该与这里提到的相同,但是我找不到必须放在其中的文件/找不到声明该类型的标头.
配置Linux I2C速度
其次,我找不到任何有关read()和write()的文档.我什至找不到定义write()和read()的头文件.我发现的唯一有用的文档是

I am trying to change the clock freq. to 400 kHz (fastmode) but I cant find the file.
The problem is, that
read(file,buf,1) takes 0.3 ms
read(file,buf,count) count > 1 returns the same buf[i] for i < count. It's the buf[0] value I would get if I would use read(file,buf,1). I think that's caused by the sensor as it wants the first bit of SUB to be 1 what the kernel doesnt provide.
The oszy. says, f = 88kHz, it shows 18 peaks for one "duration" and the delay between two "durations" is 0.2 to 0.3 ms
It should be the same as mentioned here but I cant find the file where I have to put that in/I cant find the header that declares that type.
Configure Linux I2C Speed
Secondly I can't find any docs about read() and write(). I cant even find the headerfile that defines write() and read(). The only usefull doc I found is https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/i2c/dev-interface, but that doesn't make sure what read and write really does
Board:
radxa.com/Rock/specification
(sry had to destroy link as I havent got 10 rep yet :/) running debian server:
radxa.com/Rock/prebuilt_images

imu: www.pololu.com/product/2468/resources
欢呼声:)

imu: www.pololu.com/product/2468/resources
Cheers :)

推荐答案

我不明白为什么这个问题得两票,因为这并不容易,或者在其他地方也不能回答. 不过,我会回答我自己的问题. I2c是在内核内部编译的,因此无法使用boot-param.设置波特率,没有配置文件.您必须更改src代码中的值(对于i2c-bus 0),并自行编译内核. github上的源代码: https://github.com /radxa/linux-rockchip/tree/radxa-stable-3.0/drivers/i2c/busses
这些文件名为rk30(这就是dmesg所说的)
干杯.

I don't get why this question got two downvotes as it's not easy or answered somewhere else. Nevertheless I will answer my own question. I2c is compiled inside the kernel and it's not possible to use boot-param. to set the baudrate and there is no config file. You have to change the values in the src-code (for i2c-bus 0) and compile the kernel on your own. source on github: https://github.com/radxa/linux-rockchip/tree/radxa-stable-3.0/drivers/i2c/busses
the files are named rk30 (that's what dmesg says)
Cheers.


另请参阅: http://talk.radxa.com/topic/775 /debian-change-i2c-bus-baudrate/2


Also see: http://talk.radxa.com/topic/775/debian-change-i2c-bus-baudrate/2

这篇关于i2c设置时钟频率. Radxa Rock Pro的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆