How to initilize the i2c and GPIO - Raspberry Pi Forums


hello pal,

interfacing touch screen pi, same driver in kernel. need initialize of platform data driver work, below have given example code ti's processor other information data sheet below-

platform data

initialise driver, code must added platform initialisation code to
configure i2c address , interrupt (chg) line.
in board files under relevant architecture , platform tree within
linux kernel directory. instance, arch/arm/mach-omap2/.
following structures initialise irq type , i2c address:

static struct mxt_platform_data mxt_data = {
.irqflags = irqf_trigger_falling | irqf_oneshot,
};

static struct i2c_board_info __initdata i2c2boardinfo[] = {
{
i2c_board_info("atmel_mxt_ts", 0x4b), /* i2c address */
.platform_data = &mxt_data,
},
};

these lines added init function initialise gpio chg line, and
register i2c adapter @ 400khz.

/* 141 = gpio pin */
i2c_boardinfo[0].irq = gpio_to_irq(141);
/* 400 = bus clock rate */
omap_register_i2c_bus(2, 400, i2c_boardinfo,
array_size(i2c_boardinfo));

want make following changes above example -
1. want use gpio pin 15
2. want use equivalent function "omap_register_i2c_bus" in pi's processor [bcm2708 ]
3. not sure need add code [file name , line easy handle]

can please me solve same.

1. want use gpio pin 15
for? can't use i2c.
i want use equivalent function "omap_register_i2c_bus" in pi's processor [bcm2708 ]
why want when there many librarys make using i2c easy. language want use.
use raw i2c peripherals see data sheet, top hit when search "bcm2835-arm-peripherals.pdf"


raspberrypi



Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums