function [max_allowed_clock_freq, internal_osc]= getMaximumAllowedFreq(chipName, SubFamily)
%GETMAXIMUMALLOWEDFREQ Summary of this function goes here
%   Detailed explanation goes here

% Copyright 2013-2023 MathWorks, Inc.

internal_osc = 0;
switch SubFamily
    case '2802x'
        switch chipName
            case {'280200', '28020', '28021'}
                max_allowed_clock_freq = 40;
            case {'28022', '28023'}
                max_allowed_clock_freq = 50;
            otherwise
                max_allowed_clock_freq = 60;
        end
    case {'2803x', '2805x'}
        max_allowed_clock_freq = 60;
    case '2806x'
        max_allowed_clock_freq = 90;
    case '280x'
        switch chipName
            case {'28015', '28016'}
                max_allowed_clock_freq = 60;
            otherwise
                max_allowed_clock_freq = 100;
        end
    case '281x'
        max_allowed_clock_freq = 150;
    case '2804x'
        max_allowed_clock_freq = 100;
    case {'28x3x', '2833x'}
        switch chipName
            case {'28232', '28332'}
                max_allowed_clock_freq = 100;
                internal_osc = 20;
            otherwise
                max_allowed_clock_freq = 150;
        end
    case '2834x'
        switch chipName
            case {'28341', '28343', '28345'}
                max_allowed_clock_freq = 200;
            otherwise
                max_allowed_clock_freq = 300;
        end
    case {'28M35x','28M36x'}
        max_allowed_clock_freq = 150;
    case {'2837xS','2837xD','2838x','28p65x'}
        max_allowed_clock_freq = 200;
    case {'2807x', '28003x', '280013x', '280015x'}
        max_allowed_clock_freq = 120;
    case {'28004x', '28002x'}
        max_allowed_clock_freq = 100;
    otherwise
        max_allowed_clock_freq = 300;
end
   
