Skip to content

DAC features and API enhancements #27191

@martinjaeger

Description

@martinjaeger

This issue will be used to collect findings from DAC peripheral PRs and issues which could influence a future update of the currently experimental API.

Overview

Supported DACs

  • ST STM32L0
  • NXP Kinetis MCUX

Work in progress

Feature enhancements

Enable/disable analog output buffer

This has been discussed already in the initial PR for the DAC. It was decided to keep this out of the API configuration until we know how common a configurable output buffer is.

Voltage references and gain

Voltage reference selection was kept out of initial API because a common implementation covering every MCU type was not obvious. PR 26649 suggests a way using new enum feature in devicetree.

There are also DACs which support to select different voltage references per channel, e.g. the external TI DACx0508.

Above mentioned DACx0508 series also supports to select a different gain (2, 1 or 0.5) for each channel. At least a gain <1 has a similar result as choosing a different voltage reference, so this might be combined in the API in some way.

Resolution

The resolution is currently not configured via devicetree, but in struct dac_channel_cfg. The reason is that some DACs (e.g. in STM32) support to use lower than max. resolution for increased speed (similar to many ADCs). Only the max. resolution is a hardware feature, but the actual resolution can be configurable by the application.

It could make sense to add the resolution as an additional cell to the io-channels property, which currently only has one cell to select the channel. (see bindings here)

Datasheets

Internal DACs

External DACs (I2C or SPI)

Metadata

Metadata

Assignees

Labels

EnhancementChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsarea: DACDigital-to-Analog Converter

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions