@mchp-mcc/clock-16bit-driver 1.0.1 → 1.1.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/Changelog.md +19 -0
- package/Readme.md +43 -14
- 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 +7745 -0
- package/output/autoCreator.js.map +1 -0
- package/output/autoProcessor.js +7747 -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 +12592 -1498
- 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 +25 -0
- package/output/main.js +155020 -0
- package/output/main.js.map +1 -0
- package/output/nullPrototype.json +11 -1
- package/output/processor.js +11209 -5640
- package/output/processor.js.map +1 -1
- package/output/reducer.js +34873 -0
- package/output/reducer.js.map +1 -0
- package/output/resources/help-icon.png +0 -0
- package/output/resources/loading-status.gif +0 -0
- package/package.json +48 -18
- package/src/App.tsx +54 -0
- package/src/CreatorFunctions.ts +1 -1
- package/src/{DerivedData.tsx → DerivedData.ts} +305 -31
- package/src/actions.ts +22 -0
- package/src/catalog.json +25 -0
- package/src/index.tsx +48 -0
- package/src/moduleConfig.json +24 -3
- package/src/reducer.tsx +94 -0
Binary file
|
Binary file
|
package/package.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mchp-mcc/clock-16bit-driver",
|
3
|
-
"version": "1.0
|
3
|
+
"version": "1.1.0",
|
4
4
|
"scf": {
|
5
|
-
"reducer": "
|
5
|
+
"reducer": "output/reducer.js",
|
6
6
|
"creator": "output/creator.js",
|
7
7
|
"processor": "output/processor.js",
|
8
8
|
"nullPrototype": "output/nullPrototype.json",
|
@@ -10,13 +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
|
-
"mode": "
|
18
|
+
"mode": "react",
|
17
19
|
"hookPaths": {
|
18
|
-
"processor": "generated_module/src/processor.
|
19
|
-
"creator": "generated_module/src/creator.
|
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"
|
20
25
|
},
|
21
26
|
"shouldNotifyOnDeploy": false
|
22
27
|
},
|
@@ -38,7 +43,8 @@
|
|
38
43
|
"update-auto-module": "yarn add @microchip/scf-automodule -D && yarn updateProject",
|
39
44
|
"build-run-dir-future": "node config/extract-run-directory-future.js",
|
40
45
|
"profile": "jest profile",
|
41
|
-
"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"
|
42
48
|
},
|
43
49
|
"husky": {
|
44
50
|
"hooks": {
|
@@ -66,21 +72,24 @@
|
|
66
72
|
"<rootDir>/run"
|
67
73
|
],
|
68
74
|
"preset": "ts-jest",
|
69
|
-
"collectCoverage": true
|
75
|
+
"collectCoverage": true,
|
76
|
+
"moduleNameMapper": {
|
77
|
+
"\\.(css|less|scss|sss|styl)$": "<rootDir>/node_modules/jest-css-modules"
|
78
|
+
}
|
70
79
|
},
|
71
80
|
"dependencies": {
|
72
81
|
"@mchp-mcc/pic-8bit-types": "^5.4.1",
|
73
82
|
"@microchip/api-prefix-registration": "^0.1.0",
|
74
83
|
"@microchip/canfd-clock-interface": "^1.0.0",
|
75
|
-
"@microchip/clock-16bit-config-interface": "^1.
|
84
|
+
"@microchip/clock-16bit-config-interface": "^1.1.2",
|
85
|
+
"@microchip/clock-16bit-interface": "^1.1.0",
|
76
86
|
"@microchip/fosc-hz": "^0.1.2",
|
77
|
-
"@microchip/pin-standard": "^0.
|
78
|
-
"@microchip/scf-
|
79
|
-
"@microchip/scf-
|
80
|
-
"@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",
|
81
90
|
"@microchip/scf-integration-test": "^1.0.0",
|
82
91
|
"@microchip/scf-interface": "^1.4.0",
|
83
|
-
"@microchip/scf-register-view-helper": "^2.
|
92
|
+
"@microchip/scf-register-view-helper": "^2.5.0"
|
84
93
|
},
|
85
94
|
"devDependencies": {
|
86
95
|
"@babel/core": "^7.9.6",
|
@@ -89,11 +98,13 @@
|
|
89
98
|
"@babel/preset-react": "^7.9.4",
|
90
99
|
"@babel/preset-typescript": "^7.9.0",
|
91
100
|
"@microchip/initializer-system": "^0.5.3",
|
101
|
+
"@microchip/melody-automodule-interface": "^1.6.2",
|
92
102
|
"@microchip/pic-8bit-types": "^5.0.1",
|
93
|
-
"@microchip/run-directory": "^2.
|
94
|
-
"@microchip/
|
95
|
-
"@microchip/scf-automodule": "^
|
96
|
-
"@microchip/scf-autoview": "^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",
|
97
108
|
"@microchip/scf-project-scripts": "^1.0.0",
|
98
109
|
"@types/core-js": "^2.5.1",
|
99
110
|
"@types/enzyme": "^3.9.3",
|
@@ -106,10 +117,14 @@
|
|
106
117
|
"@types/semver": "^7.1.0",
|
107
118
|
"@typescript-eslint/eslint-plugin": "^3.2.0",
|
108
119
|
"@typescript-eslint/parser": "^3.6.0",
|
120
|
+
"autoprefixer": "^9.7.6",
|
109
121
|
"babel-eslint": "^10.1.0",
|
110
122
|
"babel-loader": "^8.0.6",
|
111
123
|
"babel-plugin-named-asset-import": "^0.3.2",
|
112
124
|
"babel-preset-react-app": "^9.0.0",
|
125
|
+
"classnames": "^2.2.6",
|
126
|
+
"core-js": "^3.6.5",
|
127
|
+
"css-loader": "^3.5.2",
|
113
128
|
"del": "^4.1.1",
|
114
129
|
"eslint": "^7.4.0",
|
115
130
|
"eslint-config-prettier": "^6.11.0",
|
@@ -117,6 +132,7 @@
|
|
117
132
|
"eslint-loader": "^4.0.2",
|
118
133
|
"eslint-plugin-prettier": "^3.1.3",
|
119
134
|
"eslint-plugin-react": "^7.20.0",
|
135
|
+
"file-loader": "^6.0.0",
|
120
136
|
"fork-ts-checker-webpack-plugin": "^1.3.7",
|
121
137
|
"fs": "^0.0.1-security",
|
122
138
|
"gulp": "^4.0.2",
|
@@ -125,17 +141,31 @@
|
|
125
141
|
"gulp-if": "^3.0.0",
|
126
142
|
"gulp-typescript": "^5.0.1",
|
127
143
|
"hard-source-webpack-plugin": "^0.13.1",
|
144
|
+
"html-webpack-plugin": "^4.2.0",
|
128
145
|
"husky": "^4.2.4",
|
129
146
|
"is-wsl": "^2.1.0",
|
130
147
|
"jest": "^24.8.0",
|
148
|
+
"jest-css-modules": "^2.1.0",
|
131
149
|
"jest-html-reporter": "^2.5.0",
|
132
150
|
"jest-pnp-resolver": "^1.2.1",
|
133
151
|
"lint-staged": "^10.1.3",
|
152
|
+
"mini-css-extract-plugin": "^0.9.0",
|
153
|
+
"node-sass": "^4.13.1",
|
154
|
+
"optimize-css-assets-webpack-plugin": "^5.0.3",
|
134
155
|
"pnp-webpack-plugin": "^1.5.0",
|
156
|
+
"postcss-loader": "^3.0.0",
|
157
|
+
"postcss-safe-parser": "^4.0.2",
|
135
158
|
"prettier": "^2.0.5",
|
159
|
+
"react": "^17.0.1",
|
160
|
+
"react-dom": "^17.0.1",
|
161
|
+
"react-redux": "^7.2.0",
|
162
|
+
"sass": "~1.32.0",
|
163
|
+
"sass-loader": "^9.0.2",
|
164
|
+
"style-loader": "^1.2.1",
|
136
165
|
"ts-jest": "^24.0.2",
|
137
166
|
"ts-pnp": "^1.1.2",
|
138
167
|
"typescript": "^4.0.5",
|
168
|
+
"url-loader": "^4.1.0",
|
139
169
|
"webpack": "^4.34.0",
|
140
170
|
"webpack-cli": "^3.3.4",
|
141
171
|
"webpack-merge": "^4.2.2",
|
package/src/App.tsx
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
/*
|
2
|
+
* @license:
|
3
|
+
* © 2019 Microchip Technology Inc. and its subsidiaries.
|
4
|
+
*
|
5
|
+
* You may use this software and any derivatives exclusively with Microchip products.
|
6
|
+
*
|
7
|
+
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS,
|
8
|
+
* IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF
|
9
|
+
* NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS
|
10
|
+
* INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE
|
11
|
+
* IN ANY APPLICATION.
|
12
|
+
*
|
13
|
+
* IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL
|
14
|
+
* OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO
|
15
|
+
* THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY
|
16
|
+
* OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S
|
17
|
+
* TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
|
18
|
+
* THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
19
|
+
*
|
20
|
+
* MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE TERMS.
|
21
|
+
*/
|
22
|
+
|
23
|
+
import React, { Component } from "react";
|
24
|
+
import { connect } from "react-redux";
|
25
|
+
import { Dispatch } from "redux";
|
26
|
+
import { AutoView } from "@microchip/scf-autoview-impl/src/lib/views/src/autoview";
|
27
|
+
import { AutoViewModule } from "@microchip/scf-autoview/lib/autoview-types";
|
28
|
+
|
29
|
+
export type State = AutoViewModule;
|
30
|
+
|
31
|
+
interface Props {
|
32
|
+
state: State;
|
33
|
+
dispatch: Dispatch;
|
34
|
+
}
|
35
|
+
|
36
|
+
class App extends Component<Props> {
|
37
|
+
constructor(props: Props, context: any) {
|
38
|
+
super(props, context);
|
39
|
+
}
|
40
|
+
|
41
|
+
render(): any {
|
42
|
+
return (
|
43
|
+
<div>
|
44
|
+
<AutoView state={this.props.state} dispatch={this.props.dispatch} />
|
45
|
+
</div>
|
46
|
+
);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
function mapStateToProps(state: State, ownProps?: any): any {
|
51
|
+
return { state: state };
|
52
|
+
}
|
53
|
+
|
54
|
+
export default connect(mapStateToProps)(App);
|
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 => {
|
@@ -6,23 +6,31 @@ import {
|
|
6
6
|
DerivedData,
|
7
7
|
DerivedFunctions,
|
8
8
|
} from "../generated_module/src/types/AutoModuleTypes";
|
9
|
-
import { forEach } from "../generated_module/src/Utils";
|
9
|
+
import { forEach, getKeys } from "../generated_module/src/Utils";
|
10
10
|
import { getCanClkDivFreq, getCanfdClockFrequency, MAX_CANFD_CLK_SRC_FREQ } from "./Util";
|
11
|
-
|
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
|
+
import _find from "lodash.find";
|
14
|
+
import { InterfaceId } from "@microchip/scf-common";
|
15
|
+
|
16
|
+
export const ARGUMENT_MAIN_CLK = "mainClockArg";
|
17
|
+
const ARGUMENT_AUX_CLK = "auxClockArg";
|
18
|
+
const ARGUMENT_REF_CLK = "refClockArg";
|
12
19
|
const CLOCK_16BIT_CONFIG_INTERFACE = "clock_16bit_config_interface";
|
13
20
|
const DIGITS_AFTER_DECIMAL_POINT = 2;
|
14
21
|
const COMPONENT_AUX_CLOCK_SOURCE = "auxClockSource";
|
15
22
|
const COMPONENT_MAIN_CLOCK_SOURCE = "mainClockSource";
|
16
|
-
const COMPONENT_AUX_CLOCK_INPUT_FREQUENCY = "auxClockInputFrequency_Hz";
|
17
|
-
const COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY = "mainClockInputFrequency_Hz";
|
23
|
+
export const COMPONENT_AUX_CLOCK_INPUT_FREQUENCY = "auxClockInputFrequency_Hz";
|
24
|
+
export const COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY = "mainClockInputFrequency_Hz";
|
18
25
|
const COMPONENT_REF_CLOCK_SOURCE = "refClockSource";
|
19
26
|
const COMPONENT_CANFD_CLOCK_SOURCE = "canfdClockSource";
|
20
|
-
const COMPONENT_REQUESTED_SYSTEM_FREQUENCY = "requestedSystemFrequency_Hz";
|
27
|
+
export const COMPONENT_REQUESTED_SYSTEM_FREQUENCY = "requestedSystemFrequency_Hz";
|
21
28
|
const COMPONENT_FVCO_DIVIDER = "fvcoDivider";
|
22
|
-
const
|
29
|
+
export const COMPONENT_SET_MAX_FREQUENCY = "setMaximumSystemFrequency";
|
30
|
+
export const COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY =
|
23
31
|
"requestedAuxClockOutputFrequency_Hz";
|
24
32
|
const COMPONENT_AFVCO_DIVIDER = "afvcoDivider";
|
25
|
-
const COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY =
|
33
|
+
export const COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY =
|
26
34
|
"requestedRefClockOutputFrequency_Hz";
|
27
35
|
const COMPONENT_REQUESTED_CANFD_CLOCK_OUTPUT_FREQUENCY =
|
28
36
|
"requestedCanfdClockOutputFrequency_Hz";
|
@@ -31,6 +39,7 @@ const PRIMARY = "Primary";
|
|
31
39
|
const PLL = "PLL";
|
32
40
|
const POSTSCALER = "Postscaler";
|
33
41
|
const EXTERNAL = "External";
|
42
|
+
const CLOCK_16BIT_DRV_INTERFACE = "clock-16bit-drv-interface";
|
34
43
|
|
35
44
|
const MEGA_HERTZ = 1000000;
|
36
45
|
const KILO_HERTZ = 1000;
|
@@ -102,6 +111,10 @@ class MyDerivedData implements DerivedData {
|
|
102
111
|
requestedRefClockOutputFrequency_HzValidator: this
|
103
112
|
.requestedRefClockOutputFrequency_HzValidator,
|
104
113
|
getCustomUiErrors: this.getCustomUiErrors,
|
114
|
+
"clock-16bit-drv-interface_payloads": this
|
115
|
+
.getClockApplicationInterfacePayload,
|
116
|
+
importName: this.friendlyImportName,
|
117
|
+
exportName: this.friendlyExportName,
|
105
118
|
};
|
106
119
|
};
|
107
120
|
|
@@ -152,7 +165,8 @@ class MyDerivedData implements DerivedData {
|
|
152
165
|
|
153
166
|
private mainClockInputFrequency_HzValidator = (): any => {
|
154
167
|
return {
|
155
|
-
minimum:
|
168
|
+
minimum: this.getMinClockFrequency(),
|
169
|
+
maximum: this.getMaxClockFrequency(),
|
156
170
|
};
|
157
171
|
};
|
158
172
|
|
@@ -171,6 +185,7 @@ class MyDerivedData implements DerivedData {
|
|
171
185
|
private requestedSystemFrequency_HzValidator = (): any => {
|
172
186
|
return {
|
173
187
|
minimum: 1,
|
188
|
+
maximum: this.getMaxSystemClockFrequency(),
|
174
189
|
};
|
175
190
|
};
|
176
191
|
|
@@ -180,6 +195,42 @@ class MyDerivedData implements DerivedData {
|
|
180
195
|
};
|
181
196
|
};
|
182
197
|
|
198
|
+
private getMinClockFrequency = (): number => {
|
199
|
+
let minClockFrequency = 0;
|
200
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
201
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
202
|
+
);
|
203
|
+
if (interfaceData != undefined) {
|
204
|
+
minClockFrequency =
|
205
|
+
interfaceData?.mainClockPayload?.mainClockInputMinFrequency ?? 0;
|
206
|
+
}
|
207
|
+
return minClockFrequency;
|
208
|
+
};
|
209
|
+
|
210
|
+
private getMaxClockFrequency = (): number => {
|
211
|
+
let maxClockFrequency = 0;
|
212
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
213
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
214
|
+
);
|
215
|
+
if (interfaceData != undefined) {
|
216
|
+
maxClockFrequency =
|
217
|
+
interfaceData?.mainClockPayload?.mainClockInputMaxFrequency ?? 0;
|
218
|
+
}
|
219
|
+
return maxClockFrequency;
|
220
|
+
};
|
221
|
+
|
222
|
+
private getMaxSystemClockFrequency = (): number => {
|
223
|
+
let maxSystemClockFrequency = 0;
|
224
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
225
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
226
|
+
);
|
227
|
+
if (interfaceData != undefined) {
|
228
|
+
maxSystemClockFrequency =
|
229
|
+
interfaceData?.mainClockPayload?.maxSystemClockFrequency ?? 0;
|
230
|
+
}
|
231
|
+
return maxSystemClockFrequency;
|
232
|
+
};
|
233
|
+
|
183
234
|
private getUiBehavior = (component: string): any => {
|
184
235
|
let uiBehavior = {};
|
185
236
|
switch (component) {
|
@@ -245,15 +296,17 @@ class MyDerivedData implements DerivedData {
|
|
245
296
|
|
246
297
|
private isMainClockInputFrequencyVisible = (): boolean => {
|
247
298
|
let visible = false;
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
if (
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
299
|
+
if (!this.dataModel.getComponentValue(COMPONENT_SET_MAX_FREQUENCY)) {
|
300
|
+
const mainClockSource = this.dataModel.getComponentValue(
|
301
|
+
COMPONENT_MAIN_CLOCK_SOURCE,
|
302
|
+
);
|
303
|
+
if (mainClockSource != undefined) {
|
304
|
+
if (
|
305
|
+
mainClockSource?.indexOf(PRIMARY) >= 0 ||
|
306
|
+
mainClockSource?.indexOf(EXTERNAL) >= 0
|
307
|
+
) {
|
308
|
+
visible = true;
|
309
|
+
}
|
257
310
|
}
|
258
311
|
}
|
259
312
|
return visible;
|
@@ -261,15 +314,17 @@ class MyDerivedData implements DerivedData {
|
|
261
314
|
|
262
315
|
private isRequestedSystemFrequencyVisible = (): boolean => {
|
263
316
|
let visible = false;
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
if (
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
317
|
+
if (!this.dataModel.getComponentValue(COMPONENT_SET_MAX_FREQUENCY)) {
|
318
|
+
const mainClockSource = this.dataModel.getComponentValue(
|
319
|
+
COMPONENT_MAIN_CLOCK_SOURCE,
|
320
|
+
);
|
321
|
+
if (mainClockSource != undefined) {
|
322
|
+
if (
|
323
|
+
mainClockSource?.indexOf(PLL) >= 0 ||
|
324
|
+
mainClockSource.indexOf(POSTSCALER) >= 0
|
325
|
+
) {
|
326
|
+
visible = true;
|
327
|
+
}
|
273
328
|
}
|
274
329
|
}
|
275
330
|
return visible;
|
@@ -345,6 +400,10 @@ class MyDerivedData implements DerivedData {
|
|
345
400
|
componentName === "canfdClkSrcFreq"
|
346
401
|
) {
|
347
402
|
return this.isCanfdClockSupported();
|
403
|
+
} else if (componentName === COMPONENT_MAIN_CLOCK_SOURCE) {
|
404
|
+
if (this.dataModel.getComponentValue(COMPONENT_SET_MAX_FREQUENCY)) {
|
405
|
+
return false;
|
406
|
+
}
|
348
407
|
}
|
349
408
|
return true;
|
350
409
|
};
|
@@ -421,6 +480,16 @@ class MyDerivedData implements DerivedData {
|
|
421
480
|
return;
|
422
481
|
};
|
423
482
|
|
483
|
+
private getActualMainClockSource = (): string | undefined => {
|
484
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
485
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
486
|
+
);
|
487
|
+
if (interfaceData != undefined) {
|
488
|
+
return interfaceData.mainClockPayload?.mainClockSource;
|
489
|
+
}
|
490
|
+
return undefined;
|
491
|
+
};
|
492
|
+
|
424
493
|
private getActualSystemFrequency = (): string => {
|
425
494
|
let systemFrequency: number | undefined;
|
426
495
|
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
@@ -791,11 +860,39 @@ class MyDerivedData implements DerivedData {
|
|
791
860
|
};
|
792
861
|
|
793
862
|
private overrideDefaultValues = (componentName: string): any => {
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
863
|
+
switch (componentName) {
|
864
|
+
case "canfdClockSource":
|
865
|
+
{
|
866
|
+
const canClock = this.getDefaultCanClock();
|
867
|
+
if (canClock) {
|
868
|
+
return canClock;
|
869
|
+
}
|
870
|
+
}
|
871
|
+
break;
|
872
|
+
case COMPONENT_MAIN_CLOCK_SOURCE:
|
873
|
+
return this.getMainClockSource();
|
874
|
+
case COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY:
|
875
|
+
return this.getMainClockInputFrequencyInHz();
|
876
|
+
case COMPONENT_REQUESTED_SYSTEM_FREQUENCY:
|
877
|
+
return this.getRequestedSystemFrequencyInHz();
|
878
|
+
case COMPONENT_FVCO_DIVIDER:
|
879
|
+
return this.getFvcoDivider();
|
880
|
+
case COMPONENT_AUX_CLOCK_SOURCE:
|
881
|
+
return this.getAuxClockSource();
|
882
|
+
case COMPONENT_AUX_CLOCK_INPUT_FREQUENCY:
|
883
|
+
return this.getAuxClockInputFrequencyInHz();
|
884
|
+
case COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY:
|
885
|
+
return this.getRequestedAuxClockOutputFrequencyInHz();
|
886
|
+
case COMPONENT_AFVCO_DIVIDER:
|
887
|
+
return this.getAfvcoDivider();
|
888
|
+
case COMPONENT_REF_CLOCK_SOURCE:
|
889
|
+
return this.getRefClockSource();
|
890
|
+
case COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY:
|
891
|
+
return this.getRequestedRefClockOutputFrequencyInHz();
|
892
|
+
case COMPONENT_SET_MAX_FREQUENCY:
|
893
|
+
return this.getMaxFrequencySetFlag();
|
894
|
+
default:
|
895
|
+
break;
|
799
896
|
}
|
800
897
|
};
|
801
898
|
|
@@ -836,6 +933,9 @@ class MyDerivedData implements DerivedData {
|
|
836
933
|
COMPONENT_REQUESTED_SYSTEM_FREQUENCY,
|
837
934
|
),
|
838
935
|
fvcoDivider: Number(this.dataModel.getComponentValue(COMPONENT_FVCO_DIVIDER)),
|
936
|
+
setMaximumSystemFrequency: this.dataModel.getComponentValue(
|
937
|
+
COMPONENT_SET_MAX_FREQUENCY,
|
938
|
+
),
|
839
939
|
};
|
840
940
|
};
|
841
941
|
|
@@ -886,6 +986,180 @@ class MyDerivedData implements DerivedData {
|
|
886
986
|
|
887
987
|
return getCanClkDivFreq(canClkSrc, canClkFreq);
|
888
988
|
};
|
989
|
+
|
990
|
+
public getExportArgFromDriverInterface = (
|
991
|
+
componentName: string,
|
992
|
+
): ExportArg | undefined => {
|
993
|
+
const exportData = this.dataModel.getExportInterfaces().getInterfaceData();
|
994
|
+
if (exportData != undefined) {
|
995
|
+
const expArg = _find(
|
996
|
+
exportData,
|
997
|
+
(i) =>
|
998
|
+
i.interface === CLOCK_16BIT_DRV_INTERFACE && i.name === componentName,
|
999
|
+
);
|
1000
|
+
return expArg;
|
1001
|
+
}
|
1002
|
+
};
|
1003
|
+
|
1004
|
+
private getMainClockSource = (): any => {
|
1005
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1006
|
+
?.value;
|
1007
|
+
if (mainClockArg != undefined) {
|
1008
|
+
return mainClockArg?.mainClockSource;
|
1009
|
+
}
|
1010
|
+
};
|
1011
|
+
|
1012
|
+
private getMaxFrequencySetFlag = (): any => {
|
1013
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1014
|
+
?.value;
|
1015
|
+
if (mainClockArg != undefined) {
|
1016
|
+
return Boolean(mainClockArg?.setMaximumSystemFrequency);
|
1017
|
+
}
|
1018
|
+
};
|
1019
|
+
|
1020
|
+
private getMainClockInputFrequencyInHz = (): any => {
|
1021
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1022
|
+
?.value;
|
1023
|
+
if (mainClockArg != undefined) {
|
1024
|
+
return mainClockArg?.mainClockInputFrequency_Hz;
|
1025
|
+
}
|
1026
|
+
};
|
1027
|
+
|
1028
|
+
private getRequestedSystemFrequencyInHz = (): any => {
|
1029
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1030
|
+
?.value;
|
1031
|
+
if (mainClockArg != undefined) {
|
1032
|
+
return mainClockArg?.requestedSystemFrequency_Hz;
|
1033
|
+
}
|
1034
|
+
};
|
1035
|
+
|
1036
|
+
private getFvcoDivider = (): any => {
|
1037
|
+
const mainClockArg = this.getExportArgFromDriverInterface(ARGUMENT_MAIN_CLK)
|
1038
|
+
?.value;
|
1039
|
+
if (mainClockArg != undefined) {
|
1040
|
+
return String(mainClockArg.fvcoDivider);
|
1041
|
+
}
|
1042
|
+
};
|
1043
|
+
|
1044
|
+
private getAuxClockSource = (): any => {
|
1045
|
+
const auxClockArg = this.getExportArgFromDriverInterface(ARGUMENT_AUX_CLK)?.value;
|
1046
|
+
if (auxClockArg != undefined) {
|
1047
|
+
return auxClockArg.auxClockSource;
|
1048
|
+
}
|
1049
|
+
};
|
1050
|
+
|
1051
|
+
private getAuxClockInputFrequencyInHz = (): any => {
|
1052
|
+
const auxClockArg = this.getExportArgFromDriverInterface(ARGUMENT_AUX_CLK)?.value;
|
1053
|
+
if (auxClockArg != undefined) {
|
1054
|
+
return auxClockArg.auxClockInputFrequency_Hz;
|
1055
|
+
}
|
1056
|
+
};
|
1057
|
+
|
1058
|
+
private getRequestedAuxClockOutputFrequencyInHz = (): any => {
|
1059
|
+
const auxClockArg = this.getExportArgFromDriverInterface(ARGUMENT_AUX_CLK)?.value;
|
1060
|
+
if (auxClockArg != undefined) {
|
1061
|
+
return auxClockArg.requestedAuxClockOutputFrequency_Hz;
|
1062
|
+
}
|
1063
|
+
};
|
1064
|
+
|
1065
|
+
private getAfvcoDivider = (): any => {
|
1066
|
+
const auxClockArg = this.getExportArgFromDriverInterface(ARGUMENT_AUX_CLK)?.value;
|
1067
|
+
if (auxClockArg != undefined) {
|
1068
|
+
return auxClockArg.afvcoDivider;
|
1069
|
+
}
|
1070
|
+
};
|
1071
|
+
|
1072
|
+
private getRefClockSource = (): any => {
|
1073
|
+
const refClockArg = this.getExportArgFromDriverInterface(ARGUMENT_REF_CLK)?.value;
|
1074
|
+
if (refClockArg != undefined) {
|
1075
|
+
return refClockArg.refClockSource;
|
1076
|
+
}
|
1077
|
+
};
|
1078
|
+
|
1079
|
+
private getRequestedRefClockOutputFrequencyInHz = (): any => {
|
1080
|
+
const refClockArg = this.getExportArgFromDriverInterface(ARGUMENT_REF_CLK)?.value;
|
1081
|
+
if (refClockArg != undefined) {
|
1082
|
+
return refClockArg.requestedRefClockOutputFrequency_Hz;
|
1083
|
+
}
|
1084
|
+
};
|
1085
|
+
|
1086
|
+
private getCanfdClockSource = (): any => {
|
1087
|
+
const refClockArg = this.getExportArgFromDriverInterface("canfdClockArg")?.value;
|
1088
|
+
if (refClockArg != undefined) {
|
1089
|
+
return refClockArg.canfdClockSource;
|
1090
|
+
}
|
1091
|
+
};
|
1092
|
+
|
1093
|
+
private getClock16bitDrvInterfaceId = (): InterfaceId => {
|
1094
|
+
return {
|
1095
|
+
name: CLOCK_16BIT_DRV_INTERFACE,
|
1096
|
+
version: "1.0.0",
|
1097
|
+
};
|
1098
|
+
};
|
1099
|
+
|
1100
|
+
private getClockApplicationInterfacePayload = ():
|
1101
|
+
| Processor.Dictionary<clock_16bit_config_interface.ProcessedPayload>
|
1102
|
+
| undefined => {
|
1103
|
+
const clockApplicationInterfacePayloads: Processor.Dictionary<clock_16bit_drv_interface.ProcessedPayload> = {};
|
1104
|
+
const clockApplicationInterfaceRequests:
|
1105
|
+
| Processor.Dictionary<clock_16bit_drv_interface.Arguments>
|
1106
|
+
| undefined = this.dataModel
|
1107
|
+
.getExportInterfaces()
|
1108
|
+
.getInterface("clock_16bit_drv_interface", this.getClock16bitDrvInterfaceId())
|
1109
|
+
?.args;
|
1110
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
1111
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
1112
|
+
);
|
1113
|
+
if (
|
1114
|
+
clockApplicationInterfaceRequests != undefined &&
|
1115
|
+
interfaceData != undefined
|
1116
|
+
) {
|
1117
|
+
getKeys(clockApplicationInterfaceRequests)?.forEach((module) => {
|
1118
|
+
clockApplicationInterfacePayloads[module] = {
|
1119
|
+
...clockApplicationInterfacePayloads[module],
|
1120
|
+
mainClockPayload: interfaceData.mainClockPayload,
|
1121
|
+
hasUSB: interfaceData.hasUSB,
|
1122
|
+
hasAuxClock: interfaceData.hasAuxClock,
|
1123
|
+
hasRefClock: interfaceData.hasRefClock,
|
1124
|
+
hasCanfdClock: interfaceData.hasCanfdClock,
|
1125
|
+
hasSecondaryOscillator: interfaceData.hasSecondaryOscillator,
|
1126
|
+
isSecondaryOscillatorEnabled:
|
1127
|
+
interfaceData.isSecondaryOscillatorEnabled,
|
1128
|
+
auxClockPayload: interfaceData.auxClockPayload,
|
1129
|
+
refClockPayload: interfaceData.refClockPayload,
|
1130
|
+
canfdClockPayload: interfaceData.canfdClockPayload,
|
1131
|
+
};
|
1132
|
+
});
|
1133
|
+
}
|
1134
|
+
return clockApplicationInterfacePayloads;
|
1135
|
+
};
|
1136
|
+
private friendlyExportName = (exportKey: string): string => {
|
1137
|
+
let exportName: string;
|
1138
|
+
switch (exportKey) {
|
1139
|
+
case "canfd_clock":
|
1140
|
+
exportName = "CAN FD Clock";
|
1141
|
+
break;
|
1142
|
+
case "clock_16bit_drv_interface":
|
1143
|
+
exportName = "Clock Drv Config";
|
1144
|
+
break;
|
1145
|
+
default:
|
1146
|
+
exportName = exportKey;
|
1147
|
+
break;
|
1148
|
+
}
|
1149
|
+
return exportName;
|
1150
|
+
};
|
1151
|
+
private friendlyImportName = (importKey: string): string => {
|
1152
|
+
let importName: string;
|
1153
|
+
switch (importKey) {
|
1154
|
+
case "clock_16bit_config_interface":
|
1155
|
+
importName = "Clock Configuration";
|
1156
|
+
break;
|
1157
|
+
default:
|
1158
|
+
importName = importKey;
|
1159
|
+
break;
|
1160
|
+
}
|
1161
|
+
return importName;
|
1162
|
+
};
|
889
1163
|
}
|
890
1164
|
|
891
1165
|
export const getSelectedCanfdFreq = (freqList: number[]): number => {
|
package/src/actions.ts
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Action } from "@microchip/scf-common";
|
2
|
+
|
3
|
+
export const ClockActions = {
|
4
|
+
FORCE_UPDATE: "FORCE_UPDATE",
|
5
|
+
};
|
6
|
+
|
7
|
+
export type ClockAction = Action<string, ClockActionPayload>;
|
8
|
+
|
9
|
+
export type ClockActionPayload = {
|
10
|
+
key: string;
|
11
|
+
value: string;
|
12
|
+
};
|
13
|
+
|
14
|
+
export const updateClockState = (key: string, value: string): ClockAction => {
|
15
|
+
return {
|
16
|
+
type: ClockActions.FORCE_UPDATE,
|
17
|
+
payload: {
|
18
|
+
key,
|
19
|
+
value,
|
20
|
+
},
|
21
|
+
};
|
22
|
+
};
|