@mchp-mcc/scf-pic8-osc-v1 4.3.2 → 4.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mchp-mcc/scf-pic8-osc-v1",
3
- "version": "4.3.2",
3
+ "version": "4.3.3",
4
4
  "scf": {
5
5
  "reducer": "auto",
6
6
  "creator": "output/creator.js",
@@ -10,7 +10,74 @@
10
10
  },
11
11
  "displayName": "Clock Control",
12
12
  "category": "System",
13
- "nullPrototype": "output/nullPrototype.json"
13
+ "nullPrototype": "output/nullPrototype.json",
14
+ "autoProcessor": "output/autoProcessor.js",
15
+ "autoCreator": "output/autoCreator.js",
16
+ "prototype": {
17
+ "payload": null,
18
+ "imports": {
19
+ "scf_pic8_osc_v1": {
20
+ "interfaceId": {
21
+ "name": "scf-pic8-osc-v1",
22
+ "version": "1.0.0"
23
+ },
24
+ "isRequired": true
25
+ },
26
+ "initializer_system": {
27
+ "interfaceId": {
28
+ "name": "initializer-system",
29
+ "version": "^0.5.3"
30
+ }
31
+ },
32
+ "config_device": {
33
+ "interfaceId": {
34
+ "name": "config-device",
35
+ "version": "^1.1.1"
36
+ }
37
+ },
38
+ "config_request": {
39
+ "interfaceId": {
40
+ "name": "config-request",
41
+ "version": "^2.0.1"
42
+ }
43
+ },
44
+ "pin_standard": {
45
+ "interfaceId": {
46
+ "name": "pin-standard",
47
+ "version": "^0.1.0"
48
+ }
49
+ },
50
+ "device_meta": {
51
+ "interfaceId": {
52
+ "name": "device-meta",
53
+ "version": "1.0.0"
54
+ }
55
+ }
56
+ },
57
+ "exports": {
58
+ "osc_clocks": {
59
+ "interfaces": [
60
+ {
61
+ "interfaceId": {
62
+ "name": "osc-clocks",
63
+ "version": "0.2.0"
64
+ }
65
+ }
66
+ ]
67
+ },
68
+ "fosc": {
69
+ "interfaces": [
70
+ {
71
+ "interfaceId": {
72
+ "name": "fosc-hz",
73
+ "version": "0.3.0"
74
+ }
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ "isEntryPoint": true
80
+ }
14
81
  },
15
82
  "scf-automodule": {
16
83
  "peripheral": {
@@ -23,12 +90,12 @@
23
90
  },
24
91
  "mode": "standard",
25
92
  "hookPaths": {
26
- "processor": "generated_module/src/processor.tsx",
27
- "creator": "generated_module/src/creator.tsx"
93
+ "processor": "generated_module/src/processor.ts",
94
+ "creator": "generated_module/src/creator.ts"
28
95
  },
29
96
  "shouldNotifyOnDeploy": false
30
97
  },
31
- "jenkinsPipeline": "MCU8_DS_PIPELINE_1XY",
98
+ "jenkinsPipeline": "MCU8_DS_PIPELINE_2XY",
32
99
  "license": "SEE LICENSE IN LICENSE.txt",
33
100
  "scripts": {
34
101
  "build": "gulp build --gulpfile config/gulpfile.js --cwd .",
@@ -48,8 +115,9 @@
48
115
  "build-run-dir-future": "node config/extract-run-directory-future.js",
49
116
  "profile": "jest profile",
50
117
  "release": "yarn build && yarn test && node -e 'require(\"./config/scf-project-scripts\").releaseProject()'",
51
- "test:itf:all": "node ./node_modules/@mchp-mcc/ccl-itf/lib/index.js --sp=tests/itf --rd=run --df=\"PIC18F57Q43|PIC16F18877|PIC16LF18875|PIC18F16Q40|PIC18F16Q41|PIC18F47Q10\"",
52
- "test:itf:dev": "node ./node_modules/@mchp-mcc/ccl-itf/lib/index.js --sp=tests/itf --rd=run --sf=osc.major.test.ts --df=\"PIC18F57Q43|PIC16F18877|PIC16LF18875|PIC18F16Q40|PIC18F16Q41|PIC18F47Q10\""
118
+ "test:itf:all": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=tests/itf --rd=run --df=\"PIC18F57Q43|PIC16F18877|PIC16LF18875|PIC18F16Q40|PIC18F16Q41|PIC18F47Q10\"",
119
+ "test:itf:dev": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=tests/itf --rd=run --sf=osc.major.test.ts --df=\"PIC18F57Q43\"",
120
+ "postprocess": "node config/appendPrototype.js"
53
121
  },
54
122
  "husky": {
55
123
  "hooks": {
@@ -63,8 +131,7 @@
63
131
  },
64
132
  "files": [
65
133
  "output/**/*",
66
- "config.json",
67
- "src/**/*"
134
+ "config.json"
68
135
  ],
69
136
  "repository": {
70
137
  "type": "git",
@@ -97,12 +164,11 @@
97
164
  "@microchip/basic_pin": "^1.0.2",
98
165
  "@microchip/config-request": "^2.0.2",
99
166
  "@microchip/fosc-hz": "^0.3.0",
100
- "@microchip/scf-automodule-interface": "^0.16.5",
101
- "@microchip/scf-common": "^3.10.0",
102
- "@microchip/scf-device": "^8.2.0",
167
+ "@microchip/scf-common": "^3.17.0",
168
+ "@microchip/scf-device": "^8.5.0",
103
169
  "@microchip/scf-integration-test": "^1.0.0",
104
170
  "@microchip/scf-interface": "^1.4.0",
105
- "@microchip/scf-register-view-helper": "^2.4.0",
171
+ "@microchip/scf-register-view-helper": "^2.5.0",
106
172
  "babel-jest": "^27.0.6"
107
173
  },
108
174
  "devDependencies": {
@@ -112,19 +178,19 @@
112
178
  "@babel/preset-react": "^7.9.4",
113
179
  "@babel/preset-typescript": "^7.9.0",
114
180
  "@mchp-mcc/avr-8bit": "^4.2.6",
115
- "@mchp-mcc/ccl-itf": "^0.2.13",
116
- "@mchp-mcc/pic-8bit": "^5.4.5-dev2",
117
- "@mchp-mcc/pic-8bit-types": "^5.4.1",
181
+ "@mchp-mcc/pic-8bit": "^5.13.0-dev.2",
182
+ "@mchp-mcc/pic-8bit-types": "^5.13.0-dev.2",
183
+ "@microchip/ccl-itf": "^1.5.0",
118
184
  "@microchip/config-device": "^1.1.1",
119
185
  "@microchip/initializer-system": "^0.5.4",
120
186
  "@microchip/interrupt-vectored": "^1.2.0",
187
+ "@microchip/melody-automodule-interface": "^1.6.2",
121
188
  "@microchip/osc-clocks": "^0.2.0",
122
- "@microchip/pic-8bit-types": "^5.0.1",
123
- "@microchip/pin-standard": "^0.2.14",
124
- "@microchip/run-directory": "^2.4.28",
125
- "@microchip/run-directory-future": "^1.1.17",
126
- "@microchip/scf-automodule": "^4.14.5",
127
- "@microchip/scf-autoview": "^3.17.0",
189
+ "@microchip/pin-standard": "^0.4.1",
190
+ "@microchip/run-directory": "^4.2.3",
191
+ "@microchip/scf-automodule": "^5.6.2",
192
+ "@microchip/scf-automodule-impl": "^1.8.2",
193
+ "@microchip/scf-autoview": "^3.26.1",
128
194
  "@microchip/scf-project-scripts": "^1.0.0",
129
195
  "@microchip/scf-server": "^1.5.10",
130
196
  "@types/core-js": "^2.5.1",
@@ -1,117 +0,0 @@
1
- import { ClockCalculator } from "./ClockCalculator";
2
- import { StringConstants } from "./StringConstants";
3
-
4
- describe("Osc Calculations", () => {
5
- // jest cases for system oscillator calculations
6
- it("Test case 1: oscSelect = SOSC, HFInternalClk = 4_MHz, externalClk = 1000000Hz, clkDevider = 1", () => {
7
- expect(
8
- new ClockCalculator("SOSC", "4_MHz", 1000000, 1).getCurrentSystemClk(),
9
- ).toBe(32768);
10
- });
11
-
12
- it("Test case 2: oscSelect = LFINTOSC, HFInternalClk = 4_MHz, externalClk = 1000000Hz, clkDevider = 1", () => {
13
- expect(
14
- new ClockCalculator("LFINTOSC", "4_MHz", 1000000, 1).getCurrentSystemClk(),
15
- ).toBe(31000);
16
- });
17
-
18
- it("Test case 3: oscSelect = HFINTOSC, HFInternalClk = 4_MHz, externalClk = 1000000Hz, clkDevider = 1", () => {
19
- expect(
20
- new ClockCalculator("HFINTOSC", "4_MHz", 1000000, 1).getCurrentSystemClk(),
21
- ).toBe(4000000);
22
- });
23
-
24
- it("Test case 4: oscSelect = EXTOSC, HFInternalClk = 4_MHz, externalClk = 1000000Hz, clkDevider = 1", () => {
25
- expect(
26
- new ClockCalculator("EXTOSC", "4_MHz", 1000000, 1).getCurrentSystemClk(),
27
- ).toBe(1000000);
28
- });
29
-
30
- it("Test case 5: oscSelect = EXTOSC with 4x PLL, HFInternalClk = 4_MHz, externalClk = 1000000Hz, clkDevider = 1", () => {
31
- expect(
32
- new ClockCalculator(
33
- "EXTOSC with 4x PLL",
34
- "4_MHz",
35
- 1000000,
36
- 1,
37
- ).getCurrentSystemClk(),
38
- ).toBe(1000000);
39
- });
40
-
41
- it("Test case 6: oscSelect = EXTOSC with 4x PLL, HFInternalClk = 4_MHz, externalClk = 5000000Hz, clkDevider = 1", () => {
42
- expect(
43
- new ClockCalculator(
44
- "EXTOSC with 4x PLL",
45
- "4_MHz",
46
- 5000000,
47
- 1,
48
- ).getCurrentSystemClk(),
49
- ).toBe(20000000);
50
- });
51
-
52
- it("Test case 7: oscSelect = EXTOSC with 4x PLL, HFInternalClk = 4_MHz, externalClk = 17000000Hz, clkDevider = 1", () => {
53
- expect(
54
- new ClockCalculator(
55
- "EXTOSC with 4x PLL",
56
- "4_MHz",
57
- 17000000,
58
- 1,
59
- ).getCurrentSystemClk(),
60
- ).toBe(17000000);
61
- });
62
-
63
- it("Test case 8: oscSelect = SOSC, HFInternalClk = 4_MHz, externalClk = 17000000Hz, clkDevider = 1", () => {
64
- expect(
65
- new ClockCalculator(
66
- StringConstants.SOSC,
67
- "4_MHz",
68
- 17000000,
69
- 1,
70
- ).getCurrentSystemClk(),
71
- ).toBe(32768);
72
- });
73
-
74
- it("Test case 9: oscSelect = HFINTOSC_2xPLL, HFInternalClk = 4_MHz, externalClk = 17000000Hz, clkDevider = 1", () => {
75
- expect(
76
- new ClockCalculator(
77
- StringConstants.HFINTOSC_2xPLL,
78
- "4_MHz",
79
- 17000000,
80
- 1,
81
- ).getCurrentSystemClk(),
82
- ).toBe(4000000);
83
- });
84
-
85
- it("Test case 10: oscSelect = EXTOSC, HFInternalClk = 4_MHz, externalClk = 170000Hz, clkDevider = 1", () => {
86
- expect(
87
- new ClockCalculator(
88
- StringConstants.EXTOSC,
89
- "4_MHz",
90
- 17000000,
91
- 1,
92
- ).getCurrentSystemClk(),
93
- ).toBe(17000000);
94
- });
95
-
96
- it("Test case 11: oscSelect = EXTOSC, HFInternalClk = 4_MHz, externalClk = 17000000Hz, clkDevider = 1", () => {
97
- expect(
98
- new ClockCalculator(
99
- StringConstants.EXTOSC,
100
- "4_MHz",
101
- 17000000,
102
- 1,
103
- ).getCurrentSystemClk(),
104
- ).toBe(17000000);
105
- });
106
-
107
- it("Test case 12: oscSelect = HFINTOSC_2xPLL, HFInternalClk = 4_MHz, externalClk = 17000000Hz, clkDevider = 1", () => {
108
- expect(
109
- new ClockCalculator(
110
- StringConstants.HFINTOSC_2xPLL,
111
- "8_MHz",
112
- 17000000,
113
- 1,
114
- ).getCurrentSystemClk(),
115
- ).toBe(16000000);
116
- });
117
- });
@@ -1,81 +0,0 @@
1
- import { StringConstants } from "./StringConstants";
2
-
3
- export class ClockCalculator {
4
- private lfintosc = "31000";
5
- private mfintosc = "500000";
6
- private mfintosc_31KHz = "31250";
7
- private sosc = "32768";
8
- private oscSelect: string;
9
- private HFInternalClk: string;
10
- private externalClk: number;
11
- private clkDivider: number;
12
-
13
- MAX_PLL = 16000000; // in Hz
14
- MIN_PLL = 3000000; // in Hz
15
-
16
- public constructor(
17
- oscSelect: string,
18
- HFInternalClk: string,
19
- externalClk: number,
20
- clkDivider: number,
21
- ) {
22
- this.oscSelect = oscSelect;
23
- this.HFInternalClk = HFInternalClk;
24
- this.externalClk = externalClk;
25
- this.clkDivider = clkDivider;
26
- }
27
-
28
- public getCurrentSystemClk = (): number => {
29
- let currentSystemClk: number;
30
- let HFClk: number;
31
-
32
- if (this.oscSelect === StringConstants.SOSC) {
33
- currentSystemClk = 32768 / this.clkDivider;
34
- } else if (this.oscSelect === StringConstants.LFINTOSC) {
35
- currentSystemClk = 31000 / this.clkDivider;
36
- } else if (this.oscSelect === StringConstants.HFINTOSC) {
37
- HFClk = parseInt(this.HFInternalClk?.replace("_MHz", "") ?? "1000000");
38
- currentSystemClk = (HFClk * 1000000) / this.clkDivider;
39
- } else if (this.oscSelect === StringConstants.HFINTOSC_2xPLL) {
40
- HFClk = parseInt(this.HFInternalClk?.replace("_MHz", "") ?? "1000000");
41
- if (HFClk == 8 || HFClk == 12 || HFClk == 16) {
42
- currentSystemClk = (HFClk * 2 * 1000000) / this.clkDivider;
43
- } else {
44
- currentSystemClk = (HFClk * 1000000) / this.clkDivider;
45
- }
46
- } else if (this.oscSelect === StringConstants.EXTOSC) {
47
- currentSystemClk = this.externalClk / this.clkDivider;
48
- } else {
49
- if (this.externalClk <= this.MIN_PLL || this.externalClk > this.MAX_PLL) {
50
- currentSystemClk = this.externalClk / this.clkDivider;
51
- } else {
52
- currentSystemClk = (this.externalClk * 4) / this.clkDivider;
53
- }
54
- }
55
- return Math.round(currentSystemClk);
56
- };
57
-
58
- public getHfIntOsc = (): string => {
59
- return this.HFInternalClk?.replace("_MHz", "000000") ?? "1000000";
60
- };
61
-
62
- public getMfIntOsc = (): string => {
63
- return this.mfintosc;
64
- };
65
-
66
- public getMfIntOsc_31KHz = (): string => {
67
- return this.mfintosc_31KHz;
68
- };
69
-
70
- public getLfIntOsc = (): string => {
71
- return this.lfintosc;
72
- };
73
-
74
- public getExtOsc = (): string => {
75
- return this.externalClk.toString();
76
- };
77
-
78
- public getSosc = (): string => {
79
- return this.sosc;
80
- };
81
- }
@@ -1,12 +0,0 @@
1
- import { CreatorFunctions } from "@microchip/scf-automodule-interface";
2
- import { MyState } from "../generated_module/src/types/AutoModuleTypes";
3
-
4
- export const getCreatorFunctions = (): CreatorFunctions => {
5
- return {
6
- shouldImport: shouldImport,
7
- };
8
- };
9
-
10
- const shouldImport = (importKey: string, state: MyState): boolean => {
11
- return true;
12
- };