function busspeed = getExtModeCANBusSpeed(hCS)
% GETEXTMODECANBUSSPEED - Gets the eCAN Bus Speed

%   Copyright 2021-2023 The MathWorks, Inc.

if codertarget.target.isCoderTarget(hCS)
    ctd = codertarget.data.getData(hCS);
    
    CANModule = codertarget.data.getParameterValue(hCS, 'ExtMode.CANModule');
    % The eCAN structure stored in variable 'eCAN_A', However the dispaly
    % name is just 'CAN_A'
    CANModule = ['e',CANModule];
    CANdata = ctd.(CANModule);
    
    busspeed = CANdata.BaudRate;
else
    busspeed = 0;
end
