Skip to content

Commit f320535

Browse files
bwitherspoonaescolar
authored andcommitted
drivers: dac: dac_ad569x: Add bit shift for 14/12-bit variants
The 14/12-bit variants (AD5692R/AD5691R) require the data to be in the upper bits of the two byte data field of the write command. See table 12 and the associated footnotes in the AD5693R/AD5692R/AD5691R/AD5693 datasheet. Signed-off-by: Brett Witherspoon <[email protected]>
1 parent 0f97f0a commit f320535

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/dac/dac_ad569x.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ static int ad569x_write_value(const struct device *dev, uint8_t channel, uint32_
119119
return -EINVAL;
120120
}
121121

122+
value <<= 16 - config->resolution;
123+
122124
return ad569x_write(dev, AD569X_CMD_WRITE_AND_UPDATE, value);
123125
}
124126

0 commit comments

Comments
 (0)