6.6.4.5.3 Function dac_register_callback()

Registers an asynchronous callback function with the driver.

enum status_code dac_register_callback( struct dac_module *const module, const enum dac_channel channel, const dac_callback_t callback, const enum dac_callback type)

Registers an asynchronous callback with the DAC driver, fired when a callback condition occurs.

Table 6-28. Parameters
Data directionParameter nameDescription

[in, out]

module_inst

Pointer to the DAC software instance struct

[in]

callback

Pointer to the callback function to register

[in]

channel

Logical channel to register callback function

[in]

type

Type of callback function to register

Returns

Status of the registration operation.

Table 6-29. Return Values
Return valueDescription

STATUS_OK

The callback was registered successfully

STATUS_ERR_INVALID_ARG

If an invalid callback type was supplied

STATUS_ERR_UNSUPPORTED_DEV

If a callback that requires event driven mode was specified with a DAC instance configured in non-event mode