diff options
author | Damien George <damien.p.george@gmail.com> | 2017-08-14 12:19:09 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-08-14 12:19:09 +1000 |
commit | bb254ba0ea89ce60dd6deab94991b2651c00dff3 (patch) | |
tree | fa2b66f3a1a9fd4bb90b2c83ce9954099b06fe01 /docs/library | |
parent | 5e76ea4affd0bd46e67b456496818803010a2d24 (diff) | |
parent | e4e4526954f8bcd88ceb21fe789963bfa710fa4f (diff) | |
download | micropython-bb254ba0ea89ce60dd6deab94991b2651c00dff3.tar.gz micropython-bb254ba0ea89ce60dd6deab94991b2651c00dff3.zip |
Merge tag 'v1.8.3' into parse-bytecode
Many small improvements and additions, with btree support in ESP8266 port
This release brings various improvements and additions to the core,
extended modules and the ESP8266 port, as well as enhancements to the docs.
There is now a "threshold" function in the gc module for the user to
configure the garbage collector to run earlier than usual, in order to help
reduce fragmentation of the heap. The btree module is now available in the
ESP8266 port, and there is improved WebREPL file transfer: get file is now
non-blocking (this change requires an update of the client software).
py core:
- nlrx64.S: prefix mp_thread_get_state with an underscore on Mac
- stream: implement 2- and 3-arg write() method as an extension to CPython
- gc: implement GC running by allocation threshold, user configurable
- fix nlrthumb.c when DEBUG=1 is defined
- obj: issue a warning when str and bytes objects are compared
- mpconfig.h: fix description for MICROPY_PY_STR_BYTES_CMP_WARN
- objstrunicode: str_index_to_ptr: should handle bytes too
- objstrunicode: str_index_to_ptr: implement positive indexing properly
- stream: implement generic flush() method, in terms of C-level ioctl
- objstringio: add MP_STREAM_FLUSH ioctl and flush() method
- objstringio: implement MP_STREAM_SEEK ioctl and add seek() method
- stream: add adapter methods with POSIX-compatible signatures
- mpconfig.h: add MICROPY_STREAMS_POSIX_API setting
- py.mk: extra switches to build "embedded" BerkeleyDB BTree lib
- mkrules.mk: allow to add more items for "clean" target using CLEAN_EXTRA
- objstr: make .partition()/.rpartition() methods configurable
- mpconfig.h: define MP_ALWAYSINLINE for reuse
extmod:
- modussl: rename to modussl_axtls.c, to allow impl using other SSL libs
- modussl_axtls: further changes to allow alternative SSL modules
- modussl_axtls: add dummy setblocking() method
- vfs_fat: implement rmdir() method (aliases to unlink)
- modussl_axtls: use mp_stream_close() method
- modwebrepl: use mp_stream_close() method
- modbtree: check __bt_open() return value for error
- modbtree: switch to accepting stream object instead of filename
- modbtree: implement __contains__ operation
- modwebrepl: factor out "GET" iteration to write_file_chunk()
- modwebrepl: make GET_FILE operation non-blocking
- modbtree: open(): add option kwargs
- modwebsocket: add readline method
- modwebsocket: make compatible with non-default object models
- modwebsocket: use mp_rom_map_elem_t and friends
- modwebrepl: add GET_VER operation to query MicroPython version
lib:
- axtls: upgrade to axTLS 1.5.4 + MicroPython patchset
- axtls: update, fixes esp8266 build
- utils/stdout_helpers: move from minimal/uart_extra.c for reuse
- embed/abort_: implementation of abort_() function raising uPy exception
- berkeley-db-1.xx: switch to "embedded" branch
- berkeley-db-1.xx: update, sets default page size to 4096
tests:
- add test for extended arguments to stream .write() method
- extmod/machine_pinbase: skip if machine.PinBase is not available
- bytes_compare: rework test for bytes <-> str comparison
- extmod/btree1: close database at the end of test
- unicode_subscr.py: detailed test for subscripting unicode strings
- run-tests: make "regex'ed .exp" facility available to device tests
- io/bytesio_ext: test for .seek()/.flush() on BytesIO
- extmod/btree1: tests against in-memory DB (using io.BytesIO)
- machine_mem.py: too non-portable, rework as an example for unix port
- machine1: revamp to work with unix port (which has "umachine")
- basics: bytes/str.partition/rpartition are now optional
mpy-cross:
- fix Makefile to handle gc-sections linker flags on OS X
- use binary file translation mode for creating mpy files on windows
- fix mingw and msys2 compilation
minimal port:
- disable MICROPY_GC_ALLOC_THRESHOLD
unix port:
- mpthreadport: adjust minimum thread stack, and stack limit check
- cache libaxtls.a in local build dir
- disable MICROPY_GC_ALLOC_THRESHOLD for minimal build
- enable MICROPY_PY_STR_BYTES_CMP_WARN
- mpconfigport.h: include stdio.h by default
- file: implement MP_STREAM_FLUSH ioctl
- file: ioctl(): check that file is open before operations
- file: fdfile_ioctl(): fix argument to check_fd_is_open()
- file: use generic stream flush() method
- enable websocket module
- moduselect: allow poll.register(), etc. accept fd-like objects
stmhal port:
- fix malloc when used with external libraries
- make SPI NSS pin definition optional
- fix I2C mappings for STM32F429DISC board
esp8266 port:
- select axTLS for SSL implementation, following recent refactor
- moduos: add rmdir() function
- cache Xtensa-built libaxtls.a in local build dir
- enable MICROPY_PY_STR_BYTES_CMP_WARN
- dupterm_task_init() should be called before running _boot.py, etc
- _boot.py: set GC alloc threshold to half of heap size
- _boot.py: decrease GC alloc threshold to quarter of heap size
- modpybuart: fix UART parity setting
- axtls_helpers: remove abort_(), now in lib/embed/
- mpconfigport.h: include sys/types.h for POSIX types definitions
- esp_mphal: implement libc's errno
- enable btree module
- eagle.rom.addr.v6.ld: add Enable_QMode symbol from SDK 2.0.0
- make APA102 driver inclusion configurable
- makeimg.py: store firmware size as last 4 bytes of padding area
- makeimg.py: append md5 hash to the generated binary
- modesp: add check_fw() function to check integrity of the firmware
- scripts/port_diag.py: include esp.check_fw() call
- flashbdev: reserve extra sysparam sector for SDK 2.0.0 compatibility
- scripts/inisetup: add commented-out call to esp.osdebug(None)
- modmachine: implement idle() function
- esp_mphal.h: add mp_hal_ticks_cpu() for reuse
- modutime: actually implement ticks_cpu()
- modmachine: implement dummy sleep() function
- tutorial/intro: reword para abou -fm dio switch
- modules/flashbdev: start filesystem at 0x90000
- esp8266.ld: increase firmware image size to 0x90000 (576K)
docs:
- add DHT to ESP8266 Quick Ref and Tutorial
- fix some spelling mistakes
- array: document array module
- library/index: include array module in ToC
- esp8266/intro: rename to "Getting started" from "Introduction"
- esp8266/intro: add troubleshooting section
- esp8266/quickref: link to installation instructions
- esp8266/tutorial/intro: add anchor for link from quickeref
- esp8266/intro: focus on hazards of unearthed power wrt electronics
- uio: mention seek()/flush() support for io.BytesIO
misc:
- logo/1bit-logo A black & white version of the logo
examples:
- http_server*: update for buffered-like streams (read line by line)
- embedding: example for embedding MicroPython in an app
- embedding: add README
- http_client*: be sure to close socket
- network: split recv- and read-based HTTP servers
qemu-arm:
- enable gcc LTO option for nlrthumb.c
Diffstat (limited to 'docs/library')
-rw-r--r-- | docs/library/array.rst | 30 | ||||
-rw-r--r-- | docs/library/builtins.rst | 2 | ||||
-rw-r--r-- | docs/library/esp.rst | 2 | ||||
-rw-r--r-- | docs/library/index.rst | 4 | ||||
-rw-r--r-- | docs/library/machine.Pin.rst | 2 | ||||
-rw-r--r-- | docs/library/machine.RTC.rst | 2 | ||||
-rw-r--r-- | docs/library/machine.SPI.rst | 2 | ||||
-rw-r--r-- | docs/library/machine.Timer.rst | 4 | ||||
-rw-r--r-- | docs/library/machine.UART.rst | 2 | ||||
-rw-r--r-- | docs/library/machine.rst | 4 | ||||
-rw-r--r-- | docs/library/network.rst | 12 | ||||
-rw-r--r-- | docs/library/pyb.ADC.rst | 2 | ||||
-rw-r--r-- | docs/library/pyb.DAC.rst | 2 | ||||
-rw-r--r-- | docs/library/pyb.ExtInt.rst | 4 | ||||
-rw-r--r-- | docs/library/pyb.I2C.rst | 2 | ||||
-rw-r--r-- | docs/library/pyb.Pin.rst | 4 | ||||
-rw-r--r-- | docs/library/pyb.RTC.rst | 2 | ||||
-rw-r--r-- | docs/library/pyb.Timer.rst | 10 | ||||
-rw-r--r-- | docs/library/pyb.rst | 4 | ||||
-rw-r--r-- | docs/library/ubinascii.rst | 2 | ||||
-rw-r--r-- | docs/library/ucollections.rst | 4 | ||||
-rw-r--r-- | docs/library/uctypes.rst | 4 | ||||
-rw-r--r-- | docs/library/uhashlib.rst | 6 | ||||
-rw-r--r-- | docs/library/uio.rst | 7 | ||||
-rw-r--r-- | docs/library/uos.rst | 2 | ||||
-rw-r--r-- | docs/library/utime.rst | 2 |
26 files changed, 79 insertions, 44 deletions
diff --git a/docs/library/array.rst b/docs/library/array.rst new file mode 100644 index 0000000000..f52b4b385e --- /dev/null +++ b/docs/library/array.rst @@ -0,0 +1,30 @@ +:mod:`array` -- arrays of numeric data +====================================== + +.. module:: array + :synopsis: efficient arrays of numeric data + +See `Python array <https://docs.python.org/3/library/array.html>`_ for more +information. + +Supported format codes: ``b``, ``B``, ``h``, ``H``, ``i``, ``I``, ``l``, +``L``, ``q``, ``Q``, ``f``, ``d`` (the latter 2 depending on the +floating-point support). + +Classes +------- + +.. class:: array.array(typecode, [iterable]) + + Create array with elements of given type. Initial contents of the + array are given by an `iterable`. If it is not provided, an empty + array is created. + + .. method:: append(val) + + Append new element to the end of array, growing it. + + .. method:: extend(iterable) + + Append new elements as contained in an iterable to the end of + array, growing it. diff --git a/docs/library/builtins.rst b/docs/library/builtins.rst index d99eadce3e..42768ab999 100644 --- a/docs/library/builtins.rst +++ b/docs/library/builtins.rst @@ -1,7 +1,7 @@ Builtin Functions ================= -All builtin functions are described here. They are alse available via +All builtin functions are described here. They are also available via ``builtins`` module. .. function:: abs() diff --git a/docs/library/esp.rst b/docs/library/esp.rst index 34d3c278d9..0836bba72e 100644 --- a/docs/library/esp.rst +++ b/docs/library/esp.rst @@ -15,7 +15,7 @@ Functions Get or set the sleep type. If the ``sleep_type`` parameter is provided, sets the sleep type to its - value. If the function is called wihout parameters, returns the current + value. If the function is called without parameters, returns the current sleep type. The possible sleep types are defined as constants: diff --git a/docs/library/index.rst b/docs/library/index.rst index 9a105697b7..d502ffdfc6 100644 --- a/docs/library/index.rst +++ b/docs/library/index.rst @@ -51,6 +51,7 @@ library. .. toctree:: :maxdepth: 1 + array.rst builtins.rst cmath.rst gc.rst @@ -75,6 +76,7 @@ library. .. toctree:: :maxdepth: 1 + array.rst builtins.rst cmath.rst gc.rst @@ -99,6 +101,7 @@ library. .. toctree:: :maxdepth: 1 + array.rst builtins.rst gc.rst select.rst @@ -116,6 +119,7 @@ library. .. toctree:: :maxdepth: 1 + array.rst builtins.rst gc.rst math.rst diff --git a/docs/library/machine.Pin.rst b/docs/library/machine.Pin.rst index fdada2f383..db25787f94 100644 --- a/docs/library/machine.Pin.rst +++ b/docs/library/machine.Pin.rst @@ -84,7 +84,7 @@ Methods - ``None`` - no pull up or down resistor. - ``Pin.PULL_UP`` - pull up resistor enabled. - - ``Pin.PULL_DOWN`` - pull down resitor enabled. + - ``Pin.PULL_DOWN`` - pull down resistor enabled. - ``drive`` can be one of: diff --git a/docs/library/machine.RTC.rst b/docs/library/machine.RTC.rst index b6e98e9d1f..6dc8b3e9ab 100644 --- a/docs/library/machine.RTC.rst +++ b/docs/library/machine.RTC.rst @@ -39,7 +39,7 @@ Methods .. method:: RTC.alarm(id, time, /*, repeat=False) - Set the RTC alarm. Time might be either a milllisecond value to program the alarm to + 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. diff --git a/docs/library/machine.SPI.rst b/docs/library/machine.SPI.rst index f3c95181dc..73b3a3996d 100644 --- a/docs/library/machine.SPI.rst +++ b/docs/library/machine.SPI.rst @@ -45,7 +45,7 @@ Methods respectively. - ``bits`` is the width of each transfer, accepted values are 8, 16 and 32. - ``firstbit`` can be ``SPI.MSB`` only. - - ``pins`` is an optional tupple with the pins to assign to the SPI bus. + - ``pins`` is an optional tuple with the pins to assign to the SPI bus. .. method:: SPI.deinit() diff --git a/docs/library/machine.Timer.rst b/docs/library/machine.Timer.rst index 344d1ea86e..12db58d5c4 100644 --- a/docs/library/machine.Timer.rst +++ b/docs/library/machine.Timer.rst @@ -104,7 +104,7 @@ Methods If only a channel identifier passed, then a previously initialized channel object is returned (or ``None`` if there is no previous channel). - Othwerwise, a TimerChannel object is initialized and returned. + Otherwise, a TimerChannel object is initialized and returned. The operating mode is is the one configured to the Timer object that was used to create the channel. @@ -152,7 +152,7 @@ Methods .. method:: timerchannel.irq(\*, trigger, priority=1, handler=None) - The behavior of this callback is heaviliy dependent on the operating + The behavior of this callback is heavily dependent on the operating mode of the timer channel: - If mode is ``Timer.PERIODIC`` the callback is executed periodically diff --git a/docs/library/machine.UART.rst b/docs/library/machine.UART.rst index 27a8801900..f832cf4664 100644 --- a/docs/library/machine.UART.rst +++ b/docs/library/machine.UART.rst @@ -167,7 +167,7 @@ Methods .. data:: UART.EVEN .. data:: UART.ODD - parity types (anlong with ``None``) + parity types (along with ``None``) .. data:: UART.RX_ANY diff --git a/docs/library/machine.rst b/docs/library/machine.rst index b103ec393d..0f361a7cb7 100644 --- a/docs/library/machine.rst +++ b/docs/library/machine.rst @@ -57,7 +57,7 @@ Power related functions 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 occuring at regular intervals on the order of millisecond). + interrupt occurring at regular intervals on the order of millisecond). .. function:: sleep() @@ -96,7 +96,7 @@ Miscellaneous functions .. function:: unique_id() - Returns a byte string with a unique idenifier of a board/SoC. It will vary + 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. diff --git a/docs/library/network.rst b/docs/library/network.rst index b183ef9a4b..0e18106aa8 100644 --- a/docs/library/network.rst +++ b/docs/library/network.rst @@ -237,7 +237,7 @@ For example:: Get or set the PHY mode. If the ``mode`` parameter is provided, sets the mode to its value. If - the function is called wihout parameters, returns the current mode. + the function is called without parameters, returns the current mode. The possible modes are defined as constants: * ``MODE_11B`` -- IEEE 802.11b, @@ -319,7 +319,7 @@ For example:: * ``STAT_WRONG_PASSWORD`` -- failed due to incorrect password, * ``STAT_NO_AP_FOUND`` -- failed because no access point replied, * ``STAT_CONNECT_FAIL`` -- failed due to other problems, - * ``STAT_GOT_IP`` -- connection susccessful. + * ``STAT_GOT_IP`` -- connection successful. .. method:: wlan.isconnected() @@ -329,7 +329,7 @@ For example:: .. method:: wlan.ifconfig([(ip, subnet, gateway, dns)]) - Get/set IP-level network interface paremeters: IP address, subnet mask, + Get/set IP-level network interface parameters: IP address, subnet mask, gateway and DNS server. When called with no arguments, this method returns a 4-tuple with the above information. To set the above values, pass a 4-tuple with the required information. For example:: @@ -343,8 +343,8 @@ For example:: with additional parameters beyond standard IP configuration (as dealt with by ``wlan.ifconfig()``). These include network-specific and hardware-specific parameters. For setting parameters, keyword argument syntax should be used, - multiple parameters can be set at once. For querying, paremeters name should - be quoted as a string, and only one paramter can be queries at time:: + multiple parameters can be set at once. For querying, parameters name should + be quoted as a string, and only one parameter can be queries at time:: # Set WiFi access point name (formally known as ESSID) and WiFi channel ap.config(essid='My AP', channel=11) @@ -397,7 +397,7 @@ For example:: .. note:: The ``WLAN`` constructor is special in the sense that if no arguments besides the id are given, - it will return the already exisiting ``WLAN`` instance without re-configuring it. This is + it will return the already existing ``WLAN`` instance without re-configuring it. This is because ``WLAN`` is a system feature of the WiPy. If the already existing instance is not initialized it will do the same as the other constructors an will initialize it with default values. diff --git a/docs/library/pyb.ADC.rst b/docs/library/pyb.ADC.rst index 2ffd4e16f5..51021fdc1a 100644 --- a/docs/library/pyb.ADC.rst +++ b/docs/library/pyb.ADC.rst @@ -13,7 +13,7 @@ class ADC -- analog to digital conversion adc = pyb.ADC(pin) # create an analog object from a pin val = adc.read() # read an analog value - adc = pyb.ADCAll(resolution) # creale an ADCAll object + adc = pyb.ADCAll(resolution) # create an ADCAll object val = adc.read_channel(channel) # read the given channel val = adc.read_core_temp() # read MCU temperature val = adc.read_core_vbat() # read MCU VBAT diff --git a/docs/library/pyb.DAC.rst b/docs/library/pyb.DAC.rst index 4b9651e27e..fd786b63b6 100644 --- a/docs/library/pyb.DAC.rst +++ b/docs/library/pyb.DAC.rst @@ -79,7 +79,7 @@ Methods .. method:: DAC.triangle(freq) Generate a triangle wave. The value on the DAC output changes at - the given frequency, and the frequence of the repeating triangle wave + the given frequency, and the frequency of the repeating triangle wave itself is 2048 times smaller. .. method:: DAC.write(value) diff --git a/docs/library/pyb.ExtInt.rst b/docs/library/pyb.ExtInt.rst index d8f4d92bb8..814217cef0 100644 --- a/docs/library/pyb.ExtInt.rst +++ b/docs/library/pyb.ExtInt.rst @@ -7,7 +7,7 @@ class ExtInt -- configure I/O pins to interrupt on external events There are a total of 22 interrupt lines. 16 of these can come from GPIO pins and the remaining 6 are from internal sources. -For lines 0 thru 15, a given line can map to the corresponding line from an +For lines 0 through 15, a given line can map to the corresponding line from an arbitrary port. So line 0 can map to Px0 where x is A, B, C, ... and line 1 can map to Px1 where x is A, B, C, ... :: @@ -27,7 +27,7 @@ explanation, along with various techniques for debouncing. Trying to register 2 callbacks onto the same pin will throw an exception. If pin is passed as an integer, then it is assumed to map to one of the -internal interrupt sources, and must be in the range 16 thru 22. +internal interrupt sources, and must be in the range 16 through 22. All other pin objects go through the pin mapper to come up with one of the gpio pins. :: diff --git a/docs/library/pyb.I2C.rst b/docs/library/pyb.I2C.rst index 210b4ccf21..67131feec0 100644 --- a/docs/library/pyb.I2C.rst +++ b/docs/library/pyb.I2C.rst @@ -39,7 +39,7 @@ Printing the i2c object gives you information about its configuration. You can specify a timeout (in ms):: - i2c.send(b'123', timeout=2000) # timout after 2 seconds + i2c.send(b'123', timeout=2000) # timeout after 2 seconds A master must specify the recipient's address:: diff --git a/docs/library/pyb.Pin.rst b/docs/library/pyb.Pin.rst index 154217ebb7..4f589fff89 100644 --- a/docs/library/pyb.Pin.rst +++ b/docs/library/pyb.Pin.rst @@ -231,7 +231,7 @@ Constants class PinAF -- Pin Alternate Functions ====================================== - A Pin represents a physical pin on the microcprocessor. Each pin + A Pin represents a physical pin on the microprocessor. Each pin can have a variety of functions (GPIO, I2C SDA, etc). Each PinAF object represents a particular function for a pin. @@ -240,7 +240,7 @@ Constants x3 = pyb.Pin.board.X3 x3_af = x3.af_list() - x3_af will now contain an array of PinAF objects which are availble on + x3_af will now contain an array of PinAF objects which are available on pin X3. For the pyboard, x3_af would contain: diff --git a/docs/library/pyb.RTC.rst b/docs/library/pyb.RTC.rst index 383ddf20c2..2628554526 100644 --- a/docs/library/pyb.RTC.rst +++ b/docs/library/pyb.RTC.rst @@ -73,7 +73,7 @@ Methods value, which is an integer in the range [-511 : 512]. With one argument it sets the RTC calibration. - The RTC Smooth Calibration mechanism addjusts the RTC clock rate by + The RTC Smooth Calibration mechanism adjusts the RTC clock rate by adding or subtracting the given number of ticks from the 32768 Hz clock over a 32 second period (corresponding to 2^20 clock ticks.) Each tick added will speed up the clock by 1 part in 2^20, or 0.954 diff --git a/docs/library/pyb.Timer.rst b/docs/library/pyb.Timer.rst index ffb092caa3..052bce2efd 100644 --- a/docs/library/pyb.Timer.rst +++ b/docs/library/pyb.Timer.rst @@ -78,7 +78,7 @@ Methods Keyword arguments: - - ``freq`` --- specifies the periodic frequency of the timer. You migh also + - ``freq`` --- specifies the periodic frequency of the timer. You might also view this as the frequency with which the timer goes through one complete cycle. - ``prescaler`` [0-0xffff] - specifies the value to be loaded into the @@ -97,7 +97,7 @@ Methods - ``Timer.UP`` - configures the timer to count from 0 to ARR (default) - ``Timer.DOWN`` - configures the timer to count from ARR down to 0. - - ``Timer.CENTER`` - confgures the timer to count from 0 to ARR and + - ``Timer.CENTER`` - configures the timer to count from 0 to ARR and then back down to 0. - ``div`` can be one of 1, 2, or 4. Divides the timer clock to determine @@ -109,7 +109,7 @@ Methods transitions on complimentary channels (both channels will be inactive) for this time). ``deadtime`` may be an integer between 0 and 1008, with the following restrictions: 0-128 in steps of 1. 128-256 in steps of - 2, 256-512 in steps of 8, and 512-1008 in steps of 16. ``deadime`` + 2, 256-512 in steps of 8, and 512-1008 in steps of 16. ``deadtime`` measures ticks of ``source_freq`` divided by ``div`` clock ticks. ``deadtime`` is only available on timers 1 and 8. @@ -141,7 +141,7 @@ Methods If only a channel number is passed, then a previously initialized channel object is returned (or ``None`` if there is no previous channel). - Othwerwise, a TimerChannel object is initialized and returned. + Otherwise, a TimerChannel object is initialized and returned. Each channel can be configured to perform pwm, output compare, or input capture. All channels share the same underlying timer, which means @@ -183,7 +183,7 @@ Methods - ``polarity`` can be one of: - ``Timer.HIGH`` - output is active high - - ``Timer.LOW`` - output is acive low + - ``Timer.LOW`` - output is active low Optional keyword arguments for Timer.IC modes: diff --git a/docs/library/pyb.rst b/docs/library/pyb.rst index 7be39a5d8e..2f3e7d36bd 100644 --- a/docs/library/pyb.rst +++ b/docs/library/pyb.rst @@ -46,7 +46,7 @@ Time related functions Returns the number of milliseconds which have elapsed since ``start``. This function takes care of counter wrap, and always returns a positive - number. This means it can be used to measure periods upto about 12.4 days. + number. This means it can be used to measure periods up to about 12.4 days. Example:: @@ -59,7 +59,7 @@ Time related functions Returns the number of microseconds which have elapsed since ``start``. This function takes care of counter wrap, and always returns a positive - number. This means it can be used to measure periods upto about 17.8 minutes. + number. This means it can be used to measure periods up to about 17.8 minutes. Example:: diff --git a/docs/library/ubinascii.rst b/docs/library/ubinascii.rst index 0a9adb50d4..4931f90482 100644 --- a/docs/library/ubinascii.rst +++ b/docs/library/ubinascii.rst @@ -17,7 +17,7 @@ Functions .. admonition:: Difference to CPython :class: attention - If additional argument, `sep` is supplied, it is used as a seperator + If additional argument, `sep` is supplied, it is used as a separator between hexadecimal values. .. function:: unhexlify(data) diff --git a/docs/library/ucollections.rst b/docs/library/ucollections.rst index c7ed068c7e..4e9de9ac67 100644 --- a/docs/library/ucollections.rst +++ b/docs/library/ucollections.rst @@ -13,10 +13,10 @@ Classes .. function:: namedtuple(name, fields) This is factory function to create a new namedtuple type with a specific - name and set of fields. A namedtyple is a subclass of tuple which allows + name and set of fields. A namedtuple is a subclass of tuple which allows to access its fields not just by numeric index, but also with an attribute access syntax using symbolic field names. Fields is a sequence of strings - specifying field names. For compatibily with CPython it can also be a + specifying field names. For compatibility with CPython it can also be a a string with space-separated field named (but this is less efficient). Example of use:: diff --git a/docs/library/uctypes.rst b/docs/library/uctypes.rst index 630a3a36fb..2a9c4dd5c0 100644 --- a/docs/library/uctypes.rst +++ b/docs/library/uctypes.rst @@ -118,7 +118,7 @@ Module contents .. data:: BIG_ENDIAN - Layour type for a big-endian packed structure. + Layout type for a big-endian packed structure. .. data:: NATIVE @@ -184,7 +184,7 @@ Subscripting a pointer with other integer values but 0 are supported too, with the same semantics as in C. Summing up, accessing structure fields generally follows C syntax, -except for pointer derefence, when you need to use ``[0]`` operator +except for pointer dereference, when you need to use ``[0]`` operator instead of ``*``. Limitations diff --git a/docs/library/uhashlib.rst b/docs/library/uhashlib.rst index 5de4b6f7ba..223c72dfe7 100644 --- a/docs/library/uhashlib.rst +++ b/docs/library/uhashlib.rst @@ -9,7 +9,7 @@ This module implements binary data hashing algorithms. Currently, it implements SHA256 algorithm. Choosing SHA256 was a deliberate choice, as a modern, cryptographically secure algorithm. This means that a - single algorithm can cover both usecases of "any hash algorithm" and + single algorithm can cover both use cases of "any hash algorithm" and security-related usage, and thus save space omitting legacy algorithms like MD5 or SHA1. @@ -53,7 +53,7 @@ Constructors Example:: - hash = uhashlib.sha1('abcd1234', 1001) # lenght of the initial piece is multiple of 4 bytes + hash = uhashlib.sha1('abcd1234', 1001) # length of the initial piece is multiple of 4 bytes hash.update('1234') # also multiple of 4 bytes ... hash.update('12345') # last chunk may be of any length @@ -68,7 +68,7 @@ Methods .. method:: hash.digest() - Return hash for all data passed thru hash, as a bytes object. After this + Return hash for all data passed through hash, as a bytes object. After this method is called, more data cannot be fed into hash any longer. .. only:: port_wipy diff --git a/docs/library/uio.rst b/docs/library/uio.rst index 1b3e2a0822..9b4c87df88 100644 --- a/docs/library/uio.rst +++ b/docs/library/uio.rst @@ -12,7 +12,7 @@ Functions .. function:: open(name, mode='r', **kwargs) - Open a file. Builtin ``open()`` function is alised to this function. + Open a file. Builtin ``open()`` function is aliased to this function. All ports (which provide access to file system) are required to support `mode` parameter, but support for other arguments vary by port. @@ -38,8 +38,9 @@ Classes opened with "b" modifier). Initial contents of file-like objects can be specified with `string` parameter (should be normal string for `StringIO` or bytes object for `BytesIO`). All the usual file - methods like ``read()``, ``write()``, ``close()`` are available on - these objects, and additionally, following method: + methods like ``read()``, ``write()``, ``seek()``, ``flush()``, + ``close()`` are available on these objects, and additionally, a + following method: .. method:: getvalue() diff --git a/docs/library/uos.rst b/docs/library/uos.rst index bb95107c04..77a61ca449 100644 --- a/docs/library/uos.rst +++ b/docs/library/uos.rst @@ -81,7 +81,7 @@ Functions .. function:: unmount(path) - Unmounts a prevoulsy mounted block device from the given path. + Unmounts a previously mounted block device from the given path. .. function:: mkfs(block_device or path) diff --git a/docs/library/utime.rst b/docs/library/utime.rst index 0bca4692ac..8310673830 100644 --- a/docs/library/utime.rst +++ b/docs/library/utime.rst @@ -117,7 +117,7 @@ Functions .. function:: time() Returns the number of seconds, as an integer, since the Epoch, assuming that underlying - RTC is set and maintained as decsribed above. If an RTC is not set, this function returns + RTC is set and maintained as described above. If an RTC is not set, this function returns number of seconds since a port-specific reference point in time (for embedded boards without a battery-backed RTC, usually since power up or reset). If you want to develop portable MicroPython application, you should not rely on this function to provide higher than second |