I2C Library functions

23 Jun 2009

I will need to debug/understand the I2C module in more detail today.

Where do i find the source code for this library ?

Best Regards

David Giles

 

23 Jun 2009

Hi David,

I will need to debug/understand the I2C module in more detail today.

Where do i find the source code for this library ?

The source code for the interfaces is not currently published. During the beta, there is some re-architecting that is going on and we don't want the libraries fragmenting or introducing legacy before we've even started. Forking is very cheap now, so we just have to be a little careful not to have everyone working on their own homebrew libraries!

But there is no restriction on only using the mbed interfaces in your program; you can always go right down to the metal, so for the moment it may be best to write your I2C driver as you would on any other LPC2368 platform (e.g. LPC23xx stick), and get the advantage of the mbed libraries for all the other things you are doing.

Our plan would be to fold your requirements for the I2C interface in to the mbed libraries over time, and finding these requirements is one of the main aims of the Beta! When you've got it working, it'd be great if you could explain the additional functionality you required and we'll see how it could be incorporated.

Simon

23 Jun 2009

The Ack/Nack is the most useful feature to have.

If the function call is ok then the function should return Ack.

If the function call encounted a problem the function should return with Nack.

At the moment all function calls are void returns. If you make then all returns Ack/Nack then this would solve a lot of potential issues.Some EEPROMs use this to let you know they have finished the EEPROM write cycle. Attempting to access the device will return a Nack if the device is busy for example.

By issuing a general call to address's it is possible to see what devices are connected to the bus. This is useful in a plug and play system for example. If you write to an I2C address that is not currently implemented the software hangs in an error state in its current state. Consequenlty in a system with some noise its likely the application will stop working.

The I2C library is working for me now. I've not changed anything from yesterday, so i'm not sure what has happened. I'll keep you posted if the problem re-appears.

Best Regards

David Giles

16 Apr 2010

Hi, i'm new at the mbed world, and i need to send data from my mbed to an I2C lcd, is there any information on how to do that??

Thank's in advance.

16 Apr 2010

Make a new topic and post the exact model of your LCD and links to any documentation and/or sample code (in any language) that you have.

21 Dec 2012

Thank's a lot people, after a couple of stumbles i got it to work!! :)