@mchp-mcc/clock-16bit-driver 1.0.3 → 1.1.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 +16 -0
- package/Readme.md +40 -12
- package/lib/generated_module/src/index.js +0 -5
- package/output/04701ca33ce96d3254191b8bb4be6080.ttf +0 -0
- package/output/0af28946b49fa427ea09eb020906b421.otf +0 -0
- package/output/0ffc720f1bf788849cc8ce9e79376cb3.eot +0 -0
- package/output/1ac124f8c2620ca86850329afeb7c0bd.otf +0 -0
- package/output/1c89d58269b6e0c5f3d9d9876325b4ba.woff2 +0 -0
- package/output/1d0d8b66fa1da76d69b95b6d0ed5cca9.svg +336 -0
- package/output/1d79a0559e5f13294dee77456b02b56f.woff +0 -0
- package/output/2509c35b0cfc629f81e50ce5ef62e4d3.woff +0 -0
- package/output/252a41f69d4c320154a12092f6fbbedd.ttf +0 -0
- package/output/2aeabc9e8ed0aef227d72fee83c14462.eot +0 -0
- package/output/2c8903475ef5366ce36603d79ba02d25.woff2 +0 -0
- package/output/39c65dcc08f7edb347b62cee45cd7048.gif +0 -0
- package/output/3dfc3dd20959a5bac99f7d9152530aa9.woff +0 -0
- package/output/61747992dd9a412e601e3defa3f3baa6.ttf +0 -0
- package/output/61bf3cad3150daa5af2dab9aaa02e3ff.woff +0 -0
- package/output/6240b67b77d9bac167d7834f793e83ff.woff2 +0 -0
- package/output/6441e63a57ccc5105bad045142bc31eb.png +0 -0
- package/output/6e408e472d90198222ef851e45a6070d.eot +0 -0
- package/output/7435e6c2064f36f486266e516e9838b8.woff2 +0 -0
- package/output/75e0e55bdb3e82dcacf88e90bf17bac6.eot +0 -0
- package/output/7d6bf0009e0d61e7e6f376fccab8bb09.woff +0 -0
- package/output/7ebd6258cbbc40b4f0e108e444bcb9b1.woff +0 -0
- package/output/87a454b233bedae23f8d1be11e8b4f68.woff +0 -0
- package/output/926388f043fc8117b35b84b241a7f688.svg +334 -0
- package/output/9347db5956a89b0bab38d3e610eee01d.gif +0 -0
- package/output/94f5fdef85538cbd160aa2b71e67ab27.otf +0 -0
- package/output/a0cf4179f3139f862d55dea472a2315c.woff2 +0 -0
- package/output/a356e361ee6765f3d6d4c1d4664f12ab.eot +0 -0
- package/output/autoCreator.js +7809 -0
- package/output/autoCreator.js.map +1 -0
- package/output/autoProcessor.js +7811 -0
- package/output/autoProcessor.js.map +1 -0
- package/output/b49c708cb6f62d20fb57be4c6f736662.woff +0 -0
- package/output/bb3b405a4608d51ddb1306c2f641f3dd.svg +332 -0
- package/output/c2e128a00fca2640240d88892e29dc53.eot +0 -0
- package/output/cbc22e9676acf295231bfecc426fe916.eot +0 -0
- package/output/creator.js +11824 -3991
- package/output/creator.js.map +1 -1
- package/output/dae0d67b5b0a7332e0d555379c67e4de.eot +0 -0
- package/output/df17d4e30091735253a854052256d95d.woff +0 -0
- package/output/ec32d6be7329ece0789ccf9d0d519c4d.ttf +0 -0
- package/output/ec806460121999bcfb12bc264d46d41e.woff2 +0 -0
- package/output/eef5282a2e59fca7c3b7a96adbb3d649.otf +0 -0
- package/output/f2ebdee8c2343f558a0221d276957606.woff2 +0 -0
- package/output/f38c5a57b52cb6dda8141610603f6a58.eot +0 -0
- package/output/f78429ed0f939ede1ddb454a60a2bc0f.woff2 +0 -0
- package/output/fa2c83d2f35244bb10dcfef484ba6431.svg +211 -0
- package/output/fbbc016360f4b50975e254398a7b6964.ttf +0 -0
- package/output/index.html +1 -1
- package/output/main.js +155020 -0
- package/output/main.js.map +1 -0
- package/output/nullPrototype.json +4 -4
- package/output/processor.js +5206 -5691
- package/output/processor.js.map +1 -1
- package/output/reducer.js +17751 -626
- package/output/reducer.js.map +1 -1
- package/package.json +25 -19
- package/src/CreatorFunctions.ts +1 -1
- package/src/{DerivedData.tsx → DerivedData.ts} +173 -55
- package/src/catalog.json +2 -0
- package/src/moduleConfig.json +27 -5
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mchp-mcc/clock-16bit-driver",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.1.1",
|
4
4
|
"scf": {
|
5
5
|
"reducer": "output/reducer.js",
|
6
6
|
"creator": "output/creator.js",
|
@@ -10,14 +10,18 @@
|
|
10
10
|
"main": "auto"
|
11
11
|
},
|
12
12
|
"displayName": "Clock",
|
13
|
-
"category": "System"
|
13
|
+
"category": "System",
|
14
|
+
"autoProcessor": "output/autoProcessor.js",
|
15
|
+
"autoCreator": "output/autoCreator.js"
|
14
16
|
},
|
15
17
|
"scf-automodule": {
|
16
18
|
"mode": "react",
|
17
19
|
"hookPaths": {
|
18
|
-
"processor": "generated_module/src/processor.
|
19
|
-
"creator": "generated_module/src/creator.
|
20
|
-
"reducer": "src/reducer.tsx"
|
20
|
+
"processor": "generated_module/src/processor.ts",
|
21
|
+
"creator": "generated_module/src/creator.ts",
|
22
|
+
"reducer": "src/reducer.tsx",
|
23
|
+
"App": "src/App.tsx",
|
24
|
+
"view": "src/index.tsx"
|
21
25
|
},
|
22
26
|
"shouldNotifyOnDeploy": false
|
23
27
|
},
|
@@ -39,7 +43,8 @@
|
|
39
43
|
"update-auto-module": "yarn add @microchip/scf-automodule -D && yarn updateProject",
|
40
44
|
"build-run-dir-future": "node config/extract-run-directory-future.js",
|
41
45
|
"profile": "jest profile",
|
42
|
-
"release": "yarn build && yarn test && node -e 'require(\"./config/scf-project-scripts\").releaseProject()'"
|
46
|
+
"release": "yarn build && yarn test && node -e 'require(\"./config/scf-project-scripts\").releaseProject()'",
|
47
|
+
"postprocess": "node config/appendPrototype.js"
|
43
48
|
},
|
44
49
|
"husky": {
|
45
50
|
"hooks": {
|
@@ -76,16 +81,15 @@
|
|
76
81
|
"@mchp-mcc/pic-8bit-types": "^5.4.1",
|
77
82
|
"@microchip/api-prefix-registration": "^0.1.0",
|
78
83
|
"@microchip/canfd-clock-interface": "^1.0.0",
|
79
|
-
"@microchip/clock-16bit-config-interface": "^1.1.
|
84
|
+
"@microchip/clock-16bit-config-interface": "^1.1.5",
|
80
85
|
"@microchip/clock-16bit-interface": "^1.1.0",
|
81
86
|
"@microchip/fosc-hz": "^0.1.2",
|
82
|
-
"@microchip/pin-standard": "^0.
|
83
|
-
"@microchip/scf-
|
84
|
-
"@microchip/scf-
|
85
|
-
"@microchip/scf-device": "^8.2.0",
|
87
|
+
"@microchip/pin-standard": "^0.4.1",
|
88
|
+
"@microchip/scf-common": "^3.17.0",
|
89
|
+
"@microchip/scf-device": "^8.5.0",
|
86
90
|
"@microchip/scf-integration-test": "^1.0.0",
|
87
91
|
"@microchip/scf-interface": "^1.4.0",
|
88
|
-
"@microchip/scf-register-view-helper": "^2.
|
92
|
+
"@microchip/scf-register-view-helper": "^2.5.0"
|
89
93
|
},
|
90
94
|
"devDependencies": {
|
91
95
|
"@babel/core": "^7.9.6",
|
@@ -94,12 +98,13 @@
|
|
94
98
|
"@babel/preset-react": "^7.9.4",
|
95
99
|
"@babel/preset-typescript": "^7.9.0",
|
96
100
|
"@microchip/initializer-system": "^0.5.3",
|
101
|
+
"@microchip/melody-automodule-interface": "^1.6.2",
|
97
102
|
"@microchip/pic-8bit-types": "^5.0.1",
|
98
|
-
"@microchip/run-directory": "^2.
|
99
|
-
"@microchip/
|
100
|
-
"@microchip/scf-automodule": "
|
101
|
-
"@microchip/scf-autoview": "^3.
|
102
|
-
"@microchip/scf-autoview-impl": "^3.
|
103
|
+
"@microchip/run-directory": "^4.2.0",
|
104
|
+
"@microchip/scf-automodule": "^5.6.3",
|
105
|
+
"@microchip/scf-automodule-impl": "^1.8.2",
|
106
|
+
"@microchip/scf-autoview": "^3.26.1",
|
107
|
+
"@microchip/scf-autoview-impl": "^3.9.2",
|
103
108
|
"@microchip/scf-project-scripts": "^1.0.0",
|
104
109
|
"@types/core-js": "^2.5.1",
|
105
110
|
"@types/enzyme": "^3.9.3",
|
@@ -151,9 +156,10 @@
|
|
151
156
|
"postcss-loader": "^3.0.0",
|
152
157
|
"postcss-safe-parser": "^4.0.2",
|
153
158
|
"prettier": "^2.0.5",
|
154
|
-
"react": "^
|
155
|
-
"react-dom": "^
|
159
|
+
"react": "^17.0.1",
|
160
|
+
"react-dom": "^17.0.1",
|
156
161
|
"react-redux": "^7.2.0",
|
162
|
+
"sass": "~1.32.0",
|
157
163
|
"sass-loader": "^9.0.2",
|
158
164
|
"style-loader": "^1.2.1",
|
159
165
|
"ts-jest": "^24.0.2",
|
package/src/CreatorFunctions.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CreatorFunctions } from "@microchip/
|
1
|
+
import { CreatorFunctions } from "@microchip/melody-automodule-interface";
|
2
2
|
import { MyState } from "../generated_module/src/types/AutoModuleTypes";
|
3
3
|
|
4
4
|
export const getCreatorFunctions = (): CreatorFunctions => {
|
@@ -8,8 +8,8 @@ import {
|
|
8
8
|
} from "../generated_module/src/types/AutoModuleTypes";
|
9
9
|
import { forEach, getKeys } from "../generated_module/src/Utils";
|
10
10
|
import { getCanClkDivFreq, getCanfdClockFrequency, MAX_CANFD_CLK_SRC_FREQ } from "./Util";
|
11
|
-
import * as
|
12
|
-
import { ExportArg } from "@microchip/
|
11
|
+
import * as clock_16bit_drv_interface from "@microchip/clock-16bit-config-interface";
|
12
|
+
import { ExportArg } from "@microchip/melody-automodule-interface/lib/src/InterfaceTypes";
|
13
13
|
import _find from "lodash.find";
|
14
14
|
import { InterfaceId } from "@microchip/scf-common";
|
15
15
|
|
@@ -20,12 +20,17 @@ const CLOCK_16BIT_CONFIG_INTERFACE = "clock_16bit_config_interface";
|
|
20
20
|
const DIGITS_AFTER_DECIMAL_POINT = 2;
|
21
21
|
const COMPONENT_AUX_CLOCK_SOURCE = "auxClockSource";
|
22
22
|
const COMPONENT_MAIN_CLOCK_SOURCE = "mainClockSource";
|
23
|
+
const COMPONENT_CAN_FD_CLOCK_SOURCE_FREQ = "canfdClkSrcFreq";
|
23
24
|
export const COMPONENT_AUX_CLOCK_INPUT_FREQUENCY = "auxClockInputFrequency_Hz";
|
24
25
|
export const COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY = "mainClockInputFrequency_Hz";
|
25
26
|
const COMPONENT_REF_CLOCK_SOURCE = "refClockSource";
|
27
|
+
const COMPONENT_REF_CLOCK_ENABLE = "refClockEnable";
|
28
|
+
export const COMPONENT_CALCULATED_REF_OUTPUT_FREQUENCY =
|
29
|
+
"calculatedRefOutputFrequency_Hz";
|
26
30
|
const COMPONENT_CANFD_CLOCK_SOURCE = "canfdClockSource";
|
27
31
|
export const COMPONENT_REQUESTED_SYSTEM_FREQUENCY = "requestedSystemFrequency_Hz";
|
28
32
|
const COMPONENT_FVCO_DIVIDER = "fvcoDivider";
|
33
|
+
export const COMPONENT_SET_MAX_FREQUENCY = "setMaximumSystemFrequency";
|
29
34
|
export const COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY =
|
30
35
|
"requestedAuxClockOutputFrequency_Hz";
|
31
36
|
const COMPONENT_AFVCO_DIVIDER = "afvcoDivider";
|
@@ -38,6 +43,7 @@ const PRIMARY = "Primary";
|
|
38
43
|
const PLL = "PLL";
|
39
44
|
const POSTSCALER = "Postscaler";
|
40
45
|
const EXTERNAL = "External";
|
46
|
+
const CLOCK_16BIT_DRV_INTERFACE = "clock-16bit-drv-interface";
|
41
47
|
|
42
48
|
const MEGA_HERTZ = 1000000;
|
43
49
|
const KILO_HERTZ = 1000;
|
@@ -100,6 +106,7 @@ class MyDerivedData implements DerivedData {
|
|
100
106
|
requestedCanfdClockOutputFrequency_Hz: this
|
101
107
|
.getRequestedCanfdClockOutputFrequency_Hz,
|
102
108
|
getUiBehavior: this.getUiBehavior,
|
109
|
+
isEnabled: this.isComponentEnabled,
|
103
110
|
mainClockInputFrequency_HzValidator: this.mainClockInputFrequency_HzValidator,
|
104
111
|
auxClockInputFrequency_HzValidator: this.auxClockInputFrequency_HzValidator,
|
105
112
|
requestedAuxClockOutputFrequency_HzValidator: this
|
@@ -109,12 +116,45 @@ class MyDerivedData implements DerivedData {
|
|
109
116
|
requestedRefClockOutputFrequency_HzValidator: this
|
110
117
|
.requestedRefClockOutputFrequency_HzValidator,
|
111
118
|
getCustomUiErrors: this.getCustomUiErrors,
|
112
|
-
"clock-16bit-
|
119
|
+
"clock-16bit-drv-interface_payloads": this
|
120
|
+
.getClockApplicationInterfacePayload,
|
113
121
|
importName: this.friendlyImportName,
|
114
122
|
exportName: this.friendlyExportName,
|
115
123
|
};
|
116
124
|
};
|
117
125
|
|
126
|
+
private isComponentEnabled = (componentName: string): boolean => {
|
127
|
+
let isComponentEnabled = false;
|
128
|
+
if (
|
129
|
+
componentName === COMPONENT_REF_CLOCK_SOURCE ||
|
130
|
+
componentName === COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY
|
131
|
+
) {
|
132
|
+
if (this.dataModel?.getComponentValue(COMPONENT_REF_CLOCK_ENABLE) === true) {
|
133
|
+
isComponentEnabled = true;
|
134
|
+
}
|
135
|
+
} else if (
|
136
|
+
componentName === COMPONENT_REF_CLOCK_ENABLE ||
|
137
|
+
componentName === COMPONENT_MAIN_CLOCK_SOURCE ||
|
138
|
+
componentName === COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY ||
|
139
|
+
componentName === COMPONENT_SET_MAX_FREQUENCY ||
|
140
|
+
componentName === COMPONENT_FVCO_DIVIDER ||
|
141
|
+
componentName === COMPONENT_AUX_CLOCK_SOURCE ||
|
142
|
+
componentName === COMPONENT_CANFD_CLOCK_SOURCE ||
|
143
|
+
componentName === COMPONENT_AFVCO_DIVIDER ||
|
144
|
+
componentName === COMPONENT_AUX_CLOCK_INPUT_FREQUENCY ||
|
145
|
+
componentName === COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY
|
146
|
+
) {
|
147
|
+
isComponentEnabled = true;
|
148
|
+
} else if (componentName === COMPONENT_REQUESTED_SYSTEM_FREQUENCY) {
|
149
|
+
if (
|
150
|
+
this.dataModel?.getComponentValue(COMPONENT_SET_MAX_FREQUENCY) === false
|
151
|
+
) {
|
152
|
+
isComponentEnabled = true;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
return isComponentEnabled;
|
156
|
+
};
|
157
|
+
|
118
158
|
private getCustomUiErrors = (componentName: string): Error[] | undefined => {
|
119
159
|
let customErrors: Error[];
|
120
160
|
switch (componentName) {
|
@@ -204,6 +244,17 @@ class MyDerivedData implements DerivedData {
|
|
204
244
|
return minClockFrequency;
|
205
245
|
};
|
206
246
|
|
247
|
+
private getClockPropertiesFromPayLoad = (): any => {
|
248
|
+
let clockProperties: unknown;
|
249
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
250
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
251
|
+
);
|
252
|
+
if (interfaceData != undefined) {
|
253
|
+
clockProperties = interfaceData?.clockProperties;
|
254
|
+
}
|
255
|
+
return clockProperties;
|
256
|
+
};
|
257
|
+
|
207
258
|
private getMaxClockFrequency = (): number => {
|
208
259
|
let maxClockFrequency = 0;
|
209
260
|
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
@@ -221,10 +272,24 @@ class MyDerivedData implements DerivedData {
|
|
221
272
|
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
222
273
|
CLOCK_16BIT_CONFIG_INTERFACE,
|
223
274
|
);
|
224
|
-
if (
|
275
|
+
if (
|
276
|
+
interfaceData != undefined &&
|
277
|
+
this.dataModel?.getComponentValue("mainClockSource") !=
|
278
|
+
"FRC Oscillator with Postscaler"
|
279
|
+
) {
|
225
280
|
maxSystemClockFrequency =
|
226
281
|
interfaceData?.mainClockPayload?.maxSystemClockFrequency ?? 0;
|
227
282
|
}
|
283
|
+
if (
|
284
|
+
this.dataModel?.getComponentValue("mainClockSource") ==
|
285
|
+
"FRC Oscillator with Postscaler"
|
286
|
+
) {
|
287
|
+
if (this.getClockPropertiesFromPayLoad()["FRC_CLOCK"] != undefined) {
|
288
|
+
maxSystemClockFrequency = Number(
|
289
|
+
this.getClockPropertiesFromPayLoad()["FRC_CLOCK"]?.value,
|
290
|
+
);
|
291
|
+
}
|
292
|
+
}
|
228
293
|
return maxSystemClockFrequency;
|
229
294
|
};
|
230
295
|
|
@@ -237,7 +302,7 @@ class MyDerivedData implements DerivedData {
|
|
237
302
|
"Requested FCAN frequency can be configured from CAN 2.0/CAN-FD modules in Drivers category",
|
238
303
|
};
|
239
304
|
break;
|
240
|
-
case
|
305
|
+
case COMPONENT_CAN_FD_CLOCK_SOURCE_FREQ:
|
241
306
|
uiBehavior = {
|
242
307
|
["ui:help"]:
|
243
308
|
"CAN FD clock source frequency should be less than or equal to 640 MHz",
|
@@ -309,15 +374,17 @@ class MyDerivedData implements DerivedData {
|
|
309
374
|
|
310
375
|
private isRequestedSystemFrequencyVisible = (): boolean => {
|
311
376
|
let visible = false;
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
if (
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
377
|
+
if (this.dataModel?.getComponentValue(COMPONENT_SET_MAX_FREQUENCY) === false) {
|
378
|
+
const mainClockSource = this.dataModel.getComponentValue(
|
379
|
+
COMPONENT_MAIN_CLOCK_SOURCE,
|
380
|
+
);
|
381
|
+
if (mainClockSource != undefined) {
|
382
|
+
if (
|
383
|
+
mainClockSource?.indexOf(PLL) >= 0 ||
|
384
|
+
mainClockSource.indexOf(POSTSCALER) >= 0
|
385
|
+
) {
|
386
|
+
visible = true;
|
387
|
+
}
|
321
388
|
}
|
322
389
|
}
|
323
390
|
return visible;
|
@@ -383,14 +450,15 @@ class MyDerivedData implements DerivedData {
|
|
383
450
|
} else if (
|
384
451
|
componentName === COMPONENT_REF_CLOCK_SOURCE ||
|
385
452
|
componentName === COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY ||
|
386
|
-
componentName ===
|
453
|
+
componentName === COMPONENT_CALCULATED_REF_OUTPUT_FREQUENCY ||
|
454
|
+
componentName === COMPONENT_REF_CLOCK_ENABLE
|
387
455
|
) {
|
388
456
|
return this.isRefClockSupported();
|
389
457
|
} else if (
|
390
458
|
componentName === COMPONENT_CANFD_CLOCK_SOURCE ||
|
391
459
|
componentName === COMPONENT_REQUESTED_CANFD_CLOCK_OUTPUT_FREQUENCY ||
|
392
460
|
componentName === "calculatedCanfdOutputFrequency_Hz" ||
|
393
|
-
componentName ===
|
461
|
+
componentName === COMPONENT_CAN_FD_CLOCK_SOURCE_FREQ
|
394
462
|
) {
|
395
463
|
return this.isCanfdClockSupported();
|
396
464
|
}
|
@@ -461,6 +529,17 @@ class MyDerivedData implements DerivedData {
|
|
461
529
|
});
|
462
530
|
}
|
463
531
|
}
|
532
|
+
if (this.dataModel?.getComponentValue(COMPONENT_SET_MAX_FREQUENCY)) {
|
533
|
+
const mainClockSource = this.dataModel?.getComponentValue(
|
534
|
+
COMPONENT_MAIN_CLOCK_SOURCE,
|
535
|
+
);
|
536
|
+
if (mainClockSource != undefined && mainClockSource?.indexOf(PLL) < 0) {
|
537
|
+
alerts.push({
|
538
|
+
type: Processor.AlertTypes.Warning,
|
539
|
+
text: "Please select PLL as clock source.",
|
540
|
+
});
|
541
|
+
}
|
542
|
+
}
|
464
543
|
|
465
544
|
return alerts;
|
466
545
|
};
|
@@ -469,6 +548,16 @@ class MyDerivedData implements DerivedData {
|
|
469
548
|
return;
|
470
549
|
};
|
471
550
|
|
551
|
+
private getActualMainClockSource = (): string | undefined => {
|
552
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
553
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
554
|
+
);
|
555
|
+
if (interfaceData != undefined) {
|
556
|
+
return interfaceData.mainClockPayload?.mainClockSource;
|
557
|
+
}
|
558
|
+
return undefined;
|
559
|
+
};
|
560
|
+
|
472
561
|
private getActualSystemFrequency = (): string => {
|
473
562
|
let systemFrequency: number | undefined;
|
474
563
|
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
@@ -868,6 +957,8 @@ class MyDerivedData implements DerivedData {
|
|
868
957
|
return this.getRefClockSource();
|
869
958
|
case COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY:
|
870
959
|
return this.getRequestedRefClockOutputFrequencyInHz();
|
960
|
+
case COMPONENT_SET_MAX_FREQUENCY:
|
961
|
+
return this.getMaxFrequencySetFlag();
|
871
962
|
default:
|
872
963
|
break;
|
873
964
|
}
|
@@ -910,31 +1001,45 @@ class MyDerivedData implements DerivedData {
|
|
910
1001
|
COMPONENT_REQUESTED_SYSTEM_FREQUENCY,
|
911
1002
|
),
|
912
1003
|
fvcoDivider: Number(this.dataModel.getComponentValue(COMPONENT_FVCO_DIVIDER)),
|
1004
|
+
setMaximumSystemFrequency: this.dataModel.getComponentValue(
|
1005
|
+
COMPONENT_SET_MAX_FREQUENCY,
|
1006
|
+
),
|
913
1007
|
};
|
914
1008
|
};
|
915
1009
|
|
916
1010
|
private auxClockArg = (): any => {
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
1011
|
+
if (
|
1012
|
+
this.dataModel.getComponentValue(COMPONENT_AUX_CLOCK_SOURCE) !=
|
1013
|
+
"FRC Oscillator"
|
1014
|
+
) {
|
1015
|
+
return {
|
1016
|
+
auxClockSource: this.dataModel.getComponentValue(
|
1017
|
+
COMPONENT_AUX_CLOCK_SOURCE,
|
1018
|
+
),
|
1019
|
+
auxClockInputFrequency_Hz: this.dataModel.getComponentValue(
|
1020
|
+
COMPONENT_AUX_CLOCK_INPUT_FREQUENCY,
|
1021
|
+
),
|
1022
|
+
requestedAuxClockOutputFrequency_Hz: this.dataModel.getComponentValue(
|
1023
|
+
COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY,
|
1024
|
+
),
|
1025
|
+
afvcoDivider: Number(
|
1026
|
+
this.dataModel.getComponentValue(COMPONENT_AFVCO_DIVIDER),
|
1027
|
+
),
|
1028
|
+
};
|
1029
|
+
}
|
929
1030
|
};
|
930
1031
|
|
931
1032
|
private refClockArg = (): any => {
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
1033
|
+
if (this.dataModel.getComponentValue(COMPONENT_REF_CLOCK_ENABLE) === true) {
|
1034
|
+
return {
|
1035
|
+
refClockSource: this.dataModel.getComponentValue(
|
1036
|
+
COMPONENT_REF_CLOCK_SOURCE,
|
1037
|
+
),
|
1038
|
+
requestedRefClockOutputFrequency_Hz: this.dataModel.getComponentValue(
|
1039
|
+
COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY,
|
1040
|
+
),
|
1041
|
+
};
|
1042
|
+
}
|
938
1043
|
};
|
939
1044
|
|
940
1045
|
private canfdClockArg = (): any => {
|
@@ -961,112 +1066,125 @@ class MyDerivedData implements DerivedData {
|
|
961
1066
|
return getCanClkDivFreq(canClkSrc, canClkFreq);
|
962
1067
|
};
|
963
1068
|
|
964
|
-
public
|
1069
|
+
public getExportArgFromDriverInterface = (
|
1070
|
+
componentName: string,
|
1071
|
+
): ExportArg | undefined => {
|
965
1072
|
const exportData = this.dataModel.getExportInterfaces().getInterfaceData();
|
966
1073
|
if (exportData != undefined) {
|
967
1074
|
const expArg = _find(
|
968
1075
|
exportData,
|
969
1076
|
(i) =>
|
970
|
-
i.interface ===
|
971
|
-
i.name === componentName,
|
1077
|
+
i.interface === CLOCK_16BIT_DRV_INTERFACE && i.name === componentName,
|
972
1078
|
);
|
973
1079
|
return expArg;
|
974
1080
|
}
|
975
1081
|
};
|
976
1082
|
|
977
1083
|
private getMainClockSource = (): any => {
|
978
|
-
const mainClockArg = this.
|
1084
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1085
|
+
?.value;
|
979
1086
|
if (mainClockArg != undefined) {
|
980
1087
|
return mainClockArg?.mainClockSource;
|
981
1088
|
}
|
982
1089
|
};
|
983
1090
|
|
1091
|
+
private getMaxFrequencySetFlag = (): any => {
|
1092
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1093
|
+
?.value;
|
1094
|
+
if (mainClockArg != undefined) {
|
1095
|
+
return Boolean(mainClockArg?.setMaximumSystemFrequency);
|
1096
|
+
}
|
1097
|
+
};
|
1098
|
+
|
984
1099
|
private getMainClockInputFrequencyInHz = (): any => {
|
985
|
-
const mainClockArg = this.
|
1100
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1101
|
+
?.value;
|
986
1102
|
if (mainClockArg != undefined) {
|
987
1103
|
return mainClockArg?.mainClockInputFrequency_Hz;
|
988
1104
|
}
|
989
1105
|
};
|
990
1106
|
|
991
1107
|
private getRequestedSystemFrequencyInHz = (): any => {
|
992
|
-
const mainClockArg = this.
|
1108
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1109
|
+
?.value;
|
993
1110
|
if (mainClockArg != undefined) {
|
994
1111
|
return mainClockArg?.requestedSystemFrequency_Hz;
|
995
1112
|
}
|
996
1113
|
};
|
997
1114
|
|
998
1115
|
private getFvcoDivider = (): any => {
|
999
|
-
const mainClockArg = this.
|
1116
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1117
|
+
?.value;
|
1000
1118
|
if (mainClockArg != undefined) {
|
1001
1119
|
return String(mainClockArg.fvcoDivider);
|
1002
1120
|
}
|
1003
1121
|
};
|
1004
1122
|
|
1005
1123
|
private getAuxClockSource = (): any => {
|
1006
|
-
const auxClockArg = this.
|
1124
|
+
const auxClockArg = this.getExportArgFromDriverInterface(ARGUMENT_AUX_CLK)?.value;
|
1007
1125
|
if (auxClockArg != undefined) {
|
1008
1126
|
return auxClockArg.auxClockSource;
|
1009
1127
|
}
|
1010
1128
|
};
|
1011
1129
|
|
1012
1130
|
private getAuxClockInputFrequencyInHz = (): any => {
|
1013
|
-
const auxClockArg = this.
|
1131
|
+
const auxClockArg = this.getExportArgFromDriverInterface(ARGUMENT_AUX_CLK)?.value;
|
1014
1132
|
if (auxClockArg != undefined) {
|
1015
1133
|
return auxClockArg.auxClockInputFrequency_Hz;
|
1016
1134
|
}
|
1017
1135
|
};
|
1018
1136
|
|
1019
1137
|
private getRequestedAuxClockOutputFrequencyInHz = (): any => {
|
1020
|
-
const auxClockArg = this.
|
1138
|
+
const auxClockArg = this.getExportArgFromDriverInterface(ARGUMENT_AUX_CLK)?.value;
|
1021
1139
|
if (auxClockArg != undefined) {
|
1022
1140
|
return auxClockArg.requestedAuxClockOutputFrequency_Hz;
|
1023
1141
|
}
|
1024
1142
|
};
|
1025
1143
|
|
1026
1144
|
private getAfvcoDivider = (): any => {
|
1027
|
-
const auxClockArg = this.
|
1145
|
+
const auxClockArg = this.getExportArgFromDriverInterface(ARGUMENT_AUX_CLK)?.value;
|
1028
1146
|
if (auxClockArg != undefined) {
|
1029
1147
|
return auxClockArg.afvcoDivider;
|
1030
1148
|
}
|
1031
1149
|
};
|
1032
1150
|
|
1033
1151
|
private getRefClockSource = (): any => {
|
1034
|
-
const refClockArg = this.
|
1152
|
+
const refClockArg = this.getExportArgFromDriverInterface(ARGUMENT_REF_CLK)?.value;
|
1035
1153
|
if (refClockArg != undefined) {
|
1036
1154
|
return refClockArg.refClockSource;
|
1037
1155
|
}
|
1038
1156
|
};
|
1039
1157
|
|
1040
1158
|
private getRequestedRefClockOutputFrequencyInHz = (): any => {
|
1041
|
-
const refClockArg = this.
|
1159
|
+
const refClockArg = this.getExportArgFromDriverInterface(ARGUMENT_REF_CLK)?.value;
|
1042
1160
|
if (refClockArg != undefined) {
|
1043
1161
|
return refClockArg.requestedRefClockOutputFrequency_Hz;
|
1044
1162
|
}
|
1045
1163
|
};
|
1046
1164
|
|
1047
1165
|
private getCanfdClockSource = (): any => {
|
1048
|
-
const refClockArg = this.
|
1166
|
+
const refClockArg = this.getExportArgFromDriverInterface("canfdClockArg")?.value;
|
1049
1167
|
if (refClockArg != undefined) {
|
1050
1168
|
return refClockArg.canfdClockSource;
|
1051
1169
|
}
|
1052
1170
|
};
|
1053
1171
|
|
1054
|
-
private
|
1172
|
+
private getClock16bitDrvInterfaceId = (): InterfaceId => {
|
1055
1173
|
return {
|
1056
|
-
name:
|
1057
|
-
version: "
|
1174
|
+
name: CLOCK_16BIT_DRV_INTERFACE,
|
1175
|
+
version: "1.0.0",
|
1058
1176
|
};
|
1059
1177
|
};
|
1060
1178
|
|
1061
1179
|
private getClockApplicationInterfacePayload = ():
|
1062
1180
|
| Processor.Dictionary<clock_16bit_config_interface.ProcessedPayload>
|
1063
1181
|
| undefined => {
|
1064
|
-
const clockApplicationInterfacePayloads: Processor.Dictionary<
|
1182
|
+
const clockApplicationInterfacePayloads: Processor.Dictionary<clock_16bit_drv_interface.ProcessedPayload> = {};
|
1065
1183
|
const clockApplicationInterfaceRequests:
|
1066
|
-
| Processor.Dictionary<
|
1184
|
+
| Processor.Dictionary<clock_16bit_drv_interface.Arguments>
|
1067
1185
|
| undefined = this.dataModel
|
1068
1186
|
.getExportInterfaces()
|
1069
|
-
.getInterface("
|
1187
|
+
.getInterface("clock_16bit_drv_interface", this.getClock16bitDrvInterfaceId())
|
1070
1188
|
?.args;
|
1071
1189
|
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
1072
1190
|
CLOCK_16BIT_CONFIG_INTERFACE,
|
@@ -1100,7 +1218,7 @@ class MyDerivedData implements DerivedData {
|
|
1100
1218
|
case "canfd_clock":
|
1101
1219
|
exportName = "CAN FD Clock";
|
1102
1220
|
break;
|
1103
|
-
case "
|
1221
|
+
case "clock_16bit_drv_interface":
|
1104
1222
|
exportName = "Clock Drv Config";
|
1105
1223
|
break;
|
1106
1224
|
default:
|
package/src/catalog.json
CHANGED
package/src/moduleConfig.json
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
"false": "disabled"
|
7
7
|
},
|
8
8
|
"help": {
|
9
|
-
"url": "v2/keyword-lookup?keyword=
|
9
|
+
"url": "v2/keyword-lookup?keyword=CLOCK_16BIT_MELODY_DRIVER&version=latest&redirect=true",
|
10
10
|
"tooltip": "Click here to open documentation"
|
11
11
|
},
|
12
12
|
"UIGroups": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"import": {
|
42
42
|
"interfaceId": {
|
43
43
|
"name": "clock-16bit-config-interface",
|
44
|
-
"version": "^1.1.
|
44
|
+
"version": "^1.1.5"
|
45
45
|
},
|
46
46
|
"isRequired": true
|
47
47
|
}
|
@@ -58,12 +58,12 @@
|
|
58
58
|
}
|
59
59
|
]
|
60
60
|
},
|
61
|
-
"
|
61
|
+
"clock_16bit_drv_interface": {
|
62
62
|
"interfaces": [
|
63
63
|
{
|
64
64
|
"interfaceId": {
|
65
|
-
"name": "clock-16bit-
|
66
|
-
"version": "
|
65
|
+
"name": "clock-16bit-drv-interface",
|
66
|
+
"version": "1.0.0"
|
67
67
|
}
|
68
68
|
}
|
69
69
|
]
|
@@ -117,6 +117,17 @@
|
|
117
117
|
"validation": true,
|
118
118
|
"category": "software"
|
119
119
|
},
|
120
|
+
"setMaximumSystemFrequency": {
|
121
|
+
"name": "setMaximumSystemFrequency",
|
122
|
+
"description": "Set System(FOSC) Frequency to Maximum",
|
123
|
+
"type": "boolean",
|
124
|
+
"defaultValue": false,
|
125
|
+
"group": "systemClock",
|
126
|
+
"tabs": [
|
127
|
+
"main"
|
128
|
+
],
|
129
|
+
"category": "software"
|
130
|
+
},
|
120
131
|
"calculatedSystemFrequency_Hz": {
|
121
132
|
"name": "calculatedSystemFrequency_Hz",
|
122
133
|
"description": "Calculated System Frequency(FOSC)",
|
@@ -324,6 +335,17 @@
|
|
324
335
|
"readonly": true
|
325
336
|
}
|
326
337
|
},
|
338
|
+
"refClockEnable": {
|
339
|
+
"name": "refClockEnable",
|
340
|
+
"description": "Reference Clock Enable",
|
341
|
+
"type": "boolean",
|
342
|
+
"defaultValue": false,
|
343
|
+
"group": "refClock",
|
344
|
+
"tabs": [
|
345
|
+
"main"
|
346
|
+
],
|
347
|
+
"category": "software"
|
348
|
+
},
|
327
349
|
"refClockSource": {
|
328
350
|
"name": "refClockSource",
|
329
351
|
"description": "REFO Clock Source",
|