]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Merge pull request #506 from makermelissa/pwm64fix 6.14.0
authorKattni <kattni@adafruit.com>
Tue, 5 Oct 2021 21:51:45 +0000 (17:51 -0400)
committerGitHub <noreply@github.com>
Tue, 5 Oct 2021 21:51:45 +0000 (17:51 -0400)
Fix libgpiod for 64-bit Pi by detecting and loading appropriate lib

16 files changed:
.github/workflows/release.yml
README.rst
docs/api.rst
docs/examples.rst
examples/mcps_busio_i2c.py [changed mode: 0755->0644]
examples/pi_busio_i2c.py [changed mode: 0755->0644]
examples/pi_busio_spi.py [changed mode: 0755->0644]
examples/pi_digitalio.py [changed mode: 0755->0644]
examples/piblinka.py [changed mode: 0755->0644]
setup.py
src/adafruit_blinka/board/feather_u2if.py
src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py
src/board.py
src/keypad.py
src/microcontroller/__init__.py
src/micropython.py

index 220e398e34de24d56a97bf359af1acb40c0c53dd..ce2635bceb9081de638d04215f237444feba87c4 100644 (file)
@@ -29,5 +29,8 @@ jobs:
         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/*
index d802c16077e6b17398021eaff1ec27229c9f0bf0..8f3aa290927d82c1ad7bb809e84730f2e92c40c8 100755 (executable)
@@ -25,11 +25,13 @@ for devices or hosts running CPython or MicroPython. Working code exists to emul
 * **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>`_.
index 61e9bbee5fc477d73425faa0a99dea71c333b0fb..dc0aeb6e660b85d9b152de70d174266abc4efbde 100755 (executable)
@@ -13,6 +13,9 @@
 .. 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:
index c174f0ce661c775cb502b9a5979d3291360b51cb..5f6211baa979f85d1dac6e3d7130d2dcf5c190bb 100755 (executable)
@@ -1,5 +1,37 @@
-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:
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 576afbdca29645bfa187c37de958fbae7b3b6e70..a18904c1d46871640d8b45be7acc970724866e0f 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,11 @@ if os.path.exists("/proc/device-tree/compatible"):
 
 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,
@@ -53,10 +57,11 @@ setup(
         "board",
         "busio",
         "digitalio",
+        "keypad",
         "micropython",
+        "neopixel_write",
         "pulseio",
         "pwmio",
-        "neopixel_write",
         "rainbowio",
     ],
     package_data={
index a6ba7596a77d973f5a9b7b5b83e512293dffad6e..23fe99eae0723770443e1d595a55bf47fa9b63cc 100644 (file)
@@ -33,6 +33,8 @@ A1 = pin.GP27
 A2 = pin.GP28
 # A3 = pin.GP29 # not currently supported in firmware
 
+NEOPIXEL = pin.GP16
+
 SCL = pin.GP3
 SDA = pin.GP2
 
index 30f45f6e8bc7e0b1d7dbb6e50bc537515c8fdefb..fb9edf3e9e788fbc8f139a8fd8ef421433b36a9a 100644 (file)
@@ -189,7 +189,7 @@ class MCP2221:
             # 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()
@@ -198,7 +198,7 @@ class MCP2221:
         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(
@@ -223,6 +223,8 @@ class MCP2221:
             # yay chunk sent!
             while self._i2c_state() == RESP_I2C_PARTIALDATA:
                 time.sleep(0.001)
+            if not buffer:
+                break
             start += chunk
             retries = 0
 
index af73c13de17e72d0ce2c96073b3735f11aa7e198..0de6c109f5a8147ec75c4af5aa4bd4b4454abd3b 100755 (executable)
@@ -27,6 +27,13 @@ See `CircuitPython:board` in CircuitPython for more details.
 
 * 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
index 97c58e782e9dc9f84ddca6f33e75f2cf485c73bc..a156d6e5add4fd0b951ca880d5e33b3618811292 100644 (file)
@@ -462,7 +462,7 @@ class ShiftRegisterKeys(_KeysBase):
 
     @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):
index 9e05c81045ea5d1e9485ce6f47ba82ebdbd2adea..fda16cc109c9c1d7c9409e89b2cbe36c4efa10b0 100755 (executable)
@@ -1,4 +1,9 @@
-"""Microcontroller pins"""
+"""
+`microcontroller` - Pin references and cpu functionality
+========================================================
+
+* Author(s): Melissa LeBlanc-Williams
+"""
 
 import sys
 import time
@@ -14,7 +19,12 @@ def delay_us(delay):
 
 
 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"""
index 5f369e3f0df022d3594edd97633e5093ed303266..843d5a5704f0b517b5064dca524d011e7951b4ca 100755 (executable)
@@ -1,6 +1,6 @@
 """
 `micropython` - MicroPython Specific Decorator Functions
-=================================================
+========================================================
 
 * Author(s): cefn
 """