I2C in interrupt mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C in interrupt mode

389 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by khfreiberg on Wed Oct 03 11:49:26 MST 2012
Is there an example how to use I2C0 in 'I2C_TRANSFER_INTERRUPT' mode.
The interrupt handlers in lpc43xx_i2c have parameters (!?).
When I add 'I2C_MasterHandler' to interrupt table it stuck in INT. I assume the int flag management is simply missing.
Do I need to write an own handler and call these functions?
I do not see how to get to my callback. What do I miss?
Labels (1)
0 Kudos
1 Reply

303 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by khfreiberg on Wed Oct 03 15:01:15 MST 2012
One more question.
I found following in the LPC43xx_I2C library that came with Keil:

/** I2C block interrupt entry (interrupt number \ref I2C0_IRQn). */
void I2C0_IRQHandler (void)
{
    LPCLIB_OSAL_ARG taskSwitch = LPCLIB_OSAL_FALSE;
    I2C_commonIRQHandler(I2C0, &taskSwitch);
    LPCLIB_OSALExitISR(&taskSwitch);
}

But the Keil libraries seems to be old LPC18xx libs, so I try to use only the new libs from LPCware.
They provide this:
/* I2C Interrupt handler functions ------*/
void I2C_IntCmd (LPC_I2Cn_Type *I2Cx, Bool NewState);
void I2C_MasterHandler (LPC_I2Cn_Type *I2Cx);
void I2C_SlaveHandler (LPC_I2Cn_Type *I2Cx);

Is there somewhere a 'I2C0_IRQHandler' in the new lib or how do I use an IRQ handler with parameters?
0 Kudos