def bin_search(min_limit, max_limit, depth, func, params, is_int=False):
    """Implement generic binary search algorithm

    :param min_limit: The minimum range limit
    :type min_limit: int or float (must set is_int if integer)
    :param max_limit: The maximum range limit
    :type max_limit: int or float
    :param depth: The recursion depth limit
    :type depth: int
    :param func: Function for evaluating result. Takes in the new value to
                 set and a dictionary of parameters. 
    :type func: function
    :param params: Dictionary of params to pass to to func, including a 
                   logger object
    :param is_int: Set if the values to binary search are integers
    :type is_int: bool, optional
    """
    new_val = (float(max_limit) + float(min_limit))/2.0
    params['logger'].info("-------------------------------")
    if is_int:
        new_val = int(new_val)
        params['logger'].info("min: {}, max: {}, mid: {}".format(
            min_limit,max_limit,new_val))
        params['logger'].info("min: 0x{:04X}, max: 0x{:04X}, mid: {:04}".format(
            min_limit,max_limit,new_val))
    else:
        params['logger'].info("min: {:0.4f}, max: {:0.4f}, mid: {:0.4f}".format(
            min_limit,max_limit,new_val))
    results = func(new_val,params)
    depth -= 1
    if depth < 0:
        params['logger'].info("Maximum depth reached")
        return {'results' : results, 'min' : min_limit, 'max' : max_limit}
    if min_limit == max_limit:
        params['logger'].info("Converged")
        return {'results' : results, 'min' : min_limit, 'max' : max_limit}
    if results['bin_value'] == 1:
        return bin_search(new_val, max_limit, depth, func, params, is_int=is_int)
    elif results['bin_value'] == 0:
        return bin_search(min_limit, new_val, depth, func, params, is_int=is_int)
    else:
        raise ValueError("Invalid bin_value: {}".format(results['bin_value']))