matlab生成底层驱动封装库的TLC文件
MC9S12XEP100.tlc(系统目标文件)就是下图在simulink界面中选择的System target file是链接编译器的%% SYSTLC: MC9S12XEP100TMF: noneMAKE: make_rtwEXTMODE: ext_comm上面的MC9S12XEP100就是下面的描述,修改这里可以修改描述文件后面几个TMF和MAKE等的设置对应的是下图中的勾选是否选择/%%%
MC9S12XEP100.tlc(系统目标文件)就是下图在simulink界面中选择的System target file是链接编译器的
//这个是控制主题代码生成的,对代码生成进行全局控制,比如说生成C语言还是什么其他语言啥的
%% SYSTLC: MC9S12XEP100 TMF: none MAKE: make_rtw EXTMODE: ext_comm
上面的MC9S12XEP100 就是下面的描述,修改这里可以修改描述文件
后面几个TMF和MAKE等的设置对应的是下图中的勾选是否选择
/%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 雨的旋律汽车电子开发板
% 网店地址:http://shop108493800.taobao.com/
% 技术支持QQ群:153167747
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%/
%selectfile NULL_FILE
%assign CodeFormat = “Embedded-C” //这行显示的是代码形式,嵌入式C语言
%assign TargetType = “RT” //这行表示的实时的系统
%assign Language = “C” //这行表示生成的代码是C语言的形式
%assign AutoBuildProcedure = !GenerateSampleERTMain
//这行的意思是表示不生成它实例的ert.main.c文件,相当于下图的蓝线没有勾选
%include “codegenentry.tlc”
/%
BEGIN_RTW_OPTIONS
rtwoption_index = 1;
rtwoptions(rtwoption_index).prompt = ‘MC9S12XEP100 Target Options’;
//这一行的作用是在simulink的配置界面里面显示下面那一行
rtwoptions(rtwoption_index).type = ‘Category’;
rtwoptions(rtwoption_index).enable = ‘on’;
rtwoptions(rtwoption_index).default = 1;
//这一行的作用是设置MC9S12XEP100 Target Options里面有几个选项,这里设置的是一个选项
rtwoptions(rtwoption_index).popupstrings = ‘’;
rtwoptions(rtwoption_index).tlcvariable = ‘’;
rtwoptions(rtwoption_index).tooltip = ‘’;
rtwoptions(rtwoption_index).callback = ‘’;
rtwoptions(rtwoption_index).makevariable = ‘’;
rtwoption_index = rtwoption_index + 1;
rtwoptions(rtwoption_index).prompt = ‘Actions’;
//这里设置的是选项的名字叫做Action,如上图设置有几个哪里可以看
rtwoptions(rtwoption_index).type = ‘Popup’;
//这里设置的是Action的类型选择方式是通过下拉框选择的
rtwoptions(rtwoption_index).popupstrings = ‘Build|Run’;
这里设置的是Action的下拉框里面有两个值可以选择Build或者Run
rtwoptions(rtwoption_index).enable = ‘on’;
rtwoptions(rtwoption_index).default = ‘Build’;
//这里设置大的是Action选项的默认是Build
rtwoptions(rtwoption_index).tlcvariable = ‘BuildAction’;
rtwoptions(rtwoption_index).tooltip = ‘Select CodeWarrior BuildAction.’;
rtwoptions(rtwoption_index).callback = ‘’;
rtwoptions(rtwoption_index).makevariable = ‘’;
%----------------------------------------%
% Configure RTW code generation settings %
%----------------------------------------%
rtwgensettings.BuildDirSuffix = ‘_MC9S12XEP100_rtw’;
//这个是设置代码的生成文件名,比如说你起了个simulink模型的名字是test,那么他便一直后生成的代码的文件的名字就是test_MC9S12XEP100_rtw;
rtwgensettings.DerivedFrom = ‘ert.tlc’;
rtwgensettings.Version = ‘1’;
rtwgensettings.SelectCallback = [‘MC9S12XEP100_callback_handler(hDlg, hSrc)’];
//这个是选择回调函数
就是你点击下图中的APPLY或者OK的时候执行的脚本函数
脚本文件如下图所示
END_RTW_OPTIONS
%/
rtwoption_index = 1;
rtwoptions(rtwoption_index).prompt = ‘TC275 Target Options’;
rtwoptions(rtwoption_index).type = ‘Category’;
rtwoptions(rtwoption_index).enable = ‘on’;
rtwoptions(rtwoption_index).default = 1;
rtwoptions(rtwoption_index).popupstrings = ‘’;
rtwoptions(rtwoption_index).tlcvariable = ‘’;
rtwoptions(rtwoption_index).tooltip = ‘’;
rtwoptions(rtwoption_index).callback = ‘’;
rtwoptions(rtwoption_index).makevariable = ‘’;
rtwoption_index = rtwoption_index + 1;
rtwoptions(rtwoption_index).prompt = ‘Actions’;
rtwoptions(rtwoption_index).type = ‘Popup’;
rtwoptions(rtwoption_index).popupstrings = ‘Build|Run’;
rtwoptions(rtwoption_index).enable = ‘on’;
rtwoptions(rtwoption_index).default = ‘Build’;
rtwoptions(rtwoption_index).tlcvariable = ‘BuildAction’;
rtwoptions(rtwoption_index).tooltip = ‘Select TC275 BuildAction.’;
rtwoptions(rtwoption_index).callback = ‘’;
rtwoptions(rtwoption_index).makevariable = ‘’;
rtwoption_index = rtwoption_index + 1;
rtwoptions(rtwoption_index).prompt = ‘TC275 Target Options1’;
rtwoptions(rtwoption_index).type = ‘Category’;
rtwoptions(rtwoption_index).enable = ‘on’;
rtwoptions(rtwoption_index).default = 1;
rtwoptions(rtwoption_index).popupstrings = ‘’;
rtwoptions(rtwoption_index).tlcvariable = ‘’;
rtwoptions(rtwoption_index).tooltip = ‘’;
rtwoptions(rtwoption_index).callback = ‘’;
rtwoptions(rtwoption_index).makevariable = ‘’;
rtwoption_index = rtwoption_index + 1;
rtwoptions(rtwoption_index).prompt = ‘Actions’;
rtwoptions(rtwoption_index).type = ‘Popup’;
rtwoptions(rtwoption_index).popupstrings = ‘Build|Run’;
rtwoptions(rtwoption_index).enable = ‘on’;
rtwoptions(rtwoption_index).default = ‘Build’;
rtwoptions(rtwoption_index).tlcvariable = ‘BuildAction’;
rtwoptions(rtwoption_index).tooltip = ‘Select TC275 BuildAction.’;
rtwoptions(rtwoption_index).callback = ‘’;
rtwoptions(rtwoption_index).makevariable = ‘’;
更多推荐
所有评论(0)