Skip to content

Commit 4ba1ebc

Browse files
committed
Use primary/secondary terminology in docstrings
1 parent 4442b57 commit 4ba1ebc

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

shared-bindings/bitbangio/I2C.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) {
158158
MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock);
159159

160160
//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any:
161-
//| """Read into ``buffer`` from the slave specified by ``address``.
161+
//| """Read into ``buffer`` from the secondary specified by ``address``.
162162
//| The number of bytes read will be the length of ``buffer``.
163163
//| At least one byte must be read.
164164
//|
@@ -210,7 +210,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a
210210
MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into);
211211

212212
//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any:
213-
//| """Write the bytes from ``buffer`` to the slave specified by ``address`` and then transmits a
213+
//| """Write the bytes from ``buffer`` to the secondary specified by ``address`` and then transmits a
214214
//| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start
215215
//| before a read.
216216
//|
@@ -270,7 +270,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_wr
270270

271271

272272
//| 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:
273-
//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop
273+
//| """Write the bytes from ``out_buffer`` to the secondary specified by ``address``, generate no stop
274274
//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
275275
//| ``in_buffer`` can be the same buffer because they are used sequentially.
276276
//|

shared-bindings/bitbangio/SPI.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@
4343
//| """A 3-4 wire serial protocol
4444
//|
4545
//| SPI is a serial protocol that has exclusive pins for data in and out of the
46-
//| master. It is typically faster than :py:class:`~bitbangio.I2C` because a
47-
//| separate pin is used to control the active slave rather than a transmitted
46+
//| microcontroller. It is typically faster than :py:class:`~bitbangio.I2C` because a
47+
//| separate pin is used to control the active secondary rather than a transmitted
4848
//| address. This class only manages three of the four SPI lines: `!clock`,
49-
//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave
50-
//| select line. (This is common because multiple slaves can share the `!clock`,
49+
//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate secondary
50+
//| select line. (This is common because multiple secondaries can share the `!clock`,
5151
//| `!MOSI` and `!MISO` lines and therefore the hardware.)"""
5252
//|
5353
//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None):
5454
//| """Construct an SPI object on the given pins.
5555
//|
5656
//| :param ~microcontroller.Pin clock: the pin to use for the clock.
57-
//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin.
58-
//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin."""
57+
//| :param ~microcontroller.Pin MOSI: the Microcontroller Out Secondary In pin.
58+
//| :param ~microcontroller.Pin MISO: the Microcontroller In Secondary Out pin."""
5959
//| ...
6060
//|
6161

shared-bindings/busio/I2C.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) {
177177
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock);
178178

179179
//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any:
180-
//| """Read into ``buffer`` from the slave specified by ``address``.
180+
//| """Read into ``buffer`` from the secondary specified by ``address``.
181181
//| The number of bytes read will be the length of ``buffer``.
182182
//| At least one byte must be read.
183183
//|
@@ -229,7 +229,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args,
229229
MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into);
230230

231231
//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any:
232-
//| """Write the bytes from ``buffer`` to the slave specified by ``address``.
232+
//| """Write the bytes from ``buffer`` to the secondary specified by ``address``.
233233
//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be
234234
//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and
235235
//| 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
288288
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto);
289289

290290
//| 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:
291-
//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop
291+
//| """Write the bytes from ``out_buffer`` to the secondary specified by ``address``, generate no stop
292292
//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
293293
//| ``in_buffer`` can be the same buffer because they are used sequentially.
294294
//|

shared-bindings/busio/SPI.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
//| """A 3-4 wire serial protocol
4646
//|
4747
//| SPI is a serial protocol that has exclusive pins for data in and out of the
48-
//| master. It is typically faster than :py:class:`~busio.I2C` because a
49-
//| separate pin is used to control the active slave rather than a transitted
48+
//| microcontroller. It is typically faster than :py:class:`~busio.I2C` because a
49+
//| separate pin is used to control the active secondary rather than a transitted
5050
//| address. This class only manages three of the four SPI lines: `!clock`,
51-
//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave
52-
//| select line. (This is common because multiple slaves can share the `!clock`,
51+
//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate secondary
52+
//| select line. (This is common because multiple secondaries can share the `!clock`,
5353
//| `!MOSI` and `!MISO` lines and therefore the hardware.)"""
5454
//|
5555
//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None):
@@ -72,8 +72,8 @@
7272
//| :ref:`Register <register-module-reference>` data descriptors.
7373
//|
7474
//| :param ~microcontroller.Pin clock: the pin to use for the clock.
75-
//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin.
76-
//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin."""
75+
//| :param ~microcontroller.Pin MOSI: the Microcontroller Out Secondary In pin.
76+
//| :param ~microcontroller.Pin MISO: the Microcontroller In Secondary Out pin."""
7777
//| ...
7878
//|
7979

shared-bindings/i2cslave/I2CSlave.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_obj___exit__(size_t n_args, const mp_obj_t *a
134134
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave___exit___obj, 4, 4, i2cslave_i2c_slave_obj___exit__);
135135

136136
//| def request(self, timeout: float = -1) -> Any:
137-
//| """Wait for an I2C request from a master.
137+
//| """Wait for an I2C request from a microcontroller.
138138
//|
139139
//| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once
140140
//| :return: I2C Slave Request or None if timeout=-1 and there's no request
@@ -228,12 +228,12 @@ const mp_obj_type_t i2cslave_i2c_slave_type = {
228228
//| class I2CSlaveRequest:
229229
//|
230230
//| def __init__(self, slave: i2cslave.I2CSlave, address: int, is_read: bool, is_restart: bool):
231-
//| """I2C transfer request from a master.
231+
//| """I2C transfer request from a microcontroller
232232
//| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`.
233233
//|
234234
//| :param slave: The I2C Slave receiving this request
235235
//| :param address: I2C address
236-
//| :param is_read: I2C Master read request
236+
//| :param is_read: True if The I2C Microcontroller is reading from the device
237237
//| :param is_restart: Repeated Start Condition"""
238238
//|
239239
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) {
@@ -270,7 +270,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) {
270270
MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_address_obj, i2cslave_i2c_slave_request_get_address);
271271

272272
//| is_read: bool = ...
273-
//| """The I2C master is reading from the device."""
273+
//| """The I2C Microcontroller is reading from the device."""
274274
//|
275275
STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) {
276276
mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type));

shared-bindings/i2cslave/__init__.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
//| if not r:
5454
//| # Maybe do some housekeeping
5555
//| continue
56-
//| with r: # Closes the transfer if necessary by sending a NACK or feeding the master dummy bytes
56+
//| with r: # Closes the transfer if necessary by sending a NACK or feeding the microcontroller dummy bytes
5757
//| if r.address == 0x40:
58-
//| if not r.is_read: # Master write which is Slave read
58+
//| if not r.is_read: # Microcontroller write which is Secondary read
5959
//| b = r.read(1)
6060
//| if not b or b[0] > 15:
6161
//| break

0 commit comments

Comments
 (0)