www.gusucode.com > rtwdemos 工具箱matlab源码程序 > rtwdemos/examplePilF28335/+f28335pil/f28335Timer.m
function hLib = f28335Timer % Copyright 2012 The MathWorks, Inc. hLib = RTW.TflTable; %---------- entry: code_profile_read_timer ----------- hEnt = RTW.TflCFunctionEntry; % Extract path information from MATLAB Preferences examplePilF28335Dir = getpref('examplePilF28335','examplePilF28335Dir'); headerPath = fullfile(examplePilF28335Dir, ... 'F28335SerialRtiostream'); sourcePath = headerPath; hEnt.setTflCFunctionEntryParameters( ... 'Key', 'code_profile_read_timer', ... 'Priority', 100, ... 'ImplementationName', 'profileTimerRead', ... 'ImplementationHeaderFile', 'F28335SerialRtiostream-ProfilerTimer.h', ... 'ImplementationSourceFile', 'F28335SerialRtiostream-ProfilerTimer.c', ... 'ImplementationHeaderPath', headerPath, ... 'ImplementationSourcePath', sourcePath); hEnt.EntryInfo.CountDirection = 'RTW_TIMER_DOWN'; hEnt.EntryInfo.TicksPerSecond = 150e6; % Conceptual Args arg = hEnt.getTflArgFromString('y1','uint32'); arg.IOType = 'RTW_IO_OUTPUT'; hEnt.addConceptualArg(arg); % Implementation Args arg = hEnt.getTflArgFromString('y1','uint32'); arg.IOType = 'RTW_IO_OUTPUT'; hEnt.Implementation.setReturn(arg); hLib.addEntry( hEnt );