lpcware

i2cm Master Only driver - example???

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by robertpalmerjr on Thu Mar 20 12:26:15 MST 2014
I have a configuration where I have:
- one master (lpc18xx)
- one slave device
- want to use interrupt based communication

Looking at the lpcopen examples, there is a driver for master only (i2cm_18xx...) and even an interrupt based master only example.  I thought, perfect!, but then I started looking at the example and it uses many function from the basic i2c_18xx driver.  For example, instead of using Chip_I2CM_Init(id) (which would make sense since this is a master example) it uses Chip_I2C_Init(id).  Looking at the code, they do the same thing, but with different levels of abstraction (i.e. I'm guessing they were written by different developers, certainly they did not copy/paste).

Only the Chip_I2CM_Xfer is used in the example.  Are there any samples that show how to use ONLY the i2cm driver?

Specifically what I'm having trouble with is the setting up the appropriate event handling on the interrupt. 

The example project uses: Chip_I2C_SetMasterEventHandler(id, Chip_I2C_EventHandler);

What is the equivalent for the master only driver?  Is there an equivalent.  It looks to me like this may not even be needed in the configuration I'm attempting.

Outcomes