1.1.4.4.19 DRV_RF215_READY_STATUS_CALLBACK Typedef

C

typedef void ( *DRV_RF215_READY_STATUS_CALLBACK ) (uintptr_t context, SYS_STATUS status);

Summary

Pointer to a RF215 driver ready status callback function.

Description

This data type defines the required function signature for the RF215 driver ready status event handling callback function. A client uses DRV_RF215_ReadyStatusCallbackRegister to register a pointer to a function which must match the signature (parameter and return value types) specified by this data type.

Parameters

ParamDescription
contextValue identifying the context of the client that registered the callback function.
statusSYS_STATUS_READY or SYS_STATUS_ERROR, depending on initialization result.

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

The context parameter contains a handle to the client context, provided at the time the callback function was registered using DRV_RF215_ReadyStatusCallbackRegister. This context value is passed back to the client as parameter. It can be any value necessary to identify the client context or instance (such as a pointer to the client's data) of the client that registered the callback.