Skip to content

Commit

Permalink
S4g fix
Browse files Browse the repository at this point in the history
Small S4g speed fix, necessary for C1 if module is placed >8 slots away
  • Loading branch information
mtiggelman committed Apr 4, 2019
1 parent 9f8d336 commit 5be48a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spirack/F1d_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def set_IQ_filter(self, value):
is possible via software.
Args:
value (int): cutoff frequency in MHz. Possible values: 1, 3, 10, 20
value (int): cutoff frequency in MHz. Possible values: 1, 3, 10, 30
Raises:
ValueError: if value parameter is not in the list of possible values
"""
Expand Down
12 changes: 6 additions & 6 deletions spirack/S4g_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
S4g = spirack.S4g_module(SPI_Rack1, 2, True)
Attributes:
range_50mA_uni (int): Constant to set span to 0 to 5 mA
range_50mA_bi (int): Constant to set span to -50mA to 50mA
range_25mA_bi (int): Constant to set span to -25mA to 25mA
range_max_uni (int): Constant to set span to 0 to max mA
range_max_bi (int): Constant to set span from -max mA to max mA
range_min_bi (int): Constant to set span to -max/2 mA to max/2 mA
Todo:
*Add checks on writing span and values
"""

import numpy as np

from .chip_mode import LTC2758_MODE, LTC2758_SPEED
from .chip_mode import LTC2758_MODE, LTC2758_SPEED, LTC2758_RD_SPEED

class S4g_module(object):
"""S4g module interface class
Expand Down Expand Up @@ -284,14 +284,14 @@ def get_settings(self, DAC):
command = 0b1101
data = bytearray([(command<<4) | address, 0, 0, 0])

code_data = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_SPEED, data)
code_data = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_RD_SPEED, data)
code = (code_data[1]<<10) | (code_data[2]<<2) | (code_data[3]>>6)

# Read span command
command = 0b1100
data = bytearray([(command<<4) | address, 0, 0, 0])

span_data = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_SPEED, data)
span_data = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_RD_SPEED, data)
span = span_data[2]

if span == S4g_module.range_max_uni:
Expand Down
2 changes: 1 addition & 1 deletion spirack/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.10'
__version__ = '0.1.11'

0 comments on commit 5be48a0

Please sign in to comment.