Skip to content

Commit 3604617

Browse files
committed
2 parents 16038fd + 98d2c09 commit 3604617

File tree

13 files changed

+78
-76
lines changed

13 files changed

+78
-76
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [josverl]

reference/micropython/machine/UART.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,9 @@ class UART:
456456

457457
def irq(
458458
self,
459-
trigger: int,
460-
priority: int = 1,
461459
handler: Callable[[UART], None] | None = None,
462-
wake: int = IDLE,
460+
trigger: int = 0,
461+
hard: bool = False,
463462
/,
464463
) -> _IRQ:
465464
"""

stubs/micropython-v1_24_1-docstubs/machine/UART.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,9 @@ class UART:
455455

456456
def irq(
457457
self,
458-
trigger: int,
459-
priority: int = 1,
460458
handler: Callable[[UART], None] | None = None,
461-
wake: int = IDLE,
459+
trigger: int = 0,
460+
hard: bool = False,
462461
/,
463462
) -> _IRQ:
464463
"""

stubs/micropython-v1_24_1-docstubs/rp2/PIOASMEmit.pyi

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,23 @@ class PIOASMEmit:
117117
"""
118118
...
119119

120-
def word(self, instr, label: Incomplete | None = ...) -> PIOASMEmit:
120+
def word(self, instr, label: Incomplete | None = ...) -> _PIO_ASM_Program:
121121
"""rp2.PIO instruction.
122122
123123
Stores a raw 16-bit value as an instruction in the program. This directive is
124124
invalid outside of a program.
125125
"""
126126
...
127127

128-
def nop(self) -> PIOASMEmit:
128+
def nop(self) -> _PIO_ASM_Program:
129129
"""rp2.PIO NOP instruction.
130130
131131
Assembles to mov y, y. "No operation", has no particular side effect, but a useful vehicle for a side-set
132132
operation or an extra delay.
133133
"""
134134
...
135135

136-
def jmp(self, condition, label: Incomplete | None = ...) -> PIOASMEmit:
136+
def jmp(self, condition, label: Incomplete | None = ...) -> _PIO_ASM_Program:
137137
"""rp2.PIO JMP instruction.
138138
139139
Set program counter to Address if Condition is true, otherwise no operation.
@@ -168,7 +168,7 @@ class PIOASMEmit:
168168
"""
169169
...
170170

171-
def wait(self, polarity: int, src: int, index: int, /) -> PIOASMEmit:
171+
def wait(self, polarity: int, src: int, index: int, /) -> _PIO_ASM_Program:
172172
"""rp2.PIO WAIT instruction.
173173
174174
Stall until some condition is met.
@@ -203,7 +203,7 @@ class PIOASMEmit:
203203
"""
204204
...
205205

206-
def in_(self, src: int, data) -> PIOASMEmit:
206+
def in_(self, src: int, data) -> _PIO_ASM_Program:
207207
"""rp2.PIO IN instruction.
208208
209209
Shift Bit count bits from Source into the Input Shift Register (ISR).
@@ -236,7 +236,7 @@ class PIOASMEmit:
236236
"""
237237
...
238238

239-
def out(self, destination: int, bit_count: int) -> PIOASMEmit:
239+
def out(self, destination: int, bit_count: int) -> _PIO_ASM_Program:
240240
"""rp2.PIO OUT instruction.
241241
242242
Shift Bit count bits out of the Output Shift Register (OSR), and write those bits to Destination.
@@ -274,7 +274,7 @@ class PIOASMEmit:
274274
"""
275275
...
276276

277-
def push(self, value: int = ..., value2: int = ...) -> PIOASMEmit:
277+
def push(self, value: int = ..., value2: int = ...) -> _PIO_ASM_Program:
278278
"""rp2.PIO PUSH instruction.
279279
280280
Push the contents of the ISR into the RX FIFO, as a single 32-bit word. Clear ISR to all-zeroes.
@@ -293,7 +293,7 @@ class PIOASMEmit:
293293
"""
294294
...
295295

296-
def pull(self, block: int = block, timeout: int = 0) -> PIOASMEmit:
296+
def pull(self, block: int = block, timeout: int = 0) -> _PIO_ASM_Program:
297297
"""rp2.PIO PULL instruction.
298298
299299
Load a 32-bit word from the TX FIFO into the OSR.
@@ -319,7 +319,7 @@ class PIOASMEmit:
319319
"""
320320
...
321321

322-
def mov(self, dest, src, operation: int | None = None) -> PIOASMEmit:
322+
def mov(self, dest, src, operation: int | None = None) -> _PIO_ASM_Program:
323323
"""rp2.PIO MOV instruction.
324324
325325
Copy data from Source to Destination.
@@ -365,7 +365,7 @@ class PIOASMEmit:
365365
"""
366366
...
367367

368-
def irq(self, mod, index: Incomplete | None = ...) -> PIOASMEmit:
368+
def irq(self, mod, index: Incomplete | None = ...) -> _PIO_ASM_Program:
369369
"""rp2.PIO instruction.
370370
371371
Set or clear the IRQ flag selected by Index argument.
@@ -384,7 +384,7 @@ class PIOASMEmit:
384384
which are running the same program. Bit 2 (the third LSB) is unaffected by this addition.
385385
If Wait is set, Delay cycles do not begin until after the wait period elapses."""
386386

387-
def set(self, destination: int, data) -> PIOASMEmit:
387+
def set(self, destination: int, data) -> _PIO_ASM_Program:
388388
"""rp2.PIO SET instruction.
389389
390390
Write immediate value Data to Destination.

stubs/micropython-v1_24_1-docstubs/rp2/StateMachine.pyi

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from typing import Any, Optional
66
from typing_extensions import TypeVar, TypeAlias, Awaitable
77
from _mpy_shed import _IRQ
88
from machine import Pin
9-
from rp2 import bootsel_button
9+
from rp2 import bootsel_button, _PIO_ASM_Program
1010
from rp2.DMA import DMA
1111
from rp2.Flash import Flash
1212
from rp2.PIO import PIO
@@ -24,9 +24,10 @@ class StateMachine:
2424

2525
def __init__(
2626
self,
27-
program: int,
28-
freq: int = 1,
27+
id: int,
28+
program: _PIO_ASM_Program,
2929
*,
30+
freq: int = 1,
3031
in_base: Pin | None = None,
3132
out_base: Pin | None = None,
3233
set_base: Pin | None = None,
@@ -39,9 +40,9 @@ class StateMachine:
3940
) -> None: ...
4041
def init(
4142
self,
42-
program: int,
43-
freq: int = 1,
43+
program: _PIO_ASM_Program,
4444
*,
45+
freq: int = 1,
4546
in_base: Pin | None = None,
4647
out_base: Pin | None = None,
4748
set_base: Pin | None = None,

stubs/micropython-v1_24_1-docstubs/rp2/__init__.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ from rp2.PIO import PIO
2424
from rp2.StateMachine import StateMachine
2525
from typing import Callable, Union, List, overload
2626
from micropython import const
27-
from rp2 import PIOASMEmit
27+
from rp2 import PIOASMEmit, _PIO_ASM_Program
2828
from machine import Pin
2929
from rp2.PIOASMEmit import PIOASMEmit
3030

31-
_PIO_ASM_Program: TypeAlias = Callable
31+
_PIO_ASM_Program: TypeAlias = PIOASMEmit
3232

3333
class PIOASMError(Exception):
3434
"""
@@ -48,7 +48,7 @@ def asm_pio(
4848
push_thresh=32,
4949
pull_thresh=32,
5050
fifo_join=PIO.JOIN_NONE,
51-
) -> Callable[..., PIOASMEmit]:
51+
) -> Callable[..., _PIO_ASM_Program]:
5252
"""
5353
Assemble a PIO program.
5454

stubs/micropython-v1_24_1-docstubs/rp2/asm_pio.pyi

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ from micropython import const # type: ignore
4545
if TYPE_CHECKING:
4646
# defined functions are all methods of the (frozen) class PIOASMEmit:
4747
# but also have a self method
48-
from rp2 import PIOASMEmit
48+
from rp2 import PIOASMEmit, _PIO_ASM_Program
4949

5050
# constants defined for PIO assembly
5151
# TODO: Make Final - or make const always return Final
@@ -110,15 +110,15 @@ if TYPE_CHECKING:
110110

111111
####################################################################################
112112

113-
def delay(delay: int) -> PIOASMEmit:
113+
def delay(delay: int) -> _PIO_ASM_Program:
114114
"""rp2.PIO delay modifier.
115115
116116
The delay method allows setting a delay for the current instruction,
117117
ensuring it does not exceed the maximum allowed delay.
118118
"""
119119
...
120120

121-
def side(value: int) -> PIOASMEmit:
121+
def side(value: int) -> _PIO_ASM_Program:
122122
"""rp2.PIO WRAP modifier.
123123
This is a modifier which can be applied to any instruction, and is used to control side-set pin values.
124124
value: the value (bits) to output on the side-set pins
@@ -167,23 +167,23 @@ if TYPE_CHECKING:
167167
"""
168168
...
169169

170-
def word(instr, label: Incomplete | None = ...) -> PIOASMEmit:
170+
def word(instr, label: Incomplete | None = ...) -> _PIO_ASM_Program:
171171
"""rp2.PIO instruction.
172172
173173
Stores a raw 16-bit value as an instruction in the program. This directive is
174174
invalid outside of a program.
175175
"""
176176
...
177177

178-
def nop() -> PIOASMEmit:
178+
def nop() -> _PIO_ASM_Program:
179179
"""rp2.PIO NOP instruction.
180180
181181
Assembles to mov y, y. "No operation", has no particular side effect, but a useful vehicle for a side-set
182182
operation or an extra delay.
183183
"""
184184
...
185185

186-
def jmp(condition, label: Incomplete | None = ...) -> PIOASMEmit:
186+
def jmp(condition, label: Incomplete | None = ...) -> _PIO_ASM_Program:
187187
"""rp2.PIO JMP instruction.
188188
189189
Set program counter to Address if Condition is true, otherwise no operation.
@@ -218,7 +218,7 @@ if TYPE_CHECKING:
218218
"""
219219
...
220220

221-
def wait(polarity: int, src: int, index: int, /) -> PIOASMEmit:
221+
def wait(polarity: int, src: int, index: int, /) -> _PIO_ASM_Program:
222222
"""rp2.PIO WAIT instruction.
223223
224224
Stall until some condition is met.
@@ -253,7 +253,7 @@ if TYPE_CHECKING:
253253
"""
254254
...
255255

256-
def in_(src, data) -> PIOASMEmit:
256+
def in_(src, data) -> _PIO_ASM_Program:
257257
"""rp2.PIO IN instruction.
258258
259259
Shift Bit count bits from Source into the Input Shift Register (ISR).
@@ -286,7 +286,7 @@ if TYPE_CHECKING:
286286
"""
287287
...
288288

289-
def out(destination: int, bit_count: int) -> PIOASMEmit:
289+
def out(destination: int, bit_count: int) -> _PIO_ASM_Program:
290290
"""rp2.PIO OUT instruction.
291291
292292
Shift Bit count bits out of the Output Shift Register (OSR), and write those bits to Destination.
@@ -324,7 +324,7 @@ if TYPE_CHECKING:
324324
"""
325325
...
326326

327-
def push(value: int = ..., value2: int = ...) -> PIOASMEmit:
327+
def push(value: int = ..., value2: int = ...) -> _PIO_ASM_Program:
328328
"""rp2.PIO PUSH instruction..
329329
330330
Push the contents of the ISR into the RX FIFO, as a single 32-bit word. Clear ISR to all-zeroes.
@@ -343,7 +343,7 @@ if TYPE_CHECKING:
343343
"""
344344
...
345345

346-
def pull(block: int = block, timeout: int = 0) -> PIOASMEmit:
346+
def pull(block: int = block, timeout: int = 0) -> _PIO_ASM_Program:
347347
"""rp2.PIO PULL instruction..
348348
349349
Load a 32-bit word from the TX FIFO into the OSR.
@@ -369,7 +369,7 @@ if TYPE_CHECKING:
369369
"""
370370
...
371371

372-
def mov(dest, src, operation: Optional[int] = None) -> PIOASMEmit:
372+
def mov(dest, src, operation: Optional[int] = None) -> _PIO_ASM_Program:
373373
"""rp2.PIO MOV instruction..
374374
375375
Copy data from Source to Destination.
@@ -415,7 +415,7 @@ if TYPE_CHECKING:
415415
"""
416416
...
417417

418-
def irq(mod, index: Incomplete | None = ...) -> PIOASMEmit:
418+
def irq(mod, index: Incomplete | None = ...) -> _PIO_ASM_Program:
419419
"""rp2.PIO instruction.
420420
421421
Set or clear the IRQ flag selected by Index argument.
@@ -435,7 +435,7 @@ if TYPE_CHECKING:
435435
If Wait is set, Delay cycles do not begin until after the wait period elapses."""
436436
...
437437

438-
def set(destination, data) -> PIOASMEmit:
438+
def set(destination, data) -> _PIO_ASM_Program:
439439
"""rp2.PIO SET instruction..
440440
441441
Write immediate value Data to Destination.

stubs/micropython-v1_25_0_preview-docstubs/machine/UART.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,9 @@ class UART:
455455

456456
def irq(
457457
self,
458-
trigger: int,
459-
priority: int = 1,
460458
handler: Callable[[UART], None] | None = None,
461-
wake: int = IDLE,
459+
trigger: int = 0,
460+
hard: bool = False,
462461
/,
463462
) -> _IRQ:
464463
"""

stubs/micropython-v1_25_0_preview-docstubs/modules.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"firmware": "micropython-v1_25_0_preview",
99
"nodename": "micropython",
1010
"version": "v1.25.0-preview",
11-
"release": "v1.25.0-preview-430-g5eee5a67d",
11+
"release": "v1.25.0-preview-442-g3805e65ed",
1212
"sysname": "micropython"
1313
},
1414
"stubber": {

0 commit comments

Comments
 (0)