1.1.6.12 LEDx_WDT_CallbackRegister Function

C

/* x = LED peripheral instance number */
void LEDx_WDT_CallbackRegister( LED_WDT_CALLBACK callback, uintptr_t context )

Summary

Allows application to register a callback with the LED WDT module

Description

This function sets the pointer to a client/application function to be called "back" when the WDT expires. It also passes a context value (usually a pointer to a context structure) that is passed into the function when it is called. The specified callback function will be called from the peripheral interrupt context. The callback should be registered before starting the WDT timer.

Precondition

LEDx_Initialize() function must have been called and the WDT must be started.

Parameters

Param Description
callback_fn A pointer to a function with a calling signature defined by the LED_WDT_CALLBACK data type. Setting this to NULL disables the callback feature.
context A value (usually a pointer) which is passed (unused) into the function identified by the callback parameter

Returns

None

Example

void wdt_callback(uintptr_t context)
{
    // Handle WDT timer callback
}

LED0_WDT_CallbackRegister(wdt_callback, 0);

Remarks

None