forked from M-Labs/artiq
1
0
Fork 0

ad53xx: style [nfc]

This commit is contained in:
Robert Jördens 2018-03-24 14:10:20 +01:00
parent 68e433a3a8
commit 08326c5727
1 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ from artiq.language.core import (kernel, portable, delay_mu, delay, now_mu,
from artiq.language.units import ns from artiq.language.units import ns
from artiq.coredevice import spi2 as spi from artiq.coredevice import spi2 as spi
SPI_AD53XX_CONFIG = (0*spi.SPI_OFFLINE | 1*spi.SPI_END | SPI_AD53XX_CONFIG = (0*spi.SPI_OFFLINE | 1*spi.SPI_END |
0*spi.SPI_INPUT | 0*spi.SPI_CS_POLARITY | 0*spi.SPI_INPUT | 0*spi.SPI_CS_POLARITY |
0*spi.SPI_CLK_POLARITY | 1*spi.SPI_CLK_PHASE | 0*spi.SPI_CLK_POLARITY | 1*spi.SPI_CLK_PHASE |
@ -82,6 +83,7 @@ def voltage_to_mu(voltage, offset_dacs=8192, vref=5.):
""" """
return int(round(0x10000*(voltage/(4.*vref)) + offset_dacs*0x4)) return int(round(0x10000*(voltage/(4.*vref)) + offset_dacs*0x4))
@portable @portable
def offset_to_mu(voltage, offset_dacs=8192, vref=5.): def offset_to_mu(voltage, offset_dacs=8192, vref=5.):
"""Returns the offset register value required to produce a given voltage """Returns the offset register value required to produce a given voltage
@ -96,6 +98,7 @@ def offset_to_mu(voltage, offset_dacs=8192, vref=5.):
""" """
return int(round(0x10000*(voltage/(4.*vref)) + offset_dacs*0x4)) return int(round(0x10000*(voltage/(4.*vref)) + offset_dacs*0x4))
class AD53xx: class AD53xx:
"""Analog devices AD53[67][0123] family of multi-channel Digital to Analog """Analog devices AD53[67][0123] family of multi-channel Digital to Analog
Converters. Converters.