Skip to content

File syn_port_dac.h

FileList > port > syn_port_dac.h

Go to the source code of this file

Platform port: Digital-to-Analog Converter (DAC). More...

  • #include "../common/syn_defs.h"
  • #include <stdint.h>

Public Functions

Type Name
SYN_Status syn_port_dac_init (uint8_t channel)
Initialize a DAC channel.
uint16_t syn_port_dac_reference_mv (void)
Return the DAC reference voltage in millivolts.
uint8_t syn_port_dac_resolution (void)
Return the DAC resolution in bits (e.g. 12 for a 12-bit DAC).
SYN_Status syn_port_dac_write (uint8_t channel, uint16_t value)
Write a raw value to a DAC channel.

Detailed Description

Mirrors syn_port_adc.h. Implementors provide these four functions for the target hardware DAC channels.

Public Functions Documentation

function syn_port_dac_init

Initialize a DAC channel.

SYN_Status syn_port_dac_init (
    uint8_t channel
) 

Parameters:

  • channel Platform-specific channel index.

Returns:

SYN_OK on success.


function syn_port_dac_reference_mv

Return the DAC reference voltage in millivolts.

uint16_t syn_port_dac_reference_mv (
    void
) 

Returns:

Reference voltage in mV.


function syn_port_dac_resolution

Return the DAC resolution in bits (e.g. 12 for a 12-bit DAC).

uint8_t syn_port_dac_resolution (
    void
) 

Returns:

Resolution in bits.


function syn_port_dac_write

Write a raw value to a DAC channel.

SYN_Status syn_port_dac_write (
    uint8_t channel,
    uint16_t value
) 

Parameters:

  • channel Platform-specific channel index.
  • value Raw counts (0 .. (1 << resolution) - 1).

Returns:

SYN_OK on success.



The documentation for this class was generated from the following file src/syntropic/port/syn_port_dac.h