ValonKATCP
The ValonKATCP class allows the Player to control the Valon synthesizer via a KATCP client. This is necessary as the Valon synthesizer is controlled by a serial port on the ROACH PPC host.
class ValonKATCP
-
class valon_katcp.ValonKATCP(self, r, serial_port)[source]
A Valon synth class modeled after the ‘valon_synth’ module, but
which communicates with a Valon installed on a ROACH via KATCP.
ValonKATCP(r, serial_port)
-
_get_synth_val(self, s)[source]
For interchangeability with the valon_synth module this class
assumes throughout that the parameter s is an integer, either
0 for SYNTH_A or 8 for SYNTH_B. However, KATCP expects a case
insensitive string ‘synth_a’ or ‘synth_b’ This function converts
from 0 or 8 to ‘synth_a’ or ‘synth_b’. It throws a KeyError if
the input isn’t 0 or 8.
-
_set_serial_port(self, port)[source]
- port: a string denoting the serial device, i.e. /dev/ttyS0
Sets the serial port on the ROACH that the Valon is connected to.
-
flash(self)[source]
Writes frequencies to valon non-volatile memory.
-
get_frequency(self, synth)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
Returns the current output frequency for the specified synthesizer.
-
get_label(self, synth)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
Returns the currently set label for ‘synth’.
-
get_options(self, synth)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
Returns the option flags/values for the specified
synthesizer. They are returned as a tuple of 4 elements:
- Ref frequency doubler flag. When set, the reference frequency doubler is active.
- Ref frequency halver flag: When set, the reference frequency halver is active.
- Integer value, the reference frequency divider value.
- ‘Low spur’ mode flag. When not set, the synth is in ‘low noise’ mode.
-
get_phase_lock(self, synth)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
Returns True if the specified synthesizer is phase locked to
its reference, False if not.
-
get_ref_select(self)[source]
Returns 1 if external reference frequency is selected, 0 if
internal reference is selected.
-
get_reference(self)[source]
Returns the set reference frequency value. This is not the
actual reference frequency, but the value that has been sent to
the Valon as the current reference frequency.
-
get_rf_level(self, synth)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
Returns the output RF level setting in dBm for the specified
synthesizer.
-
get_vco_range(self, synth)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
Returns a tuple of the VCO range, (min, max)
-
roach = None
The KATCP client object
-
set_frequency(self, synth)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
- frequency: A floating point value, the frequency in MHz.
- chan_spacing: A floating point value, the resolution of the
setting, in Hz. This defaults to 10 Hz.
Sets the output frequency of the specified synthesizer. Returns
True on success.
-
set_label(self, synth, new_label)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
- new_label: A string; only the first 16 characters will be used.
Gives a custom label to the specified synthesizer.
-
set_options(self, synth, double=0, half=0, r=1, low_spur=0)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
- double: Set to 1 to double the reference frequency, default = 0
- half: Set to 1 to halve the reference frequency, default = 0
- r: Reference frequency multiplier, default = 1
- low_spur: Set to 1 to use ‘low spur’ mode, clear to use ‘low noise’ mode. Default = 0
Sets the synthesizer options.
-
set_ref_select(self, external)[source]
- external: External reference flag, an integer number. Set to 1 for external ref, 0 for internal ref.
Sets the reference frequency source to external or internal.
-
set_reference(self, ref_freq)[source]
- ref_freq: the reference frequency being used, in Hz.
Tells the Valon synthesizer module of the reference frequency
being used.
-
set_rf_level(self, synth, rf_level)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
- rf_level: The new level, in dBm. This must be one of -4, -1,
2, and 5, or the function will return False and not set the
level.
Sets the output RF level in dBm for the specified synthesizer.
-
set_vco_range(self, synth, low, high)[source]
- synth: An integer, 0x00 for SYNTH_A, and 0x08 for SYNTH_B
- low: Minimum frequency the VCO is capable of producing.
- high: Maximum frequency the VCO is capable of producing.
Sets the specified synthesizer’s VCO range.
-
timeout = None
The default timeout for katcp requests for this module