summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorsommersoft <sommersoft@gmail.com>2018-04-06 01:58:29 +0000
committersommersoft <sommersoft@gmail.com>2018-04-06 01:58:29 +0000
commitcc644032ea81783de0e1e15b90dac2ce7913011b (patch)
treef859d54e7b8830b96cf9965dcb54c2f2daaaa21a /shared-bindings
parentd1974e0038f18ed2ffc59f0f198d998070f4c618 (diff)
parent6ee573c7c9e4912de8c518df73af81dd8c2fd935 (diff)
Merge branch 'super_status' of https://github.com/sommersoft/circuitpython into super_status
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/_stage/__init__.c29
-rw-r--r--shared-bindings/audiobusio/PDMIn.c8
-rw-r--r--shared-bindings/audiobusio/__init__.c2
-rw-r--r--shared-bindings/busio/SPI.c4
-rw-r--r--shared-bindings/busio/UART.c39
-rw-r--r--shared-bindings/busio/UART.h4
-rw-r--r--shared-bindings/busio/__init__.c8
-rw-r--r--shared-bindings/gamepad/GamePad.c7
-rw-r--r--shared-bindings/help.c11
-rw-r--r--shared-bindings/index.rst8
-rw-r--r--shared-bindings/math/__init__.c12
-rw-r--r--shared-bindings/microcontroller/Processor.c2
-rw-r--r--shared-bindings/microcontroller/__init__.c7
-rw-r--r--shared-bindings/random/__init__.c4
-rw-r--r--shared-bindings/storage/__init__.c57
-rw-r--r--shared-bindings/storage/__init__.h1
16 files changed, 158 insertions, 45 deletions
diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c
index 16e0b58d9..24a359664 100644
--- a/shared-bindings/_stage/__init__.c
+++ b/shared-bindings/_stage/__init__.c
@@ -32,7 +32,22 @@
#include "Layer.h"
#include "Text.h"
-//| .. currentmodule:: _stage
+//| :mod:`_stage` --- C-level helpers for animation of sprites on a stage
+//| =====================================================================
+//|
+//| .. module:: _stage
+//| :synopsis: C-level helpers for animation of sprites on a stage
+//| :platform: SAMD21
+//|
+//| The `_stage` module contains native code to speed-up the ```stage`` Library
+//| <https://github.com/python-ugame/circuitpython-stage>`_.
+//| Libraries
+//|
+//| .. toctree::
+//| :maxdepth: 3
+//|
+//| Layer
+//| Text
//|
//| .. function:: render(x0, y0, x1, y1, layers, buffer, spi)
//|
@@ -42,9 +57,9 @@
//| :param int y0: Top edge of the fragment.
//| :param int x1: Right edge of the fragment.
//| :param int y1: Bottom edge of the fragment.
-//| :param list layers: A list of the `Layer` objects.
+//| :param list layers: A list of the :py:class:`~_stage.Layer` objects.
//| :param bytearray buffer: A buffer to use for rendering.
-//| :param SPI spi: The SPI device to use.
+//| :param ~busio.SPI spi: The SPI bus to use.
//|
//| Note that this function only sends the raw pixel data. Setting up
//| the display for receiving it and handling the chip-select and
@@ -56,10 +71,10 @@
//| This function is intended for internal use in the ``stage`` library
//| and all the necessary checks are performed there.
STATIC mp_obj_t stage_render(size_t n_args, const mp_obj_t *args) {
- uint8_t x0 = mp_obj_get_int(args[0]);
- uint8_t y0 = mp_obj_get_int(args[1]);
- uint8_t x1 = mp_obj_get_int(args[2]);
- uint8_t y1 = mp_obj_get_int(args[3]);
+ uint16_t x0 = mp_obj_get_int(args[0]);
+ uint16_t y0 = mp_obj_get_int(args[1]);
+ uint16_t x1 = mp_obj_get_int(args[2]);
+ uint16_t y1 = mp_obj_get_int(args[3]);
size_t layers_size = 0;
mp_obj_t *layers;
diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c
index bd89ab179..6f0a130e8 100644
--- a/shared-bindings/audiobusio/PDMIn.c
+++ b/shared-bindings/audiobusio/PDMIn.c
@@ -47,13 +47,13 @@
//| Create a PDMIn object associated with the given pins. This allows you to
//| record audio signals from the given pins. Individual ports may put further
//| restrictions on the recording parameters. The overall frequency is
-//| determined by `frequency` x `oversample`, and the total must be 1MHz or
+//| determined by `frequency` x ``oversample``, and the total must be 1MHz or
//| higher, so `frequency` must be a minimum of 16000.
//|
//| :param ~microcontroller.Pin clock_pin: The pin to output the clock to
//| :param ~microcontroller.Pin data_pin: The pin to read the data from
//| :param int frequency: Target frequency of the resulting samples. Check `frequency` for actual value.
-//| Minimum frequency is about 16000 Hz.
+//| Minimum frequency is about 16000 Hz.
//| :param int bit_depth: Final number of bits per sample. Must be divisible by 8
//| :param bool mono: True when capturing a single channel of audio, captures two channels otherwise
//| :param int oversample: Number of single bit samples to decimate into a final sample. Must be divisible by 8
@@ -182,8 +182,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4,
//| audio at the given rate. For internal flash, writing all 1s to the file
//| before recording is recommended to speed up writes.
//|
-//| :return: The number of samples recorded. If this is less than `destination_length`,
-//| some samples were missed due to processing time.
+//| :return: The number of samples recorded. If this is less than ``destination_length``,
+//| some samples were missed due to processing time.
//|
STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destination, mp_obj_t destination_length) {
audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_obj);
diff --git a/shared-bindings/audiobusio/__init__.c b/shared-bindings/audiobusio/__init__.c
index 70606e496..bdd999b04 100644
--- a/shared-bindings/audiobusio/__init__.c
+++ b/shared-bindings/audiobusio/__init__.c
@@ -34,7 +34,7 @@
#include "shared-bindings/audiobusio/PDMIn.h"
//| :mod:`audiobusio` --- Support for audio input and output over digital bus
-//| =================================================
+//| =========================================================================
//|
//| .. module:: audiobusio
//| :synopsis: Support for audio input and output over digital bus
diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c
index c2889bb12..52c145d6d 100644
--- a/shared-bindings/busio/SPI.c
+++ b/shared-bindings/busio/SPI.c
@@ -258,7 +258,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write);
//|
//| :param bytearray buffer: Read data into this buffer
//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]``
-//| :param int end: End of the slice; this index is not included
+//| :param int end: End of the slice; this index is not included
//| :param int write_value: Value to write while reading. (Usually ignored.)
//|
STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
@@ -304,7 +304,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto);
//| :param bytearray buffer_out: Write out the data in this buffer
//| :param bytearray buffer_in: Read data into this buffer
//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]``
-//| :param int out_end: End of the slice; this index is not included
+//| :param int out_end: End of the slice; this index is not included
//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]``
//| :param int in_end: End of the slice; this index is not included
//|
diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c
index 3a3cb4246..1b63d8d0e 100644
--- a/shared-bindings/busio/UART.c
+++ b/shared-bindings/busio/UART.c
@@ -33,6 +33,7 @@
#include "lib/utils/context_manager_helpers.h"
#include "py/ioctl.h"
+#include "py/objproperty.h"
#include "py/runtime.h"
#include "py/stream.h"
@@ -48,11 +49,11 @@
//| A common bidirectional serial protocol that uses an an agreed upon speed
//| rather than a shared clock line.
//|
-//| :param ~microcontroller.Pin tx: the pin to transmit with
-//| :param ~microcontroller.Pin rx: the pin to receive on
-//| :param int baudrate: the transmit and receive speed
+//| :param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only.
+//| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only.
+//| :param int baudrate: the transmit and receive speed.
/// :param int bits: the number of bits per byte, 7, 8 or 9.
-/// :param Parity parity: the parity used for error checking
+/// :param Parity parity: the parity used for error checking.
/// :param int stop: the number of stop bits, 1 or 2.
/// :param int timeout: the timeout in milliseconds to wait for the first character and between subsequent characters.
/// :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.)
@@ -220,6 +221,33 @@ STATIC mp_uint_t busio_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t
return ret;
}
+//| .. attribute:: baudrate
+//|
+//| The current baudrate.
+//|
+STATIC mp_obj_t busio_uart_obj_get_baudrate(mp_obj_t self_in) {
+ busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ raise_error_if_deinited(common_hal_busio_uart_deinited(self));
+ return MP_OBJ_NEW_SMALL_INT(common_hal_busio_uart_get_baudrate(self));
+}
+MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_get_baudrate_obj, busio_uart_obj_get_baudrate);
+
+STATIC mp_obj_t busio_uart_obj_set_baudrate(mp_obj_t self_in, mp_obj_t baudrate) {
+ busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ raise_error_if_deinited(common_hal_busio_uart_deinited(self));
+ common_hal_busio_uart_set_baudrate(self, mp_obj_get_int(baudrate));
+ return mp_const_none;
+}
+MP_DEFINE_CONST_FUN_OBJ_2(busio_uart_set_baudrate_obj, busio_uart_obj_set_baudrate);
+
+
+const mp_obj_property_t busio_uart_baudrate_obj = {
+ .base.type = &mp_type_property,
+ .proxy = {(mp_obj_t)&busio_uart_get_baudrate_obj,
+ (mp_obj_t)&busio_uart_set_baudrate_obj,
+ (mp_obj_t)&mp_const_none_obj},
+};
+
//| .. class:: busio.UART.Parity
//|
//| Enum-like class to define the parity used to verify correct data transfer.
@@ -274,6 +302,9 @@ STATIC const mp_rom_map_elem_t busio_uart_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) },
+ // Properties
+ { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&busio_uart_baudrate_obj) },
+
// Nested Enum-like Classes.
{ MP_ROM_QSTR(MP_QSTR_Parity), MP_ROM_PTR(&busio_uart_parity_type) },
};
diff --git a/shared-bindings/busio/UART.h b/shared-bindings/busio/UART.h
index 28196931a..fa39d8ad5 100644
--- a/shared-bindings/busio/UART.h
+++ b/shared-bindings/busio/UART.h
@@ -55,6 +55,10 @@ extern size_t common_hal_busio_uart_read(busio_uart_obj_t *self,
extern size_t common_hal_busio_uart_write(busio_uart_obj_t *self,
const uint8_t *data, size_t len, int *errcode);
+extern uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self);
+extern void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate);
+
+
extern uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self);
extern bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self);
diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c
index 6956e3c3d..958ee062a 100644
--- a/shared-bindings/busio/__init__.c
+++ b/shared-bindings/busio/__init__.c
@@ -32,9 +32,9 @@
#include "shared-bindings/microcontroller/Pin.h"
#include "shared-bindings/busio/__init__.h"
#include "shared-bindings/busio/I2C.h"
-//xxxx #include "shared-bindings/busio/OneWire.h"
+#include "shared-bindings/busio/OneWire.h"
#include "shared-bindings/busio/SPI.h"
-//xxxx #include "shared-bindings/busio/UART.h"
+#include "shared-bindings/busio/UART.h"
#include "shared-bindings/busio/__init__.h"
#include "py/runtime.h"
@@ -89,8 +89,8 @@ STATIC const mp_rom_map_elem_t busio_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_busio) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&busio_i2c_type) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&busio_spi_type) },
- //xxxx { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&busio_onewire_type) },
- //xxxx { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&busio_uart_type) },
+ { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&busio_onewire_type) },
+ { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&busio_uart_type) },
};
STATIC MP_DEFINE_CONST_DICT(busio_module_globals, busio_module_globals_table);
diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c
index bdc3359fb..a03b9318d 100644
--- a/shared-bindings/gamepad/GamePad.c
+++ b/shared-bindings/gamepad/GamePad.c
@@ -49,8 +49,8 @@ gamepad_obj_t* gamepad_singleton = NULL;
//|
//|
//| pad = gamepad.GamePad(
-//| digitalio.DigitalInOut(board.D0),
-//| digitalio.DigitalInOut(board.D1),
+//| digitalio.DigitalInOut(board.D10),
+//| digitalio.DigitalInOut(board.D11),
//| )
//|
//| y = 0
@@ -63,8 +63,9 @@ gamepad_obj_t* gamepad_singleton = NULL;
//| y += 1
//| print(y)
//| time.sleep(0.1)
-//| while pad.get_pressed():
+//| while buttons:
//| # Wait for all buttons to be released.
+//| buttons = pad.get_pressed()
//| time.sleep(0.1)
//|
diff --git a/shared-bindings/help.c b/shared-bindings/help.c
index a3ae94797..d8ffc13dd 100644
--- a/shared-bindings/help.c
+++ b/shared-bindings/help.c
@@ -26,7 +26,16 @@
#include "genhdr/mpversion.h"
-const char *circuitpython_help_text =
+//| :func:`help` - Built-in method to provide helpful information
+//| ==============================================================
+//|
+//| .. method:: help(object=None)
+//|
+//| Prints a help method about the given object. When ``object`` is none,
+//| prints general port information.
+//|
+
+const char circuitpython_help_text[] =
"Welcome to Adafruit CircuitPython " MICROPY_GIT_TAG "!\r\n"
"\r\n"
"Please visit learn.adafruit.com/category/circuitpython for project guides.\r\n"
diff --git a/shared-bindings/index.rst b/shared-bindings/index.rst
index 1813d5699..a43270e15 100644
--- a/shared-bindings/index.rst
+++ b/shared-bindings/index.rst
@@ -17,9 +17,9 @@ SAMD51, SAMD51 Express, and ESP8266.
NOTE 2: **SAMD** and/or **SAMD Express** without additional numbers, means both SAMD21 & SAMD51 versions
are supported.
-================= ===============
-Module Supported Ports
-================= ===============
+================= ==============================
+Module Supported Ports
+================= ==============================
`analogio` **All Supported**
`audiobusio` **SAMD/SAMD Express**
`audioio` **SAMD Express**
@@ -43,7 +43,7 @@ Module Supported Ports
`touchio` **SAMD/SAMD Express**
`uheap` **Debug (All)**
`usb_hid` **SAMD/SAMD Express**
-================= ===============
+================= ==============================
Modules
---------
diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c
index 76ba80c95..84827842f 100644
--- a/shared-bindings/math/__init__.c
+++ b/shared-bindings/math/__init__.c
@@ -176,7 +176,7 @@ STATIC NORETURN void math_error(void) {
//|
//| .. function:: pow(x, y)
//|
- //| Returns `x` to the power of `y`.
+ //| Returns ``x`` to the power of ``y``.
//|
//| .. function:: radians(x)
//|
@@ -188,7 +188,7 @@ STATIC NORETURN void math_error(void) {
//|
//| .. function:: sqrt(x)
//|
- //| Returns the square root of `x`.
+ //| Returns the square root of ``x``.
//|
//| .. function:: tan(x)
//|
@@ -299,25 +299,25 @@ MATH_FUN_2(ldexp, ldexp)
// .. function:: erf(x)
//
-// Return the error function of `x`.
+// Return the error function of ``x``.
//
MATH_FUN_1(erf, erf)
// .. function:: erfc(x)
//
-// Return the complementary error function of `x`.
+// Return the complementary error function of ``x``.
//
MATH_FUN_1(erfc, erfc)
// .. function:: gamma(x)
//
-// Return the gamma function of `x`.
+// Return the gamma function of ``x``.
//
MATH_FUN_1(gamma, tgamma)
// .. function:: lgamma(x)
//
-// Return the natural logarithm of the gamma function of `x`.
+// Return the natural logarithm of the gamma function of ``x``.
//
MATH_FUN_1(lgamma, lgamma)
#endif
diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c
index a311f1866..be685b0a8 100644
--- a/shared-bindings/microcontroller/Processor.c
+++ b/shared-bindings/microcontroller/Processor.c
@@ -37,7 +37,7 @@
//| .. currentmodule:: microcontroller
//|
//| :class:`Processor` --- Microcontroller CPU information and control
-//| --------------------------------------------------------
+//| ------------------------------------------------------------------
//|
//| Get information about the microcontroller CPU and control it.
//|
diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c
index f261178f0..0c627cdf9 100644
--- a/shared-bindings/microcontroller/__init__.c
+++ b/shared-bindings/microcontroller/__init__.c
@@ -59,11 +59,12 @@
//|
//| Pin
//| Processor
+//| RunMode
//|
//| .. attribute:: cpu
//|
-//| CPU information and control, such as `cpu.temperature` and `cpu.frequency`
+//| CPU information and control, such as ``cpu.temperature`` and ``cpu.frequency``
//| (clock frequency).
//| This object is the sole instance of `microcontroller.Processor`.
//|
@@ -74,7 +75,7 @@
//| because this stops all other functions from completing. Think of this as an empty
//| ``while`` loop that runs for the specified ``(delay)`` time. If you have other
//| code or peripherals (e.g audio recording) that require specific timing or
-//| processing while you are waiting, explore a different avenue such as using
+//| processing while you are waiting, explore a different avenue such as using
//| `time.sleep()`.
//|
STATIC mp_obj_t mcu_delay_us(mp_obj_t delay_obj) {
@@ -134,7 +135,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mcu_on_next_reset_obj, mcu_on_next_reset);
//| .. method:: reset()
//|
//| Reset the microcontroller. After reset, the microcontroller will enter the
-//| run mode last set by `one_next_reset`.
+//| run mode last set by `on_next_reset`.
//|
//| .. warning:: This may result in file system corruption when connected to a
//| host computer. Be very careful when calling this! Make sure the device
diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c
index fe52c1fc0..cea437e98 100644
--- a/shared-bindings/random/__init__.c
+++ b/shared-bindings/random/__init__.c
@@ -79,7 +79,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_getrandbits_obj, random_getrandbits);
//| .. function:: randrange(stop)
//| randrange(start, stop, step=1)
//|
-//| Returns a randomly selected integer from `range(start, stop, step)`.
+//| Returns a randomly selected integer from ``range(start, stop, step)``.
//|
STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) {
mp_int_t start = 0;
@@ -122,7 +122,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(random_randrange_obj, 1, 3, random_ra
//| .. function:: randint(a, b)
//|
//| Returns a randomly selected integer between a and b inclusive. Equivalent
-//| to `randrange(a, b + 1, 1)`
+//| to ``randrange(a, b + 1, 1)``
//|
STATIC mp_obj_t random_randint(mp_obj_t a_in, mp_obj_t b_in) {
mp_int_t a = mp_obj_get_int(a_in);
diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c
index 9c186a051..734cabcc1 100644
--- a/shared-bindings/storage/__init__.c
+++ b/shared-bindings/storage/__init__.c
@@ -43,9 +43,7 @@
//| The `storage` provides storage management functionality such as mounting and
//| unmounting which is typically handled by the operating system hosting Python.
//| CircuitPython does not have an OS, so this module provides this functionality
-//| directly. Its based on MicroPython's `uos` module but deliberately separates
-//| CPython compatible functionality (in `os`) from incompatible functionality
-//| (in `storage`).
+//| directly.
//|
//| .. function:: mount(filesystem, mount_path, \*, readonly=False)
@@ -124,12 +122,22 @@ mp_obj_t storage_remount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_a
}
MP_DEFINE_CONST_FUN_OBJ_KW(storage_remount_obj, 1, storage_remount);
+//| .. function:: getmount(mount_path)
+//|
+//| Retrieves the mount object associated with the mount path
+//|
+mp_obj_t storage_getmount(const mp_obj_t mnt_in) {
+ return common_hal_storage_getmount(mp_obj_str_get_str(mnt_in));
+}
+MP_DEFINE_CONST_FUN_OBJ_1(storage_getmount_obj, storage_getmount);
+
STATIC const mp_rom_map_elem_t storage_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_storage) },
{ MP_ROM_QSTR(MP_QSTR_mount), MP_ROM_PTR(&storage_mount_obj) },
{ MP_ROM_QSTR(MP_QSTR_umount), MP_ROM_PTR(&storage_umount_obj) },
{ MP_ROM_QSTR(MP_QSTR_remount), MP_ROM_PTR(&storage_remount_obj) },
+ { MP_ROM_QSTR(MP_QSTR_getmount), MP_ROM_PTR(&storage_getmount_obj) },
//| .. class:: VfsFat(block_device)
//|
@@ -137,6 +145,49 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = {
//|
//| :param block_device: Block device the the filesystem lives on
//|
+ //| .. attribute:: label
+ //|
+ //| The filesystem label, up to 11 case-insensitive bytes. Note that
+ //| this property can only be set when the device is writable by the
+ //| microcontroller.
+ //|
+ //| .. method:: mkfs
+ //|
+ //| Format the block device, deleting any data that may have been there
+ //|
+ //| .. method:: open(path, mode)
+ //|
+ //| Like builtin ``open()``
+ //|
+ //| .. method:: ilistdir([path])
+ //|
+ //| Return an iterator whose values describe files and folders within
+ //| ``path``
+ //|
+ //| .. method:: mkdir(path)
+ //|
+ //| Like `os.mkdir`
+ //|
+ //| .. method:: rmdir(path)
+ //|
+ //| Like `os.rmdir`
+ //|
+ //| .. method:: stat(path)
+ //|
+ //| Like `os.stat`
+ //|
+ //| .. method:: statvfs(path)
+ //|
+ //| Like `os.statvfs`
+ //|
+ //| .. method:: mount(readonly, mkfs)
+ //|
+ //| Don't call this directly, call `storage.mount`.
+ //|
+ //| .. method:: umount
+ //|
+ //| Don't call this directly, call `storage.umount`.
+ //|
{ MP_ROM_QSTR(MP_QSTR_VfsFat), MP_ROM_PTR(&mp_fat_vfs_type) },
};
diff --git a/shared-bindings/storage/__init__.h b/shared-bindings/storage/__init__.h
index 574b5ff8d..76b9ae854 100644
--- a/shared-bindings/storage/__init__.h
+++ b/shared-bindings/storage/__init__.h
@@ -34,5 +34,6 @@ void common_hal_storage_mount(mp_obj_t vfs_obj, const char* path, bool readonly)
void common_hal_storage_umount_path(const char* path);
void common_hal_storage_umount_object(mp_obj_t vfs_obj);
void common_hal_storage_remount(const char* path, bool readonly);
+mp_obj_t common_hal_storage_getmount(const char* path);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_STORAGE___INIT___H