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)

get(key)[source]

Get a synthesizer configuration setting (instance attribute).

async locked()[source]

Return the reference lock status.

Returns:

bool: True if locked

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 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.

async 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

async get(channel)[source]

Measure the temperature on one channel.

Args:

channel (int): Channel index to measure on

Return:

float: Temperature

async get_all()[source]

Measure and return the temperatures on all channels.

Returns:

list(float): Temperatures on all channels

async 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

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

ldac()[source]

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

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 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.

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 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.

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

Return the hardware/firmware version.

Returns:

str: Version string.

ptb.voltage_tcp module

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

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

Return the error flags on all channels.

Returns:
tuple(bool): Error flag on all channels.

True means that there is an error.

async version()[source]

Return the hardware/firmware version.

Returns:

str: Version string.

ptb.shutter_tcp module

class ptb.shutter_tcp.ShutterTCP(reader, writer)[source]

Indices and tables