Welcome to ptb-drivers’s documentation!¶
Contents:
Synthesizer¶
ptb.synth_protocol
module¶
-
class
ptb.synth_protocol.
SynthProtocol
[source]¶ Protocol for the PTB synthesizer (ADF4350-based)
-
async
save
(regs=None)[source]¶ Save the six registers to the EEPROM. That data is loaded on boot of the synthesizer.
- Args:
- regs (list(int), optional): 32 bit register values
(reg5 down to reg0). If no register values are passed, then the ones calculated by
set_frequency()
are used.
-
set
(**kwargs)[source]¶ Configure synthesizer settings.
See datasheet and
ADF4350
for fields and values.This does not update the synthesizer settings or registers. This method only sets instance attributes that affect the calculation of register values during
set_frequency()
.
-
async
ptb.synth_tcp
module¶
ptb.adf4350
module¶
-
class
ptb.adf4350.
ADF4350
[source]¶ From the dtasheet with analogies of naming from https://github.com/analogdevicesinc/no-OS/blob/master/drivers/adf4350/adf4350.h
Temperature Sensor¶
ptb.temp_protocol
module¶
-
class
ptb.temp_protocol.
TempProtocol
[source]¶ Protocol for the PTB multi-channel temperature sensor
-
async
get
(channel)[source]¶ Measure the temperature on one channel.
- Args:
channel (int): Channel index to measure on
- Return:
float: Temperature
-
async
ptb.temp_tcp
module¶
Voltage Source¶
ptb.voltage_protocol
module¶
-
class
ptb.voltage_protocol.
VoltageProtocol
[source]¶ Protocol for the PTB multi-channel voltage source
-
async
get_data
(channels=None)[source]¶ Get raw channel output values. Values are given in DAC LSBs (integers).
- Args:
channels (list(int)): Target channels. Defaults to 1…8
- Returns:
list(int)): DAC values, one for each target channel.
-
async
get_temperature
()[source]¶ Get temperature data for controller and amplifier boards.
- Returns:
list(float): Raw ADC values for the NTCs
-
async
set_data
(values, channels=None)[source]¶ Set raw channel output values. Values are given in DAC LSBs (integers). Data becomes active only after
ldac()
.- Args:
values (list(int)): DAC values, one for each target channel. channels (list(int)): Target channels. Defaults to 1…len(values)
- Returns:
list(int): Actual values returned by the device.
-
async
set_gain
(values, channels=None)[source]¶ Set channel gains. Channel gains are processed within the microcontroller and become active on
set_volt()
and a subsequentldac()
.Gains are given in 2**16/full_scale where full_scale = u_max - u_min.
- Args:
values (list(float)): Gains, one for each target channel. channels (list(int)): Target channels. Defaults to 1…len(values)
- Returns:
list(float): Actual values returned by the device.
-
async
set_offset
(values, channels=None)[source]¶ Set channel offsets. Channel gains are processed within the microcontroller and become active on
set_volt()
and a subsequentldac()
.Offsets are given in DAC LSBs (integers).
- Args:
values (list(int)): Offsets, one for each target channel. channels (list(int)): Target channels. Defaults to 1…len(values)
- Returns:
list(int): Actual values returned by the device.
-
async
set_voltage
(values, channels=None)[source]¶ Set output voltages. Voltages become active only after
ldac()
.- Args:
values (list(float)): Voltages, one for each target channel. channels (list(int)): Target channels. Defaults to 1…len(values)
- Returns:
list(float): Actual values returned by the device.
-
async
ptb.voltage_tcp
module¶
Shutter Controller¶
ptb.shutter_protocol
module¶
-
class
ptb.shutter_protocol.
ShutterProtocol
[source]¶ Protocol for the PTB multi-channel shutter controller
-
async
clear
()[source]¶ Clear all error flags.
- Returns:
- tuple(bool): Error flag on all channels after clearing.
True means that there is an error.
-
async
passthrough
(shutter, cmd)[source]¶ Execute a low level command.
- Args:
shutter (int): Shutter index (1-3) cmd (bytes(1)): Single character command (e.g. W)
- Return:
bytes: Response
-
async