spirack 0.2.17__tar.gz → 0.2.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {spirack-0.2.17 → spirack-0.2.18}/PKG-INFO +3 -3
- {spirack-0.2.17 → spirack-0.2.18}/setup.py +2 -2
- {spirack-0.2.17 → spirack-0.2.18}/spirack/D5a_module.py +52 -40
- {spirack-0.2.17 → spirack-0.2.18}/spirack/spi_rack.py +8 -0
- spirack-0.2.18/spirack/version.py +1 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack.egg-info/PKG-INFO +3 -3
- spirack-0.2.17/spirack/version.py +0 -1
- {spirack-0.2.17 → spirack-0.2.18}/LICENSE +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/README.md +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/setup.cfg +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/B1b_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/B2b_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/D4_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/D4a_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/D4b_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/D5b_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/F1d_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/M2j_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/M2p_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/P2d_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/S4g_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/S5i_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/S5k_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/S5l_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/U1c_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/U2_module.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/__init__.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack/chip_mode.py +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack.egg-info/SOURCES.txt +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack.egg-info/dependency_links.txt +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack.egg-info/requires.txt +0 -0
- {spirack-0.2.17 → spirack-0.2.18}/spirack.egg-info/top_level.txt +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: spirack
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.18
|
|
4
4
|
Summary: Drivers for the QuTech SPI-rack
|
|
5
|
-
Home-page: https://github.com/
|
|
6
|
-
Author:
|
|
5
|
+
Home-page: https://github.com/qutechdev/SPI-rack
|
|
6
|
+
Author: QuTech Electronics Team
|
|
7
7
|
Author-email: qutechdev@gmail.com
|
|
8
8
|
License: MIT
|
|
9
9
|
Keywords: SPI,Qcodes,SPI-rack,QuTech,TU Delft,SPI
|
|
@@ -30,8 +30,8 @@ setup(name='spirack',
|
|
|
30
30
|
description='Drivers for the QuTech SPI-rack',
|
|
31
31
|
long_description=long_description,
|
|
32
32
|
long_description_content_type="text/markdown",
|
|
33
|
-
url='https://github.com/
|
|
34
|
-
author='
|
|
33
|
+
url='https://github.com/qutechdev/SPI-rack',
|
|
34
|
+
author='QuTech Electronics Team',
|
|
35
35
|
author_email='qutechdev@gmail.com',
|
|
36
36
|
license='MIT',
|
|
37
37
|
packages=['spirack'],
|
|
@@ -44,8 +44,8 @@ class D5a_module(object):
|
|
|
44
44
|
|
|
45
45
|
# DAC software span constants
|
|
46
46
|
range_4V_uni = 0
|
|
47
|
-
range_8V_uni = 1
|
|
48
47
|
range_4V_bi = 2
|
|
48
|
+
range_8V_uni = 1
|
|
49
49
|
range_8V_bi = 3
|
|
50
50
|
range_2V_bi = 4
|
|
51
51
|
|
|
@@ -254,34 +254,6 @@ class D5a_module(object):
|
|
|
254
254
|
# send data via controller
|
|
255
255
|
self.spi_rack.write_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_SPEED, data)
|
|
256
256
|
|
|
257
|
-
def update_multiple_this_is_a_test(self, DAC1, DAC2):
|
|
258
|
-
"""Updates the output of the DAC to the written value
|
|
259
|
-
|
|
260
|
-
Updates the output of the DAC when called. Neccessary after using
|
|
261
|
-
change_value or change_span when wanting to update the DAC.
|
|
262
|
-
|
|
263
|
-
Args:
|
|
264
|
-
DAC (int: 0-15): DAC inside the module of which to update
|
|
265
|
-
"""
|
|
266
|
-
if DAC not in range(self._num_dacs):
|
|
267
|
-
raise ValueError('D5a module {} [update]: DAC {} does not exist.'.format(self.module, DAC))
|
|
268
|
-
|
|
269
|
-
# Determine which DAC in IC by checking even/uneven
|
|
270
|
-
address = (DAC%2)<<1
|
|
271
|
-
|
|
272
|
-
# Update DAC to given span/value
|
|
273
|
-
command = 0b0100
|
|
274
|
-
b1 = (command<<4) | address
|
|
275
|
-
b2 = 0
|
|
276
|
-
b3 = 0
|
|
277
|
-
b4 = 0
|
|
278
|
-
data = bytearray([b1, b2, b3, b4])
|
|
279
|
-
|
|
280
|
-
# Determine in which IC the DAC is, for SPI chip select
|
|
281
|
-
DAC_ic = DAC//2
|
|
282
|
-
# send data via controller
|
|
283
|
-
self.spi_rack.write_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_SPEED, data)
|
|
284
|
-
|
|
285
257
|
def set_voltage(self, DAC, voltage):
|
|
286
258
|
"""Sets the DAC output voltage and updates the DAC output
|
|
287
259
|
|
|
@@ -346,7 +318,7 @@ class D5a_module(object):
|
|
|
346
318
|
def get_stepsize(self, DAC):
|
|
347
319
|
"""Returns the smallest voltage step for a given DAC
|
|
348
320
|
|
|
349
|
-
Calculates and returns the
|
|
321
|
+
Calculates and returns the smallest voltage step of the DAC for the
|
|
350
322
|
set span. Voltage steps smaller than this will not change the DAC value.
|
|
351
323
|
Recommended to only step the DAC in multiples of this value, as otherwise
|
|
352
324
|
steps might not behave as expected.
|
|
@@ -360,13 +332,15 @@ class D5a_module(object):
|
|
|
360
332
|
raise ValueError('D5a module {} [get_stepsize]: DAC {} does not exist.'.format(self.module, DAC))
|
|
361
333
|
|
|
362
334
|
if self.span[DAC] == D5a_module.range_4V_uni:
|
|
363
|
-
return 4.0/(2**18)
|
|
364
|
-
|
|
365
|
-
return 8.0/(2**18)
|
|
366
|
-
|
|
367
|
-
return 16.0/(2**18)
|
|
368
|
-
|
|
369
|
-
return 4.0/(2**18)
|
|
335
|
+
return 4.0 / (2 ** 18)
|
|
336
|
+
elif self.span[DAC] == D5a_module.range_4V_bi or self.span[DAC] == D5a_module.range_8V_uni:
|
|
337
|
+
return 8.0 / (2 ** 18)
|
|
338
|
+
elif self.span[DAC] == D5a_module.range_8V_bi:
|
|
339
|
+
return 16.0 / (2 ** 18)
|
|
340
|
+
elif self.span[DAC] == D5a_module.range_2V_bi:
|
|
341
|
+
return 4.0 / (2 ** 18)
|
|
342
|
+
else:
|
|
343
|
+
raise ValueError(f"Span for DAC {DAC} not set to valid value. Span currently set to {self.span[DAC]}.")
|
|
370
344
|
|
|
371
345
|
def get_settings(self, DAC):
|
|
372
346
|
"""Reads current DAC settings
|
|
@@ -388,14 +362,14 @@ class D5a_module(object):
|
|
|
388
362
|
DAC_ic = DAC//2
|
|
389
363
|
|
|
390
364
|
# Read code command
|
|
391
|
-
command = 0b1101
|
|
365
|
+
command = 0b1101
|
|
392
366
|
data = bytearray([(command<<4) | address, 0, 0, 0])
|
|
393
367
|
|
|
394
368
|
code_data = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_RD_SPEED, data)
|
|
395
369
|
code = (code_data[1]<<10) | (code_data[2]<<2) | (code_data[3]>>6)
|
|
396
370
|
|
|
397
371
|
# Read span command
|
|
398
|
-
command = 0b1100
|
|
372
|
+
command = 0b1100
|
|
399
373
|
data = bytearray([(command<<4) | address, 0, 0, 0])
|
|
400
374
|
|
|
401
375
|
span_data = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_RD_SPEED, data)
|
|
@@ -416,5 +390,43 @@ class D5a_module(object):
|
|
|
416
390
|
|
|
417
391
|
self.voltages[DAC] = voltage
|
|
418
392
|
self.span[DAC] = span
|
|
419
|
-
|
|
393
|
+
|
|
420
394
|
return [voltage, span]
|
|
395
|
+
|
|
396
|
+
def is_D5a_communicating(self):
|
|
397
|
+
"""Checks proper communication with the D5a.
|
|
398
|
+
"""
|
|
399
|
+
DAC = 0 # DAC 0 is expected available for any D5a version (any number of DACs)
|
|
400
|
+
|
|
401
|
+
# Determine which DAC in IC by checking even/uneven
|
|
402
|
+
address = (DAC%2)<<1
|
|
403
|
+
# Determine in which IC the DAC is, for SPI chip select
|
|
404
|
+
DAC_ic = DAC//2
|
|
405
|
+
|
|
406
|
+
# Read initial value of input code resgiter.
|
|
407
|
+
# Any value could be legal and user-given
|
|
408
|
+
|
|
409
|
+
# Command to read input code register
|
|
410
|
+
command = 0b1011
|
|
411
|
+
data = bytearray([(command<<4) | address, 0, 0, 0])
|
|
412
|
+
orig_data_rd = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_RD_SPEED, data)
|
|
413
|
+
orig_value = (orig_data_rd[1]<<10) | (orig_data_rd[2]<<2) | (orig_data_rd[3]>>6)
|
|
414
|
+
|
|
415
|
+
# Write a new value and read back to check
|
|
416
|
+
# First write to the input code register
|
|
417
|
+
test_value = 177033 # Arbitrary, 0b10 1011 0011 1000 1001
|
|
418
|
+
self.change_value(DAC, test_value)
|
|
419
|
+
# Now read back the updated value
|
|
420
|
+
command = 0b1011
|
|
421
|
+
data = bytearray([(command<<4) | address, 0, 0, 0])
|
|
422
|
+
new_data_rd = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_RD_SPEED, data)
|
|
423
|
+
new_value = (new_data_rd[1]<<10) | (new_data_rd[2]<<2) | (new_data_rd[3]>>6)
|
|
424
|
+
|
|
425
|
+
# Write again the original value
|
|
426
|
+
self.change_value(DAC, orig_value)
|
|
427
|
+
|
|
428
|
+
# Check and return the result
|
|
429
|
+
if (test_value != new_value):
|
|
430
|
+
return 0
|
|
431
|
+
else:
|
|
432
|
+
return 1
|
|
@@ -381,3 +381,11 @@ class SPI_rack(serial.Serial):
|
|
|
381
381
|
|
|
382
382
|
version = self.readline().decode('utf-8')
|
|
383
383
|
return version[:-1]
|
|
384
|
+
|
|
385
|
+
def is_C1b_communicating(self):
|
|
386
|
+
"""
|
|
387
|
+
"""
|
|
388
|
+
if (self.get_battery()==[0.0,0.0]) and (self.get_temperature()==0.0):
|
|
389
|
+
if (self.get_battery()==[0.0,0.0]) and (self.get_temperature()==0.0):
|
|
390
|
+
return 0
|
|
391
|
+
return 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.2.18'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: spirack
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.18
|
|
4
4
|
Summary: Drivers for the QuTech SPI-rack
|
|
5
|
-
Home-page: https://github.com/
|
|
6
|
-
Author:
|
|
5
|
+
Home-page: https://github.com/qutechdev/SPI-rack
|
|
6
|
+
Author: QuTech Electronics Team
|
|
7
7
|
Author-email: qutechdev@gmail.com
|
|
8
8
|
License: MIT
|
|
9
9
|
Keywords: SPI,Qcodes,SPI-rack,QuTech,TU Delft,SPI
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.2.17'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|