summaryrefslogtreecommitdiff
path: root/shared-bindings/busio
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-10-29 09:58:44 -0400
committerDan Halbert <halbert@halwitz.org>2019-10-29 09:58:44 -0400
commit43b8d5e8ab07d9053fd55059a240891b6547626b (patch)
treecb4da4ed47767925cde4d6171f3f5f0f0f0187da /shared-bindings/busio
parente35eb08f1d91f4db7a65eea0987a8cdc4d1e1d65 (diff)
Update I2C and SPI documentation
Diffstat (limited to 'shared-bindings/busio')
-rw-r--r--shared-bindings/busio/I2C.c4
-rw-r--r--shared-bindings/busio/SPI.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c
index 3bd89e2e2..50a95beb2 100644
--- a/shared-bindings/busio/I2C.c
+++ b/shared-bindings/busio/I2C.c
@@ -60,6 +60,10 @@
//| :param int frequency: The clock frequency in Hertz
//| :param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C)
//|
+//| .. note:: On the nRF52840, only one I2C object may be created,
+//| except on the Circuit Playground Bluefruit, which allows two,
+//| one for the onboard accelerometer, and one for offboard use.
+//|
STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
busio_i2c_obj_t *self = m_new_obj(busio_i2c_obj_t);
self->base.type = &busio_i2c_type;
diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c
index d47bf499a..d1791bef3 100644
--- a/shared-bindings/busio/SPI.c
+++ b/shared-bindings/busio/SPI.c
@@ -154,11 +154,12 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) {
//| within spec for the SAMD21.
//|
//| .. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz,
-//| and 8MHz. 16MHz and 32MHz are also available, but only on the first
-//| `busio.SPI` object you create. Two more ``busio.SPI`` objects can be created, but they are restricted
-//| to 8MHz maximum. This is a hardware restriction: there is only one high-speed SPI peripheral.
+//| and 8MHz.
//| If you pick a a baudrate other than one of these, the nearest lower
//| baudrate will be chosen, with a minimum of 125kHz.
+//| Two SPI objects may be created, except on the Circuit Playground Bluefruit,
+//| which allows only one (to allow for an additional I2C object).
+//|
STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits };
static const mp_arg_t allowed_args[] = {