Skip to content

Commit d750096

Browse files
committed
Did neopixel, network, nvm
1 parent e31e9ee commit d750096

File tree

4 files changed

+33
-29
lines changed

4 files changed

+33
-29
lines changed

shared-bindings/neopixel_write/__init__.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "shared-bindings/digitalio/DigitalInOut.h"
3232
#include "supervisor/shared/translate.h"
3333

34-
//| :mod:`neopixel_write` --- Low-level neopixel implementation
34+
//| """:mod:`neopixel_write` --- Low-level neopixel implementation
3535
//| ===========================================================
3636
//|
3737
//| .. module:: neopixel_write
@@ -53,15 +53,14 @@
5353
//| pin = digitalio.DigitalInOut(board.NEOPIXEL)
5454
//| pin.direction = digitalio.Direction.OUTPUT
5555
//| pixel_off = bytearray([0, 0, 0])
56-
//| neopixel_write.neopixel_write(pin, pixel_off)
56+
//| neopixel_write.neopixel_write(pin, pixel_off)"""
5757
//|
58-
//| .. function:: neopixel_write(digitalinout, buf)
59-
//|
60-
//| Write buf out on the given DigitalInOut.
58+
//| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: bytearray) -> Any:
59+
//| """Write buf out on the given DigitalInOut.
6160
//|
6261
//| :param ~digitalio.DigitalInOut digitalinout: the DigitalInOut to output with
63-
//| :param bytearray buf: The bytes to clock out. No assumption is made about color order
64-
//|
62+
//| :param bytearray buf: The bytes to clock out. No assumption is made about color order"""
63+
//| ...
6564
STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf) {
6665
if (!MP_OBJ_IS_TYPE(digitalinout_obj, &digitalio_digitalinout_type)) {
6766
mp_raise_TypeError_varg(translate("Expected a %q"), digitalio_digitalinout_type.name);

shared-bindings/network/__init__.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#if CIRCUITPY_NETWORK
4040

41-
//| :mod:`network` --- Network Interface Management
41+
//| """:mod:`network` --- Network Interface Management
4242
//| ===============================================
4343
//|
4444
//| .. module:: network
@@ -47,11 +47,11 @@
4747
//|
4848
//| This module provides a registry of configured NICs.
4949
//| It is used by the 'socket' module to look up a suitable
50-
//| NIC when a socket is created.
50+
//| NIC when a socket is created."""
5151
//|
52-
//| .. function:: route()
53-
//|
54-
//| Returns a list of all configured NICs.
52+
//| def route() -> Any:
53+
//| """Returns a list of all configured NICs."""
54+
//| ...
5555
//|
5656

5757
STATIC mp_obj_t network_route(void) {

shared-bindings/nvm/ByteArray.c

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,33 @@
3131
#include "shared-bindings/nvm/ByteArray.h"
3232
#include "supervisor/shared/translate.h"
3333

34-
//| .. currentmodule:: nvm
34+
35+
36+
37+
//| class ByteArray:
38+
//| """.. currentmodule:: nvm
3539
//|
36-
//| :class:`ByteArray` -- Presents a stretch of non-volatile memory as a bytearray.
37-
//| ================================================================================
40+
//| :class:`ByteArray` -- Presents a stretch of non-volatile memory as a bytearray.
41+
//| ================================================================================
3842
//|
39-
//| Non-volatile memory is available as a byte array that persists over reloads
40-
//| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign
41-
//| all values to change at once.
43+
//| Non-volatile memory is available as a byte array that persists over reloads
44+
//| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign
45+
//| all values to change at once.
4246
//|
43-
//| Usage::
47+
//| Usage::
4448
//|
45-
//| import microcontroller
46-
//| microcontroller.nvm[0:3] = b"\xcc\x10\x00"
49+
//| import microcontroller
50+
//| microcontroller.nvm[0:3] = b\"\xcc\x10\x00\""""
4751
//|
4852

49-
//| .. class:: ByteArray()
50-
//|
51-
//| Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`.
53+
//| def __init__(self, ):
54+
//| """Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`."""
55+
//| ...
5256
//|
5357

54-
//| .. method:: __len__()
55-
//|
56-
//| Return the length. This is used by (`len`)
58+
//| def __len__(self, ) -> Any:
59+
//| """Return the length. This is used by (`len`)"""
60+
//| ...
5761
//|
5862
STATIC mp_obj_t nvm_bytearray_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
5963
nvm_bytearray_obj_t *self = MP_OBJ_TO_PTR(self_in);

shared-bindings/nvm/__init__.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "shared-bindings/nvm/__init__.h"
3232
#include "shared-bindings/nvm/ByteArray.h"
3333

34-
//| :mod:`nvm` --- Non-volatile memory
34+
//| """:mod:`nvm` --- Non-volatile memory
3535
//| ===========================================================
3636
//|
3737
//| .. module:: nvm
@@ -47,7 +47,8 @@
4747
//| .. toctree::
4848
//| :maxdepth: 3
4949
//|
50-
//| ByteArray
50+
//| ByteArray"""
51+
//|
5152
STATIC const mp_rom_map_elem_t nvm_module_globals_table[] = {
5253
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_nvm) },
5354
{ MP_ROM_QSTR(MP_QSTR_ByteArray), MP_ROM_PTR(&nvm_bytearray_type) },

0 commit comments

Comments
 (0)