Wykres commitów

670 Commity (5543b2a9cc7381931431c69d93a77ba5d5d58e2e)

Autor SHA1 Wiadomość Data
Ned Konz 5543b2a9cc extmod/uasyncio: Add clear method to ThreadSafeFlag.
This is useful in situations where the ThreadSafeFlag is reused and needs
to be cleared of any previous, unwanted event.

For example, clear the flag at the start of an operation, trigger the
operation (eg an I2C write), then (a)wait for an external event to set the
flag (eg a pin IRQ).  Further events may trigger the flag again but these
are unwanted and should be cleared before the next cycle starts.
2022-08-12 17:06:28 +10:00
Nathan Hendler 9bcb2c0a20 docs/library/rp2: Fix pull_thresh docs to use pull instead of push. 2022-08-11 14:29:47 +10:00
chrismas9 c038ea0cc6 docs/library/pyb.Timer: Document how to use BKIN pin with example.
Document how to connect the Timer block BRK_IN to a physical Pin alternate
function.

Add an example of PWM Motor drive using complementary outputs with dead
time and break input to kill the PWM and generate a callback.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-07-29 12:22:23 +10:00
chrismas9 33ea400ce8 docs/library/pyb.Pin: Add Pin.ALT constant.
Some Pin alternate functions are inputs, for example, timer capture and
break inputs.  In Pyb.Pin the only way to set alt mode is with Pin.AF_PP or
Pin.AF_OD.  It is not intuitive to use an output mode to configure an
input.  Pin.ALT is used in the machine.Pin class and works in pyb.Pin.

The examples are changed to use Pin.ALT because TIM2_CH3 can be a capture
input or pulse output.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-07-29 12:16:32 +10:00
chrismas9 e168d47424 docs/library/pyb.Pin: Fix out-of-context paragraphs, and AF_PP typo.
Remove out of context callback paragraph, it was part of the wipy docs.
And move the paragraph about PULL_UP/PULL_DOWN resistor values to within
the init() method docs.  Also fix pull-pull -> push-pull.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-07-29 12:07:09 +10:00
Peter Hinch fe5598452d docs/library/time: Provide more info about which epoch is used.
Some embedded targets use 1970 epoch.
2022-07-29 11:27:16 +10:00
Andrew Scheller fa15aed0f7 docs/library/neopixel: Add note that neopixel is included in rp2 builds. 2022-07-23 23:27:04 +10:00
Carlosgg b41cfea02a extmod/modussl_mbedtls: Implement cert_reqs and cadata arguments.
Add cert_reqs and cadata keyword-args to ssl.wrap_socket() and
ssl.CERT_NONE, ssl.CERT_OPTIONAL, ssl.CERT_REQUIRED constants to allow
certificate validation.

CPython doesn't accept cadata in ssl.wrap_socket(), but it does in
SSLContext.load_verify_locations(), so we use this name to at least match
the same name in load_verify_locations().

Add docs for these new arguments, as well as docs for the existing
server_hostname argument which is important for certificate validation.

Tests are added as well.

Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
2022-07-20 16:46:04 +10:00
IhorNehrutsa 1ea82b6dcc esp32,esp8266: Rename WLAN dhcp_hostname config to hostname.
But retain old name for backwards compatibility.
2022-07-05 23:40:32 +10:00
Jim Mussared 3ce21945b1 docs/library/bluetooth: Add link to aioble.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-06-24 18:05:39 +10:00
Damien George db7682e02d extmod/uasyncio: Implement stream read(-1) to read all data up to EOF.
Fixes issue #6355.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-24 17:04:57 +10:00
Christian Walther ba21f76f89 esp32/modesp32: Add wake_on_ulp() so ULP can wake CPU from deepsleep.
Add esp32.wake_on_ulp() to give access to esp_sleep_enable_ulp_wakeup(),
which is needed to allow the ULP co-processor to wake the main CPU from
deep sleep.
2022-06-23 17:31:01 +10:00
Luiz Brandao 7861eddd0f docs/library/uasyncio: Consistently use "uasyncio" instead of "asyncio". 2022-06-21 17:28:48 +10:00
Patrick Joy 3d58bb23c2 docs/library/machine: Add note on interrupts being critical to system. 2022-06-21 17:25:11 +10:00
Damien George 9175482f29 docs/library: Remove unnecessary "pyb." prefix on class names.
Otherwise these classes are refered to with a double prefix, like
pyb.pyb.ADC.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-21 14:33:23 +10:00
Howard Lovatt 89e1e67748 docs/library/pyb.Timer: Document `brk` argument and its constants. 2022-06-21 14:22:50 +10:00
David Lechner a565811f23 extmod/modbtree: Use buffer protocol for keys/values.
This changes the btree implementation to use the buffer protocol for
reading key/values in all methods.  `str` and `bytes` objects are not the
only bytes-like objects that could be used.

Documentation and tests are also updated.

Addresses issue #8748.

Signed-off-by: David Lechner <david@pybricks.com>
2022-06-21 00:44:49 +10:00
iabdalkader 6e868d47dc docs: Update to use new WLAN argument names for ssid/security/key.
Addresses issue #8083.
2022-06-17 21:43:44 +10:00
Andrew Scheller cedb93c179 docs: Update Raspberry Pi URLs from .org to .com. 2022-06-14 11:41:13 +10:00
Damien George 9670a156da all: Rename MICROPY_PY_WIZNET5K to MICROPY_PY_NETWORK_WIZNET5K.
To match MICROPY_PY_NETWORK_CYW43 and MICROPY_PY_NETWORK_NINAW10.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-07 16:55:18 +10:00
Damien George 402df833fe py/modsys: Introduce sys.implementation._machine constant.
This contains a string useful for identifying the underlying machine.  This
string is kept consistent with the second part of the REPL banner via the
new config option MICROPY_BANNER_MACHINE.

This makes os.uname() more or less redundant, as all the information in
os.uname() is now available in the sys module.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-28 17:23:03 +10:00
Damien George 59c5d41611 py/modsys: Rename sys.implementation.mpy to sys.implementation._mpy.
Per CPython docs, non-standard attributes must begin with an underscore.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-28 17:23:03 +10:00
Damien George 2a08e38c60 docs/library/network.WLAN: Add "txpower" to list of known WLAN configs.
Signed-off-by: Damien George <damien@micropython.org>
2022-04-22 21:51:29 +10:00
robert-hh 56b331ace6 drivers/codec: Add driver for the WM8960 codec.
This codec is assembled for the MIMXRT1xxx_DEV boards and available for
WM8960 breakout boards as well.

The driver itself has been tested as working with the MIMXRT boards and a
Sparkfun WM6890 breakout board.  It implements the initialization, basic
methods and some enhanced methods like 3D, ALC, soft-mute and deemphasis.
2022-04-04 16:31:17 +10:00
robert-hh 7a447e08b2 docs: Add quickref and docs for mimxrt, including network.LAN docs. 2022-04-04 14:11:31 +10:00
iabdalkader 5cdf964571 docs/library/pyb.CAN: Update CAN docs to match revised API. 2022-04-02 22:46:07 +11:00
MikeTeachman 1f6cb8f047 mixmrt/machine_i2s: Add I2S protocol support.
This commit adds support for machine.I2S on the mimxrt port.  The I2S API
is consistent with the existing stm32, esp32, and rp2 implementations.

I2S features:
- controller transmit and controller receive
- 16-bit and 32-bit sample sizes
- mono and stereo formats
- sampling frequencies from 8kHz to 48kHz
- 3 modes of operation:
  - blocking
  - non-blocking with callback
  - uasyncio
- configurable internal buffer
- optional MCK

Tested with the following development boards:
- MIMXRT1010_EVK, MIMXRT1015_EVK, MIMXRT1020_EVK, MIMXRT1050_EVK
- Teensy 4.0, Teensy 4.1
- Olimex RT1010
- Seeed ARCH MIX

Tested with the following I2S hardware peripherals:
- UDA1334
- GY-SPH0645LM4H
- WM8960 codec on board the MIMXRT boards and separate breakout board
- INMP441
- PCM5102
- SGTL5000 on the Teensy audio shield

Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2022-03-30 14:12:40 +11:00
Damien George 5e685a9c6f docs/library/machine.I2S: Clarify what rate refers to.
Signed-off-by: Damien George <damien@micropython.org>
2022-03-29 11:44:08 +11:00
Jonathan Hogg 21d0599bd1 esp32/modesp32: Add new gpio_deep_sleep_hold function.
Add a new function to control whether held pins will retain their function
through deep-sleep.

Also document this function and explain how to use this in quickref to
retain pin configuration during deep-sleep.
2022-03-21 23:59:07 +11:00
Damien George ac2293161e py/modsys: Add optional mutable attributes sys.ps1/ps2 and use them.
This allows customising the REPL prompt strings.

Signed-off-by: Damien George <damien@micropython.org>
2022-03-10 10:58:33 +11:00
Damien George cac939ddc3 py/modsys: Add optional sys.tracebacklimit attribute.
With behaviour as per CPython.

Signed-off-by: Damien George <damien@micropython.org>
2022-03-10 10:43:21 +11:00
Jonathan Hogg 3ebc370344 docs/library/machine.Pin: Update to use preferred DRIVE_x constants.
Update documents with new common names for the drive strength constants.
2022-03-07 23:47:45 +11:00
Damien George bb2bd071f7 docs/library/esp32.rst: Mark esp32.Partition as not taking kw args.
Fixes issue #8380.

Signed-off-by: Damien George <damien@micropython.org>
2022-03-07 15:15:45 +11:00
Jan 5d9171b5cc docs/library/machine.UART.rst: Add details for `invert` parameter. 2022-03-07 14:12:50 +11:00
Damien George 106a83de22 esp32/esp32_partition: Add support for specifying block_size.
To support filesystems that use a block size different from the native
erase-page size.

Signed-off-by: Damien George <damien@micropython.org>
2022-02-22 00:37:25 +11:00
Lars Kellogg-Stedman 8f6924c9fb docs/library/uasyncio.rst: Fix description of ThreadSafeFlag.wait.
When a task waits on a ThreadSafeFlag (and the wait method returns), the
flag is immediately reset.  This was not clear in the documentation, which
appeared to copy the description of the wait method from the Event class.

Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com>
2022-02-09 16:09:48 +11:00
Jos Verlinde 6653856b87 docs/library/machine.Pin.rst: Document defaults for Pin.init. 2022-02-09 15:55:10 +11:00
Jos Verlinde 7f67524031 docs/library/pyb.SPI.rst: Document default for prescaler argument.
To prevent "non-default argument follows default argument" errors.
2022-02-09 15:06:34 +11:00
Jos Verlinde 58cd2a8b0a docs/library/esp.rst: Document the osdebug function. 2022-02-09 15:06:19 +11:00
Jos Verlinde f99b679916 docs/library/machine.WDT.rst: Use correct case for WDT.feed. 2022-02-09 15:05:49 +11:00
Jos Verlinde 7621b17636 docs/library/machine.SPI.rst: Add class constant SoftSPI.MSB and .LSB. 2022-02-09 15:05:38 +11:00
Jos Verlinde 8715ad9ccf docs/library/pyb.DAC.rst: Add DAC class constants. 2022-02-09 15:05:26 +11:00
Jos Verlinde ba4f6f5fdf docs/library/pyb.rst: Add pyb.hid_mouse and pyb.hid_keyboard constants. 2022-02-09 15:04:57 +11:00
Jos Verlinde 50b172023f docs/library/pyb.Timer.rst: Add pyb.Timer class constants. 2022-02-09 15:04:24 +11:00
Jos Verlinde 2c30ac7aeb docs/library/socket.rst: Document socket as a class.
Following CPython: https://bugs.python.org/issue45772
2022-02-09 15:03:26 +11:00
Jos Verlinde cd0531c533 docs: Use the correct * keyword-only notation. 2022-02-09 15:01:00 +11:00
Jos Verlinde a41abd94dc docs/library/collections.rst: Use class for deque and OrderedDict. 2022-02-09 15:00:00 +11:00
Damien George 79a3158de6 stm32/pin: Change remaining uses of "af" to "alt".
The keyword "af" has been deprecated for some time and "alt" should be used
instead (but "af" still works).

Signed-off-by: Damien George <damien@micropython.org>
2022-01-27 16:44:13 +11:00
Christian Decker 2e3a2785cd extmod/modubinascii: Add newline keyword to b2a_base64 function.
This allows encoding things (eg a Basic-Auth header for a request) without
slicing the \n from the string, which allocates additional memory.

Co-authored-by: David Lechner <david@lechnology.com>
2022-01-23 10:18:01 +11:00
Damien George 4d2f487ee1 docs/library: Specify additional ADC methods and new ADCBlock class.
The new ADC methods are: init(), read_uv() and block().

The new ADCBlock class has methods: init() and connect().

See related discussions in #3943, #4213.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-21 22:35:23 +11:00