HELLO :
When use i2c bus 2 control the pwm of LCD.The effect is not as expected.(NO dimming domw or up).So read the spec again,and get some clues from the e2e.ti.Copied the code and tried again...still not yet work -(:
My questions :
how 2 specify the read/write operation in MASTER mode?
the last R/W_ bit indicates the read/write operation,but the code in the u-boot(1.3.3).omap24xx_12c.c:
code as
static int i2c_write_byte (u8 devaddr, u8 regoffset, u8 value)
{
int i2c_error = 0;
u16 status, stat;
/* wait until bus not busy */
wait_for_bb ();
/* two bytes */
outw (2, I2C_CNT);
=============================================================
/* set slave address */
outw (devaddr, I2C_SA);
which bit will be on the SCL line after the SA send out?
=============================================================
/* stop bit needed here */
outw (I2C_CON_EN | I2C_CON_MST | I2C_CON_STT | I2C_CON_TRX |
I2C_CON_STP, I2C_CON);
Enable the TXR bit to '1' to indicates what mode?Or ther is another control register to control the result of the read and write operation?
=============================================================
/* wait until state change */
status = wait_for_pin ();
..................
..................
}
Any one could help me?
Thanks