Welcome, guest ( Login )

Video

Version 13, changed by reisswolf. 08/11/2008.   Show version history


V4L2 specifications
USB Video drivers
some other drivers and apps (include a nice video debug tool)
Bayer RGB (raw pixel)

i2c-gpio

(STOP, this driver may need update..)

This is a simple i2c bus driver based on pio. Most I2C tasks are initialization, so you don't really need a hardware I2C core. You can use the gpio.zip component. The default is port bit[0] for SDA, bit[1] for SCL. You may need to edit linux-2.6.x/arch/nios2nommu/kernel/setup.c if you have different port pins assignment.

In kernel config,

Processor type and features -->
--- Platform drivers Options
[*] GPIO-Based I2C Interface

In your top level design,
.bidir_port_to_and_from_the_gpio_0 ( { I2C_SCLK, I2C_SDAT }),

i2c from opencores

ellis summaried,

As mentioned by jdhar there is "A ready made avalon component - no need to do all of this." under:
http://via.fps-tech.org/svn/fpga/cores/i2c_master/trunk/
->
copy the folder and files into a folder in your Quartus project
directory, SOPC Builder will find the component automatically. Add the
component to your SOPC Builder system and connect the signals to some
pins.

Or you can find a sopc v7.2/v8.0 ready component,contributed by longshot, in the project area of nios forum,
 OpenCores I2C

The single hdl files, some usefull documentation and programming examples (chapter 6 of "I2C_specs.doc") can be found under:
http://www.opencores.org/cvsweb.shtml/i2c/

The opencore i2c component should be named as "i2c_0" and "i2c_1".
Otherwise you will have to modify linux-2.6/arch/nios2/kernel/config.c.

In your top level design:
      inout            HC_I2C_SCLK;
      inout            HC_I2C_SDAT;
and for component named "i2c_0":
      .i2c_scl_to_and_from_the_i2c_0 (HC_I2C_SCLK),
      .i2c_sda_to_and_from_the_i2c_0 (HC_I2C_SDAT),

Kernel config,
   
    [*] I2C support  --->
    [*]   I2C device interface
          I2C Hardware Bus support  --->
    [*] OpenCores I2C Controller
 
NEEK project with i2c from opencores

A sample project with igor_mac 8.0 ethernet and i2c opencore is available here:NEEK_ocm80_i2c.zip.
It was set up mentioned the stuff on top. SDA and SCL are assigned to the special connector on board as shown here:



User space device interface

Please check, linux-2.6/Documentation/i2c/dev-interface .

You can use i2c-tools to help probe and dump,

  Miscellaneous Applications  --->
 --- LM SENSORS
 [*] i2c-tools


/> ls /usr/sbin
i2cdetect
i2cdump
i2cget
i2cset



Attachments (3)

  File By Size Attached Ver.
 gpio.zip hippo5329@yahoo.com.tw 12K 01/21/2007 1 Delete attachment
 NEEK_ocm80_i2c.zip reisswolf 3M 08/11/2008 1 Delete attachment
 NEEK-I2C-Pins.png reisswolf 382K 08/11/2008 2 Delete attachment