⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cexpr.m

📁 这是一个关于MATLAB的函数
💻 M
字号:
function resp = cexpr(cc,expr,timeout)
%CEXPR   Executes a C or GEL expression in the Target processor
%  RESP = CEXPR(CC,EXP,TIMEOUT) will execute on the target DSP a 
%   'C' data expression or GEL command defined by EXP. This method
%   can provide access to complex data objects such as structures
%   and arrays.  As defined by the Code Composer syntax, EXP is a
%   string with C syntax where variables are taken  from the local 
%   scope of the DSP processor, while routines are mapped to GEL 
%   functions defined in the DSP project.  The returned value RESP 
%   will follow the C syntax rules.  Most GEL commands do not
%   return a value, in which case RESP will not be set.  The 
%   resolution of DSP variables in the C expression will depend
%   on the scope of the DSP program.  
%
%  RESP = CEXPR(CC,EXP) Same as above, except the timeout value 
%   defaults to the  timeout property specified by the CC object.
%   Use CC.GET to examine the default timeout value.
%
%  Examples
%   >a=cexpr(cc,'x.zz') - Return value of zz field in x structure.
%   >cexpr(cc,'Startup()') - Execute GEL function 'Startup'
%   >cexpr(cc,'x.b=10')    - Set value of x.b in DSP to 10.
%   >cexpr(cc,['x.c[2]=' int2str(z)]) - Set value of x.c[2] 
%      in DSP to the value of MATLAB variable z.
%
%  See also READ, WRITE, ADDRESS.

% Copyright 2001-2002 The MathWorks, Inc.
% $Revision: 1.4 $ $Date: 2002/06/12 15:30:46 $

% Check input parameters
error(nargchk(2,3,nargin));
if ~ishandle(cc),
    error('First Parameter must be a CCSDSP Handle.');
end
% Parse timeout
if( nargin >= 3) & (~isempty(timeout)),
    if ~isnumeric(timeout) | length(timeout) ~= 1,
        error('TIMEOUT parameter must be a single numeric value.');
    end
    dtimeout = double(timeout);
else
    dtimeout = double(get(cc,'timeout'));
end
if( dtimeout < 0)
    error(['Negative TIMEOUT value "' num2str(dtimeout) '" not permitted.']);
end
temp = ccsmexswitchyard([54,cc.boardnum,cc.procnum,dtimeout,cc.eventwaitms],expr);
if ~isempty(temp)
    resp = temp; 
end
    
% [EOF] cexpr.m

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -