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 1. Parameters
Data direction Parameter name Description

[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 2. Return Values
Return value Description

STATUS_OK

Module initiated correctly

STATUS_ERR_DENIED

If module is enabled

STATUS_BUSY

If module is busy resetting