rp2040js 0.14.1 → 0.14.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/dist/cjs/gpio-pin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GPIOPin = exports.FUNCTION_PIO1 = exports.FUNCTION_PIO0 = exports.FUNCTION_SIO = exports.GPIOPinState = void 0;
|
|
4
|
+
const pio_1 = require("./peripherals/pio");
|
|
4
5
|
var GPIOPinState;
|
|
5
6
|
(function (GPIOPinState) {
|
|
6
7
|
GPIOPinState[GPIOPinState["Low"] = 0] = "Low";
|
|
@@ -166,6 +167,16 @@ class GPIOPin {
|
|
|
166
167
|
if (this.irqValue !== prevIrqValue) {
|
|
167
168
|
this.rp2040.updateIOInterrupt();
|
|
168
169
|
}
|
|
170
|
+
for (const pio of this.rp2040.pio) {
|
|
171
|
+
for (const machine of pio.machines) {
|
|
172
|
+
if (machine.enabled &&
|
|
173
|
+
machine.waiting &&
|
|
174
|
+
machine.waitType === pio_1.WaitType.Pin &&
|
|
175
|
+
machine.waitIndex === this.index) {
|
|
176
|
+
machine.checkWait();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
169
180
|
}
|
|
170
181
|
checkForUpdates() {
|
|
171
182
|
const { lastValue, value } = this;
|
|
@@ -2,7 +2,7 @@ import { RP2040 } from '../rp2040';
|
|
|
2
2
|
import { FIFO } from '../utils/fifo';
|
|
3
3
|
import { DREQChannel } from './dma';
|
|
4
4
|
import { BasePeripheral, Peripheral } from './peripheral';
|
|
5
|
-
declare enum WaitType {
|
|
5
|
+
export declare enum WaitType {
|
|
6
6
|
None = 0,
|
|
7
7
|
Pin = 1,
|
|
8
8
|
rxFIFO = 2,
|
|
@@ -118,4 +118,3 @@ export declare class RPPIO extends BasePeripheral implements Peripheral {
|
|
|
118
118
|
run(): void;
|
|
119
119
|
stop(): void;
|
|
120
120
|
}
|
|
121
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RPPIO = exports.StateMachine = void 0;
|
|
3
|
+
exports.RPPIO = exports.StateMachine = exports.WaitType = void 0;
|
|
4
4
|
const fifo_1 = require("../utils/fifo");
|
|
5
5
|
const dma_1 = require("./dma");
|
|
6
6
|
const peripheral_1 = require("./peripheral");
|
|
@@ -73,7 +73,7 @@ var WaitType;
|
|
|
73
73
|
WaitType[WaitType["txFIFO"] = 3] = "txFIFO";
|
|
74
74
|
WaitType[WaitType["IRQ"] = 4] = "IRQ";
|
|
75
75
|
WaitType[WaitType["Out"] = 5] = "Out";
|
|
76
|
-
})(WaitType || (WaitType = {}));
|
|
76
|
+
})(WaitType = exports.WaitType || (exports.WaitType = {}));
|
|
77
77
|
function bitReverse(x) {
|
|
78
78
|
x = ((x & 0x55555555) << 1) | ((x & 0xaaaaaaaa) >> 1);
|
|
79
79
|
x = ((x & 0x33333333) << 2) | ((x & 0xcccccccc) >> 2);
|
package/dist/esm/gpio-pin.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WaitType } from './peripherals/pio';
|
|
1
2
|
export var GPIOPinState;
|
|
2
3
|
(function (GPIOPinState) {
|
|
3
4
|
GPIOPinState[GPIOPinState["Low"] = 0] = "Low";
|
|
@@ -163,6 +164,16 @@ export class GPIOPin {
|
|
|
163
164
|
if (this.irqValue !== prevIrqValue) {
|
|
164
165
|
this.rp2040.updateIOInterrupt();
|
|
165
166
|
}
|
|
167
|
+
for (const pio of this.rp2040.pio) {
|
|
168
|
+
for (const machine of pio.machines) {
|
|
169
|
+
if (machine.enabled &&
|
|
170
|
+
machine.waiting &&
|
|
171
|
+
machine.waitType === WaitType.Pin &&
|
|
172
|
+
machine.waitIndex === this.index) {
|
|
173
|
+
machine.checkWait();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
166
177
|
}
|
|
167
178
|
checkForUpdates() {
|
|
168
179
|
const { lastValue, value } = this;
|
|
@@ -2,7 +2,7 @@ import { RP2040 } from '../rp2040';
|
|
|
2
2
|
import { FIFO } from '../utils/fifo';
|
|
3
3
|
import { DREQChannel } from './dma';
|
|
4
4
|
import { BasePeripheral, Peripheral } from './peripheral';
|
|
5
|
-
declare enum WaitType {
|
|
5
|
+
export declare enum WaitType {
|
|
6
6
|
None = 0,
|
|
7
7
|
Pin = 1,
|
|
8
8
|
rxFIFO = 2,
|
|
@@ -118,4 +118,3 @@ export declare class RPPIO extends BasePeripheral implements Peripheral {
|
|
|
118
118
|
run(): void;
|
|
119
119
|
stop(): void;
|
|
120
120
|
}
|
|
121
|
-
export {};
|
|
@@ -62,7 +62,7 @@ const EXECCTRL_STATUS_SEL = 1 << 4;
|
|
|
62
62
|
const EXECCTRL_SIDE_PINDIR = 1 << 29;
|
|
63
63
|
const EXECCTRL_SIDE_EN = 1 << 30;
|
|
64
64
|
const EXECCTRL_EXEC_STALLED = 1 << 31;
|
|
65
|
-
var WaitType;
|
|
65
|
+
export var WaitType;
|
|
66
66
|
(function (WaitType) {
|
|
67
67
|
WaitType[WaitType["None"] = 0] = "None";
|
|
68
68
|
WaitType[WaitType["Pin"] = 1] = "Pin";
|