1.1.13.32 1.8.24.30 1.10.23.32 1.11.23.32 1.12.24.32 1.13.22.32 1.14.17.32 1.15.18.32 1.16.25.32 1.17.20.32 1.18.21.32 1.19.21.32 1.20.25.32 1.21.26.32 1.22.28.32 1.23.27.32 1.24.23.32 1.27.26.30 1.34.26.30 1.35.20.30 UART_CALLBACK Typedef

C

/* Non-blocking mode */

typedef void (*UART_CALLBACK)( uintptr_t context )

Summary

Defines the data type and function signature of the UART peripheral library callback function.

Description

This data type defines the function signature of the UART peripheral callback function. The UART peripheral will call back the client's function with this signature to notify the application when a transfer has completed or when a transfer error has occured.

Precondition

UARTx_Initialize must have been called for the given UART peripheral instance and UARTx_CallbackRegister must have been called to set the function to be called.

Parameters

Param Description
context Allows the caller to provide a context value (usually a pointer tothe callers context for multi-instance clients).

Returns

None.

Example

void UARTReadCallback(uintptr_t context)
{
    // This function will be called when a UART read has completed.
}

void UARTWriteCallback(uintptr_t context)
{
    // This function will be called when a UART write has completed.
}

UART1_ReadCallbackRegister(UARTReadCallback, 0);
UART1_WriteCallbackRegister(UARTWriteCallback, 0);

Remarks

Code within the callback function will execute in an interrupt context. The application should avoid calling hardware blocking functions or interrupt in-sensitive code in this function.