aboutsummaryrefslogtreecommitdiff
path: root/docs/library
diff options
context:
space:
mode:
authorDavid Grayson <davidegrayson@gmail.com>2023-03-03 11:38:48 -0800
committerDamien George <damien@micropython.org>2023-03-09 11:44:20 +1100
commitf80d040c038c343b0709eba537014fb52bc8115e (patch)
tree145702c4816520d17faeadb8a9fc117c082394fe /docs/library
parent673957b643b111e5879efd05a2ddf0808ed613d0 (diff)
rp2/modrp2: Disable other core, shorten delay to 8us in bootsel_button.
This function seems to work fine in multi-core applications now. The delay is now in units of microseconds instead of depending on the clock speed, and is adjustable by board configuration headers. Also added documentation.
Diffstat (limited to 'docs/library')
-rw-r--r--docs/library/rp2.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/library/rp2.rst b/docs/library/rp2.rst
index ec7666d7c..7a473387b 100644
--- a/docs/library/rp2.rst
+++ b/docs/library/rp2.rst
@@ -66,6 +66,17 @@ For running PIO programs, see :class:`rp2.StateMachine`.
>>> rp2.asm_pio_encode("set(0, 1)", 0)
57345
+.. function:: bootsel_button()
+
+ Temporarily turns the QSPI_SS pin into an input and reads its value,
+ returning 1 for low and 0 for high.
+ On a typical RP2040 board with a BOOTSEL button, a return value of 1
+ indicates that the button is pressed.
+
+ Since this function temporarily disables access to the external flash
+ memory, it also temporarily disables interrupts and the other core to
+ prevent them from trying to execute code from flash.
+
.. class:: PIOASMError
This exception is raised from `asm_pio()` or `asm_pio_encode()` if there is