forked from M-Labs/artiq
ad53xx: style [nfc]
This commit is contained in:
parent
68e433a3a8
commit
08326c5727
|
@ -13,6 +13,7 @@ from artiq.language.core import (kernel, portable, delay_mu, delay, now_mu,
|
|||
from artiq.language.units import ns
|
||||
from artiq.coredevice import spi2 as spi
|
||||
|
||||
|
||||
SPI_AD53XX_CONFIG = (0*spi.SPI_OFFLINE | 1*spi.SPI_END |
|
||||
0*spi.SPI_INPUT | 0*spi.SPI_CS_POLARITY |
|
||||
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))
|
||||
|
||||
|
||||
@portable
|
||||
def offset_to_mu(voltage, offset_dacs=8192, vref=5.):
|
||||
"""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))
|
||||
|
||||
|
||||
class AD53xx:
|
||||
"""Analog devices AD53[67][0123] family of multi-channel Digital to Analog
|
||||
Converters.
|
||||
|
|
Loading…
Reference in New Issue