@mchp-mcc/clock-16bit-driver 1.0.1 → 1.0.2
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 +7 -0
- package/Readme.md +7 -2
- package/output/creator.js +3328 -3
- package/output/creator.js.map +1 -1
- package/output/index.html +25 -0
- package/output/nullPrototype.json +11 -1
- package/output/processor.js +6096 -16
- package/output/processor.js.map +1 -1
- package/output/reducer.js +17774 -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 +34 -10
- package/src/App.tsx +54 -0
- package/src/DerivedData.tsx +219 -13
- package/src/actions.ts +22 -0
- package/src/catalog.json +25 -0
- package/src/index.tsx +48 -0
- package/src/moduleConfig.json +13 -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.0.2",
|
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",
|
@@ -13,10 +13,11 @@
|
|
13
13
|
"category": "System"
|
14
14
|
},
|
15
15
|
"scf-automodule": {
|
16
|
-
"mode": "
|
16
|
+
"mode": "react",
|
17
17
|
"hookPaths": {
|
18
18
|
"processor": "generated_module/src/processor.tsx",
|
19
|
-
"creator": "generated_module/src/creator.tsx"
|
19
|
+
"creator": "generated_module/src/creator.tsx",
|
20
|
+
"reducer": "src/reducer.tsx"
|
20
21
|
},
|
21
22
|
"shouldNotifyOnDeploy": false
|
22
23
|
},
|
@@ -66,17 +67,21 @@
|
|
66
67
|
"<rootDir>/run"
|
67
68
|
],
|
68
69
|
"preset": "ts-jest",
|
69
|
-
"collectCoverage": true
|
70
|
+
"collectCoverage": true,
|
71
|
+
"moduleNameMapper": {
|
72
|
+
"\\.(css|less|scss|sss|styl)$": "<rootDir>/node_modules/jest-css-modules"
|
73
|
+
}
|
70
74
|
},
|
71
75
|
"dependencies": {
|
72
76
|
"@mchp-mcc/pic-8bit-types": "^5.4.1",
|
73
77
|
"@microchip/api-prefix-registration": "^0.1.0",
|
74
78
|
"@microchip/canfd-clock-interface": "^1.0.0",
|
75
|
-
"@microchip/clock-16bit-config-interface": "^1.
|
79
|
+
"@microchip/clock-16bit-config-interface": "^1.1.0",
|
80
|
+
"@microchip/clock-16bit-interface": "^1.1.0",
|
76
81
|
"@microchip/fosc-hz": "^0.1.2",
|
77
82
|
"@microchip/pin-standard": "^0.2.14",
|
78
83
|
"@microchip/scf-automodule-interface": "^0.17.0",
|
79
|
-
"@microchip/scf-common": "^3.
|
84
|
+
"@microchip/scf-common": "^3.16.0",
|
80
85
|
"@microchip/scf-device": "^8.2.0",
|
81
86
|
"@microchip/scf-integration-test": "^1.0.0",
|
82
87
|
"@microchip/scf-interface": "^1.4.0",
|
@@ -90,10 +95,11 @@
|
|
90
95
|
"@babel/preset-typescript": "^7.9.0",
|
91
96
|
"@microchip/initializer-system": "^0.5.3",
|
92
97
|
"@microchip/pic-8bit-types": "^5.0.1",
|
93
|
-
"@microchip/run-directory": "^2.
|
98
|
+
"@microchip/run-directory": "^2.3.58",
|
94
99
|
"@microchip/run-directory-future": "^1.0.5",
|
95
|
-
"@microchip/scf-automodule": "
|
96
|
-
"@microchip/scf-autoview": "^3.
|
100
|
+
"@microchip/scf-automodule": "4.14.6",
|
101
|
+
"@microchip/scf-autoview": "^3.20.0",
|
102
|
+
"@microchip/scf-autoview-impl": "^3.3.1",
|
97
103
|
"@microchip/scf-project-scripts": "^1.0.0",
|
98
104
|
"@types/core-js": "^2.5.1",
|
99
105
|
"@types/enzyme": "^3.9.3",
|
@@ -106,10 +112,14 @@
|
|
106
112
|
"@types/semver": "^7.1.0",
|
107
113
|
"@typescript-eslint/eslint-plugin": "^3.2.0",
|
108
114
|
"@typescript-eslint/parser": "^3.6.0",
|
115
|
+
"autoprefixer": "^9.7.6",
|
109
116
|
"babel-eslint": "^10.1.0",
|
110
117
|
"babel-loader": "^8.0.6",
|
111
118
|
"babel-plugin-named-asset-import": "^0.3.2",
|
112
119
|
"babel-preset-react-app": "^9.0.0",
|
120
|
+
"classnames": "^2.2.6",
|
121
|
+
"core-js": "^3.6.5",
|
122
|
+
"css-loader": "^3.5.2",
|
113
123
|
"del": "^4.1.1",
|
114
124
|
"eslint": "^7.4.0",
|
115
125
|
"eslint-config-prettier": "^6.11.0",
|
@@ -117,6 +127,7 @@
|
|
117
127
|
"eslint-loader": "^4.0.2",
|
118
128
|
"eslint-plugin-prettier": "^3.1.3",
|
119
129
|
"eslint-plugin-react": "^7.20.0",
|
130
|
+
"file-loader": "^6.0.0",
|
120
131
|
"fork-ts-checker-webpack-plugin": "^1.3.7",
|
121
132
|
"fs": "^0.0.1-security",
|
122
133
|
"gulp": "^4.0.2",
|
@@ -125,17 +136,30 @@
|
|
125
136
|
"gulp-if": "^3.0.0",
|
126
137
|
"gulp-typescript": "^5.0.1",
|
127
138
|
"hard-source-webpack-plugin": "^0.13.1",
|
139
|
+
"html-webpack-plugin": "^4.2.0",
|
128
140
|
"husky": "^4.2.4",
|
129
141
|
"is-wsl": "^2.1.0",
|
130
142
|
"jest": "^24.8.0",
|
143
|
+
"jest-css-modules": "^2.1.0",
|
131
144
|
"jest-html-reporter": "^2.5.0",
|
132
145
|
"jest-pnp-resolver": "^1.2.1",
|
133
146
|
"lint-staged": "^10.1.3",
|
147
|
+
"mini-css-extract-plugin": "^0.9.0",
|
148
|
+
"node-sass": "^4.13.1",
|
149
|
+
"optimize-css-assets-webpack-plugin": "^5.0.3",
|
134
150
|
"pnp-webpack-plugin": "^1.5.0",
|
151
|
+
"postcss-loader": "^3.0.0",
|
152
|
+
"postcss-safe-parser": "^4.0.2",
|
135
153
|
"prettier": "^2.0.5",
|
154
|
+
"react": "^16.13.1",
|
155
|
+
"react-dom": "^16.13.1",
|
156
|
+
"react-redux": "^7.2.0",
|
157
|
+
"sass-loader": "^9.0.2",
|
158
|
+
"style-loader": "^1.2.1",
|
136
159
|
"ts-jest": "^24.0.2",
|
137
160
|
"ts-pnp": "^1.1.2",
|
138
161
|
"typescript": "^4.0.5",
|
162
|
+
"url-loader": "^4.1.0",
|
139
163
|
"webpack": "^4.34.0",
|
140
164
|
"webpack-cli": "^3.3.4",
|
141
165
|
"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/DerivedData.tsx
CHANGED
@@ -6,23 +6,30 @@ 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_ux_interface from "@microchip/clock-16bit-interface";
|
12
|
+
import { ExportArg } from "@microchip/scf-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 COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY =
|
29
|
+
export const COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY =
|
23
30
|
"requestedAuxClockOutputFrequency_Hz";
|
24
31
|
const COMPONENT_AFVCO_DIVIDER = "afvcoDivider";
|
25
|
-
const COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY =
|
32
|
+
export const COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY =
|
26
33
|
"requestedRefClockOutputFrequency_Hz";
|
27
34
|
const COMPONENT_REQUESTED_CANFD_CLOCK_OUTPUT_FREQUENCY =
|
28
35
|
"requestedCanfdClockOutputFrequency_Hz";
|
@@ -102,6 +109,7 @@ class MyDerivedData implements DerivedData {
|
|
102
109
|
requestedRefClockOutputFrequency_HzValidator: this
|
103
110
|
.requestedRefClockOutputFrequency_HzValidator,
|
104
111
|
getCustomUiErrors: this.getCustomUiErrors,
|
112
|
+
"clock-16bit-ux-interface_payloads": this.getClockApplicationInterfacePayload,
|
105
113
|
};
|
106
114
|
};
|
107
115
|
|
@@ -152,7 +160,8 @@ class MyDerivedData implements DerivedData {
|
|
152
160
|
|
153
161
|
private mainClockInputFrequency_HzValidator = (): any => {
|
154
162
|
return {
|
155
|
-
minimum:
|
163
|
+
minimum: this.getMinClockFrequency(),
|
164
|
+
maximum: this.getMaxClockFrequency(),
|
156
165
|
};
|
157
166
|
};
|
158
167
|
|
@@ -171,6 +180,7 @@ class MyDerivedData implements DerivedData {
|
|
171
180
|
private requestedSystemFrequency_HzValidator = (): any => {
|
172
181
|
return {
|
173
182
|
minimum: 1,
|
183
|
+
maximum: this.getMaxSystemClockFrequency(),
|
174
184
|
};
|
175
185
|
};
|
176
186
|
|
@@ -180,6 +190,42 @@ class MyDerivedData implements DerivedData {
|
|
180
190
|
};
|
181
191
|
};
|
182
192
|
|
193
|
+
private getMinClockFrequency = (): number => {
|
194
|
+
let minClockFrequency = 0;
|
195
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
196
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
197
|
+
);
|
198
|
+
if (interfaceData != undefined) {
|
199
|
+
minClockFrequency =
|
200
|
+
interfaceData?.mainClockPayload?.mainClockInputMinFrequency ?? 0;
|
201
|
+
}
|
202
|
+
return minClockFrequency;
|
203
|
+
};
|
204
|
+
|
205
|
+
private getMaxClockFrequency = (): number => {
|
206
|
+
let maxClockFrequency = 0;
|
207
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
208
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
209
|
+
);
|
210
|
+
if (interfaceData != undefined) {
|
211
|
+
maxClockFrequency =
|
212
|
+
interfaceData?.mainClockPayload?.mainClockInputMaxFrequency ?? 0;
|
213
|
+
}
|
214
|
+
return maxClockFrequency;
|
215
|
+
};
|
216
|
+
|
217
|
+
private getMaxSystemClockFrequency = (): number => {
|
218
|
+
let maxSystemClockFrequency = 0;
|
219
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
220
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
221
|
+
);
|
222
|
+
if (interfaceData != undefined) {
|
223
|
+
maxSystemClockFrequency =
|
224
|
+
interfaceData?.mainClockPayload?.maxSystemClockFrequency ?? 0;
|
225
|
+
}
|
226
|
+
return maxSystemClockFrequency;
|
227
|
+
};
|
228
|
+
|
183
229
|
private getUiBehavior = (component: string): any => {
|
184
230
|
let uiBehavior = {};
|
185
231
|
switch (component) {
|
@@ -791,11 +837,37 @@ class MyDerivedData implements DerivedData {
|
|
791
837
|
};
|
792
838
|
|
793
839
|
private overrideDefaultValues = (componentName: string): any => {
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
840
|
+
switch (componentName) {
|
841
|
+
case "canfdClockSource":
|
842
|
+
{
|
843
|
+
const canClock = this.getDefaultCanClock();
|
844
|
+
if (canClock) {
|
845
|
+
return canClock;
|
846
|
+
}
|
847
|
+
}
|
848
|
+
break;
|
849
|
+
case COMPONENT_MAIN_CLOCK_SOURCE:
|
850
|
+
return this.getMainClockSource();
|
851
|
+
case COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY:
|
852
|
+
return this.getMainClockInputFrequencyInHz();
|
853
|
+
case COMPONENT_REQUESTED_SYSTEM_FREQUENCY:
|
854
|
+
return this.getRequestedSystemFrequencyInHz();
|
855
|
+
case COMPONENT_FVCO_DIVIDER:
|
856
|
+
return this.getFvcoDivider();
|
857
|
+
case COMPONENT_AUX_CLOCK_SOURCE:
|
858
|
+
return this.getAuxClockSource();
|
859
|
+
case COMPONENT_AUX_CLOCK_INPUT_FREQUENCY:
|
860
|
+
return this.getAuxClockInputFrequencyInHz();
|
861
|
+
case COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY:
|
862
|
+
return this.getRequestedAuxClockOutputFrequencyInHz();
|
863
|
+
case COMPONENT_AFVCO_DIVIDER:
|
864
|
+
return this.getAfvcoDivider();
|
865
|
+
case COMPONENT_REF_CLOCK_SOURCE:
|
866
|
+
return this.getRefClockSource();
|
867
|
+
case COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY:
|
868
|
+
return this.getRequestedRefClockOutputFrequencyInHz();
|
869
|
+
default:
|
870
|
+
break;
|
799
871
|
}
|
800
872
|
};
|
801
873
|
|
@@ -886,6 +958,140 @@ class MyDerivedData implements DerivedData {
|
|
886
958
|
|
887
959
|
return getCanClkDivFreq(canClkSrc, canClkFreq);
|
888
960
|
};
|
961
|
+
|
962
|
+
public getExportArg = (componentName: string): ExportArg | undefined => {
|
963
|
+
const exportData = this.dataModel.getExportInterfaces().getInterfaceData();
|
964
|
+
if (exportData != undefined) {
|
965
|
+
const expArg = _find(
|
966
|
+
exportData,
|
967
|
+
(i) =>
|
968
|
+
i.interface === "clock-16bit-ux-interface" &&
|
969
|
+
i.name === componentName,
|
970
|
+
);
|
971
|
+
return expArg;
|
972
|
+
}
|
973
|
+
};
|
974
|
+
|
975
|
+
private getMainClockSource = (): any => {
|
976
|
+
const mainClockArg = this.getExportArg(ARGUMENT_MAIN_CLK)?.value;
|
977
|
+
if (mainClockArg != undefined) {
|
978
|
+
return mainClockArg?.mainClockSource;
|
979
|
+
}
|
980
|
+
};
|
981
|
+
|
982
|
+
private getMainClockInputFrequencyInHz = (): any => {
|
983
|
+
const mainClockArg = this.getExportArg(ARGUMENT_MAIN_CLK)?.value;
|
984
|
+
if (mainClockArg != undefined) {
|
985
|
+
return mainClockArg?.mainClockInputFrequency_Hz;
|
986
|
+
}
|
987
|
+
};
|
988
|
+
|
989
|
+
private getRequestedSystemFrequencyInHz = (): any => {
|
990
|
+
const mainClockArg = this.getExportArg(ARGUMENT_MAIN_CLK)?.value;
|
991
|
+
if (mainClockArg != undefined) {
|
992
|
+
return mainClockArg?.requestedSystemFrequency_Hz;
|
993
|
+
}
|
994
|
+
};
|
995
|
+
|
996
|
+
private getFvcoDivider = (): any => {
|
997
|
+
const mainClockArg = this.getExportArg(ARGUMENT_MAIN_CLK)?.value;
|
998
|
+
if (mainClockArg != undefined) {
|
999
|
+
return String(mainClockArg.fvcoDivider);
|
1000
|
+
}
|
1001
|
+
};
|
1002
|
+
|
1003
|
+
private getAuxClockSource = (): any => {
|
1004
|
+
const auxClockArg = this.getExportArg(ARGUMENT_AUX_CLK)?.value;
|
1005
|
+
if (auxClockArg != undefined) {
|
1006
|
+
return auxClockArg.auxClockSource;
|
1007
|
+
}
|
1008
|
+
};
|
1009
|
+
|
1010
|
+
private getAuxClockInputFrequencyInHz = (): any => {
|
1011
|
+
const auxClockArg = this.getExportArg(ARGUMENT_AUX_CLK)?.value;
|
1012
|
+
if (auxClockArg != undefined) {
|
1013
|
+
return auxClockArg.auxClockInputFrequency_Hz;
|
1014
|
+
}
|
1015
|
+
};
|
1016
|
+
|
1017
|
+
private getRequestedAuxClockOutputFrequencyInHz = (): any => {
|
1018
|
+
const auxClockArg = this.getExportArg(ARGUMENT_AUX_CLK)?.value;
|
1019
|
+
if (auxClockArg != undefined) {
|
1020
|
+
return auxClockArg.requestedAuxClockOutputFrequency_Hz;
|
1021
|
+
}
|
1022
|
+
};
|
1023
|
+
|
1024
|
+
private getAfvcoDivider = (): any => {
|
1025
|
+
const auxClockArg = this.getExportArg(ARGUMENT_AUX_CLK)?.value;
|
1026
|
+
if (auxClockArg != undefined) {
|
1027
|
+
return auxClockArg.afvcoDivider;
|
1028
|
+
}
|
1029
|
+
};
|
1030
|
+
|
1031
|
+
private getRefClockSource = (): any => {
|
1032
|
+
const refClockArg = this.getExportArg(ARGUMENT_REF_CLK)?.value;
|
1033
|
+
if (refClockArg != undefined) {
|
1034
|
+
return refClockArg.refClockSource;
|
1035
|
+
}
|
1036
|
+
};
|
1037
|
+
|
1038
|
+
private getRequestedRefClockOutputFrequencyInHz = (): any => {
|
1039
|
+
const refClockArg = this.getExportArg(ARGUMENT_REF_CLK)?.value;
|
1040
|
+
if (refClockArg != undefined) {
|
1041
|
+
return refClockArg.requestedRefClockOutputFrequency_Hz;
|
1042
|
+
}
|
1043
|
+
};
|
1044
|
+
|
1045
|
+
private getCanfdClockSource = (): any => {
|
1046
|
+
const refClockArg = this.getExportArg("canfdClockArg")?.value;
|
1047
|
+
if (refClockArg != undefined) {
|
1048
|
+
return refClockArg.canfdClockSource;
|
1049
|
+
}
|
1050
|
+
};
|
1051
|
+
|
1052
|
+
private getClock16bitUxInterfaceId = (): InterfaceId => {
|
1053
|
+
return {
|
1054
|
+
name: "clock-16bit-ux-interface",
|
1055
|
+
version: "0.1.0",
|
1056
|
+
};
|
1057
|
+
};
|
1058
|
+
|
1059
|
+
private getClockApplicationInterfacePayload = ():
|
1060
|
+
| Processor.Dictionary<clock_16bit_config_interface.ProcessedPayload>
|
1061
|
+
| undefined => {
|
1062
|
+
const clockApplicationInterfacePayloads: Processor.Dictionary<clock_16bit_ux_interface.ProcessedPayload> = {};
|
1063
|
+
const clockApplicationInterfaceRequests:
|
1064
|
+
| Processor.Dictionary<clock_16bit_ux_interface.Arguments>
|
1065
|
+
| undefined = this.dataModel
|
1066
|
+
.getExportInterfaces()
|
1067
|
+
.getInterface("clock_16bit_ux_interface", this.getClock16bitUxInterfaceId())
|
1068
|
+
?.args;
|
1069
|
+
const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
|
1070
|
+
CLOCK_16BIT_CONFIG_INTERFACE,
|
1071
|
+
);
|
1072
|
+
if (
|
1073
|
+
clockApplicationInterfaceRequests != undefined &&
|
1074
|
+
interfaceData != undefined
|
1075
|
+
) {
|
1076
|
+
getKeys(clockApplicationInterfaceRequests)?.forEach((module) => {
|
1077
|
+
clockApplicationInterfacePayloads[module] = {
|
1078
|
+
...clockApplicationInterfacePayloads[module],
|
1079
|
+
mainClockPayload: interfaceData.mainClockPayload,
|
1080
|
+
hasUSB: interfaceData.hasUSB,
|
1081
|
+
hasAuxClock: interfaceData.hasAuxClock,
|
1082
|
+
hasRefClock: interfaceData.hasRefClock,
|
1083
|
+
hasCanfdClock: interfaceData.hasCanfdClock,
|
1084
|
+
hasSecondaryOscillator: interfaceData.hasSecondaryOscillator,
|
1085
|
+
isSecondaryOscillatorEnabled:
|
1086
|
+
interfaceData.isSecondaryOscillatorEnabled,
|
1087
|
+
auxClockPayload: interfaceData.auxClockPayload,
|
1088
|
+
refClockPayload: interfaceData.refClockPayload,
|
1089
|
+
canfdClockPayload: interfaceData.canfdClockPayload,
|
1090
|
+
};
|
1091
|
+
});
|
1092
|
+
}
|
1093
|
+
return clockApplicationInterfacePayloads;
|
1094
|
+
};
|
889
1095
|
}
|
890
1096
|
|
891
1097
|
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
|
+
};
|
package/src/catalog.json
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"name": "@mchp-mcc/local-catalog",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"content": [
|
5
|
+
{
|
6
|
+
"name": "@mchp-mcc/clock-16bit-driver",
|
7
|
+
"version": "*",
|
8
|
+
"meta": {
|
9
|
+
"keywords": [
|
10
|
+
"avr",
|
11
|
+
"pic8",
|
12
|
+
"driver",
|
13
|
+
""
|
14
|
+
],
|
15
|
+
"name": "Clock",
|
16
|
+
"category": "System",
|
17
|
+
"description": "<Write description here>",
|
18
|
+
"deviceFilterRegEx": ".*",
|
19
|
+
"defaultSelection": true,
|
20
|
+
"releaseNotesLink": "https://onlinedocs.microchip.com/v2/keyword-lookup?keyword\u003dMCC.MELODY.8BITAVR.RELEASENOTES\u0026version\u003dlatest\u0026redirect\u003dtrue"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"catalogs": []
|
25
|
+
}
|
package/src/index.tsx
ADDED
@@ -0,0 +1,48 @@
|
|
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
|
+
import React from "react";
|
23
|
+
import { Store } from "redux";
|
24
|
+
import { render } from "react-dom";
|
25
|
+
import { Provider } from "react-redux";
|
26
|
+
import { createStore } from "@microchip/scf-autoview-impl/src/lib/views/src/store";
|
27
|
+
import App from "./App";
|
28
|
+
|
29
|
+
const bridge = (parent as any).windowCommunication;
|
30
|
+
let store: Store;
|
31
|
+
|
32
|
+
if (bridge) {
|
33
|
+
store = createStore({
|
34
|
+
dispatch: (action) => bridge.send("dispatch", [action]),
|
35
|
+
setRender: (render) => bridge.registerFunction("render", render),
|
36
|
+
refresh: () => bridge.send("refresh", []),
|
37
|
+
});
|
38
|
+
}
|
39
|
+
|
40
|
+
const Content: React.FunctionComponent<any> = () => {
|
41
|
+
return (
|
42
|
+
<Provider store={store}>
|
43
|
+
<App />
|
44
|
+
</Provider>
|
45
|
+
);
|
46
|
+
};
|
47
|
+
|
48
|
+
render(<Content />, document.getElementById("root"));
|
package/src/moduleConfig.json
CHANGED
@@ -41,7 +41,7 @@
|
|
41
41
|
"import": {
|
42
42
|
"interfaceId": {
|
43
43
|
"name": "clock-16bit-config-interface",
|
44
|
-
"version": "1.
|
44
|
+
"version": "^1.1.0"
|
45
45
|
},
|
46
46
|
"isRequired": true
|
47
47
|
}
|
@@ -57,6 +57,16 @@
|
|
57
57
|
}
|
58
58
|
}
|
59
59
|
]
|
60
|
+
},
|
61
|
+
"clock_16bit_ux_interface": {
|
62
|
+
"interfaces": [
|
63
|
+
{
|
64
|
+
"interfaceId": {
|
65
|
+
"name": "clock-16bit-ux-interface",
|
66
|
+
"version": "0.1.0"
|
67
|
+
}
|
68
|
+
}
|
69
|
+
]
|
60
70
|
}
|
61
71
|
},
|
62
72
|
"softwareData": {
|
@@ -109,7 +119,7 @@
|
|
109
119
|
},
|
110
120
|
"calculatedSystemFrequency_Hz": {
|
111
121
|
"name": "calculatedSystemFrequency_Hz",
|
112
|
-
"description": "System Frequency(FOSC)",
|
122
|
+
"description": "Calculated System Frequency(FOSC)",
|
113
123
|
"type": "string",
|
114
124
|
"defaultValue": "0",
|
115
125
|
"group": "systemClock",
|
@@ -123,7 +133,7 @@
|
|
123
133
|
},
|
124
134
|
"instructionClockFrequency_Hz": {
|
125
135
|
"name": "instructionClockFrequency_Hz",
|
126
|
-
"description": "Peripheral Frequency(FOSC/2)",
|
136
|
+
"description": "Calculated Peripheral Frequency(FOSC/2)",
|
127
137
|
"type": "string",
|
128
138
|
"defaultValue": "0",
|
129
139
|
"group": "systemClock",
|