This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1001397] I2C driver for Kinetic microcontrollers
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: unassigned at bugs dot ecos dot sourceware dot org
- Date: Sun, 6 Jan 2013 05:47:01 +0000
- Subject: [Bug 1001397] I2C driver for Kinetic microcontrollers
- Auto-submitted: auto-generated
- References: <bug-1001397-777@http.bugs.ecos.sourceware.org/>
Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001397
--- Comment #39 from Mike Jones <mjones@linear.com> 2013-01-06 05:46:55 GMT ---
I am having trouble slowing down the bus speed.
This is my code for write byte, but it is clocking at over 1Mhz, and my devices
only go up to 400Khz.
Is there something else I need to do?
void smbus_write_byte(uint8_t address, uint8_t command, uint8_t data)
{
cyg_uint8 buffer[2];
cyg_i2c_device device = { \
.i2c_bus = &hal_kinetis_i2c0_bus, \
.i2c_address = address, \
.i2c_flags = 0, \
.i2c_delay = 10000 \
};
buffer[0] = command;
buffer[1] = data;
cyg_i2c_transaction_begin(&device);
if(!cyg_i2c_transaction_tx(&device, true, &buffer[0], 2, false)) {
diag_printf("Read: fail TX.\n");
}
cyg_i2c_transaction_stop(&device);
cyg_i2c_transaction_end(&device);
}
--
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.