Jump to main content

##

# 2.15.44 OSC32KCTRL_CallbackRegister Function

## C

    void OSC32KCTRL_CallbackRegister (OSC32KCTRL_CFD_CALLBACK callback,
    uintptr_t context);

## Summary

Register the function to be called when the 32KHz External Oscillator has failed.

## Description

This function register the function to be called when the 32KHz External Oscillator has failed.

## Precondition

The 32KHz External Oscillator should have been configured in MCC and enabled.

## Parameters

Param | Description
--- | ---
callback | Pointer to the OSC32KCTRL_CFD_CALLBACK type of function that will be called when a clock failure is detected. This can be NULL, in which case no callback will be generated.
context | Context value to be passed into the callback function when it called.

## Returns

None.

## Example

    void MyOscillatorFailureCallback (uintptr_t context )
    {
        // This means the 32KHz clock has failed.
    }

    // Register the callback function. Specify the context as NULL.
    OSC32KCTRL_CallbackRegister(MyOscillatorFailureCallback, (uintptr_t)NULL);

## Remarks

None.