This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1001397] I2C driver for Kinetis microcontrollers
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: ecos-bugs at ecos dot sourceware dot org
- Date: Tue, 23 Apr 2013 04:47:18 +0000
- Subject: [Bug 1001397] I2C driver for Kinetis microcontrollers
- Auto-submitted: auto-generated
- References: <bug-1001397-13 at http dot bugs dot ecos dot sourceware dot org/>
Please do not reply to this email, use the link below.
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001397
--- Comment #57 from Mike Jones <mjones@linear.com> ---
I get the same conservative frequency no matter how
CYGNUM_DEVS_FREESCALE_I2C_CLOCK_AGR is set.
I have given the code below, which I know ignores the delay specified in the
CDL. Is there a different way to write the code so that the delay and AGR of
the CDL get applied?
uint16_t smbus_read_word(uint8_t address, uint8_t command)
{
cyg_i2c_device device = { \
.i2c_bus = &cyg_i2c0_bus, \
.i2c_address = address, \
.i2c_flags = 0, \
.i2c_delay = i2c_bus_time \
};
cyg_uint8 buffer[1];
cyg_uint8 input[2];
buffer[0] = command;
cyg_i2c_transaction_begin(&device);
if(!cyg_i2c_transaction_tx(&device, true, &buffer[0], 1, false)) {
diag_printf("Read Word: fail TX.\n");
} else if(!cyg_i2c_transaction_rx(&device, true, &input[0], 2, true, true))
{
diag_printf("Read Word: fail RX.\n");
}
cyg_i2c_transaction_end(&device);
return input[1] << 8 | input[0];
}
--
You are receiving this mail because:
You are on the CC list for the bug.