Skip to content

Commit

Permalink
Add stubs for v.24.1, stm32,rp2,esp32,samd
Browse files Browse the repository at this point in the history
Signed-off-by: Jos Verlinde <Jos.Verlinde@microsoft.com>
  • Loading branch information
Josverl committed Dec 26, 2024
1 parent ffac761 commit e7f8c39
Show file tree
Hide file tree
Showing 2,056 changed files with 209,526 additions and 12,587 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Core functions
Module: '_asyncio' 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 _typeshed import Incomplete
from typing import Any, Coroutine, List, Tuple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Module: '_onewire' 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 _typeshed import Incomplete

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,12 @@ Supported format codes: ``b``, ``B``, ``h``, ``H``, ``i``, ``I``, ``l``,
``L``, ``q``, ``Q``, ``f``, ``d`` (the latter 2 depending on the
floating-point support).
---
Efficient arrays of numeric data.
MicroPython module: https://docs.micropython.org/en/v1.24.0/library/array.html
CPython module: :mod:`python:array` https://docs.python.org/3/library/array.html .
Supported format codes: ``b``, ``B``, ``h``, ``H``, ``i``, ``I``, ``l``,
``L``, ``q``, ``Q``, ``f``, ``d`` (the latter 2 depending on the
floating-point support).
---
Module: 'array' 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 _typeshed import Incomplete
from typing import Any, List, Optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Core functions
Module: 'asyncio.__init__' 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 _typeshed import Incomplete
Expand Down
Original file line number Diff line number Diff line change
@@ -1,174 +1,42 @@
"""
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.core' 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

_exc_context: dict = {}

def ticks(*args, **kwargs) -> Incomplete: ...
def create_task(coro) -> Task:
"""
Create a new task from the given coroutine and schedule it to run.
Returns the corresponding `Task` object.
"""
...

def create_task(*args, **kwargs) -> Incomplete: ...
def _promote_to_task(*args, **kwargs) -> Incomplete: ...
def ticks_diff(*args, **kwargs) -> Incomplete: ...
def run(coro) -> Incomplete:
"""
Create a new task from the given coroutine and run it until it completes.
Returns the value returned by *coro*.
"""
...

def run(*args, **kwargs) -> Incomplete: ...
def run_until_complete(*args, **kwargs) -> Incomplete: ...
def current_task() -> Task:
"""
Return the `Task` object associated with the currently running task.
"""
...

def new_event_loop() -> Incomplete:
"""
Reset the event loop and return it.
Note: since MicroPython only has a single event loop this function just
resets the loop's state, it does not create a new one.
"""
...

def get_event_loop() -> Incomplete:
"""
Return the event loop used to schedule and run tasks. See `Loop`.
"""
...

def sleep_ms(t) -> Coroutine[Incomplete, Any, Any]:
"""
Sleep for *t* milliseconds.
This is a coroutine, and a MicroPython extension.
"""
...

def current_task(*args, **kwargs) -> Incomplete: ...
def new_event_loop(*args, **kwargs) -> Incomplete: ...
def get_event_loop(*args, **kwargs) -> Incomplete: ...
def sleep_ms(*args, **kwargs) -> Incomplete: ...
def ticks_add(*args, **kwargs) -> Incomplete: ...
def sleep(t) -> Coroutine[Incomplete, Any, Any]:
"""
Sleep for *t* seconds (can be a float).
This is a coroutine.
"""
...
def sleep(*args, **kwargs) -> Incomplete: ...

cur_task: Incomplete ## <class 'NoneType'> = None
_task_queue: Incomplete ## <class 'TaskQueue'> = <TaskQueue>

class Loop:
"""
This represents the object which schedules and runs tasks. It cannot be
created, use `get_event_loop` instead.
"""

def get_exception_handler(self) -> None:
"""
Get the current exception handler. Returns the handler, or ``None`` if no
custom handler is set.
"""
...

def default_exception_handler(self, context) -> Incomplete:
"""
The default exception handler that is called.
"""
...

def set_exception_handler(self, handler) -> None:
"""
Set the exception handler to call when a Task raises an exception that is not
caught. The *handler* should accept two arguments: ``(loop, context)``.
"""
...
def get_exception_handler(self, *args, **kwargs) -> Incomplete: ...
def default_exception_handler(self, *args, **kwargs) -> Incomplete: ...
def set_exception_handler(self, *args, **kwargs) -> Incomplete: ...
def run_forever(self, *args, **kwargs) -> Incomplete: ...
def run_until_complete(self, *args, **kwargs) -> Incomplete: ...
def stop(self, *args, **kwargs) -> Incomplete: ...
def close(self, *args, **kwargs) -> Incomplete: ...
def create_task(self, *args, **kwargs) -> Incomplete: ...
def call_exception_handler(self, *args, **kwargs) -> Incomplete: ...

def run_forever(self) -> Incomplete:
"""
Run the event loop until `stop()` is called.
"""
...

def run_until_complete(self, awaitable) -> Incomplete:
"""
Run the given *awaitable* until it completes. If *awaitable* is not a task
then it will be promoted to one.
"""
...

def stop(self) -> None:
"""
Stop the event loop.
"""
...

def close(self) -> None:
"""
Close the event loop.
"""
...

def create_task(self, coro) -> Task:
"""
Create a task from the given *coro* and return the new `Task` object.
"""
...

def call_exception_handler(self, context) -> Incomplete:
"""
Call the current exception handler. The argument *context* is passed through and
is a dictionary containing keys: ``'message'``, ``'exception'``, ``'future'``.
"""
...
_exc_handler: Incomplete ## <class 'NoneType'> = None
def __init__(self, *argv, **kwargs) -> None: ...

Expand All @@ -182,14 +50,6 @@ class TaskQueue:
def __init__(self, *argv, **kwargs) -> None: ...

class Task:
"""
This object wraps a coroutine into a running task. Tasks can be waited on
using ``await task``, which will wait for the task to complete and return
the return value of the task.
Tasks should not be created directly, rather use `create_task` to create them.
"""

def __init__(self, *argv, **kwargs) -> None: ...

class TimeoutError(Exception): ...
Expand Down
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: ...
Loading

0 comments on commit e7f8c39

Please sign in to comment.