-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stubs for v.24.1, stm32,rp2,esp32,samd
Signed-off-by: Jos Verlinde <Jos.Verlinde@microsoft.com>
- Loading branch information
Showing
2,056 changed files
with
209,526 additions
and
12,587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 9 additions & 81 deletions
90
publish/micropython-v1_24_0-samd-seeed_wio_terminal-stubs/asyncio/event.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,25 @@ | ||
""" | ||
Asynchronous I/O scheduler for writing concurrent code. | ||
MicroPython module: https://docs.micropython.org/en/v1.24.0/library/asyncio.html | ||
CPython module: | ||
`asyncio `<https://docs.python.org/3.8/library/asyncio.html> | ||
Example:: | ||
import asyncio | ||
async def blink(led, period_ms): | ||
while True: | ||
led.on() | ||
await asyncio.sleep_ms(5) | ||
led.off() | ||
await asyncio.sleep_ms(period_ms) | ||
async def main(led1, led2): | ||
asyncio.create_task(blink(led1, 700)) | ||
asyncio.create_task(blink(led2, 400)) | ||
await asyncio.sleep_ms(10_000) | ||
# Running on a pyboard | ||
from pyb import LED | ||
asyncio.run(main(LED(1), LED(2))) | ||
# Running on a generic board | ||
from machine import Pin | ||
asyncio.run(main(Pin(1), Pin(2))) | ||
Core functions | ||
-------------- | ||
--- | ||
Module: 'asyncio.event' on micropython-v1.24.0-samd-SEEED_WIO_TERMINAL | ||
""" | ||
|
||
# MCU: {'version': '1.24.0', 'mpy': 'v6.3', 'port': 'samd', 'board': 'SEEED_WIO_TERMINAL', 'family': 'micropython', 'build': '', 'arch': 'armv7emsp', 'ver': '1.24.0', 'cpu': 'SAMD51P19A'} | ||
# Stubber: v1.23.0 | ||
# MCU: {'family': 'micropython', 'version': '1.24.0', 'build': '', 'ver': '1.24.0', 'port': 'samd', 'board': 'SEEED_WIO_TERMINAL', 'cpu': 'SAMD51P19A', 'mpy': 'v6.3', 'arch': 'armv7emsp'} | ||
# Stubber: v1.24.0 | ||
from __future__ import annotations | ||
from typing import Any, Coroutine, List, Tuple, Generator | ||
from typing import Generator | ||
from _typeshed import Incomplete | ||
|
||
class ThreadSafeFlag: | ||
""" | ||
Create a new flag which can be used to synchronise a task with code running | ||
outside the asyncio loop, such as other threads, IRQs, or scheduler | ||
callbacks. Flags start in the cleared state. | ||
""" | ||
|
||
def set(self) -> None: | ||
""" | ||
Set the flag. If there is a task waiting on the flag, it will be scheduled | ||
to run. | ||
""" | ||
... | ||
|
||
def set(self, *args, **kwargs) -> Incomplete: ... | ||
def ioctl(self, *args, **kwargs) -> Incomplete: ... | ||
def clear(self) -> None: | ||
""" | ||
Clear the flag. This may be used to ensure that a possibly previously-set | ||
flag is clear before waiting for it. | ||
""" | ||
... | ||
def clear(self, *args, **kwargs) -> Incomplete: ... | ||
|
||
wait: Generator ## = <generator> | ||
def __init__(self, *argv, **kwargs) -> None: ... | ||
|
||
class Event: | ||
""" | ||
Create a new event which can be used to synchronise tasks. Events start | ||
in the cleared state. | ||
""" | ||
|
||
def set(self) -> None: | ||
""" | ||
Set the event. Any tasks waiting on the event will be scheduled to run. | ||
Note: This must be called from within a task. It is not safe to call this | ||
from an IRQ, scheduler callback, or other thread. See `ThreadSafeFlag`. | ||
""" | ||
... | ||
|
||
def is_set(self) -> bool: | ||
""" | ||
Returns ``True`` if the event is set, ``False`` otherwise. | ||
""" | ||
... | ||
def set(self, *args, **kwargs) -> Incomplete: ... | ||
def is_set(self, *args, **kwargs) -> Incomplete: ... | ||
def clear(self, *args, **kwargs) -> Incomplete: ... | ||
|
||
def clear(self) -> None: | ||
""" | ||
Clear the event. | ||
""" | ||
... | ||
wait: Generator ## = <generator> | ||
def __init__(self, *argv, **kwargs) -> None: ... |
Oops, something went wrong.