Skip to content

Commit 9ec2245

Browse files
committed
Clean up
1 parent 8a37983 commit 9ec2245

File tree

3 files changed

+7
-31
lines changed

3 files changed

+7
-31
lines changed

shared-bindings/busdevice/I2CDevice.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2016 Scott Shawcroft
6+
* Copyright (c) 2020 Mark Komus
77
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy
99
* of this software and associated documentation files (the "Software"), to deal

shared-bindings/busdevice/I2CDevice.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@
3636

3737
#include "py/obj.h"
3838

39-
#include "common-hal/microcontroller/Pin.h"
4039
#include "shared-module/busdevice/I2CDevice.h"
41-
#include "shared-bindings/busio/I2C.h"
40+
//#include "shared-bindings/busio/I2C.h"
4241

4342
// Type object used in Python. Should be shared between ports.
4443
extern const mp_obj_type_t busdevice_i2cdevice_type;

shared-bindings/busdevice/__init__.c

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2016 Scott Shawcroft for Adafruit Industries
6+
* Copyright (c) 2020 Mark Komus
77
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy
99
* of this software and associated documentation files (the "Software"), to deal
@@ -37,33 +37,10 @@
3737

3838
//| """Hardware accelerated external bus access
3939
//|
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.
6744
//|
6845

6946
STATIC const mp_rom_map_elem_t busdevice_module_globals_table[] = {

0 commit comments

Comments
 (0)