function [neg_on_err] = pb_set_freq(freq)
% FUNCTION NAME:
%   pb_set_freq
%
% DESCRIPTION:
%   Write the given frequency to a frequency register on a DDS enabled board.
%   To do this, first call pb_start_programming(), and pass it FREQ_REGS. The
%   first call pb_set_freq() will then program frequency register 0, the second 
%   call will program frequency register 1, etc. When you have programmed all
%   the registers you intend to, call pb_stop_programming()
%
% INPUT:
%   freq - The frequency in MHz to be programmed to the register.
%
% OUTPUT:
%   neg_on_err - A negative number is returned on failure, and spinerr is set
%                to a description of the error. 0 is returned on success. 
%
% $Revision: R2017a$ 
% $Author: SpinCore Technologies, Inc.$
% $Date: November 17, 2023$
% ------------------------------------------------------------------------------

global SPINAPI_DLL_NAME;

neg_on_err = calllib(SPINAPI_DLL_NAME, 'pb_set_freq', freq);

end