drivers: dac: Add drivers for TI DAC family X311 on SPI bus #90811
+324
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR submits the device driver code for the Texas Instrument chip family DAC N311, with N indicating the resolution (see below).
These chips provide a single output channel and support "power mode" selection by reserving the two MSB values for this.
There is a single "register" that is updated with each 16-bit write to the chip via SPI.
Code Changes
The driver was code was modeled after DAC drivers for other chip families, where different resolutions are supported.
Kconfig.tx311
enables the driver when a matching entry is added to the device tree;dac_tx311.c
) processes the device tree to set the correct resolution value;power-down-mode
to set the power mode bits.Tests
Normal Mode
This driver was developed to control the TI 6311 DAC chip that is part of an external PCB. The SPI bus was connected to a Raspberry Pico W and a sample program was created to generate a "saw tooth" signal with a period of a few seconds and the power mode set to "normal".
A oscilloscope was connected to the
Vout
pin of the chip to confirm the full voltage range, 0 to 3.3 V, is produced.Resistor to GND Mode
The power mode was set to "power-down-100k" and the test program was recompiled. The DAC output shows no saw-tooth signal.