|
3 | 3 | *
|
4 | 4 | * The MIT License (MIT)
|
5 | 5 | *
|
6 |
| - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries |
| 6 | + * Copyright (c) 2020 Mark Komus |
7 | 7 | *
|
8 | 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
9 | 9 | * of this software and associated documentation files (the "Software"), to deal
|
|
37 | 37 |
|
38 | 38 | //| """Hardware accelerated external bus access
|
39 | 39 | //|
|
40 |
| -//| The `busio` module contains classes to support a variety of serial |
41 |
| -//| protocols. |
42 |
| -//| |
43 |
| -//| When the microcontroller does not support the behavior in a hardware |
44 |
| -//| accelerated fashion it may internally use a bitbang routine. However, if |
45 |
| -//| hardware support is available on a subset of pins but not those provided, |
46 |
| -//| then a RuntimeError will be raised. Use the `bitbangio` module to explicitly |
47 |
| -//| bitbang a serial protocol on any general purpose pins. |
48 |
| -//| |
49 |
| -//| All classes change hardware state and should be deinitialized when they |
50 |
| -//| are no longer needed if the program continues after use. To do so, either |
51 |
| -//| call :py:meth:`!deinit` or use a context manager. See |
52 |
| -//| :ref:`lifetime-and-contextmanagers` for more info. |
53 |
| -//| |
54 |
| -//| For example:: |
55 |
| -//| |
56 |
| -//| import busio |
57 |
| -//| from board import * |
58 |
| -//| |
59 |
| -//| i2c = busio.I2C(SCL, SDA) |
60 |
| -//| print(i2c.scan()) |
61 |
| -//| i2c.deinit() |
62 |
| -//| |
63 |
| -//| This example will initialize the the device, run |
64 |
| -//| :py:meth:`~busio.I2C.scan` and then :py:meth:`~busio.I2C.deinit` the |
65 |
| -//| hardware. The last step is optional because CircuitPython automatically |
66 |
| -//| resets hardware after a program finishes.""" |
| 40 | +//| The I2CDevice and SPIDevice helper classes make managing transaction state on a bus easy. |
| 41 | +//| For example, they manage locking the bus to prevent other concurrent access. For SPI |
| 42 | +//| devices, it manages the chip select and protocol changes such as mode. For I2C, it |
| 43 | +//| manages the device address. |
67 | 44 | //|
|
68 | 45 |
|
69 | 46 | STATIC const mp_rom_map_elem_t busdevice_module_globals_table[] = {
|
|
0 commit comments