I2C in kernel space

Hi,
I would like to use the Yun with I2C. My plan is to use the kernel I2C subsystem and the kernel modules as the are. How does the bridge between the AR9331 and the *Mega work?
Do I have to use the *Mega or is there a kernel solution to use some GPIO-I2C kernel module?

muebau

It looks like there may be a bit bang driver for I2C on the AR9331:
https://forum.openwrt.org/viewtopic.php?id=36471

However, that will not help you as all IO lines to the AR9331 go to something on the 32U4. So best bet is use the 32U4 I2C libraries and talk over the serial bridge to the 32U4. There is a library called Wire for the 32U4 that talks I2C.

Biggest problem Yun did not break out any GPIO pin (total of 29) which could provide I2C connection.

Now we have software but hardware.

How does the bridge between the AR9331 and the *Mega work?

I am able to bridge AR9331 with Uno by using Yun Bridge library, both sides has to modify (procedure is a quite long). Linino side is software modify, the Uno is software and hardware mod.

Yes they did break those out. They are the 2 unlabeled pins next to AREF:

Those are connected to the 32U4 and can be accessed via the Wire library.

Those 2 pins inter connect with pin 2 and pin 3.

for my understand OP wants bypass 32U4 direct connect I2C bus via AR9331, I could be wrong.

Yeah, I was wondering why on the main Yun page it said this:

TWI: 2 (SDA) and 3 (SCL). Support TWI communication using the Wire library.

Thanks for pointing that out.

It would be nice to do I2C from the 9331, but the option without modding (rewiring) something is the 32U4. Which really, is probably just as fast as bit banging GPIO on the 9331. And the task does not eat up CPU time on the 9331 except for serial comms to the 32U4. Also, you could add another processor via USB connection that handles I2C as well. So it can be expanded other ways too. IMO the I2C via the 32U4 is a good option.

Hi,
thank you a lot for the replies.

Yeah I would like to bypass the 32U4 and do I2C (bitbang) on the AR9331. Its sad to hear this is not possible without solder (modify) the YUN. The project have to base on unmodified boards. At the moment I think of an i2c-tiny-usb interface hooked on the USB port.

Thanks
muebau

Hi,
btw. there is the MP02 (also based on the AR9331) with a lot of GPIOs:

http://store.villagetelco.com/mesh-potatoes/mesh-potato-2-basic.html

muebau

ATmega32u4 module is needed to make it compatible with yun.

It has GPIOs x 11 and SPI/PCM/UART/I2C Interface multiplexed.

11 is better than 0.

Actually, you may be able to still bit bang from the AR9331 on the Yun.

Look at page 4 of the schematic for the Yun. It brings GPIO to the NTB0104UK chips. Those chips are auto direction sensing level converters 3.3V <-> 5V logic. So if you put the pins on the 32U4 into high z mode then you could bit bang those pins on the AR9331. Now if those need to be 3.3V you need to level convert them back, but it does give you access to some of the pins. It is at least worth a look. You could do the same for the TX/RX lines, but you lose AR9331 to 32U4 comms that way. But if that does not matter to you then those could be big banged too.