Jump to main content

##

# DRV_SST26_EVENT_HANDLER Typedef

## C

    typedef void (*DRV_SST26_EVENT_HANDLER) ( DRV_SST26_TRANSFER_STATUS event, uintptr_t context );

## Summary

Pointer to a SST26 Driver Event handler function

## Description

This data type defines the required function signature for the SST26 driver event handling callback function. A client must register a pointer using the event handling function whose function signature (parameter and return value types) match the types specified by this function pointer in order to receive transfer related event calls back from the driver.

This data type is only supported when sst26 driver is using

- QSPI PLIB in SPI mode
- SPI PLIB

## Parameters

Param | Description
--- | ---
event | Identifies the type of event
context | Value identifying the context of the application that registered the event handling function.

## Returns

None.

## Example

    void APP_MyTransferEventHandler( DRV_SST26_TRANSFER_STATUS event, uintptr_t context )
    {
        MY_APP_DATA_STRUCT* pAppData = (MY_APP_DATA_STRUCT*) context;

        switch(event)
        {
            case DRV_SST26_TRANSFER_COMPLETED:
            {
                // Handle the transfer complete event.
                break;
            }

            case DRV_SST26_TRANSFER_ERROR_UNKNOWN:
            default:
            {
                // Handle error.
                break;
            }
        }
    }

## Remarks

If the event is DRV_SST26_TRANSFER_COMPLETED, it means that the data was transferred successfully.

If the event is DRV_SST26_TRANSFER_ERROR_UNKNOWN, it means that the data was not transferred successfully.

The context parameter contains the handle to the client context, provided at the time the event handling function was registered using the DRV_SST26_EventHandlerSet function. This context handle value is passed back to the client as the "context" parameter.

It can be any value necessary to identify the client context or instance (such as a pointer to the client's data) instance of the client that made the buffer add request. The event handler function executes in the driver's interrupt context. It is recommended of the application to not perform process intensive or blocking operations with in this function.