motor-control-sdk/source/.meta/position_sense/templates/hdsl_templates.h.xdt

28 lines
713 B
Plaintext
Raw Normal View History

%%{
let module = system.modules[args[0]];
%%}
/*
* HDSL
*/
/* HDSL Instance Macros */
#define CONFIG_HDSL_NUM_INSTANCES `module.$instances.length`
% for(let i = 0; i < module.$instances.length; i++) {
% let instance = module.$instances[i];
% let Mode = 0;
%if(instance.Mode === "FREE_RUN")
%{
% Mode = 0;
%}
%else
%{
% Mode = 1;
%}
#define `instance.$name`_BOOSTER_PACK `instance.Booster_Pack & 1`
#define `instance.$name` (`i`)
#define `instance.$name`_CHANNEL0 (`instance.channel_0 & 1`)
#define `instance.$name`_CHANNEL1 (`instance.channel_1 & 1`)
#define `instance.$name`_MODE (`Mode`)
% }