In Device Driver programming when “Callback” event is called?
Callback event is called when any one of the following events occurs.
1. A read or write transaction is completed.
The argument pArg that is passed back is the address of the buffer.
At this point, the application owns the buffer.
2. An error has occurred during the reading or writes transaction.
pArg contains the error code(s) for the driver.
The definition of ADI_CALLBACK is as follows.
typedef void (* ADI_CALLBACK) ( /* Callback function pointer */
void *pCBParam, /* Client supplied callback param */
uint32_t Event, /* Event ID specific to the Driver/Service */
void *pArg); /* Pointer to the event specific argument */
Callbacks operates at interrupt level, so care must be taken to minimize the amount of code executed inside of the interrupt.