@mchp-mcc/clock-16bit-driver 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +14 -0
- package/Readme.md +14 -0
- package/output/autoCreator.js +108 -22
- package/output/autoCreator.js.map +1 -1
- package/output/autoProcessor.js +108 -22
- package/output/autoProcessor.js.map +1 -1
- package/output/creator.js +108 -22
- package/output/creator.js.map +1 -1
- package/output/main.js +1 -1
- package/output/nullPrototype.json +6 -0
- package/output/processor.js +108 -22
- package/output/processor.js.map +1 -1
- package/output/reducer.js +107 -21
- package/output/reducer.js.map +1 -1
- package/package.json +12 -6
- package/src/DerivedData.ts +96 -0
- package/src/moduleConfig.json +8 -0
- package/tests/itf/Utils.ts +52 -0
- package/tests/itf/clock.test.ts +1165 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mchp-mcc/clock-16bit-driver",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.1",
|
4
4
|
"scf": {
|
5
5
|
"reducer": "output/reducer.js",
|
6
6
|
"creator": "output/creator.js",
|
@@ -44,7 +44,9 @@
|
|
44
44
|
"build-run-dir-future": "node config/extract-run-directory-future.js",
|
45
45
|
"profile": "jest profile",
|
46
46
|
"release": "yarn build && yarn test && node -e 'require(\"./config/scf-project-scripts\").releaseProject()'",
|
47
|
-
"postprocess": "node config/appendPrototype.js"
|
47
|
+
"postprocess": "node config/appendPrototype.js",
|
48
|
+
"test-itf-all": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --df=\"dsPIC33CK64MC105|dsPIC33CK256MC506|dsPIC33CDV64MC106|dsPIC33CK64MP105|dsPIC33CDVL64MC106|dsPIC33CDV256MP506|dsPIC33CK512MPT608|dsPIC33CDVC256MP506|dsPIC33CK256MP508|dsPIC33CK512MP608|dsPIC33CK1024MP710|dsPIC33CH512MP508|dsPIC33CH128MP508\"",
|
49
|
+
"test-itf": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --df=\"dsPIC33CH128MP508$\""
|
48
50
|
},
|
49
51
|
"husky": {
|
50
52
|
"hooks": {
|
@@ -59,14 +61,16 @@
|
|
59
61
|
"files": [
|
60
62
|
"output/**/*",
|
61
63
|
"config.json",
|
62
|
-
"src/**/*"
|
64
|
+
"src/**/*",
|
65
|
+
"/tests/itf/"
|
63
66
|
],
|
64
67
|
"jest": {
|
65
68
|
"testPathIgnorePatterns": [
|
66
69
|
"/node_modules/",
|
67
70
|
"/run/",
|
68
71
|
"/generated_module/examples/",
|
69
|
-
"/lib/"
|
72
|
+
"/lib/",
|
73
|
+
"/tests/"
|
70
74
|
],
|
71
75
|
"modulePathIgnorePatterns": [
|
72
76
|
"<rootDir>/run"
|
@@ -78,6 +82,7 @@
|
|
78
82
|
}
|
79
83
|
},
|
80
84
|
"dependencies": {
|
85
|
+
"@mchp-mcc/pic-16bit": "^5.10.0",
|
81
86
|
"@mchp-mcc/pic-8bit-types": "^5.4.1",
|
82
87
|
"@microchip/api-prefix-registration": "^0.1.0",
|
83
88
|
"@microchip/canfd-clock-interface": "^1.0.0",
|
@@ -97,10 +102,11 @@
|
|
97
102
|
"@babel/preset-env": "^7.9.6",
|
98
103
|
"@babel/preset-react": "^7.9.4",
|
99
104
|
"@babel/preset-typescript": "^7.9.0",
|
105
|
+
"@microchip/ccl-itf": "^1.6.0",
|
100
106
|
"@microchip/initializer-system": "^0.5.3",
|
101
107
|
"@microchip/melody-automodule-interface": "^1.6.2",
|
102
108
|
"@microchip/pic-8bit-types": "^5.0.1",
|
103
|
-
"@microchip/run-directory": "^4.2.
|
109
|
+
"@microchip/run-directory": "^4.2.3",
|
104
110
|
"@microchip/scf-automodule": "^5.6.3",
|
105
111
|
"@microchip/scf-automodule-impl": "^1.8.2",
|
106
112
|
"@microchip/scf-autoview": "^3.26.1",
|
@@ -175,4 +181,4 @@
|
|
175
181
|
"description": "- Download & Install [nodejs](https://nodejs.org/en/download/)\r - Download & Install npm\r - Setup node & npm in enviroment path",
|
176
182
|
"main": "lib/generated_module/src/index.js",
|
177
183
|
"author": ""
|
178
|
-
}
|
184
|
+
}
|
package/src/DerivedData.ts
CHANGED
@@ -118,11 +118,40 @@ class MyDerivedData implements DerivedData {
|
|
118
118
|
getCustomUiErrors: this.getCustomUiErrors,
|
119
119
|
"clock-16bit-drv-interface_payloads": this
|
120
120
|
.getClockApplicationInterfacePayload,
|
121
|
+
"clock-16bit-drv-interface_payload": this
|
122
|
+
.getDefaultClockApplicationInterfacePayload,
|
121
123
|
importName: this.friendlyImportName,
|
122
124
|
exportName: this.friendlyExportName,
|
123
125
|
};
|
124
126
|
};
|
125
127
|
|
128
|
+
private getFamilyName = (): string => {
|
129
|
+
let deviceFamilyName = "";
|
130
|
+
const deviceMetaData = this.dataModel?.getImports()?.device_meta?.payload;
|
131
|
+
if (deviceMetaData) {
|
132
|
+
deviceFamilyName = deviceMetaData?.familyName;
|
133
|
+
}
|
134
|
+
return deviceFamilyName;
|
135
|
+
};
|
136
|
+
|
137
|
+
private isSecondaryDevice = (): boolean => {
|
138
|
+
const deviceFamilyName = this.getFamilyName();
|
139
|
+
|
140
|
+
const hasSecondaryCoreFlashSupport =
|
141
|
+
this.getModel()?.getImports()?.device_meta?.payload
|
142
|
+
?.hasSecondaryCoreFlashSupport ?? false;
|
143
|
+
|
144
|
+
/*
|
145
|
+
Device name ends with "S" followed by a digit.
|
146
|
+
The second part of the condition is for devices like Centaurus which have their inidividual flash.
|
147
|
+
|
148
|
+
*/
|
149
|
+
if (deviceFamilyName.match(/S\d$/) && !hasSecondaryCoreFlashSupport) {
|
150
|
+
return true;
|
151
|
+
}
|
152
|
+
return false;
|
153
|
+
};
|
154
|
+
|
126
155
|
private isComponentEnabled = (componentName: string): boolean => {
|
127
156
|
let isComponentEnabled = false;
|
128
157
|
if (
|
@@ -152,6 +181,11 @@ class MyDerivedData implements DerivedData {
|
|
152
181
|
isComponentEnabled = true;
|
153
182
|
}
|
154
183
|
}
|
184
|
+
|
185
|
+
// Checking whether Secondary Device of Dual Core is being used
|
186
|
+
if (componentName === COMPONENT_MAIN_CLOCK_SOURCE && this.isSecondaryDevice()) {
|
187
|
+
isComponentEnabled = false;
|
188
|
+
}
|
155
189
|
return isComponentEnabled;
|
156
190
|
};
|
157
191
|
|
@@ -308,6 +342,15 @@ class MyDerivedData implements DerivedData {
|
|
308
342
|
"CAN FD clock source frequency should be less than or equal to 640 MHz",
|
309
343
|
};
|
310
344
|
break;
|
345
|
+
case COMPONENT_MAIN_CLOCK_SOURCE:
|
346
|
+
if (this.shouldShowSecDeviceNotif()) {
|
347
|
+
uiBehavior = {
|
348
|
+
["ui:help"]: `Ensure to select ${this.dataModel.getComponentValue(
|
349
|
+
COMPONENT_MAIN_CLOCK_SOURCE,
|
350
|
+
)} as part of Main Device also`,
|
351
|
+
};
|
352
|
+
}
|
353
|
+
break;
|
311
354
|
default:
|
312
355
|
break;
|
313
356
|
}
|
@@ -541,9 +584,39 @@ class MyDerivedData implements DerivedData {
|
|
541
584
|
}
|
542
585
|
}
|
543
586
|
|
587
|
+
if (this.shouldShowSecDeviceNotif()) {
|
588
|
+
alerts.push({
|
589
|
+
type: Processor.AlertTypes.Hint,
|
590
|
+
text: `Ensure to select ${this.dataModel?.getComponentValue(
|
591
|
+
COMPONENT_MAIN_CLOCK_SOURCE,
|
592
|
+
)} as clock source for the Main Device with frequency ${this.dataModel?.getComponentValue(
|
593
|
+
COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY,
|
594
|
+
)}Hz`,
|
595
|
+
});
|
596
|
+
}
|
597
|
+
|
544
598
|
return alerts;
|
545
599
|
};
|
546
600
|
|
601
|
+
private shouldShowSecDeviceNotif = (): boolean => {
|
602
|
+
const deviceFamilyName = this.getFamilyName();
|
603
|
+
if (deviceFamilyName.match(/S\d$/)) {
|
604
|
+
if (
|
605
|
+
this.dataModel?.getComponentValue(COMPONENT_MAIN_CLOCK_SOURCE) ===
|
606
|
+
"Primary Oscillator" ||
|
607
|
+
this.dataModel?.getComponentValue(COMPONENT_MAIN_CLOCK_SOURCE) ===
|
608
|
+
"Primary Oscillator with PLL" ||
|
609
|
+
this.dataModel?.getComponentValue(COMPONENT_MAIN_CLOCK_SOURCE) ===
|
610
|
+
"External Oscillator" ||
|
611
|
+
this.dataModel?.getComponentValue(COMPONENT_MAIN_CLOCK_SOURCE) ===
|
612
|
+
"External Oscillator with PLL"
|
613
|
+
) {
|
614
|
+
return true;
|
615
|
+
}
|
616
|
+
}
|
617
|
+
return false;
|
618
|
+
};
|
619
|
+
|
547
620
|
private calculatedFunction = (): any => {
|
548
621
|
return;
|
549
622
|
};
|
@@ -1212,6 +1285,29 @@ class MyDerivedData implements DerivedData {
|
|
1212
1285
|
}
|
1213
1286
|
return clockApplicationInterfacePayloads;
|
1214
1287
|
};
|
1288
|
+
|
1289
|
+
private getDefaultClockApplicationInterfacePayload = ():
|
1290
|
+
| clock_16bit_config_interface.ProcessedPayload
|
1291
|
+
| undefined => {
|
1292
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
1293
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
1294
|
+
);
|
1295
|
+
if (interfaceData != undefined) {
|
1296
|
+
return {
|
1297
|
+
mainClockPayload: interfaceData.mainClockPayload,
|
1298
|
+
hasUSB: interfaceData.hasUSB,
|
1299
|
+
hasAuxClock: interfaceData.hasAuxClock,
|
1300
|
+
hasRefClock: interfaceData.hasRefClock,
|
1301
|
+
hasCanfdClock: interfaceData.hasCanfdClock,
|
1302
|
+
hasSecondaryOscillator: interfaceData.hasSecondaryOscillator,
|
1303
|
+
isSecondaryOscillatorEnabled: interfaceData.isSecondaryOscillatorEnabled,
|
1304
|
+
auxClockPayload: interfaceData.auxClockPayload,
|
1305
|
+
refClockPayload: interfaceData.refClockPayload,
|
1306
|
+
canfdClockPayload: interfaceData.canfdClockPayload,
|
1307
|
+
};
|
1308
|
+
}
|
1309
|
+
};
|
1310
|
+
|
1215
1311
|
private friendlyExportName = (exportKey: string): string => {
|
1216
1312
|
let exportName: string;
|
1217
1313
|
switch (exportKey) {
|
package/src/moduleConfig.json
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
export const getReadOnlyValue = (moduleData: any, tabId:any,property:any): any => {
|
2
|
+
const uiPropertyValueRule = getUISchemaData(moduleData)?.[tabId]?.[property]?.["ui:readonly"];
|
3
|
+
return uiPropertyValueRule;
|
4
|
+
}
|
5
|
+
export const getHiddenProperty = (moduleData: any, tabId:any,property:any): any => {
|
6
|
+
const uiPropertyValueRule = getUISchemaData(moduleData)?.[tabId]?.[property]?.["ui:widget"];
|
7
|
+
return uiPropertyValueRule;
|
8
|
+
}
|
9
|
+
const getUISchemaData = (moduleData:any): any => {
|
10
|
+
const uiSchema = moduleData?.payload?.auto?.main.uiSchema;
|
11
|
+
return uiSchema;
|
12
|
+
}
|
13
|
+
export const getRegisterValue = (moduleData: any, regName:any): any => {
|
14
|
+
const uiRegisterValue =moduleData?.payload?.auto?.register?.schema?.properties?.[regName]?.title;
|
15
|
+
return uiRegisterValue
|
16
|
+
}
|
17
|
+
export const getSettingBit = (moduleData: any, regName:any,settingBit): any => {
|
18
|
+
const uiSettingBit=moduleData?.payload?.auto?.register?.formData?.[regName]?.[settingBit];
|
19
|
+
return uiSettingBit
|
20
|
+
}
|
21
|
+
export const getConfigBitsSettingBit = (moduleData: any, regName:any,settingBit): any => {
|
22
|
+
const uiSettingBit=moduleData?.payload?.auto?.main?.formData?.[regName]?.[settingBit];
|
23
|
+
return uiSettingBit
|
24
|
+
}
|
25
|
+
export const getArgs = (moduleData: any, moduleName:any,property:any): any => {
|
26
|
+
const argValue=moduleData?.imports?.[moduleName]?.args?.[property];
|
27
|
+
return argValue
|
28
|
+
}
|
29
|
+
export const getPayload = (moduleData: any, moduleNameInterface:any,property:any): any => {
|
30
|
+
const argpayLoaddata = moduleData?.exports?.[moduleNameInterface]?.interfaces[0]?.payload?.[property];
|
31
|
+
return argpayLoaddata
|
32
|
+
}
|
33
|
+
export const getClockPayload = (moduleData: any,moduleId:any,moduleNameInterface:any,property:any): any => {
|
34
|
+
const argpayLoaddata = moduleData?.exports?.[moduleNameInterface]?.interfaces[0]?.payloads?.[moduleId]?.[property];
|
35
|
+
return argpayLoaddata
|
36
|
+
}
|
37
|
+
export const getModulepins = (moduleData: any,moduleId:any,pinpath:any): any => {
|
38
|
+
const ModulePinName = moduleData?.payload?.processedRows?.rows?.[moduleId]?.[pinpath];
|
39
|
+
return ModulePinName;
|
40
|
+
}
|
41
|
+
export const getModuleLockedPins = (moduleData: any,moduleId:any,pinpath:any,pinname:any): any => {
|
42
|
+
const pinlockData: any = moduleData?.payload?.processedRows?.rows?.[moduleId]?.[pinpath]?.pins?.[pinname];
|
43
|
+
return pinlockData
|
44
|
+
}
|
45
|
+
export const getResult = (moduleData: any, moduleName:any,property:any): any => {
|
46
|
+
const argValue=moduleData?.imports?.[moduleName]?.results?.[property];
|
47
|
+
return argValue
|
48
|
+
}
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|