function ret = EMIFEnable(hObj, EMIFModule, chipSelect)
%EMIFENABLE Enable the EMIF parameters based on CPU

% Copyright 2018-2022 The MathWorks, Inc.


ret = 0;
hCS = hObj.getConfigSet();
if codertarget.target.isCoderTarget(hCS)
    emifdata = codertarget.data.getParameterValue(hObj, EMIFModule);
    % Enable EMIF parameters depending upon the CSx enable or disabled
    % Also disable EMIF2 parameters for CPU2
    if strcmp(EMIFModule, 'EMIF2')
        if (codertarget.data.isValidParameter(hCS, 'ESB.ProcessingUnit') && contains(codertarget.data.getParameterValue(hCS, 'ESB.ProcessingUnit'), 'CPU2'))
            ret = 0;
        else
            ret = emifdata.(chipSelect);
        end
    else
        ret = emifdata.(chipSelect);
    end
end
end