gusucode.com > target工具箱matlab源码程序 > target/extensions/processor/shared/ti/mdlinfo/getBlockInfo_TgtPref_Targets_C2000.m
function [linkPjtGenInfo, schedPjtGenInfo, targetPjtGenInfo] = getBlockInfo_TgtPref_Targets_C2000(linkPjtGenInfo, schedPjtGenInfo, targetPjtGenInfo) %GETBLOCKINFO_TGTPREF Get user preference information. % Copyright 2008-2015 The MathWorks, Inc. % Get the info under the Target Pref's 'Peripherals' tab targetPjtGenInfo.sysinfo.peripherals = getTgtPrefPeripherals(linkPjtGenInfo.modelName); % Set the masktype string for the system search according to the chip used switch lower(linkPjtGenInfo.sysinfo.tgtPrefs.chipInfo.subFamily) case '281x' targetPjtGenInfo.sysinfo.ADCblocktypes = {'C281x ADC'}; targetPjtGenInfo.sysinfo.PWMblocktypes = {'C281x PWM'}; targetPjtGenInfo.sysinfo.CANblocktypes = {'C28x eCAN Receive', 'C28x eCAN Transmit'}; targetPjtGenInfo.sysinfo.QEPblocktypes = {'C281x QEP'}; targetPjtGenInfo.sysinfo.GPIOblocktypes = {'C281x GPIO Digital Input', 'C281x GPIO Digital Output'}; targetPjtGenInfo.sysinfo.numGPIOpins = 16; targetPjtGenInfo.sysinfo.CAPblocktypes = {'C281x CAP'}; targetPjtGenInfo.sysinfo.SPIblocktypes = {'C28x SPI Receive','C28x SPI Transmit'}; targetPjtGenInfo.sysinfo.SCIblocktypes = {'C28x SCI Receive','C28x SCI Transmit'}; targetPjtGenInfo.sysinfo.WATCHDOGblocktypes = {'C28x WatchDog'}; case {'280x','2833x','2804x','2802x','2803x','2806x','2834x'} switch lower(linkPjtGenInfo.sysinfo.tgtPrefs.chipInfo.subFamily) case {'2802x','2803x','2806x'}, chipType = 'C2802x/03x/05x/06x/M3x/37x/07x'; targetPjtGenInfo.sysinfo.AnalogIOblocktypes = {'C2802x/03x/06x AnalogIO Input', 'C2802x/03x/06x AnalogIO Output'}; if isequal(lower(linkPjtGenInfo.sysinfo.tgtPrefs.chipInfo.subFamily),'2803x') targetPjtGenInfo.sysinfo.GPIOblocktypes = {'C2803x GPIO Digital Input', 'C2803x GPIO Digital Output'}; targetPjtGenInfo.sysinfo.COMPblocktypes = {'C2803x COMP'}; targetPjtGenInfo.sysinfo.LINblocktypes = {'C2803x LIN Receive','C2803x LIN Transmit'}; elseif isequal(lower(linkPjtGenInfo.sysinfo.tgtPrefs.chipInfo.subFamily),'2806x') targetPjtGenInfo.sysinfo.GPIOblocktypes = {'C2806x GPIO Digital Input', 'C2806x GPIO Digital Output'}; targetPjtGenInfo.sysinfo.COMPblocktypes = {'C2806x COMP'}; else targetPjtGenInfo.sysinfo.GPIOblocktypes = {'C2802x GPIO Digital Input', 'C2802x GPIO Digital Output'}; targetPjtGenInfo.sysinfo.COMPblocktypes = {'C2802x COMP'}; end case {'2833x'}, chipType = 'C280x/C2833x'; targetPjtGenInfo.sysinfo.GPIOblocktypes = {'C2833x GPIO Digital Input', 'C2833x GPIO Digital Output'}; case {'2834x'}, chipType = 'C280x/C2833x/C2834x'; targetPjtGenInfo.sysinfo.GPIOblocktypes = {'C2833x/C2834x GPIO Digital Input', 'C2833x/C2834x GPIO Digital Output'}; targetPjtGenInfo.sysinfo.PWMblocktypes = {'C2834x ePWM'}; otherwise chipType = 'C280x/C2833x'; targetPjtGenInfo.sysinfo.GPIOblocktypes = {'C280x GPIO Digital Input', 'C280x GPIO Digital Output'}; end if ~strcmpi(linkPjtGenInfo.sysinfo.tgtPrefs.chipInfo.subFamily, '2834x') switch lower(linkPjtGenInfo.sysinfo.tgtPrefs.chipInfo.subFamily) case {'2802x', '2803x', '2806x'} targetPjtGenInfo.sysinfo.ADCblocktypes = {'C2802x/03x/05x/06x/M3x/37x/07x ADC'}; otherwise targetPjtGenInfo.sysinfo.ADCblocktypes = {[chipType,' ADC']}; end targetPjtGenInfo.sysinfo.PWMblocktypes = {[chipType,' ePWM']}; end if ~strcmpi( linkPjtGenInfo.sysinfo.tgtPrefs.chipInfo.subFamily, '2803x') targetPjtGenInfo.sysinfo.LINblocktypes = {'',''}; end targetPjtGenInfo.sysinfo.numGPIOpins = 8; targetPjtGenInfo.sysinfo.CAPblocktypes = {'C28x eCAP'}; targetPjtGenInfo.sysinfo.QEPblocktypes = {'C28x eQEP'}; targetPjtGenInfo.sysinfo.SPIblocktypes = {'C28x SPI Receive', 'C28x SPI Transmit'}; targetPjtGenInfo.sysinfo.SCIblocktypes = {'C28x SCI Receive', 'C28x SCI Transmit'}; targetPjtGenInfo.sysinfo.I2Cblocktypes = {'C28x I2C Receive','C28x I2C Transmit'}; targetPjtGenInfo.sysinfo.WATCHDOGblocktypes = {'C28x WatchDog'}; targetPjtGenInfo.sysinfo.CANblocktypes = {'C28x eCAN Receive', 'C28x eCAN Transmit'}; otherwise linkPjtGenInfo.error = 1; linkPjtGenInfo.errormsg = 'Unknown DSP chip family'; return; end