rp2040js 0.17.17 → 0.18.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/dist/cjs/clock/clock.d.ts +11 -11
- package/dist/cjs/clock/clock.js +2 -2
- package/dist/cjs/clock/mock-clock.d.ts +17 -17
- package/dist/cjs/clock/mock-clock.js +52 -52
- package/dist/cjs/clock/realtime-clock.d.ts +23 -23
- package/dist/cjs/clock/realtime-clock.js +73 -73
- package/dist/cjs/cortex-m0-core.d.ts +87 -87
- package/dist/cjs/cortex-m0-core.js +1251 -1251
- package/dist/cjs/gdb/gdb-connection.d.ts +11 -11
- package/dist/cjs/gdb/gdb-connection.js +57 -57
- package/dist/cjs/gdb/gdb-server.d.ts +23 -23
- package/dist/cjs/gdb/gdb-server.js +232 -232
- package/dist/cjs/gdb/gdb-tcp-server.d.ts +10 -10
- package/dist/cjs/gdb/gdb-tcp-server.js +34 -34
- package/dist/cjs/gdb/gdb-utils.d.ts +9 -9
- package/dist/cjs/gdb/gdb-utils.js +48 -48
- package/dist/cjs/gpio-pin.d.ts +56 -56
- package/dist/cjs/gpio-pin.js +216 -216
- package/dist/cjs/index.d.ts +11 -11
- package/dist/cjs/index.js +36 -36
- package/dist/cjs/interpolator.d.ts +36 -36
- package/dist/cjs/interpolator.js +150 -150
- package/dist/cjs/irq.d.ts +29 -29
- package/dist/cjs/irq.js +33 -33
- package/dist/cjs/peripherals/adc.d.ts +52 -52
- package/dist/cjs/peripherals/adc.js +261 -261
- package/dist/cjs/peripherals/busctrl.d.ts +10 -10
- package/dist/cjs/peripherals/busctrl.js +84 -84
- package/dist/cjs/peripherals/clocks.d.ts +9 -9
- package/dist/cjs/peripherals/clocks.js +42 -42
- package/dist/cjs/peripherals/dma.d.ts +109 -109
- package/dist/cjs/peripherals/dma.js +520 -520
- package/dist/cjs/peripherals/i2c.d.ts +54 -54
- package/dist/cjs/peripherals/i2c.js +458 -458
- package/dist/cjs/peripherals/io.d.ts +11 -11
- package/dist/cjs/peripherals/io.js +100 -100
- package/dist/cjs/peripherals/pads.d.ts +13 -13
- package/dist/cjs/peripherals/pads.js +58 -58
- package/dist/cjs/peripherals/peripheral.d.ts +22 -22
- package/dist/cjs/peripherals/peripheral.js +61 -61
- package/dist/cjs/peripherals/pio.d.ts +120 -120
- package/dist/cjs/peripherals/pio.js +1086 -1086
- package/dist/cjs/peripherals/ppb.d.ts +25 -25
- package/dist/cjs/peripherals/ppb.js +229 -229
- package/dist/cjs/peripherals/pwm.d.ts +65 -65
- package/dist/cjs/peripherals/pwm.js +372 -372
- package/dist/cjs/peripherals/reset.d.ts +8 -8
- package/dist/cjs/peripherals/reset.js +40 -40
- package/dist/cjs/peripherals/rtc.d.ts +10 -10
- package/dist/cjs/peripherals/rtc.js +74 -74
- package/dist/cjs/peripherals/spi.d.ts +38 -38
- package/dist/cjs/peripherals/spi.js +240 -240
- package/dist/cjs/peripherals/ssi.d.ts +6 -6
- package/dist/cjs/peripherals/ssi.js +43 -43
- package/dist/cjs/peripherals/syscfg.d.ts +5 -5
- package/dist/cjs/peripherals/syscfg.js +26 -26
- package/dist/cjs/peripherals/sysinfo.d.ts +4 -4
- package/dist/cjs/peripherals/sysinfo.js +22 -22
- package/dist/cjs/peripherals/tbman.d.ts +4 -4
- package/dist/cjs/peripherals/tbman.js +17 -17
- package/dist/cjs/peripherals/timer.d.ts +18 -18
- package/dist/cjs/peripherals/timer.js +156 -156
- package/dist/cjs/peripherals/uart.d.ts +31 -31
- package/dist/cjs/peripherals/uart.js +132 -132
- package/dist/cjs/peripherals/usb.d.ts +29 -29
- package/dist/cjs/peripherals/usb.js +309 -309
- package/dist/cjs/rp2040.d.ts +71 -71
- package/dist/cjs/rp2040.js +361 -361
- package/dist/cjs/sio.d.ts +21 -21
- package/dist/cjs/sio.js +425 -425
- package/dist/cjs/usb/cdc.d.ts +20 -20
- package/dist/cjs/usb/cdc.js +126 -126
- package/dist/cjs/usb/interfaces.d.ts +47 -47
- package/dist/cjs/usb/interfaces.js +46 -46
- package/dist/cjs/usb/setup.d.ts +5 -5
- package/dist/cjs/usb/setup.js +53 -53
- package/dist/cjs/utils/assembler.d.ts +79 -79
- package/dist/cjs/utils/assembler.js +328 -328
- package/dist/cjs/utils/bit.d.ts +3 -3
- package/dist/cjs/utils/bit.js +15 -15
- package/dist/cjs/utils/fifo.d.ts +15 -15
- package/dist/cjs/utils/fifo.js +56 -56
- package/dist/cjs/utils/logging.d.ts +23 -23
- package/dist/cjs/utils/logging.js +48 -48
- package/dist/cjs/utils/pio-assembler.d.ts +45 -45
- package/dist/cjs/utils/pio-assembler.js +87 -87
- package/dist/cjs/utils/time.d.ts +2 -2
- package/dist/cjs/utils/time.js +32 -32
- package/dist/cjs/utils/timer32.d.ts +57 -57
- package/dist/cjs/utils/timer32.js +208 -208
- package/dist/esm/clock/clock.d.ts +11 -11
- package/dist/esm/clock/clock.js +1 -1
- package/dist/esm/clock/mock-clock.d.ts +17 -17
- package/dist/esm/clock/mock-clock.js +47 -47
- package/dist/esm/clock/realtime-clock.d.ts +23 -23
- package/dist/esm/clock/realtime-clock.js +68 -68
- package/dist/esm/cortex-m0-core.d.ts +87 -87
- package/dist/esm/cortex-m0-core.js +1247 -1247
- package/dist/esm/gdb/gdb-connection.d.ts +11 -11
- package/dist/esm/gdb/gdb-connection.js +53 -53
- package/dist/esm/gdb/gdb-server.d.ts +23 -23
- package/dist/esm/gdb/gdb-server.js +228 -228
- package/dist/esm/gdb/gdb-tcp-server.d.ts +10 -10
- package/dist/esm/gdb/gdb-tcp-server.js +30 -30
- package/dist/esm/gdb/gdb-utils.d.ts +9 -9
- package/dist/esm/gdb/gdb-utils.js +36 -36
- package/dist/esm/gpio-pin.d.ts +56 -56
- package/dist/esm/gpio-pin.js +212 -212
- package/dist/esm/index.d.ts +11 -11
- package/dist/esm/index.js +11 -11
- package/dist/esm/interpolator.d.ts +36 -36
- package/dist/esm/interpolator.js +145 -145
- package/dist/esm/irq.d.ts +29 -29
- package/dist/esm/irq.js +30 -30
- package/dist/esm/peripherals/adc.d.ts +52 -52
- package/dist/esm/peripherals/adc.js +257 -257
- package/dist/esm/peripherals/busctrl.d.ts +10 -10
- package/dist/esm/peripherals/busctrl.js +80 -80
- package/dist/esm/peripherals/clocks.d.ts +9 -9
- package/dist/esm/peripherals/clocks.js +38 -38
- package/dist/esm/peripherals/dma.d.ts +109 -109
- package/dist/esm/peripherals/dma.js +515 -515
- package/dist/esm/peripherals/i2c.d.ts +54 -54
- package/dist/esm/peripherals/i2c.js +454 -454
- package/dist/esm/peripherals/io.d.ts +11 -11
- package/dist/esm/peripherals/io.js +96 -96
- package/dist/esm/peripherals/pads.d.ts +13 -13
- package/dist/esm/peripherals/pads.js +54 -54
- package/dist/esm/peripherals/peripheral.d.ts +22 -22
- package/dist/esm/peripherals/peripheral.js +55 -55
- package/dist/esm/peripherals/pio.d.ts +120 -120
- package/dist/esm/peripherals/pio.js +1081 -1081
- package/dist/esm/peripherals/ppb.d.ts +25 -25
- package/dist/esm/peripherals/ppb.js +225 -225
- package/dist/esm/peripherals/pwm.d.ts +65 -65
- package/dist/esm/peripherals/pwm.js +368 -368
- package/dist/esm/peripherals/reset.d.ts +8 -8
- package/dist/esm/peripherals/reset.js +36 -36
- package/dist/esm/peripherals/rtc.d.ts +10 -10
- package/dist/esm/peripherals/rtc.js +70 -70
- package/dist/esm/peripherals/spi.d.ts +38 -38
- package/dist/esm/peripherals/spi.js +236 -236
- package/dist/esm/peripherals/ssi.d.ts +6 -6
- package/dist/esm/peripherals/ssi.js +39 -39
- package/dist/esm/peripherals/syscfg.d.ts +5 -5
- package/dist/esm/peripherals/syscfg.js +22 -22
- package/dist/esm/peripherals/sysinfo.d.ts +4 -4
- package/dist/esm/peripherals/sysinfo.js +18 -18
- package/dist/esm/peripherals/tbman.d.ts +4 -4
- package/dist/esm/peripherals/tbman.js +13 -13
- package/dist/esm/peripherals/timer.d.ts +18 -18
- package/dist/esm/peripherals/timer.js +152 -152
- package/dist/esm/peripherals/uart.d.ts +31 -31
- package/dist/esm/peripherals/uart.js +128 -128
- package/dist/esm/peripherals/usb.d.ts +29 -29
- package/dist/esm/peripherals/usb.js +305 -305
- package/dist/esm/rp2040.d.ts +71 -71
- package/dist/esm/rp2040.js +357 -357
- package/dist/esm/sio.d.ts +21 -21
- package/dist/esm/sio.js +421 -421
- package/dist/esm/usb/cdc.d.ts +20 -20
- package/dist/esm/usb/cdc.js +121 -121
- package/dist/esm/usb/interfaces.d.ts +47 -47
- package/dist/esm/usb/interfaces.js +43 -43
- package/dist/esm/usb/setup.d.ts +5 -5
- package/dist/esm/usb/setup.js +46 -46
- package/dist/esm/utils/assembler.d.ts +79 -79
- package/dist/esm/utils/assembler.js +245 -245
- package/dist/esm/utils/bit.d.ts +3 -3
- package/dist/esm/utils/bit.js +9 -9
- package/dist/esm/utils/fifo.d.ts +15 -15
- package/dist/esm/utils/fifo.js +52 -52
- package/dist/esm/utils/logging.d.ts +23 -23
- package/dist/esm/utils/logging.js +44 -44
- package/dist/esm/utils/pio-assembler.d.ts +45 -45
- package/dist/esm/utils/pio-assembler.js +75 -75
- package/dist/esm/utils/time.d.ts +2 -2
- package/dist/esm/utils/time.js +27 -27
- package/dist/esm/utils/timer32.d.ts +57 -57
- package/dist/esm/utils/timer32.js +203 -203
- package/package.json +33 -22
- package/dist/esm/package.json +0 -1
package/dist/cjs/utils/bit.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function bit(n: number): number;
|
|
2
|
-
export declare function s32(n: number): number;
|
|
3
|
-
export declare function u32(n: number): number;
|
|
1
|
+
export declare function bit(n: number): number;
|
|
2
|
+
export declare function s32(n: number): number;
|
|
3
|
+
export declare function u32(n: number): number;
|
package/dist/cjs/utils/bit.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.u32 = exports.s32 = exports.bit = void 0;
|
|
4
|
-
function bit(n) {
|
|
5
|
-
return 1 << n;
|
|
6
|
-
}
|
|
7
|
-
exports.bit = bit;
|
|
8
|
-
function s32(n) {
|
|
9
|
-
return n | 0;
|
|
10
|
-
}
|
|
11
|
-
exports.s32 = s32;
|
|
12
|
-
function u32(n) {
|
|
13
|
-
return n >>> 0;
|
|
14
|
-
}
|
|
15
|
-
exports.u32 = u32;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.u32 = exports.s32 = exports.bit = void 0;
|
|
4
|
+
function bit(n) {
|
|
5
|
+
return 1 << n;
|
|
6
|
+
}
|
|
7
|
+
exports.bit = bit;
|
|
8
|
+
function s32(n) {
|
|
9
|
+
return n | 0;
|
|
10
|
+
}
|
|
11
|
+
exports.s32 = s32;
|
|
12
|
+
function u32(n) {
|
|
13
|
+
return n >>> 0;
|
|
14
|
+
}
|
|
15
|
+
exports.u32 = u32;
|
package/dist/cjs/utils/fifo.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export declare class FIFO {
|
|
2
|
-
readonly buffer: Uint32Array;
|
|
3
|
-
private start;
|
|
4
|
-
private used;
|
|
5
|
-
constructor(size: number);
|
|
6
|
-
get size(): number;
|
|
7
|
-
get itemCount(): number;
|
|
8
|
-
push(value: number): void;
|
|
9
|
-
pull(): number;
|
|
10
|
-
peek(): number;
|
|
11
|
-
reset(): void;
|
|
12
|
-
get empty(): boolean;
|
|
13
|
-
get full(): boolean;
|
|
14
|
-
get items(): number[];
|
|
15
|
-
}
|
|
1
|
+
export declare class FIFO {
|
|
2
|
+
readonly buffer: Uint32Array;
|
|
3
|
+
private start;
|
|
4
|
+
private used;
|
|
5
|
+
constructor(size: number);
|
|
6
|
+
get size(): number;
|
|
7
|
+
get itemCount(): number;
|
|
8
|
+
push(value: number): void;
|
|
9
|
+
pull(): number;
|
|
10
|
+
peek(): number;
|
|
11
|
+
reset(): void;
|
|
12
|
+
get empty(): boolean;
|
|
13
|
+
get full(): boolean;
|
|
14
|
+
get items(): number[];
|
|
15
|
+
}
|
package/dist/cjs/utils/fifo.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FIFO = void 0;
|
|
4
|
-
class FIFO {
|
|
5
|
-
constructor(size) {
|
|
6
|
-
this.start = 0;
|
|
7
|
-
this.used = 0;
|
|
8
|
-
this.buffer = new Uint32Array(size);
|
|
9
|
-
}
|
|
10
|
-
get size() {
|
|
11
|
-
return this.buffer.length;
|
|
12
|
-
}
|
|
13
|
-
get itemCount() {
|
|
14
|
-
return this.used;
|
|
15
|
-
}
|
|
16
|
-
push(value) {
|
|
17
|
-
const { length } = this.buffer;
|
|
18
|
-
const { start, used } = this;
|
|
19
|
-
if (this.used < length) {
|
|
20
|
-
this.buffer[(start + used) % length] = value;
|
|
21
|
-
this.used++;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
pull() {
|
|
25
|
-
const { start, used } = this;
|
|
26
|
-
const { length } = this.buffer;
|
|
27
|
-
if (used) {
|
|
28
|
-
this.start = (start + 1) % length;
|
|
29
|
-
this.used--;
|
|
30
|
-
return this.buffer[start];
|
|
31
|
-
}
|
|
32
|
-
return 0;
|
|
33
|
-
}
|
|
34
|
-
peek() {
|
|
35
|
-
return this.used ? this.buffer[this.start] : 0;
|
|
36
|
-
}
|
|
37
|
-
reset() {
|
|
38
|
-
this.used = 0;
|
|
39
|
-
}
|
|
40
|
-
get empty() {
|
|
41
|
-
return this.used == 0;
|
|
42
|
-
}
|
|
43
|
-
get full() {
|
|
44
|
-
return this.used === this.buffer.length;
|
|
45
|
-
}
|
|
46
|
-
get items() {
|
|
47
|
-
const { start, used, buffer } = this;
|
|
48
|
-
const { length } = buffer;
|
|
49
|
-
const result = [];
|
|
50
|
-
for (let i = 0; i < used; i++) {
|
|
51
|
-
result[i] = buffer[(start + i) % length];
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.FIFO = FIFO;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FIFO = void 0;
|
|
4
|
+
class FIFO {
|
|
5
|
+
constructor(size) {
|
|
6
|
+
this.start = 0;
|
|
7
|
+
this.used = 0;
|
|
8
|
+
this.buffer = new Uint32Array(size);
|
|
9
|
+
}
|
|
10
|
+
get size() {
|
|
11
|
+
return this.buffer.length;
|
|
12
|
+
}
|
|
13
|
+
get itemCount() {
|
|
14
|
+
return this.used;
|
|
15
|
+
}
|
|
16
|
+
push(value) {
|
|
17
|
+
const { length } = this.buffer;
|
|
18
|
+
const { start, used } = this;
|
|
19
|
+
if (this.used < length) {
|
|
20
|
+
this.buffer[(start + used) % length] = value;
|
|
21
|
+
this.used++;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
pull() {
|
|
25
|
+
const { start, used } = this;
|
|
26
|
+
const { length } = this.buffer;
|
|
27
|
+
if (used) {
|
|
28
|
+
this.start = (start + 1) % length;
|
|
29
|
+
this.used--;
|
|
30
|
+
return this.buffer[start];
|
|
31
|
+
}
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
peek() {
|
|
35
|
+
return this.used ? this.buffer[this.start] : 0;
|
|
36
|
+
}
|
|
37
|
+
reset() {
|
|
38
|
+
this.used = 0;
|
|
39
|
+
}
|
|
40
|
+
get empty() {
|
|
41
|
+
return this.used == 0;
|
|
42
|
+
}
|
|
43
|
+
get full() {
|
|
44
|
+
return this.used === this.buffer.length;
|
|
45
|
+
}
|
|
46
|
+
get items() {
|
|
47
|
+
const { start, used, buffer } = this;
|
|
48
|
+
const { length } = buffer;
|
|
49
|
+
const result = [];
|
|
50
|
+
for (let i = 0; i < used; i++) {
|
|
51
|
+
result[i] = buffer[(start + i) % length];
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.FIFO = FIFO;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export interface Logger {
|
|
2
|
-
debug(componentName: string, message: string): void;
|
|
3
|
-
warn(componentName: string, message: string): void;
|
|
4
|
-
error(componentName: string, message: string): void;
|
|
5
|
-
info(componentName: string, message: string): void;
|
|
6
|
-
}
|
|
7
|
-
export declare enum LogLevel {
|
|
8
|
-
Debug = 0,
|
|
9
|
-
Info = 1,
|
|
10
|
-
Warn = 2,
|
|
11
|
-
Error = 3
|
|
12
|
-
}
|
|
13
|
-
export declare class ConsoleLogger implements Logger {
|
|
14
|
-
currentLogLevel: LogLevel;
|
|
15
|
-
private throwOnError;
|
|
16
|
-
constructor(currentLogLevel: LogLevel, throwOnError?: boolean);
|
|
17
|
-
private aboveLogLevel;
|
|
18
|
-
private formatMessage;
|
|
19
|
-
debug(componetName: string, message: string): void;
|
|
20
|
-
warn(componetName: string, message: string): void;
|
|
21
|
-
error(componentName: string, message: string): void;
|
|
22
|
-
info(componentName: string, message: string): void;
|
|
23
|
-
}
|
|
1
|
+
export interface Logger {
|
|
2
|
+
debug(componentName: string, message: string): void;
|
|
3
|
+
warn(componentName: string, message: string): void;
|
|
4
|
+
error(componentName: string, message: string): void;
|
|
5
|
+
info(componentName: string, message: string): void;
|
|
6
|
+
}
|
|
7
|
+
export declare enum LogLevel {
|
|
8
|
+
Debug = 0,
|
|
9
|
+
Info = 1,
|
|
10
|
+
Warn = 2,
|
|
11
|
+
Error = 3
|
|
12
|
+
}
|
|
13
|
+
export declare class ConsoleLogger implements Logger {
|
|
14
|
+
currentLogLevel: LogLevel;
|
|
15
|
+
private throwOnError;
|
|
16
|
+
constructor(currentLogLevel: LogLevel, throwOnError?: boolean);
|
|
17
|
+
private aboveLogLevel;
|
|
18
|
+
private formatMessage;
|
|
19
|
+
debug(componetName: string, message: string): void;
|
|
20
|
+
warn(componetName: string, message: string): void;
|
|
21
|
+
error(componentName: string, message: string): void;
|
|
22
|
+
info(componentName: string, message: string): void;
|
|
23
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConsoleLogger = exports.LogLevel = void 0;
|
|
4
|
-
const
|
|
5
|
-
var LogLevel;
|
|
6
|
-
(function (LogLevel) {
|
|
7
|
-
LogLevel[LogLevel["Debug"] = 0] = "Debug";
|
|
8
|
-
LogLevel[LogLevel["Info"] = 1] = "Info";
|
|
9
|
-
LogLevel[LogLevel["Warn"] = 2] = "Warn";
|
|
10
|
-
LogLevel[LogLevel["Error"] = 3] = "Error";
|
|
11
|
-
})(LogLevel
|
|
12
|
-
class ConsoleLogger {
|
|
13
|
-
constructor(currentLogLevel, throwOnError = true) {
|
|
14
|
-
this.currentLogLevel = currentLogLevel;
|
|
15
|
-
this.throwOnError = throwOnError;
|
|
16
|
-
}
|
|
17
|
-
aboveLogLevel(logLevel) {
|
|
18
|
-
return logLevel >= this.currentLogLevel ? true : false;
|
|
19
|
-
}
|
|
20
|
-
formatMessage(componentName, message) {
|
|
21
|
-
const currentTime =
|
|
22
|
-
return `${currentTime} [${componentName}] ${message}`;
|
|
23
|
-
}
|
|
24
|
-
debug(componetName, message) {
|
|
25
|
-
if (this.aboveLogLevel(LogLevel.Debug)) {
|
|
26
|
-
console.debug(this.formatMessage(componetName, message));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
warn(componetName, message) {
|
|
30
|
-
if (this.aboveLogLevel(LogLevel.Warn)) {
|
|
31
|
-
console.warn(this.formatMessage(componetName, message));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
error(componentName, message) {
|
|
35
|
-
if (this.aboveLogLevel(LogLevel.Error)) {
|
|
36
|
-
console.error(this.formatMessage(componentName, message));
|
|
37
|
-
if (this.throwOnError) {
|
|
38
|
-
throw new Error(`[${componentName}] ${message}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
info(componentName, message) {
|
|
43
|
-
if (this.aboveLogLevel(LogLevel.Info)) {
|
|
44
|
-
console.info(this.formatMessage(componentName, message));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.ConsoleLogger = ConsoleLogger;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConsoleLogger = exports.LogLevel = void 0;
|
|
4
|
+
const time_js_1 = require("./time.js");
|
|
5
|
+
var LogLevel;
|
|
6
|
+
(function (LogLevel) {
|
|
7
|
+
LogLevel[LogLevel["Debug"] = 0] = "Debug";
|
|
8
|
+
LogLevel[LogLevel["Info"] = 1] = "Info";
|
|
9
|
+
LogLevel[LogLevel["Warn"] = 2] = "Warn";
|
|
10
|
+
LogLevel[LogLevel["Error"] = 3] = "Error";
|
|
11
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
12
|
+
class ConsoleLogger {
|
|
13
|
+
constructor(currentLogLevel, throwOnError = true) {
|
|
14
|
+
this.currentLogLevel = currentLogLevel;
|
|
15
|
+
this.throwOnError = throwOnError;
|
|
16
|
+
}
|
|
17
|
+
aboveLogLevel(logLevel) {
|
|
18
|
+
return logLevel >= this.currentLogLevel ? true : false;
|
|
19
|
+
}
|
|
20
|
+
formatMessage(componentName, message) {
|
|
21
|
+
const currentTime = (0, time_js_1.formatTime)(new Date());
|
|
22
|
+
return `${currentTime} [${componentName}] ${message}`;
|
|
23
|
+
}
|
|
24
|
+
debug(componetName, message) {
|
|
25
|
+
if (this.aboveLogLevel(LogLevel.Debug)) {
|
|
26
|
+
console.debug(this.formatMessage(componetName, message));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
warn(componetName, message) {
|
|
30
|
+
if (this.aboveLogLevel(LogLevel.Warn)) {
|
|
31
|
+
console.warn(this.formatMessage(componetName, message));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
error(componentName, message) {
|
|
35
|
+
if (this.aboveLogLevel(LogLevel.Error)) {
|
|
36
|
+
console.error(this.formatMessage(componentName, message));
|
|
37
|
+
if (this.throwOnError) {
|
|
38
|
+
throw new Error(`[${componentName}] ${message}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
info(componentName, message) {
|
|
43
|
+
if (this.aboveLogLevel(LogLevel.Info)) {
|
|
44
|
+
console.info(this.formatMessage(componentName, message));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.ConsoleLogger = ConsoleLogger;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export declare const PIO_SRC_PINS = 0;
|
|
2
|
-
export declare const PIO_SRC_X = 1;
|
|
3
|
-
export declare const PIO_SRC_Y = 2;
|
|
4
|
-
export declare const PIO_SRC_NULL = 3;
|
|
5
|
-
export declare const PIO_SRC_STATUS = 5;
|
|
6
|
-
export declare const PIO_SRC_ISR = 6;
|
|
7
|
-
export declare const PIO_SRC_OSR = 7;
|
|
8
|
-
export declare const PIO_DEST_PINS = 0;
|
|
9
|
-
export declare const PIO_DEST_X = 1;
|
|
10
|
-
export declare const PIO_DEST_Y = 2;
|
|
11
|
-
export declare const PIO_DEST_NULL = 3;
|
|
12
|
-
export declare const PIO_DEST_PINDIRS = 4;
|
|
13
|
-
export declare const PIO_DEST_PC = 5;
|
|
14
|
-
export declare const PIO_DEST_ISR = 6;
|
|
15
|
-
export declare const PIO_DEST_EXEC = 7;
|
|
16
|
-
export declare const PIO_MOV_DEST_PINS = 0;
|
|
17
|
-
export declare const PIO_MOV_DEST_X = 1;
|
|
18
|
-
export declare const PIO_MOV_DEST_Y = 2;
|
|
19
|
-
export declare const PIO_MOV_DEST_EXEC = 4;
|
|
20
|
-
export declare const PIO_MOV_DEST_PC = 5;
|
|
21
|
-
export declare const PIO_MOV_DEST_ISR = 6;
|
|
22
|
-
export declare const PIO_MOV_DEST_OSR = 7;
|
|
23
|
-
export declare const PIO_OP_NONE = 0;
|
|
24
|
-
export declare const PIO_OP_INVERT = 1;
|
|
25
|
-
export declare const PIO_OP_BITREV = 2;
|
|
26
|
-
export declare const PIO_WAIT_SRC_GPIO = 0;
|
|
27
|
-
export declare const PIO_WAIT_SRC_PIN = 1;
|
|
28
|
-
export declare const PIO_WAIT_SRC_IRQ = 2;
|
|
29
|
-
export declare const PIO_COND_ALWAYS = 0;
|
|
30
|
-
export declare const PIO_COND_NOTX = 1;
|
|
31
|
-
export declare const PIO_COND_XDEC = 2;
|
|
32
|
-
export declare const PIO_COND_NOTY = 3;
|
|
33
|
-
export declare const PIO_COND_YDEC = 4;
|
|
34
|
-
export declare const PIO_COND_XNEY = 5;
|
|
35
|
-
export declare const PIO_COND_PIN = 6;
|
|
36
|
-
export declare const PIO_COND_NOTEMPTYOSR = 7;
|
|
37
|
-
export declare function pioJMP(cond: number | undefined, address: number, delay?: number): number;
|
|
38
|
-
export declare function pioWAIT(polarity: boolean, src: number, index: number, delay?: number): number;
|
|
39
|
-
export declare function pioIN(src: number, bitCount: number, delay?: number): number;
|
|
40
|
-
export declare function pioOUT(Dest: number, bitCount: number, delay?: number): number;
|
|
41
|
-
export declare function pioPUSH(ifFull: boolean, noBlock: boolean, delay?: number): number;
|
|
42
|
-
export declare function pioPULL(ifEmpty: boolean, noBlock: boolean, delay?: number): number;
|
|
43
|
-
export declare function pioMOV(dest: number, op: number | undefined, src: number, delay?: number): number;
|
|
44
|
-
export declare function pioIRQ(clear: boolean, wait: boolean, index: number, delay?: number): number;
|
|
45
|
-
export declare function pioSET(dest: number, data: number, delay?: number): number;
|
|
1
|
+
export declare const PIO_SRC_PINS = 0;
|
|
2
|
+
export declare const PIO_SRC_X = 1;
|
|
3
|
+
export declare const PIO_SRC_Y = 2;
|
|
4
|
+
export declare const PIO_SRC_NULL = 3;
|
|
5
|
+
export declare const PIO_SRC_STATUS = 5;
|
|
6
|
+
export declare const PIO_SRC_ISR = 6;
|
|
7
|
+
export declare const PIO_SRC_OSR = 7;
|
|
8
|
+
export declare const PIO_DEST_PINS = 0;
|
|
9
|
+
export declare const PIO_DEST_X = 1;
|
|
10
|
+
export declare const PIO_DEST_Y = 2;
|
|
11
|
+
export declare const PIO_DEST_NULL = 3;
|
|
12
|
+
export declare const PIO_DEST_PINDIRS = 4;
|
|
13
|
+
export declare const PIO_DEST_PC = 5;
|
|
14
|
+
export declare const PIO_DEST_ISR = 6;
|
|
15
|
+
export declare const PIO_DEST_EXEC = 7;
|
|
16
|
+
export declare const PIO_MOV_DEST_PINS = 0;
|
|
17
|
+
export declare const PIO_MOV_DEST_X = 1;
|
|
18
|
+
export declare const PIO_MOV_DEST_Y = 2;
|
|
19
|
+
export declare const PIO_MOV_DEST_EXEC = 4;
|
|
20
|
+
export declare const PIO_MOV_DEST_PC = 5;
|
|
21
|
+
export declare const PIO_MOV_DEST_ISR = 6;
|
|
22
|
+
export declare const PIO_MOV_DEST_OSR = 7;
|
|
23
|
+
export declare const PIO_OP_NONE = 0;
|
|
24
|
+
export declare const PIO_OP_INVERT = 1;
|
|
25
|
+
export declare const PIO_OP_BITREV = 2;
|
|
26
|
+
export declare const PIO_WAIT_SRC_GPIO = 0;
|
|
27
|
+
export declare const PIO_WAIT_SRC_PIN = 1;
|
|
28
|
+
export declare const PIO_WAIT_SRC_IRQ = 2;
|
|
29
|
+
export declare const PIO_COND_ALWAYS = 0;
|
|
30
|
+
export declare const PIO_COND_NOTX = 1;
|
|
31
|
+
export declare const PIO_COND_XDEC = 2;
|
|
32
|
+
export declare const PIO_COND_NOTY = 3;
|
|
33
|
+
export declare const PIO_COND_YDEC = 4;
|
|
34
|
+
export declare const PIO_COND_XNEY = 5;
|
|
35
|
+
export declare const PIO_COND_PIN = 6;
|
|
36
|
+
export declare const PIO_COND_NOTEMPTYOSR = 7;
|
|
37
|
+
export declare function pioJMP(cond: number | undefined, address: number, delay?: number): number;
|
|
38
|
+
export declare function pioWAIT(polarity: boolean, src: number, index: number, delay?: number): number;
|
|
39
|
+
export declare function pioIN(src: number, bitCount: number, delay?: number): number;
|
|
40
|
+
export declare function pioOUT(Dest: number, bitCount: number, delay?: number): number;
|
|
41
|
+
export declare function pioPUSH(ifFull: boolean, noBlock: boolean, delay?: number): number;
|
|
42
|
+
export declare function pioPULL(ifEmpty: boolean, noBlock: boolean, delay?: number): number;
|
|
43
|
+
export declare function pioMOV(dest: number, op: number | undefined, src: number, delay?: number): number;
|
|
44
|
+
export declare function pioIRQ(clear: boolean, wait: boolean, index: number, delay?: number): number;
|
|
45
|
+
export declare function pioSET(dest: number, data: number, delay?: number): number;
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pioSET = exports.pioIRQ = exports.pioMOV = exports.pioPULL = exports.pioPUSH = exports.pioOUT = exports.pioIN = exports.pioWAIT = exports.pioJMP = exports.PIO_COND_NOTEMPTYOSR = exports.PIO_COND_PIN = exports.PIO_COND_XNEY = exports.PIO_COND_YDEC = exports.PIO_COND_NOTY = exports.PIO_COND_XDEC = exports.PIO_COND_NOTX = exports.PIO_COND_ALWAYS = exports.PIO_WAIT_SRC_IRQ = exports.PIO_WAIT_SRC_PIN = exports.PIO_WAIT_SRC_GPIO = exports.PIO_OP_BITREV = exports.PIO_OP_INVERT = exports.PIO_OP_NONE = exports.PIO_MOV_DEST_OSR = exports.PIO_MOV_DEST_ISR = exports.PIO_MOV_DEST_PC = exports.PIO_MOV_DEST_EXEC = exports.PIO_MOV_DEST_Y = exports.PIO_MOV_DEST_X = exports.PIO_MOV_DEST_PINS = exports.PIO_DEST_EXEC = exports.PIO_DEST_ISR = exports.PIO_DEST_PC = exports.PIO_DEST_PINDIRS = exports.PIO_DEST_NULL = exports.PIO_DEST_Y = exports.PIO_DEST_X = exports.PIO_DEST_PINS = exports.PIO_SRC_OSR = exports.PIO_SRC_ISR = exports.PIO_SRC_STATUS = exports.PIO_SRC_NULL = exports.PIO_SRC_Y = exports.PIO_SRC_X = exports.PIO_SRC_PINS = void 0;
|
|
4
|
-
exports.PIO_SRC_PINS = 0;
|
|
5
|
-
exports.PIO_SRC_X = 1;
|
|
6
|
-
exports.PIO_SRC_Y = 2;
|
|
7
|
-
exports.PIO_SRC_NULL = 3;
|
|
8
|
-
exports.PIO_SRC_STATUS = 5;
|
|
9
|
-
exports.PIO_SRC_ISR = 6;
|
|
10
|
-
exports.PIO_SRC_OSR = 7;
|
|
11
|
-
exports.PIO_DEST_PINS = 0;
|
|
12
|
-
exports.PIO_DEST_X = 1;
|
|
13
|
-
exports.PIO_DEST_Y = 2;
|
|
14
|
-
exports.PIO_DEST_NULL = 3;
|
|
15
|
-
exports.PIO_DEST_PINDIRS = 4;
|
|
16
|
-
exports.PIO_DEST_PC = 5;
|
|
17
|
-
exports.PIO_DEST_ISR = 6;
|
|
18
|
-
exports.PIO_DEST_EXEC = 7;
|
|
19
|
-
exports.PIO_MOV_DEST_PINS = 0;
|
|
20
|
-
exports.PIO_MOV_DEST_X = 1;
|
|
21
|
-
exports.PIO_MOV_DEST_Y = 2;
|
|
22
|
-
exports.PIO_MOV_DEST_EXEC = 4;
|
|
23
|
-
exports.PIO_MOV_DEST_PC = 5;
|
|
24
|
-
exports.PIO_MOV_DEST_ISR = 6;
|
|
25
|
-
exports.PIO_MOV_DEST_OSR = 7;
|
|
26
|
-
exports.PIO_OP_NONE = 0;
|
|
27
|
-
exports.PIO_OP_INVERT = 1;
|
|
28
|
-
exports.PIO_OP_BITREV = 2;
|
|
29
|
-
exports.PIO_WAIT_SRC_GPIO = 0;
|
|
30
|
-
exports.PIO_WAIT_SRC_PIN = 1;
|
|
31
|
-
exports.PIO_WAIT_SRC_IRQ = 2;
|
|
32
|
-
exports.PIO_COND_ALWAYS = 0;
|
|
33
|
-
exports.PIO_COND_NOTX = 1;
|
|
34
|
-
exports.PIO_COND_XDEC = 2;
|
|
35
|
-
exports.PIO_COND_NOTY = 3;
|
|
36
|
-
exports.PIO_COND_YDEC = 4;
|
|
37
|
-
exports.PIO_COND_XNEY = 5;
|
|
38
|
-
exports.PIO_COND_PIN = 6;
|
|
39
|
-
exports.PIO_COND_NOTEMPTYOSR = 7;
|
|
40
|
-
function pioJMP(cond = 0, address, delay = 0) {
|
|
41
|
-
return ((delay & 0x1f) << 8) | ((cond & 0x7) << 5) | (address & 0x1f);
|
|
42
|
-
}
|
|
43
|
-
exports.pioJMP = pioJMP;
|
|
44
|
-
function pioWAIT(polarity, src, index, delay = 0) {
|
|
45
|
-
return ((1 << 13) |
|
|
46
|
-
((delay & 0x1f) << 8) |
|
|
47
|
-
((polarity ? 1 : 0) << 7) |
|
|
48
|
-
((src & 0x3) << 5) |
|
|
49
|
-
(index & 0x1f));
|
|
50
|
-
}
|
|
51
|
-
exports.pioWAIT = pioWAIT;
|
|
52
|
-
function pioIN(src, bitCount, delay = 0) {
|
|
53
|
-
return (2 << 13) | ((delay & 0x1f) << 8) | ((src & 0x7) << 5) | (bitCount & 0x1f);
|
|
54
|
-
}
|
|
55
|
-
exports.pioIN = pioIN;
|
|
56
|
-
function pioOUT(Dest, bitCount, delay = 0) {
|
|
57
|
-
return (3 << 13) | ((delay & 0x1f) << 8) | ((Dest & 0x7) << 5) | (bitCount & 0x1f);
|
|
58
|
-
}
|
|
59
|
-
exports.pioOUT = pioOUT;
|
|
60
|
-
function pioPUSH(ifFull, noBlock, delay = 0) {
|
|
61
|
-
return (4 << 13) | ((delay & 0x1f) << 8) | ((ifFull ? 1 : 0) << 6) | ((noBlock ? 1 : 0) << 5);
|
|
62
|
-
}
|
|
63
|
-
exports.pioPUSH = pioPUSH;
|
|
64
|
-
function pioPULL(ifEmpty, noBlock, delay = 0) {
|
|
65
|
-
return ((4 << 13) |
|
|
66
|
-
((delay & 0x1f) << 8) |
|
|
67
|
-
(1 << 7) |
|
|
68
|
-
((ifEmpty ? 1 : 0) << 6) |
|
|
69
|
-
((noBlock ? 1 : 0) << 5));
|
|
70
|
-
}
|
|
71
|
-
exports.pioPULL = pioPULL;
|
|
72
|
-
function pioMOV(dest, op = 0, src, delay = 0) {
|
|
73
|
-
return (5 << 13) | ((delay & 0x1f) << 8) | ((dest & 0x7) << 5) | ((op & 0x3) << 3) | (src & 0x7);
|
|
74
|
-
}
|
|
75
|
-
exports.pioMOV = pioMOV;
|
|
76
|
-
function pioIRQ(clear, wait, index, delay = 0) {
|
|
77
|
-
return ((6 << 13) |
|
|
78
|
-
((delay & 0x1f) << 8) |
|
|
79
|
-
((clear ? 1 : 0) << 6) |
|
|
80
|
-
((wait ? 1 : 0) << 5) |
|
|
81
|
-
(index & 0x1f));
|
|
82
|
-
}
|
|
83
|
-
exports.pioIRQ = pioIRQ;
|
|
84
|
-
function pioSET(dest, data, delay = 0) {
|
|
85
|
-
return (7 << 13) | ((delay & 0x1f) << 8) | ((dest & 0x7) << 5) | (data & 0x1f);
|
|
86
|
-
}
|
|
87
|
-
exports.pioSET = pioSET;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pioSET = exports.pioIRQ = exports.pioMOV = exports.pioPULL = exports.pioPUSH = exports.pioOUT = exports.pioIN = exports.pioWAIT = exports.pioJMP = exports.PIO_COND_NOTEMPTYOSR = exports.PIO_COND_PIN = exports.PIO_COND_XNEY = exports.PIO_COND_YDEC = exports.PIO_COND_NOTY = exports.PIO_COND_XDEC = exports.PIO_COND_NOTX = exports.PIO_COND_ALWAYS = exports.PIO_WAIT_SRC_IRQ = exports.PIO_WAIT_SRC_PIN = exports.PIO_WAIT_SRC_GPIO = exports.PIO_OP_BITREV = exports.PIO_OP_INVERT = exports.PIO_OP_NONE = exports.PIO_MOV_DEST_OSR = exports.PIO_MOV_DEST_ISR = exports.PIO_MOV_DEST_PC = exports.PIO_MOV_DEST_EXEC = exports.PIO_MOV_DEST_Y = exports.PIO_MOV_DEST_X = exports.PIO_MOV_DEST_PINS = exports.PIO_DEST_EXEC = exports.PIO_DEST_ISR = exports.PIO_DEST_PC = exports.PIO_DEST_PINDIRS = exports.PIO_DEST_NULL = exports.PIO_DEST_Y = exports.PIO_DEST_X = exports.PIO_DEST_PINS = exports.PIO_SRC_OSR = exports.PIO_SRC_ISR = exports.PIO_SRC_STATUS = exports.PIO_SRC_NULL = exports.PIO_SRC_Y = exports.PIO_SRC_X = exports.PIO_SRC_PINS = void 0;
|
|
4
|
+
exports.PIO_SRC_PINS = 0;
|
|
5
|
+
exports.PIO_SRC_X = 1;
|
|
6
|
+
exports.PIO_SRC_Y = 2;
|
|
7
|
+
exports.PIO_SRC_NULL = 3;
|
|
8
|
+
exports.PIO_SRC_STATUS = 5;
|
|
9
|
+
exports.PIO_SRC_ISR = 6;
|
|
10
|
+
exports.PIO_SRC_OSR = 7;
|
|
11
|
+
exports.PIO_DEST_PINS = 0;
|
|
12
|
+
exports.PIO_DEST_X = 1;
|
|
13
|
+
exports.PIO_DEST_Y = 2;
|
|
14
|
+
exports.PIO_DEST_NULL = 3;
|
|
15
|
+
exports.PIO_DEST_PINDIRS = 4;
|
|
16
|
+
exports.PIO_DEST_PC = 5;
|
|
17
|
+
exports.PIO_DEST_ISR = 6;
|
|
18
|
+
exports.PIO_DEST_EXEC = 7;
|
|
19
|
+
exports.PIO_MOV_DEST_PINS = 0;
|
|
20
|
+
exports.PIO_MOV_DEST_X = 1;
|
|
21
|
+
exports.PIO_MOV_DEST_Y = 2;
|
|
22
|
+
exports.PIO_MOV_DEST_EXEC = 4;
|
|
23
|
+
exports.PIO_MOV_DEST_PC = 5;
|
|
24
|
+
exports.PIO_MOV_DEST_ISR = 6;
|
|
25
|
+
exports.PIO_MOV_DEST_OSR = 7;
|
|
26
|
+
exports.PIO_OP_NONE = 0;
|
|
27
|
+
exports.PIO_OP_INVERT = 1;
|
|
28
|
+
exports.PIO_OP_BITREV = 2;
|
|
29
|
+
exports.PIO_WAIT_SRC_GPIO = 0;
|
|
30
|
+
exports.PIO_WAIT_SRC_PIN = 1;
|
|
31
|
+
exports.PIO_WAIT_SRC_IRQ = 2;
|
|
32
|
+
exports.PIO_COND_ALWAYS = 0;
|
|
33
|
+
exports.PIO_COND_NOTX = 1;
|
|
34
|
+
exports.PIO_COND_XDEC = 2;
|
|
35
|
+
exports.PIO_COND_NOTY = 3;
|
|
36
|
+
exports.PIO_COND_YDEC = 4;
|
|
37
|
+
exports.PIO_COND_XNEY = 5;
|
|
38
|
+
exports.PIO_COND_PIN = 6;
|
|
39
|
+
exports.PIO_COND_NOTEMPTYOSR = 7;
|
|
40
|
+
function pioJMP(cond = 0, address, delay = 0) {
|
|
41
|
+
return ((delay & 0x1f) << 8) | ((cond & 0x7) << 5) | (address & 0x1f);
|
|
42
|
+
}
|
|
43
|
+
exports.pioJMP = pioJMP;
|
|
44
|
+
function pioWAIT(polarity, src, index, delay = 0) {
|
|
45
|
+
return ((1 << 13) |
|
|
46
|
+
((delay & 0x1f) << 8) |
|
|
47
|
+
((polarity ? 1 : 0) << 7) |
|
|
48
|
+
((src & 0x3) << 5) |
|
|
49
|
+
(index & 0x1f));
|
|
50
|
+
}
|
|
51
|
+
exports.pioWAIT = pioWAIT;
|
|
52
|
+
function pioIN(src, bitCount, delay = 0) {
|
|
53
|
+
return (2 << 13) | ((delay & 0x1f) << 8) | ((src & 0x7) << 5) | (bitCount & 0x1f);
|
|
54
|
+
}
|
|
55
|
+
exports.pioIN = pioIN;
|
|
56
|
+
function pioOUT(Dest, bitCount, delay = 0) {
|
|
57
|
+
return (3 << 13) | ((delay & 0x1f) << 8) | ((Dest & 0x7) << 5) | (bitCount & 0x1f);
|
|
58
|
+
}
|
|
59
|
+
exports.pioOUT = pioOUT;
|
|
60
|
+
function pioPUSH(ifFull, noBlock, delay = 0) {
|
|
61
|
+
return (4 << 13) | ((delay & 0x1f) << 8) | ((ifFull ? 1 : 0) << 6) | ((noBlock ? 1 : 0) << 5);
|
|
62
|
+
}
|
|
63
|
+
exports.pioPUSH = pioPUSH;
|
|
64
|
+
function pioPULL(ifEmpty, noBlock, delay = 0) {
|
|
65
|
+
return ((4 << 13) |
|
|
66
|
+
((delay & 0x1f) << 8) |
|
|
67
|
+
(1 << 7) |
|
|
68
|
+
((ifEmpty ? 1 : 0) << 6) |
|
|
69
|
+
((noBlock ? 1 : 0) << 5));
|
|
70
|
+
}
|
|
71
|
+
exports.pioPULL = pioPULL;
|
|
72
|
+
function pioMOV(dest, op = 0, src, delay = 0) {
|
|
73
|
+
return (5 << 13) | ((delay & 0x1f) << 8) | ((dest & 0x7) << 5) | ((op & 0x3) << 3) | (src & 0x7);
|
|
74
|
+
}
|
|
75
|
+
exports.pioMOV = pioMOV;
|
|
76
|
+
function pioIRQ(clear, wait, index, delay = 0) {
|
|
77
|
+
return ((6 << 13) |
|
|
78
|
+
((delay & 0x1f) << 8) |
|
|
79
|
+
((clear ? 1 : 0) << 6) |
|
|
80
|
+
((wait ? 1 : 0) << 5) |
|
|
81
|
+
(index & 0x1f));
|
|
82
|
+
}
|
|
83
|
+
exports.pioIRQ = pioIRQ;
|
|
84
|
+
function pioSET(dest, data, delay = 0) {
|
|
85
|
+
return (7 << 13) | ((delay & 0x1f) << 8) | ((dest & 0x7) << 5) | (data & 0x1f);
|
|
86
|
+
}
|
|
87
|
+
exports.pioSET = pioSET;
|
package/dist/cjs/utils/time.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getCurrentMicroseconds(): number;
|
|
2
|
-
export declare function formatTime(date: Date): string;
|
|
1
|
+
export declare function getCurrentMicroseconds(): number;
|
|
2
|
+
export declare function formatTime(date: Date): string;
|