Hi,
i'm working with the Freescale SABRE Platform for Smart Devices (I.MX6).
is it possible to set the I2C-2 Bus to slave and give him a new "slave-address".
I want to connect a new extern master and write in a register to read it later.
is that even possible?
salut!
Hi Michael
I believe this is possible, one can look at mxc_i2c_slave_test example
in imx-test package
http://repository.timesys.com/buildsources/i/imx-test/imx-test-3.14.28-1.0.0/
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
first, thanks for your help.
I test the example, but thats only for testing connected devices?
How can i set the Master-Bus to slave?
salut!
I believe it is performed in main(), see attached mxc_i2c_slave_test.c
..
fd = open(I2C_MASTER_DEV, O_RDWR); |
if (fd < 0) {
printf("i2c-slave-test:master thread:open device error\n"); | |
goto fail; |
}
ret = ioctl(fd, I2C_SLAVE_FORCE, I2C_SLAVE_ADDR);
if (ret < 0) {
printf("i2c-slave-test:master thread:ioctl error\n"); | |
goto fail; |
}
pthread_create(&slave_thread_id, 0, slave_thread, (void *)0);
....
~igor
i got this:
root@imx6qsabresd:/unit_tests# ./mxc_i2c_slave_test.out
i2c-slave-test:open device error
i2c-slave-test: slave thread: Fail
i2c-slave-test:master thread:about to receive 100 bytes
i2c-slave-test:master thread: read error
i2c-slave-test:master thread: Fail
the mxc_i2c_slave_test is unchanged.
where is my fault?
salut!