1.1.2.8.6 DRV_AK4954_COMMAND_EVENT_HANDLER Type

Pointer to a AK4954 Driver Command Event Handler Function

Description

AK4954 Driver Command Event Handler Function

This data type defines the required function signature for the AK4954 driver command event handling callback function.

A command is a control instruction to the AK4954 Codec. Example Mute ON/OFF, Zero Detect Enable/Disable etc.

A client must register a pointer to a command event handling function who's function signature (parameter and return value types) match the types specified by this function pointer in order to receive command related event calls back from the driver.

The parameters and return values are described here and a partial example implementation is provided.

Parameters

ParametersDescription
contextValue identifying the context of the application that registered the event handling function.

Returns

None.

Remarks

The occurrence of this call back means that the last control command was transferred successfully.

The context parameter contains a handle to the client context, provided at the time the event handling function was registered using the DRV_AK4954_CommandEventHandlerSet 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 control data driver interrupt context. It is recommended of the application to not perform process intensive or blocking operations with in this function.

Example

void APP_AK4954CommandEventHandler( uintptr_t context ) {

MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;

_\/\/ Last Submitted command is completed._ _\/\/ Perform further processing here_

}

C

typedef void (* DRV_AK4954_COMMAND_EVENT_HANDLER)(uintptr_t contextHandle);