@mchp-mcc/clock-16bit-driver 1.1.1 → 1.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mchp-mcc/clock-16bit-driver",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
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.0",
109
+ "@microchip/run-directory": "^4.2.4",
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
+ }
@@ -118,11 +118,31 @@ 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 getDeviceName = (): string => {
129
+ let deviceName = "";
130
+ const deviceMetaData = this.dataModel?.getImports()?.device_meta?.payload;
131
+ if (deviceMetaData) {
132
+ deviceName = deviceMetaData?.deviceName;
133
+ }
134
+ return deviceName;
135
+ };
136
+
137
+ private isSecondaryDevice = (): boolean => {
138
+ const deviceName = this.getDeviceName();
139
+ // device name ends with "S" followed by a digit
140
+ if (deviceName.match(/S\d$/)) {
141
+ return true;
142
+ }
143
+ return false;
144
+ };
145
+
126
146
  private isComponentEnabled = (componentName: string): boolean => {
127
147
  let isComponentEnabled = false;
128
148
  if (
@@ -152,6 +172,11 @@ class MyDerivedData implements DerivedData {
152
172
  isComponentEnabled = true;
153
173
  }
154
174
  }
175
+
176
+ // Checking whether Secondary Device of Dual Core is being used
177
+ if (componentName === COMPONENT_MAIN_CLOCK_SOURCE && this.isSecondaryDevice()) {
178
+ isComponentEnabled = false;
179
+ }
155
180
  return isComponentEnabled;
156
181
  };
157
182
 
@@ -275,7 +300,7 @@ class MyDerivedData implements DerivedData {
275
300
  if (
276
301
  interfaceData != undefined &&
277
302
  this.dataModel?.getComponentValue("mainClockSource") !=
278
- "FRC Oscillator with Postscaler"
303
+ "FRC Oscillator with Postscaler"
279
304
  ) {
280
305
  maxSystemClockFrequency =
281
306
  interfaceData?.mainClockPayload?.maxSystemClockFrequency ?? 0;
@@ -337,9 +362,9 @@ class MyDerivedData implements DerivedData {
337
362
  const canfdInterfaceRequests:
338
363
  | Processor.Dictionary<any>
339
364
  | undefined = this.dataModel
340
- .getExportInterfaces()
341
- .getInterface("canfd_clock", canfd_clock_interface.Interface.getInterfaceId())
342
- ?.args;
365
+ .getExportInterfaces()
366
+ .getInterface("canfd_clock", canfd_clock_interface.Interface.getInterfaceId())
367
+ ?.args;
343
368
  return canfdInterfaceRequests;
344
369
  };
345
370
 
@@ -1183,9 +1208,9 @@ class MyDerivedData implements DerivedData {
1183
1208
  const clockApplicationInterfaceRequests:
1184
1209
  | Processor.Dictionary<clock_16bit_drv_interface.Arguments>
1185
1210
  | undefined = this.dataModel
1186
- .getExportInterfaces()
1187
- .getInterface("clock_16bit_drv_interface", this.getClock16bitDrvInterfaceId())
1188
- ?.args;
1211
+ .getExportInterfaces()
1212
+ .getInterface("clock_16bit_drv_interface", this.getClock16bitDrvInterfaceId())
1213
+ ?.args;
1189
1214
  const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
1190
1215
  CLOCK_16BIT_CONFIG_INTERFACE,
1191
1216
  );
@@ -1212,6 +1237,29 @@ class MyDerivedData implements DerivedData {
1212
1237
  }
1213
1238
  return clockApplicationInterfacePayloads;
1214
1239
  };
1240
+
1241
+ private getDefaultClockApplicationInterfacePayload = ():
1242
+ | clock_16bit_config_interface.ProcessedPayload
1243
+ | undefined => {
1244
+ const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
1245
+ CLOCK_16BIT_CONFIG_INTERFACE,
1246
+ );
1247
+ if (interfaceData != undefined) {
1248
+ return {
1249
+ mainClockPayload: interfaceData.mainClockPayload,
1250
+ hasUSB: interfaceData.hasUSB,
1251
+ hasAuxClock: interfaceData.hasAuxClock,
1252
+ hasRefClock: interfaceData.hasRefClock,
1253
+ hasCanfdClock: interfaceData.hasCanfdClock,
1254
+ hasSecondaryOscillator: interfaceData.hasSecondaryOscillator,
1255
+ isSecondaryOscillatorEnabled: interfaceData.isSecondaryOscillatorEnabled,
1256
+ auxClockPayload: interfaceData.auxClockPayload,
1257
+ refClockPayload: interfaceData.refClockPayload,
1258
+ canfdClockPayload: interfaceData.canfdClockPayload,
1259
+ };
1260
+ }
1261
+ };
1262
+
1215
1263
  private friendlyExportName = (exportKey: string): string => {
1216
1264
  let exportName: string;
1217
1265
  switch (exportKey) {
@@ -45,6 +45,14 @@
45
45
  },
46
46
  "isRequired": true
47
47
  }
48
+ },
49
+ "device_meta": {
50
+ "import": {
51
+ "interfaceId": {
52
+ "name": "device-meta",
53
+ "version": "1.0.0"
54
+ }
55
+ }
48
56
  }
49
57
  },
50
58
  "exports": {
@@ -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
+