@mchp-mcc/clock-16bit-driver 1.0.0 → 1.0.3

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.
Binary file
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@mchp-mcc/clock-16bit-driver",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "scf": {
5
- "reducer": "auto",
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": "standard",
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.0.0",
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.13.4",
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.4.1",
98
+ "@microchip/run-directory": "^2.3.58",
94
99
  "@microchip/run-directory-future": "^1.0.5",
95
- "@microchip/scf-automodule": "^4.14.6",
96
- "@microchip/scf-autoview": "^3.17.0",
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",
@@ -145,4 +169,4 @@
145
169
  "description": "- Download & Install [nodejs](https://nodejs.org/en/download/)\r - Download & Install npm\r - Setup node & npm in enviroment path",
146
170
  "main": "lib/generated_module/src/index.js",
147
171
  "author": ""
148
- }
172
+ }
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);
@@ -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,9 @@ 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,
113
+ importName: this.friendlyImportName,
114
+ exportName: this.friendlyExportName,
105
115
  };
106
116
  };
107
117
 
@@ -152,7 +162,8 @@ class MyDerivedData implements DerivedData {
152
162
 
153
163
  private mainClockInputFrequency_HzValidator = (): any => {
154
164
  return {
155
- minimum: 1,
165
+ minimum: this.getMinClockFrequency(),
166
+ maximum: this.getMaxClockFrequency(),
156
167
  };
157
168
  };
158
169
 
@@ -171,6 +182,7 @@ class MyDerivedData implements DerivedData {
171
182
  private requestedSystemFrequency_HzValidator = (): any => {
172
183
  return {
173
184
  minimum: 1,
185
+ maximum: this.getMaxSystemClockFrequency(),
174
186
  };
175
187
  };
176
188
 
@@ -180,6 +192,42 @@ class MyDerivedData implements DerivedData {
180
192
  };
181
193
  };
182
194
 
195
+ private getMinClockFrequency = (): number => {
196
+ let minClockFrequency = 0;
197
+ const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
198
+ CLOCK_16BIT_CONFIG_INTERFACE,
199
+ );
200
+ if (interfaceData != undefined) {
201
+ minClockFrequency =
202
+ interfaceData?.mainClockPayload?.mainClockInputMinFrequency ?? 0;
203
+ }
204
+ return minClockFrequency;
205
+ };
206
+
207
+ private getMaxClockFrequency = (): number => {
208
+ let maxClockFrequency = 0;
209
+ const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
210
+ CLOCK_16BIT_CONFIG_INTERFACE,
211
+ );
212
+ if (interfaceData != undefined) {
213
+ maxClockFrequency =
214
+ interfaceData?.mainClockPayload?.mainClockInputMaxFrequency ?? 0;
215
+ }
216
+ return maxClockFrequency;
217
+ };
218
+
219
+ private getMaxSystemClockFrequency = (): number => {
220
+ let maxSystemClockFrequency = 0;
221
+ const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
222
+ CLOCK_16BIT_CONFIG_INTERFACE,
223
+ );
224
+ if (interfaceData != undefined) {
225
+ maxSystemClockFrequency =
226
+ interfaceData?.mainClockPayload?.maxSystemClockFrequency ?? 0;
227
+ }
228
+ return maxSystemClockFrequency;
229
+ };
230
+
183
231
  private getUiBehavior = (component: string): any => {
184
232
  let uiBehavior = {};
185
233
  switch (component) {
@@ -341,7 +389,8 @@ class MyDerivedData implements DerivedData {
341
389
  } else if (
342
390
  componentName === COMPONENT_CANFD_CLOCK_SOURCE ||
343
391
  componentName === COMPONENT_REQUESTED_CANFD_CLOCK_OUTPUT_FREQUENCY ||
344
- componentName === "calculatedCanfdOutputFrequency_Hz"
392
+ componentName === "calculatedCanfdOutputFrequency_Hz" ||
393
+ componentName === "canfdClkSrcFreq"
345
394
  ) {
346
395
  return this.isCanfdClockSupported();
347
396
  }
@@ -790,11 +839,37 @@ class MyDerivedData implements DerivedData {
790
839
  };
791
840
 
792
841
  private overrideDefaultValues = (componentName: string): any => {
793
- if (componentName == "canfdClockSource") {
794
- const canClock = this.getDefaultCanClock();
795
- if (canClock) {
796
- return canClock;
797
- }
842
+ switch (componentName) {
843
+ case "canfdClockSource":
844
+ {
845
+ const canClock = this.getDefaultCanClock();
846
+ if (canClock) {
847
+ return canClock;
848
+ }
849
+ }
850
+ break;
851
+ case COMPONENT_MAIN_CLOCK_SOURCE:
852
+ return this.getMainClockSource();
853
+ case COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY:
854
+ return this.getMainClockInputFrequencyInHz();
855
+ case COMPONENT_REQUESTED_SYSTEM_FREQUENCY:
856
+ return this.getRequestedSystemFrequencyInHz();
857
+ case COMPONENT_FVCO_DIVIDER:
858
+ return this.getFvcoDivider();
859
+ case COMPONENT_AUX_CLOCK_SOURCE:
860
+ return this.getAuxClockSource();
861
+ case COMPONENT_AUX_CLOCK_INPUT_FREQUENCY:
862
+ return this.getAuxClockInputFrequencyInHz();
863
+ case COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY:
864
+ return this.getRequestedAuxClockOutputFrequencyInHz();
865
+ case COMPONENT_AFVCO_DIVIDER:
866
+ return this.getAfvcoDivider();
867
+ case COMPONENT_REF_CLOCK_SOURCE:
868
+ return this.getRefClockSource();
869
+ case COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY:
870
+ return this.getRequestedRefClockOutputFrequencyInHz();
871
+ default:
872
+ break;
798
873
  }
799
874
  };
800
875
 
@@ -885,6 +960,167 @@ class MyDerivedData implements DerivedData {
885
960
 
886
961
  return getCanClkDivFreq(canClkSrc, canClkFreq);
887
962
  };
963
+
964
+ public getExportArg = (componentName: string): ExportArg | undefined => {
965
+ const exportData = this.dataModel.getExportInterfaces().getInterfaceData();
966
+ if (exportData != undefined) {
967
+ const expArg = _find(
968
+ exportData,
969
+ (i) =>
970
+ i.interface === "clock-16bit-ux-interface" &&
971
+ i.name === componentName,
972
+ );
973
+ return expArg;
974
+ }
975
+ };
976
+
977
+ private getMainClockSource = (): any => {
978
+ const mainClockArg = this.getExportArg(ARGUMENT_MAIN_CLK)?.value;
979
+ if (mainClockArg != undefined) {
980
+ return mainClockArg?.mainClockSource;
981
+ }
982
+ };
983
+
984
+ private getMainClockInputFrequencyInHz = (): any => {
985
+ const mainClockArg = this.getExportArg(ARGUMENT_MAIN_CLK)?.value;
986
+ if (mainClockArg != undefined) {
987
+ return mainClockArg?.mainClockInputFrequency_Hz;
988
+ }
989
+ };
990
+
991
+ private getRequestedSystemFrequencyInHz = (): any => {
992
+ const mainClockArg = this.getExportArg(ARGUMENT_MAIN_CLK)?.value;
993
+ if (mainClockArg != undefined) {
994
+ return mainClockArg?.requestedSystemFrequency_Hz;
995
+ }
996
+ };
997
+
998
+ private getFvcoDivider = (): any => {
999
+ const mainClockArg = this.getExportArg(ARGUMENT_MAIN_CLK)?.value;
1000
+ if (mainClockArg != undefined) {
1001
+ return String(mainClockArg.fvcoDivider);
1002
+ }
1003
+ };
1004
+
1005
+ private getAuxClockSource = (): any => {
1006
+ const auxClockArg = this.getExportArg(ARGUMENT_AUX_CLK)?.value;
1007
+ if (auxClockArg != undefined) {
1008
+ return auxClockArg.auxClockSource;
1009
+ }
1010
+ };
1011
+
1012
+ private getAuxClockInputFrequencyInHz = (): any => {
1013
+ const auxClockArg = this.getExportArg(ARGUMENT_AUX_CLK)?.value;
1014
+ if (auxClockArg != undefined) {
1015
+ return auxClockArg.auxClockInputFrequency_Hz;
1016
+ }
1017
+ };
1018
+
1019
+ private getRequestedAuxClockOutputFrequencyInHz = (): any => {
1020
+ const auxClockArg = this.getExportArg(ARGUMENT_AUX_CLK)?.value;
1021
+ if (auxClockArg != undefined) {
1022
+ return auxClockArg.requestedAuxClockOutputFrequency_Hz;
1023
+ }
1024
+ };
1025
+
1026
+ private getAfvcoDivider = (): any => {
1027
+ const auxClockArg = this.getExportArg(ARGUMENT_AUX_CLK)?.value;
1028
+ if (auxClockArg != undefined) {
1029
+ return auxClockArg.afvcoDivider;
1030
+ }
1031
+ };
1032
+
1033
+ private getRefClockSource = (): any => {
1034
+ const refClockArg = this.getExportArg(ARGUMENT_REF_CLK)?.value;
1035
+ if (refClockArg != undefined) {
1036
+ return refClockArg.refClockSource;
1037
+ }
1038
+ };
1039
+
1040
+ private getRequestedRefClockOutputFrequencyInHz = (): any => {
1041
+ const refClockArg = this.getExportArg(ARGUMENT_REF_CLK)?.value;
1042
+ if (refClockArg != undefined) {
1043
+ return refClockArg.requestedRefClockOutputFrequency_Hz;
1044
+ }
1045
+ };
1046
+
1047
+ private getCanfdClockSource = (): any => {
1048
+ const refClockArg = this.getExportArg("canfdClockArg")?.value;
1049
+ if (refClockArg != undefined) {
1050
+ return refClockArg.canfdClockSource;
1051
+ }
1052
+ };
1053
+
1054
+ private getClock16bitUxInterfaceId = (): InterfaceId => {
1055
+ return {
1056
+ name: "clock-16bit-ux-interface",
1057
+ version: "0.1.0",
1058
+ };
1059
+ };
1060
+
1061
+ private getClockApplicationInterfacePayload = ():
1062
+ | Processor.Dictionary<clock_16bit_config_interface.ProcessedPayload>
1063
+ | undefined => {
1064
+ const clockApplicationInterfacePayloads: Processor.Dictionary<clock_16bit_ux_interface.ProcessedPayload> = {};
1065
+ const clockApplicationInterfaceRequests:
1066
+ | Processor.Dictionary<clock_16bit_ux_interface.Arguments>
1067
+ | undefined = this.dataModel
1068
+ .getExportInterfaces()
1069
+ .getInterface("clock_16bit_ux_interface", this.getClock16bitUxInterfaceId())
1070
+ ?.args;
1071
+ const interfaceData: clock_16bit_config_interface.ProcessedPayload = this.dataModel.getImportValue(
1072
+ CLOCK_16BIT_CONFIG_INTERFACE,
1073
+ );
1074
+ if (
1075
+ clockApplicationInterfaceRequests != undefined &&
1076
+ interfaceData != undefined
1077
+ ) {
1078
+ getKeys(clockApplicationInterfaceRequests)?.forEach((module) => {
1079
+ clockApplicationInterfacePayloads[module] = {
1080
+ ...clockApplicationInterfacePayloads[module],
1081
+ mainClockPayload: interfaceData.mainClockPayload,
1082
+ hasUSB: interfaceData.hasUSB,
1083
+ hasAuxClock: interfaceData.hasAuxClock,
1084
+ hasRefClock: interfaceData.hasRefClock,
1085
+ hasCanfdClock: interfaceData.hasCanfdClock,
1086
+ hasSecondaryOscillator: interfaceData.hasSecondaryOscillator,
1087
+ isSecondaryOscillatorEnabled:
1088
+ interfaceData.isSecondaryOscillatorEnabled,
1089
+ auxClockPayload: interfaceData.auxClockPayload,
1090
+ refClockPayload: interfaceData.refClockPayload,
1091
+ canfdClockPayload: interfaceData.canfdClockPayload,
1092
+ };
1093
+ });
1094
+ }
1095
+ return clockApplicationInterfacePayloads;
1096
+ };
1097
+ private friendlyExportName = (exportKey: string): string => {
1098
+ let exportName: string;
1099
+ switch (exportKey) {
1100
+ case "canfd_clock":
1101
+ exportName = "CAN FD Clock";
1102
+ break;
1103
+ case "clock_16bit_ux_interface":
1104
+ exportName = "Clock Drv Config";
1105
+ break;
1106
+ default:
1107
+ exportName = exportKey;
1108
+ break;
1109
+ }
1110
+ return exportName;
1111
+ };
1112
+ private friendlyImportName = (importKey: string): string => {
1113
+ let importName: string;
1114
+ switch (importKey) {
1115
+ case "clock_16bit_config_interface":
1116
+ importName = "Clock Configuration";
1117
+ break;
1118
+ default:
1119
+ importName = importKey;
1120
+ break;
1121
+ }
1122
+ return importName;
1123
+ };
888
1124
  }
889
1125
 
890
1126
  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
+ };
@@ -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"));
@@ -41,7 +41,7 @@
41
41
  "import": {
42
42
  "interfaceId": {
43
43
  "name": "clock-16bit-config-interface",
44
- "version": "1.0.0"
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",