TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
+ for file in $(find -not -path "./.*" -not -path "./docs*" -name "*.py"); do
+ sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file;
+ done;
python setup.py sdist
twine upload dist/*
* **board** - breakout-specific pin identities
* **busio** - hardware-driven interfaces for I2C, SPI, UART
* **digitalio** - digital input/output pins, using pin identities from board+microcontroller packages
+* **keypad** - support for scanning keys and key matrices
* **microcontroller** - chip-specific pin identities
* **micropython** - MicroPython-specific module
* **neopixel_write** - low-level interface to NeoPixels
* **pulseio** - contains classes that provide access to basic pulse IO (PWM)
* **pwmio** - contains classes that provide access to basic pulse IO (PWM)
+* **rainbowio** - provides the colorwheel() function
For details, see the `Blinka API reference
<https://circuitpython.readthedocs.io/projects/blinka/en/latest/index.html>`_.
.. automodule:: adafruit_blinka.microcontroller
:members:
+.. automodule:: analogio
+ :members:
+
.. automodule:: bitbangio
:members:
.. automodule:: digitalio
:members:
-.. automodule:: analogio
+.. automodule:: keypad
:members:
-.. automodule:: pulseio
+.. automodule:: microcontroller
+ :members:
+
+.. automodule:: micropython
:members:
.. automodule:: neopixel_write
:members:
+.. automodule:: pulseio
+ :members:
+
+.. automodule:: pwmio
+ :members:
+.. automodule:: rainbowio
+ :members:
-examples
+Examples
--------
-No examples are currently available. See the `CircuitPython docs
-<https://circuitpython.readthedocs.io/>`_ for extensive API documentation.
+See the `CircuitPython docs <https://circuitpython.readthedocs.io/>`_ for extensive API documentation which should
+(mostly) work with Blinka.
+
+.. literalinclude:: ../examples/analog_in.py
+ :caption: examples/analog_in.py
+ :linenos:
+
+.. literalinclude:: ../examples/bbb_digitalio.py
+ :caption: examples/bbb_digitalio.py
+ :linenos:
+
+.. literalinclude:: ../examples/mcps_busio_i2c.py
+ :caption: examples/mcps_busio_i2c.py
+ :linenos:
+
+.. literalinclude:: ../examples/pb_digitalio.py
+ :caption: examples/pb_digitalio.py
+ :linenos:
+
+.. literalinclude:: ../examples/pi_busio_i2c.py
+ :caption: examples/pi_busio_i2c.py
+ :linenos:
+
+.. literalinclude:: ../examples/pi_busio_spi.py
+ :caption: examples/pi_busio_spi.py
+ :linenos:
+
+.. literalinclude:: ../examples/pi_digitalio.py
+ :caption: examples/pi_digitalio.py
+ :linenos:
+
+.. literalinclude:: ../examples/piblinka.py
+ :caption: examples/piblinka.py
+ :linenos:
setup(
name="Adafruit-Blinka",
- use_scm_version=True,
+ use_scm_version={
+ # This is needed for the PyPI version munging in the Github Actions release.yml
+ "git_describe_command": "git describe --tags --long",
+ "local_scheme": "no-local-version",
+ },
setup_requires=["setuptools_scm"],
description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
long_description=long_description,
"board",
"busio",
"digitalio",
+ "keypad",
"micropython",
+ "neopixel_write",
"pulseio",
"pwmio",
- "neopixel_write",
"rainbowio",
],
package_data={
A2 = pin.GP28
# A3 = pin.GP29 # not currently supported in firmware
+NEOPIXEL = pin.GP16
+
SCL = pin.GP3
SDA = pin.GP2
# bus release will need "a few hundred microseconds"
time.sleep(0.001)
- # pylint: disable=too-many-arguments
+ # pylint: disable=too-many-arguments,too-many-branches
def _i2c_write(self, cmd, address, buffer, start=0, end=None):
if self._i2c_state() != 0x00:
self._i2c_cancel()
length = end - start
retries = 0
- while (end - start) > 0:
+ while (end - start) > 0 or not buffer:
chunk = min(end - start, MCP2221_MAX_I2C_DATA_LEN)
# write out current chunk
resp = self._hid_xfer(
# yay chunk sent!
while self._i2c_state() == RESP_I2C_PARTIALDATA:
time.sleep(0.001)
+ if not buffer:
+ break
start += chunk
retries = 0
* Author(s): cefn
"""
+
+
+__version__ = "0.0.0-auto.0"
+__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git"
+__blinka__ = True
+
+
import sys
import adafruit_platformdetect.constants.boards as ap_board
@property
def events(self):
- """The `EventQueue` associated with this `Keys` object. (read-only)"""
+ """The ``EventQueue`` associated with this `Keys` object. (read-only)"""
return self._events
def _keypad_shiftregisterkeys_scan(self):
-"""Microcontroller pins"""
+"""
+`microcontroller` - Pin references and cpu functionality
+========================================================
+
+* Author(s): Melissa LeBlanc-Williams
+"""
import sys
import time
class Pin(Enum):
- """Reference Pin object"""
+ """
+ Identifies an IO pin on the microcontroller.
+
+ They are fixed by the hardware so they cannot be constructed on demand. Instead, use board or
+ microcontroller.pin to reference the desired pin.
+ """
def __init__(self, pin_id):
"""Identifier for pin, referencing platform-specific pin id"""
"""
`micropython` - MicroPython Specific Decorator Functions
-=================================================
+========================================================
* Author(s): cefn
"""