F1d_module


class spirack.F1d_module(spi_rack, module)

F1d module interface class. This class does the low level interfacing with the F1d IQ-Mixer module. It requires an SPI Rack object and module number at initialization.

Allows the user to read the RF and LO power levels. Next to that, a status bit can be checked to see if the RF power level clipped. This bit needs to be cleared manually after reading. If the remote control is enabled, it also allows the user to set the I/Q gain and filter settings remotely. The module then ignores the front switch settings until remote control is disabled again.

At initialization the RF clipped bit will be cleared.

Parameters:

  • spi_rack (SPI_rack) - SPI_rack class object via which the communication runs
  • module (int) - module number set on the harware

Methods

enable_remote(enable)

Enables remote control of module. Set to 1/True to enable remote control and 0/False to disable. If enabled, switches on the front of the module are ignored and all control happens via software.

Parameters:

  • enable (bool) - enables/disables remote control
rf_clipped()

Return if the RF input clipped. If the RF clipped since the last RF bit reset, returns True. Else returns False.

Returns - true/false depending if the RF clipped (bool)

clear_rf_clip()

Clears rf clip bit. Use this function to clear the RF clip bit once it has been read.

set_IQ_filter(value)

Set the IF output filter on both the I and Q channel. In addition to the filter values on the front of the module, a fourth higher cutoff frequency is possible via software.

Parameters:

  • value (int) - cutoff frequency in Mhz. Possible values: 1, 3, 10, 20
set_I_gain(value)

Sets the gain for the I output channel. Values are the same as on the front of the module.

Parameters:

  • value (string) - cutoff frequency. Possible values: ‘LOW’, ‘MID’, ‘HIGH’
set_Q_gain(value)

Sets the gain for the Q output channel. Values are the same as on the front of the module.

Parameters:

  • value (string) - cutoff frequency. Possible values: ‘LOW’, ‘MID’, ‘HIGH’
get_RF_level()

Get RF input power. Calculates the RF input power from the ADC value. Within 4 dB accurate upto 4 dBm. Above will deviate more, but its also above the clipping level.

Returns - RF input power in dBm (float)

get_LO_level()

Get LO input power. Calculates the LO input power from the ADC value. Within 4 dB accurate upto 4 dBm. Above will deviate more, but its also above the clipping level.

Returns - LO input power in dBm (float)

read_adc(channel)

Reads the ADC for RF/LO power. Reads the given ADC channel. These channels are connected to the outputs of RF power detectors. Output needs to be converted to dBm. Function used internally.

Parameters:

  • channel (int: 0-1) - the ADC channel to be read

Returns - 12-bit ADC data (int)


Attributes

Attribute Info
module the module number set by the user (must coincide with hardware)
remote_settings contains a byte with the remote settings (IQ gain and filter)