This commit is contained in:
gamblor21 2020-10-27 08:43:51 -05:00
parent 8a379830a8
commit 9ec224539b
3 changed files with 7 additions and 31 deletions

View File

@ -3,7 +3,7 @@
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Scott Shawcroft
* Copyright (c) 2020 Mark Komus
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View File

@ -36,9 +36,8 @@
#include "py/obj.h"
#include "common-hal/microcontroller/Pin.h"
#include "shared-module/busdevice/I2CDevice.h"
#include "shared-bindings/busio/I2C.h"
//#include "shared-bindings/busio/I2C.h"
// Type object used in Python. Should be shared between ports.
extern const mp_obj_type_t busdevice_i2cdevice_type;

View File

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