Forum Discussion
Altera_Forum
Honored Contributor
16 years agoThere already is a device driver for the OpenCores I²C Controller.
in my Kernel configuration I see this: (I set the [*] where I suppose you need them.)Device Drivers --->
<*> I2C device interface
<*> I2C support --->
I2C Hardware Bus support --->
*** I2C system bus drivers (mostly embedded / system-on-chip) ***
<*> OpenCores I2C Controller
< > Simtec Generic I2C interface (NEW)
*** External I2C/SMBus adapter drivers ***
< > Parallel port adapter (light) (NEW)
< > TAOS evaluation module (NEW)
*** Other I2C/SMBus bus drivers ***
< > PCA9564/PCA9665 as platform device (NEW)
< > I2C/SMBus Test Stub (NEW) So you don't need to use hardware registers or interrupts in your own code. You just need to create an appropriate driver for the I²C chip you want to use. For communication with the chip, this driver uses the "open Cores" I²C hardware via the I²C subsystem. Seehttp://www.nioswiki.com/OperatingSystems/UClinux/Video for more info. There seem to be six chip drivers provided that use this bus. you might take a look at their source code to find out how to access the I²C subsystem. -Michael