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.
-
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
-
get
(channel)[source]¶ Measure the temperature on one channel.
- Args:
- channel (int): Channel index to measure on
- Return:
- float: Temperature
-
ptb.temp_tcp
module¶
Voltage Source¶
ptb.voltage_protocol
module¶
-
class
ptb.voltage_protocol.
VoltageProtocol
[source]¶ Protocol for the PTB multi-channel voltage source
-
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
-
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 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.
-
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.
-