📄 cast_c6xx.m
字号:
function resp = cast_C6xx(mm,datatype)
% Private. Casting for C6xx memory symbols.
% Copyright 2002 The MathWorks, Inc.
% $Revision: 1.4 $ $Date: 2002/05/13 18:31:52 $
if (mm.bitsperstorageunit ~=8)
error('An addressable unit must contain 16 bits for C54x memory objects');
end
% Initialize (pre/post)pad
mm.prepad = 0; % Modified later, if necessary
mm.postpad = 0;
switch datatype
case {'double','long double'},
totalbits = 64;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'float';
case {'single','float'}
totalbits = 32;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'float';
case {'long','signed long'}
totalbits = 64;
mm.postpad = 24; % c6000 specific!
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'signed';
case {'int','signed int'}
totalbits = 32;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'signed';
case 'short',
totalbits = 16;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'signed';
case {'char','signed char'}
totalbits = 8;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'signed';
case 'unsigned long',
totalbits = 64;
mm.postpad = 24; % c6000 specific!
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'unsigned';
case 'unsigned short'
totalbits = 16;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'unsigned';
case 'unsigned int'
totalbits = 32;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'unsigned';
case 'unsigned char'
totalbits = 8;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'unsigned';
case 'int64'
totalbits = 64;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'signed';
case 'uint64'
totalbits = 64;
mm.storageunitspervalue = round(totalbits/mm.bitsperstorageunit);
mm.represent = 'unsigned';
case 'int32'
mm.storageunitspervalue = round(32/mm.bitsperstorageunit);
mm.represent = 'signed';
case 'uint32'
mm.storageunitspervalue = round(32/mm.bitsperstorageunit);
mm.represent = 'unsigned';
case 'int16'
mm.storageunitspervalue = round(16/mm.bitsperstorageunit);
mm.represent = 'signed';
case 'uint16'
mm.storageunitspervalue = round(16/mm.bitsperstorageunit);
mm.represent = 'unsigned';
case 'int8'
mm.storageunitspervalue = round(8/mm.bitsperstorageunit);
mm.represent = 'signed';
case 'uint8'
mm.storageunitspervalue = round(8/mm.bitsperstorageunit);
mm.represent = 'unsigned';
%==========================================================================
% Special TI types
case 'Q0.15',
mm.storageunitspervalue = round(16/mm.bitsperstorageunit);
mm.represent = 'fract';
mm.binarypt = 15; % future expansion?
case 'Q0.31',
mm.storageunitspervalue = round(32/mm.bitsperstorageunit);
mm.represent = 'fract';
mm.binarypt = 31; % future expansion?
otherwise,
error(['DATATYPE:' datatype ' is not recognized']);
end
% [EOF] cast_C6xx.m
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -