6.6.4.1.3 Function dac_init()

Initialize the DAC device struct.

enum status_code dac_init( struct dac_module *const dev_inst, Dac *const module, struct dac_config *const config)

Use this function to initialize the Digital to Analog Converter. Resets the underlying hardware module and configures it.

Note: The DAC channel must be configured separately.
Table 6-7. Parameters
Data directionParameter nameDescription

[out]

module_inst

Pointer to the DAC software instance struct

[in]

module

Pointer to the DAC module instance

[in]

config

Pointer to the config struct, created by the user application

Returns

Status of initialization.

Table 6-8. Return Values
Return valueDescription

STATUS_OK

Module initiated correctly

STATUS_ERR_DENIED

If module is enabled

STATUS_BUSY

If module is busy resetting