1.1.4.4.4 DRV_RF215_ReadyStatusCallbackRegister Function
C
void DRV_RF215_ReadyStatusCallbackRegister ( const SYS_MODULE_INDEX index, const DRV_RF215_READY_STATUS_CALLBACK callback, uintptr_t context );
Summary
Allows a client to set an event handling function for the driver to call back when it is ready to be opened.
Description
This function allows a client to register a RF215 ready notification event handling function for the driver to call back when the driver is ready to be opened.
Precondition
DRV_RF215_Initialize must have been called before.
Parameters
Param | Description |
---|---|
index | Identifier for the object instance to be opened. Only one instance (index 0) supported. |
callback | Pointer to the callback function. |
context | The value of this parameter will be passed back to the client unchanged, when the callback function is called. |
Returns
None.
Example
static void APP_ReadyNotCb(uintptr_t ctxt, SYS_STATUS status) { DRV_HANDLE drvRf215Handle; // The context handle was set to an application specific object // It is now retrievable easily in the event handler MY_APP_OBJ myAppObj = (MY_APP_OBJ *) ctxt; if (status == SYS_STATUS_READY) { // Driver ready to be opened. drvRf215Handle = DRV_RF215_Open(DRV_RF215_INDEX_0, RF215_TRX_ID_RF09); } } MY_APP_OBJ myAppObj; // Application specific data object DRV_RF215_ReadyStatusCallbackRegister(APP_ReadyNotCb, (uintptr_t) myAppObj);
Remarks
None.