diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7477df61cf..0d85926310 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Please note that this project is released with a -[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/master/CODE_OF_CONDUCT.md). +[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. Participation covers any forum used to converse about CircuitPython including unofficial and official spaces. Failure to do so will result in corrective actions such as time out or ban from the project. diff --git a/README.rst b/README.rst index dfddd13373..347b8b8c6b 100644 --- a/README.rst +++ b/README.rst @@ -55,12 +55,12 @@ Contributing ------------ See -`CONTRIBUTING.md `__ +`CONTRIBUTING.md `__ for full guidelines but please be aware that by contributing to this project you are agreeing to the `Code of -Conduct `__. +Conduct `__. Contributors who follow the `Code of -Conduct `__ +Conduct `__ are welcome to submit pull requests and they will be promptly reviewed by project admins. Please join the `Discord `__ too. @@ -96,7 +96,6 @@ CircuitPython: - Supports native USB on all boards, allowing file editing without special tools. - Supports only SAMD21, SAMD51, nRF52840, CXD56, STM32F4 and i.MX RT ports. -- Tracks MicroPython's releases (not master). - Floats (aka decimals) are enabled for all builds. - Error messages are translated into 10+ languages. - Does not support concurrency within Python (including interrupts and threading). Some concurrency @@ -211,8 +210,8 @@ The remaining port directories not listed above are in the repo to maintain comp `back to top <#circuitpython>`__ -.. |Build Status| image:: https://travis-ci.com/adafruit/circuitpython.svg?branch=master - :target: https://travis-ci.org/adafruit/circuitpython +.. |Build Status| image:: https://github.com/adafruit/circuitpython/workflows/Build%20CI/badge.svg + :target: https://github.com/adafruit/circuitpython/actions?query=branch%3Amain .. |Doc Status| image:: https://readthedocs.org/projects/circuitpython/badge/?version=latest :target: http://circuitpython.readthedocs.io/ .. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg diff --git a/docs/README.md b/docs/README.md index e98b46f67b..19c81a2fa3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,7 +5,7 @@ The latest documentation can be found at: http://circuitpython.readthedocs.io/en/latest/ The documentation you see there is generated from the files in the whole tree: -https://github.com/adafruit/circuitpython/tree/master +https://github.com/adafruit/circuitpython/tree/main Building the documentation locally ---------------------------------- diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 6f87ecf798..2d52e988b0 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -1,9 +1,11 @@ +.. role:: strike + Design Guide ============ This guide covers a variety of development practices for CircuitPython core and library APIs. These APIs are both `built-into CircuitPython -`_ and those that are +`_ and those that are `distributed on GitHub `_ and in the `Adafruit `_ and `Community `_ bundles. Consistency with these @@ -46,6 +48,41 @@ not have the ``adafruit_`` module or package prefix. Both should have the CircuitPython repository topic on GitHub. +Terminology +----------- + +As our Code of Conduct states, we strive to use "welcoming and inclusive +language." Whether it is in documentation or in code, the words we use matter. +This means we disfavor language that due to historical and social context can +make community members and potential community members feel unwelcome. + +There are specific terms to avoid except where technical limitations require it. +While specific cases may call for other terms, consider using these suggested +terms first: + ++--------------------+---------------------+ +| Preferred | Deprecated | ++====================+=====================+ +| Main (device) | :strike:`Master` | ++--------------------+---------------------+ +| Peripheral | :strike:`Slave` | ++--------------------+ + +| Sensor | | ++--------------------+ + +| Secondary (device) | | ++--------------------+---------------------+ +| Denylist | :strike:`Blacklist` | ++--------------------+---------------------+ +| Allowlist | :strike:`Whitelist` | ++--------------------+---------------------+ + +Note that "technical limitations" refers e.g., to the situation where an +upstream library or URL has to contain those substrings in order to work. +However, when it comes to documentation and the names of parameters and +properties in CircuitPython, we will use alternate terms even if this breaks +tradition with past practice. + + .. _lifetime-and-contextmanagers: Lifetime and ContextManagers diff --git a/docs/porting.rst b/docs/porting.rst index d28f56f475..db4ae76262 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -64,7 +64,7 @@ as a natural "TODO" list. An example minimal build list is shown below: CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok) # These modules are implemented in shared-module/ - they can be included in diff --git a/docs/redirects.txt b/docs/redirects.txt index 68d0b2de2e..28dc73aba2 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -32,8 +32,8 @@ shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time -shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cslave/#i2cslave.I2CSlave -shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cslave/#i2cslave.I2CSlaveRequest +shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheral +shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheralRequest shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire diff --git a/docs/static/customstyle.css b/docs/static/customstyle.css index 6c964b762c..3c0bc84243 100644 --- a/docs/static/customstyle.css +++ b/docs/static/customstyle.css @@ -24,3 +24,7 @@ overflow: visible !important; } } + +.strike { + text-decoration: line-through; +} diff --git a/extmod/machine_i2c.c b/extmod/machine_i2c.c deleted file mode 100644 index 4129ace0a0..0000000000 --- a/extmod/machine_i2c.c +++ /dev/null @@ -1,641 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include -#include - -#include "py/mperrno.h" -#include "py/mphal.h" -#include "py/runtime.h" -#include "extmod/machine_i2c.h" - -#include "supervisor/shared/translate.h" - -#if MICROPY_PY_MACHINE_I2C - -typedef mp_machine_soft_i2c_obj_t machine_i2c_obj_t; - -STATIC void mp_hal_i2c_delay(machine_i2c_obj_t *self) { - // We need to use an accurate delay to get acceptable I2C - // speeds (eg 1us should be not much more than 1us). - mp_hal_delay_us_fast(self->us_delay); -} - -STATIC void mp_hal_i2c_scl_low(machine_i2c_obj_t *self) { - mp_hal_pin_od_low(self->scl); -} - -STATIC int mp_hal_i2c_scl_release(machine_i2c_obj_t *self) { - uint32_t count = self->us_timeout; - - mp_hal_pin_od_high(self->scl); - mp_hal_i2c_delay(self); - // For clock stretching, wait for the SCL pin to be released, with timeout. - for (; mp_hal_pin_read(self->scl) == 0 && count; --count) { - mp_hal_delay_us_fast(1); - } - if (count == 0) { - return -MP_ETIMEDOUT; - } - return 0; // success -} - -STATIC void mp_hal_i2c_sda_low(machine_i2c_obj_t *self) { - mp_hal_pin_od_low(self->sda); -} - -STATIC void mp_hal_i2c_sda_release(machine_i2c_obj_t *self) { - mp_hal_pin_od_high(self->sda); -} - -STATIC int mp_hal_i2c_sda_read(machine_i2c_obj_t *self) { - return mp_hal_pin_read(self->sda); -} - -STATIC int mp_hal_i2c_start(machine_i2c_obj_t *self) { - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - mp_hal_i2c_sda_low(self); - mp_hal_i2c_delay(self); - return 0; // success -} - -STATIC int mp_hal_i2c_stop(machine_i2c_obj_t *self) { - mp_hal_i2c_delay(self); - mp_hal_i2c_sda_low(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - return ret; -} - -STATIC void mp_hal_i2c_init(machine_i2c_obj_t *self, uint32_t freq) { - self->us_delay = 500000 / freq; - if (self->us_delay == 0) { - self->us_delay = 1; - } - mp_hal_pin_open_drain(self->scl); - mp_hal_pin_open_drain(self->sda); - mp_hal_i2c_stop(self); // ignore error -} - -// return value: -// 0 - byte written and ack received -// 1 - byte written and nack received -// <0 - error, with errno being the negative of the return value -STATIC int mp_hal_i2c_write_byte(machine_i2c_obj_t *self, uint8_t val) { - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - - for (int i = 7; i >= 0; i--) { - if ((val >> i) & 1) { - mp_hal_i2c_sda_release(self); - } else { - mp_hal_i2c_sda_low(self); - } - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - mp_hal_i2c_sda_release(self); - return ret; - } - mp_hal_i2c_scl_low(self); - } - - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - - int ack = mp_hal_i2c_sda_read(self); - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - - return ack; -} - -// return value: -// 0 - success -// <0 - error, with errno being the negative of the return value -STATIC int mp_hal_i2c_read_byte(machine_i2c_obj_t *self, uint8_t *val, int nack) { - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - mp_hal_i2c_delay(self); - - uint8_t data = 0; - for (int i = 7; i >= 0; i--) { - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - data = (data << 1) | mp_hal_i2c_sda_read(self); - mp_hal_i2c_scl_low(self); - mp_hal_i2c_delay(self); - } - *val = data; - - // send ack/nack bit - if (!nack) { - mp_hal_i2c_sda_low(self); - } - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - mp_hal_i2c_sda_release(self); - return ret; - } - mp_hal_i2c_scl_low(self); - mp_hal_i2c_sda_release(self); - - return 0; // success -} - -// return value: -// >=0 - number of acks received -// <0 - error, with errno being the negative of the return value -int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - - // start the I2C transaction - int ret = mp_hal_i2c_start(self); - if (ret != 0) { - return ret; - } - - // write the slave address - ret = mp_hal_i2c_write_byte(self, addr << 1); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, release the bus cleanly - mp_hal_i2c_stop(self); - return -MP_ENODEV; - } - - // write the buffer to the I2C memory - int num_acks = 0; - while (len--) { - ret = mp_hal_i2c_write_byte(self, *src++); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, stop sending - break; - } - ++num_acks; - } - - // finish the I2C transaction - if (stop) { - ret = mp_hal_i2c_stop(self); - if (ret != 0) { - return ret; - } - } - - return num_acks; -} - -// return value: -// 0 - success -// <0 - error, with errno being the negative of the return value -int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - - // start the I2C transaction - int ret = mp_hal_i2c_start(self); - if (ret != 0) { - return ret; - } - - // write the slave address - ret = mp_hal_i2c_write_byte(self, (addr << 1) | 1); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, release the bus cleanly - mp_hal_i2c_stop(self); - return -MP_ENODEV; - } - - // read the bytes from the slave - while (len--) { - ret = mp_hal_i2c_read_byte(self, dest++, len == 0); - if (ret != 0) { - return ret; - } - } - - // finish the I2C transaction - if (stop) { - ret = mp_hal_i2c_stop(self); - if (ret != 0) { - return ret; - } - } - - return 0; // success -} - -/******************************************************************************/ -// MicroPython bindings for I2C - -STATIC void machine_i2c_obj_init_helper(machine_i2c_obj_t *self, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_scl, ARG_sda, ARG_freq, ARG_timeout }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_freq, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 400000} }, - { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 255} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - self->scl = mp_hal_get_pin_obj(args[ARG_scl].u_obj); - self->sda = mp_hal_get_pin_obj(args[ARG_sda].u_obj); - self->us_timeout = args[ARG_timeout].u_int; - mp_hal_i2c_init(self, args[ARG_freq].u_int); -} - -STATIC mp_obj_t machine_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - // check the id argument, if given - if (n_args > 0) { - if (args[0] != MP_OBJ_NEW_SMALL_INT(-1)) { - #if defined(MICROPY_PY_MACHINE_I2C_MAKE_NEW) - // dispatch to port-specific constructor - extern mp_obj_t MICROPY_PY_MACHINE_I2C_MAKE_NEW(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *all_args, mp_map_t *kw_args); - return MICROPY_PY_MACHINE_I2C_MAKE_NEW(type, n_args, args, kw_args); - #else - mp_raise_ValueError(translate("invalid I2C peripheral")); - #endif - } - --n_args; - ++args; - } - - // create new soft I2C object - machine_i2c_obj_t *self = m_new_obj(machine_i2c_obj_t); - self->base.type = &machine_i2c_type; - machine_i2c_obj_init_helper(self, n_args, args, kw_args); - return (mp_obj_t)self; -} - -STATIC mp_obj_t machine_i2c_obj_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - machine_i2c_obj_init_helper(args[0], n_args - 1, args + 1, kw_args); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_init_obj, 1, machine_i2c_obj_init); - -STATIC mp_obj_t machine_i2c_scan(mp_obj_t self_in) { - mp_obj_base_t *self = MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_obj_t list = mp_obj_new_list(0, NULL); - // 7-bit addresses 0b0000xxx and 0b1111xxx are reserved - for (int addr = 0x08; addr < 0x78; ++addr) { - int ret = i2c_p->writeto(self, addr, NULL, 0, true); - if (ret == 0) { - mp_obj_list_append(list, MP_OBJ_NEW_SMALL_INT(addr)); - } - } - return list; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_scan_obj, machine_i2c_scan); - -STATIC mp_obj_t machine_i2c_start(mp_obj_t self_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->start == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - int ret = i2c_p->start(self); - if (ret != 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_start_obj, machine_i2c_start); - -STATIC mp_obj_t machine_i2c_stop(mp_obj_t self_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->stop == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - int ret = i2c_p->stop(self); - if (ret != 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_stop_obj, machine_i2c_stop); - -STATIC mp_obj_t machine_i2c_readinto(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->read == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - - // get the buffer to read into - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); - - // work out if we want to send a nack at the end - bool nack = (n_args == 2) ? true : mp_obj_is_true(args[2]); - - // do the read - int ret = i2c_p->read(self, bufinfo.buf, bufinfo.len, nack); - if (ret != 0) { - mp_raise_OSError(-ret); - } - - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readinto_obj, 2, 3, machine_i2c_readinto); - -STATIC mp_obj_t machine_i2c_write(mp_obj_t self_in, mp_obj_t buf_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->write == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - - // get the buffer to write from - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); - - // do the write - int ret = i2c_p->write(self, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - // return number of acks received - return MP_OBJ_NEW_SMALL_INT(ret); -} -MP_DEFINE_CONST_FUN_OBJ_2(machine_i2c_write_obj, machine_i2c_write); - -STATIC mp_obj_t machine_i2c_readfrom(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[2])); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->readfrom(self, addr, (uint8_t*)vstr.buf, vstr.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readfrom_obj, 3, 4, machine_i2c_readfrom); - -STATIC mp_obj_t machine_i2c_readfrom_into(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_WRITE); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->readfrom(self, addr, bufinfo.buf, bufinfo.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readfrom_into_obj, 3, 4, machine_i2c_readfrom_into); - -STATIC mp_obj_t machine_i2c_writeto(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_READ); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->writeto(self, addr, bufinfo.buf, bufinfo.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - // return number of acks received - return MP_OBJ_NEW_SMALL_INT(ret); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_writeto_obj, 3, 4, machine_i2c_writeto); - -STATIC int read_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t addrsize, uint8_t *buf, size_t len) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - uint8_t memaddr_buf[4]; - size_t memaddr_len = 0; - for (int16_t i = addrsize - 8; i >= 0; i -= 8) { - memaddr_buf[memaddr_len++] = memaddr >> i; - } - int ret = i2c_p->writeto(self, addr, memaddr_buf, memaddr_len, false); - if (ret != memaddr_len) { - // must generate STOP - i2c_p->writeto(self, addr, NULL, 0, true); - return ret; - } - return i2c_p->readfrom(self, addr, buf, len, true); -} - -#define MAX_MEMADDR_SIZE (4) -#define BUF_STACK_SIZE (12) - -STATIC int write_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t addrsize, const uint8_t *buf, size_t len) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - - // need some memory to create the buffer to send; try to use stack if possible - uint8_t buf2_stack[MAX_MEMADDR_SIZE + BUF_STACK_SIZE]; - uint8_t *buf2; - size_t buf2_alloc = 0; - if (len <= BUF_STACK_SIZE) { - buf2 = buf2_stack; - } else { - buf2_alloc = MAX_MEMADDR_SIZE + len; - buf2 = m_new(uint8_t, buf2_alloc); - } - - // create the buffer to send - size_t memaddr_len = 0; - for (int16_t i = addrsize - 8; i >= 0; i -= 8) { - buf2[memaddr_len++] = memaddr >> i; - } - memcpy(buf2 + memaddr_len, buf, len); - - int ret = i2c_p->writeto(self, addr, buf2, memaddr_len + len, true); - if (buf2_alloc != 0) { - m_del(uint8_t, buf2, buf2_alloc); - } - return ret; -} - -STATIC const mp_arg_t machine_i2c_mem_allowed_args[] = { - { MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_memaddr, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_arg, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_addrsize, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} }, -}; - -STATIC mp_obj_t machine_i2c_readfrom_mem(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_n, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // create the buffer to store data into - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[ARG_n].u_obj)); - - // do the transfer - int ret = read_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, (uint8_t*)vstr.buf, vstr.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_readfrom_mem_obj, 1, machine_i2c_readfrom_mem); - - -STATIC mp_obj_t machine_i2c_readfrom_mem_into(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_buf, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // get the buffer to store data into - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buf].u_obj, &bufinfo, MP_BUFFER_WRITE); - - // do the transfer - int ret = read_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_readfrom_mem_into_obj, 1, machine_i2c_readfrom_mem_into); - -STATIC mp_obj_t machine_i2c_writeto_mem(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_buf, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // get the buffer to write the data from - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buf].u_obj, &bufinfo, MP_BUFFER_READ); - - // do the transfer - int ret = write_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_writeto_mem_obj, 1, machine_i2c_writeto_mem); - -STATIC const mp_rom_map_elem_t machine_i2c_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_i2c_init_obj) }, - { MP_ROM_QSTR(MP_QSTR_scan), MP_ROM_PTR(&machine_i2c_scan_obj) }, - - // primitive I2C operations - { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&machine_i2c_start_obj) }, - { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&machine_i2c_stop_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&machine_i2c_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&machine_i2c_write_obj) }, - - // standard bus operations - { MP_ROM_QSTR(MP_QSTR_readfrom), MP_ROM_PTR(&machine_i2c_readfrom_obj) }, - { MP_ROM_QSTR(MP_QSTR_readfrom_into), MP_ROM_PTR(&machine_i2c_readfrom_into_obj) }, - { MP_ROM_QSTR(MP_QSTR_writeto), MP_ROM_PTR(&machine_i2c_writeto_obj) }, - - // memory operations - { MP_ROM_QSTR(MP_QSTR_readfrom_mem), MP_ROM_PTR(&machine_i2c_readfrom_mem_obj) }, - { MP_ROM_QSTR(MP_QSTR_readfrom_mem_into), MP_ROM_PTR(&machine_i2c_readfrom_mem_into_obj) }, - { MP_ROM_QSTR(MP_QSTR_writeto_mem), MP_ROM_PTR(&machine_i2c_writeto_mem_obj) }, -}; - -MP_DEFINE_CONST_DICT(mp_machine_soft_i2c_locals_dict, machine_i2c_locals_dict_table); - -int mp_machine_soft_i2c_read(mp_obj_base_t *self_in, uint8_t *dest, size_t len, bool nack) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - while (len--) { - int ret = mp_hal_i2c_read_byte(self, dest++, nack && (len == 0)); - if (ret != 0) { - return ret; - } - } - return 0; // success -} - -int mp_machine_soft_i2c_write(mp_obj_base_t *self_in, const uint8_t *src, size_t len) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - int num_acks = 0; - while (len--) { - int ret = mp_hal_i2c_write_byte(self, *src++); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, stop sending - break; - } - ++num_acks; - } - return num_acks; -} - -STATIC const mp_machine_i2c_p_t mp_machine_soft_i2c_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_i2c) - .start = (int(*)(mp_obj_base_t*))mp_hal_i2c_start, - .stop = (int(*)(mp_obj_base_t*))mp_hal_i2c_stop, - .read = mp_machine_soft_i2c_read, - .write = mp_machine_soft_i2c_write, - .readfrom = mp_machine_soft_i2c_readfrom, - .writeto = mp_machine_soft_i2c_writeto, -}; - -const mp_obj_type_t machine_i2c_type = { - { &mp_type_type }, - .name = MP_QSTR_I2C, - .make_new = machine_i2c_make_new, - .protocol = &mp_machine_soft_i2c_p, - .locals_dict = (mp_obj_dict_t*)&mp_machine_soft_i2c_locals_dict, -}; - -#endif // MICROPY_PY_MACHINE_I2C diff --git a/extmod/machine_i2c.h b/extmod/machine_i2c.h deleted file mode 100644 index 7f5ee568e3..0000000000 --- a/extmod/machine_i2c.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H -#define MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H - -#include "py/obj.h" -#include "py/proto.h" - -// I2C protocol -// the first 4 methods can be NULL, meaning operation is not supported -typedef struct _mp_machine_i2c_p_t { - MP_PROTOCOL_HEAD - int (*start)(mp_obj_base_t *obj); - int (*stop)(mp_obj_base_t *obj); - int (*read)(mp_obj_base_t *obj, uint8_t *dest, size_t len, bool nack); - int (*write)(mp_obj_base_t *obj, const uint8_t *src, size_t len); - int (*readfrom)(mp_obj_base_t *obj, uint16_t addr, uint8_t *dest, size_t len, bool stop); - int (*writeto)(mp_obj_base_t *obj, uint16_t addr, const uint8_t *src, size_t len, bool stop); -} mp_machine_i2c_p_t; - -typedef struct _mp_machine_soft_i2c_obj_t { - mp_obj_base_t base; - uint32_t us_delay; - uint32_t us_timeout; - mp_hal_pin_obj_t scl; - mp_hal_pin_obj_t sda; -} mp_machine_soft_i2c_obj_t; - -extern const mp_obj_type_t machine_i2c_type; -extern const mp_obj_dict_t mp_machine_soft_i2c_locals_dict; - -int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop); -int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop); - -#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H diff --git a/extmod/machine_spi.c b/extmod/machine_spi.c deleted file mode 100644 index 4ead321d90..0000000000 --- a/extmod/machine_spi.c +++ /dev/null @@ -1,286 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include - -#include "py/runtime.h" -#include "extmod/machine_spi.h" - -#include "supervisor/shared/translate.h" - -#if MICROPY_PY_MACHINE_SPI - -// if a port didn't define MSB/LSB constants then provide them -#ifndef MICROPY_PY_MACHINE_SPI_MSB -#define MICROPY_PY_MACHINE_SPI_MSB (0) -#define MICROPY_PY_MACHINE_SPI_LSB (1) -#endif - -/******************************************************************************/ -// MicroPython bindings for generic machine.SPI - -STATIC mp_obj_t mp_machine_soft_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - -mp_obj_t mp_machine_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - // check the id argument, if given - if (n_args > 0) { - if (args[0] != MP_OBJ_NEW_SMALL_INT(-1)) { - #if defined(MICROPY_PY_MACHINE_SPI_MAKE_NEW) - // dispatch to port-specific constructor - extern mp_obj_t MICROPY_PY_MACHINE_SPI_MAKE_NEW(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - return MICROPY_PY_MACHINE_SPI_MAKE_NEW(type, n_args, args, kw_args); - #else - mp_raise_ValueError(translate("invalid SPI peripheral")); - #endif - } - --n_args; - ++args; - } - - // software SPI - return mp_machine_soft_spi_make_new(type, n_args, args, kw_args); -} - -STATIC mp_obj_t machine_spi_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - spi_p->init(s, n_args - 1, args + 1, kw_args); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_spi_init_obj, 1, machine_spi_init); - -STATIC mp_obj_t machine_spi_deinit(mp_obj_t self) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(self); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - if (spi_p->deinit != NULL) { - spi_p->deinit(s); - } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_spi_deinit_obj, machine_spi_deinit); - -STATIC void mp_machine_spi_transfer(mp_obj_t self, size_t len, const void *src, void *dest) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(self); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - spi_p->transfer(s, len, src, dest); -} - -STATIC mp_obj_t mp_machine_spi_read(size_t n_args, const mp_obj_t *args) { - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[1])); - memset(vstr.buf, n_args == 3 ? mp_obj_get_int(args[2]) : 0, vstr.len); - mp_machine_spi_transfer(args[0], vstr.len, vstr.buf, vstr.buf); - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_read_obj, 2, 3, mp_machine_spi_read); - -STATIC mp_obj_t mp_machine_spi_readinto(size_t n_args, const mp_obj_t *args) { - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); - memset(bufinfo.buf, n_args == 3 ? mp_obj_get_int(args[2]) : 0, bufinfo.len); - mp_machine_spi_transfer(args[0], bufinfo.len, bufinfo.buf, bufinfo.buf); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_readinto_obj, 2, 3, mp_machine_spi_readinto); - -STATIC mp_obj_t mp_machine_spi_write(mp_obj_t self, mp_obj_t wr_buf) { - mp_buffer_info_t src; - mp_get_buffer_raise(wr_buf, &src, MP_BUFFER_READ); - mp_machine_spi_transfer(self, src.len, (const uint8_t*)src.buf, NULL); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(mp_machine_spi_write_obj, mp_machine_spi_write); - -STATIC mp_obj_t mp_machine_spi_write_readinto(mp_obj_t self, mp_obj_t wr_buf, mp_obj_t rd_buf) { - mp_buffer_info_t src; - mp_get_buffer_raise(wr_buf, &src, MP_BUFFER_READ); - mp_buffer_info_t dest; - mp_get_buffer_raise(rd_buf, &dest, MP_BUFFER_WRITE); - if (src.len != dest.len) { - mp_raise_ValueError(translate("buffers must be the same length")); - } - mp_machine_spi_transfer(self, src.len, src.buf, dest.buf); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_3(mp_machine_spi_write_readinto_obj, mp_machine_spi_write_readinto); - -STATIC const mp_rom_map_elem_t machine_spi_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_spi_init_obj) }, - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&machine_spi_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_machine_spi_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_machine_spi_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_machine_spi_write_obj) }, - { MP_ROM_QSTR(MP_QSTR_write_readinto), MP_ROM_PTR(&mp_machine_spi_write_readinto_obj) }, - - { MP_ROM_QSTR(MP_QSTR_MSB), MP_ROM_INT(MICROPY_PY_MACHINE_SPI_MSB) }, - { MP_ROM_QSTR(MP_QSTR_LSB), MP_ROM_INT(MICROPY_PY_MACHINE_SPI_LSB) }, -}; - -MP_DEFINE_CONST_DICT(mp_machine_spi_locals_dict, machine_spi_locals_dict_table); - -/******************************************************************************/ -// Implementation of soft SPI - -STATIC uint32_t baudrate_from_delay_half(uint32_t delay_half) { - #ifdef MICROPY_HW_SOFTSPI_MIN_DELAY - if (delay_half == MICROPY_HW_SOFTSPI_MIN_DELAY) { - return MICROPY_HW_SOFTSPI_MAX_BAUDRATE; - } else - #endif - { - return 500000 / delay_half; - } -} - -STATIC uint32_t baudrate_to_delay_half(uint32_t baudrate) { - #ifdef MICROPY_HW_SOFTSPI_MIN_DELAY - if (baudrate >= MICROPY_HW_SOFTSPI_MAX_BAUDRATE) { - return MICROPY_HW_SOFTSPI_MIN_DELAY; - } else - #endif - { - uint32_t delay_half = 500000 / baudrate; - // round delay_half up so that: actual_baudrate <= requested_baudrate - if (500000 % baudrate != 0) { - delay_half += 1; - } - return delay_half; - } -} - -STATIC void mp_machine_soft_spi_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - mp_machine_soft_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_printf(print, "SoftSPI(baudrate=%u, polarity=%u, phase=%u," - " sck=" MP_HAL_PIN_FMT ", mosi=" MP_HAL_PIN_FMT ", miso=" MP_HAL_PIN_FMT ")", - baudrate_from_delay_half(self->spi.delay_half), self->spi.polarity, self->spi.phase, - mp_hal_pin_name(self->spi.sck), mp_hal_pin_name(self->spi.mosi), mp_hal_pin_name(self->spi.miso)); -} - -STATIC mp_obj_t mp_machine_soft_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *all_args, mp_map_t *kw_args) { - enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits, ARG_firstbit, ARG_sck, ARG_mosi, ARG_miso }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 500000} }, - { MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_phase, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_bits, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} }, - { MP_QSTR_firstbit, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = MICROPY_PY_MACHINE_SPI_MSB} }, - { MP_QSTR_sck, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_mosi, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_miso, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, all_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - // create new object - mp_machine_soft_spi_obj_t *self = m_new_obj(mp_machine_soft_spi_obj_t); - self->base.type = &mp_machine_soft_spi_type; - - // set parameters - self->spi.delay_half = baudrate_to_delay_half(args[ARG_baudrate].u_int); - self->spi.polarity = args[ARG_polarity].u_int; - self->spi.phase = args[ARG_phase].u_int; - if (args[ARG_bits].u_int != 8) { - mp_raise_ValueError(translate("bits must be 8")); - } - if (args[ARG_firstbit].u_int != MICROPY_PY_MACHINE_SPI_MSB) { - mp_raise_ValueError(translate("firstbit must be MSB")); - } - if (args[ARG_sck].u_obj == MP_OBJ_NULL - || args[ARG_mosi].u_obj == MP_OBJ_NULL - || args[ARG_miso].u_obj == MP_OBJ_NULL) { - mp_raise_ValueError(translate("must specify all of sck/mosi/miso")); - } - self->spi.sck = mp_hal_get_pin_obj(args[ARG_sck].u_obj); - self->spi.mosi = mp_hal_get_pin_obj(args[ARG_mosi].u_obj); - self->spi.miso = mp_hal_get_pin_obj(args[ARG_miso].u_obj); - - // configure bus - mp_soft_spi_ioctl(&self->spi, MP_SPI_IOCTL_INIT); - - return MP_OBJ_FROM_PTR(self); -} - -STATIC void mp_machine_soft_spi_init(mp_obj_base_t *self_in, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_machine_soft_spi_obj_t *self = (mp_machine_soft_spi_obj_t*)self_in; - - enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_sck, ARG_mosi, ARG_miso }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_polarity, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_phase, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_sck, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_mosi, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_miso, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - if (args[ARG_baudrate].u_int != -1) { - self->spi.delay_half = baudrate_to_delay_half(args[ARG_baudrate].u_int); - } - if (args[ARG_polarity].u_int != -1) { - self->spi.polarity = args[ARG_polarity].u_int; - } - if (args[ARG_phase].u_int != -1) { - self->spi.phase = args[ARG_phase].u_int; - } - if (args[ARG_sck].u_obj != MP_OBJ_NULL) { - self->spi.sck = mp_hal_get_pin_obj(args[ARG_sck].u_obj); - } - if (args[ARG_mosi].u_obj != MP_OBJ_NULL) { - self->spi.mosi = mp_hal_get_pin_obj(args[ARG_mosi].u_obj); - } - if (args[ARG_miso].u_obj != MP_OBJ_NULL) { - self->spi.miso = mp_hal_get_pin_obj(args[ARG_miso].u_obj); - } - - // configure bus - mp_soft_spi_ioctl(&self->spi, MP_SPI_IOCTL_INIT); -} - -STATIC void mp_machine_soft_spi_transfer(mp_obj_base_t *self_in, size_t len, const uint8_t *src, uint8_t *dest) { - mp_machine_soft_spi_obj_t *self = (mp_machine_soft_spi_obj_t*)self_in; - mp_soft_spi_transfer(&self->spi, len, src, dest); -} - -const mp_machine_spi_p_t mp_machine_soft_spi_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_spi) - .init = mp_machine_soft_spi_init, - .deinit = NULL, - .transfer = mp_machine_soft_spi_transfer, -}; - -const mp_obj_type_t mp_machine_soft_spi_type = { - { &mp_type_type }, - .name = MP_QSTR_SoftSPI, - .print = mp_machine_soft_spi_print, - .make_new = mp_machine_spi_make_new, // delegate to master constructor - .protocol = &mp_machine_soft_spi_p, - .locals_dict = (mp_obj_dict_t*)&mp_machine_spi_locals_dict, -}; - -#endif // MICROPY_PY_MACHINE_SPI diff --git a/extmod/machine_spi.h b/extmod/machine_spi.h deleted file mode 100644 index 365b44d6e8..0000000000 --- a/extmod/machine_spi.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H -#define MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H - -#include "py/obj.h" -#include "py/proto.h" -#include "py/mphal.h" -#include "drivers/bus/spi.h" - -// SPI protocol -typedef struct _mp_machine_spi_p_t { - MP_PROTOCOL_HEAD - void (*init)(mp_obj_base_t *obj, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - void (*deinit)(mp_obj_base_t *obj); // can be NULL - void (*transfer)(mp_obj_base_t *obj, size_t len, const uint8_t *src, uint8_t *dest); -} mp_machine_spi_p_t; - -typedef struct _mp_machine_soft_spi_obj_t { - mp_obj_base_t base; - mp_soft_spi_obj_t spi; -} mp_machine_soft_spi_obj_t; - -extern const mp_machine_spi_p_t mp_machine_soft_spi_p; -extern const mp_obj_type_t mp_machine_soft_spi_type; -extern const mp_obj_dict_t mp_machine_spi_locals_dict; - -mp_obj_t mp_machine_spi_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args); - -MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_read_obj); -MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_readinto_obj); -MP_DECLARE_CONST_FUN_OBJ_2(mp_machine_spi_write_obj); -MP_DECLARE_CONST_FUN_OBJ_3(mp_machine_spi_write_readinto_obj); - -#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H diff --git a/locale/ID.po b/locale/ID.po index c40ac105c5..ae057fbd7a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -293,6 +293,7 @@ msgstr "Semua channel event yang disinkronisasi sedang digunakan" msgid "All timers for this pin are in use" msgstr "Semua timer untuk pin ini sedang digunakan" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -300,7 +301,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Semua timer sedang digunakan" @@ -582,6 +583,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" @@ -828,10 +833,6 @@ msgstr "operasi I/O pada file tertutup" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operasi I2C tidak didukung" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -973,7 +974,7 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1441,6 +1442,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1627,6 +1632,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate tidak didukung" @@ -1743,11 +1749,11 @@ msgstr "abort() dipanggil" msgid "address %08x is not aligned to %d bytes" msgstr "alamat %08x tidak selaras dengan %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1828,10 +1834,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits harus memilki nilai 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1858,10 +1860,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers harus mempunyai panjang yang sama" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1937,7 +1935,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2291,10 +2289,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "bit pertama(firstbit) harus berupa MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2479,14 +2473,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "perangkat I2C tidak valid" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "perangkat SPI tidak valid" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumen-argumen tidak valid" @@ -2663,10 +2649,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "harus menentukan semua pin sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3455,6 +3437,9 @@ msgstr "" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 tidak mendukung pull up" +#~ msgid "I2C operation not supported" +#~ msgstr "operasi I2C tidak didukung" + #~ msgid "Invalid bit clock pin" #~ msgstr "Bit clock pada pin tidak valid" @@ -3546,9 +3531,15 @@ msgstr "" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" +#~ msgid "bits must be 8" +#~ msgstr "bits harus memilki nilai 8" + #~ msgid "buffer too long" #~ msgstr "buffer terlalu panjang" +#~ msgid "buffers must be the same length" +#~ msgstr "buffers harus mempunyai panjang yang sama" + #~ msgid "can query only one param" #~ msgstr "hanya bisa melakukan query satu param" @@ -3573,6 +3564,9 @@ msgstr "" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "bit pertama(firstbit) harus berupa MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "alokasi flash harus dibawah 1MByte" @@ -3582,6 +3576,12 @@ msgstr "" #~ msgid "impossible baudrate" #~ msgstr "baudrate tidak memungkinkan" +#~ msgid "invalid I2C peripheral" +#~ msgstr "perangkat I2C tidak valid" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "perangkat SPI tidak valid" + #~ msgid "invalid alarm" #~ msgstr "alarm tidak valid" @@ -3603,6 +3603,9 @@ msgstr "" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alokasi memori gagal, mengalokasikan %u byte untuk kode native" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "harus menentukan semua pin sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "keyword harus berupa string" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f125c2cc4b..1582b746ca 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -291,6 +291,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -298,7 +299,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -821,10 +822,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -966,7 +963,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1729,11 +1726,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1814,10 +1811,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1843,10 +1836,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1922,7 +1911,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2276,10 +2265,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2464,14 +2449,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2648,10 +2625,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 39bf51af8e..b23144fc8c 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -299,6 +299,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -580,6 +581,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -825,10 +830,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -970,7 +971,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1433,6 +1434,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1619,6 +1624,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1728,11 +1734,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1813,10 +1819,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1842,10 +1844,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1921,7 +1919,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2275,10 +2273,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2463,14 +2457,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2647,10 +2633,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 1359ce6dd0..eff611b20d 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,11 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" -"Language-Team: German \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -300,6 +298,7 @@ msgstr "Alle sync event Kanäle werden benutzt" msgid "All timers for this pin are in use" msgstr "Alle timer für diesen Pin werden bereits benutzt" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -307,7 +306,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timer werden benutzt" @@ -592,6 +591,10 @@ msgstr "Beschädigte .mpy Datei" msgid "Corrupt raw code" msgstr "Beschädigter raw code" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" @@ -842,10 +845,6 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" msgid "I2C Init Error" msgstr "I2C-Init-Fehler" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C-operation nicht unterstützt" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -989,7 +988,7 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1465,6 +1464,10 @@ msgstr "Stream fehlt readinto() oder write() Methode." msgid "Supply at least one UART pin" msgstr "Geben Sie mindestens einen UART-Pin an" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Zeitüberschreitung beim Auslesen der Temperatur" @@ -1669,6 +1672,7 @@ msgstr "" "Eingabeaufforderung auf dem anderen Gerät abgelehnt oder ignoriert." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate wird nicht unterstützt" @@ -1787,11 +1791,11 @@ msgstr "abort() wurde aufgerufen" msgid "address %08x is not aligned to %d bytes" msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "Adresse außerhalb der Grenzen" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresses ist leer" @@ -1872,10 +1876,6 @@ msgstr "Der binäre Operator %q ist nicht implementiert" msgid "bits must be 7, 8 or 9" msgstr "bits muss 7, 8 oder 9 sein" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits müssen 8 sein" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "Es müssen 8 oder 16 bits_per_sample sein" @@ -1901,10 +1901,6 @@ msgstr "Puffersegmente müssen gleich lang sein" msgid "buffer too small" msgstr "Der Puffer ist zu klein" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "Buffer müssen gleich lang sein" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "Tasten müssen digitalio.DigitalInOut sein" @@ -1982,7 +1978,7 @@ msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren" msgid "can't convert NaN to int" msgstr "kann NaN nicht nach int konvertieren" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kann Adresse nicht in int konvertieren" @@ -2347,10 +2343,6 @@ msgstr "Das erste Argument muss ein Ndarray sein" msgid "first argument to super() must be type" msgstr "Das erste Argument für super() muss type sein" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" @@ -2536,14 +2528,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "Das Intervall muss im Bereich %s-%s sein" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ungültige I2C Schnittstelle" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "ungültige SPI Schnittstelle" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ungültige argumente" @@ -2726,10 +2710,6 @@ msgstr "Mehrfache Vererbung nicht unterstützt" msgid "must raise an object" msgstr "muss ein Objekt verursachen (raise)" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso müssen alle spezifiziert sein" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" @@ -3562,6 +3542,9 @@ msgstr "Nullschritt" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 unterstützt pull up nicht" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C-operation nicht unterstützt" + #~ msgid "Invalid bit clock pin" #~ msgstr "Ungültiges bit clock pin" @@ -3711,12 +3694,18 @@ msgstr "Nullschritt" #~ "Sie laufen im abgesicherten Modus, was bedeutet, dass etwas Unerwartetes " #~ "passiert ist.\n" +#~ msgid "bits must be 8" +#~ msgstr "bits müssen 8 sein" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf ist zu klein. brauche %d Bytes" #~ msgid "buffer too long" #~ msgstr "Buffer zu lang" +#~ msgid "buffers must be the same length" +#~ msgstr "Buffer müssen gleich lang sein" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder ist keine Instanz von ByteOrder (%s erhalten)" @@ -3732,6 +3721,9 @@ msgstr "Nullschritt" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" + #~ msgid "flash location must be below 1MByte" #~ msgstr "flash location muss unter 1MByte sein" @@ -3744,6 +3736,12 @@ msgstr "Nullschritt" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "Das Interval ist nicht im Bereich 0.0020 bis 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "ungültige I2C Schnittstelle" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "ungültige SPI Schnittstelle" + #~ msgid "invalid alarm" #~ msgstr "ungültiger Alarm" @@ -3766,6 +3764,9 @@ msgstr "Nullschritt" #~ msgstr "" #~ "Speicherallozierung fehlgeschlagen, alloziere %u Bytes für nativen Code" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso müssen alle spezifiziert sein" + #~ msgid "name must be a string" #~ msgstr "name muss ein String sein" diff --git a/locale/en_US.po b/locale/en_US.po index 579fc6501e..c89772779e 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -291,6 +291,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -298,7 +299,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -572,6 +573,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -817,10 +822,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -962,7 +963,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1425,6 +1426,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1611,6 +1616,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1652,6 +1658,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -1700,11 +1726,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1785,10 +1811,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1814,10 +1836,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1893,7 +1911,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2247,10 +2265,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2435,14 +2449,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2619,10 +2625,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3059,6 +3061,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3212,6 +3218,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index b240ab689b..16f2b3669a 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,11 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" -"Language-Team: English \n" "Language: en_x_pirate\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -298,6 +296,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -305,7 +304,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -581,6 +580,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -826,10 +829,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -971,7 +970,7 @@ msgstr "Belay that! Invalid pin for starboard-side channel" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1434,6 +1433,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1620,6 +1623,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1661,6 +1665,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "Blimey! Yer code filename has two extensions\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -1709,11 +1733,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1794,10 +1818,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "pieces must be of 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1823,10 +1843,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "yer buffers must be of the same length" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1902,7 +1918,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2256,10 +2272,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2444,14 +2456,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "Belay that! I2C peripheral be invalid" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "Arr! SPI peripheral be invalid" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2628,10 +2632,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3068,6 +3068,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3221,6 +3225,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" @@ -3283,3 +3291,15 @@ msgstr "" #~ msgid "Invalid clock pin" #~ msgstr "Avast! Clock pin be invalid" + +#~ msgid "bits must be 8" +#~ msgstr "pieces must be of 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "yer buffers must be of the same length" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "Belay that! I2C peripheral be invalid" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "Arr! SPI peripheral be invalid" diff --git a/locale/es.po b/locale/es.po index 013750e931..22597249bd 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -302,6 +302,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "Todos los timers para este pin están siendo utilizados" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -309,7 +310,7 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos los timers en uso" @@ -589,6 +590,10 @@ msgstr "Archivo .mpy corrupto" msgid "Corrupt raw code" msgstr "Código crudo corrupto" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" @@ -835,10 +840,6 @@ msgstr "Operación I/O en archivo cerrado" msgid "I2C Init Error" msgstr "Error de inicio de I2C" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operación I2C no soportada" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -982,7 +983,7 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1452,6 +1453,10 @@ msgstr "A Stream le falta el método readinto() o write()." msgid "Supply at least one UART pin" msgstr "Suministre al menos un pin UART" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Lectura de temperatura expirada" @@ -1640,6 +1645,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate no soportado" @@ -1756,11 +1762,11 @@ msgstr "se llamó abort()" msgid "address %08x is not aligned to %d bytes" msgstr "la dirección %08x no esta alineada a %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "address fuera de límites" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "addresses esta vacío" @@ -1841,10 +1847,6 @@ msgstr "operacion binaria %q no implementada" msgid "bits must be 7, 8 or 9" msgstr "bits deben ser 7, 8 ó 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits debe ser 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" @@ -1871,10 +1873,6 @@ msgstr "Las secciones del buffer necesitan tener longitud igual" msgid "buffer too small" msgstr "buffer demasiado pequeño" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "los buffers deben de tener la misma longitud" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "los botones necesitan ser digitalio.DigitalInOut" @@ -1950,7 +1948,7 @@ msgstr "no se puede convertir el objeto '%q' a %q implícitamente" msgid "can't convert NaN to int" msgstr "no se puede convertir Nan a int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "no se puede convertir address a int" @@ -2311,10 +2309,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "primer argumento para super() debe ser de tipo" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit debe ser MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2499,14 +2493,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periférico I2C inválido" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periférico SPI inválido" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumentos inválidos" @@ -2686,10 +2672,6 @@ msgstr "herencia multiple no soportada" msgid "must raise an object" msgstr "debe hacer un raise de un objeto" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "se deben de especificar sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" @@ -3526,6 +3508,9 @@ msgstr "paso cero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 no soporta pull up." +#~ msgid "I2C operation not supported" +#~ msgstr "operación I2C no soportada" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pin bit clock inválido" @@ -3695,12 +3680,18 @@ msgstr "paso cero" #~ msgid "bad GATT role" #~ msgstr "mal GATT role" +#~ msgid "bits must be 8" +#~ msgstr "bits debe ser 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf es demasiado pequeño. necesita %d bytes" #~ msgid "buffer too long" #~ msgstr "buffer demasiado largo" +#~ msgid "buffers must be the same length" +#~ msgstr "los buffers deben de tener la misma longitud" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder no es instancia de ByteOrder (encontarmos un %s)" @@ -3737,6 +3728,9 @@ msgstr "paso cero" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit debe ser MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "la ubicación de la flash debe estar debajo de 1MByte" @@ -3749,6 +3743,12 @@ msgstr "paso cero" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "El intervalo está fuera del rango de 0.0020 a 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periférico I2C inválido" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periférico SPI inválido" + #~ msgid "invalid alarm" #~ msgstr "alarma inválida" @@ -3771,6 +3771,9 @@ msgstr "paso cero" #~ msgstr "" #~ "falló la asignación de memoria, asignando %u bytes para código nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "se deben de especificar sck/mosi/miso" + #~ msgid "name must be a string" #~ msgstr "name debe de ser un string" diff --git a/locale/fil.po b/locale/fil.po index 66ccc711ac..e4c5678d27 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -295,6 +295,7 @@ msgstr "Lahat ng sync event channels ay ginagamit" msgid "All timers for this pin are in use" msgstr "Lahat ng timers para sa pin na ito ay ginagamit" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -302,7 +303,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Lahat ng timer ginagamit" @@ -581,6 +582,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" @@ -831,10 +836,6 @@ msgstr "I/O operasyon sa saradong file" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "Hindi supportado ang operasyong I2C" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -978,7 +979,7 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1448,6 +1449,10 @@ msgstr "Stream kulang ng readinto() o write() method." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1635,6 +1640,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Hindi supportadong baudrate" @@ -1753,11 +1759,11 @@ msgstr "abort() tinawag" msgid "address %08x is not aligned to %d bytes" msgstr "address %08x ay hindi pantay sa %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "wala sa sakop ang address" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "walang laman ang address" @@ -1838,10 +1844,6 @@ msgstr "binary op %q hindi implemented" msgid "bits must be 7, 8 or 9" msgstr "bits ay dapat 7, 8 o 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits ay dapat walo (8)" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample ay dapat 8 o 16" @@ -1868,10 +1870,6 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "buffer too small" msgstr "masyadong maliit ang buffer" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "ang buffers ay dapat parehas sa haba" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1948,7 +1946,7 @@ msgstr "hindi maaaring i-convert ang '%q' na bagay sa %q nang walang pahiwatig" msgid "can't convert NaN to int" msgstr "hindi ma i-convert NaN sa int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "hindi ma i-convert ang address sa INT" @@ -2312,10 +2310,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "unang argument ng super() ay dapat type" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit ay dapat MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2501,14 +2495,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "maling I2C peripheral" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "hindi wastong SPI peripheral" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "mali ang mga argumento" @@ -2689,10 +2675,6 @@ msgstr "maraming inhertance hindi sinusuportahan" msgid "must raise an object" msgstr "dapat itaas ang isang object" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" @@ -3506,6 +3488,9 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Walang pull down support ang GPI016." +#~ msgid "I2C operation not supported" +#~ msgstr "Hindi supportado ang operasyong I2C" + #~ msgid "Invalid bit clock pin" #~ msgstr "Mali ang bit clock pin" @@ -3647,9 +3632,15 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" +#~ msgid "bits must be 8" +#~ msgstr "bits ay dapat walo (8)" + #~ msgid "buffer too long" #~ msgstr "masyadong mahaba ng buffer" +#~ msgid "buffers must be the same length" +#~ msgstr "ang buffers ay dapat parehas sa haba" + #~ msgid "can query only one param" #~ msgstr "maaaring i-query lamang ang isang param" @@ -3680,6 +3671,9 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit ay dapat MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "dapat na mas mababa sa 1MB ang lokasyon ng flash" @@ -3689,6 +3683,12 @@ msgstr "zero step" #~ msgid "impossible baudrate" #~ msgstr "impossibleng baudrate" +#~ msgid "invalid I2C peripheral" +#~ msgstr "maling I2C peripheral" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "hindi wastong SPI peripheral" + #~ msgid "invalid alarm" #~ msgstr "mali ang alarm" @@ -3711,6 +3711,9 @@ msgstr "zero step" #~ msgstr "" #~ "nabigo ang paglalaan ng memorya, naglalaan ng %u bytes para sa native code" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "ang keywords dapat strings" diff --git a/locale/fr.po b/locale/fr.po index 587f098771..5a49fd5f91 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,11 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" -"Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -304,6 +302,7 @@ msgstr "Tous les canaux d'événements de synchro sont utilisés" msgid "All timers for this pin are in use" msgstr "Tous les timers pour cette broche sont utilisés" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -311,7 +310,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tous les timers sont utilisés" @@ -599,6 +598,10 @@ msgstr "Fichier .mpy corrompu" msgid "Corrupt raw code" msgstr "Code brut corrompu" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" @@ -846,10 +849,6 @@ msgstr "opération d'E/S sur un fichier fermé" msgid "I2C Init Error" msgstr "Erreur d'initialisation I2C" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "opération sur I2C non supportée" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -993,7 +992,7 @@ msgstr "Broche invalide pour le canal droit" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1469,6 +1468,10 @@ msgstr "Il manque une méthode readinto() ou write() au flux." msgid "Supply at least one UART pin" msgstr "Fournissez au moins une broche UART" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temporisation de lecture dépassée" @@ -1671,6 +1674,7 @@ msgstr "" "appareil ait été refusée ou ignorée." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Débit non supporté" @@ -1790,11 +1794,11 @@ msgstr "abort() appelé" msgid "address %08x is not aligned to %d bytes" msgstr "l'adresse %08x n'est pas alignée sur %d octets" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adresse hors limites" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresses vides" @@ -1875,10 +1879,6 @@ msgstr "opération binaire '%q' non implémentée" msgid "bits must be 7, 8 or 9" msgstr "bits doivent être 7, 8 ou 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "les bits doivent être 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "'bits_per_sample' doivent être 8 ou 16" @@ -1904,10 +1904,6 @@ msgstr "les tranches de tampon doivent être de longueurs égales" msgid "buffer too small" msgstr "tampon trop petit" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "les tampons doivent être de la même longueur" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "les boutons doivent être des digitalio.DigitalInOut" @@ -1984,7 +1980,7 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" msgid "can't convert NaN to int" msgstr "on ne peut convertir NaN en entier 'int'" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "ne peut convertir l'adresse en entier 'int'" @@ -2353,10 +2349,6 @@ msgstr "le premier argument doit être un ndarray" msgid "first argument to super() must be type" msgstr "le premier argument de super() doit être un type" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "le 1er bit doit être le MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "l'ordre d'aplatissement doit être «C» ou «F»" @@ -2543,14 +2535,6 @@ msgstr "interp est défini pour les tableaux 1D de longueur égale" msgid "interval must be in range %s-%s" msgstr "l'intervalle doit être dans la plage %s-%s" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "périphérique I2C invalide" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "périphérique SPI invalide" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "arguments invalides" @@ -2731,10 +2715,6 @@ msgstr "héritages multiples non supportés" msgid "must raise an object" msgstr "doit lever un objet" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck, mosi et miso doivent tous être spécifiés" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" @@ -3581,6 +3561,9 @@ msgstr "'step' nul" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Le GPIO16 ne supporte pas le tirage (pull-up)" +#~ msgid "I2C operation not supported" +#~ msgstr "opération sur I2C non supportée" + #~ msgid "Invalid bit clock pin" #~ msgstr "Broche invalide pour 'bit clock'" @@ -3750,12 +3733,18 @@ msgstr "'step' nul" #~ msgid "bad GATT role" #~ msgstr "mauvais rôle GATT" +#~ msgid "bits must be 8" +#~ msgstr "les bits doivent être 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "'buf' est trop petit. Besoin de %d octets" #~ msgid "buffer too long" #~ msgstr "tampon trop long" +#~ msgid "buffers must be the same length" +#~ msgstr "les tampons doivent être de la même longueur" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "'byteorder' n'est pas une instance de ByteOrder (reçu un %s)" @@ -3794,6 +3783,9 @@ msgstr "'step' nul" #~ msgid "expecting a pin" #~ msgstr "une broche (Pin) est attendue" +#~ msgid "firstbit must be MSB" +#~ msgstr "le 1er bit doit être le MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "l'emplacement en mémoire flash doit être inférieur à 1Mo" @@ -3806,6 +3798,12 @@ msgstr "'step' nul" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "intervalle hors bornes 0.0020 à 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "périphérique I2C invalide" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "périphérique SPI invalide" + #~ msgid "invalid alarm" #~ msgstr "alarme invalide" @@ -3828,6 +3826,9 @@ msgstr "'step' nul" #~ msgstr "" #~ "l'allocation de mémoire a échoué en allouant %u octets pour un code natif" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck, mosi et miso doivent tous être spécifiés" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "les noms doivent être des chaînes de caractère" diff --git a/locale/it_IT.po b/locale/it_IT.po index 01368e88a8..c47d0e8e3e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -294,6 +294,7 @@ msgstr "Tutti i canali di eventi sincronizzati in uso" msgid "All timers for this pin are in use" msgstr "Tutti i timer per questo pin sono in uso" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -301,7 +302,7 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tutti i timer utilizzati" @@ -582,6 +583,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" @@ -831,10 +836,6 @@ msgstr "operazione I/O su file chiuso" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operazione I2C non supportata" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -980,7 +981,7 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1459,6 +1460,10 @@ msgstr "Metodi mancanti readinto() o write() allo stream." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1646,6 +1651,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "baudrate non supportato" @@ -1756,11 +1762,11 @@ msgstr "abort() chiamato" msgid "address %08x is not aligned to %d bytes" msgstr "l'indirizzo %08x non è allineato a %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "indirizzo fuori limite" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "gli indirizzi sono vuoti" @@ -1841,10 +1847,6 @@ msgstr "operazione binaria %q non implementata" msgid "bits must be 7, 8 or 9" msgstr "i bit devono essere 7, 8 o 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "i bit devono essere 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1873,10 +1875,6 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "buffer too small" msgstr "buffer troppo piccolo" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "i buffer devono essere della stessa lunghezza" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1953,7 +1951,7 @@ msgstr "impossibile convertire l'oggetto '%q' implicitamente in %q" msgid "can't convert NaN to int" msgstr "impossibile convertire NaN in int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "impossible convertire indirizzo in int" @@ -2313,10 +2311,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "il primo bit deve essere il più significativo (MSB)" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2502,14 +2496,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periferica I2C invalida" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periferica SPI invalida" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argomenti non validi" @@ -2691,10 +2677,6 @@ msgstr "ereditarietà multipla non supportata" msgid "must raise an object" msgstr "deve lanciare un oggetto" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "è necessario specificare tutte le sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3529,6 +3511,9 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 non supporta pull-up" +#~ msgid "I2C operation not supported" +#~ msgstr "operazione I2C non supportata" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pin del clock di bit non valido" @@ -3636,9 +3621,15 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[errore addrinfo %d]" +#~ msgid "bits must be 8" +#~ msgstr "i bit devono essere 8" + #~ msgid "buffer too long" #~ msgstr "buffer troppo lungo" +#~ msgid "buffers must be the same length" +#~ msgstr "i buffer devono essere della stessa lunghezza" + #~ msgid "can query only one param" #~ msgstr "è possibile interrogare solo un parametro" @@ -3669,6 +3660,9 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "il primo bit deve essere il più significativo (MSB)" + #~ msgid "flash location must be below 1MByte" #~ msgstr "Locazione della flash deve essere inferiore a 1mb" @@ -3678,6 +3672,12 @@ msgstr "zero step" #~ msgid "impossible baudrate" #~ msgstr "baudrate impossibile" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periferica I2C invalida" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periferica SPI invalida" + #~ msgid "invalid alarm" #~ msgstr "alarm non valido" @@ -3700,6 +3700,9 @@ msgstr "zero step" #~ msgstr "" #~ "allocazione di memoria fallita, allocazione di %d byte per codice nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "è necessario specificare tutte le sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "argomenti nominati devono essere stringhe" diff --git a/locale/ko.po b/locale/ko.po index 27f8216f83..156f40d9b6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -293,6 +293,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "핀의 모든 타이머가 사용 중입니다" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -300,7 +301,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" @@ -576,6 +577,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -821,10 +826,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -966,7 +967,7 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1429,6 +1430,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1616,6 +1621,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1725,11 +1731,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1810,10 +1816,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "비트(bits)는 7, 8 또는 9 여야합니다" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "비트(bits)는 8이어야합니다" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample은 8 또는 16이어야합니다." @@ -1839,10 +1841,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1918,7 +1916,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2272,10 +2270,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2460,14 +2454,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ICT주변 기기가 유효하지 않습니다" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "SPI주변 기기가 유효하지 않습니다" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2644,10 +2630,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3319,3 +3301,12 @@ msgstr "" #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "스캔을 계속할 수 없습니다, 오류 0x%04x" + +#~ msgid "bits must be 8" +#~ msgstr "비트(bits)는 8이어야합니다" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "ICT주변 기기가 유효하지 않습니다" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "SPI주변 기기가 유효하지 않습니다" diff --git a/locale/nl.po b/locale/nl.po index 5be371d83f..77cc11cab3 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -299,6 +299,7 @@ msgstr "Alle sync event kanalen zijn in gebruik" msgid "All timers for this pin are in use" msgstr "Alle timers voor deze pin zijn in gebruik" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timers zijn in gebruik" @@ -588,6 +589,10 @@ msgstr "Corrupt .mpy bestand" msgid "Corrupt raw code" msgstr "Corrupt raw code" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Kan UART niet initialiseren" @@ -835,10 +840,6 @@ msgstr "I/O actie op gesloten bestand" msgid "I2C Init Error" msgstr "I2C Init Fout" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C actie niet ondersteund" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -982,7 +983,7 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1459,6 +1460,10 @@ msgstr "Stream mist readinto() of write() methode." msgid "Supply at least one UART pin" msgstr "Geef op zijn minst 1 UART pin op" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temperatuur lees time-out" @@ -1655,6 +1660,7 @@ msgstr "" "apparaat geweigerd of genegeerd werd." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Niet-ondersteunde baudsnelheid" @@ -1773,11 +1779,11 @@ msgstr "abort() aangeroepen" msgid "address %08x is not aligned to %d bytes" msgstr "adres %08x is niet afgestemd op %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adres buiten bereik" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adressen zijn leeg" @@ -1858,10 +1864,6 @@ msgstr "binaire op %q niet geïmplementeerd" msgid "bits must be 7, 8 or 9" msgstr "bits moet 7, 8, of 9 zijn" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits moet 8 zijn" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample moet 8 of 16 zijn" @@ -1887,10 +1889,6 @@ msgstr "buffer slices moeten van gelijke grootte zijn" msgid "buffer too small" msgstr "buffer te klein" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers moeten dezelfde lengte hebben" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons moeten digitalio.DigitalInOut zijn" @@ -1967,7 +1965,7 @@ msgstr "kan '%q' object niet omzetten naar %q impliciet" msgid "can't convert NaN to int" msgstr "kan NaN niet omzetten naar int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kan adres niet omzetten naar int" @@ -2324,10 +2322,6 @@ msgstr "eerst argument moet een ndarray zijn" msgid "first argument to super() must be type" msgstr "eerste argument voor super() moet een type zijn" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "het eerste bit moet het MSB zijn" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "De afvlakkingsvolgorde moet ofwel \"C\", ofwel \"F\" zijn" @@ -2513,14 +2507,6 @@ msgstr "interp is gedefinieerd for eendimensionale arrays van gelijke lengte" msgid "interval must be in range %s-%s" msgstr "interval moet binnen bereik %s-%s vallen" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "onjuist I2C randapparaat" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "onjuist SPI randapparaat" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ongeldige argumenten" @@ -2700,10 +2686,6 @@ msgstr "meervoudige overerving niet ondersteund" msgid "must raise an object" msgstr "moet een object oproepen (raise)" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso moeten alle gespecificeerd worden" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" @@ -3352,5 +3334,26 @@ msgstr "y-waarde buiten bereik" msgid "zero step" msgstr "nul-stap" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C actie niet ondersteund" + #~ msgid "Negative step not supported" #~ msgstr "Negatieve stappen niet ondersteund" + +#~ msgid "bits must be 8" +#~ msgstr "bits moet 8 zijn" + +#~ msgid "buffers must be the same length" +#~ msgstr "buffers moeten dezelfde lengte hebben" + +#~ msgid "firstbit must be MSB" +#~ msgstr "het eerste bit moet het MSB zijn" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "onjuist I2C randapparaat" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "onjuist SPI randapparaat" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso moeten alle gespecificeerd worden" diff --git a/locale/pl.po b/locale/pl.po index 0e82359f9b..888ce64285 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -292,6 +292,7 @@ msgstr "Wszystkie kanały zdarzeń synchronizacji w użyciu" msgid "All timers for this pin are in use" msgstr "Wszystkie timery tej nóżki w użyciu" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -299,7 +300,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Wszystkie timery w użyciu" @@ -575,6 +576,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" @@ -820,10 +825,6 @@ msgstr "Operacja I/O na zamkniętym pliku" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "Operacja I2C nieobsługiwana" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -967,7 +968,7 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1430,6 +1431,10 @@ msgstr "Strumień nie ma metod readinto() lub write()." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1616,6 +1621,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Zła szybkość transmisji" @@ -1728,11 +1734,11 @@ msgstr "Wywołano abort()" msgid "address %08x is not aligned to %d bytes" msgstr "adres %08x nie jest wyrównany do %d bajtów" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adres poza zakresem" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adres jest pusty" @@ -1813,10 +1819,6 @@ msgstr "brak dwu-argumentowego operatora %q" msgid "bits must be 7, 8 or 9" msgstr "bits musi być 7, 8 lub 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits musi być 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample musi być 8 lub 16" @@ -1842,10 +1844,6 @@ msgstr "fragmenty bufora muszą mieć tę samą długość" msgid "buffer too small" msgstr "zbyt mały bufor" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "bufory muszą mieć tę samą długość" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons musi być digitalio.DigitalInOut" @@ -1921,7 +1919,7 @@ msgstr "nie można automatycznie skonwertować '%q' do '%q'" msgid "can't convert NaN to int" msgstr "nie można skonwertować NaN do int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "nie można skonwertować adresu do int" @@ -2276,10 +2274,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "pierwszy argument super() musi być typem" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit musi być MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2464,14 +2458,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "złe I2C" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "złe SPI" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "złe arguemnty" @@ -2648,10 +2634,6 @@ msgstr "wielokrotne dziedzicznie niewspierane" msgid "must raise an object" msgstr "wyjątek musi być obiektem" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso muszą być podane" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" @@ -3426,6 +3408,9 @@ msgstr "zerowy krok" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Nie udało się rozpocząć zapisu do flash, błąd 0x%04x" +#~ msgid "I2C operation not supported" +#~ msgstr "Operacja I2C nieobsługiwana" + #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" @@ -3523,9 +3508,15 @@ msgstr "zerowy krok" #~ msgid "bad GATT role" #~ msgstr "zła rola GATT" +#~ msgid "bits must be 8" +#~ msgstr "bits musi być 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf zbyt mały. Wymagane %d bajtów" +#~ msgid "buffers must be the same length" +#~ msgstr "bufory muszą mieć tę samą długość" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder musi być typu ByteOrder (jest %s)" @@ -3536,9 +3527,21 @@ msgstr "zerowy krok" #~ msgid "color buffer must be a buffer or int" #~ msgstr "bufor kolorów musi być typu buffer lub int" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit musi być MSB" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "przedział poza zakresem 0.0020 do 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "złe I2C" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "złe SPI" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso muszą być podane" + #~ msgid "name must be a string" #~ msgstr "nazwa musi być łańcuchem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 308809a2be..e951df1080 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -294,6 +294,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "Todos os temporizadores para este pino estão em uso" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -301,7 +302,7 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos os temporizadores em uso" @@ -578,6 +579,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" @@ -826,10 +831,6 @@ msgstr "Operação I/O no arquivo fechado" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C operação não suportada" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -973,7 +974,7 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1442,6 +1443,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1628,6 +1633,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Taxa de transmissão não suportada" @@ -1738,11 +1744,11 @@ msgstr "abort() chamado" msgid "address %08x is not aligned to %d bytes" msgstr "endereço %08x não está alinhado com %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1823,10 +1829,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits devem ser 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1855,10 +1857,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers devem ser o mesmo tamanho" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1934,7 +1932,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2289,10 +2287,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit devem ser MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2477,14 +2471,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periférico I2C inválido" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periférico SPI inválido" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumentos inválidos" @@ -2661,10 +2647,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "deve especificar todos sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3439,6 +3421,9 @@ msgstr "passo zero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 não suporta pull up." +#~ msgid "I2C operation not supported" +#~ msgstr "I2C operação não suportada" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pino de bit clock inválido" @@ -3512,9 +3497,15 @@ msgstr "passo zero" #~ msgid "Use esptool to erase flash and re-upload Python instead" #~ msgstr "Use o esptool para apagar o flash e recarregar o Python" +#~ msgid "bits must be 8" +#~ msgstr "bits devem ser 8" + #~ msgid "buffer too long" #~ msgstr "buffer muito longo" +#~ msgid "buffers must be the same length" +#~ msgstr "buffers devem ser o mesmo tamanho" + #~ msgid "can query only one param" #~ msgstr "pode consultar apenas um parâmetro" @@ -3539,6 +3530,9 @@ msgstr "passo zero" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit devem ser MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "o local do flash deve estar abaixo de 1 MByte" @@ -3548,6 +3542,12 @@ msgstr "passo zero" #~ msgid "impossible baudrate" #~ msgstr "taxa de transmissão impossível" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periférico I2C inválido" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periférico SPI inválido" + #~ msgid "invalid alarm" #~ msgstr "Alarme inválido" @@ -3569,6 +3569,9 @@ msgstr "passo zero" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alocação de memória falhou, alocando %u bytes para código nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "deve especificar todos sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "heap deve ser uma lista" diff --git a/locale/sv.po b/locale/sv.po index bf9bb3f5d9..df2431c4e0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -299,6 +299,7 @@ msgstr "Alla händelsekanaler används" msgid "All timers for this pin are in use" msgstr "Alla timers för denna pinne är i bruk" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alla timers används" @@ -588,6 +589,10 @@ msgstr "Skadad .mpy-fil" msgid "Corrupt raw code" msgstr "Korrupt rå kod" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Det gick inte att initiera UART" @@ -833,10 +838,6 @@ msgstr "I/O-operation på stängd fil" msgid "I2C Init Error" msgstr "I2C init-fel" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C-åtgärd stöds inte" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -980,7 +981,7 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1455,6 +1456,10 @@ msgstr "Stream saknar readinto() eller write() metod." msgid "Supply at least one UART pin" msgstr "Ange minst en UART-pinne" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temperaturavläsning tog för lång tid" @@ -1651,6 +1656,7 @@ msgstr "" "eller ignorerades." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate stöd inte" @@ -1766,11 +1772,11 @@ msgstr "abort() anropad" msgid "address %08x is not aligned to %d bytes" msgstr "adressen %08x är inte justerad till %d byte" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adress utanför gränsen" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresserna är tomma" @@ -1851,10 +1857,6 @@ msgstr "binär op %q är inte implementerad" msgid "bits must be 7, 8 or 9" msgstr "bits måste vara 7, 8 eller 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits måste vara 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample måste vara 8 eller 16" @@ -1880,10 +1882,6 @@ msgstr "buffertsegmenten måste vara lika långa" msgid "buffer too small" msgstr "buffert för liten" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffertar måste vara samma längd" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons måste vara digitalio.DigitalInOut" @@ -1959,7 +1957,7 @@ msgstr "kan inte konvertera '%q' objekt implicit till %q" msgid "can't convert NaN to int" msgstr "kan inte konvertera NaN till int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kan inte konvertera address till int" @@ -2318,10 +2316,6 @@ msgstr "första argumentet måste vara en ndarray" msgid "first argument to super() must be type" msgstr "första argumentet till super() måste vara typ" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit måste vara MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "förenklingsordningen måste vara antingen \"C\" eller \"F\"" @@ -2506,14 +2500,6 @@ msgstr "interp är definierad för 1D-matriser med samma längd" msgid "interval must be in range %s-%s" msgstr "interval måste vara i intervallet %s-%s" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ogiltig I2C-kringutrustning" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "ogiltig SPI-kringutrustning" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ogiltiga argument" @@ -2693,10 +2679,6 @@ msgstr "multipelt arv stöds inte" msgid "must raise an object" msgstr "måste ge ett objekt" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "måste ange alla av sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "måste använda nyckelordsargument för nyckelfunktion" @@ -3345,8 +3327,29 @@ msgstr "y-värde utanför intervall" msgid "zero step" msgstr "noll steg" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C-åtgärd stöds inte" + #~ msgid "Negative step not supported" #~ msgstr "Negativt step stöds inte" +#~ msgid "bits must be 8" +#~ msgstr "bits måste vara 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "buffertar måste vara samma längd" + #~ msgid "empty %q list" #~ msgstr "tom %q-lista" + +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit måste vara MSB" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "ogiltig I2C-kringutrustning" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "ogiltig SPI-kringutrustning" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "måste ange alla av sck/mosi/miso" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9f44fbd9ef..4f85c5fa86 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -298,6 +298,7 @@ msgstr "Suǒyǒu tóngbù shìjiàn píndào shǐyòng" msgid "All timers for this pin are in use" msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -305,7 +306,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Suǒyǒu jìshí qì shǐyòng" @@ -583,6 +584,10 @@ msgstr "Fǔbài de .mpy wénjiàn" msgid "Corrupt raw code" msgstr "Sǔnhuài de yuánshǐ dàimǎ" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" @@ -828,10 +833,6 @@ msgstr "Wénjiàn shàng de I/ O cāozuò" msgid "I2C Init Error" msgstr "I2C chūshǐhuà cuòwù" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C cāozuò bù zhīchí" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -975,7 +976,7 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1444,6 +1445,10 @@ msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." msgid "Supply at least one UART pin" msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1639,6 +1644,7 @@ msgstr "" "huò hūlüè." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Bù zhīchí de baudrate" @@ -1753,11 +1759,11 @@ msgstr "zhōngzhǐ () diàoyòng" msgid "address %08x is not aligned to %d bytes" msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "dìzhǐ chāochū biānjiè" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "dìzhǐ wèi kōng" @@ -1838,10 +1844,6 @@ msgstr "èrjìnzhì bǎn qián bǎn %q wèi zhíxíng" msgid "bits must be 7, 8 or 9" msgstr "bǐtè bìxū shì 7,8 huò 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bǐtè bìxū shì 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "měi jiàn yàngběn bìxū wèi 8 huò 16" @@ -1867,10 +1869,6 @@ msgstr "huǎnchōng qū qiēpiàn bìxū chángdù xiāngděng" msgid "buffer too small" msgstr "huǎnchōng qū tài xiǎo" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "ànniǔ bìxū shì digitalio.DigitalInOut" @@ -1946,7 +1944,7 @@ msgstr "wúfǎ jiāng '%q' duìxiàng zhuǎnhuàn wèi %q yǐn hán" msgid "can't convert NaN to int" msgstr "wúfǎ jiāng dǎoháng zhuǎnhuàn wèi int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "wúfǎ jiāng dìzhǐ zhuǎnhuàn wèi int" @@ -2304,10 +2302,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "dì yī wèi bìxū shì MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2492,14 +2486,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "Jiàngé bìxū zài %s-%s fànwéi nèi" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "wúxiào de I2C wàiwéi qì" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "wúxiào de SPI wàiwéi qì" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "wúxiào de cānshù" @@ -2677,10 +2663,6 @@ msgstr "bù zhīchí duō gè jìchéng" msgid "must raise an object" msgstr "bìxū tíchū duìxiàng" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" @@ -3485,6 +3467,9 @@ msgstr "líng bù" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Flash xiě rù shībài, err 0x%04x" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C cāozuò bù zhīchí" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -3605,9 +3590,15 @@ msgstr "líng bù" #~ msgid "bad GATT role" #~ msgstr "zǒng xiédìng de bùliáng juésè" +#~ msgid "bits must be 8" +#~ msgstr "bǐtè bìxū shì 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "huǎnchōng tài xiǎo. Xūyào%d zì jié" +#~ msgid "buffers must be the same length" +#~ msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "zì jié bùshì zì jié xù shílì (yǒu %s)" @@ -3620,9 +3611,21 @@ msgstr "líng bù" #~ msgid "expected a DigitalInOut" #~ msgstr "qídài de DigitalInOut" +#~ msgid "firstbit must be MSB" +#~ msgstr "dì yī wèi bìxū shì MSB" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "jùlí 0.0020 Zhì 10.24 Zhī jiān de jiàngé shíjiān" +#~ msgid "invalid I2C peripheral" +#~ msgstr "wúxiào de I2C wàiwéi qì" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "wúxiào de SPI wàiwéi qì" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" + #~ msgid "name must be a string" #~ msgstr "míngchēng bìxū shì yīgè zìfú chuàn" diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk index 5a47a5890d..a36966b87c 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "MX25L51245G" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index a71728e2db..da5f1ffac8 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -13,5 +13,5 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index cdbdf44f80..81391b953e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -14,7 +14,7 @@ LONGINT_IMPL = MPZ # Make room for frozen libs. CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 46a245e609..7aa45eb39e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -15,7 +15,7 @@ LONGINT_IMPL = NONE CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_PIXELBUF = 1 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 4220aa77ff..863b97d315 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -14,7 +14,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = NONE CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 # So not all of displayio, sorry! diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index 199cef362a..cec87f2bf9 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index d5e03b49d4..9e27ec7b4a 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -15,7 +15,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_GAMEPAD = 0 CFLAGS_INLINE_LIMIT = 50 diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index a94dd3c4e7..8bd4b818df 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 # supersized, not ultra-supersized CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index a8390fd97c..15c5ad817c 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_COUNTIO = 0 diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 812c208ccb..09420ed3da 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -15,7 +15,7 @@ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 # too itsy bitsy for all of displayio CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index 588e50ee1b..e3948565d1 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 864d31909d..b6490433e5 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index 295ba4bce4..a04e097692 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -CIRCUITPY_I2CSLAVE = 1 +CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index 08f8d431ea..eae50d70bf 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index 7a9b44e4c9..c17600fc75 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q32FV" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index c4b1f6d5af..6f3febfe56 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 46f727131d..9e0621810c 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -15,6 +15,6 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 1c43369076..d641a89ebd 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -21,7 +21,7 @@ CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index de9b617649..e06a2af7ee 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -19,12 +19,11 @@ CIRCUITPY_AUDIOIO = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index e96497b3e5..11592073f9 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -22,7 +22,7 @@ CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 diff --git a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.c b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c similarity index 80% rename from ports/atmel-samd/common-hal/i2cslave/I2CSlave.c rename to ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c index 79c1449e2f..84642d4048 100644 --- a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +++ b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/i2cslave/I2CSlave.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "common-hal/busio/I2C.h" #include "lib/utils/interrupt_char.h" @@ -35,7 +35,7 @@ #include "hal/include/hal_gpio.h" #include "peripherals/samd/sercom.h" -void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, +void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint8_t *addresses, unsigned int num_addresses, bool smbus) { uint8_t sercom_index; @@ -87,19 +87,19 @@ void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, if (smbus) { sercom->I2CS.CTRLA.bit.LOWTOUTEN = 1; // Errata 12003 - sercom->I2CS.CTRLA.bit.SEXTTOEN = 1; // Slave SCL Low Extend/Cumulative Time-Out 25ms + sercom->I2CS.CTRLA.bit.SEXTTOEN = 1; // SCL Low Extend/Cumulative Time-Out 25ms } sercom->I2CS.CTRLA.bit.SCLSM = 0; // Clock stretch before ack - sercom->I2CS.CTRLA.bit.MODE = 0x04; // Slave mode + sercom->I2CS.CTRLA.bit.MODE = 0x04; // Device mode sercom->I2CS.CTRLA.bit.ENABLE = 1; } -bool common_hal_i2cslave_i2c_slave_deinited(i2cslave_i2c_slave_obj_t *self) { +bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self) { return self->sda_pin == NO_PIN; } -void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self) { - if (common_hal_i2cslave_i2c_slave_deinited(self)) { +void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self) { + if (common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { return; } @@ -111,7 +111,7 @@ void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self) { self->scl_pin = NO_PIN; } -static int i2c_slave_check_error(i2cslave_i2c_slave_obj_t *self, bool raise) { +static int i2c_peripheral_check_error(i2cperipheral_i2c_peripheral_obj_t *self, bool raise) { if (!self->sercom->I2CS.INTFLAG.bit.ERROR) { return 0; } @@ -130,9 +130,9 @@ static int i2c_slave_check_error(i2cslave_i2c_slave_obj_t *self, bool raise) { return -err; } -int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) +int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) { - int err = i2c_slave_check_error(self, false); + int err = i2c_peripheral_check_error(self, false); if (err) { return err; } @@ -149,22 +149,22 @@ int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, u for (unsigned int i = 0; i < self->num_addresses; i++) { if (*address == self->addresses[i]) { - common_hal_i2cslave_i2c_slave_ack(self, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self, true); return 1; } } // This should clear AMATCH, but it doesn't... - common_hal_i2cslave_i2c_slave_ack(self, false); + common_hal_i2cperipheral_i2c_peripheral_ack(self, false); return 0; } -int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint8_t *data) { +int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data) { for (int t = 0; t < 100 && !self->sercom->I2CS.INTFLAG.reg; t++) { mp_hal_delay_us(10); } - i2c_slave_check_error(self, true); + i2c_peripheral_check_error(self, true); if (!self->sercom->I2CS.INTFLAG.bit.DRDY || self->sercom->I2CS.INTFLAG.bit.PREC || @@ -176,12 +176,12 @@ int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint return 1; } -int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uint8_t data) { +int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data) { for (int t = 0; !self->sercom->I2CS.INTFLAG.reg && t < 100; t++) { mp_hal_delay_us(10); } - i2c_slave_check_error(self, true); + i2c_peripheral_check_error(self, true); if (self->sercom->I2CS.INTFLAG.bit.PREC) { return 0; @@ -203,12 +203,12 @@ int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uin return 1; } -void common_hal_i2cslave_i2c_slave_ack(i2cslave_i2c_slave_obj_t *self, bool ack) { +void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack) { self->sercom->I2CS.CTRLB.bit.ACKACT = !ack; self->sercom->I2CS.CTRLB.bit.CMD = 0x03; } -void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { +void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self) { for (int t = 0; !self->sercom->I2CS.INTFLAG.reg && t < 100; t++) { mp_hal_delay_us(10); } @@ -218,7 +218,7 @@ void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { } if (!self->sercom->I2CS.STATUS.bit.DIR) { - common_hal_i2cslave_i2c_slave_ack(self, false); + common_hal_i2cperipheral_i2c_peripheral_ack(self, false); } else { int i = 0; while (self->sercom->I2CS.INTFLAG.reg == SERCOM_I2CS_INTFLAG_DRDY) { @@ -246,7 +246,7 @@ void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { if (self->sercom->I2CS.STATUS.bit.CLKHOLD) { // Unable to release the clock. - // The slave might have to be re-initialized to get unstuck. + // The device might have to be re-initialized to get unstuck. mp_raise_OSError(MP_EIO); } } diff --git a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.h b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h similarity index 85% rename from ports/atmel-samd/common-hal/i2cslave/I2CSlave.h rename to ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h index bf4f877bd4..03ae3a2885 100644 --- a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.h +++ b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" @@ -40,6 +40,6 @@ typedef struct { uint8_t scl_pin; uint8_t sda_pin; bool writing; -} i2cslave_i2c_slave_obj_t; +} i2cperipheral_i2c_peripheral_obj_t; -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H diff --git a/ports/atmel-samd/common-hal/i2cperipheral/__init__.c b/ports/atmel-samd/common-hal/i2cperipheral/__init__.c new file mode 100644 index 0000000000..c67511c536 --- /dev/null +++ b/ports/atmel-samd/common-hal/i2cperipheral/__init__.c @@ -0,0 +1 @@ +// No i2cperipheral module functions. diff --git a/ports/atmel-samd/common-hal/i2cslave/__init__.c b/ports/atmel-samd/common-hal/i2cslave/__init__.c deleted file mode 100644 index f289bbc0e4..0000000000 --- a/ports/atmel-samd/common-hal/i2cslave/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No i2cslave module functions. diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index c60bb83e7d..23f60f8a7f 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -14,7 +14,7 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_GNSS = 1 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 040022052c..ad23105393 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -22,7 +22,7 @@ CIRCUITPY_DIGITALIO = 1 CIRCUITPY_BUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_MICROCONTROLLER = 1 CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 004930ba70..311c87b5d5 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -20,7 +20,7 @@ CIRCUITPY_BOARD = 0 CIRCUITPY_BUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 49d9985083..12f34343b9 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -22,7 +22,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_COUNTIO = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 715b65e63e..385870a654 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -14,7 +14,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PIXELBUF = 0 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index dda9b24366..ed689545d0 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -25,8 +25,8 @@ CIRCUITPY_AUDIOPWMIO ?= 1 CIRCUITPY_BLEIO ?= 1 -# No I2CSlave implementation -CIRCUITPY_I2CSLAVE = 0 +# No I2CPeripheral implementation +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC ?= 1 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 7b720d1564..896d78bba7 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -14,7 +14,7 @@ ifeq ($(MCU_SERIES),F4) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 CIRCUITPY_RTC ?= 0 @@ -29,7 +29,7 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_PULSEIO ?= 0 @@ -46,7 +46,7 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 63c4980c31..5d4b168fe9 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -161,8 +161,6 @@ PY_EXTMOD_O_BASENAME += \ extmod/machine_pinbase.o \ extmod/machine_signal.o \ extmod/machine_pulse.o \ - extmod/machine_i2c.o \ - extmod/machine_spi.o LIB_SRC_C = $(addprefix lib/,\ $(LIB_SRC_C_EXTRA) \ diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 95824be1e8..74d8f548dd 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -165,8 +165,8 @@ endif ifeq ($(CIRCUITPY_GNSS),1) SRC_PATTERNS += gnss/% endif -ifeq ($(CIRCUITPY_I2CSLAVE),1) -SRC_PATTERNS += i2cslave/% +ifeq ($(CIRCUITPY_I2CPERIPHERAL),1) +SRC_PATTERNS += i2cperipheral/% endif ifeq ($(CIRCUITPY_MATH),1) SRC_PATTERNS += math/% @@ -290,8 +290,8 @@ SRC_COMMON_HAL_ALL = \ gnss/GNSS.c \ gnss/PositionFix.c \ gnss/SatelliteSystem.c \ - i2cslave/I2CSlave.c \ - i2cslave/__init__.c \ + i2cperipheral/I2CPeripheral.c \ + i2cperipheral/__init__.c \ microcontroller/Pin.c \ microcontroller/Processor.c \ microcontroller/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 4b054b83ce..c92cb1b669 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -408,11 +408,11 @@ extern const struct _mp_obj_module_t gnss_module; #define GNSS_MODULE #endif -#if CIRCUITPY_I2CSLAVE -extern const struct _mp_obj_module_t i2cslave_module; -#define I2CSLAVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cslave), (mp_obj_t)&i2cslave_module }, +#if CIRCUITPY_I2CPERIPHERAL +extern const struct _mp_obj_module_t i2cperipheral_module; +#define I2CPERIPHERAL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cperipheral), (mp_obj_t)&i2cperipheral_module }, #else -#define I2CSLAVE_MODULE +#define I2CPERIPHERAL_MODULE #endif #if CIRCUITPY_MATH @@ -690,7 +690,7 @@ extern const struct _mp_obj_module_t watchdog_module; GAMEPAD_MODULE \ GAMEPADSHIFT_MODULE \ GNSS_MODULE \ - I2CSLAVE_MODULE \ + I2CPERIPHERAL_MODULE \ JSON_MODULE \ MATH_MODULE \ _EVE_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ac7d2ec305..3459bff6d7 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -112,8 +112,8 @@ CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) CIRCUITPY_GNSS ?= 0 CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) -CIRCUITPY_I2CSLAVE ?= $(CIRCUITPY_FULL_BUILD) -CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE) +CIRCUITPY_I2CPERIPHERAL ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_I2CPERIPHERAL=$(CIRCUITPY_I2CPERIPHERAL) CIRCUITPY_MATH ?= 1 CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 2043fc903f..43fe11e628 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -45,6 +45,14 @@ //| physical level it consists of 2 wires: SCL and SDA, the clock and data //| lines respectively. //| +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to +//| manage locks. +//| +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. +//| //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin //| :param int frequency: The clock frequency of the bus @@ -158,7 +166,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); //| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: -//| """Read into ``buffer`` from the slave specified by ``address``. +//| """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. //| @@ -210,7 +218,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); //| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//| """Write the bytes from ``buffer`` to the slave specified by ``address`` and then transmits a +//| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start //| before a read. //| @@ -270,7 +278,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_wr //| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| """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/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 08bbf1257f..6d31037c75 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -43,19 +43,29 @@ //| """A 3-4 wire serial protocol //| //| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~bitbangio.I2C` because a -//| separate pin is used to control the active slave rather than a transmitted +//| main device. It is typically faster than :py:class:`~bitbangio.I2C` because a +//| separate pin is used to select a device rather than a transmitted //| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate +//| select line, often abbreviated `!CS` or `!SS`. (This is common because +//| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines +//| and therefore the hardware.)""" //| //| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| """Construct an SPI object on the given pins. //| +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to +//| manage locks. +//| +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. +//| +//| //| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| :param ~microcontroller.Pin MOSI: the Main Out Selected In pin. +//| :param ~microcontroller.Pin MISO: the Main In Selected Out pin.""" //| ... //| diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 7e8af765f7..b61dd93f3a 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -177,7 +177,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: bytearray, *, start: int = 0, end: int = None) -> Any: -//| """Read into ``buffer`` from the slave specified by ``address``. +//| """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. //| @@ -229,7 +229,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); //| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//| """Write the bytes from ``buffer`` to the slave specified by ``address``. +//| """Write the bytes from ``buffer`` to the device selected by ``address``. //| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be //| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and //| repeated start before a read. @@ -288,7 +288,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: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| """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 2ba9a4c22c..22f001d2dc 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -45,12 +45,13 @@ //| """A 3-4 wire serial protocol //| //| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~busio.I2C` because a -//| separate pin is used to control the active slave rather than a transitted +//| main device. It is typically faster than :py:class:`~bitbangio.I2C` because a +//| separate pin is used to select a device rather than a transmitted //| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate +//| select line, often abbreviated `!CS` or `!SS`. (This is common because +//| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines +//| and therefore the hardware.)""" //| //| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| @@ -72,8 +73,8 @@ //| :ref:`Register ` data descriptors. //| //| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| :param ~microcontroller.Pin MOSI: the Main Out Selected In pin. +//| :param ~microcontroller.Pin MISO: the Main In Selected Out pin.""" //| ... //| diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cperipheral/I2CPeripheral.c similarity index 51% rename from shared-bindings/i2cslave/I2CSlave.c rename to shared-bindings/i2cperipheral/I2CPeripheral.c index 80875ce758..4a3900174a 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -25,7 +25,7 @@ */ #include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/i2cslave/I2CSlave.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "shared-bindings/time/__init__.h" #include "shared-bindings/util.h" @@ -39,22 +39,22 @@ #include "py/objproperty.h" #include "py/runtime.h" -STATIC mp_obj_t mp_obj_new_i2cslave_i2c_slave_request(i2cslave_i2c_slave_obj_t *slave, uint8_t address, bool is_read, bool is_restart) { - i2cslave_i2c_slave_request_obj_t *self = m_new_obj(i2cslave_i2c_slave_request_obj_t); - self->base.type = &i2cslave_i2c_slave_request_type; - self->slave = slave; +STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2c_peripheral_obj_t *peripheral, uint8_t address, bool is_read, bool is_restart) { + i2cperipheral_i2c_peripheral_request_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_request_obj_t); + self->base.type = &i2cperipheral_i2c_peripheral_request_type; + self->peripheral = peripheral; self->address = address; self->is_read = is_read; self->is_restart = is_restart; return (mp_obj_t)self; } -//| class I2CSlave: -//| """Two wire serial protocol slave""" +//| class I2CPeripheral: +//| """Two wire serial protocol peripheral""" //| //| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False): //| """I2C is a two-wire protocol for communicating between devices. -//| This implements the slave side. +//| This implements the peripheral (sensor, secondary) side. //| //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin @@ -62,9 +62,9 @@ STATIC mp_obj_t mp_obj_new_i2cslave_i2c_slave_request(i2cslave_i2c_slave_obj_t * //| :param bool smbus: Use SMBUS timings if the hardware supports it""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - i2cslave_i2c_slave_obj_t *self = m_new_obj(i2cslave_i2c_slave_obj_t); - self->base.type = &i2cslave_i2c_slave_type; +STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + i2cperipheral_i2c_peripheral_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_obj_t); + self->base.type = &i2cperipheral_i2c_peripheral_type; enum { ARG_scl, ARG_sda, ARG_addresses, ARG_smbus }; static const mp_arg_t allowed_args[] = { { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -98,7 +98,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ mp_raise_ValueError(translate("addresses is empty")); } - common_hal_i2cslave_i2c_slave_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); + common_hal_i2cperipheral_i2c_peripheral_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); return (mp_obj_t)self; } @@ -106,13 +106,13 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_obj_deinit(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cslave_i2c_slave_deinit(self); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_i2cperipheral_i2c_peripheral_deinit(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_deinit_obj, i2cslave_i2c_slave_obj_deinit); +MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit); //| def __enter__(self, ) -> Any: //| """No-op used in Context Managers.""" @@ -125,25 +125,25 @@ MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_deinit_obj, i2cslave_i2c_slave_obj_ //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cslave_i2c_slave_deinit(self); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2cperipheral_i2c_peripheral_deinit(self); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave___exit___obj, 4, 4, i2cslave_i2c_slave_obj___exit__); +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: -//| """Wait for an I2C request from a master. +//| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once //| :return: I2C Slave Request or None if timeout=-1 and there's no request -//| :rtype: ~i2cslave.I2CSlaveRequest""" +//| :rtype: ~i2cperipheral.I2CPeripheralRequest""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - if(common_hal_i2cslave_i2c_slave_deinited(self)) { +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + if(common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { raise_deinited_error(); } enum { ARG_timeout }; @@ -180,7 +180,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar return mp_const_none; } - int status = common_hal_i2cslave_i2c_slave_is_addressed(self, &address, &is_read, &is_restart); + int status = common_hal_i2cperipheral_i2c_peripheral_is_addressed(self, &address, &is_read, &is_restart); if (status < 0) { // On error try one more time before bailing out if (last_error) { @@ -198,7 +198,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar continue; } - return mp_obj_new_i2cslave_i2c_slave_request(self, address, is_read, is_restart); + return mp_obj_new_i2cperipheral_i2c_peripheral_request(self, address, is_read, is_restart); } while (forever || common_hal_time_monotonic() < timeout_end); if (timeout_ms > 0) { @@ -206,39 +206,39 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar } return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_obj, 1, i2cslave_i2c_slave_request); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_obj, 1, i2cperipheral_i2c_peripheral_request); -STATIC const mp_rom_map_elem_t i2cslave_i2c_slave_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cslave_i2c_slave_deinit_obj) }, +STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cslave_i2c_slave___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cslave_i2c_slave_request_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_i2c_slave_locals_dict, i2cslave_i2c_slave_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_locals_dict, i2cperipheral_i2c_peripheral_locals_dict_table); -const mp_obj_type_t i2cslave_i2c_slave_type = { +const mp_obj_type_t i2cperipheral_i2c_peripheral_type = { { &mp_type_type }, - .name = MP_QSTR_I2CSlave, - .make_new = i2cslave_i2c_slave_make_new, - .locals_dict = (mp_obj_dict_t*)&i2cslave_i2c_slave_locals_dict, + .name = MP_QSTR_I2CPeripheral, + .make_new = i2cperipheral_i2c_peripheral_make_new, + .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_locals_dict, }; -//| class I2CSlaveRequest: +//| class I2CPeripheralRequest: //| -//| def __init__(self, slave: i2cslave.I2CSlave, address: int, is_read: bool, is_restart: bool): -//| """I2C transfer request from a master. -//| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`. +//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool): +//| """Information about an I2C transfer request +//| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`. //| -//| :param slave: The I2C Slave receiving this request +//| :param peripheral: The I2CPeripheral object receiving this request //| :param address: I2C address -//| :param is_read: I2C Master read request +//| :param is_read: True if the main peripheral is requesting data //| :param is_restart: Repeated Start Condition""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 4, 4, false); - return mp_obj_new_i2cslave_i2c_slave_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); + 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: @@ -251,56 +251,56 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, s //| """Close the request.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cslave_i2c_slave_close(self->slave); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave_request___exit___obj, 4, 4, i2cslave_i2c_slave_request_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_request_obj___exit__); //| address: int = ... //| """The I2C address of the request.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_address(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_int(self->address); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_address_obj, i2cslave_i2c_slave_request_get_address); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_address_obj, i2cperipheral_i2c_peripheral_request_get_address); //| is_read: bool = ... -//| """The I2C master is reading from the device.""" +//| """The I2C main controller is reading from this peripheral.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_read(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(self->is_read); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_read_obj, i2cslave_i2c_slave_request_get_is_read); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_read_obj, i2cperipheral_i2c_peripheral_request_get_is_read); //| is_restart: bool = ... //| """Is Repeated Start Condition.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_restart(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_restart(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(self->is_restart); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_restart_obj, i2cslave_i2c_slave_request_get_is_restart); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_restart_obj, i2cperipheral_i2c_peripheral_request_get_is_restart); //| def read(self, n: int = -1, ack: bool = True) -> bytearray: //| """Read data. -//| If ack=False, the caller is responsible for calling :py:meth:`I2CSlaveRequest.ack`. +//| If ack=False, the caller is responsible for calling :py:meth:`I2CPeripheralRequest.ack`. //| //| :param n: Number of bytes to read (negative means all) //| :param ack: Whether or not to send an ACK after the n'th byte //| :return: Bytes read""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); enum { ARG_n, ARG_ack }; static const mp_arg_t allowed_args[] = { { MP_QSTR_n, MP_ARG_INT, {.u_int = -1} }, @@ -329,7 +329,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *p } uint8_t data; - int num = common_hal_i2cslave_i2c_slave_read_byte(self->slave, &data); + int num = common_hal_i2cperipheral_i2c_peripheral_read_byte(self->peripheral, &data); if (num == 0) { break; } @@ -338,16 +338,16 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *p buffer[i++] = data; if (i == n) { if (ack) { - common_hal_i2cslave_i2c_slave_ack(self->slave, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); } break; } - common_hal_i2cslave_i2c_slave_ack(self->slave, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); } return mp_obj_new_bytearray(i, buffer); } -MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_read_obj, 1, i2cslave_i2c_slave_request_read); +MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2cperipheral_i2c_peripheral_request_read); //| def write(self, buffer: bytearray) -> int: //| """Write the data contained in buffer. @@ -356,9 +356,9 @@ MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_read_obj, 1, i2cslave_i2c_ //| :return: Number of bytes written""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_obj_t buf_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); if (!self->is_read) { mp_raise_OSError(MP_EACCES); @@ -373,7 +373,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_ break; } - int num = common_hal_i2cslave_i2c_slave_write_byte(self->slave, ((uint8_t *)(bufinfo.buf))[i]); + int num = common_hal_i2cperipheral_i2c_peripheral_write_byte(self->peripheral, ((uint8_t *)(bufinfo.buf))[i]); if (num == 0) { return mp_obj_new_int(i); } @@ -381,55 +381,55 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_ return mp_obj_new_int(bufinfo.len); } -STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cslave_i2c_slave_request_write_obj, i2cslave_i2c_slave_request_write); +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: //| """Acknowledge or Not Acknowledge last byte received. -//| Use together with :py:meth:`I2CSlaveRequest.read` ack=False. +//| Use together with :py:meth:`I2CPeripheralRequest.read` ack=False. //| //| :param ack: Whether to send an ACK or NACK""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_ack(uint n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_ack(uint n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); bool ack = (n_args == 1) ? true : mp_obj_is_true(args[1]); if (self->is_read) { mp_raise_OSError(MP_EACCES); } - common_hal_i2cslave_i2c_slave_ack(self->slave, ack); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, ack); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave_request_ack_obj, 1, 2, i2cslave_i2c_slave_request_ack); +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request_ack_obj, 1, 2, i2cperipheral_i2c_peripheral_request_ack); -STATIC mp_obj_t i2cslave_i2c_slave_request_close(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_close(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cslave_i2c_slave_close(self->slave); + common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_request_close_obj, i2cslave_i2c_slave_request_close); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_request_close_obj, i2cperipheral_i2c_peripheral_request_close); -STATIC const mp_rom_map_elem_t i2cslave_i2c_slave_request_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_request_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cslave_i2c_slave_request___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cslave_i2c_slave_request_address_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cslave_i2c_slave_request_is_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cslave_i2c_slave_request_is_restart_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cslave_i2c_slave_request_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cslave_i2c_slave_request_write_obj) }, - { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cslave_i2c_slave_request_ack_obj) }, - { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cslave_i2c_slave_request_close_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_restart_obj) }, + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_ack_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_close_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_i2c_slave_request_locals_dict, i2cslave_i2c_slave_request_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_request_locals_dict, i2cperipheral_i2c_peripheral_request_locals_dict_table); -const mp_obj_type_t i2cslave_i2c_slave_request_type = { +const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type = { { &mp_type_type }, - .name = MP_QSTR_I2CSlaveRequest, - .make_new = i2cslave_i2c_slave_request_make_new, - .locals_dict = (mp_obj_dict_t*)&i2cslave_i2c_slave_request_locals_dict, + .name = MP_QSTR_I2CPeripheralRequest, + .make_new = i2cperipheral_i2c_peripheral_request_make_new, + .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_request_locals_dict, }; diff --git a/shared-bindings/i2cslave/I2CSlave.h b/shared-bindings/i2cperipheral/I2CPeripheral.h similarity index 60% rename from shared-bindings/i2cslave/I2CSlave.h rename to shared-bindings/i2cperipheral/I2CPeripheral.h index abb7614168..3035cfbfe7 100644 --- a/shared-bindings/i2cslave/I2CSlave.h +++ b/shared-bindings/i2cperipheral/I2CPeripheral.h @@ -30,31 +30,31 @@ #include "py/obj.h" #include "common-hal/microcontroller/Pin.h" -#include "common-hal/i2cslave/I2CSlave.h" +#include "common-hal/i2cperipheral/I2CPeripheral.h" typedef struct { mp_obj_base_t base; - i2cslave_i2c_slave_obj_t *slave; + i2cperipheral_i2c_peripheral_obj_t *peripheral; uint16_t address; bool is_read; bool is_restart; -} i2cslave_i2c_slave_request_obj_t; +} i2cperipheral_i2c_peripheral_request_obj_t; -extern const mp_obj_type_t i2cslave_i2c_slave_request_type; +extern const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type; -extern const mp_obj_type_t i2cslave_i2c_slave_type; +extern const mp_obj_type_t i2cperipheral_i2c_peripheral_type; -extern void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, +extern void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint8_t *addresses, unsigned int num_addresses, bool smbus); -extern void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self); -extern bool common_hal_i2cslave_i2c_slave_deinited(i2cslave_i2c_slave_obj_t *self); +extern void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self); +extern bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self); -extern int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, +extern int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart); -extern int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint8_t *data); -extern int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uint8_t data); -extern void common_hal_i2cslave_i2c_slave_ack(i2cslave_i2c_slave_obj_t *self, bool ack); -extern void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self); +extern int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data); +extern int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data); +extern void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack); +extern void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H diff --git a/shared-bindings/i2cslave/__init__.c b/shared-bindings/i2cperipheral/__init__.c similarity index 67% rename from shared-bindings/i2cslave/__init__.c rename to shared-bindings/i2cperipheral/__init__.c index 41b42fef83..e2cb8509d6 100644 --- a/shared-bindings/i2cslave/__init__.c +++ b/shared-bindings/i2cperipheral/__init__.c @@ -30,32 +30,32 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" -//#include "shared-bindings/i2cslave/__init__.h" -#include "shared-bindings/i2cslave/I2CSlave.h" +//#include "shared-bindings/i2cperipheral/__init__.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "py/runtime.h" -//| """Two wire serial protocol slave +//| """Two wire serial protocol peripheral //| -//| The `i2cslave` module contains classes to support a I2C slave. +//| The `i2cperipheral` module contains classes to support an I2C peripheral. //| -//| Example emulating 2 devices:: +//| Example emulating a peripheral with 2 addresses (read and write):: //| //| import board -//| from i2cslave import I2CSlave +//| from i2cperipheral import I2CPeripheral //| //| regs = [0] * 16 //| index = 0 //| -//| with I2CSlave(board.SCL, board.SDA, (0x40, 0x41)) as slave: +//| with I2CPeripheral(board.SCL, board.SDA, (0x40, 0x41)) as device: //| while True: -//| r = slave.request() +//| r = device.request() //| if not r: //| # Maybe do some housekeeping //| continue -//| with r: # Closes the transfer if necessary by sending a NACK or feeding the master dummy bytes +//| with r: # Closes the transfer if necessary by sending a NACK or feeding dummy bytes //| if r.address == 0x40: -//| if not r.is_read: # Master write which is Slave read +//| if not r.is_read: # Main write which is Selected read //| b = r.read(1) //| if not b or b[0] > 15: //| break @@ -63,11 +63,11 @@ //| b = r.read(1) //| if b: //| regs[index] = b[0] -//| elif r.is_restart: # Combined transfer: This is the Master read message +//| elif r.is_restart: # Combined transfer: This is the Main read message //| n = r.write(bytes([regs[index]])) //| #else: //| # A read transfer is not supported in this example -//| # If the Master tries, it will get 0xff byte(s) by the ctx manager (r.close()) +//| # If the microcontroller tries, it will get 0xff byte(s) by the ctx manager (r.close()) //| elif r.address == 0x41: //| if not r.is_read: //| b = r.read(1) @@ -75,7 +75,7 @@ //| # do something //| pass //| -//| This example sets up an I2C slave that can be accessed from Linux like this:: +//| This example sets up an I2C device that can be accessed from Linux like this:: //| //| $ i2cget -y 1 0x40 0x01 //| 0x00 @@ -84,22 +84,23 @@ //| 0xaa //| //| .. warning:: -//| I2CSlave makes use of clock stretching in order to slow down the master. -//| Make sure the I2C master supports this. +//| I2CPeripheral makes use of clock stretching in order to slow down +//| the host. +//| Make sure the I2C host supports this. //| //| Raspberry Pi in particular does not support this with its I2C hw block. //| This can be worked around by using the ``i2c-gpio`` bit banging driver. //| Since the RPi firmware uses the hw i2c, it's not possible to emulate a HAT eeprom.""" //| -STATIC const mp_rom_map_elem_t i2cslave_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cslave) }, - { MP_ROM_QSTR(MP_QSTR_I2CSlave), MP_ROM_PTR(&i2cslave_i2c_slave_type) }, +STATIC const mp_rom_map_elem_t i2cperipheral_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cperipheral) }, + { MP_ROM_QSTR(MP_QSTR_I2CPeripheral), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_type) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_module_globals, i2cslave_module_globals_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_module_globals, i2cperipheral_module_globals_table); -const mp_obj_module_t i2cslave_module = { +const mp_obj_module_t i2cperipheral_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&i2cslave_module_globals, + .globals = (mp_obj_dict_t*)&i2cperipheral_module_globals, }; diff --git a/tests/pyb/halerror.py b/tests/pyb/halerror.py deleted file mode 100644 index 1a6bce1a7e..0000000000 --- a/tests/pyb/halerror.py +++ /dev/null @@ -1,15 +0,0 @@ -# test hal errors - -import pyb - -i2c = pyb.I2C(2, pyb.I2C.MASTER) -try: - i2c.recv(1, 1) -except OSError as e: - print(repr(e)) - -can = pyb.CAN(1, pyb.CAN.NORMAL) -try: - can.send('1', 1, timeout=50) -except OSError as e: - print(repr(e)) diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py deleted file mode 100644 index 6875e5a5aa..0000000000 --- a/tests/pyb/i2c.py +++ /dev/null @@ -1,32 +0,0 @@ -import pyb -from pyb import I2C - -# test we can correctly create by id or name -for bus in (-1, 0, 1, 2, 3, "X", "Y", "Z"): - try: - I2C(bus) - print("I2C", bus) - except ValueError: - print("ValueError", bus) - -i2c = I2C(1) - -i2c.init(I2C.MASTER, baudrate=400000) -print(i2c.scan()) -i2c.deinit() - -# use accelerometer to test i2c bus - -accel_addr = 76 - -pyb.Accel() # this will init the MMA for us -i2c.init(I2C.MASTER, baudrate=400000) - -print(i2c.scan()) -print(i2c.is_ready(accel_addr)) - -print(i2c.mem_read(1, accel_addr, 7, timeout=500)) -i2c.mem_write(0, accel_addr, 0, timeout=500) - -i2c.send(7, addr=accel_addr) -i2c.recv(1, addr=accel_addr) diff --git a/tests/pyb/i2c.py.exp b/tests/pyb/i2c.py.exp deleted file mode 100644 index 709fb412de..0000000000 --- a/tests/pyb/i2c.py.exp +++ /dev/null @@ -1,12 +0,0 @@ -ValueError -1 -ValueError 0 -I2C 1 -I2C 2 -ValueError 3 -I2C X -I2C Y -ValueError Z -[] -[76] -True -b'\x01' diff --git a/tests/pyb/i2c_error.py b/tests/pyb/i2c_error.py deleted file mode 100644 index 3201d6367d..0000000000 --- a/tests/pyb/i2c_error.py +++ /dev/null @@ -1,50 +0,0 @@ -# test I2C errors, with polling (disabled irqs) and DMA - -import pyb -from pyb import I2C - -# init accelerometer -pyb.Accel() - -# get I2C bus -i2c = I2C(1, I2C.MASTER, dma=True) - -# test polling mem_read -pyb.disable_irq() -i2c.mem_read(1, 76, 0x0a) # should succeed -pyb.enable_irq() -try: - pyb.disable_irq() - i2c.mem_read(1, 77, 0x0a) # should fail -except OSError as e: - pyb.enable_irq() - print(repr(e)) -i2c.mem_read(1, 76, 0x0a) # should succeed - -# test polling mem_write -pyb.disable_irq() -i2c.mem_write(1, 76, 0x0a) # should succeed -pyb.enable_irq() -try: - pyb.disable_irq() - i2c.mem_write(1, 77, 0x0a) # should fail -except OSError as e: - pyb.enable_irq() - print(repr(e)) -i2c.mem_write(1, 76, 0x0a) # should succeed - -# test DMA mem_read -i2c.mem_read(1, 76, 0x0a) # should succeed -try: - i2c.mem_read(1, 77, 0x0a) # should fail -except OSError as e: - print(repr(e)) -i2c.mem_read(1, 76, 0x0a) # should succeed - -# test DMA mem_write -i2c.mem_write(1, 76, 0x0a) # should succeed -try: - i2c.mem_write(1, 77, 0x0a) # should fail -except OSError as e: - print(repr(e)) -i2c.mem_write(1, 76, 0x0a) # should succeed diff --git a/tests/pyb/spi.py b/tests/pyb/spi.py deleted file mode 100644 index 88cc975bb6..0000000000 --- a/tests/pyb/spi.py +++ /dev/null @@ -1,33 +0,0 @@ -from pyb import SPI - -# test we can correctly create by id or name -for bus in (-1, 0, 1, 2, 3, "X", "Y", "Z"): - try: - SPI(bus) - print("SPI", bus) - except ValueError: - print("ValueError", bus) - -spi = SPI(1) -print(spi) - -spi = SPI(1, SPI.MASTER) -spi = SPI(1, SPI.MASTER, baudrate=500000) -spi = SPI(1, SPI.MASTER, 500000, polarity=1, phase=0, bits=8, firstbit=SPI.MSB, ti=False, crc=None) -print(spi) - -spi.init(SPI.SLAVE, phase=1) -print(spi) -try: - # need to flush input before we get an error (error is what we want to test) - for i in range(10): - spi.recv(1, timeout=100) -except OSError: - print("OSError") - -spi.init(SPI.MASTER) -spi.send(1, timeout=100) -print(spi.recv(1, timeout=100)) -print(spi.send_recv(1, timeout=100)) - -spi.deinit() diff --git a/tests/pyb/spi.py.exp b/tests/pyb/spi.py.exp deleted file mode 100644 index a0d835700f..0000000000 --- a/tests/pyb/spi.py.exp +++ /dev/null @@ -1,14 +0,0 @@ -ValueError -1 -ValueError 0 -SPI 1 -SPI 2 -ValueError 3 -SPI X -SPI Y -ValueError Z -SPI(1) -SPI(1, SPI.MASTER, baudrate=328125, prescaler=256, polarity=1, phase=0, bits=8) -SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) -OSError -b'\xff' -b'\xff' diff --git a/tests/run-tests b/tests/run-tests index 6e980f03ce..151d48095b 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -87,28 +87,32 @@ def run_micropython(pyb, args, test_file, is_special=False): def get(required=False): rv = b'' while True: - ready = select.select([master], [], [], 0.02) - if ready[0] == [master]: - rv += os.read(master, 1024) + ready = select.select([emulator], [], [], 0.02) + if ready[0] == [emulator]: + rv += os.read(emulator, 1024) else: if not required or rv: return rv def send_get(what): - os.write(master, what) + os.write(emulator, what) return get() with open(test_file, 'rb') as f: # instead of: output_mupy = subprocess.check_output(args, stdin=f) - master, slave = pty.openpty() - p = subprocess.Popen(args, stdin=slave, stdout=slave, + # openpty returns two read/write file descriptors. The first one is + # used by the program which provides the virtual + # terminal service, and the second one is used by the + # subprogram which requires a tty to work. + emulator, subterminal = pty.openpty() + p = subprocess.Popen(args, stdin=subterminal, stdout=subterminal, stderr=subprocess.STDOUT, bufsize=0) banner = get(True) output_mupy = banner + b''.join(send_get(line) for line in f) send_get(b'\x04') # exit the REPL, so coverage info is saved p.kill() - os.close(master) - os.close(slave) + os.close(emulator) + os.close(subterminal) else: output_mupy = subprocess.check_output(args + [test_file], stderr=subprocess.STDOUT) except subprocess.CalledProcessError: diff --git a/tests/wipy/i2c.py b/tests/wipy/i2c.py deleted file mode 100644 index 39dcdc722b..0000000000 --- a/tests/wipy/i2c.py +++ /dev/null @@ -1,175 +0,0 @@ -''' -I2C test for the CC3200 based boards. -A MPU-9150 sensor must be connected to the I2C bus. -''' - -from machine import I2C -import os -import time - -mch = os.uname().machine -if 'LaunchPad' in mch: - i2c_pins = ('GP11', 'GP10') -elif 'WiPy' in mch: - i2c_pins = ('GP15', 'GP10') -else: - raise Exception('Board not supported!') - -i2c = I2C(0, I2C.MASTER, baudrate=400000) -# try initing without the peripheral id -i2c = I2C() -print(i2c) -i2c = I2C(mode=I2C.MASTER, baudrate=50000, pins=i2c_pins) -print(i2c) - -i2c = I2C(0, I2C.MASTER, baudrate=100000) -print(i2c) -i2c = I2C(0, mode=I2C.MASTER, baudrate=400000) -print(i2c) -i2c = I2C(0, mode=I2C.MASTER, baudrate=400000, pins=i2c_pins) -print(i2c) - -addr = i2c.scan()[0] -print(addr) - -reg = bytearray(1) -reg2 = bytearray(2) -reg2_r = bytearray(2) - -# reset the sensor -reg[0] |= 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -print(1 == i2c.readfrom_mem_into(addr, 107, reg)) # read the power management register 1 -print(0x40 == reg[0]) - -# now just read one byte -data = i2c.readfrom_mem(addr, 117, 1) # read the "who am I?" register -print(0x68 == data[0]) -print(len(data) == 1) -print(1 == i2c.readfrom_mem_into(addr, 117, reg)) # read the "who am I?" register again -print(0x68 == reg[0]) - -# now try reading two bytes -data = i2c.readfrom_mem(addr, 116, 2) # read the "who am I?" register -print(0x68 == data[1]) -print(data == b'\x00\x68') -print(len(data) == 2) -print(2 == i2c.readfrom_mem_into(addr, 116, reg2)) # read the "who am I?" register again -print(0x68 == reg2[1]) -print(reg2 == b'\x00\x68') - -print(1 == i2c.readfrom_mem_into(addr, 107, reg)) # read the power management register 1 -print(0x40 == reg[0]) -# clear the sleep bit -reg[0] = 0 -print(1 == i2c.writeto_mem(addr, 107, reg)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg) -print(0 == reg[0]) - -# set the sleep bit -reg[0] = 0x40 -print(1 == i2c.writeto_mem(addr, 107, reg)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg) -print(0x40 == reg[0]) - -# reset the sensor -reg[0] |= 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -# now read and write two register at a time -print(2 == i2c.readfrom_mem_into(addr, 107, reg2)) -print(0x40 == reg2[0]) -print(0x00 == reg2[1]) -# clear the sleep bit -reg2[0] = 0 -# set some other bits -reg2[1] |= 0x03 -print(2 == i2c.writeto_mem(addr, 107, reg2)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg2_r) -print(reg2 == reg2_r) - -# reset the sensor -reg[0] = 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -# try some raw read and writes -reg[0] = 117 # register address -print(1 == i2c.writeto(addr, reg, stop=False)) # just write the register address -# now read -print(1 == i2c.readfrom_into(addr, reg)) -print(reg[0] == 0x68) -reg[0] = 117 # register address -print(1 == i2c.writeto(addr, reg, stop=False)) # just write the register address -# now read -print(0x68 == i2c.readfrom(addr, 1)[0]) - -i2c.readfrom_mem_into(addr, 107, reg2) -print(0x40 == reg2[0]) -print(0x00 == reg2[1]) - -reg2[0] = 107 # register address -reg2[1] = 0 -print(2 == i2c.writeto(addr, reg2, stop=True)) # write the register address and the data -i2c.readfrom_mem_into(addr, 107, reg) # check it back -print(reg[0] == 0) - -# check for memory leaks... -for i in range (0, 1000): - i2c = I2C(0, I2C.MASTER, baudrate=100000) - -# test deinit -i2c = I2C(0, I2C.MASTER, baudrate=100000) -i2c.deinit() -print(i2c) - -# next ones should raise -try: - i2c.scan() -except Exception: - print("Exception") - -try: - i2c.readfrom(addr, 1) -except Exception: - print("Exception") - -try: - i2c.readfrom_into(addr, reg) -except Exception: - print("Exception") - -try: - i2c.readfrom_mem_into(addr, 107, reg) -except Exception: - print("Exception") - -try: - i2c.writeto(addr, reg, stop=False) -except Exception: - print("Exception") - -try: - i2c.writeto_mem(addr, 107, reg) -except Exception: - print("Exception") - -try: - i2c.readfrom_mem(addr, 116, 2) -except Exception: - print("Exception") - -try: - I2C(1, I2C.MASTER, baudrate=100000) -except Exception: - print("Exception") - -# reinitialization must work -i2c.init(baudrate=400000) -print(i2c) diff --git a/tests/wipy/i2c.py.exp b/tests/wipy/i2c.py.exp deleted file mode 100644 index 083da9be7d..0000000000 --- a/tests/wipy/i2c.py.exp +++ /dev/null @@ -1,51 +0,0 @@ -I2C(0, I2C.MASTER, baudrate=100000) -I2C(0, I2C.MASTER, baudrate=50000) -I2C(0, I2C.MASTER, baudrate=100000) -I2C(0, I2C.MASTER, baudrate=400000) -I2C(0, I2C.MASTER, baudrate=400000) -104 -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -I2C(0) -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -I2C(0, I2C.MASTER, baudrate=400000) diff --git a/tests/wipy/spi.py b/tests/wipy/spi.py deleted file mode 100644 index 6bd7aabce1..0000000000 --- a/tests/wipy/spi.py +++ /dev/null @@ -1,147 +0,0 @@ -''' -SPI test for the CC3200 based boards. -''' - -from machine import SPI -import os - -mch = os.uname().machine -if 'LaunchPad' in mch: - spi_pins = ('GP14', 'GP16', 'GP30') -elif 'WiPy' in mch: - spi_pins = ('GP14', 'GP16', 'GP30') -else: - raise Exception('Board not supported!') - -spi = SPI(0, SPI.MASTER, baudrate=2000000, polarity=0, phase=0, firstbit=SPI.MSB, pins=spi_pins) -print(spi) -spi = SPI(baudrate=5000000) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=200000, bits=16, polarity=0, phase=0) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=0, phase=1) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=5000000, bits=32, polarity=1, phase=0) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=1, phase=1) -print(spi) -spi.init(baudrate=20000000, polarity=0, phase=0) -print(spi) -spi=SPI() -print(spi) -SPI(mode=SPI.MASTER) -SPI(mode=SPI.MASTER, pins=spi_pins) -SPI(id=0, mode=SPI.MASTER, polarity=0, phase=0, pins=('GP14', 'GP16', 'GP15')) -SPI(0, SPI.MASTER, polarity=0, phase=0, pins=('GP31', 'GP16', 'GP15')) - -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=0, phase=0, pins=spi_pins) -print(spi.write('123456') == 6) -buffer_r = bytearray(10) -print(spi.readinto(buffer_r) == 10) -print(spi.readinto(buffer_r, write=0x55) == 10) -read = spi.read(10) -print(len(read) == 10) -read = spi.read(10, write=0xFF) -print(len(read) == 10) -buffer_w = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) -print(spi.write_readinto(buffer_w, buffer_r) == 10) -print(buffer_w == buffer_r) - -# test all polaritiy and phase combinations -spi.init(polarity=1, phase=0, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -spi.init(polarity=1, phase=1, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -spi.init(polarity=0, phase=1, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -# test 16 and 32 bit transfers -buffer_w = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2]) -buffer_r = bytearray(12) -spi.init(SPI.MASTER, baudrate=10000000, bits=16, polarity=0, phase=0, pins=None) -print(spi.write_readinto(buffer_w, buffer_r) == 12) -print(buffer_w == buffer_r) - -buffer_r = bytearray(12) -spi.init(SPI.MASTER, baudrate=10000000, bits=32, polarity=0, phase=0, pins=None) -print(spi.write_readinto(buffer_w, buffer_r) == 12) -print(buffer_w == buffer_r) - -# check for memory leaks... -for i in range (0, 1000): - spi = SPI(0, SPI.MASTER, baudrate=1000000) - -# test deinit -spi = SPI(0, SPI.MASTER, baudrate=1000000) -spi.deinit() -print(spi) - -spi = SPI(0, SPI.MASTER, baudrate=1000000) -# next ones must fail -try: - spi = SPI(0, 10, baudrate=10000000, polarity=0, phase=0) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=10000000, polarity=1, phase=2) -except: - print("Exception") - -try: - spi = SPI(1, mode=SPI.MASTER, baudrate=10000000, polarity=1, phase=1) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0, firstbit=2) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0, pins=('GP1', 'GP2')) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=0, phase=0, bits=9) -except: - print("Exception") - -spi.deinit() -try: - spi.read(15) -except Exception: - print("Exception") - -try: - spi.spi.readinto(buffer_r) -except Exception: - print("Exception") - -try: - spi.spi.write('abc') -except Exception: - print("Exception") - -try: - spi.write_readinto(buffer_w, buffer_r) -except Exception: - print("Exception") - -# reinitialization must work -spi.init(baudrate=500000) -print(spi) diff --git a/tests/wipy/spi.py.exp b/tests/wipy/spi.py.exp deleted file mode 100644 index cc4ff40228..0000000000 --- a/tests/wipy/spi.py.exp +++ /dev/null @@ -1,35 +0,0 @@ -SPI(0, SPI.MASTER, baudrate=2000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=5000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=200000, bits=16, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=10000000, bits=8, polarity=0, phase=1, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=5000000, bits=32, polarity=1, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=10000000, bits=8, polarity=1, phase=1, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=20000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=1000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -True -True -True -True -True -True -True -True -True -True -True -True -True -True -SPI(0) -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -SPI(0, SPI.MASTER, baudrate=500000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) diff --git a/tools/codestats.sh b/tools/codestats.sh index d33db973b1..5f7625c450 100755 --- a/tools/codestats.sh +++ b/tools/codestats.sh @@ -90,9 +90,9 @@ else last_rev="v1.0" fi -# get a list of hashes between last revision (exclusive) and master -hashes=$(git log --format=format:"%H" --reverse ${last_rev}..master) -#hashes=$(git log --format=format:"%H" --reverse ${last_rev}..master | $AWK '{if (NR % 10 == 0) print $0}') # do every 10th one +# get a list of hashes between last revision (exclusive) and main +hashes=$(git log --format=format:"%H" --reverse ${last_rev}..main) +#hashes=$(git log --format=format:"%H" --reverse ${last_rev}..main | $AWK '{if (NR % 10 == 0) print $0}') # do every 10th one for hash in $hashes; do @@ -182,6 +182,6 @@ EOF done -# checkout master and cleanup -git checkout master +# checkout main and cleanup +git checkout main $RM $pystoneavg diff --git a/tools/pyboard.py b/tools/pyboard.py index 16ee41f703..bb5642bd78 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -191,7 +191,7 @@ class ProcessToSerial: class ProcessPtyToTerminal: - """Execute a process which creates a PTY and prints slave PTY as + """Execute a process which creates a PTY and prints secondary PTY as first line of its output, and emulate serial connection using this PTY."""