问题
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
Cheers :)
回答1:
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.
Edit:
Also see:
http://talk.radxa.com/topic/775/debian-change-i2c-bus-baudrate/2
来源:https://stackoverflow.com/questions/27451233/i2c-set-clock-freq-radxa-rock-pro