@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.
Files changed (70) hide show
  1. package/Changelog.md +19 -0
  2. package/Readme.md +43 -14
  3. package/lib/generated_module/src/index.js +0 -5
  4. package/output/04701ca33ce96d3254191b8bb4be6080.ttf +0 -0
  5. package/output/0af28946b49fa427ea09eb020906b421.otf +0 -0
  6. package/output/0ffc720f1bf788849cc8ce9e79376cb3.eot +0 -0
  7. package/output/1ac124f8c2620ca86850329afeb7c0bd.otf +0 -0
  8. package/output/1c89d58269b6e0c5f3d9d9876325b4ba.woff2 +0 -0
  9. package/output/1d0d8b66fa1da76d69b95b6d0ed5cca9.svg +336 -0
  10. package/output/1d79a0559e5f13294dee77456b02b56f.woff +0 -0
  11. package/output/2509c35b0cfc629f81e50ce5ef62e4d3.woff +0 -0
  12. package/output/252a41f69d4c320154a12092f6fbbedd.ttf +0 -0
  13. package/output/2aeabc9e8ed0aef227d72fee83c14462.eot +0 -0
  14. package/output/2c8903475ef5366ce36603d79ba02d25.woff2 +0 -0
  15. package/output/39c65dcc08f7edb347b62cee45cd7048.gif +0 -0
  16. package/output/3dfc3dd20959a5bac99f7d9152530aa9.woff +0 -0
  17. package/output/61747992dd9a412e601e3defa3f3baa6.ttf +0 -0
  18. package/output/61bf3cad3150daa5af2dab9aaa02e3ff.woff +0 -0
  19. package/output/6240b67b77d9bac167d7834f793e83ff.woff2 +0 -0
  20. package/output/6441e63a57ccc5105bad045142bc31eb.png +0 -0
  21. package/output/6e408e472d90198222ef851e45a6070d.eot +0 -0
  22. package/output/7435e6c2064f36f486266e516e9838b8.woff2 +0 -0
  23. package/output/75e0e55bdb3e82dcacf88e90bf17bac6.eot +0 -0
  24. package/output/7d6bf0009e0d61e7e6f376fccab8bb09.woff +0 -0
  25. package/output/7ebd6258cbbc40b4f0e108e444bcb9b1.woff +0 -0
  26. package/output/87a454b233bedae23f8d1be11e8b4f68.woff +0 -0
  27. package/output/926388f043fc8117b35b84b241a7f688.svg +334 -0
  28. package/output/9347db5956a89b0bab38d3e610eee01d.gif +0 -0
  29. package/output/94f5fdef85538cbd160aa2b71e67ab27.otf +0 -0
  30. package/output/a0cf4179f3139f862d55dea472a2315c.woff2 +0 -0
  31. package/output/a356e361ee6765f3d6d4c1d4664f12ab.eot +0 -0
  32. package/output/autoCreator.js +7745 -0
  33. package/output/autoCreator.js.map +1 -0
  34. package/output/autoProcessor.js +7747 -0
  35. package/output/autoProcessor.js.map +1 -0
  36. package/output/b49c708cb6f62d20fb57be4c6f736662.woff +0 -0
  37. package/output/bb3b405a4608d51ddb1306c2f641f3dd.svg +332 -0
  38. package/output/c2e128a00fca2640240d88892e29dc53.eot +0 -0
  39. package/output/cbc22e9676acf295231bfecc426fe916.eot +0 -0
  40. package/output/creator.js +12592 -1498
  41. package/output/creator.js.map +1 -1
  42. package/output/dae0d67b5b0a7332e0d555379c67e4de.eot +0 -0
  43. package/output/df17d4e30091735253a854052256d95d.woff +0 -0
  44. package/output/ec32d6be7329ece0789ccf9d0d519c4d.ttf +0 -0
  45. package/output/ec806460121999bcfb12bc264d46d41e.woff2 +0 -0
  46. package/output/eef5282a2e59fca7c3b7a96adbb3d649.otf +0 -0
  47. package/output/f2ebdee8c2343f558a0221d276957606.woff2 +0 -0
  48. package/output/f38c5a57b52cb6dda8141610603f6a58.eot +0 -0
  49. package/output/f78429ed0f939ede1ddb454a60a2bc0f.woff2 +0 -0
  50. package/output/fa2c83d2f35244bb10dcfef484ba6431.svg +211 -0
  51. package/output/fbbc016360f4b50975e254398a7b6964.ttf +0 -0
  52. package/output/index.html +25 -0
  53. package/output/main.js +155020 -0
  54. package/output/main.js.map +1 -0
  55. package/output/nullPrototype.json +11 -1
  56. package/output/processor.js +11209 -5640
  57. package/output/processor.js.map +1 -1
  58. package/output/reducer.js +34873 -0
  59. package/output/reducer.js.map +1 -0
  60. package/output/resources/help-icon.png +0 -0
  61. package/output/resources/loading-status.gif +0 -0
  62. package/package.json +48 -18
  63. package/src/App.tsx +54 -0
  64. package/src/CreatorFunctions.ts +1 -1
  65. package/src/{DerivedData.tsx → DerivedData.ts} +305 -31
  66. package/src/actions.ts +22 -0
  67. package/src/catalog.json +25 -0
  68. package/src/index.tsx +48 -0
  69. package/src/moduleConfig.json +24 -3
  70. package/src/reducer.tsx +94 -0
@@ -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.2"
45
45
  },
46
46
  "isRequired": true
47
47
  }
@@ -57,6 +57,16 @@
57
57
  }
58
58
  }
59
59
  ]
60
+ },
61
+ "clock_16bit_drv_interface": {
62
+ "interfaces": [
63
+ {
64
+ "interfaceId": {
65
+ "name": "clock-16bit-drv-interface",
66
+ "version": "1.0.0"
67
+ }
68
+ }
69
+ ]
60
70
  }
61
71
  },
62
72
  "softwareData": {
@@ -107,9 +117,20 @@
107
117
  "validation": true,
108
118
  "category": "software"
109
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
+ },
110
131
  "calculatedSystemFrequency_Hz": {
111
132
  "name": "calculatedSystemFrequency_Hz",
112
- "description": "System Frequency(FOSC)",
133
+ "description": "Calculated System Frequency(FOSC)",
113
134
  "type": "string",
114
135
  "defaultValue": "0",
115
136
  "group": "systemClock",
@@ -123,7 +144,7 @@
123
144
  },
124
145
  "instructionClockFrequency_Hz": {
125
146
  "name": "instructionClockFrequency_Hz",
126
- "description": "Peripheral Frequency(FOSC/2)",
147
+ "description": "Calculated Peripheral Frequency(FOSC/2)",
127
148
  "type": "string",
128
149
  "defaultValue": "0",
129
150
  "group": "systemClock",
@@ -0,0 +1,94 @@
1
+ import { State } from "../generated_module/src/types/State";
2
+ import { Actions } from "@microchip/scf-autoview/lib/simpleForm/actions";
3
+ import * as Auto from "@microchip/scf-autoview-impl/src/lib/reducer/reducer";
4
+ import { ClockAction, ClockActionPayload, ClockActions } from "./actions";
5
+ import {
6
+ COMPONENT_AUX_CLOCK_INPUT_FREQUENCY,
7
+ COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY,
8
+ COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY,
9
+ COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY,
10
+ COMPONENT_REQUESTED_SYSTEM_FREQUENCY,
11
+ } from "./DerivedData";
12
+
13
+ export interface MyState extends Auto.FormState {
14
+ [key: string]: any;
15
+ }
16
+
17
+ export const reduce = (state: State, action: any): State => {
18
+ switch (action.type) {
19
+ case Actions.SUBMIT_FORM:
20
+ return Auto.reduce(state, action);
21
+ case ClockActions.FORCE_UPDATE:
22
+ return clockReduce(state, action);
23
+ default:
24
+ return state;
25
+ }
26
+ };
27
+
28
+ export const clockReduce = (state: State, action: any): State => {
29
+ switch (action.type) {
30
+ case ClockActions.FORCE_UPDATE:
31
+ return updateClockUI(state, action);
32
+ default:
33
+ return state;
34
+ }
35
+ };
36
+
37
+ const updateClockUI = (state: State, action: ClockAction): State => {
38
+ const payload = action.payload;
39
+ let componentName = "";
40
+ const componentPath = payload?.key?.split(".");
41
+ if (componentPath != undefined) {
42
+ componentName = componentPath[componentPath?.length - 1];
43
+ }
44
+ const typeCastedComponentValue = getTypeCastedComponentValue(componentName, payload);
45
+ const newState = getNewState(state, componentName, typeCastedComponentValue);
46
+ return newState;
47
+ };
48
+
49
+ const getTypeCastedComponentValue = (
50
+ componentName: string,
51
+ payload: ClockActionPayload | undefined,
52
+ ): string | number | undefined => {
53
+ let componentValue: string | number | undefined;
54
+ if (
55
+ componentName === COMPONENT_MAIN_CLOCK_INPUT_FREQUENCY ||
56
+ componentName === COMPONENT_REQUESTED_SYSTEM_FREQUENCY ||
57
+ componentName === COMPONENT_AUX_CLOCK_INPUT_FREQUENCY ||
58
+ componentName === COMPONENT_REQUESTED_AUX_CLOCK_OUTPUT_FREQUENCY ||
59
+ componentName === COMPONENT_REQUESTED_REF_CLOCK_OUTPUT_FREQUENCY
60
+ ) {
61
+ componentValue = Number(payload?.value);
62
+ } else {
63
+ componentValue = payload?.value;
64
+ }
65
+ return componentValue;
66
+ };
67
+
68
+ const getNewState = (
69
+ state: State,
70
+ componentName: string,
71
+ componentValue: string | number | undefined,
72
+ ): State => {
73
+ for (const key in state) {
74
+ state[key] = updateValue(key, state[key], componentName, componentValue);
75
+ }
76
+ return state;
77
+ };
78
+
79
+ const updateValue = (
80
+ key: string,
81
+ existingValue: string | State,
82
+ componentName: string,
83
+ newValue: string | number | undefined,
84
+ ): string | number | State => {
85
+ if (typeof existingValue == "object") {
86
+ return getNewState(existingValue, componentName, newValue);
87
+ } else {
88
+ if (key == componentName && newValue != undefined) {
89
+ return newValue;
90
+ } else {
91
+ return existingValue;
92
+ }
93
+ }
94
+ };