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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BasePeripheral, Peripheral } from './peripheral';
|
|
2
|
-
export declare class RPReset extends BasePeripheral implements Peripheral {
|
|
3
|
-
private reset;
|
|
4
|
-
private wdsel;
|
|
5
|
-
private reset_done;
|
|
6
|
-
readUint32(offset: number): number;
|
|
7
|
-
writeUint32(offset: number, value: number): void;
|
|
8
|
-
}
|
|
1
|
+
import { BasePeripheral, Peripheral } from './peripheral.js';
|
|
2
|
+
export declare class RPReset extends BasePeripheral implements Peripheral {
|
|
3
|
+
private reset;
|
|
4
|
+
private wdsel;
|
|
5
|
+
private reset_done;
|
|
6
|
+
readUint32(offset: number): number;
|
|
7
|
+
writeUint32(offset: number, value: number): void;
|
|
8
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RPReset = void 0;
|
|
4
|
-
const
|
|
5
|
-
const RESET = 0x0; //Reset control.
|
|
6
|
-
const WDSEL = 0x4; //Watchdog select.
|
|
7
|
-
const RESET_DONE = 0x8; //Reset Done
|
|
8
|
-
class RPReset extends
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.reset = 0;
|
|
12
|
-
this.wdsel = 0;
|
|
13
|
-
this.reset_done = 0x1ffffff;
|
|
14
|
-
}
|
|
15
|
-
readUint32(offset) {
|
|
16
|
-
switch (offset) {
|
|
17
|
-
case RESET:
|
|
18
|
-
return this.reset;
|
|
19
|
-
case WDSEL:
|
|
20
|
-
return this.wdsel;
|
|
21
|
-
case RESET_DONE:
|
|
22
|
-
return this.reset_done;
|
|
23
|
-
}
|
|
24
|
-
return super.readUint32(offset);
|
|
25
|
-
}
|
|
26
|
-
writeUint32(offset, value) {
|
|
27
|
-
switch (offset) {
|
|
28
|
-
case RESET:
|
|
29
|
-
this.reset = value & 0x1ffffff;
|
|
30
|
-
break;
|
|
31
|
-
case WDSEL:
|
|
32
|
-
this.wdsel = value & 0x1ffffff;
|
|
33
|
-
break;
|
|
34
|
-
default:
|
|
35
|
-
super.writeUint32(offset, value);
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.RPReset = RPReset;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RPReset = void 0;
|
|
4
|
+
const peripheral_js_1 = require("./peripheral.js");
|
|
5
|
+
const RESET = 0x0; //Reset control.
|
|
6
|
+
const WDSEL = 0x4; //Watchdog select.
|
|
7
|
+
const RESET_DONE = 0x8; //Reset Done
|
|
8
|
+
class RPReset extends peripheral_js_1.BasePeripheral {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.reset = 0;
|
|
12
|
+
this.wdsel = 0;
|
|
13
|
+
this.reset_done = 0x1ffffff;
|
|
14
|
+
}
|
|
15
|
+
readUint32(offset) {
|
|
16
|
+
switch (offset) {
|
|
17
|
+
case RESET:
|
|
18
|
+
return this.reset;
|
|
19
|
+
case WDSEL:
|
|
20
|
+
return this.wdsel;
|
|
21
|
+
case RESET_DONE:
|
|
22
|
+
return this.reset_done;
|
|
23
|
+
}
|
|
24
|
+
return super.readUint32(offset);
|
|
25
|
+
}
|
|
26
|
+
writeUint32(offset, value) {
|
|
27
|
+
switch (offset) {
|
|
28
|
+
case RESET:
|
|
29
|
+
this.reset = value & 0x1ffffff;
|
|
30
|
+
break;
|
|
31
|
+
case WDSEL:
|
|
32
|
+
this.wdsel = value & 0x1ffffff;
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
super.writeUint32(offset, value);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.RPReset = RPReset;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BasePeripheral, Peripheral } from './peripheral';
|
|
2
|
-
export declare class RP2040RTC extends BasePeripheral implements Peripheral {
|
|
3
|
-
setup0: number;
|
|
4
|
-
setup1: number;
|
|
5
|
-
rtc1: number;
|
|
6
|
-
rtc0: number;
|
|
7
|
-
ctrl: number;
|
|
8
|
-
readUint32(offset: number): number;
|
|
9
|
-
writeUint32(offset: number, value: number): void;
|
|
10
|
-
}
|
|
1
|
+
import { BasePeripheral, Peripheral } from './peripheral.js';
|
|
2
|
+
export declare class RP2040RTC extends BasePeripheral implements Peripheral {
|
|
3
|
+
setup0: number;
|
|
4
|
+
setup1: number;
|
|
5
|
+
rtc1: number;
|
|
6
|
+
rtc0: number;
|
|
7
|
+
ctrl: number;
|
|
8
|
+
readUint32(offset: number): number;
|
|
9
|
+
writeUint32(offset: number, value: number): void;
|
|
10
|
+
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RP2040RTC = void 0;
|
|
4
|
-
const
|
|
5
|
-
const RTC_SETUP0 = 0x04;
|
|
6
|
-
const RTC_SETUP1 = 0x08;
|
|
7
|
-
const RTC_CTRL = 0x0c;
|
|
8
|
-
const IRQ_SETUP_0 = 0x10;
|
|
9
|
-
const RTC_RTC1 = 0x18;
|
|
10
|
-
const RTC_RTC0 = 0x1c;
|
|
11
|
-
const RTC_ENABLE_BITS = 0x01;
|
|
12
|
-
const RTC_ACTIVE_BITS = 0x2;
|
|
13
|
-
const RTC_LOAD_BITS = 0x10;
|
|
14
|
-
class RP2040RTC extends
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.setup0 = 0;
|
|
18
|
-
this.setup1 = 0;
|
|
19
|
-
this.rtc1 = 0;
|
|
20
|
-
this.rtc0 = 0;
|
|
21
|
-
this.ctrl = 0;
|
|
22
|
-
}
|
|
23
|
-
readUint32(offset) {
|
|
24
|
-
switch (offset) {
|
|
25
|
-
case RTC_SETUP0:
|
|
26
|
-
return this.setup0;
|
|
27
|
-
case RTC_SETUP1:
|
|
28
|
-
return this.setup1;
|
|
29
|
-
case RTC_CTRL:
|
|
30
|
-
return this.ctrl;
|
|
31
|
-
case IRQ_SETUP_0:
|
|
32
|
-
return 0;
|
|
33
|
-
case RTC_RTC1:
|
|
34
|
-
return this.rtc1;
|
|
35
|
-
case RTC_RTC0:
|
|
36
|
-
return this.rtc0;
|
|
37
|
-
}
|
|
38
|
-
return super.readUint32(offset);
|
|
39
|
-
}
|
|
40
|
-
writeUint32(offset, value) {
|
|
41
|
-
switch (offset) {
|
|
42
|
-
case RTC_SETUP0:
|
|
43
|
-
this.setup0 = value;
|
|
44
|
-
break;
|
|
45
|
-
case RTC_SETUP1:
|
|
46
|
-
this.setup1 = value;
|
|
47
|
-
break;
|
|
48
|
-
case RTC_CTRL:
|
|
49
|
-
// Though RTC_LOAD_BITS is type SC and should be cleared on next cycle, pico-sdk write
|
|
50
|
-
// RTC_LOAD_BITS & RTC_ENABLE_BITS seperatly.
|
|
51
|
-
// https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_rtc/rtc.c#L76-L80
|
|
52
|
-
if (value & RTC_LOAD_BITS) {
|
|
53
|
-
this.ctrl |= RTC_LOAD_BITS;
|
|
54
|
-
}
|
|
55
|
-
if (value & RTC_ENABLE_BITS) {
|
|
56
|
-
this.ctrl |= RTC_ENABLE_BITS;
|
|
57
|
-
this.ctrl |= RTC_ACTIVE_BITS;
|
|
58
|
-
if (this.ctrl & RTC_LOAD_BITS) {
|
|
59
|
-
this.rtc1 = this.setup0;
|
|
60
|
-
this.rtc0 = this.setup1;
|
|
61
|
-
this.ctrl &= ~RTC_LOAD_BITS;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
this.ctrl &= ~RTC_ENABLE_BITS;
|
|
66
|
-
this.ctrl &= ~RTC_ACTIVE_BITS;
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
default:
|
|
70
|
-
super.writeUint32(offset, value);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.RP2040RTC = RP2040RTC;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RP2040RTC = void 0;
|
|
4
|
+
const peripheral_js_1 = require("./peripheral.js");
|
|
5
|
+
const RTC_SETUP0 = 0x04;
|
|
6
|
+
const RTC_SETUP1 = 0x08;
|
|
7
|
+
const RTC_CTRL = 0x0c;
|
|
8
|
+
const IRQ_SETUP_0 = 0x10;
|
|
9
|
+
const RTC_RTC1 = 0x18;
|
|
10
|
+
const RTC_RTC0 = 0x1c;
|
|
11
|
+
const RTC_ENABLE_BITS = 0x01;
|
|
12
|
+
const RTC_ACTIVE_BITS = 0x2;
|
|
13
|
+
const RTC_LOAD_BITS = 0x10;
|
|
14
|
+
class RP2040RTC extends peripheral_js_1.BasePeripheral {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.setup0 = 0;
|
|
18
|
+
this.setup1 = 0;
|
|
19
|
+
this.rtc1 = 0;
|
|
20
|
+
this.rtc0 = 0;
|
|
21
|
+
this.ctrl = 0;
|
|
22
|
+
}
|
|
23
|
+
readUint32(offset) {
|
|
24
|
+
switch (offset) {
|
|
25
|
+
case RTC_SETUP0:
|
|
26
|
+
return this.setup0;
|
|
27
|
+
case RTC_SETUP1:
|
|
28
|
+
return this.setup1;
|
|
29
|
+
case RTC_CTRL:
|
|
30
|
+
return this.ctrl;
|
|
31
|
+
case IRQ_SETUP_0:
|
|
32
|
+
return 0;
|
|
33
|
+
case RTC_RTC1:
|
|
34
|
+
return this.rtc1;
|
|
35
|
+
case RTC_RTC0:
|
|
36
|
+
return this.rtc0;
|
|
37
|
+
}
|
|
38
|
+
return super.readUint32(offset);
|
|
39
|
+
}
|
|
40
|
+
writeUint32(offset, value) {
|
|
41
|
+
switch (offset) {
|
|
42
|
+
case RTC_SETUP0:
|
|
43
|
+
this.setup0 = value;
|
|
44
|
+
break;
|
|
45
|
+
case RTC_SETUP1:
|
|
46
|
+
this.setup1 = value;
|
|
47
|
+
break;
|
|
48
|
+
case RTC_CTRL:
|
|
49
|
+
// Though RTC_LOAD_BITS is type SC and should be cleared on next cycle, pico-sdk write
|
|
50
|
+
// RTC_LOAD_BITS & RTC_ENABLE_BITS seperatly.
|
|
51
|
+
// https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_rtc/rtc.c#L76-L80
|
|
52
|
+
if (value & RTC_LOAD_BITS) {
|
|
53
|
+
this.ctrl |= RTC_LOAD_BITS;
|
|
54
|
+
}
|
|
55
|
+
if (value & RTC_ENABLE_BITS) {
|
|
56
|
+
this.ctrl |= RTC_ENABLE_BITS;
|
|
57
|
+
this.ctrl |= RTC_ACTIVE_BITS;
|
|
58
|
+
if (this.ctrl & RTC_LOAD_BITS) {
|
|
59
|
+
this.rtc1 = this.setup0;
|
|
60
|
+
this.rtc0 = this.setup1;
|
|
61
|
+
this.ctrl &= ~RTC_LOAD_BITS;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.ctrl &= ~RTC_ENABLE_BITS;
|
|
66
|
+
this.ctrl &= ~RTC_ACTIVE_BITS;
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
super.writeUint32(offset, value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.RP2040RTC = RP2040RTC;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { RP2040 } from '../rp2040';
|
|
2
|
-
import { FIFO } from '../utils/fifo';
|
|
3
|
-
import { DREQChannel } from './dma';
|
|
4
|
-
import { BasePeripheral, Peripheral } from './peripheral';
|
|
5
|
-
export interface ISPIDMAChannels {
|
|
6
|
-
rx: DREQChannel;
|
|
7
|
-
tx: DREQChannel;
|
|
8
|
-
}
|
|
9
|
-
export declare class RPSPI extends BasePeripheral implements Peripheral {
|
|
10
|
-
readonly irq: number;
|
|
11
|
-
readonly dreq: ISPIDMAChannels;
|
|
12
|
-
readonly rxFIFO: FIFO;
|
|
13
|
-
readonly txFIFO: FIFO;
|
|
14
|
-
onTransmit: (value: number) => void;
|
|
15
|
-
private busy;
|
|
16
|
-
private control0;
|
|
17
|
-
private control1;
|
|
18
|
-
private dmaControl;
|
|
19
|
-
private clockDivisor;
|
|
20
|
-
private intRaw;
|
|
21
|
-
private intEnable;
|
|
22
|
-
get intStatus(): number;
|
|
23
|
-
get enabled(): boolean;
|
|
24
|
-
/** Data size in bits: 4 to 16 bits */
|
|
25
|
-
get dataBits(): number;
|
|
26
|
-
get masterMode(): boolean;
|
|
27
|
-
get spiMode():
|
|
28
|
-
get clockFrequency(): number;
|
|
29
|
-
private updateDMATx;
|
|
30
|
-
private updateDMARx;
|
|
31
|
-
constructor(rp2040: RP2040, name: string, irq: number, dreq: ISPIDMAChannels);
|
|
32
|
-
private doTX;
|
|
33
|
-
completeTransmit(rxValue: number): void;
|
|
34
|
-
checkInterrupts(): void;
|
|
35
|
-
private fifosUpdated;
|
|
36
|
-
readUint32(offset: number): number;
|
|
37
|
-
writeUint32(offset: number, value: number): void;
|
|
38
|
-
}
|
|
1
|
+
import { RP2040 } from '../rp2040.js';
|
|
2
|
+
import { FIFO } from '../utils/fifo.js';
|
|
3
|
+
import { DREQChannel } from './dma.js';
|
|
4
|
+
import { BasePeripheral, Peripheral } from './peripheral.js';
|
|
5
|
+
export interface ISPIDMAChannels {
|
|
6
|
+
rx: DREQChannel;
|
|
7
|
+
tx: DREQChannel;
|
|
8
|
+
}
|
|
9
|
+
export declare class RPSPI extends BasePeripheral implements Peripheral {
|
|
10
|
+
readonly irq: number;
|
|
11
|
+
readonly dreq: ISPIDMAChannels;
|
|
12
|
+
readonly rxFIFO: FIFO;
|
|
13
|
+
readonly txFIFO: FIFO;
|
|
14
|
+
onTransmit: (value: number) => void;
|
|
15
|
+
private busy;
|
|
16
|
+
private control0;
|
|
17
|
+
private control1;
|
|
18
|
+
private dmaControl;
|
|
19
|
+
private clockDivisor;
|
|
20
|
+
private intRaw;
|
|
21
|
+
private intEnable;
|
|
22
|
+
get intStatus(): number;
|
|
23
|
+
get enabled(): boolean;
|
|
24
|
+
/** Data size in bits: 4 to 16 bits */
|
|
25
|
+
get dataBits(): number;
|
|
26
|
+
get masterMode(): boolean;
|
|
27
|
+
get spiMode(): 0 | 1 | 2 | 3;
|
|
28
|
+
get clockFrequency(): number;
|
|
29
|
+
private updateDMATx;
|
|
30
|
+
private updateDMARx;
|
|
31
|
+
constructor(rp2040: RP2040, name: string, irq: number, dreq: ISPIDMAChannels);
|
|
32
|
+
private doTX;
|
|
33
|
+
completeTransmit(rxValue: number): void;
|
|
34
|
+
checkInterrupts(): void;
|
|
35
|
+
private fifosUpdated;
|
|
36
|
+
readUint32(offset: number): number;
|
|
37
|
+
writeUint32(offset: number, value: number): void;
|
|
38
|
+
}
|