%% $RCSfile: sfun_frmad.tlc,v $ %% $Revision: 1.1 $ %% $Date: 2000/07/10 17:19:31 $ %% %% Abstract: Frame-based A/D Conversion %% An example of a frame-based A/D converter. Contains place-holders %% for adding actual code for a frame-based A/D converter %% %% Copyright 1990-2000 The MathWorks, Inc. %implements sfun_frmad "C" %% Function: BlockTypeSetup ==================================================== %% Abstract: %% Cache an extern declarations to frame-based AD routines %% %function BlockTypeSetup(block, system) void %openfile buffer #include "sfun_frmad_wrapper.h" %closefile buffer % %endfunction %% Function: Start ============================================================= %% %function Start(block, system) Output /* Frame-based A/D converter %: * Set up converter for a frame size of % * (For now, simply generate a noisy multi-channel frame-based signal). */ %endfunction %% Function: Outputs =========================================================== %% %function Outputs(block, system) Output /* Frame-based A/D converter %: * Start conversion and wait till it completes * (For now, simply generate a noisy multi-channel frame-based signal). */ %assign y = LibBlockOutputSignalAddr(0, "", "", 0) %assign fnName = SFcnParamSettings.Function %assign frmSize = SFcnParamSettings.FrameSize %assign ts = SFcnParamSettings.Ts %assign noisA = SFcnParamSettings.NoiseAmp %assign noisF = SFcnParamSettings.NoiseFreq %assign nAmpRows = Parameter[0].Dimensions[0] %assign nAmpCols = Parameter[0].Dimensions[1] %assign nAmps = nAmpRows * nAmpCols %assign count = LibBlockIWork(IWORK, "", "", 0) %% %if fnName == "Constant" sfun_frmad_const_wrapper(%, %, %, %, nAmps, %, %, %); %else %assign nFreqRows = Parameter[1].Dimensions[0] %assign nFreqCols = Parameter[1].Dimensions[1] %assign nFreqs = nFreqRows * nFreqCols sfun_frmad_sine_wrapper(%, %, %, %, %, %, %, %, %, %); %endif % = % + %; %% %endfunction %% [EOF] sfun_frmad.tlc