forked from M-Labs/artiq
1
0
Fork 0

ad53xx: remove channel index AND

It's incorrect since it doesn't respect the number of channels
of any of those chips (none has 64 channels).
This commit is contained in:
Robert Jördens 2018-03-24 15:39:06 +01:00
parent 77bcc2c78f
commit b0c8097025
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ def ad53xx_cmd_write_ch(channel, value, op):
:const:`AD53XX_CMD_GAIN`. :const:`AD53XX_CMD_GAIN`.
:return: The 24-bit word to be written to the DAC :return: The 24-bit word to be written to the DAC
""" """
return op | ((channel & 0x3f) + 8) << 16 | (value & 0xffff) return op | (channel + 8) << 16 | (value & 0xffff)
@portable @portable
@ -65,7 +65,7 @@ def ad53xx_cmd_read_ch(channel, op):
:return: The 24-bit word to be written to the DAC :return: The 24-bit word to be written to the DAC
""" """
return (AD53XX_CMD_SPECIAL | AD53XX_SPECIAL_READ | op | return (AD53XX_CMD_SPECIAL | AD53XX_SPECIAL_READ | op |
(((channel & 0x3f) + 8) << 7)) ((channel + 8) << 7))
@portable @portable