function [neg_on_err] = pb_overflow(reset, of)
% FUNCTION NAME:
%   pb_overflow
%
% DESCRIPTION:
%   Retrieve the contents of the overflow registers. This can be used to find
%   out if the ADC is being driven with to large of a signal. In addition, 
%   the RadioProcessor must round data values at certain points during the 
%   processing of the signal. By default, this rounding is done in such a way 
%   that overflows cannot occur. However, if you change the rounding
%   procedure, this function will allow you to determine if overflows have
%   occurred. Each overflow register counts the number of overflows up to
%   65535. If more overflows than this occur, the register will remain at 
%   65535. The overflow registers can reset by setting the reset argument of
%   this function to 1.
%
% INPUTS:
%   reset - Set this to one to reset the overflow counters
%
%   of - Pointer to a PB_OVERFLOW_STRUCT which will hold the values of the 
%        overflow counter. This can be a NULL pointer if you are using this 
%        function to reset the counters
% 
% OUTPUTS:
%   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_overflow', reset, of);

end