summaryrefslogtreecommitdiff
path: root/shared-bindings/i2cperipheral/I2CPeripheral.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-07-22 14:00:28 -0700
committerGitHub <noreply@github.com>2020-07-22 14:00:28 -0700
commit049921fec8be3ccd9c3a29e14f21e6ffa76b09ea (patch)
tree4350f9a3e8c0c9a04882c682db8951f0dc266f75 /shared-bindings/i2cperipheral/I2CPeripheral.c
parent1ec358094671716cadf9b17ca51deb346070bcae (diff)
parent02b71e013adda29cd67172a3782fda8fa5da0bba (diff)
Merge branch 'main' into memmonitor
Diffstat (limited to 'shared-bindings/i2cperipheral/I2CPeripheral.c')
-rw-r--r--shared-bindings/i2cperipheral/I2CPeripheral.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c
index 4a3900174..b528ca9c3 100644
--- a/shared-bindings/i2cperipheral/I2CPeripheral.c
+++ b/shared-bindings/i2cperipheral/I2CPeripheral.c
@@ -52,7 +52,7 @@ STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2
//| class I2CPeripheral:
//| """Two wire serial protocol peripheral"""
//|
-//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False):
+//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False) -> None:
//| """I2C is a two-wire protocol for communicating between devices.
//| This implements the peripheral (sensor, secondary) side.
//|
@@ -102,7 +102,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type,
return (mp_obj_t)self;
}
-//| def deinit(self, ) -> Any:
+//| def deinit(self) -> None:
//| """Releases control of the underlying hardware so other classes can use it."""
//| ...
//|
@@ -114,13 +114,13 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit);
-//| def __enter__(self, ) -> Any:
+//| def __enter__(self) -> I2CPeripheral:
//| """No-op used in Context Managers."""
//| ...
//|
// Provided by context manager helper.
-//| def __exit__(self, ) -> Any:
+//| def __exit__(self) -> None:
//| """Automatically deinitializes the hardware on context exit. See
//| :ref:`lifetime-and-contextmanagers` for more info."""
//| ...
@@ -133,7 +133,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const m
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__);
-//| def request(self, timeout: float = -1) -> Any:
+//| def request(self, timeout: float = -1) -> I2CPeripheralRequest:
//| """Wait for an I2C request.
//|
//| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once
@@ -227,7 +227,7 @@ const mp_obj_type_t i2cperipheral_i2c_peripheral_type = {
//| class I2CPeripheralRequest:
//|
-//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool):
+//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool) -> None:
//| """Information about an I2C transfer request
//| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`.
//|
@@ -241,13 +241,13 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_
return mp_obj_new_i2cperipheral_i2c_peripheral_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3]));
}
-//| def __enter__(self, ) -> Any:
+//| def __enter__(self) -> I2CPeripheralRequest:
//| """No-op used in Context Managers."""
//| ...
//|
// Provided by context manager helper.
-//| def __exit__(self, ) -> Any:
+//| def __exit__(self) -> None:
//| """Close the request."""
//| ...
//|
@@ -383,7 +383,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cperipheral_i2c_peripheral_request_write_obj, i2cperipheral_i2c_peripheral_request_write);
-//| def ack(self, ack: bool = True) -> Any:
+//| def ack(self, ack: bool = True) -> None:
//| """Acknowledge or Not Acknowledge last byte received.
//| Use together with :py:meth:`I2CPeripheralRequest.read` ack=False.
//|