diff options
| author | dherrada <dylan.herrada@adafruit.com> | 2020-07-02 13:25:07 -0400 |
|---|---|---|
| committer | dherrada <dylan.herrada@adafruit.com> | 2020-07-02 13:25:07 -0400 |
| commit | 522b17ca93d4e1d64bb113057c8a62992a22c4ab (patch) | |
| tree | 8c05d048acf8e56b066ac5a27eedf7d8df91d0fd /shared-bindings/busio | |
| parent | ac113fdc815f31b54d742f73265359787bd95290 (diff) | |
Made suggested changes
Diffstat (limited to 'shared-bindings/busio')
| -rw-r--r-- | shared-bindings/busio/I2C.c | 4 | ||||
| -rw-r--r-- | shared-bindings/busio/SPI.c | 4 | ||||
| -rw-r--r-- | shared-bindings/busio/UART.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index eb33a2459..0b4079d4f 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -176,7 +176,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: Union[bytearray, memoryview], *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -287,7 +287,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 3d28adbcb..12eccab95 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//| def write(self, buffer: bytes, *, start: int = 0, end: int = None) -> None: +//| def write(self, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None: //| """Write the data contained in ``buffer``. The SPI object must be locked. //| If the buffer is empty, nothing happens. //| @@ -314,7 +314,7 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: int = 0, out_end: int = None, in_start: None = 0, in_end: int = None) -> None: +//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The SPI object must be locked. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 133caee19..af0d4dbcd 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -190,7 +190,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def readinto(self, buf: bytes) -> Optional[int]: +//| def readinto(self, buf: Union[bytearray, memoryview]) -> Optional[int]: //| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| //| :return: number of bytes read and stored into ``buf`` @@ -200,7 +200,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def readline(self, ) -> Optional[int]: +//| def readline(self, ) -> bytes: //| """Read a line, ending in a newline character. //| //| :return: the line read @@ -208,7 +208,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def write(self, buf: bytearray) -> Optional[int]: +//| def write(self, buf: Union[bytearray, memoryview]) -> Optional[int]: //| """Write the buffer of bytes to the bus. //| //| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. |
