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)

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.
start(regs=None)[source]

Send the six registers to 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.
version()[source]

Return the hardware/firmware version.

Returns:
str: Version string.

ptb.synth_tcp module

class ptb.synth_tcp.SynthTCP(reader, writer)[source]

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

set_frequency(f_out)[source]

Set output frequency.

Args:
f_out (float): Desired frequency
Returns:
Actual output frequency set

Temperature Sensor

ptb.temp_protocol module

class ptb.temp_protocol.TempProtocol[source]

Protocol for the PTB multi-channel temperature sensor

get(channel)[source]

Measure the temperature on one channel.

Args:
channel (int): Channel index to measure on
Return:
float: Temperature
get_all()[source]

Measure and return the temperatures on all channels.

Returns:
list(float): Temperatures on all channels
version()[source]

Return the hardware/firmware version.

Returns:
str: Version string.

ptb.temp_tcp module

class ptb.temp_tcp.TempTCP(reader, writer)[source]

Voltage Source

ptb.voltage_protocol module

class ptb.voltage_protocol.VoltageProtocol[source]

Protocol for the PTB multi-channel voltage source

factory()[source]

Reset gains and offsets to default values

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.
get_temperature()[source]

Get temperature data for controller and amplifier boards.

Returns:
list(float): Raw ADC values for the NTCs
ldac()[source]

Pulse LDAC to all DACs to load values into active registers.

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.
set_gain(values, channels=None)[source]

Set channel gains. Channel gains are processed within the microcontroller and become active on set_volt() and a subsequent ldac().

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.
set_offset(values, channels=None)[source]

Set channel offsets. Channel gains are processed within the microcontroller and become active on set_volt() and a subsequent ldac().

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.
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.
version()[source]

Return the hardware/firmware version.

Returns:
str: Version string.

ptb.voltage_tcp module

class ptb.voltage_tcp.VoltageTCP(reader, writer)[source]

Indices and tables