Sfoglia il codice sorgente

【删除】不在此仓库同步的自动补全代码

SummerGift 6 anni fa
parent
commit
2d2fad6811

+ 0 - 8
docs/code-completion/_thread.py

@@ -1,8 +0,0 @@
-"""
-_thread 模块提供了用于处理多线程的基本方法——多个控制线程共享它们的全局数据空间。
-为了实现同步,提供了简单的锁(也称为互斥锁或二进制信号量)。
-"""
-
-def start_new_thread(testThread) -> None:
-    """start_new_thread(testThread, ())"""
-    ...

+ 0 - 49
docs/code-completion/array.py

@@ -1,49 +0,0 @@
-"""
-array 模块定义了一个对象类型,它可以简洁地表示基本值的数组:字符、整数、浮点数。支持代码格式: b, B, h, H, i, I, l, L, q, Q, f, d (最后2个需要支持浮点数)。
-"""
-
-class array(object):
-    def __init__(self) -> None:
-    """
-    用给定类型的元素创建数组。数组的初始内容由 iterable 提供,如果没有提供,则创建一个空数组。
-    typecode:数组的类型
-    iterable:数组初始内容
-    示例:
-
-    - import array
-    - a = array.array('i', [2, 4, 1, 5])'
-    - b = array.array('f')
-    - print(a)
-    - array('i', [2, 4, 1, 5])
-    - print(b)
-    - array('f')
-    """
-    ...
-
-    def append(self, val) -> None:
-        """
-        将一个新元素追加到数组的末尾。
-        示例:
-
-        - a = array.array('f', [3, 6])
-        - print(a)
-        - array('f', [3.0, 6.0])
-        - a.append(7.0)
-        - print(a)
-        - array('f', [3.0, 6.0, 7.0])
-        """
-        ...
-
-    def extend(self, iterable) -> None:
-        """
-        将一个新的数组追加到数组的末尾,注意追加的数组和原来数组的数据类型要保持一致。
-        示例:
-
-        - a = array.array('i', [1, 2, 3])
-        - b = array.array('i', [4, 5])
-        - a.extend(b)
-        - print(a)
-        - array('i', [1, 2, 3, 4, 5])
-        """
-        ...
-

+ 0 - 43
docs/code-completion/cmath.py

@@ -1,43 +0,0 @@
-"""
-cmath 模块提供了对复数的数学函数的访问。这个模块中的函数接受整数、浮点数或复数作为参数。他们还将接受任何有复数或浮点方法的 Python 对象:这些方法分别用于将对象转换成复数或浮点数,然后将该函数应用到转换的结果中。
-"""
-
-e = ...  # type: int
-pi = ...  # type: int
-
-def cos(z) -> None:
-    """返回z的余弦。"""
-    ...
-
-def exp(z) -> None:
-    """返回z的指数。"""
-    ...
-
-def log(z) -> None:
-    """返回z的对数。"""
-    ...
-
-def log10(z) -> None:
-    """返回z的常用对数。"""
-    ...
-
-def phase(z) -> None:
-    """返回z的相位, 范围是(-pi, +pi],以弧度表示。"""
-    ...
-
-def polar(z) -> None:
-    """返回z的极坐标。"""
-    ...
-
-def rect(r, phi) -> None:
-    """返回模量r和相位phi的复数。"""
-    ...
-
-def sin(z) -> None:
-    """返回z的正弦。"""
-    ...
-
-def sqrt(z) -> None:
-    """返回z的平方根。"""
-    ...
-

+ 0 - 23
docs/code-completion/gc.py

@@ -1,23 +0,0 @@
-"""
-gc 模块提供了垃圾收集器的控制接口。
-"""
-
-def enable() -> None:
-    """允许自动回收内存碎片。"""
-    ...
-
-def disable() -> None:
-    """禁止自动回收,但可以通过collect()函数进行手动回收内存碎片。"""
-    ...
-
-def collect() -> None:
-    """运行一次垃圾回收。"""
-    ...
-
- def mem_alloc() -> None:
-    """返回已分配的内存数量。"""
-    ...
-
-def mem_free() -> None:
-    """返回剩余的内存数量。"""
-    ...

+ 0 - 965
docs/code-completion/machine.py

@@ -1,965 +0,0 @@
-"""The ``machine`` module contains specific functions related to the hardware
-on a particular board. Most functions in this module allow to achieve
-direct and unrestricted access to and control of hardware blocks on a
-system (like CPU, timers, buses, etc.). Used incorrectly, this can
-lead to malfunction, lockups, crashes of your board, and in extreme
-cases, hardware damage.
-
-A note of callbacks used by functions and class methods of machine
-module: all these callbacks should be considered as executing in an
-interrupt context. This is true for both physical devices with
-IDs >= 0 and “virtual” devices with negative IDs like -1 (these
-“virtual” devices are still thin shims on top of real hardware
-and real hardware interrupts).
-"""
-
-
-from typing import Callable, Optional, Collection, Union, Any
-
-
-IDLE = ...  # type: int
-SLEEP = ...  # type: int
-DEEPSLEEP = ...  # type: int
-
-PWRON_RESET = ...  # type: int
-HARD_RESET = ...  # type: int
-WDT_RESET = ...  # type: int
-DEEPSLEEP_RESET = ...  # type: int
-PIN_WAKE = ...  # type: int
-RTC_WAKE = ... # type: int
-
-
-class Pin(object):
-    """A pin object is used to control I/O pins (also known as GPIO - general-purpose
-input/output).  Pin objects are commonly associated with a physical pin that can
-drive an output voltage and read input voltages.  The pin class has methods to set the mode of
-the pin (IN, OUT, etc) and methods to get and set the digital logic level.
-For analog control of a pin, see the :class:`ADC` class.
-
-A pin object is constructed by using an identifier which unambiguously
-specifies a certain I/O pin.  The allowed forms of the identifier and the
-physical pin that the identifier maps to are port-specific.  Possibilities
-for the identifier are an integer, a string or a tuple with port and pin
-number.
-
-Usage Model::
-
-    from machine import Pin
-
-    # create an output pin on pin #0
-    p0 = Pin(0, Pin.OUT)
-
-    # set the value low then high
-    p0.value(0)
-    p0.value(1)
-
-    # create an input pin on pin #2, with a pull up resistor
-    p2 = Pin(2, Pin.IN, Pin.PULL_UP)
-
-    # read and print the pin value
-    print(p2.value())
-
-    # reconfigure pin #0 in input mode
-    p0.mode(p0.IN)
-
-    # configure an irq callback
-    p0.irq(lambda p:print(p))
-    """
-
-    IRQ_FALLING = ...  # type: int
-    IRQ_RISING = ...  # type: int
-    IRQ_LOWLEVEL = ...  # type: int
-    IRQ_HIGHLEVEL = ...  # type: int
-    IN = ...  # type: int
-    OUT = ...  # type: int
-    OPEN_DRAIN = ...  # type: int
-    PULL_UP = ...  # type: int
-    PULL_DOWN = ...  # type: int
-    LOW_POWER = ...  # type: int
-    MED_POWER = ...  # type: int
-    HIGH_POWER = ...  # type: int
-    OUT_PP = ...  # type: int
-    OUT_OD = ...  # type: int
-
-    def __init__(self, id: Any, mode: int = -1, pull: int = -1, *,
-                 value: Optional[int] = None,
-                 drive: Optional[int] = None,
-                 alt: Optional[int] = None) -> None:
-        """Access the pin peripheral (GPIO pin) associated with the given ``id``.  If
-   additional arguments are given in the constructor then they are used to initialise
-   the pin.  Any settings that are not specified will remain in their previous state.
-
-   The arguments are:
-
-     - ``id`` is mandatory and can be an arbitrary object.  Among possible value
-       types are: int (an internal Pin identifier), str (a Pin name), and tuple
-       (pair of [port, pin]).
-
-     - ``mode`` specifies the pin mode, which can be one of:
-
-       - ``Pin.IN`` - Pin is configured for input.  If viewed as an output the pin
-         is in high-impedance state.
-
-       - ``Pin.OUT`` - Pin is configured for (normal) output.
-
-       - ``Pin.OPEN_DRAIN`` - Pin is configured for open-drain output. Open-drain
-         output works in the following way: if the output value is set to 0 the pin
-         is active at a low level; if the output value is 1 the pin is in a high-impedance
-         state.  Not all ports implement this mode, or some might only on certain pins.
-
-       - ``Pin.ALT`` - Pin is configured to perform an alternative function, which is
-         port specific.  For a pin configured in such a way any other Pin methods
-         (except :meth:`Pin.init`) are not applicable (calling them will lead to undefined,
-         or a hardware-specific, result).  Not all ports implement this mode.
-
-       - ``Pin.ALT_OPEN_DRAIN`` - The Same as ``Pin.ALT``, but the pin is configured as
-         open-drain.  Not all ports implement this mode.
-
-     - ``pull`` specifies if the pin has a (weak) pull resistor attached, and can be
-       one of:
-
-       - ``None`` - No pull up or down resistor.
-       - ``Pin.PULL_UP`` - Pull up resistor enabled.
-       - ``Pin.PULL_DOWN`` - Pull down resistor enabled.
-
-     - ``value`` is valid only for Pin.OUT and Pin.OPEN_DRAIN modes and specifies initial
-       output pin value if given, otherwise the state of the pin peripheral remains
-       unchanged.
-
-     - ``drive`` specifies the output power of the pin and can be one of: ``Pin.LOW_POWER``,
-       ``Pin.MED_POWER`` or ``Pin.HIGH_POWER``.  The actual current driving capabilities
-       are port dependent.  Not all ports implement this argument.
-
-     - ``alt`` specifies an alternate function for the pin and the values it can take are
-       port dependent.  This argument is valid only for ``Pin.ALT`` and ``Pin.ALT_OPEN_DRAIN``
-       modes.  It may be used when a pin supports more than one alternate function.  If only
-       one pin alternate function is supported the this argument is not required.  Not all
-       ports implement this argument.
-
-   As specified above, the Pin class allows to set an alternate function for a particular
-   pin, but it does not specify any further operations on such a pin.  Pins configured in
-   alternate-function mode are usually not used as GPIO but are instead driven by other
-   hardware peripherals.  The only operation supported on such a pin is re-initialising,
-   by calling the constructor or :meth:`Pin.init` method.  If a pin that is configured in
-   alternate-function mode is re-initialised with ``Pin.IN``, ``Pin.OUT``, or
-   ``Pin.OPEN_DRAIN``, the alternate function will be removed from the pin.        """
-        ...
-
-    def init(self, value: int, drive: int, alt: int, mode: int = -1, pull: int = -1) -> None:
-        """Re-initialise the pin using the given parameters. Only those arguments
-        that are specified will be set. The rest of the pin peripheral state
-        will remain unchanged. See the constructor documentation for details
-        of the arguments.
-
-        :param value: Initial output pin value.
-        :param drive: Output power of the pin.
-        :param alt: Alternate function for the pin.
-        :param mode: Pin mode.
-        :param pull: Flag that specifies if the pin has a (weak) pull resistor attached.
-        """
-        ...
-
-    def value(self, x: Optional[int] = None) -> Optional[int]:
-        """This method allows to set and get the value of the pin, depending on
-        whether the argument **x** is supplied or not.
-
-        If the argument is omitted then this method gets the digital logic
-        level of the pin, returning 0 or 1 corresponding to low and high
-        voltage signals respectively. The behaviour of this method depends
-        on the mode of the pin:
-
-        * ``Pin.IN`` - The method returns the actual input value currently present on the pin.
-        * ``Pin.OUT`` - The behaviour and return value of the method is undefined.
-        * ``Pin.OPEN_DRAIN`` - If the pin is in state ‘0’ then the behaviour and return value of the method is undefined. Otherwise, if the pin is in state ‘1’, the method returns the actual input value currently present on the pin.
-
-        :param x: Value to set on a pin.
-        :return: Current value of a pin.
-        """
-        ...
-
-    def __call__(self, x: Optional[int]) -> Optional[int]:
-        """Pin objects are callable. The call method provides a (fast) shortcut
-        to set and get the value of the pin. It is equivalent to
-        Pin.value([x]). See ``Pin.value()`` for more details.
-
-        :param x: Value to set on a pin.
-        :return: Current value of a pin.
-        """
-        ...
-
-    def on(self) -> None:
-        """Set pin to “1” output level."""
-        ...
-
-    def off(self) -> None:
-        """Set pin to “0” output level."""
-        ...
-
-    def mode(self, mode: Optional[int]) -> Optional[int]:
-        """Get or set the pin mode.
-
-        **mode** can be one of following values:
-
-        * ``Pin.IN`` - Pin is configured for input. If viewed as an output the pin is in high-impedance state.
-
-        * ``Pin.OUT`` - Pin is configured for (normal) output.
-
-        * ``Pin.OPEN_DRAIN`` - Pin is configured for open-drain output. Open-drain output works in the following way: if the output value is set to 0 the pin is active at a low level; if the output value is 1 the pin is in a high-impedance state. Not all ports implement this mode, or some might only on certain pins.
-
-        * ``Pin.ALT`` - Pin is configured to perform an alternative function, which is port specific. For a pin configured in such a way any other Pin methods (except Pin.init()) are not applicable (calling them will lead to undefined, or a hardware-specific, result). Not all ports implement this mode.
-
-        * ``Pin.ALT_OPEN_DRAIN`` - The Same as Pin.ALT, but the pin is configured as open-drain. Not all ports implement this mode.
-
-        :param mode: Mode to be set on a pin.
-        :return: Current mode on a pin.
-        """
-        ...
-
-    def pull(self, pull: Optional[int]) -> Optional[int]:
-        """Get or set the pin pull state.
-
-        *pull* can be one of following values:
-
-        * ``None`` - No pull up or down resistor.
-        * ``Pin.PULL_UP`` - Pull up resistor enabled.
-        * ``Pin.PULL_DOWN`` - Pull down resistor enabled.
-
-        :param pull: Pull state.
-        :return: Current pull state.
-        """
-        ...
-
-    def irq(self, handler: Callable[[Pin], Any] = None, trigger: int = (IRQ_FALLING | IRQ_RISING),
-            priority: int = 1, wake: int = None) -> Callable[[Pin], Any]:
-        """
-        Configure an interrupt handler to be called when the trigger source
-        of the pin is active.
-
-        If the pin mode is ``Pin.IN`` then the trigger
-        source is the external value on the pin.
-
-        If the pin mode is ``Pin.OUT`` then the trigger source is the output
-        buffer of the pin.
-
-        if the pin mode is ``Pin.OPEN_DRAIN`` then the trigger source is the
-        output buffer for state ‘0’ and the external pin value for state ‘1’.
-
-        Possible values for ``wake``:
-
-        * ``machine.IDLE``
-        * ``machine.SLEEP``
-        * ``machine.DEEPSLEEP``
-
-        Possible values for ``trigger``:
-
-        * ``Pin.IRQ_FALLING`` - interrupt on falling edge.
-        * ``Pin.IRQ_RISING`` - interrupt on rising edge.
-        * ``Pin.IRQ_LOW_LEVEL`` - interrupt on low level.
-        * ``Pin.IRQ_HIGH_LEVEL`` - interrupt on high level.
-
-        These values can be OR’ed together to trigger on multiple events.
-
-        :param handler: Interrupt handler.
-        :param trigger: Event which can generate an interrupt
-        :param priority: Priority level of the interrupt
-        :param wake: Power mode in which this interrupt can wake up the system
-        :return: Callback object.
-        """
-        ...
-
-
-# class Signal(object):
-#     def __init__(self, pin_obj: Pin, invert: bool = False) -> None:
-#         """Create a Signal object.
-
-#         :param pin_obj: Existing Pin object.
-#         :param invert: If True, the signal will be inverted (active low).
-#         """
-#         ...
-
-#     def value(self, x: Optional[bool]) -> None:
-#         """This method allows to set and get the value of the signal, depending
-#         on whether the argument x is supplied or not.
-
-#         If the argument is omitted then this method gets the signal level, 1
-#         meaning signal is asserted (active) and 0 - signal inactive.
-
-#         If the argument is supplied then this method sets the signal level.
-#         The argument x can be anything that converts to a boolean. If it
-#         converts to True, the signal is active, otherwise it is inactive.
-
-#         Correspondence between signal being active and actual logic level
-#         on the underlying pin depends on whether signal is inverted
-#         (active-low) or not. For non-inverted signal, active status
-#         corresponds to logical 1, inactive - to logical 0. For
-#         inverted/active-low signal, active status corresponds to
-#         logical 0, while inactive - to logical 1.
-
-#         :param x: Signal level (active or not).
-#         :return: Signal level.
-#         :rtype: int
-#         """
-#         ...
-
-#     def on(self) -> None:
-#         """Activate signal."""
-#         ...
-
-#     def off(self) -> None:
-#         """Deactivate signal."""
-#         ...
-
-
-class UART(object):
-    def __init__(self, id: int, baudrate: int = 115200) -> None:
-        """Init UART object with a given baudrate.
-
-        :param id: ID of UART "object" (either 0 or 1).
-        :param baudrate: Rate of data transfer.
-        """
-
-    def init(self, baudrate: int, bits: int = 8, parity: Optional[int] = 0, stop: int = 1,
-             timeout: int = 0, timeout_char: int = 0) -> None:
-        """Init with a given parameters.
-
-        :param baudrate: Baud rate, that specifies how fast data is sent over serial line.
-        :param bits: Bit length of data packet (can be 7, 8 or 9 depending on parity).
-        :param parity: Number of parity bits (can be 0 or 1).
-        :param stop: Length of stop bit (can be 1 or 2).
-        :param timeout: Timeout waiting for first char (in ms).
-        :param timeout_char: Timeout waiting between chars (in ms).
-        """
-        ...
-
-    def deinit(self) -> None:
-        """Turn off the UART bus."""
-        ...
-
-    def any(self) -> int:
-        """Returns an integer counting the number of characters that can be read
-        without blocking. It will return 0 if there are no characters
-        available and a positive number if there are characters. The method
-        may return 1 even if there is more than one character available for reading.
-
-        :return: Number of characters that can be read without blocking.
-        """
-        ...
-
-    def read(self, nbytes: Optional[int] = None) -> bytes:
-        """Read characters. If ``nbytes`` is specified then read at most that many
-        bytes, otherwise read as much data as possible.
-
-        :param nbytes: Upper limit on number of read characters.
-        :return: Bytes read in.
-        """
-        ...
-
-    def readinto(self, buf: bytearray, nbytes: Optional[int]) -> Optional[int]:
-        """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
-        that many bytes. Otherwise, read at most ``len(buf)`` bytes.
-
-        :param buf: Buffer for holding read data.
-        :param nbytes: Upper limit on number of read characters.
-        :return: Number of bytes read in.
-        """
-        ...
-
-    def readline(self) -> Optional[bytes]:
-        """Read a line, ending in a newline character.
-
-        :return: The line read or ``None`` on timeout.
-        """
-        ...
-
-    def write(self, buf: bytearray) -> Optional[int]:
-        """
-        Write the buffer of bytes to the bus.
-
-        :param buf: Data that needs to be written.
-        :return: Number of bytes written or ``None`` on timeout.
-        """
-        ...
-
-    def sendbreak(self) -> None:
-        """
-        Send a break condition on the bus. This drives the bus low for a
-        duration longer than required for a normal transmission of a character.
-        """
-
-
-class SPI(object):
-
-    LSB = ...  # type: int
-    MSB = ...  # type: int
-
-    def __init__(self, id: int, baudrate: int = 1000000, polarity: int = 0, phase: int = 0,
-             bits: int = 8, firstbit: int = MSB, sck: Optional[Pin] = None,
-             mosi: Optional[Pin] = None, miso: Optional[Pin] = None) -> None:
-        """
-        Construct an SPI object on the given bus, ``id``. Values of id depend
-        on a particular port and its hardware. Values 0, 1, etc. are commonly
-        used to select hardware SPI block #0, #1, etc. Value -1 can be used
-        for bitbanging (software) implementation of SPI (if supported by a port).
-
-        With no additional parameters, the SPI object is created but not
-        initialised (it has the settings from the last initialisation of
-        the bus, if any). If extra arguments are given, the bus is
-        initialised. See init for parameters of initialisation.
-
-        :param id: Bus ID.
-        """
-        ...
-
-    def init(self, baudrate: int = 1000000, polarity: int = 0, phase: int = 0,
-             bits: int = 8, firstbit: int = MSB, sck: Optional[Pin] = None,
-             mosi: Optional[Pin] = None, miso: Optional[Pin] = None) -> None:
-        """
-        Initialise the SPI bus with the given parameters.
-
-        :param baudrate: SCK clock rate.
-        :param polarity: Level the idle clock line sits at (0 or 1).
-        :param phase: Sample data on the first or second clock edge respectively (0 or 1).
-        :param bits: Width in bits of each transfer.
-        :param firstbit: Can be ``SPI.MSB`` or ``SPI.LSB``.
-        :param sck: SCK pin.
-        :param mosi: MOSI pin.
-        :param miso: MISO pin.
-        """
-        ...
-
-    def deinit(self) -> None:
-        """Turn off the SPI bus."""
-        ...
-
-    def read(self, nbytes: int, write: int = 0x00) -> bytes:
-        """Read a number of bytes specified by ``nbytes`` while continuously
-        writing the single byte given by ``write``. Returns a ``bytes``
-        object with the data that was read.
-
-        :param nbytes: Number of characters to read.
-        :param write: Value to continiously write while reading data.
-        :return: Bytes read in.
-        """
-        ...
-
-    def readinto(self, buf: bytearray, write: int = 0x00) -> None:
-        """Read into the buffer specified by ``buf`` while continuously writing
-        the single byte given by ``write``.
-        """
-        ...
-
-    def write(self, buf: bytes) -> None:
-        """Write the bytes contained in ``buf``.
-
-        :param buf: Bytes to write.
-        """
-        ...
-
-    def write_readinto(self, write_buf: bytearray, read_buf: bytearray) -> None:
-        """Write the bytes from ``write_buf`` while reading into ``read_buf``. The
-        buffers can be the same or different, but both buffers must have
-        the same length.
-
-        :param write_buf: Buffer to read data into.
-        :param read_buf: Buffer to write data from.
-        """
-        ...
-
-
-class I2C(object):
-    def __init__(self, id: int, scl: Pin = None, sda: Pin = None, freq: int = 400000) -> None:
-        """Construct and return a new I2C object.
-
-        :param id: Particular I2C peripheral (-1 for software implementation).
-        :param scl: Pin object specifying the pin to use for SCL.
-        :param sda: Pin object specifying the pin to use for SDA.
-        :param freq: Maximum frequency for SCL.
-        """
-        ...
-
-    def init(self, scl: Pin, sda: Pin, *, freq: int = 400000) -> None:
-        """
-        Initialise the I2C bus with the given arguments.
-
-        :param scl: Pin object specifying the pin to use for SCL.
-        :param sda: Pin object specifying the pin to use for SDA.
-        :param freq: Maximum frequency for SCL.
-        """
-        ...
-
-    def scan(self) -> Collection[int]:
-        """Scan all I2C addresses between *0x08* and *0x77* inclusive and return a
-        list of those that respond. A device responds if it pulls the SDA
-        line low after its address (including a write bit) is sent on the bus.
-        """
-        ...
-
-    def start(self) -> None:
-        """Generate a START condition on the bus (SDA transitions to low while SCL is high)."""
-        ...
-
-    def stop(self) -> None:
-        """Generate a STOP condition on the bus (SDA transitions to high while SCL is high)."""
-        ...
-
-    def readinto(self, buf: bytearray, nack: bool = True) -> None:
-        """Reads bytes from the bus and stores them into ``buf``. The number of bytes
-        read is the length of ``buf``. An **ACK** will be sent on the bus after
-        receiving all but the last byte. After the last byte is received,
-        if ``nack`` is true then a **NACK** will be sent, otherwise an **ACK** will be
-        sent (and in this case the slave assumes more bytes are going to be
-        read in a later call).
-
-        :param buf: Buffer to read bytes into.
-        :param nack: If true, then NACK will be sent after reading last bytes.
-        """
-        ...
-
-    def write(self, buf: bytearray) -> None:
-        """Write the bytes from ``buf`` to the bus. Checks that an **ACK** is received
-        after each byte and stops transmitting the remaining bytes if a
-        **NACK** is received. The function returns the number of ACKs that
-        were received.
-
-        :param buf: Buffer to write bytes from.
-        """
-
-    def readfrom(self, addr: int, nbytes: int, stop: bool = True) -> bytes:
-        """Read ``nbytes`` from the slave specified by ``addr``.
-
-        :param addr: Address of slave device.
-        :param nbytes: Maximum amount of bytes to be read.
-        :param stop: If true, then STOP condition is generated at the end of the transfer.
-        :return: Data read.
-        """
-        ...
-
-    def readfrom_into(self, addr: int, buf: bytearray, stop: bool = True) -> None:
-        """Read into ``buf`` from the slave specified by ``addr``. The number of
-        bytes read will be the length of buf. If ``stop`` is true then a **STOP**
-        condition is generated at the end of the transfer.
-
-        :param addr: Address of slave device.
-        :param buf: Buffer for storing read data.
-        :param stop: If true, then STOP condition is generated at the end of the transfer.
-        """
-        ...
-
-    def writeto(self, addr: int, buf: bytearray, stop: bool = True) -> None:
-        """Write the bytes from ``buf`` to the slave specified by ``addr``. If a **NACK** is
-        received following the write of a byte from buf then the remaining
-        bytes are not sent. If stop is true then a **STOP** condition is generated
-        at the end of the transfer, even if a **NACK** is received.
-
-        :param addr: Address of slave device.
-        :param buf: Buffer to write data from.
-        :param stop: If true, then STOP condition is generated at the end of the transfer.
-        :return: Number of ACKs that were received.
-        """
-        ...
-
-    def readfrom_mem(self, addr: int, memaddr: int, addrsize: int = 8) -> bytes:
-        """Read ``nbytes`` from the slave specified by ``addr`` starting from the memory
-        address specified by ``memaddr``. The argument ``addrsize`` specifies the
-        address size in bits. Returns a bytes object with the data read.
-
-        :param addr: Address of slave device.
-        :param memaddr: Memory address location on a slave device to read from.
-        :param addrsize: Address size in bits.
-        :return: Data that has been read.
-        """
-        ...
-
-    def readfrom_mem_into(self, addr: int, memaddr: int, buf, *, addrsize=8) -> None:
-        """Read into ``buf`` from the slave specified by addr starting from the memory
-        address specified by ``memaddr``. The number of bytes read is the length
-        of ``buf``. The argument ``addrsize`` specifies the address size in bits
-        (on ESP8266 this argument is not recognised and the address size is
-        always 8 bits).
-
-        :param addr: Address of slave device.
-        :param memaddr: Memory address location on a slave device to write into.
-        :param buf: Buffer to store read data.
-        :param addrsize: Address size in bits.
-        """
-        ...
-
-    def writeto_mem(self, addr: int, memaddr: int, addrsize=8) -> None:
-        """Write ``buf`` to the slave specified by ``addr`` starting from the
-        memory address specified by ``memaddr``. The argument ``addrsize`` specifies
-        the address size in bits (on ESP8266 this argument is not recognised
-        and the address size is always 8 bits).
-
-        :param addr: Address of slave device.
-        :param memaddr: Memory address location on a slave device to write into.
-        :param addrsize: Address size in bits.
-        """
-        ...
-
-
-class RTC(object):
-    def __init__(self, id: int = 0) -> None:
-        """Create an RTC object.
-
-        :param id: ID of RTC device.
-        """
-        ...
-
-    def init(self, datetime: tuple) -> None:
-        """Initialise the RTC. Datetime is a tuple of the form:
-
-        ``(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])``
-
-        :param datetime: Tuple with information regarding desired initial date.
-        """
-        ...
-
-    def now(self) -> tuple:
-        """Get get the current datetime tuple.
-
-        :return: Current datetime tuple.
-        """
-        ...
-
-    def deinit(self) -> None:
-        """Resets the RTC to the time of January 1, 2015 and starts running it again."""
-        ...
-
-    def alarm(self, id: int, time: Union[int, tuple], *, repeat: bool = False) -> None:
-        """Set the RTC alarm. Time might be either a millisecond value to program the
-        alarm to current ``time + time_in_ms`` in the future, or a ``datetimetuple``.
-        If the ``time`` passed is in milliseconds, repeat can be set to True to
-        make the alarm periodic.
-
-        :param id: Alarm ID.
-        :param time: Either timestamp in milliseconds or datetime tuple, describing desired moment in the future.
-        :param repeat: Make alarm periodic, if time passed as milliseconds.
-        """
-        ...
-
-    def alarm_left(self, alarm_id: int = 0) -> int:
-        """
-        Get the number of milliseconds left before the alarm expires.
-
-        :param alarm_id: Alarm ID.
-        :return: Tumber of milliseconds left before the alarm expires.
-        :rtype: int
-        """
-        ...
-
-    def cancel(self, alarm_id: int = 0) -> None:
-        """
-        Cancel a running alarm.
-
-        :param alarm_id: Alarm ID.
-        """
-        ...
-
-    def irq(self, *, trigger: int, handler: Callable = None, wake: int = IDLE) -> None:
-        """
-        Create an irq object triggered by a real time clock alarm.
-
-        :param trigger: Must be ``RTC.ALARM0``.
-        :param handler: Function to be called when the callback is triggered.
-        :param wake: Sleep mode from where this interrupt can wake up the system.
-        """
-        ...
-
-    ALARM0 = ...  # type: int
-
-
-class Timer(object):
-    ONE_SHOT = ...  # type: int
-    PERIODIC = ...  # type: int
-
-    def __init__(self, id: int) -> None:
-        """
-        Construct a new timer object of the given id. Id of -1 constructs a
-        virtual timer (if supported by a board).
-
-        :param id: Timer ID.
-        """
-
-    def init(self, mode : Timer.PERIODIC, period : int, callback : func) -> None:
-        """
-        Init the timer. Start the timer, and enable the timer peripheral.
-        """
-        ...
-
-    def deinit(self) -> None:
-        """
-        Deinitialises the timer. Stops the timer, and disables the timer peripheral.
-        """
-        ...
-
-class ADC(object):
-    """
-    - id:使用的 ADC 设备编号,id = 1 表示编号为 1 的 ADC 设备;
-    - channel:使用的 ADC 设备通道号,每个 ADC 设备对应多个通道;
-    - 例如:ADC(1,4) 表示当前使用编号为 1 的 ADC 设备的 4 通道;
-    """
-
-    def __init__(self, id: int, channel: int) -> None:
-        """
-        """
-
-    def init(self, channel : int) -> None:
-        """
-        根据输入的层参数初始化 ADC 对象,入参为使用的 ADC 对象通道号;
-        """
-        ...
-
-    def deinit(self) -> None:
-        """
-        用于关闭 ADC 对象,ADC 对象 deinit 之后需要重新 init 才能使用。
-        """
-        ...
-
-    def read(self) -> None:
-        """
-        用于获取并返回当前 ADC 对象的采样值。例如当前采样值为 2048,对应设备的分辨率为 12位,当前设备参考电压为 3.3V ,则该 ADC 对象通道上实际电压值的计算公式为:采样值 * 参考电压  /  (1 <<  分辨率位数),即 vol = 2048 / 4096 * 3.3 V = 1.15V。
-        """
-        ...
-
-class PWM(object):
-    """
-    在给定的总线上构建一个 PWM 对象,参数介绍如下:
-
-    - id:使用的 PWM 设备编号,如  id = 1 表示编号为 1 的 PWM 设备;
-    - channel:使用的 PWM 设备通道号,每个 PWM 设备包含多个通道,范围为 [0, 4];
-    - freq:初始化频率,范围 [1, 156250];
-    - duty:初始化占空比数值,范围 [0 255];
-
-    例如:PWM(1,4,100,100) 表示当前使用 编号为 1 的 PWM 设备的 4 通道,初始化频率为 1000 Hz,初始化占空比的数值为 100。
-    """
-
-    def __init__(self, id: int, channel: int, freq: int, duty: int) -> None:
-        """
-        """
-
-    def init(self, channel : int, freq : int, duty : int) -> None:
-        """
-        根据输入的参数初始化 PWM 对象。
-        """
-        ...
-
-    def deinit(self) -> None:
-        """
-        用于关闭 PWM 对象,对象 deinit 之后需要重新 init 才能使用。
-        """
-        ...
-
-    def freq(self, freq : int = None)-> None:
-        """
-        用于获取或者设置 PWM 对象的频率,频率的范围为 [1, 156250]。如果参数为空,返回当前 PWM 对象的频率;如果参数非空,则使用该参数设置当前 PWM 对象的频率。
-        """
-        ...
-
-    def duty(self, duty : int = None) -> None:
-        """
-        用于获取或者设置 PWM 对象的占空比数值,占空比数值的范围为 [0, 255],例如 duty = 100,表示当前设备占空比为 100/255 = 39.22% 。如果参数为空,返回当前 PWM 对象的占空比数值;如果参数非空,则使用该参数设置当前 PWM 对象的占空比数值。
-        """
-        ...
-
-class LCD(object):
-    """
-    在给定总线上构造一个 LCD 对象,无入参,初始化的对象取决于特定硬件。
-    """
-
-    WHITE = ...  # type: int
-    BLACK = ...  # type: int 
-    BLUE  = ...  # type: int
-    BRED  = ...  # type: int
-    GRED  = ...  # type: int
-    GBLUE  = ...  # type: int
-    RED  = ...  # type: int
-    MAGENTA  = ...  # type: int
-    GREEN  = ...  # type: int
-    CYAN  = ...  # type: int
-    YELLOW  = ...  # type: int
-    BROWN  = ...  # type: int
-    BRRED  = ...  # type: int
-    GRAY = ...  # type: int 
-    GRAY175 = ...  # type: int 
-    GRAY151  = ...  # type: int
-    GRAY240 = ...  # type: int
-
-    def __init__(self) -> None:
-        """
-        """
-
-    def light(self, value : int) -> None:
-        """
-        控制是否开启 LCD 背光,入参为 True 则打开 LCD 背光,入参为 False 则关闭 LCD 背光。
-        """
-        ...
-
-    def fill(self, color : int) -> None:
-        """
-        根据给定的颜色填充整个屏幕,支持多种颜色,可以传入的参数有:
-
-        - WHITE BLACK BLUE BRED GRED GBLUE RED MAGENTA GREEN CYAN YELLOW BROWN BRRED GRAY GRAY175 GRAY151 GRAY240
-        """
-        ...
-
-    def pixel(self, x : int, y : int , color : int) -> None:
-        """
-        向指定的位置(x, y)画点,点的颜色为 color 指定的颜色,可指定的颜色和上一个功能相同。
-        注意:(x, y)  坐标的范围是 0 - 239,使用下面的方法对坐标进行操作时同样需要遵循此限制。
-        """
-        ...
-
-    def set_color(self, back_color : int, fore_color : int) -> None:
-        """
-        设置 LCD 屏幕的前景色和背景色。
-        """
-        ...
-
-
-    def text(self, input_str : str, x : int, y : int, size : int) -> None:
-        """
-        在指定的位置(x,y)写入字符串,字符串由 str 指定,字体的大小由 size 指定,size 的大小可为 16,24,32。
-        """
-        ...
-
-    def line(self, x1 : int, y1 : int, x2 : int, y2 : int) -> None:
-        """
-        在 LCD 上画一条直线,起始地址为 (x1, y1),终点为(x2, y2)。
-        """
-        ...
-
-    def rectangle(self, x1 : int, y1 : int, x2 : int, y2 : int) -> None:
-        """
-        在 LCD 上画一个矩形,左上角的位置为(x1, y1),右下角的位置为(x2, y2)。
-        """
-        ...
-
-    def circle(self, x1 : int, y1 : int, r : int) -> None:
-        """
-        在 LCD 上画一个圆形,圆心的位置为(x1, y1),半径长度为 r。。
-        """
-        ...
-
-
-class WDT(object):
-
-    def __init__(self, timeout : int) -> None:
-        """
-        Construct a new watchdog object.
-        """
-
-    def feed(self) -> None:
-        """
-        Perform the dog feed operation and clear the watchdog counter.
-        """
-        ...
-
-def reset() -> None:
-    """Resets the device in a manner similar to pushing the external RESET button."""
-    ...
-
-def reset_cause() -> int:
-    """Get the reset cause. Below are possible return values:
-
-    * ``machine.PWRON_RESET``
-    * ``machine.HARD_RESET``
-    * ``machine.WDT_RESET``
-    * ``machine.DEEPSLEEP_RESET``
-    * ``machine.SOFT_RESET``
-
-    :return: Reset cause.
-    :rtype: int
-    """
-    ...
-
-def disable_irq() -> int:
-    """Disable interrupt requests. Returns the previous IRQ state which should
-    be considered an opaque value. This return value should be passed to
-    the ``enable_irq`` function to restore interrupts to their original state,
-    before ``disable_irq`` was called.
-
-    :return: Previous IRQ state.
-    :rtype: int
-    """
-    ...
-
-def enable_irq(state: int) -> None:
-    """Re-enable interrupt requests. The state parameter should be the value
-    that was returned from the most recent call to the ``disable_irq`` function.
-
-    :param state: IRQ state, previously returned from ``disable_irq`` function.
-    """
-    ...
-
-def freq() -> int:
-    """
-    Returns CPU frequency in hertz.
-
-    :return: CPU frequency in hertz.
-    """
-
-def idle() -> None:
-    """Gates the clock to the CPU, useful to reduce power consumption at any time
-    during short or long periods. Peripherals continue working and execution
-    resumes as soon as any interrupt is triggered (on many ports this includes
-    system timer interrupt occurring at regular intervals on the order of millisecond).
-    """
-
-def sleep() -> None:
-    """Stops the CPU and disables all peripherals except for WLAN. Execution is
-    resumed from the point where the sleep was requested. For wake up to
-    actually happen, wake sources should be configured first.
-    """
-
-def deepsleep() -> None:
-    """Stops the CPU and all peripherals (including networking interfaces, if
-    any). Execution is resumed from the main script, just as with a reset.
-    The reset cause can be checked to know that we are coming from
-    ``machine.DEEPSLEEP``. For wake up to actually happen, wake
-    sources should be configured first, like Pin change or RTC timeout.
-    """
-
-def wake_reason() -> int:
-    """Get the wake reason. Possible values are:
-
-    * ``machine.WLAN_WAKE``
-    * ``machine.PIN_WAKE``
-    * ``machine.RTC_WAKE``
-
-    :return: Wake reason.
-    """
-    ...
-
-def unique_id() -> bytearray:
-    """
-    Returns a byte string with a unique identifier of a board/SoC. It will
-    vary from a board/SoC instance to another, if underlying hardware allows.
-    Length varies by hardware (so use substring of a full value if you expect
-    a short ID). In some MicroPython ports, ID corresponds to the network MAC address.
-    :return: Unique identifier of a board/SoC.
-    """
-    ...
-
-def time_pulse_us(pin: Pin, pulse_level: int, timeout_us: int = 1000000) -> int:
-    """
-    Time a pulse on the given pin, and return the duration of the pulse in
-    microseconds. The pulse_level argument should be 0 to time a low pulse
-    or 1 to time a high pulse.
-
-    If the current input value of the pin is different to pulse_level, the
-    function first (*) waits until the pin input becomes equal to pulse_level,
-    then (**) times the duration that the pin is equal to pulse_level. If the
-    pin is already equal to pulse_level then timing starts straight away.
-
-    The function will return **-2** if there was timeout waiting for condition marked
-    (*) above, and **-1** if there was timeout during the main measurement, marked (**)
-    above. The timeout is the same for both cases and given by timeout_us
-    (which is in microseconds).
-
-    :param pin: Pin for timing a pulse on.
-    :param pulse_level: Level of pulse (*1* for high, *0* for low)
-    :param timeout_us: Duration of wait for pin change conditions, in microsecond.
-    :return: Result code (-1 or -2)
-    """
-    ...
-

+ 0 - 234
docs/code-completion/math.py

@@ -1,234 +0,0 @@
-"""
-math 模块提供了对 C 标准定义的数学函数的访问。
-本模块需要带有硬件 FPU,精度是32位,这个模块需要浮点功能支持。
-"""
-
-e = ...  # type: int
-pi = ...  # type: int
-
-def acos(x) -> None:
-    """传入弧度值,计算cos(x)的反三角函数。"""
-    ...
-
-def acosh(x) -> None:
-    """返回 x 的逆双曲余弦。"""
-    ...
-
-def asin(x) -> None:
-    """传入弧度值,计算sin(x)的反三角函数。 示例:
-    - x = math.asin(0.5)
-    - print(x)
-    0.5235988"""
-    ...
-
-def asinh(x) -> None:
-    """返回 x 的逆双曲正弦。"""
-    ...
-
-def atan(x) -> None:
-    """返回 x 的逆切线。"""
-    ...
-
-def atan2(y, x) -> None:
-    """Return the principal value of the inverse tangent of y/x."""
-    ...
-
-def atanh(x) -> None:
-    """Return the inverse hyperbolic tangent of x."""
-    ...
-
-def ceil(x) -> None:
-    """向上取整。 示例:
-    - x = math.ceil(5.6454)
-    - print(x)
-    - 6
-    """
-    ...
-
-def copysign(x, y) -> None:
-    """Return x with the sign of y."""
-    ...
-
-def cos(x) -> None:
-    """传入弧度值,计算余弦。 示例:计算cos60°
-    - math.cos(math.radians(60))
-    - 0.5
-    """
-    ...
-
-def cosh(x) -> None:
-    """Return the hyperbolic cosine of x."""
-    ...
-
-def degrees(x) -> None:
-    """弧度转化为角度。 示例:
-    - x = math.degrees(1.047198)
-    - print(x)
-    - 60.00002"""
-    ...
-
-def erf(x) -> None:
-    """Return the error function of x."""
-    ...
-
-def erfc(x) -> None:
-    """Return the complementary error function of x."""
-    ...
-
-def exp(x) -> None:
-    """计算e的x次方(幂)。
-    示例:
-    - x = math.exp(2)
-    - print(x)
-    - 7.389056"""
-    ...
-
-def expm1(x) -> None:
-    """计算 math.exp(x) - 1。"""
-    ...
-
-def fabs(x) -> None:
-    """计算绝对值。 示例:
-    - x = math.fabs(-5)
-    - print(x)
-    - 5.0
-    - y = math.fabs(5.0)
-    - print(y)
-    - 5.0
-    """
-    ...
-
-def floor(x) -> None:
-    """向下取整。 示例:
-    - x = math.floor(2.99)
-    - print(x)
-    2
-    - y = math.floor(-2.34)
-    - print(y)
-    -3
-    """
-    ...
-
-def fmod(x, y) -> None:
-    """取x除以y的模。 示例:
-    - x = math.fmod(4, 5)
-    - print(x)
-    4.0
-    """
-    ...
-
-def frexp(x) -> None:
-    """Decomposes a floating-point number into its mantissa and exponent. The returned value is the tuple (m, e) such that x == m * 2**e exactly. If x == 0 then the function returns (0.0, 0), otherwise the relation 0.5 <= abs(m) < 1 holds."""
-    ...
-
-def gamma(x) -> None:
-    """返回伽马函数。 示例:
-    - x = math.gamma(5.21)
-    - print(x)
-    33.08715。
-    """
-    ...
-
-def isfinite(x) -> None:
-    """Return True if x is finite."""
-    ...
-
-def isinf(x) -> None:
-    """Return True if x is infinite."""
-    ...
-
-def isnan(x) -> None:
-    """Return True if x is not-a-number"""
-    ...
-
-def ldexp(x, exp) -> None:
-    """Return x * (2**exp)."""
-    ...
-
-def lgamma(x) -> None:
-    """返回伽马函数的自然对数。 示例:
-    - x = math.lgamma(5.21)
-    - print(x)
-    3.499145"""
-    ...
-
-def log(x) -> None:
-    """计算以e为底的x的对数。 示例:
-    - x = math.log(10)
-    - print(x)
-    2.302585"""
-    ...
-
-def log10(x) -> None:
-    """计算以10为底的x的对数。 示例:
-    - x = math.log10(10)
-    - print(x)
-    1.0"""
-    ...
-
-def log2(x) -> None:
-    """计算以2为底的x的对数。 示例:
-    - x = math.log2(8)
-    - print(x)
-    3.0"""
-    ...
-
-def modf(x) -> None:
-    """Return a tuple of two floats, being the fractional and integral parts of x. Both return values have the same sign as x."""
-    ...
-
-def pow(x, y) -> None:
-    """计算 x 的 y 次方(幂)。 示例:
-    - x = math.pow(2, 3)
-    - print(x)
-    8.0"""
-    ...
-
-def radians(x) -> None:
-    """角度转化为弧度。 示例:
-    - x = math.radians(60)
-    - print(x)
-    1.047198"""
-    ...
-
-def sin(x) -> None:
-    """传入弧度值,计算正弦。 示例:计算sin90°
-    - math.sin(math.radians(90))
-    1.0"""
-    ...
-
-def sinh(x) -> None:
-    """Return the hyperbolic sine of x."""
-    ...
-
-def sqrt(x) -> None:
-    """
-    计算平方根。 
-    示例:
-    - x = math.sqrt(9)
-    - print(x)
-    3.0"""
-    ...
-
-def tan(x) -> None:
-    """
-    传入弧度值,计算正切。 示例:计算tan60°
-    - math.tan(math.radians(60))
-    1.732051"""
-    ...
-
-def tanh(x) -> None:
-    """Return the hyperbolic tangent of x."""
-    ...
-
-def trunc(x) -> None:
-    """
-    取整。 
-    示例:
-    - x = math.trunc(5.12)
-    - print(x)
-    5
-    - y = math.trunc(-6.8)
-    - print(y)
-    -6"""
-    ...

+ 0 - 83
docs/code-completion/network.py

@@ -1,83 +0,0 @@
-"""
-此模块提供网络驱动程序和路由配置。特定硬件的网络驱动程序在此模块中可用,用于配置硬件网络接口。然后,配置接口提供的网络服务可以通过 usocket 模块使用。
-"""
-
-STA_IF = ...  # type: int
-AP_IF = ...  # type: int
-
-class WLAN(object):
-    """
-    创建一个 WLAN 网络接口对象。
-    支持的接口是 network.STA_IF(STA 模式,可以连接到上游的 WiFi 热点上) 和 network.AP_IF(AP 模式,允许其他 WiFi 客户端连接到自身的热点)。
-    下面方法的可用性取决于接口的类型。
-    例如,只有STA 接口可以使用 WLAN.connect() 方法连接到 AP 热点上。
-    """
-
-    STAT_IDLE = ...  # type: int
-    STAT_CONNECTING = ...  # type: int
-    STAT_WRONG_PASSWORD = ...  # type: int
-    STAT_NO_AP_FOUND = ...  # type: int
-    STAT_CONNECT_FAIL = ...  # type: int
-    STAT_GOT_IP = ...  # type: int
-
-    def __init__(self, interface_id : int) -> None:
-        """初始化一个 wlan 对象"""
-        ...
-
-    def active(self, is_active : int) -> None:
-        """
-        - active([is_active])
-        如果向该方法传入布尔数值,传入 True 则使能卡,传入 False 则禁止网卡。否则,如果不传入参数,则查询当前网卡的状态。
-        """
-        ...
-
-    def connect(self, ssid: str, password : str) -> None:
-        """使用指定的账号和密码链接指定的无线热点。"""
-        ...
-
-    def disconnect(self) -> None:
-        """从当前链接的无线网络中断开。"""
-        ...
-
-    def scan(self) -> None:
-        """
-        扫描当前可以连接的无线网络。
-        只能在 STA 模式下进行扫描,使用元组列表的形式返回 WiFi 接入点的相关信息。
-        (ssid, bssid, channel, rssi, authmode, hidden)
-        """
-        ...
-
-    def status(self, param : str) -> None:
-        """
-        - status([param])
-        返回当前无线连接的状态。
-        当调用该方法时没有附带参数,就会返回值描述当前网络连接的状态。
-        如果还没有从热点连接中获得 IP 地址,此时的状态为 STATION_IDLE。
-        如果已经从连接的无线网络中获得 IP 地址,此时的状态为 STAT_GOT_IP。
-        当调用该函数使用的参数为 rssi 时,则返回 rssi 的值,该函数目前只支持这一个参数。
-        """
-        ...
-
-    def isconnected(self) -> None:
-        """
-        在 STA 模式时,如果已经连接到 WiFi 网络,并且获得了 IP 地址,则返回 True。
-        如果处在 AP 模式,此时已经与客户端建立连接,则返回 True。其他情况下都返回 False。"""
-        ...
-
-    def ifconfig(self, config: tuple) -> None:
-        """
-        ifconfig([(ip, subnet, gateway, dns)])
-        获取或者设置网络接口的参数,IP 地址,子网掩码,网关,DNS 服务器。
-        当调用该方法不附带参数时,该方法会返回一个包含四个元素的元组来描述上面的信息。
-        想要设置上面的值,传入一个包含上述四个元素的元组,例如:
-        - nic.ifconfig(('192.168.0.4', '255.255.255.0', '192.168.0.1', '8.8.8.8'))
-        """
-        ...
-
-    def config(self, mac : str = None, essid : str = None, password : str = None, hidden : int = 0, channel : int = 0) -> None:
-        """
-        - config(param=value, ...)
-        获取或者设置一般网络接口参数,这些方法允许处理标准的 ip 配置之外的其他参数,如 WLAN.ifconfig() 函数处理的参数。
-        这些参数包括特定网络和特定硬件的参数。
-        对于参数的设置,应该使用关键字的语法,可以一次性设置多个参数。"""
-        ...

+ 0 - 19
docs/code-completion/rtthread.py

@@ -1,19 +0,0 @@
-"""
-rtthread 模块提供了与 RT-Thread 操作系统相关的功能,如查看栈使用情况等。
-"""
-
-def current_tid() -> None:
-    """返回当前线程的 id 。"""
-    ...
-
-def is_preempt_thread() -> None:
-    """返回是否是可抢占线程。"""
-    ...
-
-def stacks_analyze() -> None:
-    """返回当前系统线程和栈使用信息。"""
-    ...
-	
-def list_device() -> None:
-    """列出当前板卡上可使用的设备信息,包括设备名和设备类型。"""
-    ...

+ 0 - 100
docs/code-completion/select.py

@@ -1,100 +0,0 @@
-"""
-uselect 模块提供了等待数据流的事件功能。
-"""
-
-def select(rlist, wlist, xlist) -> None:
-    """
-    监控对象何时可读或可写,一旦监控的对象状态改变,返回结果(阻塞线程)。这个函数是为了兼容,效率不高,推荐用 poll 函数 。
-
-    - select.select(rlist, wlist, xlist[, timeout])
-
-    - rlist:等待读就绪的文件描述符数组
-    - wlist:等待写就绪的文件描述符数组
-    - xlist:等待异常的数组
-    - timeout:等待时间(单位:秒)
-
-    示例:
-
-    - def selectTest():
-    - global s
-    - rs, ws, es = select.select([s,], [], [])
-    - #程序会在此等待直到对象s可读
-    - print(rs)
-    - for i in rs:
-    -     if i == s:
-    -     print("s can read now")
-    -     data,addr=s.recvfrom(1024)
-    -     print('received:',data,'from',addr)"""
-    ...
-
-class poll(string):
-    """
-    创建 poll 实例。
-
-    示例:
-
-    - poller = select.poll()
-    - print(poller)
-    - <poll>
-    """
-    def __init__(self) -> None:
-    ...
-
-    def register(self, obj) -> None:
-        """
-        - register(obj[, eventmask])
-        注册一个用以监控的对象,并设置被监控对象的监控标志位 flag。
-
-        - obj:被监控的对象
-        - flag:被监控的标志
-        -     select.POLLIN — 可读
-        -     select.POLLHUP — 已挂断
-        -     select.POLLERR — 出错
-        -     select.POLLOUT — 可写
-        """
-        ...
-
-    def unregister(self, obj) -> None:
-        """
-        解除监控的对象的注册。
-
-        - obj:注册过的对象
-
-        示例:
-
-        - READ_ONLY = select.POLLIN | select.POLLHUP | select.POLLERR
-        - READ_WRITE = select.POLLOUT | READ_ONLY
-        - poller.register(s, READ_WRITE)
-        - poller.unregister(s)
-        """
-        ...
-
-    def modify(self, obj, eventmask) -> None:
-        """
-        修改已注册的对象监控标志。
-
-        - obj:已注册的被监控对象
-        - flag:修改为的监控标志
-        
-        示例:
-
-        - READ_ONLY = select.POLLIN | select.POLLHUP | select.POLLERR
-        - READ_WRITE = select.POLLOUT | READ_ONLY
-        - poller.register(s, READ_WRITE)
-        - poller.modify(s, READ_ONLY)
-        """
-        ...
-
-    def poll(self, timeout) -> None:
-        """
-        - poll([timeout])
-        等待至少一个已注册的对象准备就绪。
-        返回 (obj, event, ...) 元组, event 元素指定了一个流发生的事件,是上面所描述的 select.POLL*常量组合。 
-        根据平台和版本的不同,在元组中可能有其他元素,所以不要假定元组的大小是 2 。如果超时,则返回空列表。
-        """
-        ...
-
-POLLIN = ...  # type: int
-POLLOUT = ...  # type: int
-POLLERR = ...  # type: int
-POLLHUP = ...  # type: int

+ 0 - 34
docs/code-completion/sys.py

@@ -1,34 +0,0 @@
-"""
-sys 模块提供系统特有的功能。
-"""
-
-def exit(retval=0) -> None:
-    """终止当前程序给定的退出代码。 函数会抛出 SystemExit 异常。"""
-    ...
-
-def print_exception(exc, file=sys.stdout) -> None:
-    """打印异常与追踪到一个类似文件的对象 file (或者缺省 sys.stdout )."""
-    ...
-
-def exit(retval=0) -> None:
-    """终止当前程序给定的退出代码。 函数会抛出 SystemExit 异常。"""
-    ...
-
- def exit(retval=0) -> None:
-    """终止当前程序给定的退出代码。 函数会抛出 SystemExit 异常。"""
-    ...
-
-def exit(retval=0) -> None:
-    """终止当前程序给定的退出代码。 函数会抛出 SystemExit 异常。"""
-    ...
-
-argv = ...  # type: str
-byteorder = ...  # type: str
-implementation = ...  # type: tuple
-modules = ...  # type: list
-path = ...  # type: str
-platform = ...  # type: str
-stderr = ... # type: stream
-stdin = ... # type: stream
-version = ... # type: str
-version_info = ... # type: str

+ 0 - 44
docs/code-completion/ubinascii.py

@@ -1,44 +0,0 @@
-"""
-ubinascii 模块包含许多在二进制和各种 ascii 编码的二进制表示之间转换的方法。
-"""
-
-def hexlify(data]) -> None:
-    """
-    - hexlify(data[, sep])
-    将字符串转换为十六进制表示的字符串。
-
-    - 示例:
-
-    - ubinascii.hexlify('hello RT-Thread')
-    - b'68656c6c6f2052542d546872656164'
-    - ubinascii.hexlify('summer')
-    - b'73756d6d6572'
-    如果指定了第二个参数sep,它将用于分隔两个十六进制数。
-
-    - 示例:
-
-    如果指定了第二个参数sep,它将用于分隔两个十六进制数。 
-    - ubinascii.hexlify('hello RT-Thread'," ")
-    - b'68 65 6c 6c 6f 20 52 54 2d 54 68 72 65 61 64'
-    - ubinascii.hexlify('hello RT-Thread',",")
-    - b'68,65,6c,6c,6f,20,52,54,2d,54,68,72,65,61,64'
-    """
-    ...
-
-def unhexlify(data) -> None:
-    """
-    转换十六进制字符串为二进制字符串,功能和 hexlify 相反。
-
-    示例:
-
-    - ubinascii.unhexlify('73756d6d6572')
-    - b'summer'"""
-    ...
-
-def a2b_base64(data) -> None:
-    """Base64编码的数据转换为二进制表示。返回字节串。"""
-    ...
-
-def b2a_base64(data) -> None:
-    """编码base64格式的二进制数据。返回的字符串。"""
-    ...

+ 0 - 37
docs/code-completion/ucollections.py

@@ -1,37 +0,0 @@
-"""
-ucollections 模块实现了专门的容器数据类型,它提供了 Python 的通用内置容器的替代方案,包括了字典、列表、集合和元组。
-"""
-
-class namedtuple(name, fields):
-    """
-    这是工厂函数创建一个新的 namedtuple 型与一个特定的字段名称和集合。namedtuple 是元组允许子类要访问它的字段不仅是数字索引,而且还具有属性使用符号字段名访问语法。 字段是字符串序列指定字段名称。为了兼容的实现也可以用空间分隔的字符串命名的字段(但效率较低) 。
-    代码示例:
-
-    - from ucollections import namedtuple
-    - MyTuple = namedtuple("MyTuple", ("id", "name"))
-    - t1 = MyTuple(1, "foo")
-    - t2 = MyTuple(2, "bar")
-    - print(t1.name)
-    - assert t2.name == t2[1]
-    - ucollections.OrderedDict(...)
-    """
-    ...
-
-class OrderedDict(...):
-    """
-    字典类型的子类,会记住并保留键/值的追加顺序。当有序的字典被迭代输出时,键/值 会按照他们被添加的顺序返回 :
-    from ucollections import OrderedDict
-
-    # To make benefit of ordered keys, OrderedDict should be initialized
-    # from sequence of (key, value) pairs.
-    - d = OrderedDict([("z", 1), ("a", 2)])
-    # More items can be added as usual
-    - d["w"] = 5
-    - d["b"] = 3
-    - for k, v in d.items():
-    -     print(k, v)
-    输出:
-
-    - z 1 a 2 w 5 b 3
-    """
-    ...

+ 0 - 77
docs/code-completion/uctypes.py

@@ -1,77 +0,0 @@
-"""
-uctypes 模块用来访问二进制数据结构,它提供 C 兼容的数据类型。
-"""
-
-LITTLE_ENDIAN  = ...  # type: int
-BIG_ENDIAN  = ...  # type: int
-NATIVE  = ...  # type: int
-
-class struct(addr, descriptor, type):
-    """
-    将内存中以 c 形式打包的结构体或联合体转换为字典,并返回该字典。
-
-    - addr:开始转换的地址
-    - descriptor:转换描述符
-    格式:"field_name":offset|uctypes.UINT32
-    - offset:偏移量,
-    单位:字节、VOID、UINT8、INT8、UINT16、INT16、UINT32、INT32、UINT64、INT64、BFUINT8、BFINT8、BFUINT16、BFINT16、BFUINT32、BFINT32、BF_POS、BF_LEN、FLOAT32、FLOAT64、PTR、ARRAY
-    - type:c 结构体或联合体存储类型,默认为本地存储类型
-    示例:
-
-    - a = b"0123"
-    - s = uctypes.struct(uctypes.addressof(a), {"a": uctypes.UINT8 | 0, "b": uctypes.UINT16 | 1}, uctypes.LITTLE_ENDIAN)
-    - print(s)
-    - <struct STRUCT 3ffc7360>
-    - print(s.a)
-    - 48
-    - s.a = 49
-    - print(a)
-    - b'1123'
-    """
-    def __init__(self) -> None:
-    ...
-
-    def sizeof(self, struct) -> None:
-        """
-        按字节返回数据的大小。参数可以是类或者数据对象 (或集合)。 示例:
-
-        - a = b"0123"
-        - b = uctypes.struct(uctypes.addressof(a), {"a": uctypes.UINT8 | 0, "b": uctypes.UINT16 | 1}, uctypes.LITTLE_ENDIAN)
-        - b.a
-        - 48
-        - print(uctypes.sizeof(b))
-        - 3
-        """
-        ...
-
-    def addressof(self, obj) -> None:
-        """
-        返回对象地址。参数需要是 bytes, bytearray 。 示例:
-
-        - a = b"0123"
-        - print(uctypes.addressof(a))
-        - 1073504048
-        """
-        ...
-
-    def bytes_at(self, addr, size)-> None:
-        """
-        捕捉从 addr 开始到 size 个地址偏移量结束的内存数据为 bytearray 对象并返回。 示例:
-
-        - a = b"0123"
-        - print( uctypes.bytes_at(uctypes.addressof(a), 4))
-        - b'0123'
-        """
-        ...
-
-    def bytearray_at(self, addr, size) -> None:
-        """
-        捕捉给定大小和地址内存为 bytearray 对象。与 bytes_at() 函数不同的是,它可以被再次写入,可以访问给定地址的参数。 示例:
-
-        - a = b"0123"
-        - print(uctypes.bytearray_at(uctypes.addressof(a), 2))
-        - bytearray(b'01')
-        """
-        ...
-
-

+ 0 - 7
docs/code-completion/uerrno.py

@@ -1,7 +0,0 @@
-"""
-uerrno 模块提供了标准的 errno 系统符号,每个符号都有对应的整数值。
-"""
-
-errorcode  = ...  # type: int
-EEXIST  = ...  # type: int
-EAGAIN  = ...  # type: int

+ 0 - 71
docs/code-completion/uhashlib.py

@@ -1,71 +0,0 @@
-"""
-uhashlib 模块实现了二进制数据哈希算法。
-"""
-
-SHA256 = ...  # type: int
-SHA1 = ...  # type: int
-MD5 = ...  # type: int
-
-class sha256(data):
-    """
-    - sha256([data])
-    创建一个SHA256哈希对象并提供 data 赋值。
-    """
-
-    def __init__(self) -> None:
-    ...
-
-    def update(self, data) -> None:
-        """将更多二进制数据放入哈希表中。"""
-        ...
-
-    def digest(self) -> None:
-        """返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
-        ...
-
-    def hexdigest(self) -> None:
-        """此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
-        ...
-
-class sha1(data):
-    """
-    - sha1([data])
-    创建一个SHA1哈希对象并提供 data 赋值。
-    """
-
-    def __init__(self) -> None:
-    ...
-
-    def update(self, data) -> None:
-        """将更多二进制数据放入哈希表中。"""
-        ...
-
-    def digest(self) -> None:
-        """返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
-        ...
-
-    def hexdigest(self) -> None:
-        """此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
-        ...
-
-
-class md5(data):
-    """
-    - md5([data])
-    创建一个MD5哈希对象并提供 data 赋值。
-    """
-
-    def __init__(self) -> None:
-    ...
-
-    def update(self, data) -> None:
-        """将更多二进制数据放入哈希表中。"""
-        ...
-
-    def digest(self) -> None:
-        """返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。"""
-        ...
-
-    def hexdigest(self) -> None:
-        """此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。"""
-        ...

+ 0 - 15
docs/code-completion/uheapq.py

@@ -1,15 +0,0 @@
-"""
-uheapq 模块提供了堆排序相关算法,堆队列是一个列表,它的元素以特定的方式存储。
-"""
-
-def heappush(heap, item) -> None:
-    """将对象压入堆中。"""
-    ...
-
-def heappop(heap) -> None:
-    """从 heap 弹出第一个元素并返回。 如果是堆时空的会抛出 IndexError。"""
-    ...
-
-def heapify(x) -> None:
-    """将列表 x 转换成堆。"""
-    ...

+ 0 - 32
docs/code-completion/uio.py

@@ -1,32 +0,0 @@
-"""
-uio 模块包含流类型 (类似文件) 对象和帮助函数。
-"""
-
-def open(name, mode='r', **kwargs) -> None:
-    """打开一个文件,关联到内建函数open()。所有端口 (用于访问文件系统) 需要支持模式参数,但支持其他参数不同的端口。"""
-    ...
-
-class FileIO(...):
-    """这个文件类型用二进制方式打开文件,等于使用open(name, “rb”)。 不应直接使用这个实例。"""
-    ...
-
-class TextIOWrapper(...):
-    """这个类型以文本方式打开文件,等同于使用open(name, “rt”)不应直接使用这个实例。"""
-    ...
-
-class StringIO(string):
-    """这个类型以文本方式打开文件,等同于使用open(name, “rt”)不应直接使用这个实例。"""
-    ...
-
-class BytesIO(string):
-    """
-    内存文件对象。StringIO 用于文本模式 I/O (用 “t” 打开文件),BytesIO 用于二进制方式 (用 “b” 方式)。
-    文件对象的初始内容可以用字符串参数指定(stringio用普通字符串,bytesio用bytes对象)。
-    所有的文件方法,如 read(), write(), seek(), flush(), close() 都可以用在这些对象上。
-    """
-    def __init__(self) -> None:
-    ...
-
-    def getvalue(self) -> None:
-        """获取缓存区内容。"""
-        ...

+ 0 - 38
docs/code-completion/ujson.py

@@ -1,38 +0,0 @@
-"""
-ujson 模块提供 Python 对象到 JSON(JavaScript Object Notation) 数据格式的转换。
-"""
-
-def dumps(obj) -> None:
-    """
-    将 dict 类型转换成 str。
-
-    - obj:要转换的对象
-
-    示例:
-
-    - obj = {1:2, 3:4, "a":6}
-    - print(type(obj), obj) #原来为dict类型
-    - <class 'dict'> {3: 4, 1: 2, 'a': 6}
-    - jsObj = json.dumps(obj) #将dict类型转换成str
-    - print(type(jsObj), jsObj)
-    - <class 'str'> {3: 4, 1: 2, "a": 6}"""
-    ...
-
-def loads(str) -> None:
-    """
-    解析 JSON 字符串并返回对象。如果字符串格式错误将引发 ValueError 异常。 
-    
-    示例:
-
-    - obj = {1:2, 3:4, "a":6}
-    - jsDumps = json.dumps(obj)
-    - jsLoads = json.loads(jsDumps)
-    - print(type(obj), obj)
-    - <class 'dict'> {3: 4, 1: 2, 'a': 6}
-    - print(type(jsDumps), jsDumps)
-    - <class 'str'> {3: 4, 1: 2, "a": 6}
-    - print(type(jsLoads), jsLoads)
-    - <class 'dict'> {'a': 6, 1: 2, 3: 4}
-    """
-    ...
-

+ 0 - 43
docs/code-completion/uos.py

@@ -1,43 +0,0 @@
-"""
-uos 模块包含了对文件系统的访问操作,是对应 CPython 模块的一个子集。
-"""
-
-def chdir(path) -> None:
-    """更改当前目录。"""
-    ...
-
-def getcwd() -> None:
-    """获取当前目录。"""
-    ...
-
-def listdir(dir : str = None) -> None:
-    """没有参数就列出当前目录,否则列出给定目录。"""
-    ...
-
-def mkdir(path : str) -> None:
-    """创建一个目录。"""
-    ...
-
-def remove(path : str) -> None:
-    """删除文件。"""
-    ...
-
-def rmdir(path : str) -> None:
-    """删除目录。"""
-    ...
-
-def rename(old_path : str, new_path : str) -> None:
-    """重命名文件或者文件夹。"""
-    ...
-
-def stat(path : str) -> None:
-    """获取文件或目录的状态。"""
-    ...
-
-def sync() -> None:
-    """同步所有的文件系统。"""
-    ...
-	
-def mkfs(fs_type : str, dev_name : str) -> None:
-    """在指定的设备上创建 fs_type 类型的文件系统。example: os.mkfs("elm", "fs")"""
-    ...

+ 0 - 117
docs/code-completion/urandom.py

@@ -1,117 +0,0 @@
-"""
-urandom 模块实现了伪随机数生成器。
-"""
-
-def choice(obj) -> None:
-    """
-    随机生成对象 obj 中的元数。
-
-    - obj:元数列表
-
-    示例:
-
-    - print(random.choice("DFRobot"))
-    - R
-    - print(random.choice("DFRobot"))
-    - D
-    - print(random.choice([0, 2, 4, 3]))
-    - 3
-    - print(random.choice([0, 2, 4, 3]))
-    - 3
-    - print(random.choice([0, 2, 4, 3]))
-    - 2
-    """
-    ...
-
-def getrandbits(size) -> None:
-    """
-    随机生成 0 到 size 个位二进制数范围内的正整数。 比如 :
-
-    - size = 4,那么便是从 0 到0b1111中随机一个正整数。
-    - size = 8,那么便是从 0 到 0b11111111中随机一个正整数。
-    - size:位大小
-
-    示例:
-
-    - print( random.getrandbits(1))  #1位二进制位,范围为0~1(十进制:0~1)
-    - 1
-    - print(random.getrandbits(1))
-    - 0
-    - print(random.getrandbits(8))  #8位二进制位,范围为0000 0000~1111 11111(十进制:0~255)
-    - 224
-    - print(random.getrandbits(8))
-    - 155
-    """
-    ...
-
-def randint(start, end) -> None:
-    """
-    随机生成一个 start 到 end 之间的整数。
-
-    start:指定范围内的开始值,包含在范围内
-    end:指定范围内的结束值,包含在范围内
-    示例:
-
-    - import random
-    - print(random.randint(1, 4))
-    - 4
-    - print(random.randint(1, 4))
-    - 2
-    """
-    ...
-
-def random() -> None:
-    """
-    随机生成一个 0 到 1 之间的浮点数。 示例:
-
-    - print(random.random())
-    - 0.7111824
-    - print(random.random())
-    - 0.3168149
-    """
-    ...
-
-
-def randrange(start, end, step) -> None:
-    """
-    随机生成 start 到 end 并且递增为 step 的范围内的正整数。例如,randrange(0, 8, 2)中,随机生成的数为 0、2、4、6 中任一个。
-
-    - start:指定范围内的开始值,包含在范围内
-    - end:指定范围内的结束值,包含在范围内
-    - step:递增基数
-
-    示例:
-
-    - print(random.randrange(2, 8, 2))
-    - 4
-    - print(random.randrange(2, 8, 2))
-    - 6
-    - print(random.randrange(2, 8, 2))
-    - 2
-    """
-    ...
-
-def seed(sed) -> None:
-    """
-    指定随机数种子,通常和其他随机数生成函数搭配使用。 
-    注意: MicroPython 中的随机数其实是一个稳定算法得出的稳定结果序列,而不是一个随机序列。
-    sed 就是这个算法开始计算的第一个值。
-    所以就会出现只要 sed 是一样的,那么后续所有“随机”结果和顺序也都完全一致。
-    """
-    ...
-
-def uniform(start, end) -> None:
-    """
-    随机生成start到end之间的浮点数。
-
-    - start:指定范围内的开始值,包含在范围内
-    - stop:指定范围内的结束值,包含在范围内
-
-    示例:
-
-    - print(random.uniform(2, 4))
-    - 2.021441
-    - print(random.uniform(2, 4))
-    - 3.998012
-    """
-    ...

+ 0 - 106
docs/code-completion/ure.py

@@ -1,106 +0,0 @@
-"""
-ure 模块用于测试字符串的某个模式,执行正则表达式操作。
-"""
-
-DEBUG = ...  # type: int
-
-class compile(...):
-    """
-    - compile(regex_str[, flags])
-    编译正则表达式,返回 regex 对象。
-    """
-    ...
-
-    def __init__(self) -> None:
-    ...
-
-    def match(self, string) -> None:
-        """用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
-        ...
-
-    def search(self, string) -> None:
-        """在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
-        ...
-
-    def sub(self, replace, string, count, flags) -> None:
-        """Compile regex_str and search for it in string, replacing all matches with replace, and returning the new string."""
-        ...
-
-    def split(self) -> None:
-        """获取缓存区内容。"""
-        ...
-
-class match(...):
-    """
-    - Match objects as returned by match() and search() methods。
-    """
-    ...
-
-    def __init__(self) -> None:
-    ...
-
-    def group(self, index) -> None:
-        """用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
-        ...
-
-    def groups(self) -> None:
-        """在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
-        ...
-
-    def start(self, index) -> None:
-        """start([index])"""
-        ...
-
-    def end(self, index) -> None:
-        """end([index])
-        Return the index in the original string of the start or end of the substring group that was matched. index defaults to the entire group, otherwise it will select a group.
-        """
-        ...
-
-    def span(self) -> None:
-        """Returns the 2-tuple (match.start(index), match.end(index))."""
-        ...
-
-class search(...):
-    """
-    - Match objects as returned by match() and search() methods。
-    """
-    ...
-
-    def __init__(self) -> None:
-    ...
-
-    def group(self, index) -> None:
-        """用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
-        ...
-
-    def groups(self) -> None:
-        """在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
-        ...
-
-    def start(self, index) -> None:
-        """start([index])"""
-        ...
-
-    def end(self, index) -> None:
-        """end([index])
-        Return the index in the original string of the start or end of the substring group that was matched. index defaults to the entire group, otherwise it will select a group.
-        """
-        ...
-
-    def span(self) -> None:
-        """Returns the 2-tuple (match.start(index), match.end(index))."""
-        ...
-
-def match(regex, string) -> None:
-    """用 string 匹配 regex,匹配总是从字符串的开始匹配。"""
-    ...
-
-def search(regex, string) -> None:
-    """在 string 中搜索 regex。不同于匹配,它搜索第一个匹配位置的正则表达式字符串 (结果可能会是0)。"""
-    ...
-
-def sub(regex_str, replace, string, count, flags) -> None:
-    """Compile regex_str and search for it in string, replacing all matches with replace, and returning the new string."""
-    ...
-

+ 0 - 187
docs/code-completion/usocket.py

@@ -1,187 +0,0 @@
-"""
-usocket 模块提供对BSD套接字接口的访问。
-"""
-
-AF_INET   = ...  # type: int
-AF_INET6  = ...  # type: int
-
-SOCK_STREAM = ...  # type: int 
-SOCK_DGRAM = ...  # type: int
-SOCK_RAW = ...  # type: int
-SO_REUSEADDR = ...  # type: int
-
-IPPROTO_TCP  = ...  # type: int
-IPPROTO_UDP  = ...  # type: int
-
-
-class socket(object):
-
-    def __init__(self, family, type, protocol = socket.IPPROTO_TCP) -> None:
-        """
-        创建新的套接字,使用指定的地址、类型和协议号。
-        - usocket.socket(usocket.AF_INET,usocket.SOCK_STREAM)
-        """
-        ...
-
-    def getaddrinfo(self, host, port) -> None:
-        return tuple
-        """
-        将主机域名(host)和端口(port)转换为用于创建套接字的5元组序列。元组列表的结构如下:
-
-        - (family, type, proto, canonname, sockaddr)
-        示例:
-
-        - info = socket.getaddrinfo("rt-thread.org", 10000)
-        - print(info)
-        - [(2, 1, 0, '', ('118.31.15.152', 10000))]
-        """
-        ...
-
-    def close(self) -> None:
-        """关闭套接字。一旦关闭后,套接字所有的功能都将失效。远端将接收不到任何数据 (清理队列数据后)。 虽然在垃圾回收时套接字会自动关闭,但还是推荐在必要时用 close() 去关闭。"""
-        ...
-
-    def bind(self, address) -> None:
-        """将套接字绑定到地址,套接字不能是已经绑定的。"""
-        ...
-
-    def listen(self, backlog) -> None:
-        """
-        listen([backlog])
-        监听套接字,使服务器能够接收连接。
-        backlog:接受套接字的最大个数,至少为0,如果没有指定,则默认一个合理值。
-        """
-        ...
-
-    def accept(self) -> None:
-        return conn, address
-        """
-        接收连接请求。 注意: 只能在绑定地址端口号和监听后调用,返回 conn 和 address。
-
-        - conn:新的套接字对象,可以用来收发消息
-        - address:连接到服务器的客户端地址
-        """
-        ...
-
-    def connect(self, address : tuple) -> None:
-        """
-        连接服务器。
-
-       - address:服务器地址和端口号的元组或列表
-        """
-        ...
-
-    def send(self, bytes) -> None:
-        return size
-        """
-        发送数据,并返回成功发送的字节数,返回字节数可能比发送的数据长度少。
-
-        - bytes:bytes类型数据
-        """
-        ...
-
-    def recv(self, bufsize) -> None:
-        return obj
-        """
-        接收数据,返回接收到的数据对象。
-
-        - bufsize:指定一次接收的最大数据量
-        示例:
-
-        - data = conn.recv(1024)
-        """
-        ...
-
-    def sendto(self, bytes, address) -> None:
-        return size
-        """
-        送数据,目标由address决定,常用于UDP通信,返回发送的数据大小。
-
-        - bytes:bytes类型数据
-        - address:目标地址和端口号的元组
-
-        示例:
-
-        - data = sendto("hello RT-Thread", ("192.168.10.110", 100))
-        """
-        ...
-
-    def recvfrom(self, bufsize) -> None:
-        return size
-        """
-        接收数据,常用于UDP通信,并返回接收到的数据对象和对象的地址。
-
-        - bufsize:指定一次接收的最大数据量
-        示例:
-
-        - data,addr=fd.recvfrom(1024)
-        """
-        ...
-
-    def setsockopt(self, level, optname, value) -> None:
-        return status
-        """
-        根据选项值设置套接字。
-
-        - level:套接字选项级别
-        - optname:套接字的选项
-        - value:可以是一个整数,也可以是一个表示缓冲区的bytes类对象。
-        示例:
-
-        - s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-        """
-        ...
-
-    def settimeout(self, value) -> None:
-        return status
-        """
-        设置超时时间,单位:秒。 示例:
-
-        s.settimeout(2)
-        """
-        ...
-
-    def setblocking(self, flag) -> None:
-        return status
-        """
-        设置阻塞或非阻塞模式: 如果 flag 是 false,设置非阻塞模式。
-        """
-        ...
-
-    def read(self, size) -> None:
-        return size
-        """
-        - read([size])
-        Read up to size bytes from the socket. 
-        Return a bytes object. If size is not given, it reads all data available from the socket until EOF; 
-        as such the method will not return until the socket is closed. This function tries to read as much data as requested (no “short reads”). 
-        This may be not possible with non-blocking socket though, and then less data will be returned.
-        """
-        ...
-
-    def readinto(self, buf) -> None:
-        return size
-        """
-        readinto(buf[, nbytes])
-        Read bytes into the buf. 
-        If nbytes is specified then read at most that many bytes. 
-        Otherwise, read at most len(buf) bytes. 
-        Just as read(), this method follows “no short reads” policy. 
-        Return value: number of bytes read and stored into buf.
-        """
-        ...
-        
-    def readline(self) -> None:
-        return obj
-        """
-        接收一行数据,遇换行符结束,并返回接收数据的对象 。
-        """
-        ...
-
-    def write(self, buf) -> None:
-        return size
-        """
-        将字节类型数据写入套接字,并返回写入成功的数据大小。
-        """
-        ...
-

+ 0 - 69
docs/code-completion/ustruct.py

@@ -1,69 +0,0 @@
-"""
-打包和解包原始数据类型。
-ustruct 模块在 Python 值和以 Python 字节对象表示的 C 结构之间执行转换。
-支持 size/byte 的前缀: @, <, >, !.
-支持的格式代码: b, B, h, H, i, I, l, L, q, Q, s, P, f, d (最后2个需要支持浮点数).
-"""
-
-def calcsize(fmt) -> None:
-    """
-    返回存放某一类型数据 fmt 需要的字节数。
-    - fmt:数据类型
-    -     b — 字节型
-    -     B — 无符号字节型
-    -     h — 短整型
-    -     H — 无符号短整型
-    -     i — 整型
-    -     I — 无符号整型
-    -     l — 整型
-    -     L — 无符号整型
-    -     q — 长整型
-    -     Q — 无符号长整型
-    -     f — 浮点型
-    -     d — 双精度浮点型
-    -     P — 无符号型
-    示例:
-
-    - print(struct.calcsize("i"))
-    - 4
-    - print(struct.calcsize("B"))
-    - 1
-    """
-    ...
-
-def pack(fmt, v1, v2, ...) -> None:
-    """
-    按照格式字符串 fmt 打包参数 v1, v2, ... 。返回值是参数打包后的字节对象。
-    fmt:同 calcsize。
-    示例:
-
-    - struct.pack("ii", 3, 2)
-    - b'\x03\x00\x00\x00\x02\x00\x00\x00'
-    - ustruct.unpack(fmt, data)
-    从 fmt 中解包数据。返回值是解包后参数的元组。
-
-    data:要解压的字节对象。
-    示例:
-    - buf = struct.pack("bb", 1, 2)
-    - print(buf)
-    - b'\x01\x02'
-    - print(struct.unpack("bb", buf))
-    - (1, 2)
-    """
-    ...
-
-def pack_into(fmt, buffer, offset, v1, v2, ...) -> None:
-    """按照格式字符串 fmt 压缩参数 v1, v2, ... 到缓冲区 buffer,开始位置是 offset。当offset 为负数时,从缓冲区末尾开始计数。"""
-    ...
-
-def unpack_from(fmt, data, offset=0) -> None:
-    """
-    以 fmt 作为规则从 data 的 offset 位置开始解包数据,如果 offset 是负数就是从缓冲区末尾开始计算。
-    返回值是解包后的参数元组。
-    - buf = struct.pack("bb", 1, 2)
-    - print(struct.unpack("bb", buf))
-    - (1, 2)
-    - print(struct.unpack_from("b", buf, 1))
-    - (2,)
-    """
-    ...

+ 0 - 101
docs/code-completion/utime.py

@@ -1,101 +0,0 @@
-"""
-utime 模块提供获取当前时间和日期、测量时间间隔和延迟的功能。
-"""
-
-from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
-
-def localtime(secs : int) -> Tuple:
-    return Tuple
-    """
-    从初始时间的秒转换为元组: (年, 月, 日, 时, 分, 秒, 星期, yearday) 。如果 secs 是空或者 None,那么使用当前时间。
-    year 年份包括世纪(例如2014)。
-
-    - month 范围 1-12
-    - day 范围 1-31
-    - hour 范围 0-23
-    - minute 范围 0-59
-    - second 范围 0-59
-    - weekday 范围 0-6 对应周一到周日
-    - yearday 范围 1-366
-    """
-    ...
-
-def mktime(time : tuple) -> int:
-    return time
-    """时间的反函数,它的参数是完整8参数的元组,返回值一个整数自2000年1月1日以来的秒数。"""
-    ...
-
-def sleep(seconds) -> None:
-    """休眠指定的时间(秒),Seconds 可以是浮点数。注意有些版本的 MicroPython不支持浮点数,为了兼容可以使用 sleep_ms() 和 sleep_us()函数。"""
-    ...
-
-def sleep_ms(ms) -> None:
-    """延时指定毫秒,参数不能小于0。"""
-    ...
-
-def sleep_us(us) -> None:
-    """延时指定微秒,参数不能小于0。"""
-    ...
-
-def ticks_ms() -> int:
-    return time
-    """
-    返回不断递增的毫秒计数器,在某些值后会重新计数(未指定)。
-    计数值本身无特定意义,只适合用在ticks_diff()。
-    注: 直接在这些值上执行标准数学运算(+,-)或关系运算符(<,>,>,> =)会导致无效结果。
-    执行数学运算然后传递结果作为参数给ticks_diff() 或 ticks_add() 也将导致函数产生无效结果。
-    """
-    ...
-
-def ticks_us() -> int:
-    return time
-    """
-    返回不断递增的微秒计数器,在某些值后会重新计数(未指定)。
-    计数值本身无特定意义,只适合用在ticks_diff()。
-    注: 直接在这些值上执行标准数学运算(+,-)或关系运算符(<,>,>,> =)会导致无效结果。
-    执行数学运算然后传递结果作为参数给ticks_diff() 或 ticks_add() 也将导致函数产生无效结果。
-    """
-    ...
-
-def ticks_cpu() -> None:
-    """与 ticks_ms() 和 ticks_us() 类似,具有更高精度 (使用 CPU 时钟),并非每个端口都实现此功能。"""
-    ...
-
-def ticks_add(ticks, delta) -> int:
-    return time
-    """
-    给定一个数字作为节拍的偏移值 delta,这个数字的值是正数或者负数都可以。 
-    给定一个 ticks 节拍值,本函数允许根据节拍值的模算数定义来计算给定节拍值之前或者之后 delta 个节拍的节拍值 。 
-    ticks 参数必须是 ticks_ms(), ticks_us(), or ticks_cpu() 函数的直接返回值。
-    然而,delta 可以是一个任意整数或者是数字表达式。ticks_add 函数对计算事件/任务的截至时间很有用。
-    (注意:必须使用 ticksdiff() 函数来处理 最后期限)。
-    """
-    ...
-
-def ticks_diff(ticks1, ticks2) -> int :
-    return time
-    """
-    计算两次调用 ticksms(), ticks_us(), 或 ticks_cpu()之间的时间。
-    因为这些函数的计数值可能会回绕,所以不能直接相减,需要使用 ticks_diff() 函数。
-    “旧” 时间需要在 “新” 时间之前,否则结果无法确定。
-    这个函数不要用在计算很长的时间 (因为 ticks*() 函数会回绕,通常周期不是很长)。
-    通常用法是在带超时的轮询事件中调用:
-    代码示例:
-    # 等待 GPIO 引脚有效,但是最多等待500微秒
-
-    - start = time.ticks_us()
-    - while pin.value() == 0:
-    -     if time.ticks_diff(time.ticks_us(), start) > 500:
-    -         raise TimeoutError
-    """
-    ...
-
-def time() -> int:
-    return time
-    """
-    返回从开始时间的秒数(整数),假设 RTC 已经按照前面方法设置好。
-    如果 RTC 没有设置,函数将返回参考点开始计算的秒数 (对于 RTC 没有后备电池的板子,上电或复位后的情况)。
-    如果你开发便携版的 MicroPython 应用程序,你不要依赖函数来提供超过秒级的精度。
-    如果需要高精度,使用 ticks_ms() 和 ticks_us() 函数。
-    如果需要日历时间,使用不带参数的 localtime() 是更好选择。"""
-    ...

+ 0 - 8
docs/code-completion/uzlib.py

@@ -1,8 +0,0 @@
-"""
-uzlib 模块实现了使用 DEFLATE 算法解压缩二进制数据 (常用的 zlib 库和 gzip 文档)。目前不支持压缩。
-"""
-
-def decompress(data) -> None:
-    """打开一个文件,关联到内建函数open()。所有端口 (用于访问文件系统) 需要支持模式参数,但支持其他参数不同的端口。"""
-    ...
-