|
45 | 45 | //| physical level it consists of 2 wires: SCL and SDA, the clock and data |
46 | 46 | //| lines respectively. |
47 | 47 | //| |
| 48 | +//| .. seealso:: Using this class directly requires careful lock management. |
| 49 | +//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to |
| 50 | +//| manage locks. |
| 51 | +//| |
| 52 | +//| .. seealso:: Using this class to directly read registers requires manual |
| 53 | +//| bit unpacking. Instead, use an existing driver or make one with |
| 54 | +//| :ref:`Register <register-module-reference>` data descriptors. |
| 55 | +//| |
48 | 56 | //| :param ~microcontroller.Pin scl: The clock pin |
49 | 57 | //| :param ~microcontroller.Pin sda: The data pin |
50 | 58 | //| :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) { |
158 | 166 | MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); |
159 | 167 |
|
160 | 168 | //| 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``. |
| 169 | +//| """Read into ``buffer`` from the device selected by ``address``. |
162 | 170 | //| The number of bytes read will be the length of ``buffer``. |
163 | 171 | //| At least one byte must be read. |
164 | 172 | //| |
@@ -210,7 +218,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a |
210 | 218 | MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); |
211 | 219 |
|
212 | 220 | //| 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 |
| 221 | +//| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a |
214 | 222 | //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start |
215 | 223 | //| before a read. |
216 | 224 | //| |
@@ -270,7 +278,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_wr |
270 | 278 |
|
271 | 279 |
|
272 | 280 | //| 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 |
| 281 | +//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop |
274 | 282 | //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and |
275 | 283 | //| ``in_buffer`` can be the same buffer because they are used sequentially. |
276 | 284 | //| |
|
0 commit comments