motor-control-sdk/source/.meta/position_sense/bissc/bissc.h.xdt

50 lines
1.6 KiB
Plaintext
Raw Normal View History

%%{
let module = system.modules[args[0]];
%%}
/*
* BiSSC
*/
/* BiSSC Instance Macros */
#define CONFIG_BISSC_NUM_INSTANCES `module.$instances.length`
% for(let i = 0; i < module.$instances.length; i++) {
% let instance = module.$instances[i];
% let Mode = 0;
% let sliceVal = 1;
% let icssValue = 0;
% if(instance.instance === "ICSSG0")
% {
% if(instance.PRU_ICSSG0_PRU.$assign === "PRU_ICSSG0_PRU0")
% {
% sliceVal = 0;
% }
% }
% else if(instance.instance === "ICSSG1")
% {
% icssValue = 1;
% if(instance.PRU_ICSSG1_PRU.$assign === "PRU_ICSSG1_PRU0")
% {
% sliceVal = 0;
% }
% }
%if(((instance.channel_0 & 1)&&(instance.channel_1 & 1))||((instance.channel_1 & 1)&&(instance.channel_2 & 1))||((instance.channel_2 & 1)&&(instance.channel_0 & 1)))
%{
% Mode = 1;
%}
%if(instance.Multi_Channel_Load_Share & 1)
%{
% Mode = 2;
%}
#define `instance.$name` (`i`)
#define `instance.$name`_CHANNEL0 (`instance.channel_0 & 1`)
#define `instance.$name`_CHANNEL1 (`instance.channel_1 & 1`)
#define `instance.$name`_CHANNEL2 (`instance.channel_2 & 1`)
#define `instance.$name`_BAUDRATE (`instance.baudrate`)
#define `instance.$name`_LOAD_SHARE_MODE `instance.Multi_Channel_Load_Share & 1`
#define `instance.$name`_MODE `Mode`
#define `instance.$name`_BOOSTER_PACK (`instance.Booster_Pack & 1`)
#define PRUICSS_PRUx (`sliceVal`)
#define PRUICSSx (`icssValue`)
% }