diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/develop/natmod.rst | 9 | ||||
-rw-r--r-- | docs/esp32/quickref.rst | 15 | ||||
-rw-r--r-- | docs/library/framebuf.rst | 12 | ||||
-rw-r--r-- | docs/library/socket.rst | 10 |
4 files changed, 42 insertions, 4 deletions
diff --git a/docs/develop/natmod.rst b/docs/develop/natmod.rst index 18678eaefb..2ccd832885 100644 --- a/docs/develop/natmod.rst +++ b/docs/develop/natmod.rst @@ -81,7 +81,14 @@ Linker limitation: the native module is not linked against the symbol table of t full MicroPython firmware. Rather, it is linked against an explicit table of exported symbols found in ``mp_fun_table`` (in ``py/nativeglue.h``), that is fixed at firmware build time. It is thus not possible to simply call some arbitrary HAL/OS/RTOS/system -function, for example. +function, for example, unless that resides at a fixed address. In that case, the path +of a linkerscript containing a series of symbol names and their fixed address can be +passed to ``mpy_ld.py`` via the ``--externs`` command line argument. That way symbols +appearing in the linkerscript will take precedence over what is provided from object +files, but at the moment the object files' implementation will still reside in the +final MPY file. The linkerscript parser is limited in its capabilities, and is +currently used only for parsing the ESP8266 port ROM symbols list (see +``ports/esp8266/boards/eagle.rom.addr.v6.ld``). New symbols can be added to the end of the table and the firmware rebuilt. The symbols also need to be added to ``tools/mpy_ld.py``'s ``fun_table`` dict in the diff --git a/docs/esp32/quickref.rst b/docs/esp32/quickref.rst index 63180b470a..c394414a76 100644 --- a/docs/esp32/quickref.rst +++ b/docs/esp32/quickref.rst @@ -544,14 +544,27 @@ Legacy methods: Equivalent to ``ADC.block().init(bits=bits)``. +The only chip that can switch resolution to a lower one is the normal esp32. +The C2 & S3 are stuck at 12 bits, while the S2 is at 13 bits. + For compatibility, the ``ADC`` object also provides constants matching the -supported ADC resolutions: +supported ADC resolutions, per chip: +ESP32: - ``ADC.WIDTH_9BIT`` = 9 - ``ADC.WIDTH_10BIT`` = 10 - ``ADC.WIDTH_11BIT`` = 11 - ``ADC.WIDTH_12BIT`` = 12 +ESP32 C3 & S3: + - ``ADC.WIDTH_12BIT`` = 12 + +ESP32 S2: + - ``ADC.WIDTH_13BIT`` = 13 + +.. method:: ADC.deinit() + + Provided to deinit the adc driver. Software SPI bus ---------------- diff --git a/docs/library/framebuf.rst b/docs/library/framebuf.rst index f22a3613bd..e2a231207d 100644 --- a/docs/library/framebuf.rst +++ b/docs/library/framebuf.rst @@ -137,6 +137,18 @@ Other methods is compared to the value from *palette*, not to the value directly from *fbuf*.) + *fbuf* can be another FrameBuffer instance, or a tuple or list of the form:: + + (buffer, width, height, format) + + or:: + + (buffer, width, height, format, stride) + + This matches the signature of the FrameBuffer constructor, and the elements + of the tuple/list are the same as the arguments to the constructor except that + the *buffer* here can be read-only. + The *palette* argument enables blitting between FrameBuffers with differing formats. Typical usage is to render a monochrome or grayscale glyph/icon to a color display. The *palette* is a FrameBuffer instance whose format is diff --git a/docs/library/socket.rst b/docs/library/socket.rst index 944e7e631a..38e0aab704 100644 --- a/docs/library/socket.rst +++ b/docs/library/socket.rst @@ -227,22 +227,28 @@ Methods has the same "no short writes" policy for blocking sockets, and will return number of bytes sent on non-blocking sockets. -.. method:: socket.recv(bufsize) +.. method:: socket.recv(bufsize, [flags]) Receive data from the socket. The return value is a bytes object representing the data received. The maximum amount of data to be received at once is specified by bufsize. + Most ports support the optional *flags* argument. Available *flags* are defined as constants + in the socket module and have the same meaning as in CPython. ``MSG_PEEK`` and ``MSG_DONTWAIT`` + are supported on all ports which accept the *flags* argument. + .. method:: socket.sendto(bytes, address) Send data to the socket. The socket should not be connected to a remote socket, since the destination socket is specified by *address*. -.. method:: socket.recvfrom(bufsize) +.. method:: socket.recvfrom(bufsize, [flags]) Receive data from the socket. The return value is a pair *(bytes, address)* where *bytes* is a bytes object representing the data received and *address* is the address of the socket sending the data. + See the `recv` function for an explanation of the optional *flags* argument. + .. method:: socket.setsockopt(level, optname, value) Set the value of the given socket option. The needed symbolic constants are defined in the |