periph_i2c from lpcopen

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

periph_i2c from lpcopen

459 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madhu kumar on Tue Nov 03 04:25:34 MST 2015
hi,


   Chip_I2C_SetMasterEventHandler(id, Chip_I2C_EventHandler); from i2c.c file, how to get value 0xD21 from Chip_I2C_EventHandler.

   who will invoke the value of Chip_I2C_EventHandler

eg:
      this function Chip_I2C_SetMasterEventHandler(id, Chip_I2C_EventHandler); call from i2c.c.
     
       In driver : i2c_17xx_40xx.c
              
        int Chip_I2C_SetMasterEventHandler(I2C_ID_T id, I2C_EVENTHANDLER_T event)
       {
          DEBUGOUT(" I2C_EVENT id : %x , event :%x \r\n", id, event);
                                      -----------------
                                      ---------------------
       }
         it shows I2C_EVENT id : 1 , event :d21

    my question how to got event value i.e d21


Labels (1)
0 Kudos
1 Reply

360 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by xianghuiwang on Tue Nov 24 17:52:58 MST 2015
Chip_I2C_EventHandler is a function pointer.

see below definition:

/**
* @briefEvent handler function type
*/
typedef void (*I2C_EVENTHANDLER_T)(I2C_ID_T, I2C_EVENT_T);

/**
* @briefSet function that must handle I2C events
* @paramid: I2C peripheral ID (I2C0, I2C1 ... etc)
* @paramevent: Pointer to function that will handle the event (Should not be NULL)
* @return1 when successful, 0 when a transfer is on going with its own event handler
*/
int Chip_I2C_SetMasterEventHandler(I2C_ID_T id, I2C_EVENTHANDLER_T event);
0 Kudos