pub unsafe extern "C" fn SoapySDRDevice_setFrequency(
    device: *mut SoapySDRDevice,
    direction: c_int,
    channel: usize,
    frequency: f64,
    args: *const SoapySDRKwargs
) -> c_int
Expand description

Set the center frequency of the chain.

  • For RX, this specifies the down-conversion frequency.
  • For TX, this specifies the up-conversion frequency.

The default implementation of setFrequency() will tune the “RF” component as close as possible to the requested center frequency. Tuning inaccuracies will be compensated for with the “BB” component.

The args can be used to augment the tuning algorithm.

  • Use “OFFSET” to specify an “RF” tuning offset, usually with the intention of moving the LO out of the passband. The offset will be compensated for using the “BB” component.
  • Use the name of a component for the key and a frequency in Hz as the value (any format) to enforce a specific frequency. The other components will be tuned with compensation to achieve the specified overall frequency.
  • Use the name of a component for the key and the value “IGNORE” so that the tuning algorithm will avoid altering the component.
  • Vendor specific implementations can also use the same args to augment tuning in other ways such as specifying fractional vs integer N tuning.

\param device a pointer to a device instance \param direction the channel direction RX or TX \param channel an available channel on the device \param frequency the center frequency in Hz \param args optional tuner arguments \return an error code or 0 for success