c2000ware-core-sdk/driverlib/.meta/clocktree/oscillators.js
2023-06-24 11:35:38 +05:30

34 lines
709 B
JavaScript

const { getDefaultValue } = system.getScript("./defaultValue.js");
exports = {
displayName: "Internal Oscillators",
config: [{
name: "type",
displayName: "Type",
default: "Internal Oscillators",
readOnly: true,
}, ],
extendConfig: ({ $ipInstance }) => {
if (!_.isEmpty($ipInstance.outPins)) {
return [{
name: $ipInstance.outPins[0].name,
default: 10,
getValue: (inst) => $ipInstance.outputValue,
readOnly: false
}];
} else {
// Override the input pin so it's visible with a tool tip
return [{
name: $ipInstance.description,
default: 0,
description: "Custom tool tip",
hidden: false,
getValue: () => { } // Tool will update
}]
}
},
};