Update repo
This commit is contained in:
@@ -0,0 +1,201 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
|
||||
/* Array of configurables that are common across device families */
|
||||
var UsedAQEventConfigs = [];
|
||||
var UsedAQOutput_Configs = [];
|
||||
var UsedAqOutput_aqEvent_Configs = [];
|
||||
|
||||
function onChangeUsedOutputs(inst, ui)
|
||||
{
|
||||
for (var aqOutputIndex in device_driverlib_peripheral.EPWM_ActionQualifierOutputModule)
|
||||
{
|
||||
var aqOutput = device_driverlib_peripheral.EPWM_ActionQualifierOutputModule[aqOutputIndex];
|
||||
if (inst["epwmActionQualifier_" + aqOutput.name + "_shadowMode"])
|
||||
{
|
||||
ui["epwmActionQualifier_" + aqOutput.name + "_shadowEvent"].hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui["epwmActionQualifier_" + aqOutput.name + "_shadowEvent"].hidden = true;
|
||||
inst["epwmActionQualifier_" + aqOutput.name + "_shadowEvent"] = device_driverlib_peripheral.EPWM_ActionQualifierLoadMode[0].name;
|
||||
}
|
||||
/*
|
||||
// Filter out the output events to only show the ones being used.
|
||||
for (var aqEventIndex in device_driverlib_peripheral.EPWM_ActionQualifierOutputEvent)
|
||||
{
|
||||
var aqEvent = device_driverlib_peripheral.EPWM_ActionQualifierOutputEvent[aqEventIndex];
|
||||
if (inst["epwmActionQualifier_" + aqOutput.name + "_usedEvents"].includes(aqEvent.name))
|
||||
{
|
||||
ui["epwmActionQualifier_" + aqOutput.name + "_" + aqEvent.name.replace("EPWM_AQ_OUTPUT_", "")].hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui["epwmActionQualifier_" + aqOutput.name + "_" + aqEvent.name.replace("EPWM_AQ_OUTPUT_", "")].hidden = true;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
var config = [
|
||||
{
|
||||
name: "epwmActionQualifier_continousSwForceReloadModeGld",
|
||||
displayName : "Enable Continuous SW Force Global Load",
|
||||
description : 'Use global load configuration for AQCSFRC',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_continousSwForceReloadMode",
|
||||
displayName : "Continuous SW Force Shadow Mode",
|
||||
description : '',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierContForce[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierContForce,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_t1Source",
|
||||
displayName : "T1 Trigger Source",
|
||||
description : '',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierTriggerSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierTriggerSource,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_t2Source",
|
||||
displayName : "T2 Trigger Source",
|
||||
description : '',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierTriggerSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierTriggerSource,
|
||||
},
|
||||
];
|
||||
|
||||
for (var aqOutputIndex in device_driverlib_peripheral.EPWM_ActionQualifierOutputModule)
|
||||
{
|
||||
var aqOutput = device_driverlib_peripheral.EPWM_ActionQualifierOutputModule[aqOutputIndex];
|
||||
var aqOutputconfigs = []
|
||||
|
||||
var aqOutput_Configs = [
|
||||
{
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_gld",
|
||||
displayName : aqOutput.displayName.replace("output", "") + "Global Load Enable",
|
||||
description : 'Use global load configuration for ' + aqOutput.displayName.replace("output", ""),
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_shadowMode",
|
||||
displayName : aqOutput.displayName.replace("output", "") + "Shadow Mode Enable",
|
||||
description : '',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeUsedOutputs,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_shadowEvent",
|
||||
displayName : aqOutput.displayName.replace("output", "") + "Shadow Load Event",
|
||||
description : '',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierLoadMode,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_t1Source",
|
||||
displayName : aqOutput.displayName.replace("output", "") + "T1 Trigger Source",
|
||||
description : '',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierTriggerSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierTriggerSource,
|
||||
deprecated : true,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_t2Source",
|
||||
displayName : aqOutput.displayName.replace("output", "") + "T2 Trigger Source",
|
||||
description : '',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierTriggerSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierTriggerSource,
|
||||
deprecated : true,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_onetimeSwForceAction",
|
||||
displayName : aqOutput.displayName.replace("output", "") + "One-Time SW Force Action",
|
||||
description : '',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierOutput[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierOutput,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_continuousSwForceAction",
|
||||
displayName : aqOutput.displayName.replace("output", "") + "Continuous SW Force Action",
|
||||
description : '',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierSWOutput[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierSWOutput,
|
||||
},
|
||||
{
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_usedEvents",
|
||||
displayName : "Events to Configure for " +
|
||||
aqOutput.displayName,
|
||||
description : '',
|
||||
hidden : false,
|
||||
default : [],
|
||||
minSelections: 0,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierOutputEvent,
|
||||
onChange : onChangeUsedOutputs,
|
||||
deprecated : true,
|
||||
}
|
||||
]
|
||||
|
||||
for (var aqEventIndex in device_driverlib_peripheral.EPWM_ActionQualifierOutputEvent)
|
||||
{
|
||||
var aqEvent = device_driverlib_peripheral.EPWM_ActionQualifierOutputEvent[aqEventIndex];
|
||||
var aqOutput_aqEvent_config = {
|
||||
name: "epwmActionQualifier_" + aqOutput.name + "_" + aqEvent.name.replace("EPWM_AQ_OUTPUT_", ""),
|
||||
displayName : aqOutput.displayName.replace("output", "") + " " + aqEvent.displayName.replace("AQ OUTPUT ", ""),
|
||||
description : '',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_ActionQualifierOutput[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ActionQualifierOutput,
|
||||
};
|
||||
aqOutputconfigs.push(aqOutput_aqEvent_config);
|
||||
}
|
||||
|
||||
aqOutput_Configs = aqOutput_Configs.concat([{
|
||||
name: "GROUP_AQ_" + aqOutput.name,
|
||||
displayName: aqOutput.displayName.replace("output", "") + "Event Output Configuration",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: aqOutputconfigs
|
||||
}]);
|
||||
config = config.concat([{
|
||||
name: "GROUP_AQ_Output_" + aqOutput.name,
|
||||
displayName: aqOutput.displayName.replace("output", "") + "Output Configuration",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: aqOutput_Configs
|
||||
}]);
|
||||
|
||||
UsedAQOutput_Configs.push(aqOutput_Configs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
var epwmAQSubmodule = {
|
||||
displayName: "EPWM Action Qualifier",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_AQ",
|
||||
description: "Enhanced Pulse Width Modulator Action Qualifier",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
exports = epwmAQSubmodule;
|
||||
@@ -0,0 +1,104 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
|
||||
function onChangeuseChopper(inst, ui)
|
||||
{
|
||||
for(var uiConfigIndex = 1; uiConfigIndex < config.length; uiConfigIndex++)
|
||||
{
|
||||
var configName = config[uiConfigIndex].name;
|
||||
ui[configName].hidden = !inst.epwmChopper_useChopper;
|
||||
inst[configName] = "0"; // Set to defaults when Chopper is disabled
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Array of CAN configurables that are common across device families */
|
||||
var config = [
|
||||
{
|
||||
name: "epwmChopper_useChopper",
|
||||
displayName : "Use Chopper",
|
||||
description : 'Check to configure the Chopper Submodule',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeuseChopper
|
||||
},
|
||||
{
|
||||
name: "epwmChopper_chopperDuty",
|
||||
displayName : "Chopper Duty Cycle",
|
||||
description : 'The chopper submodule duty cycle.',
|
||||
hidden : true,
|
||||
default : "0",
|
||||
options : [
|
||||
{name:"0", displayName: "1/8 DUTY"},
|
||||
{name:"1", displayName: "2/8 DUTY"},
|
||||
{name:"2", displayName: "3/8 DUTY"},
|
||||
{name:"3", displayName: "4/8 DUTY"},
|
||||
{name:"4", displayName: "5/8 DUTY"},
|
||||
{name:"5", displayName: "6/8 DUTY"},
|
||||
{name:"6", displayName: "7/8 DUTY"},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "epwmChopper_chopperFreq",
|
||||
displayName : "Chopper Frequency",
|
||||
description : 'The chopper submodule frequency.',
|
||||
hidden : true,
|
||||
default : "0",
|
||||
options : [
|
||||
{name:"0", displayName: "SYSCLKOUT / 1"},
|
||||
{name:"1", displayName: "SYSCLKOUT / 2"},
|
||||
{name:"2", displayName: "SYSCLKOUT / 3"},
|
||||
{name:"3", displayName: "SYSCLKOUT / 4"},
|
||||
{name:"4", displayName: "SYSCLKOUT / 5"},
|
||||
{name:"5", displayName: "SYSCLKOUT / 6"},
|
||||
{name:"6", displayName: "SYSCLKOUT / 7"},
|
||||
{name:"7", displayName: "SYSCLKOUT / 8"},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "epwmChopper_chopperFirstPulseWidth",
|
||||
displayName : "Chopper First Pulse Width",
|
||||
description : 'The chopper submodule first pulse width.',
|
||||
hidden : true,
|
||||
default : "0",
|
||||
options : [
|
||||
{name:"0", displayName: "8/(1xEPWMCLK)"},
|
||||
{name:"1", displayName: "8/(2xEPWMCLK)"},
|
||||
{name:"2", displayName: "8/(3xEPWMCLK)"},
|
||||
{name:"3", displayName: "8/(4xEPWMCLK)"},
|
||||
{name:"4", displayName: "8/(5xEPWMCLK)"},
|
||||
{name:"5", displayName: "8/(6xEPWMCLK)"},
|
||||
{name:"6", displayName: "8/(7xEPWMCLK)"},
|
||||
{name:"7", displayName: "8/(8xEPWMCLK)"},
|
||||
{name:"8", displayName: "8/(9xEPWMCLK)"},
|
||||
{name:"9", displayName: "8/(10xEPWMCLK)"},
|
||||
{name:"10",displayName: "8/(11xEPWMCLK)"},
|
||||
{name:"11",displayName: "8/(12xEPWMCLK)"},
|
||||
{name:"12",displayName: "8/(13xEPWMCLK)"},
|
||||
{name:"13",displayName: "8/(14xEPWMCLK)"},
|
||||
{name:"14",displayName: "8/(15xEPWMCLK)"},
|
||||
{name:"15",displayName: "8/(16xEPWMCLK)"},
|
||||
]
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
var epwmChopperSubmodule = {
|
||||
displayName: "EPWM Chopper",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_PC",
|
||||
description: "Enhanced Pulse Width Modulator Chopper",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmChopperSubmodule;
|
||||
@@ -0,0 +1,258 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
|
||||
function onChangeCMPXShadowLoadMode(inst, ui)
|
||||
{
|
||||
// CMPA
|
||||
if (inst.epwmCounterCompare_enableShadowLoadModeCMPA == true)
|
||||
{
|
||||
ui.epwmCounterCompare_shadowLoadModeCMPA.hidden = false;
|
||||
}
|
||||
else if (inst.epwmCounterCompare_enableShadowLoadModeCMPA == false)
|
||||
{
|
||||
ui.epwmCounterCompare_shadowLoadModeCMPA.hidden = true;
|
||||
inst.epwmCounterCompare_shadowLoadModeCMPA = device_driverlib_peripheral.EPWM_CounterCompareLoadMode[0].name;
|
||||
}
|
||||
|
||||
// CMPB
|
||||
if (inst.epwmCounterCompare_enableShadowLoadModeCMPB == true)
|
||||
{
|
||||
ui.epwmCounterCompare_shadowLoadModeCMPB.hidden = false;
|
||||
}
|
||||
else if (inst.epwmCounterCompare_enableShadowLoadModeCMPB == false)
|
||||
{
|
||||
ui.epwmCounterCompare_shadowLoadModeCMPB.hidden = true;
|
||||
inst.epwmCounterCompare_shadowLoadModeCMPB = device_driverlib_peripheral.EPWM_CounterCompareLoadMode[0].name;
|
||||
}
|
||||
|
||||
// CMPC
|
||||
if (inst.epwmCounterCompare_enableShadowLoadModeCMPC == true)
|
||||
{
|
||||
ui.epwmCounterCompare_shadowLoadModeCMPC.hidden = false;
|
||||
}
|
||||
else if (inst.epwmCounterCompare_enableShadowLoadModeCMPC == false)
|
||||
{
|
||||
ui.epwmCounterCompare_shadowLoadModeCMPC.hidden = true;
|
||||
inst.epwmCounterCompare_shadowLoadModeCMPC = device_driverlib_peripheral.EPWM_CounterCompareLoadMode[0].name;
|
||||
}
|
||||
|
||||
// CMPD
|
||||
if (inst.epwmCounterCompare_enableShadowLoadModeCMPD == true)
|
||||
{
|
||||
ui.epwmCounterCompare_shadowLoadModeCMPD.hidden = false;
|
||||
}
|
||||
else if (inst.epwmCounterCompare_enableShadowLoadModeCMPD == false)
|
||||
{
|
||||
ui.epwmCounterCompare_shadowLoadModeCMPD.hidden = true;
|
||||
inst.epwmCounterCompare_shadowLoadModeCMPD = device_driverlib_peripheral.EPWM_CounterCompareLoadMode[0].name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Array of CAN configurables that are common across device families */
|
||||
var config = [
|
||||
{
|
||||
name: "GROUP_CMPA",
|
||||
displayName: "CMPA",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmCounterCompare_cmpA",
|
||||
displayName : "Counter Compare A (CMPA)",
|
||||
description : 'Counter Compare A (CMPA) value',
|
||||
hidden : false,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_cmpAGld",
|
||||
displayName : "Enable Counter Compare A (CMPA) Global Load",
|
||||
description : 'Use global load configuration for CMPA',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_enableShadowLoadModeCMPA",
|
||||
displayName : "Enable Shadow Counter Compare A (CMPA)",
|
||||
description : 'Enable Shadow Counter Compare A (CMPA) value',
|
||||
hidden : false,
|
||||
default : true,
|
||||
onChange : onChangeCMPXShadowLoadMode
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_shadowLoadModeCMPA",
|
||||
displayName : "Counter Compare A Shadow Load Event",
|
||||
description : 'Counter Compare A Shadow Load Event',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CounterCompareLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CounterCompareLoadMode,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_cmpALink",
|
||||
displayName : "Counter Compare A (CMPA) Link",
|
||||
description : 'Simultaneous write to the current ePWM module CMPA register',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CurrentLink[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CurrentLink,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_CMPB",
|
||||
displayName: "CMPB",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmCounterCompare_cmpB",
|
||||
displayName : "Counter Compare B (CMPB)",
|
||||
description : 'Counter Compare B (CMPB) value',
|
||||
hidden : false,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_cmpBGld",
|
||||
displayName : "Enable Counter Compare B (CMPB) Global Load",
|
||||
description : 'Use global load configuration for CMPB',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_enableShadowLoadModeCMPB",
|
||||
displayName : "Enable Shadow Counter Compare B (CMPB)",
|
||||
description : 'Enable Shadow Counter Compare B (CMPB) value',
|
||||
hidden : false,
|
||||
default : true,
|
||||
onChange : onChangeCMPXShadowLoadMode
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_shadowLoadModeCMPB",
|
||||
displayName : "Counter Compare B Shadow Load Event",
|
||||
description : 'Counter Compare B Shadow Load Event',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CounterCompareLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CounterCompareLoadMode,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_cmpBLink",
|
||||
displayName : "Counter Compare B (CMPB) Link",
|
||||
description : 'Simultaneous write to the current ePWM module CMPB register',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CurrentLink[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CurrentLink,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_CMPC",
|
||||
displayName: "CMPC",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmCounterCompare_cmpC",
|
||||
displayName : "Counter Compare C (CMPC)",
|
||||
description : 'Counter Compare C (CMPC) value',
|
||||
hidden : false,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_cmpCGld",
|
||||
displayName : "Enable Counter Compare C (CMPC) Global Load",
|
||||
description : 'Use global load configuration for CMPC',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_enableShadowLoadModeCMPC",
|
||||
displayName : "Enable Shadow Counter Compare C (CMPC)",
|
||||
description : 'Enable Shadow Counter Compare C (CMPC) value',
|
||||
hidden : false,
|
||||
default : true,
|
||||
onChange : onChangeCMPXShadowLoadMode
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_shadowLoadModeCMPC",
|
||||
displayName : "Counter Compare C Shadow Load Event",
|
||||
description : 'Counter Compare C Shadow Load Event',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CounterCompareLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CounterCompareLoadMode,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_cmpCLink",
|
||||
displayName : "Counter Compare C (CMPC) Link",
|
||||
description : 'Simultaneous write to the current ePWM module CMPC register',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CurrentLink[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CurrentLink,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_CMPD",
|
||||
displayName: "CMPD",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmCounterCompare_cmpD",
|
||||
displayName : "Counter Compare D (CMPD)",
|
||||
description : 'Counter Compare D (CMPD) value',
|
||||
hidden : false,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_cmpDGld",
|
||||
displayName : "Enable Counter Compare D (CMPD) Global Load",
|
||||
description : 'Use global load configuration for CMPD',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_enableShadowLoadModeCMPD",
|
||||
displayName : "Enable Shadow Counter Compare D (CMPD)",
|
||||
description : 'Enable Shadow Counter Compare D (CMPD) value',
|
||||
hidden : false,
|
||||
default : true,
|
||||
onChange : onChangeCMPXShadowLoadMode
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_shadowLoadModeCMPD",
|
||||
displayName : "Counter Compare D Shadow Load Event",
|
||||
description : 'Counter Compare D Shadow Load Event',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CounterCompareLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CounterCompareLoadMode,
|
||||
},
|
||||
{
|
||||
name: "epwmCounterCompare_cmpDLink",
|
||||
displayName : "Counter Compare D (CMPD) Link",
|
||||
description : 'Simultaneous write to the current ePWM module CMPD register',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CurrentLink[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CurrentLink,
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
|
||||
var epwmCCSubmodule = {
|
||||
displayName: "EPWM Counter Compare",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_CC",
|
||||
description: "Enhanced Pulse Width Modulator Counter Compare",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmCCSubmodule;
|
||||
@@ -0,0 +1,386 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
|
||||
function onChangeDeadbandMode(inst, ui, mode)
|
||||
{
|
||||
if (mode == "AH")
|
||||
{
|
||||
inst.epwmDeadband_inputRED = "EPWM_DB_INPUT_EPWMA";
|
||||
inst.epwmDeadband_inputFED = "EPWM_DB_INPUT_EPWMA";
|
||||
|
||||
inst.epwmDeadband_polarityRED = "EPWM_DB_POLARITY_ACTIVE_HIGH";
|
||||
inst.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_HIGH";
|
||||
|
||||
inst.epwmDeadband_enableRED = true;
|
||||
inst.epwmDeadband_enableFED = true;
|
||||
|
||||
inst.epwmDeadband_outputSwapOutA = false;
|
||||
inst.epwmDeadband_outputSwapOutB = false;
|
||||
}
|
||||
else if (mode == "AL")
|
||||
{
|
||||
inst.epwmDeadband_inputRED = "EPWM_DB_INPUT_EPWMA";
|
||||
inst.epwmDeadband_inputFED = "EPWM_DB_INPUT_EPWMA";
|
||||
|
||||
inst.epwmDeadband_polarityRED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
inst.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
|
||||
inst.epwmDeadband_enableRED = true;
|
||||
inst.epwmDeadband_enableFED = true;
|
||||
|
||||
inst.epwmDeadband_outputSwapOutA = false;
|
||||
inst.epwmDeadband_outputSwapOutB = false;
|
||||
|
||||
}
|
||||
else if (mode == "AHC")
|
||||
{
|
||||
inst.epwmDeadband_inputRED = "EPWM_DB_INPUT_EPWMA";
|
||||
inst.epwmDeadband_inputFED = "EPWM_DB_INPUT_EPWMA";
|
||||
|
||||
inst.epwmDeadband_polarityRED = "EPWM_DB_POLARITY_ACTIVE_HIGH";
|
||||
inst.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
|
||||
inst.epwmDeadband_enableRED = true;
|
||||
inst.epwmDeadband_enableFED = true;
|
||||
|
||||
inst.epwmDeadband_outputSwapOutA = false;
|
||||
inst.epwmDeadband_outputSwapOutB = false;
|
||||
}
|
||||
else if (mode == "ALC")
|
||||
{
|
||||
inst.epwmDeadband_inputRED = "EPWM_DB_INPUT_EPWMA";
|
||||
inst.epwmDeadband_inputFED = "EPWM_DB_INPUT_EPWMA";
|
||||
|
||||
inst.epwmDeadband_polarityRED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
inst.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_HIGH";
|
||||
|
||||
inst.epwmDeadband_enableRED = true;
|
||||
inst.epwmDeadband_enableFED = true;
|
||||
|
||||
inst.epwmDeadband_outputSwapOutA = false;
|
||||
inst.epwmDeadband_outputSwapOutB = false;
|
||||
}
|
||||
else if (mode == "DUAL")
|
||||
{
|
||||
inst.epwmDeadband_inputRED = "EPWM_DB_INPUT_EPWMB";
|
||||
inst.epwmDeadband_inputFED = "EPWM_DB_INPUT_DB_RED";
|
||||
|
||||
inst.epwmDeadband_polarityRED = "EPWM_DB_POLARITY_ACTIVE_HIGH";
|
||||
inst.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_HIGH";
|
||||
|
||||
inst.epwmDeadband_enableRED = false;
|
||||
inst.epwmDeadband_enableFED = true;
|
||||
|
||||
inst.epwmDeadband_outputSwapOutA = false;
|
||||
inst.epwmDeadband_outputSwapOutB = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeEnableDelays(inst, ui)
|
||||
{
|
||||
// if (inst.epwmDeadband_enableRED == true)
|
||||
// {
|
||||
// ui.epwmDeadband_delayRED.hidden = false;
|
||||
// }
|
||||
// else if (inst.epwmDeadband_enableRED == false)
|
||||
// {
|
||||
// ui.epwmDeadband_delayRED.hidden = true;
|
||||
// inst.epwmDeadband_delayRED = 0;// Set to default
|
||||
// }
|
||||
// if (inst.epwmDeadband_enableFED == true)
|
||||
// {
|
||||
// ui.epwmDeadband_delayFED.hidden = false;
|
||||
// }
|
||||
// else if (inst.epwmDeadband_enableFED == false)
|
||||
// {
|
||||
// ui.epwmDeadband_delayFED.hidden = true;
|
||||
// inst.epwmDeadband_delayFED = 0; // Set to default
|
||||
// }
|
||||
}
|
||||
|
||||
function onChangeShadowModes(inst, ui)
|
||||
{
|
||||
if (!inst["epwmDeadband_controlShadowMode"])
|
||||
{
|
||||
ui["epwmDeadband_controlShadowLoadEvent"].hidden = true;
|
||||
inst.epwmDeadband_controlShadowLoadEvent= device_driverlib_peripheral.EPWM_DeadBandControlLoadMode[0].name;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui["epwmDeadband_controlShadowLoadEvent"].hidden = false;
|
||||
}
|
||||
if (!inst["epwmDeadband_redShadowMode"])
|
||||
{
|
||||
ui["epwmDeadband_redShadowLoadEvent"].hidden = true;
|
||||
inst.epwmDeadband_redShadowLoadEvent = device_driverlib_peripheral.EPWM_RisingEdgeDelayLoadMode[0].name
|
||||
}
|
||||
else
|
||||
{
|
||||
ui["epwmDeadband_redShadowLoadEvent"].hidden = false;
|
||||
}
|
||||
if (!inst["epwmDeadband_fedShadowMode"])
|
||||
{
|
||||
ui["epwmDeadband_fedShadowLoadEvent"].hidden = true;
|
||||
inst.epwmDeadband_fedShadowLoadEvent = device_driverlib_peripheral.EPWM_FallingEdgeDelayLoadMode[0].name
|
||||
}
|
||||
else
|
||||
{
|
||||
ui["epwmDeadband_fedShadowLoadEvent"].hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Array of configurables that are common across device families */
|
||||
var config = [
|
||||
{
|
||||
name: "GROUP_DEADBAND_MODE",
|
||||
displayName : "Common Dead-Band Modes",
|
||||
description : 'Mode for the Dead-Band Submodule',
|
||||
config : [
|
||||
{
|
||||
name: "AH",
|
||||
displayName: "Active High",
|
||||
description : '',
|
||||
buttonText: "Setup the Dead-Band Module",
|
||||
onComplete: (inst, ui, result) => {
|
||||
onChangeDeadbandMode(inst, ui, "AH")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "AL",
|
||||
displayName: "Active Low",
|
||||
description : '',
|
||||
buttonText: "Setup the Dead-Band Module",
|
||||
onComplete: (inst, ui, result) => {
|
||||
onChangeDeadbandMode(inst, ui, "AL")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "AHC",
|
||||
displayName: "Active High Complementary",
|
||||
description : '',
|
||||
buttonText: "Setup the Dead-Band Module",
|
||||
onComplete: (inst, ui, result) => {
|
||||
onChangeDeadbandMode(inst, ui, "AHC")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ALC",
|
||||
displayName: "Active Low Complementary",
|
||||
description : '',
|
||||
buttonText: "Setup the Dead-Band Module",
|
||||
onComplete: (inst, ui, result) => {
|
||||
onChangeDeadbandMode(inst, ui, "ALC")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DUAL",
|
||||
displayName: "Dual Edge Delay Mode",
|
||||
description : '',
|
||||
buttonText: "Setup the Dead-Band Module",
|
||||
onComplete: (inst, ui, result) => {
|
||||
onChangeDeadbandMode(inst, ui, "DUAL")
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_inputRED",
|
||||
displayName : "Rising Edge Delay Input",
|
||||
description : 'Select the source for DBRED (Rising Edge Delay)',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DB_INPUT[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DB_INPUT.slice(0,2)
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_inputFED",
|
||||
displayName : "Falling Edge Delay Input",
|
||||
description : 'Select the source for DBFED (Falling Edge Delay)',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DB_INPUT[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DB_INPUT
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmDeadband_polarityRED",
|
||||
displayName : "Rising Edge Delay Polarity",
|
||||
description : 'Whether or not to invert RED (Rising Edge Delay)',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DeadBandPolarity[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DeadBandPolarity
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmDeadband_polarityFED",
|
||||
displayName : "Falling Edge Delay Polarity",
|
||||
description : 'Whether or not to invert FED (Falling Edge Delay)',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DeadBandPolarity[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DeadBandPolarity
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmDeadband_enableRED",
|
||||
displayName : "Enable Rising Edge Delay",
|
||||
description : 'Enable DBRED (Rising Edge Delay) by choosing it as the source for the A path',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEnableDelays
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_redShadowLoadEvent",
|
||||
displayName : "RED Shadow Load Event",
|
||||
description : 'Shadow to active load event for the RED (Rising Edge Delay) register.',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_RisingEdgeDelayLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_RisingEdgeDelayLoadMode
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_redShadowMode",
|
||||
displayName : "Enable RED Shadow Mode",
|
||||
description : 'Enable shadowing of the RED (Rising Edge Delay) register.',
|
||||
hidden : false,
|
||||
default : false,
|
||||
//onChange : onChangeShadowModes,
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmDeadband_delayRED",
|
||||
displayName : "Rising Edge Delay Value",
|
||||
description : 'DBRED (Rising Edge Delay) delay value',
|
||||
hidden : false,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_enableFED",
|
||||
displayName : "Enable Falling Edge Delay",
|
||||
description : 'Enable DBFED (Falling Edge Delay) by choosing it as the source for the B path',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEnableDelays
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_fedShadowLoadEvent",
|
||||
displayName : "FED Shadow Load Event",
|
||||
description : 'Shadow to active load event for the FED (Falling Edge Delay) register.',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_FallingEdgeDelayLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_FallingEdgeDelayLoadMode
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_fedShadowMode",
|
||||
displayName : "Enable FED Shadow Mode",
|
||||
description : 'Enable shadowing of the FED (Falling Edge Delay) register.',
|
||||
hidden : false,
|
||||
default : false,
|
||||
//onChange : onChangeShadowModes,
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmDeadband_delayFED",
|
||||
displayName : "Falling Edge Delay Value",
|
||||
description : 'DBFED (Falling Edge Delay) delay value',
|
||||
hidden : false,
|
||||
default : 0,
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmDeadband_outputSwapOutA",
|
||||
displayName : "Swap Output for EPWMxA",
|
||||
description : 'Check to enable output swap. Channel A path to Out B.',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_outputSwapOutB",
|
||||
displayName : "Swap Output for EPWMxB",
|
||||
description : 'Check to enable output swap. Channel B path to Out A.',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_dbControlGld",
|
||||
displayName : "Enable Deadband Control Global Load",
|
||||
description : 'Use global load configuration for deadband control',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_controlShadowLoadEvent",
|
||||
displayName : "Deadband Control Shadow Load Event",
|
||||
description : 'Shadow to active load event for the DBCTL (Deadband Control) register.',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DeadBandControlLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DeadBandControlLoadMode
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_controlShadowMode",
|
||||
displayName : "Enable Deadband Control Shadow Mode",
|
||||
description : 'Enable shadowing of the DBCTL (Deadband Control) register.',
|
||||
hidden : true,
|
||||
default : false,
|
||||
//onChange : onChangeShadowModes,
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_redGld",
|
||||
displayName : "Enable RED Global Load",
|
||||
description : 'Use global load configuration for RED',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_fedGld",
|
||||
displayName : "Enable FED Global Load",
|
||||
description : 'Use global load configuration for FED',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_deadbandCounterClockRate",
|
||||
displayName : "Dead Band Counter Clock Rate",
|
||||
description : 'Dead band counter clock rate.',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DeadBandClockMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DeadBandClockMode
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
if(["F28P65x"].includes(Common.getDeviceName()))
|
||||
{
|
||||
config = config.concat(
|
||||
{
|
||||
name: "epwmDeadband_deadbandFallingEdgeDelayLink",
|
||||
displayName : "Dead Band Rising Edge Delay Link",
|
||||
description : 'Simultaneous write to the current ePWM module DBRED register',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CurrentLink[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CurrentLink
|
||||
},
|
||||
{
|
||||
name: "epwmDeadband_deadbandRisingEdgeDelayLink",
|
||||
displayName : "Dead Band Falling Edge Delay Link",
|
||||
description : 'Simultaneous write to the current ePWM module DBFED register',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CurrentLink[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CurrentLink
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
var epwmDeadbandSubmodule = {
|
||||
displayName: "EPWM Dead-Band",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_DB",
|
||||
description: "Enhanced Pulse Width Modulator Dead-Band",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmDeadbandSubmodule;
|
||||
@@ -0,0 +1,745 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
var DCCompareTypeConfigNames_CombinationNames = []
|
||||
var DCAConfigs = [];
|
||||
var DCBConfigs = [];
|
||||
|
||||
function onChangeEventDetection(inst, ui)
|
||||
{
|
||||
if(inst.epwmDigitalCompare_enableEventDetection)
|
||||
{
|
||||
ui.epwmDigitalCompare_CAPGATETripInput.hidden = false;
|
||||
ui.epwmDigitalCompare_CAPGATE_combinationInputConfig.hidden = false;
|
||||
ui.epwmDigitalCompare_configCAPGATE.hidden = false;
|
||||
ui.epwmDigitalCompare_CAPINTripInput.hidden = false;
|
||||
ui.epwmDigitalCompare_CAPIN_combinationInputConfig.hidden = false;
|
||||
ui.epwmDigitalCompare_invertCAPIN.hidden = false;
|
||||
ui.epwmXCMP_setRegisters_XMIN_read.hidden = false;
|
||||
ui.epwmXCMP_setShadowRegisters1_XMIN_read.hidden = false;
|
||||
ui.epwmXCMP_setShadowRegisters2_XMIN_read.hidden = false;
|
||||
ui.epwmXCMP_setShadowRegisters3_XMIN_read.hidden = false;
|
||||
ui.epwmXCMP_setRegisters_XMAX_read.hidden = false;
|
||||
ui.epwmXCMP_setShadowRegisters1_XMAX_read.hidden = false;
|
||||
ui.epwmXCMP_setShadowRegisters2_XMAX_read.hidden = false;
|
||||
ui.epwmXCMP_setShadowRegisters3_XMAX_read.hidden = false;
|
||||
|
||||
|
||||
}else
|
||||
{
|
||||
ui.epwmDigitalCompare_CAPGATETripInput.hidden = true;
|
||||
ui.epwmDigitalCompare_CAPGATE_combinationInputConfig.hidden = true;
|
||||
ui.epwmDigitalCompare_configCAPGATE.hidden = true;
|
||||
ui.epwmDigitalCompare_CAPINTripInput.hidden = true;
|
||||
ui.epwmDigitalCompare_CAPIN_combinationInputConfig.hidden = true;
|
||||
ui.epwmDigitalCompare_invertCAPIN.hidden = true;
|
||||
ui.epwmXCMP_setRegisters_XMIN_read.hidden = true;
|
||||
ui.epwmXCMP_setRegisters_XMIN_read.hidden = true;
|
||||
ui.epwmXCMP_setShadowRegisters1_XMIN_read.hidden = true;
|
||||
ui.epwmXCMP_setShadowRegisters2_XMIN_read.hidden = true;
|
||||
ui.epwmXCMP_setShadowRegisters3_XMIN_read.hidden = true;
|
||||
ui.epwmXCMP_setRegisters_XMAX_read.hidden = true;
|
||||
ui.epwmXCMP_setShadowRegisters1_XMAX_read.hidden = true;
|
||||
ui.epwmXCMP_setShadowRegisters2_XMAX_read.hidden = true;
|
||||
ui.epwmXCMP_setShadowRegisters3_XMAX_read.hidden = true;
|
||||
|
||||
inst.epwmDigitalCompare_CAPGATETripInput = device_driverlib_peripheral.EPWM_DigitalCompareTripInput[0].name;
|
||||
inst.epwmDigitalCompare_CAPGATE_combinationInputConfig = [];
|
||||
inst.epwmDigitalCompare_configCAPGATE = device_driverlib_peripheral.EPWM_selectCaptureGateInputPolarity[0].name;
|
||||
inst.epwmDigitalCompare_CAPINTripInput = device_driverlib_peripheral.EPWM_DigitalCompareTripInput[0].name;
|
||||
inst.epwmDigitalCompare_CAPIN_combinationInputConfig = [];
|
||||
inst.epwmDigitalCompare_invertCAPIN = "EPWM_CAPTURE_INPUT_CAPIN_SYNC";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function pulseSelChanged(inst, ui)
|
||||
{
|
||||
inst.epwmDigitalCompare_dCCounterCapturePulse = inst.epwmDigitalCompare_blankingWindowEvent;
|
||||
}
|
||||
|
||||
function onChangeDCCounterCapture(inst, ui)
|
||||
{
|
||||
if (inst.epwmDigitalCompare_useDCCounterCapture == true)
|
||||
{
|
||||
ui.epwmDigitalCompare_dCCounterCaptureShadow.hidden = false;
|
||||
ui.epwmDigitalCompare_dCCounterCapturePulse.hidden = false;
|
||||
if(["F28P65x"].includes(Common.getDeviceName())){
|
||||
ui.epwmDigitalCompare_dCCounterCapturePulseLogic.hidden = false;
|
||||
}
|
||||
}
|
||||
else if (inst.epwmDigitalCompare_useDCCounterCapture == false)
|
||||
{
|
||||
ui.epwmDigitalCompare_dCCounterCaptureShadow.hidden = true;
|
||||
ui.epwmDigitalCompare_dCCounterCapturePulse.hidden = true;
|
||||
ui.epwmDigitalCompare_dCCounterCapturePulseLogic.hidden = true;
|
||||
// Set to defaults
|
||||
inst.epwmDigitalCompare_dCCounterCaptureShadow = false;
|
||||
inst.epwmDigitalCompare_dCCounterCapturePulseLogic = false;
|
||||
inst.epwmDigitalCompare_dCCounterCapturePulse = device_driverlib_peripheral.EPWM_DigitalCompareBlankingPulse[0].name;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeBlankingWindow(inst, ui)
|
||||
{
|
||||
if (inst.epwmDigitalCompare_useBlankingWindow == true)
|
||||
{
|
||||
ui.epwmDigitalCompare_blankingWindowEvent.hidden = false;
|
||||
ui.epwmDigitalCompare_blankingWindowOffset.hidden = false;
|
||||
ui.epwmDigitalCompare_blankingWindowLength.hidden = false;
|
||||
ui.epwmDigitalCompare_invertBlankingWindow.hidden = false;
|
||||
}
|
||||
else if (inst.epwmDigitalCompare_useBlankingWindow == false)
|
||||
{
|
||||
ui.epwmDigitalCompare_blankingWindowEvent.hidden = true;
|
||||
ui.epwmDigitalCompare_blankingWindowOffset.hidden = true;
|
||||
ui.epwmDigitalCompare_blankingWindowLength.hidden = true;
|
||||
ui.epwmDigitalCompare_invertBlankingWindow.hidden = true;
|
||||
// Set everything to its default state
|
||||
inst.epwmDigitalCompare_blankingWindowEvent = device_driverlib_peripheral.EPWM_DigitalCompareBlankingPulse[0].name;
|
||||
inst.epwmDigitalCompare_blankingWindowOffset = 0;
|
||||
inst.epwmDigitalCompare_blankingWindowLength= 0;
|
||||
inst.epwmDigitalCompare_invertBlankingWindow = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeEdgeFilter(inst, ui)
|
||||
{
|
||||
if (inst.epwmDigitalCompare_useEdgeFilter == true)
|
||||
{
|
||||
ui.epwmDigitalCompare_edgeFilterMode.hidden = false;
|
||||
ui.epwmDigitalCompare_valleyCaptureSource.hidden = false;
|
||||
ui.epwmDigitalCompare_edgeFilterEdgeCount.hidden = false;
|
||||
ui.epwmDigitalCompare_enableValleyCapture.hidden = false;
|
||||
ui.epwmDigitalCompare_startValleyCapture.hidden = false;
|
||||
ui.epwmDigitalCompare_startValleyCaptureTriggerCount.hidden = false;
|
||||
ui.epwmDigitalCompare_stopValleyCaptureTriggerCount.hidden = false;
|
||||
ui.epwmDigitalCompare_enableEdgeFilterDelay.hidden = false;
|
||||
ui.epwmDigitalCompare_SWVDELVAL.hidden = false;
|
||||
ui.epwmDigitalCompare_valleyDelayDivider.hidden = false;
|
||||
|
||||
if (inst.epwmDigitalCompare_enableValleyCapture == true){
|
||||
ui.epwmDigitalCompare_valleyCaptureSource.hidden = false;
|
||||
if (inst.epwmDigitalCompare_valleyCaptureSource == device_driverlib_peripheral.EPWM_ValleyTriggerSource[0].name)
|
||||
{
|
||||
ui.epwmDigitalCompare_startValleyCapture.hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.epwmDigitalCompare_startValleyCapture.hidden = true;
|
||||
}
|
||||
ui.epwmDigitalCompare_startValleyCaptureTriggerCount.hidden = false;
|
||||
ui.epwmDigitalCompare_stopValleyCaptureTriggerCount.hidden = false;
|
||||
}
|
||||
else if (inst.epwmDigitalCompare_enableValleyCapture == false)
|
||||
{
|
||||
ui.epwmDigitalCompare_valleyCaptureSource.hidden = true;
|
||||
ui.epwmDigitalCompare_startValleyCapture.hidden = true;
|
||||
ui.epwmDigitalCompare_startValleyCaptureTriggerCount.hidden = true;
|
||||
ui.epwmDigitalCompare_stopValleyCaptureTriggerCount.hidden = true;
|
||||
// Set everything to its defaults
|
||||
inst.epwmDigitalCompare_valleyCaptureSource = device_driverlib_peripheral.EPWM_ValleyTriggerSource[0].name;
|
||||
inst.epwmDigitalCompare_startValleyCapture = false;
|
||||
inst.epwmDigitalCompare_startValleyCaptureTriggerCount = "0";
|
||||
inst.epwmDigitalCompare_stopValleyCaptureTriggerCount = "0";
|
||||
}
|
||||
|
||||
if (inst.epwmDigitalCompare_enableEdgeFilterDelay == true)
|
||||
{
|
||||
ui.epwmDigitalCompare_SWVDELVAL.hidden = false;
|
||||
ui.epwmDigitalCompare_valleyDelayDivider.hidden = false;
|
||||
}
|
||||
else if (inst.epwmDigitalCompare_enableEdgeFilterDelay == false)
|
||||
{
|
||||
ui.epwmDigitalCompare_SWVDELVAL.hidden = true;
|
||||
ui.epwmDigitalCompare_valleyDelayDivider.hidden = true;
|
||||
// Set to defaults
|
||||
inst.epwmDigitalCompare_SWVDELVAL= 0;
|
||||
inst.epwmDigitalCompare_valleyDelayDivider = device_driverlib_peripheral.EPWM_ValleyDelayMode[0].name;
|
||||
}
|
||||
}
|
||||
else if (inst.epwmDigitalCompare_useEdgeFilter == false)
|
||||
{
|
||||
ui.epwmDigitalCompare_edgeFilterMode.hidden = true;
|
||||
ui.epwmDigitalCompare_valleyCaptureSource.hidden = true;
|
||||
ui.epwmDigitalCompare_edgeFilterEdgeCount.hidden = true;
|
||||
ui.epwmDigitalCompare_enableValleyCapture.hidden = true;
|
||||
ui.epwmDigitalCompare_startValleyCapture.hidden = true;
|
||||
ui.epwmDigitalCompare_startValleyCaptureTriggerCount.hidden = true;
|
||||
ui.epwmDigitalCompare_stopValleyCaptureTriggerCount.hidden = true;
|
||||
ui.epwmDigitalCompare_enableEdgeFilterDelay.hidden = true;
|
||||
ui.epwmDigitalCompare_SWVDELVAL.hidden = true;
|
||||
ui.epwmDigitalCompare_valleyDelayDivider.hidden = true;
|
||||
|
||||
// Set everything to its default state
|
||||
inst.epwmDigitalCompare_edgeFilterMode = device_driverlib_peripheral.EPWM_DigitalCompareEdgeFilterMode[0].name;
|
||||
inst.epwmDigitalCompare_valleyCaptureSource = device_driverlib_peripheral.EPWM_ValleyTriggerSource[0].name;
|
||||
inst.epwmDigitalCompare_edgeFilterEdgeCount = "EPWM_DC_EDGEFILT_EDGECNT_0";
|
||||
inst.epwmDigitalCompare_enableValleyCapture = false;
|
||||
inst.epwmDigitalCompare_startValleyCapture = false;
|
||||
inst.epwmDigitalCompare_startValleyCaptureTriggerCount = "0";
|
||||
inst.epwmDigitalCompare_stopValleyCaptureTriggerCount = "0";
|
||||
inst.epwmDigitalCompare_enableEdgeFilterDelay = false;
|
||||
inst.epwmDigitalCompare_SWVDELVAL = 0;
|
||||
inst.epwmDigitalCompare_valleyDelayDivider = device_driverlib_peripheral.EPWM_ValleyDelayMode[0].name;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeComboInputs (inst, ui)
|
||||
{
|
||||
for (var dcCompareTypeIndex in device_driverlib_peripheral.EPWM_DigitalCompareType)
|
||||
{
|
||||
var dcCompareType = device_driverlib_peripheral.EPWM_DigitalCompareType[dcCompareTypeIndex];
|
||||
if (inst["epwmDigitalCompare_" + dcCompareType.name] == "EPWM_DC_TRIP_COMBINATION")
|
||||
{
|
||||
ui["epwmDigitalCompare_" + dcCompareType.name + "_combinationInputConfig"].hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui["epwmDigitalCompare_" + dcCompareType.name + "_combinationInputConfig"].hidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var dcCompareTypeIndex in device_driverlib_peripheral.EPWM_DigitalCompareType)
|
||||
{
|
||||
var dcCompareType = device_driverlib_peripheral.EPWM_DigitalCompareType[dcCompareTypeIndex];
|
||||
|
||||
var dcCompareTypeConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareType.name,
|
||||
displayName : dcCompareType.displayName,
|
||||
description : "Trip input to the " + dcCompareType.displayName,
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareTripInput[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareTripInput,
|
||||
//onChange : onChangeComboInputs,
|
||||
};
|
||||
|
||||
|
||||
var dcCombinationConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareType.name + "_combinationInputConfig",
|
||||
displayName : "Combination Input Sources (" + dcCompareType.displayName + ")",
|
||||
description : "Select the sources to include in the Combination input sources",
|
||||
hidden : false,
|
||||
minSelections: 0,
|
||||
default : [],
|
||||
options : device_driverlib_peripheral.EPWM_DC_COMBINATIONAL
|
||||
};
|
||||
|
||||
DCCompareTypeConfigNames_CombinationNames.push(
|
||||
{
|
||||
CompareTypeName : dcCompareTypeConfig.name,
|
||||
CombinationName : dcCombinationConfig.name
|
||||
}
|
||||
);
|
||||
|
||||
if (dcCompareType.name.indexOf("DCA") != -1)
|
||||
{
|
||||
DCAConfigs.push(dcCompareTypeConfig);
|
||||
DCAConfigs.push(dcCombinationConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
DCBConfigs.push(dcCompareTypeConfig);
|
||||
DCBConfigs.push(dcCombinationConfig);
|
||||
}
|
||||
}
|
||||
|
||||
for (var dcCompareOutputIndex in device_driverlib_peripheral.EPWM_TripZoneDigitalCompareOutput)
|
||||
{
|
||||
var dcCompareOutput = device_driverlib_peripheral.EPWM_TripZoneDigitalCompareOutput[dcCompareOutputIndex];
|
||||
|
||||
var dcCompareOutputConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareOutput.name,
|
||||
displayName : "Condition For " + dcCompareOutput.displayName,
|
||||
description : "Select the Condition for " + dcCompareOutput.displayName + " for which the EVENT is generated.",
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_TripZoneDigitalCompareOutputEvent[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_TripZoneDigitalCompareOutputEvent,
|
||||
}
|
||||
|
||||
if (dcCompareOutput.name.indexOf("OUTPUT_A") != -1)
|
||||
{
|
||||
DCAConfigs.push(dcCompareOutputConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
DCBConfigs.push(dcCompareOutputConfig);
|
||||
}
|
||||
}
|
||||
|
||||
for (var dcCompareModuleIndex in device_driverlib_peripheral.EPWM_DigitalCompareModule)
|
||||
{
|
||||
for (var dcCompareEventIndex in device_driverlib_peripheral.EPWM_DigitalCompareEvent)
|
||||
{
|
||||
var dcCompareModule = device_driverlib_peripheral.EPWM_DigitalCompareModule[dcCompareModuleIndex];
|
||||
var dcCompareEvent = device_driverlib_peripheral.EPWM_DigitalCompareEvent[dcCompareEventIndex];
|
||||
|
||||
var dcxevty = "DC" + dcCompareModule.name.replace("EPWM_DC_MODULE_","") + "EVT" + dcCompareEvent.name.replace("EPWM_DC_EVENT_","")
|
||||
|
||||
var dcCompareEventSyncConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareModule.name + "_" + dcCompareEvent.name + "_eventSync",
|
||||
displayName : "Synch Mode (" + dcxevty + ")",
|
||||
description : "Select the Sync Mode for " + dcCompareModule.displayName + " " + dcCompareEvent.displayName,
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareSyncMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareSyncMode,
|
||||
}
|
||||
|
||||
var dcCompareEventSourceConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareModule.name + "_" + dcCompareEvent.name + "_eventSource",
|
||||
displayName : "Signal Source (" + dcxevty + ")",
|
||||
description : "Select the Signal Source for " + dcCompareModule.displayName + " " + dcCompareEvent.displayName,
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareEventSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareEventSource,
|
||||
}
|
||||
|
||||
var dcCompareEventCBCLatchModeConfig = null;
|
||||
var dcCompareEventCBCLatchClearEventConfig = null;
|
||||
|
||||
if (!["F2807x", "F2837xD", "F2837xS", "F28004x"].includes(Common.getDeviceName()))
|
||||
{
|
||||
dcCompareEventCBCLatchModeConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareModule.name + "_" + dcCompareEvent.name + "_latchMode",
|
||||
displayName : "CBC Latch Mode (" + dcxevty + ")",
|
||||
description : "Select the CBC latch mode for " + dcCompareModule.displayName + " " + dcCompareEvent.displayName,
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareCBCLatchMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareCBCLatchMode,
|
||||
}
|
||||
|
||||
dcCompareEventCBCLatchClearEventConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareModule.name + "_" + dcCompareEvent.name + "_latchClearEvent",
|
||||
displayName : "CBC Latch Clear Event (" + dcxevty + ")",
|
||||
description : "Select the CBC latch clear event for " + dcCompareModule.displayName + " " + dcCompareEvent.displayName,
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareCBCLatchClearEvent[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareCBCLatchClearEvent,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (dcCompareEvent.name == "EPWM_DC_EVENT_1")
|
||||
{
|
||||
var dcCompareGenerateADCTriggerConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareModule.name + "_" + dcCompareEvent.name + "_adcTrig",
|
||||
displayName : "Generate ADC SOC (" + dcxevty + ")",
|
||||
description : "Enable/disable generation of ADC SOC Event for " + dcCompareModule.displayName + " " + dcCompareEvent.displayName,
|
||||
hidden : false,
|
||||
default : false,
|
||||
}
|
||||
|
||||
var dcCompareGenerateSyncTriggerConfig = {
|
||||
name: "epwmDigitalCompare_" + dcCompareModule.name + "_" + dcCompareEvent.name + "_syncTrig",
|
||||
displayName : "Generate SYNCOUT (" + dcxevty + ")",
|
||||
description : "Enable/disable generation of SYNCOUTEvent for " + dcCompareModule.displayName + " " + dcCompareEvent.displayName,
|
||||
hidden : false,
|
||||
default : false,
|
||||
}
|
||||
|
||||
if (dcCompareModule.name.indexOf("MODULE_A") != -1)
|
||||
{
|
||||
DCAConfigs.push(dcCompareGenerateADCTriggerConfig);
|
||||
DCAConfigs.push(dcCompareGenerateSyncTriggerConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
DCBConfigs.push(dcCompareGenerateADCTriggerConfig);
|
||||
DCBConfigs.push(dcCompareGenerateSyncTriggerConfig);
|
||||
}
|
||||
}
|
||||
|
||||
if (dcCompareModule.name.indexOf("MODULE_A") != -1)
|
||||
{
|
||||
DCAConfigs.push(dcCompareEventSyncConfig);
|
||||
DCAConfigs.push(dcCompareEventSourceConfig);
|
||||
if (dcCompareEventCBCLatchModeConfig){
|
||||
DCAConfigs.push(dcCompareEventCBCLatchModeConfig);
|
||||
DCAConfigs.push(dcCompareEventCBCLatchClearEventConfig);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DCBConfigs.push(dcCompareEventSyncConfig);
|
||||
DCBConfigs.push(dcCompareEventSourceConfig);
|
||||
if (dcCompareEventCBCLatchModeConfig){
|
||||
DCBConfigs.push(dcCompareEventCBCLatchModeConfig);
|
||||
DCBConfigs.push(dcCompareEventCBCLatchClearEventConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var config = [
|
||||
{
|
||||
name: "GROUP_DCA",
|
||||
displayName: "DCAEVT1 and DCAEVT2",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: DCAConfigs
|
||||
},
|
||||
{
|
||||
name: "GROUP_DCB",
|
||||
displayName: "DCBEVT1 and DCBEVT2",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: DCBConfigs
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_dcFilterInput",
|
||||
displayName : "Digital Compare Filter Input (DCEVTFILT event source)",
|
||||
description : 'Select the event source for the DCEVTFILT signal',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareFilterInput[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareFilterInput,
|
||||
},
|
||||
|
||||
// Blanking window
|
||||
{
|
||||
name: "epwmDigitalCompare_useBlankingWindow",
|
||||
displayName : "Use Blanking Window",
|
||||
description : 'Use blanking window to blank the DCEVTFILT signal',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeBlankingWindow
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_blankingWindowEvent",
|
||||
displayName : "Blanking Window Start Event",
|
||||
description : 'Select the event source that starts the blanking window counter (And resets the counter)',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareBlankingPulse[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareBlankingPulse,
|
||||
onChange : pulseSelChanged
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_blankingWindowOffset",
|
||||
displayName : "Blanking Window Offset from the Start Event",
|
||||
description : 'Set the offset of the blanking window (TBCLK count)',
|
||||
hidden : true,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_blankingWindowLength",
|
||||
displayName : "Blanking Window Length",
|
||||
description : 'Set the length of the blanking window (TBCLK count)',
|
||||
hidden : true,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_invertBlankingWindow",
|
||||
displayName : "Invert Blanking Window",
|
||||
description : 'Invert the blanking window signal',
|
||||
hidden : true,
|
||||
default : false
|
||||
},
|
||||
|
||||
// DCCAP
|
||||
|
||||
{
|
||||
name: "epwmDigitalCompare_useDCCounterCapture",
|
||||
displayName : "Use DC Counter Capture",
|
||||
description : 'Use the DC Counter Capture feature to capture the TBCTR value at the selected event.',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeDCCounterCapture
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_dCCounterCaptureShadow",
|
||||
displayName : "Enable DC Counter Capture Shadow Mode",
|
||||
description : 'Use the DC Counter Capture feature in shadow mode.',
|
||||
hidden : true,
|
||||
default : false
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_dCCounterCapturePulse",
|
||||
displayName : "DC Counter Capture Re-Enable Event\\Shadow Load Event (Blanking Window Start Event)",
|
||||
description : 'This is detemined by the Blanking Window Start Event and re-enables the TBCTR capture.',
|
||||
hidden : true,
|
||||
readOnly : true,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareBlankingPulse[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareBlankingPulse,
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_dCCounterCapturePulseLogic",
|
||||
displayName : "DC Counter Capture Independent Pulse Selection",
|
||||
description : 'Pulse Selection between digital compare capture or digital compare blanking signal',
|
||||
hidden : true,
|
||||
default : false,
|
||||
},
|
||||
|
||||
|
||||
// Edge Filter Valley Switching
|
||||
{
|
||||
name: "epwmDigitalCompare_useEdgeFilter",
|
||||
displayName : "Use Edge Filter",
|
||||
description : 'The DCEVTFILT signal and DCCAP (Counter Capture) will use the output of the edge filter',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEdgeFilter
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_edgeFilterMode",
|
||||
displayName : "Edge Filter Mode",
|
||||
description : 'Sets the Digital Compare Event edge filter mode',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareEdgeFilterMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareEdgeFilterMode,
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmDigitalCompare_edgeFilterEdgeCount",
|
||||
displayName : "Edge Filter Edge Count",
|
||||
description : 'Sets the number of edges detected by the Digital Compare Event edge filter to generate an event',
|
||||
hidden : true,
|
||||
default : "EPWM_DC_EDGEFILT_EDGECNT_0",
|
||||
options : [
|
||||
{ name: "EPWM_DC_EDGEFILT_EDGECNT_0", displayName: "No edge is required to generate event"},
|
||||
{ name: "EPWM_DC_EDGEFILT_EDGECNT_1", displayName: "1 edge is required for event generation" },
|
||||
{ name: "EPWM_DC_EDGEFILT_EDGECNT_2", displayName: "2 edges are required for event generation" },
|
||||
{ name: "EPWM_DC_EDGEFILT_EDGECNT_3", displayName: "3 edges are required for event generation" },
|
||||
{ name: "EPWM_DC_EDGEFILT_EDGECNT_4", displayName: "4 edges are required for event generation" },
|
||||
{ name: "EPWM_DC_EDGEFILT_EDGECNT_5", displayName: "5 edges are required for event generation" },
|
||||
{ name: "EPWM_DC_EDGEFILT_EDGECNT_6", displayName: "6 edges are required for event generation" },
|
||||
{ name: "EPWM_DC_EDGEFILT_EDGECNT_7", displayName: "7 edges are required for event generation" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_enableValleyCapture",
|
||||
displayName : "Enable Edge Filter Reset/Enable Valley Capture",
|
||||
description : 'This will enable valley capturing feature/allows the input signal selected for valley capturing to reset the edge filter counter',
|
||||
hidden : true,
|
||||
default : false,
|
||||
onChange : onChangeEdgeFilter
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmDigitalCompare_valleyCaptureSource",
|
||||
displayName : "Edge Filter Counter Reset/Valley Capture Signal Source",
|
||||
description : 'Sets the signal source for valley capture and edge filter counter reset',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_ValleyTriggerSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ValleyTriggerSource,
|
||||
onChange : onChangeEdgeFilter
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_startValleyCapture",
|
||||
displayName : "Start Valley Capture Logic",
|
||||
description : 'Start the valley capture logic',
|
||||
hidden : true,
|
||||
default : false
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_startValleyCaptureTriggerCount",
|
||||
displayName : "Start Valley Capture",
|
||||
description : 'The number of trigger events required to start the valley capture count',
|
||||
hidden : true,
|
||||
default : "0",
|
||||
options : [
|
||||
{ displayName: "0 Event (Prevent from starting)", name : "0" },
|
||||
{ displayName: "1 Events", name : "1" },
|
||||
{ displayName: "2 Events", name : "2" },
|
||||
{ displayName: "3 Events", name : "3" },
|
||||
{ displayName: "4 Events", name : "4" },
|
||||
{ displayName: "5 Events", name : "5" },
|
||||
{ displayName: "6 Events", name : "6" },
|
||||
{ displayName: "7 Events", name : "7" },
|
||||
{ displayName: "8 Events", name : "8" },
|
||||
{ displayName: "9 Events", name : "9" },
|
||||
{ displayName: "10 Events", name : "10"},
|
||||
{ displayName: "11 Events", name : "11"},
|
||||
{ displayName: "12 Events", name : "12"},
|
||||
{ displayName: "14 Events", name : "14"},
|
||||
{ displayName: "15 Events", name : "15"},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_stopValleyCaptureTriggerCount",
|
||||
displayName : "Stop Valley Capture",
|
||||
description : 'The number of trigger events required to stop the valley capture count',
|
||||
hidden : true,
|
||||
default : "0",
|
||||
options : [
|
||||
{ displayName: "0 Event (Prevent from stopping)", name : "0" },
|
||||
{ displayName: "1 Events", name : "1" },
|
||||
{ displayName: "2 Events", name : "2" },
|
||||
{ displayName: "3 Events", name : "3" },
|
||||
{ displayName: "4 Events", name : "4" },
|
||||
{ displayName: "5 Events", name : "5" },
|
||||
{ displayName: "6 Events", name : "6" },
|
||||
{ displayName: "7 Events", name : "7" },
|
||||
{ displayName: "8 Events", name : "8" },
|
||||
{ displayName: "9 Events", name : "9" },
|
||||
{ displayName: "10 Events", name : "10"},
|
||||
{ displayName: "11 Events", name : "11"},
|
||||
{ displayName: "12 Events", name : "12"},
|
||||
{ displayName: "14 Events", name : "14"},
|
||||
{ displayName: "15 Events", name : "15"},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_enableEdgeFilterDelay",
|
||||
displayName : "Select the delayed output (by HWDELVAL) of the Edge Filter",
|
||||
description : 'Start the valley capture logic',
|
||||
hidden : true,
|
||||
default : false,
|
||||
onChange : onChangeEdgeFilter
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_SWVDELVAL",
|
||||
displayName : "SWVDELVAL (software valley delay value)",
|
||||
description : 'Set SWVDELVAL (software valley delay value). This value along with the valley delay divider will be used to calculate the HWDELVAL',
|
||||
hidden : true,
|
||||
default : 0
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_valleyDelayDivider",
|
||||
displayName : "Valley Delay Divider",
|
||||
description : 'The delay divider along with SWVDELVAL will be used to calculate the HWDELVAL',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_ValleyDelayMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ValleyDelayMode,
|
||||
}
|
||||
];
|
||||
|
||||
if(["F28P65x"].includes(Common.getDeviceName()))
|
||||
{
|
||||
config = config.concat(
|
||||
{
|
||||
name: "epwmDigitalCompare_enableEventDetection",
|
||||
displayName : "Use Event Detection",
|
||||
description : "Use the DC Event Detection to determine occurrence of a trip event in a configured time window",
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEventDetection
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_CAPINTripInput",
|
||||
displayName : "Capture Input",
|
||||
description : "Trip input on which edge detection logic is performed",
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareTripInput[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareTripInput,
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_CAPIN_combinationInputConfig",
|
||||
displayName : "Combination Capture Input Sources",
|
||||
description : "Select the sources to include in the Combination input sources",
|
||||
hidden : true,
|
||||
minSelections: 0,
|
||||
default : [],
|
||||
options : device_driverlib_peripheral.EPWM_DC_COMBINATIONAL
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_invertCAPIN",
|
||||
displayName : "Invert Capture Input polarity",
|
||||
description : 'Selects the input polarity for capture',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_selectCaptureInputPolarity[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_selectCaptureInputPolarity,
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_CAPGATETripInput",
|
||||
displayName : "Capture Gate",
|
||||
description : "Trip input gating the min/max logic",
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DigitalCompareTripInput[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DigitalCompareTripInput,
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_CAPGATE_combinationInputConfig",
|
||||
displayName : "Combination Capture Gate Input Sources",
|
||||
description : "Select the sources to include in the Combination input sources",
|
||||
hidden : true,
|
||||
minSelections: 0,
|
||||
default : [],
|
||||
options : device_driverlib_peripheral.EPWM_DC_COMBINATIONAL
|
||||
},
|
||||
{
|
||||
name: "epwmDigitalCompare_configCAPGATE",
|
||||
displayName : "Capture Gate Polarity Select",
|
||||
description : 'Capture Gate selection of the input polarity',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_selectCaptureGateInputPolarity[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_selectCaptureGateInputPolarity
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setRegisters_XMIN_read",
|
||||
displayName: "XMIN",
|
||||
hidden: true,
|
||||
getValue: (inst) => inst.epwmXCMP_setRegisters_XMIN,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters1_XMIN_read",
|
||||
displayName: "XMIN Shadow 1",
|
||||
hidden: true,
|
||||
getValue: (inst) => inst.epwmXCMP_setShadowRegisters1_XMIN,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters2_XMIN_read",
|
||||
displayName: "XMIN Shadow 2",
|
||||
hidden: true,
|
||||
getValue: (inst) => inst.epwmXCMP_setShadowRegisters2_XMIN,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters3_XMIN_read",
|
||||
displayName: "XMIN Shadow 3",
|
||||
hidden: true,
|
||||
getValue: (inst) => inst.epwmXCMP_setShadowRegisters3_XMIN,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setRegisters_XMAX_read",
|
||||
displayName: "XMAX",
|
||||
hidden: true,
|
||||
getValue: (inst) => inst.epwmXCMP_setRegisters_XMAX,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters1_XMAX_read",
|
||||
displayName: "XMAX Shadow 1",
|
||||
hidden: true,
|
||||
getValue: (inst) => inst.epwmXCMP_setShadowRegisters1_XMAX,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters2_XMAX_read",
|
||||
displayName: "XMAX Shadow 2",
|
||||
hidden: true,
|
||||
getValue: (inst) => inst.epwmXCMP_setShadowRegisters2_XMAX,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters3_XMAX_read",
|
||||
displayName: "XMAX Shadow 3",
|
||||
hidden: true,
|
||||
getValue: (inst) => inst.epwmXCMP_setShadowRegisters3_XMAX,
|
||||
default: 0,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
var epwmDigitalCompareSubmodule = {
|
||||
displayName: "EPWM Digital Compare",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_DC",
|
||||
description: "Enhanced Pulse Width Modulator Digital Compare",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmDigitalCompareSubmodule;
|
||||
@@ -0,0 +1,212 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
function onChangeEnableDisable(inst, ui)
|
||||
{
|
||||
if (inst.epwmDiodeEmulation_enableDE)
|
||||
{
|
||||
ui.epwmDiodeEmulation_selExitMode.hidden = false;
|
||||
ui.epwmDiodeEmulation_TripLSelect.hidden = false;
|
||||
ui.epwmDiodeEmulation_TripHSelect.hidden = false;
|
||||
ui.epwmDiodeEmulation_enableDiodeEmulationModeCounter.hidden = false;
|
||||
ui.epwmDiodeEmulation_enablePWMTrip.hidden = false;
|
||||
if(inst.epwmDiodeEmulation_selExitMode === device_driverlib_peripheral.EPWM_DiodeEmulationMode[0].name)
|
||||
{
|
||||
ui.epwmDiodeEmulation_Reentrycnt.hidden = false;
|
||||
}else if(inst.epwmDiodeEmulation_selExitMode === device_driverlib_peripheral.EPWM_DiodeEmulationMode[1].name)
|
||||
{
|
||||
ui.epwmDiodeEmulation_Reentrycnt.hidden = true;
|
||||
}
|
||||
if(inst.epwmDiodeEmulation_enableDiodeEmulationModeCounter)
|
||||
{
|
||||
ui.epwmDiodeEmulation_stepIncr.hidden = false;
|
||||
ui.epwmDiodeEmulation_stepDecr.hidden = false;
|
||||
ui.epwmDiodeEmulation_stepThreshold.hidden = false;
|
||||
}else
|
||||
{
|
||||
ui.epwmDiodeEmulation_stepIncr.hidden = true;
|
||||
ui.epwmDiodeEmulation_stepDecr.hidden = true;
|
||||
ui.epwmDiodeEmulation_stepThreshold.hidden = true;
|
||||
}
|
||||
for (var dePwmChannel in device_driverlib_peripheral.EPWM_DE_CHANNEL)
|
||||
{
|
||||
var deOutput = device_driverlib_peripheral.EPWM_DE_CHANNEL[dePwmChannel];
|
||||
ui["epwmDiodeEmulation_" + deOutput.name + "_selTrip"].hidden = false;
|
||||
ui["epwmDiodeEmulation_" + deOutput.name + "_configOutput"].hidden = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.epwmDiodeEmulation_selExitMode.hidden = true;
|
||||
ui.epwmDiodeEmulation_TripLSelect.hidden = true;
|
||||
ui.epwmDiodeEmulation_TripHSelect.hidden = true;
|
||||
ui.epwmDiodeEmulation_enableDiodeEmulationModeCounter.hidden = true;
|
||||
ui.epwmDiodeEmulation_stepIncr.hidden = true;
|
||||
ui.epwmDiodeEmulation_stepDecr.hidden = true;
|
||||
ui.epwmDiodeEmulation_stepThreshold.hidden = true;
|
||||
ui.epwmDiodeEmulation_Reentrycnt.hidden = true;
|
||||
ui.epwmDiodeEmulation_enablePWMTrip.hidden = true;
|
||||
|
||||
inst.epwmDiodeEmulation_selExitMode = "EPWM_DIODE_EMULATION_CBC";
|
||||
inst.epwmDiodeEmulation_TripLSelect = "EPWM_DE_TRIPL_SRC_INPUTXBAR_OUT1";
|
||||
inst.epwmDiodeEmulation_TripHSelect = "EPWM_DE_TRIPH_SRC_INPUTXBAR_OUT1";
|
||||
inst.epwmDiodeEmulation_enableDiodeEmulationModeCounter = false;
|
||||
inst.epwmDiodeEmulation_stepIncr = 0;
|
||||
inst.epwmDiodeEmulation_stepDecr = 0;
|
||||
inst.epwmDiodeEmulation_stepThreshold = 0;
|
||||
inst.epwmDiodeEmulation_Reentrycnt = 0;
|
||||
inst.epwmDiodeEmulation_enablePWMTrip = false;
|
||||
for (var dePwmChannel in device_driverlib_peripheral.EPWM_DE_CHANNEL)
|
||||
{
|
||||
var deOutput = device_driverlib_peripheral.EPWM_DE_CHANNEL[dePwmChannel];
|
||||
ui["epwmDiodeEmulation_" + deOutput.name + "_selTrip"].hidden = true;
|
||||
ui["epwmDiodeEmulation_" + deOutput.name + "_configOutput"].hidden = true;
|
||||
inst["epwmDiodeEmulation_" + deOutput.name + "_selTrip"] = "EPWM_DE_SRC_TRIPL";
|
||||
inst["epwmDiodeEmulation_" + deOutput.name + "_configOutput"] = "EPWM_DE_SYNC_TRIPHorL";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// make sure to add conditionals to not have the same trip signal for triph / tripl ?
|
||||
var config = [
|
||||
{
|
||||
name : "epwmDiodeEmulation_enableDE",
|
||||
displayName : "Enable Diode Emulation Mode",
|
||||
description : 'Enables Diode Emulation Mode, by default Diode Emulation is cleared',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_enablePWMTrip",
|
||||
displayName : "Enable PWM Trip Output",
|
||||
description : 'If enabled, PWM Trip will not bypass diode emulation logic',
|
||||
hidden : true,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_selExitMode",
|
||||
displayName : "Diode Emulation Mode Select",
|
||||
description : 'The event for which the diode emulation mode exits',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DiodeEmulationMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DiodeEmulationMode,
|
||||
onChange : onChangeEnableDisable
|
||||
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_Reentrycnt",
|
||||
displayName : "Reentry Delay",
|
||||
description : 'Delay value until diode emulation can exit in terms of PWMSYNCOUT (0-255)',
|
||||
hidden : true,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_TripLSelect",
|
||||
displayName : "Input TripL Select",
|
||||
description : 'Input trip low select from Xbar or CMPSS',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DiodeEmulationTripLSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DiodeEmulationTripLSource
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_TripHSelect",
|
||||
displayName : "Input TripH Select",
|
||||
description : 'Input trip high select from Xbar or CMPSS',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DiodeEmulationTripHSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DiodeEmulationTripHSource
|
||||
},
|
||||
{
|
||||
name: "GROUP_DEMON",
|
||||
displayName: "Diode Emulation Monitor Configuration",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmDiodeEmulation_enableDiodeEmulationModeCounter",
|
||||
displayName : "Enable Monitor Counter",
|
||||
description : 'Enabling this ',
|
||||
hidden : true,
|
||||
default : false,
|
||||
onChange : onChangeEnableDisable
|
||||
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_stepIncr",
|
||||
displayName : "Increment Stepsize of Counter when TripH or TripL Occurs",
|
||||
description : 'Increments count by defined step size when TripH or TripL occurs(256 is max step size)',
|
||||
hidden : true,
|
||||
default : 0
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_stepDecr",
|
||||
displayName : "Decrement Stepsize of Counter when TripH or TripL Occurs",
|
||||
description : 'Decrements count by defined step size when TripH or TripL occurs(256 is max step size)',
|
||||
hidden : true,
|
||||
default : 0
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_stepThreshold",
|
||||
displayName : "Threshold for Number of TripH or TripL Signal Occurrences",
|
||||
description : 'When threshold is reached, a trip pulse is generated and counter is cleared',
|
||||
hidden : true,
|
||||
default : 0
|
||||
},
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
for (var dePwmChannel in device_driverlib_peripheral.EPWM_DE_CHANNEL)
|
||||
{
|
||||
var deOutput = device_driverlib_peripheral.EPWM_DE_CHANNEL[dePwmChannel];
|
||||
var deOutputconfigs = []
|
||||
var deOutput_Configs = [
|
||||
{
|
||||
name: "epwmDiodeEmulation_" + deOutput.name + "_selTrip",
|
||||
displayName : deOutput.displayName.replace("emulation", "Emulation").replace("channel", "Channel") + " Trip Select",
|
||||
description : 'Trip select for diode emulation output',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DE_SRC[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DE_SRC,
|
||||
},
|
||||
{
|
||||
name: "epwmDiodeEmulation_" + deOutput.name + "_configOutput",
|
||||
displayName : deOutput.displayName.replace("emulation", "Emulation").replace("channel", "Channel") + " Output Select",
|
||||
description : 'Set diode emulation output channel A to tripHortripL, inverted tripHortripL, constant low or high',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_DiodeEmulationSignal[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_DiodeEmulationSignal,
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
config = config.concat([{
|
||||
name: "GROUP_DE_Output_" + deOutput.name,
|
||||
displayName: deOutput.displayName.replace("emulation", "Emulation").replace("channel", "Channel") + " Output Configuration",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: deOutput_Configs
|
||||
}]);
|
||||
|
||||
}
|
||||
|
||||
var epwmDiodeEmulationSubmodule = {
|
||||
displayName: "EPWM Diode Emulation",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_DE",
|
||||
description: "Enhanced Pulse Width Modulator Diode Emulation Configuration",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmDiodeEmulationSubmodule;
|
||||
@@ -0,0 +1,333 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
|
||||
var ADC_SOC_configs = []
|
||||
|
||||
function onChangeInterrupt (inst, ui)
|
||||
{
|
||||
if (inst.epwmEventTrigger_enableInterrupt)
|
||||
{
|
||||
for(var uiConfigIndex = 1; uiConfigIndex < config.length; uiConfigIndex++)
|
||||
{
|
||||
var configName = config[uiConfigIndex].name;
|
||||
if (!configName.startsWith("GROUP_")){
|
||||
ui[configName].hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (inst.epwmEventTrigger_interruptEventCountInitEnable == true)
|
||||
{
|
||||
ui.epwmEventTrigger_interruptEventCountInitValue.hidden = false;
|
||||
}
|
||||
else if (inst.epwmEventTrigger_interruptEventCountInitEnable == false)
|
||||
{
|
||||
ui.epwmEventTrigger_interruptEventCountInitValue.hidden = true;
|
||||
inst.epwmEventTrigger_interruptEventCountInitValue = ePWMCountInitial[0].name;
|
||||
}
|
||||
}
|
||||
else if (inst.epwmEventTrigger_enableInterrupt == false){
|
||||
for(var uiConfigIndex = 2; uiConfigIndex < config.length; uiConfigIndex++)
|
||||
{
|
||||
var configName = config[uiConfigIndex].name;
|
||||
if (!configName.startsWith("GROUP_")){
|
||||
ui[configName].hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Set values to their defaults
|
||||
inst.epwmEventTrigger_registerInterrupts = false;
|
||||
inst.epwmEventTrigger_interruptSource = device_driverlib_peripheral.EPWM_INT_TBCTR[0].name;
|
||||
inst.epwmEventTrigger_interruptEventCount = ePWMCount[0].name;
|
||||
inst.epwmEventTrigger_interruptEventCountInitEnable = false;
|
||||
inst.epwmEventTrigger_interruptEventCountInitValue = ePWMCountInitial[0].name;
|
||||
inst.epwmEventTrigger_interruptEventCountInitForce = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeADCEnableDisable (inst, ui)
|
||||
{
|
||||
for (var adcSocConfigIndex = 1; adcSocConfigIndex < ADC_SOC_configs.length-6; adcSocConfigIndex++)
|
||||
{
|
||||
var configName = ADC_SOC_configs[adcSocConfigIndex].name;
|
||||
if (inst.epwmEventTrigger_EPWM_SOC_A_triggerEnable)
|
||||
{
|
||||
if (adcSocConfigIndex == 3)
|
||||
{
|
||||
ui[configName].hidden = false;
|
||||
var configName2 = ADC_SOC_configs[4].name;
|
||||
var configName3 = ADC_SOC_configs[5].name;
|
||||
if (inst[configName] == true)
|
||||
{
|
||||
ui[configName2].hidden = false;
|
||||
ui[configName3].hidden = false;
|
||||
}
|
||||
else if (inst[configName] == false)
|
||||
{
|
||||
ui[configName2].hidden = true;
|
||||
ui[configName3].hidden = true;
|
||||
// Reset values to their defaults
|
||||
inst[configName2] = ePWMCountInitial[0].name;
|
||||
inst[configName3] = false;
|
||||
}
|
||||
}
|
||||
else if (adcSocConfigIndex != 4 && adcSocConfigIndex != 5){
|
||||
ui[configName].hidden = false;
|
||||
}
|
||||
}
|
||||
else if (inst.epwmEventTrigger_EPWM_SOC_A_triggerEnable == false)
|
||||
{
|
||||
ui[configName].hidden = true;
|
||||
// Reset values to their defaults
|
||||
inst.epwmEventTrigger_EPWM_SOC_A_triggerSource = device_driverlib_peripheral.EPWM_ADCStartOfConversionSource[0].name;
|
||||
inst.epwmEventTrigger_EPWM_SOC_A_triggerEventPrescalar = ePWMCount[0].name;
|
||||
inst.epwmEventTrigger_EPWM_SOC_A_triggerEventCountInitEnable = false;
|
||||
inst.epwmEventTrigger_EPWM_SOC_A_triggerEventCountInitValue = ePWMCountInitial[0].name;
|
||||
inst.epwmEventTrigger_EPWM_SOC_A_triggerEventCountInitForce = false;
|
||||
}
|
||||
}
|
||||
|
||||
for (var adcSocConfigIndex = 7; adcSocConfigIndex < ADC_SOC_configs.length; adcSocConfigIndex++)
|
||||
{
|
||||
var configName = ADC_SOC_configs[adcSocConfigIndex].name;
|
||||
if (inst.epwmEventTrigger_EPWM_SOC_B_triggerEnable)
|
||||
{
|
||||
if (adcSocConfigIndex == 9)
|
||||
{
|
||||
ui[configName].hidden = false;
|
||||
var configName2 = ADC_SOC_configs[10].name;
|
||||
var configName3 = ADC_SOC_configs[11].name;
|
||||
if (inst[configName] == true)
|
||||
{
|
||||
ui[configName2].hidden = false;
|
||||
ui[configName3].hidden = false;
|
||||
}
|
||||
else if (inst[configName] == false)
|
||||
{
|
||||
ui[configName2].hidden = true;
|
||||
ui[configName3].hidden = true;
|
||||
// Reset values to their defaults
|
||||
inst[configName2] = ePWMCountInitial[0].name;
|
||||
inst[configName3] = false;
|
||||
}
|
||||
}
|
||||
else if (adcSocConfigIndex != 10 && adcSocConfigIndex != 11)
|
||||
{
|
||||
ui[configName].hidden = false;
|
||||
}
|
||||
}
|
||||
else if (inst.epwmEventTrigger_EPWM_SOC_B_triggerEnable == false)
|
||||
{
|
||||
ui[configName].hidden = true;
|
||||
// Reset values to their defaults
|
||||
inst.epwmEventTrigger_EPWM_SOC_B_triggerSource = device_driverlib_peripheral.EPWM_ADCStartOfConversionSource[0].name;
|
||||
inst.epwmEventTrigger_EPWM_SOC_B_triggerEventPrescalar = ePWMCount[0].name;
|
||||
inst.epwmEventTrigger_EPWM_SOC_B_triggerEventCountInitEnable = false;
|
||||
inst.epwmEventTrigger_EPWM_SOC_B_triggerEventCountInitValue = ePWMCountInitial[0].name;
|
||||
inst.epwmEventTrigger_EPWM_SOC_B_triggerEventCountInitForce = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var ePWMCount = [
|
||||
{ displayName: "Disabled", name: "0" },
|
||||
{ displayName: "1 Event Generates Interrupt", name: "1" },
|
||||
{ displayName: "2 Events Generates Interrupt", name: "2" },
|
||||
{ displayName: "3 Events Generates Interrupt", name: "3" },
|
||||
{ displayName: "4 Events Generates Interrupt", name: "4" },
|
||||
{ displayName: "5 Events Generates Interrupt", name: "5" },
|
||||
{ displayName: "6 Events Generates Interrupt", name: "6" },
|
||||
{ displayName: "7 Events Generates Interrupt", name: "7" },
|
||||
{ displayName: "8 Events Generates Interrupt", name: "8" },
|
||||
{ displayName: "9 Events Generates Interrupt", name: "9" },
|
||||
{ displayName: "10 Events Generates Interrupt", name: "10" },
|
||||
{ displayName: "11 Events Generates Interrupt", name: "11" },
|
||||
{ displayName: "12 Events Generates Interrupt", name: "12" },
|
||||
{ displayName: "13 Events Generates Interrupt", name: "13" },
|
||||
{ displayName: "14 Events Generates Interrupt", name: "14" },
|
||||
{ displayName: "15 Events Generates Interrupt", name: "15" },
|
||||
]
|
||||
|
||||
var ePWMCountInitial = [
|
||||
{ displayName: "Initialize event counter to 0" , name: "0" },
|
||||
{ displayName: "Initialize event counter to 1" , name: "1" },
|
||||
{ displayName: "Initialize event counter to 2" , name: "2" },
|
||||
{ displayName: "Initialize event counter to 3" , name: "3" },
|
||||
{ displayName: "Initialize event counter to 4" , name: "4" },
|
||||
{ displayName: "Initialize event counter to 5" , name: "5" },
|
||||
{ displayName: "Initialize event counter to 6" , name: "6" },
|
||||
{ displayName: "Initialize event counter to 7" , name: "7" },
|
||||
{ displayName: "Initialize event counter to 8" , name: "8" },
|
||||
{ displayName: "Initialize event counter to 9" , name: "9" },
|
||||
{ displayName: "Initialize event counter to 10", name: "10" },
|
||||
{ displayName: "Initialize event counter to 11", name: "11" },
|
||||
{ displayName: "Initialize event counter to 12", name: "12" },
|
||||
{ displayName: "Initialize event counter to 13", name: "13" },
|
||||
{ displayName: "Initialize event counter to 14", name: "14" },
|
||||
{ displayName: "Initialize event counter to 15", name: "15" },
|
||||
]
|
||||
|
||||
/* Array of CAN configurables that are common across device families */
|
||||
var config = [
|
||||
{
|
||||
name: "epwmEventTrigger_enableInterrupt",
|
||||
displayName : "Enable EPWM Interrupt",
|
||||
description : 'Check to enable EPWM interrupt',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeInterrupt
|
||||
},
|
||||
{
|
||||
name : "epwmEventTrigger_registerInterrupts",
|
||||
displayName : "Register Interrupt Handler",
|
||||
description : 'Whether or not to register interrupt handlers in the interrupt module.',
|
||||
hidden : true,
|
||||
default : false
|
||||
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_interruptSource",
|
||||
displayName : "Interrupt Event Sources",
|
||||
description : 'Select all events that must be enabled to generate an EPWM interrupt',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_INT_TBCTR[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_INT_TBCTR
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_interruptEventCount",
|
||||
displayName : "Interrupt Event Count",
|
||||
description : 'The number of events that have to occur before an interrupt is issued',
|
||||
hidden : true,
|
||||
default : ePWMCount[0].name,
|
||||
options : ePWMCount
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_interruptEventCountInitEnable",
|
||||
displayName : "Interrupt Event Count Initial Value Load Enable",
|
||||
description : 'Enables the ePWM interrupt counter to be pre-interrupt loaded with a count value after a SYNC or software force',
|
||||
hidden : true,
|
||||
default : false,
|
||||
onChange : onChangeInterrupt
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_interruptEventCountInitValue",
|
||||
displayName : "Interrupt Event Count Initial Value",
|
||||
description : 'Value of the pre-interrupt value that is to be loaded into the interrupt event counter.',
|
||||
hidden : true,
|
||||
default : ePWMCountInitial[0].name,
|
||||
options : ePWMCountInitial
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_interruptEventCountInitForce",
|
||||
displayName : "Force Interrupt Event Count Initial Value",
|
||||
description : 'Forces the ePWM interrupt counter to be pre-interrupt loaded with the init count value',
|
||||
hidden : true,
|
||||
default : false,
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
for (var socIndex in device_driverlib_peripheral.EPWM_ADCStartOfConversionType)
|
||||
{
|
||||
var soc = device_driverlib_peripheral.EPWM_ADCStartOfConversionType[socIndex];
|
||||
var soc_name = "SOC" + soc.name.replace("EPWM_SOC_", "");
|
||||
ADC_SOC_configs = ADC_SOC_configs.concat([
|
||||
{
|
||||
name: "epwmEventTrigger_" + soc.name + "_triggerEnable",
|
||||
displayName : soc_name + " Trigger Enable",
|
||||
description : 'Enable the SOC trigger generated by the ET submodule for ' + soc_name,
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeADCEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_" + soc.name + "_triggerSource",
|
||||
displayName : soc_name + " Trigger Source",
|
||||
description : 'Select the SOC trigger source for ' + soc_name,
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_ADCStartOfConversionSource[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ADCStartOfConversionSource
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_" + soc.name + "_triggerEventPrescalar",
|
||||
displayName : soc_name + " Trigger Event Count",
|
||||
description : 'The number of events that have to occur before an SOC is issued',
|
||||
hidden : true,
|
||||
default : ePWMCount[0].name,
|
||||
options : ePWMCount
|
||||
},
|
||||
|
||||
{
|
||||
name: "epwmEventTrigger_" + soc.name + "_triggerEventCountInitEnable",
|
||||
displayName : soc_name + " Trigger Event Count Initial Value Load Enable",
|
||||
description : 'Enables the ePWM SOC trigger counter to be pre-event loaded with a count value after a software force',
|
||||
hidden : true,
|
||||
default : false,
|
||||
onChange : onChangeADCEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_" + soc.name + "_triggerEventCountInitValue",
|
||||
displayName : soc_name + " Trigger Event Count Initial Value",
|
||||
description : 'Value of the pre-event value that is to be loaded into the SOC trigger event counter.',
|
||||
hidden : true,
|
||||
default : ePWMCountInitial[0].name,
|
||||
options : ePWMCountInitial
|
||||
},
|
||||
{
|
||||
name: "epwmEventTrigger_" + soc.name + "_triggerEventCountInitForce",
|
||||
displayName : "Force " + soc_name + " Trigger Event Count Initial Value",
|
||||
description : 'Forces the ePWM SOC trigger counter to be pre-event loaded with the init count value',
|
||||
hidden : true,
|
||||
default : false,
|
||||
},
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
config = config.concat([
|
||||
{
|
||||
name: "GROUP_ADCSOC",
|
||||
displayName: "ADC SOC Trigger",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: ADC_SOC_configs
|
||||
}
|
||||
]);
|
||||
|
||||
|
||||
var epwmEventTriggerSubmodule = {
|
||||
displayName: "EPWM Event-Trigger",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_ET",
|
||||
description: "Enhanced Pulse Width Modulator Event Trigger",
|
||||
config: config,
|
||||
moduleInstances: (inst) => {
|
||||
if (inst.epwmEventTrigger_registerInterrupts)
|
||||
{
|
||||
return [{
|
||||
name: "epwmInt",
|
||||
displayName: "EPWM Interrupt ",
|
||||
moduleName: "/driverlib/interrupt.js",
|
||||
collapsed: true,
|
||||
args: {
|
||||
$name : inst.$name + "_ET_INT",
|
||||
int : "INT_" + inst.$name,
|
||||
pinmuxPeripheralModule : "epwm",
|
||||
driverlibInt: "INT_#"
|
||||
}
|
||||
}]
|
||||
}
|
||||
return [];
|
||||
},
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
exports = epwmEventTriggerSubmodule;
|
||||
@@ -0,0 +1,134 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
|
||||
function onChangeEnableDisable(inst, ui)
|
||||
{
|
||||
if (inst.epwmGlobalLoad_gld)
|
||||
{
|
||||
ui.epwmGlobalLoad_gldMode.hidden = false;
|
||||
ui.epwmGlobalLoad_gldPeriod.hidden = false;
|
||||
ui.epwmGlobalLoad_enableOneShot.hidden = false;
|
||||
ui.epwmGlobalLoad_globalePWMLoadLink.hidden = false;
|
||||
if (inst.epwmGlobalLoad_enableOneShot)
|
||||
{
|
||||
ui.epwmGlobalLoad_oneShotMode.hidden = false;
|
||||
ui.epwmGlobalLoad_oneShotForce.hidden = false;
|
||||
}
|
||||
else if (inst.epwmGlobalLoad_enableOneShot == false)
|
||||
{
|
||||
ui.epwmGlobalLoad_oneShotMode.hidden = true;
|
||||
ui.epwmGlobalLoad_oneShotForce.hidden = true;
|
||||
// Set to defalts
|
||||
inst.epwmGlobalLoad_oneShotMode = false;
|
||||
inst.epwmGlobalLoad_oneShotForce = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.epwmGlobalLoad_gldMode.hidden = true;
|
||||
ui.epwmGlobalLoad_gldPeriod.hidden = true;
|
||||
ui.epwmGlobalLoad_enableOneShot.hidden = true;
|
||||
ui.epwmGlobalLoad_oneShotMode.hidden = true;
|
||||
ui.epwmGlobalLoad_oneShotForce.hidden = true;
|
||||
ui.epwmGlobalLoad_globalePWMLoadLink.hidden = true;
|
||||
|
||||
// Set to default
|
||||
inst.epwmGlobalLoad_gldMode = device_driverlib_peripheral.EPWM_GlobalLoadTrigger[0].name;
|
||||
inst.epwmGlobalLoad_gldPeriod = globalPeriodOptions[0].name;
|
||||
inst.epwmGlobalLoad_enableOneShot = false;
|
||||
inst.epwmGlobalLoad_oneShotMode = false;
|
||||
inst.epwmGlobalLoad_oneShotForce = false;
|
||||
inst.epwmGlobalLoad_globalePWMLoadLink = device_driverlib_peripheral.EPWM_CurrentLink[0].name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var globalPeriodOptions = [
|
||||
{ displayName: "Counter is disabled", name : "0" },
|
||||
{ displayName: "Generate stobe on 1st event", name : "1" },
|
||||
{ displayName: "Generate stobe on 2nd event", name : "2" },
|
||||
{ displayName: "Generate stobe on 3rd event", name : "3" },
|
||||
{ displayName: "Generate stobe on 4th event", name : "4" },
|
||||
{ displayName: "Generate stobe on 5th event", name : "5" },
|
||||
{ displayName: "Generate stobe on 6th event", name : "6" },
|
||||
{ displayName: "Generate stobe on 7th event", name : "7" },
|
||||
]
|
||||
|
||||
var config = [
|
||||
{
|
||||
name : "epwmGlobalLoad_gld",
|
||||
displayName : "Enable Global Shadow to Active Load",
|
||||
description : 'all the shadow to active reload events are defined by GLDMODE bits in GLDCTL register',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmGlobalLoad_gldMode",
|
||||
displayName : "Global Load Pulse Selection",
|
||||
description : 'The event for which there will be a Shadow to Active Mode Reload',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_GlobalLoadTrigger[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_GlobalLoadTrigger,
|
||||
},
|
||||
{
|
||||
name: "epwmGlobalLoad_gldPeriod",
|
||||
displayName : "Global Load Strobe Period",
|
||||
description : 'Amount of events that need to occur before a load strobe is generated',
|
||||
hidden : true,
|
||||
default : globalPeriodOptions[0].name,
|
||||
options : globalPeriodOptions,
|
||||
},
|
||||
{
|
||||
name: "epwmGlobalLoad_enableOneShot",
|
||||
displayName : "One Shot Mode",
|
||||
description : 'Enable One Shot Load Mode',
|
||||
hidden : true,
|
||||
default : false,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmGlobalLoad_oneShotMode",
|
||||
displayName : "Enable Reload Event in One Shot Mode",
|
||||
description : 'Upon occurrence of a chosen load strobe, one shadow to active reload occurs',
|
||||
hidden : true,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmGlobalLoad_oneShotForce",
|
||||
displayName : "Force Load Event",
|
||||
description : 'Force one load event at the input of the event pre-scale counter',
|
||||
hidden : true,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmGlobalLoad_globalePWMLoadLink",
|
||||
displayName : "Global PWM Load Link",
|
||||
description : 'Simultaneous write to the current ePWM module GLDCTL2 register',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_CurrentLink[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CurrentLink,
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
var epwmGlobalLoadSubmodule = {
|
||||
displayName: "EPWM Global Load",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_GL",
|
||||
description: "Enhanced Pulse Width Modulator Global Load Configuration",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmGlobalLoadSubmodule;
|
||||
@@ -0,0 +1,415 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
// input 1 is the channel's output, input 2 is other channel's output
|
||||
let EPWM_MINDB_ICL_LUT_A = [
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC0", displayName: "ICLXBAR = LOW | MINDBxB = LOW | MINDBxA = LOW" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC1", displayName: "ICLXBAR = LOW | MINDBxB = LOW | MINDBxA = HIGH" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC2", displayName: "ICLXBAR = LOW | MINDBxB = HIGH | MINDBxA = LOW" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC3", displayName: "ICLXBAR = LOW | MINDBxB = HIGH | MINDBxA = HIGH" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC4", displayName: "ICLXBAR = HIGH | MINDBxB = LOW | MINDBxA = LOW" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC5", displayName: "ICLXBAR = HIGH | MINDBxB = LOW | MINDBxA = HIGH" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC6", displayName: "ICLXBAR = HIGH | MINDBxB = HIGH | MINDBxA = LOW" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC7", displayName: "ICLXBAR = HIGH | MINDBxB = HIGH | MINDBxA = HIGH" },
|
||||
]
|
||||
|
||||
let EPWM_MINDB_ICL_LUT_B = [
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC0", displayName: "ICLXBAR = LOW | MINDBxA = LOW | MINDBxB = LOW" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC1", displayName: "ICLXBAR = LOW | MINDBxA = LOW | MINDBxB = HIGH" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC2", displayName: "ICLXBAR = LOW | MINDBxA = HIGH | MINDBxB = HIGH" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC3", displayName: "ICLXBAR = LOW | MINDBxA = HIGH | MINDBxB = HIGH" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC4", displayName: "ICLXBAR = HIGH | MINDBxA = LOW | MINDBxB = LOW" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC5", displayName: "ICLXBAR = HIGH | MINDBxA = LOW | MINDBxB = HIGH" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC6", displayName: "ICLXBAR = HIGH | MINDBxA = HIGH | MINDBxB = LOW" },
|
||||
{ name: "EPWM_MINDB_ICL_LUT_DEC7", displayName: "ICLXBAR = HIGH | MINDBxA = HIGH | MINDBxB = HIGH" },
|
||||
]
|
||||
|
||||
function set_LUT_table(inst, ui, dbOutput, reset)
|
||||
{
|
||||
var output_LUT_high = inst["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTHIGH"];
|
||||
var output_LUT_low = inst["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTLOW"];
|
||||
var output_high = "1";
|
||||
var output_low = "0";
|
||||
|
||||
if(reset)
|
||||
{
|
||||
// inst["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTHIGH"].;
|
||||
// inst["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTLOW"];
|
||||
|
||||
}else
|
||||
{
|
||||
for(var index_high_options in output_LUT_high)
|
||||
{
|
||||
switch(output_LUT_high[index_high_options])
|
||||
{
|
||||
case "EPWM_MINDB_ICL_LUT_DEC0":
|
||||
inst["epwmICL_LUT0" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_high;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC1":
|
||||
inst["epwmICL_LUT1" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_high;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC2":
|
||||
inst["epwmICL_LUT2" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_high;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC3":
|
||||
inst["epwmICL_LUT3" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_high;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC4":
|
||||
inst["epwmICL_LUT4" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_high;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC5":
|
||||
inst["epwmICL_LUT5" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_high;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC6":
|
||||
inst["epwmICL_LUT6" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_high;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC7":
|
||||
inst["epwmICL_LUT7" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_high;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(var index_low_options in output_LUT_low)
|
||||
{
|
||||
// check if LUT high does not have LUT low option and set that defautl to low
|
||||
switch(output_LUT_low[index_low_options])
|
||||
{
|
||||
case "EPWM_MINDB_ICL_LUT_DEC0":
|
||||
inst["epwmICL_LUT0" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_low;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC1":
|
||||
inst["epwmICL_LUT1" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_low;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC2":
|
||||
inst["epwmICL_LUT2" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_low;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC3":
|
||||
inst["epwmICL_LUT3" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_low;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC4":
|
||||
inst["epwmICL_LUT4" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_low;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC5":
|
||||
inst["epwmICL_LUT5" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_low;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC6":
|
||||
inst["epwmICL_LUT6" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_low;
|
||||
break;
|
||||
case "EPWM_MINDB_ICL_LUT_DEC7":
|
||||
inst["epwmICL_LUT7" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = output_low;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onChangeEnableDisable(inst, ui)
|
||||
{
|
||||
for (var dbOutputIndex in device_driverlib_peripheral.EPWM_DeadBandOutput)
|
||||
{
|
||||
var dbOutput = device_driverlib_peripheral.EPWM_DeadBandOutput[dbOutputIndex];
|
||||
if(inst["epwmMinDeadBand_Enable" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] === true)
|
||||
{
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_inputRefSignal"].hidden = false;
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_invertInput"].hidden = false;
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_setDelay"].hidden = false;
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_configBlockSignal"].hidden = false;
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_configANDOR"].hidden = false;
|
||||
}else
|
||||
{
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_inputRefSignal"].hidden = true;
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_invertInput"].hidden = true;
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_setDelay"].hidden = true;
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_configBlockSignal"].hidden = true;
|
||||
ui["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_configANDOR"].hidden = true;
|
||||
inst["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_inputRefSignal"] = "EPWM_MINDB_SEL_DEPWM";
|
||||
inst["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_invertInput"] = "EPWM_MINDB_REF_SIG";
|
||||
inst["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_setDelay"] = 1;
|
||||
inst["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_configBlockSignal"] = "EPWM_MINDB_BLOCKING_SIGNAL_BYPASS";
|
||||
inst["epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_configANDOR"] = "EPWM_MINDB_POLSEL_INVERT_LOGICAL_AND";
|
||||
}
|
||||
if(inst["epwmICL_Enable" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] === true)
|
||||
{
|
||||
ui["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_selXBAR"].hidden = false;
|
||||
ui["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTHIGH"].hidden = false;
|
||||
ui["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTLOW"].hidden = false;
|
||||
set_LUT_table(inst, ui, dbOutput, 0);
|
||||
}else
|
||||
{
|
||||
ui["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_selXBAR"].hidden = true;
|
||||
ui["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTHIGH"].hidden = true;
|
||||
ui["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTLOW"].hidden = true;
|
||||
inst["epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_selXBAR"] = "EPWM_MINDB_ICL_XBAR_OUT1";
|
||||
inst["epwmICL_LUT0" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = "0";
|
||||
inst["epwmICL_LUT1" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = "0";
|
||||
inst["epwmICL_LUT2" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = "0";
|
||||
inst["epwmICL_LUT3" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = "0";
|
||||
inst["epwmICL_LUT4" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = "0";
|
||||
inst["epwmICL_LUT5" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = "0";
|
||||
inst["epwmICL_LUT6" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = "0";
|
||||
inst["epwmICL_LUT7" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "")] = "0";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var config = [
|
||||
|
||||
];
|
||||
|
||||
var mindbLongDesc = `
|
||||
Enhanced Pulse Width Modulator Minimum Deadband and Illegal Combo Logic Configuration
|
||||
|
||||
The input into the MINDB module can be a signal from the MINDB X-BAR or the diode emulation output (without high resolution).
|
||||
The third input into the LUT for the ICL module is selected from one of the ICL X-BAR outputs.
|
||||

|
||||
`;
|
||||
|
||||
|
||||
for (var dbOutputIndex in device_driverlib_peripheral.EPWM_DeadBandOutput)
|
||||
{
|
||||
var dbOutput = device_driverlib_peripheral.EPWM_DeadBandOutput[dbOutputIndex];
|
||||
var dbOutput_Configs = [
|
||||
{
|
||||
name: "epwmMinDeadBand_Enable" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Enable Minimum Dead-Band for " + dbOutput.displayName.replace("DB output is", ""),
|
||||
description : 'Enable dead-band output for' + dbOutput.displayName.replace("DB output is", ""),
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_inputRefSignal",
|
||||
displayName : "Input Reference Signal for" + dbOutput.displayName.replace("DB output is", ""),
|
||||
description : 'Select reference signal for minimum deadband output' + dbOutput.displayName.replace("DB output is", ""),
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_MINDB_SEL[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_MINDB_SEL,
|
||||
},
|
||||
{
|
||||
name: "epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_invertInput",
|
||||
displayName : "Invert Input Reference Signal",
|
||||
description : 'Invert input reference signal to the Minimum Dead-Band Logic',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_MINDB_REF[0].name ,
|
||||
options : device_driverlib_peripheral.EPWM_MINDB_REF
|
||||
},
|
||||
{
|
||||
name: "epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_setDelay",
|
||||
displayName : "Minimum Dead-Band Delay for" + dbOutput.displayName.replace("DB output is", "") + " (SYSCLK Cycles)",
|
||||
description : 'Set minimum dead-band delay applied to reference signal',
|
||||
hidden : true,
|
||||
default : 1
|
||||
},
|
||||
{
|
||||
name: "epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_configBlockSignal",
|
||||
displayName : "Blocking Signal for" + dbOutput.displayName.replace("DB output is", ""),
|
||||
description : 'Select blocking signal for' + dbOutput.displayName.replace("DB output is", ""),
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_MINDB_BLOCKING_SIGNAL[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_MINDB_BLOCKING_SIGNAL
|
||||
},
|
||||
{
|
||||
name: "epwmMinDeadBand_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_configANDOR",
|
||||
displayName : "AND OR Logic for Blocking Signal with " + dbOutput.displayName.replace("DB output is", ""),
|
||||
description : 'Select signal for the AND OR logic of' + dbOutput.displayName.replace("DB output is", ""),
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_MINDB_POLSEL[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_MINDB_POLSEL
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
config = config.concat([{
|
||||
name: "GROUP_MINDB_Output_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName: dbOutput.displayName.replace("DB output is", "MINDB").replace("PWM", "PWMx") + " Output Configuration",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: dbOutput_Configs
|
||||
}]);
|
||||
|
||||
}
|
||||
|
||||
for (var dbOutputIndex in device_driverlib_peripheral.EPWM_DeadBandOutput)
|
||||
{
|
||||
var dbOutput = device_driverlib_peripheral.EPWM_DeadBandOutput[dbOutputIndex];
|
||||
var dbOutput_Configs = [
|
||||
{
|
||||
name: "epwmICL_Enable" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Enable Illegal Combo Logic for" + dbOutput.displayName.replace("DB output is", ""),
|
||||
description : 'Enable Illegal Combo Logic for' + dbOutput.displayName.replace("DB output is", ""),
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_selXBAR",
|
||||
displayName : "Input XBAR Reference Signal",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_MINDB_ICL_XBAR[0].name ,
|
||||
options : device_driverlib_peripheral.EPWM_MINDB_ICL_XBAR
|
||||
},
|
||||
{
|
||||
name: "epwmICL_LUT0" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Backend",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : "0" ,
|
||||
},
|
||||
{
|
||||
name: "epwmICL_LUT1" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Backend",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : "0" ,
|
||||
},
|
||||
{
|
||||
name: "epwmICL_LUT2" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Backend",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : "0" ,
|
||||
},
|
||||
{
|
||||
name: "epwmICL_LUT3" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Backend",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : "0" ,
|
||||
},
|
||||
{
|
||||
name: "epwmICL_LUT4" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Backend",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : "0" ,
|
||||
},
|
||||
{
|
||||
name: "epwmICL_LUT5" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Backend",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : "0" ,
|
||||
},
|
||||
{
|
||||
name: "epwmICL_LUT6" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Backend",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : "0" ,
|
||||
},
|
||||
{
|
||||
name: "epwmICL_LUT7" + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName : "Backend",
|
||||
description : 'Select input XBAR signal to the Illegal Combo Logic',
|
||||
hidden : true,
|
||||
default : "0" ,
|
||||
},
|
||||
]
|
||||
if(dbOutput.name.replace("EPWM_DB_OUTPUT_", "")== "A")
|
||||
{
|
||||
dbOutput_Configs = dbOutput_Configs.concat([{
|
||||
name: "epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTHIGH",
|
||||
displayName : "Output High",
|
||||
description : 'Select which combinations of inputs to output high',
|
||||
hidden : true,
|
||||
default : [],
|
||||
minSelections: 0,
|
||||
options : EPWM_MINDB_ICL_LUT_A,
|
||||
onChange : onChangeEnableDisable
|
||||
|
||||
},
|
||||
{
|
||||
name: "epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTLOW",
|
||||
displayName : "Output Low",
|
||||
description : 'Select which combinations of inputs to output low',
|
||||
hidden : true,
|
||||
default : ["EPWM_MINDB_ICL_LUT_DEC0",
|
||||
"EPWM_MINDB_ICL_LUT_DEC1",
|
||||
"EPWM_MINDB_ICL_LUT_DEC2",
|
||||
"EPWM_MINDB_ICL_LUT_DEC3",
|
||||
"EPWM_MINDB_ICL_LUT_DEC4",
|
||||
"EPWM_MINDB_ICL_LUT_DEC5",
|
||||
"EPWM_MINDB_ICL_LUT_DEC6",
|
||||
"EPWM_MINDB_ICL_LUT_DEC7"],
|
||||
minSelections: 0,
|
||||
options : EPWM_MINDB_ICL_LUT_A,
|
||||
onChange : onChangeEnableDisable
|
||||
|
||||
}]);
|
||||
}else
|
||||
{
|
||||
dbOutput_Configs = dbOutput_Configs.concat([{
|
||||
name: "epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTHIGH",
|
||||
displayName : "Output High",
|
||||
description : 'Select which combinations of inputs to output high',
|
||||
hidden : true,
|
||||
default : [],
|
||||
minSelections: 0,
|
||||
options : EPWM_MINDB_ICL_LUT_B,
|
||||
onChange : onChangeEnableDisable
|
||||
|
||||
},
|
||||
{
|
||||
name: "epwmICL_" + dbOutput.name.replace("EPWM_DB_OUTPUT_", "") + "_OUTLOW",
|
||||
displayName : "Output Low",
|
||||
description : 'Select which combinations of inputs to output low',
|
||||
hidden : true,
|
||||
default : ["EPWM_MINDB_ICL_LUT_DEC0",
|
||||
"EPWM_MINDB_ICL_LUT_DEC1",
|
||||
"EPWM_MINDB_ICL_LUT_DEC2",
|
||||
"EPWM_MINDB_ICL_LUT_DEC3",
|
||||
"EPWM_MINDB_ICL_LUT_DEC4",
|
||||
"EPWM_MINDB_ICL_LUT_DEC5",
|
||||
"EPWM_MINDB_ICL_LUT_DEC6",
|
||||
"EPWM_MINDB_ICL_LUT_DEC7"],
|
||||
minSelections: 0,
|
||||
options : EPWM_MINDB_ICL_LUT_B,
|
||||
onChange : onChangeEnableDisable
|
||||
|
||||
}]);
|
||||
}
|
||||
for (var ilcOutputIndex in device_driverlib_peripheral.EPWM_MINDB_ICL_LUT)
|
||||
{
|
||||
var ilcOutput = device_driverlib_peripheral.EPWM_MINDB_ICL_LUT[ilcOutputIndex];
|
||||
// change LUT output value output low -> Output low
|
||||
dbOutput_Configs = dbOutput_Configs.concat([
|
||||
{
|
||||
name: ilcOutput.name + dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName: ilcOutput.displayName.replace("PWMA/B", dbOutput.displayName.replace("DB output is ePWM", "")).replace("output", "Output").replace("value","Value").replace("on", "On").replace("decoding", "Decoding"),
|
||||
description: "",
|
||||
hidden: true,
|
||||
default: device_driverlib_peripheral.EPWM_MINDB_ICL_XBAR[0].name.replace("A/B", dbOutput.displayName.replace("DB output is ePWM", "")),
|
||||
options: device_driverlib_peripheral.EPWM_MINDB_ICL_XBAR
|
||||
}
|
||||
|
||||
]);
|
||||
}
|
||||
config = config.concat([{
|
||||
name: "GROUP_ICL_" +dbOutput.name.replace("EPWM_DB_OUTPUT_", ""),
|
||||
displayName: "ICL Channel " + dbOutput.name.replace("EPWM_DB_OUTPUT_", "").replace("EPWM_DB_OUTPUT_", ""),
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: dbOutput_Configs
|
||||
}]);
|
||||
|
||||
}
|
||||
var epwmMinimumDeadbandIllegalComboLogicSubmodule = {
|
||||
displayName: "EPWM Minimum Deadband and Illegal Combo Logic",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_MINDB",
|
||||
description: mindbLongDesc,
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmMinimumDeadbandIllegalComboLogicSubmodule;
|
||||
@@ -0,0 +1,234 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
let device_driverlib_hrpwm =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_hrpwm.js");
|
||||
|
||||
|
||||
function onChangeEnableDisable(inst, ui)
|
||||
{
|
||||
if (inst.epwmTimebase_phaseEnable == true)
|
||||
{
|
||||
ui.epwmTimebase_phaseShift.hidden = false;
|
||||
}
|
||||
else if (inst.epwmTimebase_phaseEnable == false)
|
||||
{
|
||||
ui.epwmTimebase_phaseShift.hidden = true;
|
||||
inst.epwmTimebase_phaseShift = 0; // Set default
|
||||
}
|
||||
|
||||
if (inst.epwmTimebase_periodLoadMode == "EPWM_PERIOD_SHADOW_LOAD")
|
||||
{
|
||||
ui.epwmTimebase_periodLoadEvent.hidden = false;
|
||||
}
|
||||
else if (inst.epwmTimebase_periodLoadMode == "EPWM_PERIOD_DIRECT_LOAD")
|
||||
{
|
||||
ui.epwmTimebase_periodLoadEvent.hidden = true;
|
||||
inst.epwmTimebase_periodLoadEvent = device_driverlib_peripheral.EPWM_PeriodShadowLoadMode[0].name; // Set default
|
||||
}
|
||||
|
||||
if (inst.epwmTimebase_counterMode == "EPWM_COUNTER_MODE_UP_DOWN")
|
||||
{
|
||||
ui.epwmTimebase_counterModeAfterSync.hidden = false;
|
||||
}
|
||||
else if (inst.epwmTimebase_counterMode == "EPWM_COUNTER_MODE_UP" ||
|
||||
inst.epwmTimebase_counterMode =="EPWM_COUNTER_MODE_DOWN" ||
|
||||
inst.epwmTimebase_counterMode == "EPWM_COUNTER_MODE_STOP_FREEZE")
|
||||
{
|
||||
ui.epwmTimebase_counterModeAfterSync.hidden = true;
|
||||
inst.epwmTimebase_counterModeAfterSync = device_driverlib_peripheral.EPWM_SyncCountMode[0].name;
|
||||
}
|
||||
}
|
||||
|
||||
var config = [
|
||||
{
|
||||
name : "epwmTimebase_emulationMode",
|
||||
displayName : "Emulation Mode",
|
||||
description : 'Behavior of the ePWM time-base counter during emulation events',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_EmulationMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_EmulationMode
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_clockDiv",
|
||||
displayName : "Time Base Clock Divider",
|
||||
description : 'CLKDIV: These bits select the time base clock pre-scale value, TBCLK = EPWMCLK/(HSPCLKDIV*CLKDIV)',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_ClockDivider[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_ClockDivider,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_hsClockDiv",
|
||||
displayName : "High Speed Clock Divider",
|
||||
description : 'HSPCLKDIV: These bits determine part of the time-base clock pre-scale value, TBCLK = EPWMCLK/(HSPCLKDIV*CLKDIV)',
|
||||
hidden : false,
|
||||
default : "EPWM_HSCLOCK_DIVIDER_2",
|
||||
options : device_driverlib_peripheral.EPWM_HSClockDivider,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_periodLoadMode",
|
||||
displayName : "Time Base Period Load Mode",
|
||||
description : 'Period load mode for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_PeriodLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_PeriodLoadMode,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_periodLoadEvent",
|
||||
displayName : "Time Base Period Load Event",
|
||||
description : 'Period load event for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_PeriodShadowLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_PeriodShadowLoadMode,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_period",
|
||||
displayName : "Time Base Period",
|
||||
description : 'Period for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_periodLink",
|
||||
displayName : "Time Base Period Link",
|
||||
description : 'Simultaneous write to the current ePWM module PRD register',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CurrentLink[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CurrentLink,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_periodGld",
|
||||
displayName : "Enable Time Base Period Global Load",
|
||||
description : 'Use global load configuration for PRD',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_counterValue",
|
||||
displayName : "Initial Counter Value",
|
||||
description : 'Initial Counter value for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_counterMode",
|
||||
displayName : "Counter Mode",
|
||||
description : 'Mode of the Counter value for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : "EPWM_COUNTER_MODE_STOP_FREEZE",
|
||||
options : device_driverlib_peripheral.EPWM_TimeBaseCountMode,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_counterModeAfterSync",
|
||||
displayName : 'Counter Mode After Sync',
|
||||
description : 'The direction the time-base counter (TBCTR) will count after a synchronization event occurs',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_SyncCountMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_SyncCountMode,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_phaseEnable",
|
||||
displayName : "Enable Phase Shift Load",
|
||||
description : 'Enable phase shift load for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_phaseShift",
|
||||
displayName : 'Phase Shift Value',
|
||||
description : 'Phase Shift Value for the Time Base Counter Submodule',
|
||||
hidden : true,
|
||||
default : 0,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_forceSyncPulse",
|
||||
displayName : 'Force a Sync Pulse',
|
||||
description : 'Force a sync pulse for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : false,
|
||||
},
|
||||
{
|
||||
name: "hrpwm_syncSource",
|
||||
displayName : "EPWMxSYNCPER Source Select",
|
||||
description : 'Selects the source of the EPWMSYNCPER signal that goes to the CMPSS and GPDAC',
|
||||
hidden : false,
|
||||
default : device_driverlib_hrpwm.HRPWM_SyncPulseSource[0].name,
|
||||
options : device_driverlib_hrpwm.HRPWM_SyncPulseSource
|
||||
},
|
||||
];
|
||||
|
||||
if (["F2807x", "F2837xD", "F2837xS", "F28004x"].includes(Common.getDeviceName()))
|
||||
{
|
||||
config.splice(config.length - 1, 0,
|
||||
{
|
||||
name: "epwmTimebase_syncOutPulseMode",
|
||||
displayName : "Sync Out Pulse",
|
||||
description : 'Sync Out Pulse for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_SyncOutPulseMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_SyncOutPulseMode,
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
config.splice.apply(config, [config.length - 1, 0].concat([
|
||||
{
|
||||
name: "epwmTimebase_syncInPulseSource",
|
||||
displayName : "Sync In Pulse Source",
|
||||
description : 'Sync in Pulse for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_SyncInPulseSource[1].name,
|
||||
options : device_driverlib_peripheral.EPWM_SyncInPulseSource,
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_syncOutPulseMode",
|
||||
displayName : "Sync Out Pulse",
|
||||
description : 'Sync Out Pulse for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
minSelections: 0,
|
||||
default : [],
|
||||
options : [
|
||||
{ name: "EPWM_SYNC_OUT_PULSE_ON_SOFTWARE", displayName: "Software force generated EPWM sync-out pulse" },
|
||||
{ name: "EPWM_SYNC_OUT_PULSE_ON_CNTR_ZERO", displayName: "Counter zero event generates EPWM sync-out pulse" },
|
||||
{ name: "EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_B", displayName: "Counter equal to CMPB event generates EPWM sync-out pulse" },
|
||||
{ name: "EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_C", displayName: "Counter equal to CMPC event generates EPWM sync-out pulse" },
|
||||
{ name: "EPWM_SYNC_OUT_PULSE_ON_CNTR_COMPARE_D", displayName: "Counter equal to CMPD event generates EPWM sync-out pulse" },
|
||||
{ name: "EPWM_SYNC_OUT_PULSE_ON_DCA_EVT1_SYNC", displayName: "DCA Event 1 Sync signal generates EPWM sync-out pulse" },
|
||||
{ name: "EPWM_SYNC_OUT_PULSE_ON_DCB_EVT1_SYNC", displayName: "DCB Event 1 Sync signal generates EPWM sync-out pulse" },
|
||||
{ name: "EPWM_SYNC_OUT_PULSE_ON_ALL", displayName: "Enable all the above sources" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "epwmTimebase_oneShotSyncOutTrigger",
|
||||
displayName : "One-Shot Sync Out Trigger",
|
||||
description : 'One-Shot Sync Out Trigger for the Time Base Counter Submodule',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_OneShotSyncOutTrigger[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_OneShotSyncOutTrigger,
|
||||
},
|
||||
]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
var epwmTimebaseSubmodule = {
|
||||
displayName: "EPWM Time Base",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_TB",
|
||||
description: "Enhanced Pulse Width Modulator Time Base Counter",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmTimebaseSubmodule;
|
||||
@@ -0,0 +1,220 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
|
||||
var TzEventConfigNames = [];
|
||||
var TzAdvEventConfigNames = [];
|
||||
|
||||
function onChangeUseAdvancedEPWMTripZoneActions(inst, ui)
|
||||
{
|
||||
for (var tzEventConfigNameIndex in TzEventConfigNames)
|
||||
{
|
||||
var tzEventConfigName = TzEventConfigNames[tzEventConfigNameIndex];
|
||||
//ui[tzEventConfigName].hidden = inst.epwmTripZone_useAdvancedEPWMTripZoneActions;
|
||||
if (inst.epwmTripZone_useAdvancedEPWMTripZoneActions)
|
||||
{
|
||||
ui[tzEventConfigName].hidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui[tzEventConfigName].hidden = false;
|
||||
inst[tzEventConfigName] = device_driverlib_peripheral.EPWM_TripZoneAction[0].name; // Set to default
|
||||
}
|
||||
}
|
||||
for (var tzAdvEventConfigNameIndex in TzAdvEventConfigNames)
|
||||
{
|
||||
var tzAdvEventConfigName = TzAdvEventConfigNames[tzAdvEventConfigNameIndex];
|
||||
//ui[tzAdvEventConfigName].hidden = !inst.epwmTripZone_useAdvancedEPWMTripZoneActions;
|
||||
if (!inst.epwmTripZone_useAdvancedEPWMTripZoneActions)
|
||||
{
|
||||
ui[tzAdvEventConfigName].hidden = true;
|
||||
inst[tzAdvEventConfigName] = device_driverlib_peripheral.EPWM_TripZoneAdvancedAction[0].name; // Set to default
|
||||
}
|
||||
else
|
||||
{
|
||||
ui[tzAdvEventConfigName].hidden = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Array of configurables that are common across device families */
|
||||
var config = [
|
||||
{
|
||||
name: "epwmTripZone_useAdvancedEPWMTripZoneActions",
|
||||
displayName : "Use Advanced EPWM Trip Zone Actions",
|
||||
description : 'Check this to use Advanced EPWM trip zone actions. Uncheck to use legacy (TZCTL2[ETZE])',
|
||||
hidden : false,
|
||||
default : false,
|
||||
onChange : onChangeUseAdvancedEPWMTripZoneActions
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
for (var tzEventIndex in device_driverlib_peripheral.EPWM_TripZoneEvent)
|
||||
{
|
||||
var tzEvent = device_driverlib_peripheral.EPWM_TripZoneEvent[tzEventIndex];
|
||||
var tzEventName = tzEvent.name.replace("EPWM_TZ_ACTION_EVENT_", "");
|
||||
var tzEventConfig = {
|
||||
name: "epwmTripZone_" + tzEvent.name,
|
||||
displayName : tzEventName + " Event",
|
||||
description : 'The action to take on ' + tzEvent.name + ". " + "(" + tzEvent.displayName + ")",
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_TripZoneAction[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_TripZoneAction
|
||||
}
|
||||
config.push(tzEventConfig);
|
||||
TzEventConfigNames.push(tzEventConfig.name);
|
||||
}
|
||||
|
||||
|
||||
for (var tzEventIndex in device_driverlib_peripheral.EPWM_TripZoneAdvancedEvent)
|
||||
{
|
||||
var tzEvent = device_driverlib_peripheral.EPWM_TripZoneAdvancedEvent[tzEventIndex];
|
||||
var tzEventName = tzEvent.name.replace("EPWM_TZ_ADV_ACTION_EVENT_", "");
|
||||
var tzEventConfig = {
|
||||
name: "epwmTripZone_" + tzEvent.name,
|
||||
displayName : tzEventName + " Event (Adv)",
|
||||
description : 'The action to take on ' + tzEvent.name + ". " + "(" + tzEvent.displayName + ")",
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_TripZoneAdvancedAction[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_TripZoneAdvancedAction
|
||||
}
|
||||
config.push(tzEventConfig);
|
||||
TzAdvEventConfigNames.push(tzEventConfig.name);
|
||||
}
|
||||
|
||||
for (var epwmX of ["A", "B"])
|
||||
{
|
||||
for (var tzEventIndex in device_driverlib_peripheral.EPWM_TripZoneAdvDigitalCompareEvent)
|
||||
{
|
||||
var tzEvent = device_driverlib_peripheral.EPWM_TripZoneAdvDigitalCompareEvent[tzEventIndex];
|
||||
var tzEventName = tzEvent.name.replace("EPWM_TZ_ADV_ACTION_EVENT_", "").replace("DCx", "DC" + epwmX);
|
||||
var tzEventConfig = {
|
||||
name: "epwmTripZone_" + tzEvent.name + "_" + epwmX,
|
||||
displayName : tzEventName + " Event (Adv)",
|
||||
description : 'For EPWMx' + epwmX + ' ,the action to take on ' + tzEvent.name + ". " + "(" + tzEvent.displayName + ")",
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_TripZoneAdvancedAction[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_TripZoneAdvancedAction
|
||||
}
|
||||
config.push(tzEventConfig);
|
||||
TzAdvEventConfigNames.push(tzEventConfig.name);
|
||||
}
|
||||
}
|
||||
|
||||
var oneShotConfig = [
|
||||
{
|
||||
name: "epwmTripZone_oneShotSource",
|
||||
displayName : "One-Shot Source",
|
||||
description : 'Check to enable the source to the One-Shot OR gate',
|
||||
hidden : false,
|
||||
minSelections : 0,
|
||||
default : [],
|
||||
options : device_driverlib_peripheral.EPWM_TZ_SIGNAL.slice(8,16)
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
var cbcConfig = [
|
||||
{
|
||||
name: "epwmTripZone_cbcSource",
|
||||
displayName : "CBC Source",
|
||||
description : 'Check to enable the source to the CBC OR gate',
|
||||
hidden : false,
|
||||
minSelections : 0,
|
||||
default : [],
|
||||
options : device_driverlib_peripheral.EPWM_TZ_SIGNAL.slice(0,8)
|
||||
},
|
||||
{
|
||||
name: "epwmTripZone_cbcPulse",
|
||||
displayName : "CBC Latch Clear Signal",
|
||||
description : 'Select the CBC Trip Zone Latch Clear Signal (TZCLR[CBCPULSE])',
|
||||
hidden : false,
|
||||
default : device_driverlib_peripheral.EPWM_CycleByCycleTripZoneClearMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_CycleByCycleTripZoneClearMode
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
var interruptConfig = [
|
||||
{
|
||||
name: "epwmTripZone_tzInterruptSource",
|
||||
displayName : "TZ Interrupt Source (ORed)",
|
||||
description : 'Select the all the signals which should be enabled to generate a TZINT.',
|
||||
hidden : false,
|
||||
minSelections : 0,
|
||||
default : [],
|
||||
options : device_driverlib_peripheral.EPWM_TZ_INTERRUPT
|
||||
},
|
||||
{
|
||||
name : "epwmTripZone_registerInterrupts",
|
||||
displayName : "Register Interrupt Handler",
|
||||
description : 'Whether or not to register interrupt handlers in the interrupt module.',
|
||||
hidden : false,
|
||||
default : false
|
||||
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
if(["F28P65x"].includes(Common.getDeviceName()))
|
||||
{
|
||||
var tripOutConfig = [
|
||||
{
|
||||
name: "epwmTripZone_tripOut",
|
||||
displayName : "TRIPOUT Source",
|
||||
description : 'Check to enable the source to the TRIPOUT Mux',
|
||||
hidden : false,
|
||||
minSelections : 0,
|
||||
default : [],
|
||||
options : device_driverlib_peripheral.EPWM_selectTripOutSource
|
||||
},
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
config = config.concat(oneShotConfig);
|
||||
config = config.concat(cbcConfig);
|
||||
config = config.concat(interruptConfig);
|
||||
if(["F28P65x"].includes(Common.getDeviceName()))
|
||||
{
|
||||
config = config.concat(tripOutConfig);
|
||||
}
|
||||
|
||||
|
||||
var epwmTripZoneSubmodule = {
|
||||
displayName: "EPWM Trip Zone",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_TZ",
|
||||
description: "Enhanced Pulse Width Modulator Trip Zone",
|
||||
config: config,
|
||||
moduleInstances: (inst) => {
|
||||
if (inst.epwmTripZone_registerInterrupts)
|
||||
{
|
||||
return [{
|
||||
name: "epwmTZInt",
|
||||
displayName: "EPWM TZ Interrupt ",
|
||||
moduleName: "/driverlib/interrupt.js",
|
||||
collapsed: true,
|
||||
args: {
|
||||
$name : inst.$name + "_TZ_INT",
|
||||
int : "INT_" + inst.$name,
|
||||
pinmuxPeripheralModule : "epwm",
|
||||
driverlibInt: "INT_#_TZ"
|
||||
}
|
||||
}]
|
||||
}
|
||||
return [];
|
||||
},
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmTripZoneSubmodule;
|
||||
@@ -0,0 +1,925 @@
|
||||
let Common = system.getScript("/driverlib/Common.js");
|
||||
let Pinmux = system.getScript("/driverlib/pinmux.js");
|
||||
let device_driverlib_peripheral =
|
||||
system.getScript("/driverlib/device_driverlib_peripherals/" +
|
||||
Common.getDeviceName().toLowerCase() + "_epwm.js");
|
||||
var shadowRegisterReloadNumberofTimesOptions = [
|
||||
{ name : "1", displayName: "One Period"},
|
||||
{ name : "2", displayName: "Two Periods" },
|
||||
{ name : "3", displayName: "Three Periods"},
|
||||
{ name : "4", displayName: "Four Periods"},
|
||||
{ name : "5", displayName: "Five Periods"},
|
||||
{ name : "6", displayName: "Six Periods"},
|
||||
{ name : "7", displayName: "Seven Periods"},
|
||||
{ name : "8", displayName: "Eight Periods"}
|
||||
]
|
||||
function generateActiveRegistersConfig(reg_name)
|
||||
{
|
||||
let xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(0, 8);
|
||||
let xcmp_RegConfig = [];
|
||||
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
xcmp_RegConfig = xcmp_RegConfig.concat(
|
||||
{
|
||||
name: "epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", ""),
|
||||
displayName: xcmp_RegArr[xcmp_Reg_Index].displayName.replace("_ACTIVE", " Active "),
|
||||
description: "Set Active Register to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
}
|
||||
)
|
||||
}
|
||||
return xcmp_RegConfig
|
||||
}
|
||||
function generateShadowRegisters1Config(reg_name)
|
||||
{
|
||||
let xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(9, 17);
|
||||
let xcmp_RegConfig = [];
|
||||
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
xcmp_RegConfig = xcmp_RegConfig.concat(
|
||||
{
|
||||
name: "epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", ""),
|
||||
displayName: xcmp_RegArr[xcmp_Reg_Index].displayName.replace("_SHADOW", " Shadow "),
|
||||
description: "Set Active Register to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
}
|
||||
)
|
||||
}
|
||||
return xcmp_RegConfig
|
||||
}
|
||||
function generateShadowRegisters2Config(reg_name)
|
||||
{
|
||||
let xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(18, 26);
|
||||
let xcmp_RegConfig = [];
|
||||
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
xcmp_RegConfig = xcmp_RegConfig.concat(
|
||||
{
|
||||
name: "epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", ""),
|
||||
displayName: xcmp_RegArr[xcmp_Reg_Index].displayName.replace("_SHADOW", " Shadow "),
|
||||
description: "Set Active Register to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
}
|
||||
)
|
||||
}
|
||||
return xcmp_RegConfig
|
||||
}
|
||||
function generateShadowRegisters3Config(reg_name)
|
||||
{
|
||||
let xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(27, 35);
|
||||
let xcmp_RegConfig = [];
|
||||
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
xcmp_RegConfig = xcmp_RegConfig.concat(
|
||||
{
|
||||
name: "epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", ""),
|
||||
displayName: xcmp_RegArr[xcmp_Reg_Index].displayName.replace("_SHADOW", " Shadow "),
|
||||
description: "Set Active Register to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
}
|
||||
)
|
||||
}
|
||||
return xcmp_RegConfig
|
||||
}
|
||||
// Generate XAQ events
|
||||
function generateXAQConfig(reg_name, EPWMxAorB)
|
||||
{
|
||||
let group_xaq = [];
|
||||
if(reg_name == "XCMPA"){
|
||||
for(var xcmp_set_index in device_driverlib_peripheral.EPWM_XCMP)
|
||||
{
|
||||
let xcmp_aq_event_config = [];
|
||||
let xcmp_set = device_driverlib_peripheral.EPWM_XCMP[xcmp_set_index];
|
||||
for(var xcmp_aq_events_index in device_driverlib_peripheral.EPWM_XCMPActionQualifierOutputEvent)
|
||||
{
|
||||
let xcmp_aq_events = device_driverlib_peripheral.EPWM_XCMPActionQualifierOutputEvent[xcmp_aq_events_index];
|
||||
xcmp_aq_event_config = xcmp_aq_event_config.concat([
|
||||
{
|
||||
name: reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", ""),
|
||||
displayName: xcmp_aq_events.displayName,
|
||||
description: "",
|
||||
longDescription: "",
|
||||
hidden: true,
|
||||
default: device_driverlib_peripheral.EPWM_ActionQualifierOutput[0].name,
|
||||
options: device_driverlib_peripheral.EPWM_ActionQualifierOutput
|
||||
}
|
||||
])
|
||||
}
|
||||
group_xaq = group_xaq.concat(
|
||||
{
|
||||
name: "GROUP_XAQ_" + EPWMxAorB + "_" + reg_name + "_" + xcmp_set.name,
|
||||
displayName: xcmp_set.displayName,
|
||||
description: "",
|
||||
longDescription: "When XCMP mode is enabled, AQ can now have up to three shadow buffer levels with their own AQ events",
|
||||
config: xcmp_aq_event_config
|
||||
}
|
||||
)
|
||||
}
|
||||
}else if (reg_name == "XCMPB"){
|
||||
for(var xcmp_set_index in device_driverlib_peripheral.EPWM_XCMP)
|
||||
{
|
||||
let xcmp_set = device_driverlib_peripheral.EPWM_XCMP[xcmp_set_index];
|
||||
let xcmp_aq_event_config = [];
|
||||
// Grab only the action qualifiers for XCMP5-8 when XCMP is split between cmpb and cmpa
|
||||
let xcmpb_options = device_driverlib_peripheral.EPWM_XCMPActionQualifierOutputEvent.slice(4,9);
|
||||
for(var xcmp_aq_events_index in xcmpb_options)
|
||||
{
|
||||
let xcmp_aq_events = xcmpb_options[xcmp_aq_events_index];
|
||||
xcmp_aq_event_config = xcmp_aq_event_config.concat([
|
||||
{
|
||||
name: reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", ""),
|
||||
displayName: xcmp_aq_events.displayName,
|
||||
description: "",
|
||||
longDescription: "",
|
||||
hidden: true,
|
||||
default: device_driverlib_peripheral.EPWM_ActionQualifierOutput[0].name,
|
||||
options: device_driverlib_peripheral.EPWM_ActionQualifierOutput
|
||||
}
|
||||
])
|
||||
}
|
||||
group_xaq = group_xaq.concat(
|
||||
{
|
||||
name: "GROUP_XAQ_" + EPWMxAorB + "_" + reg_name + "_" + xcmp_set.name,
|
||||
displayName: xcmp_set.displayName,
|
||||
description: "",
|
||||
longDescription: "When XCMP mode is enabled, AQ can now have up to three shadow buffer levels with their own AQ events",
|
||||
config: xcmp_aq_event_config
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
return group_xaq;
|
||||
}
|
||||
|
||||
function onChangeActiveAndShdwRegistersConfig(inst, ui, reg_name, startIndex, stopIndex)
|
||||
{
|
||||
// this not only sets the active and shadow buffer, but it also shows the action qualifier active and shadow buffers
|
||||
let xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(0,8);
|
||||
let xcmp_Shdw1RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(9,17);
|
||||
let xcmp_Shdw2RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(18,26);
|
||||
let xcmp_Shdw3RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(27,35);
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
if(xcmp_Reg_Index >= startIndex && xcmp_Reg_Index < stopIndex)
|
||||
{
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = false;
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_Shdw1RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = false;
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_Shdw2RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = false;
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_Shdw3RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = false;
|
||||
|
||||
}else
|
||||
{
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = true;
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_Shdw1RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = true;
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_Shdw2RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = true;
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_Shdw3RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = true;
|
||||
}
|
||||
}
|
||||
// show action qualifier events when user chooses
|
||||
for(var xcmp_set_index in device_driverlib_peripheral.EPWM_XCMP)
|
||||
{
|
||||
let xcmp_set = device_driverlib_peripheral.EPWM_XCMP[xcmp_set_index];
|
||||
for(var xcmp_aq_events_index in device_driverlib_peripheral.EPWM_XCMPActionQualifierOutputEvent)
|
||||
{
|
||||
if(xcmp_aq_events_index >= startIndex && xcmp_aq_events_index < stopIndex)
|
||||
{
|
||||
let xcmp_aq_events = device_driverlib_peripheral.EPWM_XCMPActionQualifierOutputEvent[xcmp_aq_events_index];
|
||||
if(reg_name == "XCMPA")
|
||||
{
|
||||
ui[reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", "")].hidden = false;
|
||||
}else if(reg_name == "XCMPB")
|
||||
{
|
||||
ui[ reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", "")].hidden = false;
|
||||
}
|
||||
}else
|
||||
{
|
||||
let xcmp_aq_events = device_driverlib_peripheral.EPWM_XCMPActionQualifierOutputEvent[xcmp_aq_events_index];
|
||||
if((xcmp_aq_events.name == "EPWM_AQ_OUTPUT_ON_TIMEBASE_XCMP1" || xcmp_aq_events.name == "EPWM_AQ_OUTPUT_ON_TIMEBASE_XCMP2" ||
|
||||
xcmp_aq_events.name == "EPWM_AQ_OUTPUT_ON_TIMEBASE_XCMP3" || xcmp_aq_events.name == "EPWM_AQ_OUTPUT_ON_TIMEBASE_XCMP4") && reg_name == "XCMPB")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(reg_name == "XCMPA")
|
||||
{
|
||||
ui[ reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", "")].hidden = true;
|
||||
}else if(reg_name == "XCMPB")
|
||||
{
|
||||
ui[ reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", "")].hidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add higher level before calling on change allocate registers
|
||||
|
||||
function setAllocateRegistersXCMPANoSplitorSplit(inst, ui)
|
||||
{
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_NONE_CMPA")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 0);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_1_CMPA")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 1);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_2_CMPA")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 2);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_3_CMPA")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 3);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_4_CMPA")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 4);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_5_CMPA" && !inst.epwmXCMP_RegisterSplit_enable)
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 5);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_6_CMPA" && !inst.epwmXCMP_RegisterSplit_enable)
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 6);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_7_CMPA" && !inst.epwmXCMP_RegisterSplit_enable)
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 7);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"] == "EPWM_XCMP_8_CMPA" && !inst.epwmXCMP_RegisterSplit_enable)
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPA", 0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
function setAllocateRegistersSplitXCMPB(inst, ui)
|
||||
{
|
||||
if(inst["epwmXCMP_selectAllocationXCMPB_Split"] == "EPWM_XCMP_5_CMPB")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPB", 4, 5);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPB_Split"] == "EPWM_XCMP_6_CMPB")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPB", 4, 6);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPB_Split"] == "EPWM_XCMP_7_CMPB")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPB", 4, 7);
|
||||
}
|
||||
if(inst["epwmXCMP_selectAllocationXCMPB_Split"] == "EPWM_XCMP_8_CMPB")
|
||||
{
|
||||
onChangeActiveAndShdwRegistersConfig(inst, ui, "XCMPB", 4, 8);
|
||||
}
|
||||
}
|
||||
function hideXCMPregisters(inst, ui, reg_name)
|
||||
{
|
||||
let xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(0, 8);
|
||||
// hide active register
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
if(reg_name == "XCMPC" || reg_name == "XCMPD")
|
||||
{
|
||||
ui["epwmXCMP_set" + reg_name].hidden = true;
|
||||
inst["epwmXCMP_set" + reg_name] = 0;
|
||||
}else
|
||||
{
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = true;
|
||||
inst["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")] = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(9,17);
|
||||
// hide shadow buffer set 1
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
if(reg_name == "XCMPC" || reg_name == "XCMPD")
|
||||
{
|
||||
ui["epwmXCMP_setShadowRegisters1" + reg_name].hidden = true;
|
||||
inst["epwmXCMP_setShadowRegisters1" + reg_name] = 0;
|
||||
}else
|
||||
{
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = true;
|
||||
inst["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")] = 0;
|
||||
}
|
||||
}
|
||||
xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(18,26);
|
||||
// hide shadow buffer set 2
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
if(reg_name == "XCMPC" || reg_name == "XCMPD")
|
||||
{
|
||||
ui["epwmXCMP_setShadowRegisters2" + reg_name].hidden = true;
|
||||
inst["epwmXCMP_setShadowRegisters2" + reg_name] = 0;
|
||||
|
||||
}else
|
||||
{
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = true;
|
||||
inst["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")] = 0;
|
||||
}
|
||||
}
|
||||
xcmp_RegArr = device_driverlib_peripheral.EPWM_XCMPReg.slice(27,35);
|
||||
// hide shadow buffer set 3
|
||||
for(var xcmp_Reg_Index in xcmp_RegArr)
|
||||
{
|
||||
if(reg_name == "XCMPC" || reg_name == "XCMPD")
|
||||
{
|
||||
ui["epwmXCMP_setShadowRegisters3" + reg_name].hidden = true;
|
||||
inst["epwmXCMP_setShadowRegisters3" + reg_name] = 0;
|
||||
}else
|
||||
{
|
||||
ui["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")].hidden = true;
|
||||
inst["epwmXCMP_set" + reg_name + "_" + xcmp_RegArr[xcmp_Reg_Index].name.replace("EPWM_", "")] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide action qualifier events
|
||||
for(var xcmp_set_index in device_driverlib_peripheral.EPWM_XCMP)
|
||||
{
|
||||
let xcmp_set = device_driverlib_peripheral.EPWM_XCMP[xcmp_set_index];
|
||||
for(var xcmp_aq_events_index in device_driverlib_peripheral.EPWM_XCMPActionQualifierOutputEvent)
|
||||
{
|
||||
let xcmp_aq_events = device_driverlib_peripheral.EPWM_XCMPActionQualifierOutputEvent[xcmp_aq_events_index];
|
||||
if((xcmp_aq_events.name == "EPWM_AQ_OUTPUT_ON_TIMEBASE_XCMP1" || xcmp_aq_events.name == "EPWM_AQ_OUTPUT_ON_TIMEBASE_XCMP2" ||
|
||||
xcmp_aq_events.name == "EPWM_AQ_OUTPUT_ON_TIMEBASE_XCMP3" || xcmp_aq_events.name == "EPWM_AQ_OUTPUT_ON_TIMEBASE_XCMP4") && reg_name == "XCMPB")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// No action qualifiers for cmpc/cmpd
|
||||
if(reg_name == "XCMPC" || reg_name == "XCMPD"){
|
||||
break;
|
||||
}else
|
||||
{
|
||||
if(reg_name == "XCMPA")
|
||||
{
|
||||
ui[ reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", "")].hidden = true;
|
||||
inst[ reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", "")] = "EPWM_AQ_OUTPUT_NO_CHANGE";
|
||||
}else if(reg_name == "XCMPB")
|
||||
{
|
||||
ui[reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", "")].hidden = true;
|
||||
inst[ reg_name + "_" + xcmp_set.name.replace("EPWM_XCMP_", "") + xcmp_aq_events.name.replace("EPWM_AQ", "")] = "EPWM_AQ_OUTPUT_NO_CHANGE";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeEnableDisable(inst, ui)
|
||||
{
|
||||
if(inst.epwmXCMP_enable)
|
||||
{
|
||||
|
||||
// show check box to enable split
|
||||
ui["epwmXCMP_RegisterSplit_enable"].hidden = false;
|
||||
// show XCMPA since that will be default option when split or no split is chosen
|
||||
ui["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"].hidden = false;
|
||||
|
||||
// show XTBPRD options
|
||||
ui["epwmXCMP_setRegisters_XTBPRD"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters1_XTBPRD"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters2_XTBPRD"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters3_XTBPRD"].hidden = false;
|
||||
|
||||
// show XMINMAX options
|
||||
ui["epwmXCMP_setRegisters_XMIN"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters1_XMIN"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters2_XMIN"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters3_XMIN"].hidden = false;
|
||||
ui["epwmXCMP_setRegisters_XMAX"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters1_XMAX"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters2_XMAX"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters3_XMAX"].hidden = false;
|
||||
// show xcmpa load options
|
||||
ui["epwmXCMP_RegisterFrcLoad_enable"].hidden = false;
|
||||
ui["epwmXCMP_selectLoadMode"].hidden = false;
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoad"].hidden = false;
|
||||
ui["epwmXCMP_selectNumberShadowRegisterLevels"].hidden = false;
|
||||
ui["epwmXCMP_selectRepeatCountShadowRegisterLevel2"].hidden = false;
|
||||
ui["epwmXCMP_selectRepeatCountShadowRegisterLevel3"].hidden = false;
|
||||
// show xmpc load options
|
||||
ui["epwmXCMP_setShadowRegisters1XCMPC"].hidden = false;
|
||||
ui["epwmXCMP_setXCMPC"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters2XCMPC"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters3XCMPC"].hidden = false;
|
||||
|
||||
// show xmpd load options
|
||||
ui["epwmXCMP_setShadowRegisters1XCMPD"].hidden = false;
|
||||
ui["epwmXCMP_setXCMPD"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters2XCMPD"].hidden = false;
|
||||
ui["epwmXCMP_setShadowRegisters3XCMPD"].hidden = false;
|
||||
// show xcmp loading for all
|
||||
ui["epwmXCMP_RegisterLoad_enable"].hidden = false;
|
||||
if(inst.epwmXCMP_RegisterSplit_enable)
|
||||
{
|
||||
// if split is enabled, show XCMPB options, show XCMPA split options
|
||||
ui["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"].hidden = false;
|
||||
ui["epwmXCMP_selectAllocationXCMPB_Split"].hidden = false;
|
||||
// show load options for xcmpb
|
||||
setAllocateRegistersXCMPANoSplitorSplit(inst, ui);
|
||||
setAllocateRegistersSplitXCMPB(inst, ui);
|
||||
}else if(!inst.epwmXCMP_RegisterSplit_enable)
|
||||
{
|
||||
ui["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"].hidden = false;
|
||||
// if split is not enabled, hide XCMPB options
|
||||
ui["epwmXCMP_selectAllocationXCMPB_Split"].hidden = true;
|
||||
inst.epwmXCMP_selectAllocationXCMPB_Split = "EPWM_XCMP_5_CMPB";
|
||||
setAllocateRegistersXCMPANoSplitorSplit(inst, ui);
|
||||
hideXCMPregisters(inst, ui, "XCMPB");
|
||||
|
||||
}
|
||||
}else
|
||||
{
|
||||
// reset settings
|
||||
// hide all the xcmpa split and no split options, set split enabled to false when XCMP mode is disabled
|
||||
inst.epwmXCMP_RegisterSplit_enable = false;
|
||||
inst.epwmXCMP_selectAllocationXCMPA_NoSplitorSplit = "EPWM_XCMP_NONE_CMPA";
|
||||
inst.epwmXCMP_selectAllocationXCMPB_Split = "EPWM_XCMP_5_CMPB";
|
||||
ui["epwmXCMP_selectAllocationXCMPA_NoSplitorSplit"].hidden = true;
|
||||
// hide all the xcmpb split options
|
||||
ui["epwmXCMP_selectAllocationXCMPB_Split"].hidden = true;
|
||||
ui["epwmXCMP_RegisterSplit_enable"].hidden = true;
|
||||
|
||||
// hide all the loading options XCMPA, set the default load mode to load once for all xcmpc registers
|
||||
inst.epwmXCMP_selectAllocationXCMPA_NoSplitorSplit = "EPWM_XCMP_NONE_CMPA";
|
||||
inst.epwmXCMP_selectNumberShadowRegisterLevels = "EPWM_XCMP_XLOADCTL_SHDWLEVEL_0";
|
||||
inst["epwmXCMP_selectLoadMode"] = "EPWM_XCMP_XLOADCTL_LOADMODE_LOADONCE";
|
||||
inst.epwmXCMP_selectShadowRegisterLevelLoad = "EPWM_XCMP_XLOADCTL_SHDWBUFPTR_NULL";
|
||||
inst.epwmXCMP_selectRepeatCountShadowRegisterLevel2 = "1";
|
||||
inst.epwmXCMP_selectRepeatCountShadowRegisterLevel3 = "1";
|
||||
inst.epwmXCMP_RegisterFrcLoad_enable = false;
|
||||
|
||||
ui["epwmXCMP_RegisterFrcLoad_enable"].hidden = true;
|
||||
ui["epwmXCMP_selectLoadMode"].hidden = true;
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoad"].hidden = true;
|
||||
ui["epwmXCMP_selectNumberShadowRegisterLevels"].hidden = true;
|
||||
ui["epwmXCMP_selectRepeatCountShadowRegisterLevel2"].hidden = true;
|
||||
ui["epwmXCMP_selectRepeatCountShadowRegisterLevel3"].hidden = true;
|
||||
// hide all set register options and hide all AQ event output configurations
|
||||
hideXCMPregisters(inst, ui, "XCMPA");
|
||||
hideXCMPregisters(inst, ui, "XCMPB");
|
||||
hideXCMPregisters(inst, ui, "XCMPC");
|
||||
hideXCMPregisters(inst, ui, "XCMPD");
|
||||
// hide all tbprd options
|
||||
ui["epwmXCMP_setRegisters_XTBPRD"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters1_XTBPRD"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters2_XTBPRD"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters3_XTBPRD"].hidden = true;
|
||||
inst["epwmXCMP_setRegisters_XTBPRD"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters1_XTBPRD"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters2_XTBPRD"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters3_XTBPRD"] = 0;
|
||||
// show XMINMAX options
|
||||
ui["epwmXCMP_setRegisters_XMIN"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters1_XMIN"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters2_XMIN"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters3_XMIN"].hidden = true;
|
||||
ui["epwmXCMP_setRegisters_XMAX"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters1_XMAX"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters2_XMAX"].hidden = true;
|
||||
ui["epwmXCMP_setShadowRegisters3_XMAX"].hidden = true;
|
||||
inst["epwmXCMP_setRegisters_XMIN"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters1_XMIN"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters2_XMIN"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters3_XMIN"] = 0;
|
||||
inst["epwmXCMP_setRegisters_XMAX"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters1_XMAX"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters2_XMAX"] = 0;
|
||||
inst["epwmXCMP_setShadowRegisters3_XMAX"] = 0;
|
||||
// hide all xmp load
|
||||
ui["epwmXCMP_RegisterLoad_enable"].hidden = true;
|
||||
inst.epwmXCMP_RegisterLoad_enable = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeLoadMode(inst, ui)
|
||||
{
|
||||
if(inst.epwmXCMP_selectLoadMode == "EPWM_XCMP_XLOADCTL_LOADMODE_LOADONCE" && inst.epwmXCMP_RegisterLoadXCMPA_enable)
|
||||
{
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoad"].hidden = false;
|
||||
}
|
||||
else if(inst.epwmXCMP_selectLoadModeXCMPB == "EPWM_XCMP_XLOADCTL_LOADMODE_LOADONCE" && inst.epwmXCMP_RegisterLoadXCMPB_enable)
|
||||
{
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoadXCMPB"].hidden = false;
|
||||
}
|
||||
else if(inst.epwmXCMP_selectLoadModeXCMPC == "EPWM_XCMP_XLOADCTL_LOADMODE_LOADONCE" && inst.epwmXCMP_RegisterLoadXCMPC_enable)
|
||||
{
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoadXCMPC"].hidden = false;
|
||||
}
|
||||
else if(inst.epwmXCMP_selectLoadModeXCMPD == "EPWM_XCMP_XLOADCTL_LOADMODE_LOADONCE" && inst.epwmXCMP_RegisterLoadXCMPD_enable)
|
||||
{
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoadXCMPD"].hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoad"].hidden = true;
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoadXCMPB"].hidden = true;
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoadXCMPC"].hidden = true;
|
||||
ui["epwmXCMP_selectShadowRegisterLevelLoadXCMPD"].hidden = true;
|
||||
|
||||
}
|
||||
}
|
||||
var config = [
|
||||
{
|
||||
name: "epwmXCMP_enable",
|
||||
displayName: "Enable XCMP Mode",
|
||||
description: "If XCMP mode is disabled, EPWM will behave like Type4",
|
||||
hidden: false,
|
||||
default: false,
|
||||
onChange: onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_RegisterSplit_enable",
|
||||
displayName: "Enable Split XCMP Registers",
|
||||
description: "Split the XCMP registers between CMPA and CMPB. CMPA and CMPB can have max of 4 registers allocated. ",
|
||||
hidden: true,
|
||||
default: false,
|
||||
onChange: onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_RegisterLoad_enable",
|
||||
displayName: "Enable X Load",
|
||||
description: "Enables register loading of shadow buffers for all XCMP registers",
|
||||
hidden: true,
|
||||
default: false,
|
||||
onChange: onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_RegisterFrcLoad_enable",
|
||||
displayName: "Force X Load",
|
||||
description: "Software force register loading of shadow buffers for all XCMP registers",
|
||||
hidden: true,
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_selectNumberShadowRegisterLevels",
|
||||
displayName : "Number of Shadow Buffer Levels",
|
||||
description : 'Number of shadow buffer levels to configure, you can use one or two or all 3 shadow buffer sets',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_XCMP_XLOADCTL_SHDWLEVEL[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_XCMP_XLOADCTL_SHDWLEVEL,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_selectLoadMode",
|
||||
displayName : "Load Mode",
|
||||
description : 'Loading once will behave like type4. Loading Multiple will cycle through all shadow buffer sets and load them at the end of period.',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_XCMPXloadCtlLoadMode[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_XCMPXloadCtlLoadMode,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_selectShadowRegisterLevelLoad",
|
||||
displayName : "Shadow Buffer Level to Load Once",
|
||||
description : 'Can load to active registers from either shadow buffer set 3, 2 or 1 first',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_XCMP_XLOADCTL_SHDWBUFPTR[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_XCMP_XLOADCTL_SHDWBUFPTR,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_selectRepeatCountShadowRegisterLevel2",
|
||||
displayName : "Number of Times to Repeat Shadow Buffer Set 2",
|
||||
description : 'Number of times to repeat a shadow buffer set each PWM cycle, can only be applied to shadow set 2 and 3',
|
||||
hidden : true,
|
||||
default : shadowRegisterReloadNumberofTimesOptions[0].name,
|
||||
options : shadowRegisterReloadNumberofTimesOptions
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_selectRepeatCountShadowRegisterLevel3",
|
||||
displayName : "Number of Times to Repeat Shadow Buffer Set 3",
|
||||
description : 'Number of times to repeat a shadow buffer set each PWM cycle, can only be applied to shadow set 2 and 3',
|
||||
hidden : true,
|
||||
default : shadowRegisterReloadNumberofTimesOptions[0].name,
|
||||
options : shadowRegisterReloadNumberofTimesOptions
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPA",
|
||||
displayName: "XCMPA",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmXCMP_selectAllocationXCMPA_NoSplitorSplit",
|
||||
displayName : "XCMP Registers to Allocate",
|
||||
description : 'XCMP registers can use all 8 XCMPA registers or can use a selection of the 8 XCMPA registers',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_XCMP_ALLOC_CMPA[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_XCMP_ALLOC_CMPA,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPA_ACTIVE_REGISTERS",
|
||||
displayName: "Active Registers",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPA_SHDW_REGISTERS1",
|
||||
displayName: "Shadow Buffer Set 1",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPA_SHDW_REGISTERS2",
|
||||
displayName: "Shadow Buffer Set 2",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPA_SHDW_REGISTERS3",
|
||||
displayName: "Shadow Buffer Set 3",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPB",
|
||||
displayName: "XCMPB",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmXCMP_selectAllocationXCMPB_Split",
|
||||
displayName : "XCMP Registers to Allocate",
|
||||
description : 'XCMP registers can use all 8 XCMPA registers or can use a selection of the 8 XCMPA registers',
|
||||
hidden : true,
|
||||
default : device_driverlib_peripheral.EPWM_XCMP_ALLOC_CMPB[0].name,
|
||||
options : device_driverlib_peripheral.EPWM_XCMP_ALLOC_CMPB,
|
||||
onChange : onChangeEnableDisable
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPB_ACTIVE_REGISTERS",
|
||||
displayName: "Active Registers",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPB_SHDW_REGISTERS1",
|
||||
displayName: "Shadow Buffer Set 1",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPB_SHDW_REGISTERS2",
|
||||
displayName: "Shadow Buffer Set 2",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPB_SHDW_REGISTERS3",
|
||||
displayName: "Shadow Buffer Set 3",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPC",
|
||||
displayName: "XCMPC",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmXCMP_setXCMPC",
|
||||
displayName: "XCMPC active register value",
|
||||
description: "Set Active Register to a value, XCMPC can only have one active register allocated to it",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters1XCMPC",
|
||||
displayName: "XCMPC Shadow 1",
|
||||
description: "Set shadow buffer 1 to a value, this value will be loaded every PWM Cycle",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters2XCMPC",
|
||||
displayName: "XCMPC Shadow 2",
|
||||
description: "Set shadow buffer 2 to a value, this value will be loaded every PWM Cycle",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters3XCMPC",
|
||||
displayName: "XCMPC Shadow 3",
|
||||
description: "Set shadow buffer 3 to a value, this value will be loaded every PWM Cycle",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XCMPD",
|
||||
displayName: "XCMPD",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
{
|
||||
name: "epwmXCMP_setXCMPD",
|
||||
displayName: "XCMPD active register value",
|
||||
description: "Set Active Register to a value, XCMPD can only have one active register allocated to it",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters1XCMPD",
|
||||
displayName: "XCMPD Shadow 1",
|
||||
description: "Set shadow buffer 1 to a value, this value will be loaded every PWM Cycle",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters2XCMPD",
|
||||
displayName: "XCMPD Shadow 2",
|
||||
description: "Set shadow buffer 2 to a value, this value will be loaded every PWM Cycle",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters3XCMPD",
|
||||
displayName: "XCMPD Shadow 3",
|
||||
description: "Set shadow buffer 3 to a value, this value will be loaded every PWM Cycle",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XTBPRD",
|
||||
displayName: "XTBPRD Configuration",
|
||||
description: "",
|
||||
longDescription: "XTBPRD will be used instead of TBPRD in type5, this includes having 3 shadow buffer sets and 1 active register",
|
||||
config: [
|
||||
{
|
||||
name: "epwmXCMP_setRegisters_XTBPRD",
|
||||
displayName: "Time Base Period",
|
||||
description: "Set XTBPRD Register to a value, during XCMP mode TBPRD is replaced with XTBPRD",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters1_XTBPRD",
|
||||
displayName: "Time Base Period Shadow 1",
|
||||
description: "Set XTBPRD Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters2_XTBPRD",
|
||||
displayName: "Time Base Period Shadow 2",
|
||||
description: "Set XTBPRD Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters3_XTBPRD",
|
||||
displayName: "Time Base Period Shadow 3",
|
||||
description: "Set XTBPRD Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_AQ_XCMPA_A",
|
||||
displayName: "ePWMxA Event Output Configuration (Action Qualifier)",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_AQ_XCMPB_B",
|
||||
displayName: "ePWMxB Event Output Configuration (Action Qualifier)",
|
||||
description: "",
|
||||
longDescription: "",
|
||||
config: [
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GROUP_XMINMAX",
|
||||
displayName: "XMINMAX Configuration (Edge Detection)",
|
||||
description: "",
|
||||
longDescription: "XMIN and XMAX registers will be used to set a defined window to monitor an event and send out a trip event if event does not occur within window. Within Digital Compare, enable Use Event Detection",
|
||||
config: [
|
||||
{
|
||||
name: "epwmXCMP_setRegisters_XMIN",
|
||||
displayName: "XMIN",
|
||||
description: "Set XMIN Register to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters1_XMIN",
|
||||
displayName: "XMIN Shadow 1",
|
||||
description: "Set XMIN Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters2_XMIN",
|
||||
displayName: "XMIN Shadow 2",
|
||||
description: "Set XMIN Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters3_XMIN",
|
||||
displayName: "XMIN Shadow 3",
|
||||
description: "Set XMIN Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setRegisters_XMAX",
|
||||
displayName: "XMAX",
|
||||
description: "Set XMINMAX Register to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters1_XMAX",
|
||||
displayName: "XMAX Shadow 1",
|
||||
description: "Set XMINMAX Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters2_XMAX",
|
||||
displayName: "XMAX Shadow 2",
|
||||
description: "Set XMINMAX Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
},
|
||||
{
|
||||
name: "epwmXCMP_setShadowRegisters3_XMAX",
|
||||
displayName: "XMAX Shadow 3",
|
||||
description: "Set XMINMAX Shadow Buffer to a value",
|
||||
hidden: true,
|
||||
default: 0,
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
];
|
||||
// Generate the configuration for active, shadow buffers
|
||||
let start_config_index = 1;
|
||||
let start_xcmpa_config_index = 9;
|
||||
let start_xcmpb_config_index = 10;
|
||||
let start_xaq_config_index = 14;
|
||||
config[start_xcmpa_config_index].config[start_config_index].config = config[start_xcmpa_config_index].config[start_config_index].config.concat(generateActiveRegistersConfig("XCMPA"));
|
||||
config[start_xcmpa_config_index].config[start_config_index + 1].config = config[start_xcmpa_config_index].config[start_config_index + 1].config.concat(generateShadowRegisters1Config("XCMPA"));
|
||||
config[start_xcmpa_config_index].config[start_config_index + 2].config = config[start_xcmpa_config_index].config[start_config_index + 2].config.concat(generateShadowRegisters2Config("XCMPA"));
|
||||
config[start_xcmpa_config_index].config[start_config_index + 3].config = config[start_xcmpa_config_index].config[start_config_index + 3].config.concat(generateShadowRegisters3Config("XCMPA"));
|
||||
|
||||
config[start_xcmpb_config_index].config[start_config_index].config = config[start_xcmpb_config_index].config[start_config_index].config.concat(generateActiveRegistersConfig("XCMPB"));
|
||||
config[start_xcmpb_config_index].config[start_config_index + 1].config = config[start_xcmpb_config_index].config[start_config_index + 1].config.concat(generateShadowRegisters1Config("XCMPB"));
|
||||
config[start_xcmpb_config_index].config[start_config_index + 2].config = config[start_xcmpb_config_index].config[start_config_index + 2].config.concat(generateShadowRegisters2Config("XCMPB"));
|
||||
config[start_xcmpb_config_index].config[start_config_index + 3].config = config[start_xcmpb_config_index].config[start_config_index + 3].config.concat(generateShadowRegisters3Config("XCMPB"));
|
||||
|
||||
// Generate the XAQ configs for epwmxA and epwmxB
|
||||
config[start_xaq_config_index].config = config[start_xaq_config_index].config.concat(generateXAQConfig("XCMPA", "EPWMXA"));
|
||||
config[start_xaq_config_index + 1].config = config[start_xaq_config_index + 1].config.concat(generateXAQConfig("XCMPB", "EPWMXB"));
|
||||
var epwmXCMPmodeSubmodule = {
|
||||
displayName: "EPWM XCMP Mode",
|
||||
maxInstances: Common.peripheralCount("EPWM"),
|
||||
defaultInstanceName: "EPWM_XCMP",
|
||||
description: "Enhanced Pulse Width Modulator XCMP Mode Configuration",
|
||||
config: config,
|
||||
templates: {
|
||||
boardc : "", //"/gpio/gpio.board.c.xdt",
|
||||
boardh : ""//"/gpio/gpio.board.h.xdt"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
exports = epwmXCMPmodeSubmodule;
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user