2023-06-24 09:05:38 +03:00
|
|
|
exports = {
|
|
|
|
|
displayName: "Mux",
|
|
|
|
|
config: [],
|
2023-07-24 12:14:00 +03:00
|
|
|
extendConfig: ({ $ipInstance }) => {
|
|
|
|
|
var pinConfig = [];
|
|
|
|
|
pinConfig.push({
|
|
|
|
|
name: "Description",
|
|
|
|
|
displayName: "Description",
|
|
|
|
|
default: $ipInstance.description,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
})
|
|
|
|
|
pinConfig.push({
|
|
|
|
|
name: "inputSelect",
|
|
|
|
|
displayName: "Input Select",
|
|
|
|
|
default: $ipInstance.resetValue,
|
|
|
|
|
options: _.map($ipInstance.inPins, ({ name }) => ({ name })),
|
|
|
|
|
})
|
|
|
|
|
pinConfig.push({
|
|
|
|
|
name: $ipInstance.outPins[0].name,
|
|
|
|
|
default: 0,
|
|
|
|
|
getValue: (inst) => inst[inst.inputSelect],
|
|
|
|
|
})
|
|
|
|
|
if ($ipInstance.name == "CPUSELx")
|
|
|
|
|
{
|
|
|
|
|
pinConfig.push({
|
|
|
|
|
name: "cpu_sel_mux",
|
|
|
|
|
displayName: "CPU Select Mux",
|
|
|
|
|
default: "Click the hyper link for SYSCLK GATES",
|
|
|
|
|
getValue: (inst) => { return "Click the hyper link for SYSCLK GATES" },
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
return pinConfig;
|
2023-06-24 09:05:38 +03:00
|
|
|
},
|
2023-07-24 12:14:00 +03:00
|
|
|
|
|
|
|
|
validate: (inst, { $ipInstance, logInfo }) => {
|
|
|
|
|
var sysctl = system.modules['/driverlib/sysctl.js']
|
|
|
|
|
if (sysctl)
|
|
|
|
|
{
|
|
|
|
|
if (inst.cpu_sel_mux)
|
|
|
|
|
{
|
|
|
|
|
logInfo("For enabling peripherals, use the " + system.getReference(sysctl.$static, "enable_SYSCTL_PERIPH_CLK_TIMER0"), inst, "cpu_sel_mux")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|