]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Added pre-commit support
authorMelissa LeBlanc-Williams <melissa@adafruit.com>
Fri, 4 Mar 2022 17:17:23 +0000 (09:17 -0800)
committerMelissa LeBlanc-Williams <melissa@adafruit.com>
Fri, 4 Mar 2022 17:17:23 +0000 (09:17 -0800)
265 files changed:
.github/workflows/build.yml
.github/workflows/release.yml
.gitignore
.gitmodules
.pre-commit-config.yaml [new file with mode: 0644]
.pylintrc
.readthedocs.yaml [new file with mode: 0644]
.readthedocs.yml [deleted file]
CODE_OF_CONDUCT.md
LICENSE
LICENSES/CC-BY-4.0.txt [new file with mode: 0644]
LICENSES/MIT.txt [new file with mode: 0644]
LICENSES/Unlicense.txt [new file with mode: 0644]
README.rst.license [new file with mode: 0644]
docs/_static/favicon.ico.license [new file with mode: 0644]
docs/api.rst.license [new file with mode: 0644]
docs/conf.py
docs/examples.rst.license [new file with mode: 0644]
docs/index.rst.license [new file with mode: 0644]
docs/requirements.txt [new file with mode: 0644]
examples/analog_in.py
examples/bbb_digitalio.py
examples/mcps_busio_i2c.py
examples/pb_digitalio.py
examples/pi_busio_i2c.py
examples/pi_busio_spi.py
examples/pi_digitalio.py
examples/piblinka.py
requirements.txt.license [new file with mode: 0644]
setup.py
src/__version__.py
src/adafruit_blinka/__init__.py
src/adafruit_blinka/agnostic/__init__.py
src/adafruit_blinka/agnostic/time.py
src/adafruit_blinka/board/bananapi/__init__.py
src/adafruit_blinka/board/bananapi/bpim2zero.py
src/adafruit_blinka/board/beagleboard/__init__.py
src/adafruit_blinka/board/beagleboard/beaglebone_ai.py
src/adafruit_blinka/board/beagleboard/beaglebone_black.py
src/adafruit_blinka/board/beagleboard/beaglebone_pocketbeagle.py
src/adafruit_blinka/board/beagleboard/beaglev_starlight.py
src/adafruit_blinka/board/binho_nova.py
src/adafruit_blinka/board/clockworkcpi3.py
src/adafruit_blinka/board/coral_dev_board.py
src/adafruit_blinka/board/coral_dev_board_mini.py
src/adafruit_blinka/board/dragonboard_410c.py
src/adafruit_blinka/board/feather_huzzah.py
src/adafruit_blinka/board/feather_u2if.py
src/adafruit_blinka/board/ftdi_ft2232h.py
src/adafruit_blinka/board/ftdi_ft232h.py
src/adafruit_blinka/board/giantboard.py
src/adafruit_blinka/board/greatfet_one.py
src/adafruit_blinka/board/hardkernel/__init__.py
src/adafruit_blinka/board/hardkernel/odroidc2.py
src/adafruit_blinka/board/hardkernel/odroidc4.py
src/adafruit_blinka/board/hardkernel/odroidn2.py
src/adafruit_blinka/board/hardkernel/odroidxu4.py
src/adafruit_blinka/board/hifive_unleashed.py
src/adafruit_blinka/board/itsybitsy_u2if.py
src/adafruit_blinka/board/lubancat/__init__.py
src/adafruit_blinka/board/lubancat/lubancat_imx6ull.py
src/adafruit_blinka/board/lubancat/lubancat_stm32mp157.py
src/adafruit_blinka/board/macropad_u2if.py
src/adafruit_blinka/board/microchip_mcp2221.py
src/adafruit_blinka/board/nanopi/__init__.py
src/adafruit_blinka/board/nanopi/duo2.py
src/adafruit_blinka/board/nanopi/neo.py
src/adafruit_blinka/board/nanopi/neoair.py
src/adafruit_blinka/board/nodemcu.py
src/adafruit_blinka/board/nvidia/__init__.py
src/adafruit_blinka/board/nvidia/clara_agx_xavier.py
src/adafruit_blinka/board/nvidia/jetson_nano.py
src/adafruit_blinka/board/nvidia/jetson_nx.py
src/adafruit_blinka/board/nvidia/jetson_tx1.py
src/adafruit_blinka/board/nvidia/jetson_tx2.py
src/adafruit_blinka/board/nvidia/jetson_tx2_nx.py
src/adafruit_blinka/board/nvidia/jetson_xavier.py
src/adafruit_blinka/board/onion/__init__.py
src/adafruit_blinka/board/onion/omega2.py
src/adafruit_blinka/board/orangepi/__init__.py
src/adafruit_blinka/board/orangepi/orangepi3.py
src/adafruit_blinka/board/orangepi/orangepipc.py
src/adafruit_blinka/board/orangepi/orangepir1.py
src/adafruit_blinka/board/orangepi/orangepizero.py
src/adafruit_blinka/board/orangepi/orangepizero2.py
src/adafruit_blinka/board/orangepi/orangepizeroplus.py
src/adafruit_blinka/board/orangepi/orangepizeroplus2h5.py
src/adafruit_blinka/board/pico_u2if.py
src/adafruit_blinka/board/pine64.py
src/adafruit_blinka/board/pineH64.py
src/adafruit_blinka/board/pyboard.py
src/adafruit_blinka/board/qt2040_trinkey_u2if.py
src/adafruit_blinka/board/qtpy_u2if.py
src/adafruit_blinka/board/radxa/__init__.py
src/adafruit_blinka/board/radxa/rockpi4.py
src/adafruit_blinka/board/radxa/rockpie.py
src/adafruit_blinka/board/radxa/rockpis.py
src/adafruit_blinka/board/raspberrypi/__init__.py
src/adafruit_blinka/board/raspberrypi/pico.py
src/adafruit_blinka/board/raspberrypi/raspi_1b_rev1.py
src/adafruit_blinka/board/raspberrypi/raspi_1b_rev2.py
src/adafruit_blinka/board/raspberrypi/raspi_40pin.py
src/adafruit_blinka/board/raspberrypi/raspi_4b.py
src/adafruit_blinka/board/raspberrypi/raspi_cm.py
src/adafruit_blinka/board/soPine.py
src/adafruit_blinka/board/stm32/__init__.py
src/adafruit_blinka/board/stm32/osd32mp1_brk.py
src/adafruit_blinka/board/stm32/osd32mp1_red.py
src/adafruit_blinka/board/stm32/stm32mp157c_dk2.py
src/adafruit_blinka/board/tritium-h3.py
src/adafruit_blinka/board/udoo_x86ultra.py
src/adafruit_blinka/microcontroller/allwinner/__init__.py
src/adafruit_blinka/microcontroller/allwinner/a33/__init__.py
src/adafruit_blinka/microcontroller/allwinner/a33/pin.py
src/adafruit_blinka/microcontroller/allwinner/a64/__init__.py
src/adafruit_blinka/microcontroller/allwinner/a64/pin.py
src/adafruit_blinka/microcontroller/allwinner/h3/__init__.py
src/adafruit_blinka/microcontroller/allwinner/h3/pin.py
src/adafruit_blinka/microcontroller/allwinner/h5/__init__.py
src/adafruit_blinka/microcontroller/allwinner/h5/pin.py
src/adafruit_blinka/microcontroller/allwinner/h6/__init__.py
src/adafruit_blinka/microcontroller/allwinner/h6/pin.py
src/adafruit_blinka/microcontroller/allwinner/h616/__init__.py
src/adafruit_blinka/microcontroller/allwinner/h616/pin.py
src/adafruit_blinka/microcontroller/am335x/__init__.py
src/adafruit_blinka/microcontroller/am335x/pin.py
src/adafruit_blinka/microcontroller/am335x/sysfs_pwmout.py
src/adafruit_blinka/microcontroller/amlogic/meson_g12_common/__init__.py
src/adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py
src/adafruit_blinka/microcontroller/amlogic/s905/__init__.py
src/adafruit_blinka/microcontroller/amlogic/s905/pin.py
src/adafruit_blinka/microcontroller/amlogic/s905x3/__init__.py
src/adafruit_blinka/microcontroller/amlogic/s905x3/pin.py
src/adafruit_blinka/microcontroller/amlogic/s922x/__init__.py
src/adafruit_blinka/microcontroller/amlogic/s922x/pin.py
src/adafruit_blinka/microcontroller/atheros/__init__.py
src/adafruit_blinka/microcontroller/atheros/ar9331/pin.py
src/adafruit_blinka/microcontroller/bcm2711/__init__.py
src/adafruit_blinka/microcontroller/bcm2711/pin.py
src/adafruit_blinka/microcontroller/bcm283x/__init__.py
src/adafruit_blinka/microcontroller/bcm283x/neopixel.py
src/adafruit_blinka/microcontroller/bcm283x/pin.py
src/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py
src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein.license [new file with mode: 0644]
src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64.license [new file with mode: 0644]
src/adafruit_blinka/microcontroller/bcm283x/pwmio/PWMOut.py
src/adafruit_blinka/microcontroller/dra74x/__init__.py
src/adafruit_blinka/microcontroller/dra74x/pin.py
src/adafruit_blinka/microcontroller/esp8266/pin.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/ft2232h/__init__.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/ft2232h/pin.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/ft232h/__init__.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/ft232h/pin.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/__init__.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/i2c.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/pin.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/spi.py
src/adafruit_blinka/microcontroller/ftdi_mpsse/mpsse/url.py
src/adafruit_blinka/microcontroller/generic_linux/i2c.py
src/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py
src/adafruit_blinka/microcontroller/generic_linux/periphery_pin.py
src/adafruit_blinka/microcontroller/generic_linux/spi.py
src/adafruit_blinka/microcontroller/generic_linux/sysfs_analogin.py
src/adafruit_blinka/microcontroller/generic_linux/sysfs_analogout.py
src/adafruit_blinka/microcontroller/generic_linux/sysfs_pin.py
src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py
src/adafruit_blinka/microcontroller/generic_micropython/i2c.py
src/adafruit_blinka/microcontroller/generic_micropython/spi.py
src/adafruit_blinka/microcontroller/hfu540/__init__.py
src/adafruit_blinka/microcontroller/hfu540/pin.py
src/adafruit_blinka/microcontroller/mcp2221/__init__.py
src/adafruit_blinka/microcontroller/mcp2221/analogio.py
src/adafruit_blinka/microcontroller/mcp2221/i2c.py
src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py
src/adafruit_blinka/microcontroller/mcp2221/pin.py
src/adafruit_blinka/microcontroller/mips24kec/__init__.py
src/adafruit_blinka/microcontroller/mips24kec/pin.py
src/adafruit_blinka/microcontroller/mt8167/__init__.py
src/adafruit_blinka/microcontroller/mt8167/pin.py
src/adafruit_blinka/microcontroller/nova/__init__.py
src/adafruit_blinka/microcontroller/nova/i2c.py
src/adafruit_blinka/microcontroller/nova/pin.py
src/adafruit_blinka/microcontroller/nova/pwmout.py
src/adafruit_blinka/microcontroller/nova/spi.py
src/adafruit_blinka/microcontroller/nova/uart.py
src/adafruit_blinka/microcontroller/nxp_imx6ull/__init__.py
src/adafruit_blinka/microcontroller/nxp_imx6ull/pin.py
src/adafruit_blinka/microcontroller/nxp_imx8m/__init__.py
src/adafruit_blinka/microcontroller/nxp_imx8m/pin.py
src/adafruit_blinka/microcontroller/nxp_lpc4330/__init__.py
src/adafruit_blinka/microcontroller/nxp_lpc4330/analogio.py
src/adafruit_blinka/microcontroller/nxp_lpc4330/i2c.py
src/adafruit_blinka/microcontroller/nxp_lpc4330/pin.py
src/adafruit_blinka/microcontroller/nxp_lpc4330/pwmout.py
src/adafruit_blinka/microcontroller/nxp_lpc4330/spi.py
src/adafruit_blinka/microcontroller/nxp_lpc4330/uart.py
src/adafruit_blinka/microcontroller/pentium/n3710/.gitignore [deleted file]
src/adafruit_blinka/microcontroller/pentium/n3710/__init__.py
src/adafruit_blinka/microcontroller/pentium/n3710/pin.py
src/adafruit_blinka/microcontroller/rockchip/PWMOut.py
src/adafruit_blinka/microcontroller/rockchip/rk3308/__init__.py
src/adafruit_blinka/microcontroller/rockchip/rk3308/pin.py
src/adafruit_blinka/microcontroller/rockchip/rk3328/__init__.py
src/adafruit_blinka/microcontroller/rockchip/rk3328/pin.py
src/adafruit_blinka/microcontroller/rockchip/rk3399/__init__.py
src/adafruit_blinka/microcontroller/rockchip/rk3399/pin.py
src/adafruit_blinka/microcontroller/rp2040/__init__.py
src/adafruit_blinka/microcontroller/rp2040/i2c.py
src/adafruit_blinka/microcontroller/rp2040/pin.py
src/adafruit_blinka/microcontroller/rp2040/spi.py
src/adafruit_blinka/microcontroller/rp2040/uart.py
src/adafruit_blinka/microcontroller/rp2040_u2if/__init__.py
src/adafruit_blinka/microcontroller/rp2040_u2if/analogio.py
src/adafruit_blinka/microcontroller/rp2040_u2if/i2c.py
src/adafruit_blinka/microcontroller/rp2040_u2if/neopixel.py
src/adafruit_blinka/microcontroller/rp2040_u2if/pin.py
src/adafruit_blinka/microcontroller/rp2040_u2if/pwmio.py
src/adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py
src/adafruit_blinka/microcontroller/rp2040_u2if/spi.py
src/adafruit_blinka/microcontroller/sama5/__init__.py
src/adafruit_blinka/microcontroller/sama5/pin.py
src/adafruit_blinka/microcontroller/samsung/exynos5422/__init__.py
src/adafruit_blinka/microcontroller/samsung/exynos5422/pin.py
src/adafruit_blinka/microcontroller/snapdragon/apq8016/__init__.py
src/adafruit_blinka/microcontroller/snapdragon/apq8016/pin.py
src/adafruit_blinka/microcontroller/starfive/JH71x0/__init__.py
src/adafruit_blinka/microcontroller/starfive/JH71x0/pin.py
src/adafruit_blinka/microcontroller/stm32/stm32f405/__init__.py
src/adafruit_blinka/microcontroller/stm32/stm32f405/pin.py
src/adafruit_blinka/microcontroller/stm32/stm32mp157/__init__.py
src/adafruit_blinka/microcontroller/stm32/stm32mp157/pin.py
src/adafruit_blinka/microcontroller/tegra/t186/__init__.py
src/adafruit_blinka/microcontroller/tegra/t186/pin.py
src/adafruit_blinka/microcontroller/tegra/t194/__init__.py
src/adafruit_blinka/microcontroller/tegra/t194/pin.py
src/adafruit_blinka/microcontroller/tegra/t210/__init__.py
src/adafruit_blinka/microcontroller/tegra/t210/pin.py
src/analogio.py
src/bitbangio.py
src/board.py
src/busio.py
src/digitalio.py
src/keypad.py
src/microcontroller/__init__.py
src/microcontroller/_pin.py [new file with mode: 0644]
src/microcontroller/pin.py
src/micropython.py
src/neopixel_write.py
src/pulseio.py
src/pwmio.py
src/rainbowio.py
src/usb_hid.py
test/scripts/upload_feather_huzzah_circuitpython_put.sh
test/scripts/upload_feather_huzzah_micropython_put.sh
test/scripts/upload_pyboard_micropython_cp.sh
test/src/testing/__init__.py
test/src/testing/adafruit_blinka.py
test/src/testing/board/__init__.py
test/src/testing/board/i2c.py
test/src/testing/microcontroller/__init__.py
test/src/testing/universal/digitalio.py
test/src/testing/universal/i2c.py
test/src/testing/universal/microcontroller.py
test/src/testing/universal/uart.py
test/src/unittest.py

index 0da2cc6c88f3118d577f90f6bfc9c7fc90122f82..c955ed0703b1ff4fdcb5b66a44cc7d56cdc77345 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
+#
+# SPDX-License-Identifier: Unlicense
 name: Build CI
 
 on: [pull_request, push]
@@ -33,18 +36,14 @@ jobs:
       # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
       run: |
         source actions-ci/install.sh
-    - name: Pip install pylint, black, & Sphinx
+    - name: Pip install Sphinx, pre-commit
       run: |
-        pip install --force-reinstall pylint==2.7.1 black Sphinx sphinx-rtd-theme
+        pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
     - name: Library version
       run: git describe --dirty --always --tags
-    - name: Check formatting
+    - name: Pre-commit hooks
       run: |
-        black --check --target-version=py37 .
-    - name: PyLint
-      run: |
-        pylint $( find src -name '*.py' )
-        ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
+        pre-commit run --all-files
     - name: Build docs
       working-directory: docs
       run: sphinx-build -E -W -b html . _build/html
index ce2635bceb9081de638d04215f237444feba87c4..9aa3d4ccbd0af967bea637ee17c292a6c47379f3 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
+#
+# SPDX-License-Identifier: Unlicense
 name: Release Actions
 
 on:
index e7e0f2da7ea4e97c0d3ea706787db572cfbbd272..5fb597bd075ede07a303f531c92cb2cd8396acb7 100644 (file)
@@ -1,3 +1,7 @@
+# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
+#
+# SPDX-License-Identifier: Unlicense
+
 *.mpy
 .idea
 __pycache__
index 41bbf17c946fffbcd57dc896054efc74995e5cb6..b23b276e6b8ce4df3ec14168e58d1a2e7552c77d 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
+#
+# SPDX-License-Identifier: Unlicense
 [submodule "test/libraries/bme280"]
        path = test/libraries/bme280
        url = https://github.com/adafruit/Adafruit_CircuitPython_BME280.git
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644 (file)
index 0000000..bf33d62
--- /dev/null
@@ -0,0 +1,42 @@
+# SPDX-FileCopyrightText: 2022 Adafruit
+#
+# SPDX-License-Identifier: Unlicense
+
+repos:
+-   repo: https://github.com/python/black
+    rev: 20.8b1
+    hooks:
+    - id: black
+-   repo: https://github.com/fsfe/reuse-tool
+    rev: v0.12.1
+    hooks:
+    - id: reuse
+-   repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v2.3.0
+    hooks:
+    -   id: check-yaml
+    -   id: end-of-file-fixer
+    -   id: trailing-whitespace
+-   repo: https://github.com/pycqa/pylint
+    rev: v2.11.1
+    hooks:
+    -   id: pylint
+        name: pylint (library code)
+        types: [python]
+        files: "^src/"
+        args:
+          - --disable=consider-using-f-string,duplicate-code
+    -   id: pylint
+        name: pylint (example code)
+        description: Run pylint rules on "examples/*.py" files
+        types: [python]
+        files: "^examples/"
+        args:
+        - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
+    -   id: pylint
+        name: pylint (test code)
+        description: Run pylint rules on "tests/*.py" files
+        types: [python]
+        files: "^tests/"
+        args:
+        - --disable=missing-docstring,consider-using-f-string,duplicate-code
index 35b40b5f25e2c8c0e29014566d2273daa3703d89..0267cf0a49f44a724cd6a55fe33eb14a99b10349 100644 (file)
--- a/.pylintrc
+++ b/.pylintrc
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
+#
+# SPDX-License-Identifier: Unlicense
 [MASTER]
 
 # A comma-separated list of package or module names from where C extensions may
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644 (file)
index 0000000..b7f9208
--- /dev/null
@@ -0,0 +1,15 @@
+
+# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
+#
+# SPDX-License-Identifier: Unlicense
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+python:
+  version: "3.7"
+  install:
+    - requirements: docs/requirements.txt
+    - requirements: requirements.txt
diff --git a/.readthedocs.yml b/.readthedocs.yml
deleted file mode 100644 (file)
index f4243ad..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-python:
-    version: 3
-requirements_file: requirements.txt
index 1617586f3aeb46283110d47ac9b3b92453eafb19..a5f7ed20bd2ab99a91db6397280a181b21ad425f 100644 (file)
@@ -1,3 +1,9 @@
+<!--
+SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
+SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
+SPDX-License-Identifier: CC-BY-4.0
+-->
+
 # Contributor Covenant Code of Conduct
 
 ## Our Pledge
diff --git a/LICENSE b/LICENSE
index b3c1ecf8e9c9eea8d15c965da738e43839bb5ea5..794a9d86f322565ac12dfec424ee424cbef96a10 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2017 cefn for adafruit industries
+Copyright (c) 2018 Adafruit Industries
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt
new file mode 100644 (file)
index 0000000..3f92dfc
--- /dev/null
@@ -0,0 +1,324 @@
+Creative Commons Attribution 4.0 International Creative Commons Corporation
+("Creative Commons") is not a law firm and does not provide legal services
+or legal advice. Distribution of Creative Commons public licenses does not
+create a lawyer-client or other relationship. Creative Commons makes its licenses
+and related information available on an "as-is" basis. Creative Commons gives
+no warranties regarding its licenses, any material licensed under their terms
+and conditions, or any related information. Creative Commons disclaims all
+liability for damages resulting from their use to the fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and conditions
+that creators and other rights holders may use to share original works of
+authorship and other material subject to copyright and certain other rights
+specified in the public license below. The following considerations are for
+informational purposes only, are not exhaustive, and do not form part of our
+licenses.
+
+Considerations for licensors: Our public licenses are intended for use by
+those authorized to give the public permission to use material in ways otherwise
+restricted by copyright and certain other rights. Our licenses are irrevocable.
+Licensors should read and understand the terms and conditions of the license
+they choose before applying it. Licensors should also secure all rights necessary
+before applying our licenses so that the public can reuse the material as
+expected. Licensors should clearly mark any material not subject to the license.
+This includes other CC-licensed material, or material used under an exception
+or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors
+
+Considerations for the public: By using one of our public licenses, a licensor
+grants the public permission to use the licensed material under specified
+terms and conditions. If the licensor's permission is not necessary for any
+reason–for example, because of any applicable exception or limitation to copyright–then
+that use is not regulated by the license. Our licenses grant only permissions
+under copyright and certain other rights that a licensor has authority to
+grant. Use of the licensed material may still be restricted for other reasons,
+including because others have copyright or other rights in the material. A
+licensor may make special requests, such as asking that all changes be marked
+or described. Although not required by our licenses, you are encouraged to
+respect those requests where reasonable. More considerations for the public
+: wiki.creativecommons.org/Considerations_for_licensees Creative Commons Attribution
+4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree to
+be bound by the terms and conditions of this Creative Commons Attribution
+4.0 International Public License ("Public License"). To the extent this Public
+License may be interpreted as a contract, You are granted the Licensed Rights
+in consideration of Your acceptance of these terms and conditions, and the
+Licensor grants You such rights in consideration of benefits the Licensor
+receives from making the Licensed Material available under these terms and
+conditions.
+
+Section 1 â€“ Definitions.
+
+a. Adapted Material means material subject to Copyright and Similar Rights
+that is derived from or based upon the Licensed Material and in which the
+Licensed Material is translated, altered, arranged, transformed, or otherwise
+modified in a manner requiring permission under the Copyright and Similar
+Rights held by the Licensor. For purposes of this Public License, where the
+Licensed Material is a musical work, performance, or sound recording, Adapted
+Material is always produced where the Licensed Material is synched in timed
+relation with a moving image.
+
+b. Adapter's License means the license You apply to Your Copyright and Similar
+Rights in Your contributions to Adapted Material in accordance with the terms
+and conditions of this Public License.
+
+c. Copyright and Similar Rights means copyright and/or similar rights closely
+related to copyright including, without limitation, performance, broadcast,
+sound recording, and Sui Generis Database Rights, without regard to how the
+rights are labeled or categorized. For purposes of this Public License, the
+rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
+
+d. Effective Technological Measures means those measures that, in the absence
+of proper authority, may not be circumvented under laws fulfilling obligations
+under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996,
+and/or similar international agreements.
+
+e. Exceptions and Limitations means fair use, fair dealing, and/or any other
+exception or limitation to Copyright and Similar Rights that applies to Your
+use of the Licensed Material.
+
+f. Licensed Material means the artistic or literary work, database, or other
+material to which the Licensor applied this Public License.
+
+g. Licensed Rights means the rights granted to You subject to the terms and
+conditions of this Public License, which are limited to all Copyright and
+Similar Rights that apply to Your use of the Licensed Material and that the
+Licensor has authority to license.
+
+h. Licensor means the individual(s) or entity(ies) granting rights under this
+Public License.
+
+i. Share means to provide material to the public by any means or process that
+requires permission under the Licensed Rights, such as reproduction, public
+display, public performance, distribution, dissemination, communication, or
+importation, and to make material available to the public including in ways
+that members of the public may access the material from a place and at a time
+individually chosen by them.
+
+j. Sui Generis Database Rights means rights other than copyright resulting
+from Directive 96/9/EC of the European Parliament and of the Council of 11
+March 1996 on the legal protection of databases, as amended and/or succeeded,
+as well as other essentially equivalent rights anywhere in the world.
+
+k. You means the individual or entity exercising the Licensed Rights under
+this Public License. Your has a corresponding meaning.
+
+Section 2 â€“ Scope.
+
+   a. License grant.
+
+1. Subject to the terms and conditions of this Public License, the Licensor
+hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive,
+irrevocable license to exercise the Licensed Rights in the Licensed Material
+to:
+
+         A. reproduce and Share the Licensed Material, in whole or in part; and
+
+         B. produce, reproduce, and Share Adapted Material.
+
+2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions
+and Limitations apply to Your use, this Public License does not apply, and
+You do not need to comply with its terms and conditions.
+
+      3. Term. The term of this Public License is specified in Section 6(a).
+
+4. Media and formats; technical modifications allowed. The Licensor authorizes
+You to exercise the Licensed Rights in all media and formats whether now known
+or hereafter created, and to make technical modifications necessary to do
+so. The Licensor waives and/or agrees not to assert any right or authority
+to forbid You from making technical modifications necessary to exercise the
+Licensed Rights, including technical modifications necessary to circumvent
+Effective Technological Measures. For purposes of this Public License, simply
+making modifications authorized by this Section 2(a)(4) never produces Adapted
+Material.
+
+      5. Downstream recipients.
+
+A. Offer from the Licensor â€“ Licensed Material. Every recipient of the Licensed
+Material automatically receives an offer from the Licensor to exercise the
+Licensed Rights under the terms and conditions of this Public License.
+
+B. No downstream restrictions. You may not offer or impose any additional
+or different terms or conditions on, or apply any Effective Technological
+Measures to, the Licensed Material if doing so restricts exercise of the Licensed
+Rights by any recipient of the Licensed Material.
+
+6. No endorsement. Nothing in this Public License constitutes or may be construed
+as permission to assert or imply that You are, or that Your use of the Licensed
+Material is, connected with, or sponsored, endorsed, or granted official status
+by, the Licensor or others designated to receive attribution as provided in
+Section 3(a)(1)(A)(i).
+
+   b. Other rights.
+
+1. Moral rights, such as the right of integrity, are not licensed under this
+Public License, nor are publicity, privacy, and/or other similar personality
+rights; however, to the extent possible, the Licensor waives and/or agrees
+not to assert any such rights held by the Licensor to the limited extent necessary
+to allow You to exercise the Licensed Rights, but not otherwise.
+
+2. Patent and trademark rights are not licensed under this Public License.
+
+3. To the extent possible, the Licensor waives any right to collect royalties
+from You for the exercise of the Licensed Rights, whether directly or through
+a collecting society under any voluntary or waivable statutory or compulsory
+licensing scheme. In all other cases the Licensor expressly reserves any right
+to collect such royalties.
+
+Section 3 â€“ License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the following
+conditions.
+
+   a. Attribution.
+
+1. If You Share the Licensed Material (including in modified form), You must:
+
+A. retain the following if it is supplied by the Licensor with the Licensed
+Material:
+
+i. identification of the creator(s) of the Licensed Material and any others
+designated to receive attribution, in any reasonable manner requested by the
+Licensor (including by pseudonym if designated);
+
+            ii. a copyright notice;
+
+            iii. a notice that refers to this Public License;
+
+            iv. a notice that refers to the disclaimer of warranties;
+
+v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
+
+B. indicate if You modified the Licensed Material and retain an indication
+of any previous modifications; and
+
+C. indicate the Licensed Material is licensed under this Public License, and
+include the text of, or the URI or hyperlink to, this Public License.
+
+2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner
+based on the medium, means, and context in which You Share the Licensed Material.
+For example, it may be reasonable to satisfy the conditions by providing a
+URI or hyperlink to a resource that includes the required information.
+
+3. If requested by the Licensor, You must remove any of the information required
+by Section 3(a)(1)(A) to the extent reasonably practicable.
+
+4. If You Share Adapted Material You produce, the Adapter's License You apply
+must not prevent recipients of the Adapted Material from complying with this
+Public License.
+
+Section 4 â€“ Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that apply to
+Your use of the Licensed Material:
+
+a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract,
+reuse, reproduce, and Share all or a substantial portion of the contents of
+the database;
+
+b. if You include all or a substantial portion of the database contents in
+a database in which You have Sui Generis Database Rights, then the database
+in which You have Sui Generis Database Rights (but not its individual contents)
+is Adapted Material; and
+
+c. You must comply with the conditions in Section 3(a) if You Share all or
+a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not replace
+Your obligations under this Public License where the Licensed Rights include
+other Copyright and Similar Rights.
+
+Section 5 â€“ Disclaimer of Warranties and Limitation of Liability.
+
+a. Unless otherwise separately undertaken by the Licensor, to the extent possible,
+the Licensor offers the Licensed Material as-is and as-available, and makes
+no representations or warranties of any kind concerning the Licensed Material,
+whether express, implied, statutory, or other. This includes, without limitation,
+warranties of title, merchantability, fitness for a particular purpose, non-infringement,
+absence of latent or other defects, accuracy, or the presence or absence of
+errors, whether or not known or discoverable. Where disclaimers of warranties
+are not allowed in full or in part, this disclaimer may not apply to You.
+
+b. To the extent possible, in no event will the Licensor be liable to You
+on any legal theory (including, without limitation, negligence) or otherwise
+for any direct, special, indirect, incidental, consequential, punitive, exemplary,
+or other losses, costs, expenses, or damages arising out of this Public License
+or use of the Licensed Material, even if the Licensor has been advised of
+the possibility of such losses, costs, expenses, or damages. Where a limitation
+of liability is not allowed in full or in part, this limitation may not apply
+to You.
+
+c. The disclaimer of warranties and limitation of liability provided above
+shall be interpreted in a manner that, to the extent possible, most closely
+approximates an absolute disclaimer and waiver of all liability.
+
+Section 6 â€“ Term and Termination.
+
+a. This Public License applies for the term of the Copyright and Similar Rights
+licensed here. However, if You fail to comply with this Public License, then
+Your rights under this Public License terminate automatically.
+
+b. Where Your right to use the Licensed Material has terminated under Section
+6(a), it reinstates:
+
+1. automatically as of the date the violation is cured, provided it is cured
+within 30 days of Your discovery of the violation; or
+
+      2. upon express reinstatement by the Licensor.
+
+c. For the avoidance of doubt, this Section 6(b) does not affect any right
+the Licensor may have to seek remedies for Your violations of this Public
+License.
+
+d. For the avoidance of doubt, the Licensor may also offer the Licensed Material
+under separate terms or conditions or stop distributing the Licensed Material
+at any time; however, doing so will not terminate this Public License.
+
+   e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
+
+Section 7 â€“ Other Terms and Conditions.
+
+a. The Licensor shall not be bound by any additional or different terms or
+conditions communicated by You unless expressly agreed.
+
+b. Any arrangements, understandings, or agreements regarding the Licensed
+Material not stated herein are separate from and independent of the terms
+and conditions of this Public License.
+
+Section 8 â€“ Interpretation.
+
+a. For the avoidance of doubt, this Public License does not, and shall not
+be interpreted to, reduce, limit, restrict, or impose conditions on any use
+of the Licensed Material that could lawfully be made without permission under
+this Public License.
+
+b. To the extent possible, if any provision of this Public License is deemed
+unenforceable, it shall be automatically reformed to the minimum extent necessary
+to make it enforceable. If the provision cannot be reformed, it shall be severed
+from this Public License without affecting the enforceability of the remaining
+terms and conditions.
+
+c. No term or condition of this Public License will be waived and no failure
+to comply consented to unless expressly agreed to by the Licensor.
+
+d. Nothing in this Public License constitutes or may be interpreted as a limitation
+upon, or waiver of, any privileges and immunities that apply to the Licensor
+or You, including from the legal processes of any jurisdiction or authority.
+
+Creative Commons is not a party to its public licenses. Notwithstanding, Creative
+Commons may elect to apply one of its public licenses to material it publishes
+and in those instances will be considered the "Licensor." The text of the
+Creative Commons public licenses is dedicated to the public domain under the
+CC0 Public Domain Dedication. Except for the limited purpose of indicating
+that material is shared under a Creative Commons public license or as otherwise
+permitted by the Creative Commons policies published at creativecommons.org/policies,
+Creative Commons does not authorize the use of the trademark "Creative Commons"
+or any other trademark or logo of Creative Commons without its prior written
+consent including, without limitation, in connection with any unauthorized
+modifications to any of its public licenses or any other arrangements, understandings,
+or agreements concerning use of licensed material. For the avoidance of doubt,
+this paragraph does not form part of the public licenses.
+
+Creative Commons may be contacted at creativecommons.org.
diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt
new file mode 100644 (file)
index 0000000..204b93d
--- /dev/null
@@ -0,0 +1,19 @@
+MIT License Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/Unlicense.txt b/LICENSES/Unlicense.txt
new file mode 100644 (file)
index 0000000..24a8f90
--- /dev/null
@@ -0,0 +1,20 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute
+this software, either in source code form or as a compiled binary, for any
+purpose, commercial or non-commercial, and by any means.
+
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and
+to the detriment of our heirs and successors. We intend this dedication to
+be an overt act of relinquishment in perpetuity of all present and future
+rights to this software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
+THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information,
+please refer to <https://unlicense.org/>
diff --git a/README.rst.license b/README.rst.license
new file mode 100644 (file)
index 0000000..42cdc8a
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
diff --git a/docs/_static/favicon.ico.license b/docs/_static/favicon.ico.license
new file mode 100644 (file)
index 0000000..42cdc8a
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
diff --git a/docs/api.rst.license b/docs/api.rst.license
new file mode 100644 (file)
index 0000000..42cdc8a
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
index 2e54ac77e7a68d741ffe0e63440478c95ed30ffd..84be26539a0eed8f6239a75cdf4b9dd120f4ec41 100755 (executable)
@@ -1,5 +1,9 @@
 # -*- coding: utf-8 -*-
 
+# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
 import os
 import sys
 
diff --git a/docs/examples.rst.license b/docs/examples.rst.license
new file mode 100644 (file)
index 0000000..42cdc8a
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
diff --git a/docs/index.rst.license b/docs/index.rst.license
new file mode 100644 (file)
index 0000000..42cdc8a
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644 (file)
index 0000000..88e6733
--- /dev/null
@@ -0,0 +1,5 @@
+# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
+#
+# SPDX-License-Identifier: Unlicense
+
+sphinx>=4.0.0
index d72fbdcaa43f5b70fe5e84d9ff20676a7be13ce6..af936d1ad6318bab4060cabdae78ad16036bc027 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Analog in demo"""
 import time
 import board
index 9d8af71748f3b65b1d8966626693367995aa44b7..8cb7c64cb64282dd16f6ba8507b14f21d31c7dbb 100755 (executable)
@@ -1,6 +1,10 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
 # Example of blinking LED on BeagleBone Black
 # https://www.adafruit.com/product/1876
 #
index 4729e3ea92a8f9ecad5d296e91be339531d847ab..e4da0f16bb2992b7c1eb9d6ae8ccd8a5eecf7fe5 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import time
 import hid
 import busio
index 0eb3a2b1139a496482a0c4ad744dc5972ea02712..89ae34772ac07040a4cacc5b7ee39a4c93bd81cd 100755 (executable)
@@ -1,6 +1,10 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
 # Example of blinking LED on PocketBeagle
 # https://www.adafruit.com/product/4179
 #
index f3b4eeab62d31ce03248dd7fe7e8ac8a2beca1f8..e2b3ce26ef4c9c7bfb5d6721f79a9660605a225f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import time
 import sys
 import board
index 1f845b270630680df07a0e3e69e4babc29ec01c2..f8899e109ccab2c4eec07a723ea0d0463bb7ef2f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import time
 import board
 import busio
index 7c6a622eff527276ac3f519b5c5819c528be8d72..96f964c1f0dbbab2fa0abac5f8b3602f1a16b3fe 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import time
 import board
 import digitalio
index 471715eba04249eedefa55b81aa6f00b727132d0..6728b6d79331b0222bb97c70fc8038ed0cc2d710 100644 (file)
@@ -1,6 +1,9 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import sys
 import time
-import adafruit_blinka.agnostic as agnostic
+from adafruit_blinka import agnostic
 import board
 import digitalio
 
diff --git a/requirements.txt.license b/requirements.txt.license
new file mode 100644 (file)
index 0000000..42cdc8a
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
index a819f3203376f501fbc30be13c7a9d3b0193dc56..fc2a39b65ffdf51d75c25d8a69a02f1a7a34f4df 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,10 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
 # Note: To use the 'upload' functionality of this file, you must:
 #   $ pip install twine
 
index 4a384b3bf9af6862c40f1b768690d49c4c008413..49f0aeba884e00757f5ee549762dc4e4518e09ac 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Return the current version"""
 VERSION = (1, 0, 0)
 
index 69e917851be562cef45acbaa934d58b1518be6b5..5bdb2a5c8935bea18b7fa1620817101ba1ad68d9 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `adafruit_blinka` - Runtime utility objects for re-implementation of CircuitPython API
 ======================================================================================
index 1f6eb4c300537ea219a81014c254f32acddcf4fb..14121d3796e7e866cf6243ff1d6a679aa15ba24f 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Allows useful indirection to test Pin naming logic by switching platform in testing
     or provide bootstrapping logic for board identification where auto-detection is not
     feasible (e.g. multiple ESP8266 boards architecturally identical). Once runtime
index 46cb837d20ba53b6da87b7dd7ccd86e04cff7f4e..c0eca3c4756ad5b78cb9937660576eedbe0c2bc6 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Platform agnostic time implementation"""
 
 from adafruit_blinka import agnostic
index 8d40623f000c6fb3813d442e46d3250c8f0182a3..6bc6884bf789a8c9ce00e99eaa05f2586cc9e884 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from Banana Pi"""
index 10da54be48af4758227d9cc5880b0ea2b78227dd..bd720e22c9be377ce9fa890cf934241968bf0db7 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Banana Pi M2 Zero."""
 
 # The Banana Pi M2 Zero uses the AllWinner H2 SoC, but pins
index 139ec8d7f60486a9152f30fcd2a79dcd851f9424..b55eef28ffaebeff0fd64249bff70082e054456a 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from BeagleBoard"""
index d88111fc898143e77d939124d3a6d931c5236dbc..5c5d78d75a312a0802580ca765fdb4bc82cef6be 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Beaglebone Black."""
 from adafruit_blinka.microcontroller.dra74x import pin
 
index b3a301c7f6036bd93eadc38bd9e90e7ed085bce8..de58a1b991afd69b61d7fcf5569d622200d5c94f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Beaglebone Black."""
 from adafruit_blinka.microcontroller.am335x import pin
 
index 43c20f9cae6e6998c423bc53e3729aa79e79e1b0..a24fd6bc3ac7a7818d141827d02ff6f5d27ce3b6 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Pin definitions for the Beaglebone PocketBeagle.
 
index 0240464ef27cd8a4357eaa297da532f2af04cb5a..95bb9220efcfe1c8e4dde187165538b8ae868138 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the BeagleV StarLight."""
 
 from adafruit_blinka.microcontroller.starfive.JH71x0 import pin
index 1e01f61f056f44a8b857109f1bfeeacfa005a156..cffb616196feb185f03f93bffb66c2e6573eb3e5 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Binho Nova"""
 from adafruit_blinka.microcontroller.nova import pin
 
index 2e8a00b439cec84f6e8c4c6a7f2bc8c7f3c98160..a93ffeb8d5fe77cb7e3aafdc1f226c0be935316b 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Clockwork Pi (CPI3) board."""
 
 from adafruit_blinka.microcontroller.allwinner.a33 import pin
index fd860d2cd79fc6c8673aa4e5ad7a7f3b538806ab..04fcbde95ac8fab817a56129e3fb8c08470d3af5 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Coral Dev Board."""
 
 from adafruit_blinka.microcontroller.nxp_imx8m import pin
index b0b425cd623d84289e9b92019e13f198c36a81b6..79e7fa6197554b1c7fc16385a874c7645806b7d8 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Coral Dev Board Mini."""
 
 from adafruit_blinka.microcontroller.mt8167 import pin
index aa42ce05d28b3ac9b473d92c3c8ee56c66e85d8e..a627309d6c32ff8ab6a13dc5b5cc9a989804b538 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Dragonboard 410c."""
 
 from adafruit_blinka.microcontroller.snapdragon.apq8016 import pin
index 70cc1862354bef4456afeb9921cecec117567f18..32bbce119e4ba26b2658617bd76646a2802cd966 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Feather Huzzah."""
 
 from adafruit_blinka.microcontroller.esp8266 import pin
index 23fe99eae0723770443e1d595a55bf47fa9b63cc..d4e6581d09c733e065c324361de5af35d1adc9e3 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Pin definitions for the Feather RP2040 with u2if firmware.
 
index 684912708b2f4337db68e524aed5964e80c7b0fe..fcb5b1ce5e9b339099e6e0820a944b698befd4d9 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the FTDI FT2232H"""
 from adafruit_blinka.microcontroller.ftdi_mpsse.ft2232h import pin
 
index 1d6a8672408c585cc744bc48a18326f6ae51ced3..11bbce5f8629890a7409adaade8dc6fb71730d1a 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the FTDI FT232H"""
 from adafruit_blinka.microcontroller.ftdi_mpsse.ft232h import pin
 
index 82fc925646b7fafd7f4c213744df7a5424a66cf4..dfbe1c216ea5ae18ba452186e0589e29dcdabed2 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Giant Board"""
 from adafruit_blinka.microcontroller.sama5 import pin
 
index 87a5173c53c8f817c22797ad7bbbf2f80d2b70b6..0279c30eee7d05796fdec275bcc67033dc969f70 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the GreatFET One"""
 from adafruit_blinka.microcontroller.nxp_lpc4330 import pin
 
index 4828ef7c1de939fd4014d402440ed0d1210a6355..a41303191000e0fae31bd0e8521c9a9f6f905027 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from HardKernel"""
index 75596edee3dcfdb43550bc1a3e12784c360707ad..006454532a5aeb42b30aa9fa35e9dc05150d1062 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Odroid C2."""
 
 from adafruit_blinka.microcontroller.amlogic.s905 import pin
index 27ccae8afc443cfd9cb3dec32cb3d5ba627d59af..2191013eb24a4a0d3c2718b069bb8fb7734dacf2 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Odroid C4."""
 
 from adafruit_blinka.microcontroller.amlogic.s905x3 import pin
index a5339589b39d8e87935c9c45115fc9d620e4fda3..4abce5b46aeb83716cde3703d490b1723835798a 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Odroid N2."""
 
 from adafruit_blinka.microcontroller.amlogic.s922x import pin
index b052f7ebefd38bc9f1b4ab7630c53eac9d539c90..b53d1d82124e5b413b52588c754cc92295b9434e 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Odroid XU4."""
 
 from adafruit_blinka.microcontroller.samsung.exynos5422 import pin
index 4a04046b79ffc27d56e2bdb76759bfa9acef8b02..50fc12e5a4d061731a0d8c9228096e56377016a7 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Hifive Unleashed."""
 
 from adafruit_blinka.microcontroller.hfu540 import pin
index c13d24cd60f401de6084ccb558aa101748e66ec3..f0490788f9e29587552d25a705fbff62a50189c1 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Pin definitions for the ItsyBitsy RP2040 with u2if firmware.
 
index d56e3eab407a87e162a7dbae61db8c156ddd6a81..7c66a935fba5b9033f74f05fbacd97522ba08b92 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from LubanCat"""
index 26a32219312603a5137b76ad50f2b2ac7a3faf8a..d1cb16abfc77dce7091b6a502c7ec7e6c1a4f43f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the LubanCat IMX6ULL."""
 
 from adafruit_blinka.microcontroller.nxp_imx6ull import pin
index 33dfdcd662a60fcd1bab491789dba7c53ca4e8cf..1439b849445832bbb4293c756cda59c15eff74cf 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the LubanCat STM32MP157."""
 
 from adafruit_blinka.microcontroller.stm32.stm32mp157 import pin
index 64b671b62e1066782d20732019cab38e07f4c0e9..314daf9c472f0350e5f9eabfe038d791d7655a19 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Pin definitions for the MacroPad RP2040 with u2if firmware.
 
index b9580b665957924db697b6fcb3cc2ad5d232080a..bbfcc508764d11df92bd7f5309986b6b1dc52bb5 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the MicroChip MCP2221"""
 from adafruit_blinka.microcontroller.mcp2221 import pin
 
index 64e3b6c5d70351aca09b6b2a055a2787c54af9be..5fe7ee9813c586ed713b23ba28a002bdcb92e651 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Board definitions from NanoPi"""
index 368c9395e1f439f6f9f5570a5d9d1b3d26fd7935..6e4dae5d670b6cdfd3842dd25623460b98c90798 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the NanoPi Duo2."""
 # Enable I2C0, UART1, and SPI by adding the following lines to /boot/armbianEnv.txt
 #    overlays=usbhost2 usbhost3 spi-spidev uart1 i2c0
index 68b5cbedd0aa83ea13c6636cf0158c76afccf077..35100d04d9db8293534c3e061eaac0749c254e63 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the NanoPi NEO Air."""
 # Enable I2C0, UART1, and SPI by adding the following lines to /boot/armbianEnv.txt
 #    overlays=usbhost2 usbhost3 spi-spidev uart1 i2c0
index 68b5cbedd0aa83ea13c6636cf0158c76afccf077..35100d04d9db8293534c3e061eaac0749c254e63 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the NanoPi NEO Air."""
 # Enable I2C0, UART1, and SPI by adding the following lines to /boot/armbianEnv.txt
 #    overlays=usbhost2 usbhost3 spi-spidev uart1 i2c0
index 256e836b45617b90049d31447abfa2fb91cff01a..a6fceca80ac503a55e9017c2307b49f381323098 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """NodeMCU pin names"""
 
 from adafruit_blinka.microcontroller.esp8266 import pin
index 69cb70e7446f054afb5290d748cb95ac2d94f7ee..7e58d0d9b0b6ce905b8fc508e3574324903ac524 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from NVIDIA"""
index d65e95a48e3a043ee631d43f4efd6ca7194a4487..420247eb69746b9641e137237494a9122996c7b3 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Clara AGX Xavier."""
 
 from adafruit_blinka.microcontroller.tegra.t194 import pin
index 8b9b77cbb73854361cef5d816a432f423f51fb2a..d4e03ac236d3ba73137a2788f96740310f17869f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Jetson Nano."""
 
 from adafruit_blinka.microcontroller.tegra.t210 import pin
index fad7c41b1bb2c193c3d099cc133493f2f2ba279d..0323f6b57ffcfa3fa0001a2fa95fa18e63df82ee 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Jetson NX."""
 
 from adafruit_blinka.microcontroller.tegra.t194 import pin
index cfa70dccd74c45caf4594c5e331e9247374eb90d..77efaecdf2fab25bf16bef1c8fe2eab78d7bb70e 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Jetson TX1."""
 
 from adafruit_blinka.microcontroller.tegra.t210 import pin
index d0431765c2b3eee8c0b002cb17d2862b73ace956..9597610d2c428d7f05992e0910900e387e5ec07a 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Jetson TX2."""
 
 from adafruit_blinka.microcontroller.tegra.t186 import pin
index ff5c1545ba06632cd64d76876300156e55cdedf7..0f1698ce481ac775d2e98e2b0aea2aff7947c376 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Jetson TX2 NX."""
 
 from adafruit_blinka.microcontroller.tegra.t186 import pin
index 29105822955bd1833b99b5e8b7972cfe111f022f..d55bb82b6c4f2176ec37b52208dd28c071f8ea32 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Jetson XAVIER."""
 
 from adafruit_blinka.microcontroller.tegra.t194 import pin
index ab79770cef2ab85d128fe4701e76915e30d600af..19abbb32535d5231bc7182422fcca2ba34005111 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from Onion"""
index 6754d35901fd321fadc27cab71e732a2118029a5..3574eb52c86c7645a230b65bfd0fd7f676d4427c 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Onion Omega2+ Expansion Dock."""
 
 from adafruit_blinka.microcontroller.mips24kec import pin
index 640a5b3f0062e94b3c54c6404590fd3a712c965b..0333f98d78f3a61e686e7babe268eadcd0bafb02 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from Xunlong Orange Pi"""
index ad609656a29fe2b77d7c05b349c3910a22b8fd54..ea3acd76beb8139cfe40310786b6883bc173784f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Orange Pi 3."""
 
 from adafruit_blinka.microcontroller.allwinner.h6 import pin
index e7c4fdacd0dd8ce47f8b9a1cb25d5e210452f865..58830a0eb418768192ade66d024934ac371ac432 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Orange Pi PC."""
 
 from adafruit_blinka.microcontroller.allwinner.h3 import pin
index 0752c514de24e3aceb6facec982f35cc31f5652a..27b3ce80b259893ef079b36216fbe46a9c1073b5 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Orange Pi R1."""
 
 from adafruit_blinka.microcontroller.allwinner.h3 import pin
index b0dadeeff77355812c68856c28be3fb01e7279f9..6e4155a16456bd8cdd9d6995f3da23d003eaee19 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Orange Pi Zero."""
 
 # The Orange Pi Zero uses the AllWinner H2 SoC, but pins
index 79f5d8ebfc1e8035f15ebb39eb0a1cac73e9daf6..662e2cee5634d21333ba9bb3024bd06122b3cf75 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Orange Pi Zero 2."""
 
 from adafruit_blinka.microcontroller.allwinner.h616 import pin
index 36ed7f33191ff512632186976212b900323f4594..d8fcd3b79c59ab4aa596b739340eb09f55ed10d5 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Orange Pi Zero Plus."""
 
 from adafruit_blinka.microcontroller.allwinner.h5 import pin
index c82b6926c8e33fd9273d423feed9f6bc3377c379..507b021708993ec5087bbf9cfe6adf92900821dc 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Orange Pi Zero Plus 2 H5."""
 
 from adafruit_blinka.microcontroller.allwinner.h5 import pin
index 6564ed38b5f00a45306b05ceb52cbc46afa52591..bf131b4fedf16085cccf3d000a6ad4001491c402 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Raspberry Pi Pico running u2if firmware"""
 from adafruit_blinka.microcontroller.rp2040_u2if import pin
 
index 5a66f9755262299fcafc869c9a56d035b29e0629..2ed3024e028ab2385d6e3dba5b93502ab7937c95 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Pine64."""
 
 from adafruit_blinka.microcontroller.allwinner.a64 import pin
index 9a5136245a707c5b51e26d3739cd7e7fb88c5901..54e287130b8a5a9a07069819d6f57bf2e10a8651 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the PineH64."""
 
 from adafruit_blinka.microcontroller.allwinner.h6 import pin
index 14ed95758a781156d041fb1bd06751384f04f84c..d6459537a1f749162be9676bed2e738da5ee08eb 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """PyBoard pin names"""
 
 from adafruit_blinka.microcontroller.stm32.stm32f405 import pin
index d71bea8c87dbfb33951885f88f3768f1060fcf6d..c80b67b0e364ea5cfe966a692ebbe9d8a734ce0a 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the QT2040 Trinkey with u2if firmware."""
 
 from adafruit_blinka.microcontroller.rp2040_u2if import pin
index 569ace2387df330558e3e77987e6aaae26ecfd2b..1958777d3aa40e2b719570ed33797bde2e810e10 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Pin definitions for the QT Py RP2040 with u2if firmware.
 
index b1b4b8c496e165e640657a1c21ab33282cf7ef49..a7b5c74fd0b403f54d1355c0d3d0b2f82a76d800 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Rock Pi Boards definition from Radxa"""
index e327ff3a176630b7a72868215ad99d69738951dc..9c046701d7c768a60b23abc6a2ef7615304d10c9 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Rock Pi 4."""
 
 from adafruit_blinka.microcontroller.rockchip.rk3399 import pin
index f5a5a747747ddfffd12666fa619bee713e76b5d2..3233d477c04bfbc1683eadf6993235e75dfd4e8c 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Rock Pi E."""
 
 from adafruit_blinka.microcontroller.rockchip.rk3328 import pin
index bf147d7b98108ad9cb55ac61bce081708d85c1de..c967d97bf64344831ae8a29519861e74cefd6932 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Rock Pi S."""
 
 from adafruit_blinka.microcontroller.rockchip.rk3308 import pin
index 0969dbf31b4798732b178c86d42aafabd29c7733..a39c1db1875db6d179cff02a270e319af5a145ad 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from Raspberry Pi"""
index e554ad1957aae5d33628dee3e8b9076c6d942530..9885d437d0b1d5114e75bf5975a27ee0b14fa006 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Raspberry Pi Pico pin names"""
 
 from adafruit_blinka.microcontroller.rp2040 import pin
index 59168dc6004b8dd0467a4c118717599e65d8c7ce..71b390f8e1c0d348bc77fe3f27e895714ac3d923 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Raspberry Pi Model B Revision 1."""
 
 from adafruit_blinka.microcontroller.bcm283x import pin
index 47fc39b32b3708c074166ecef1ba4b84b8f5cbce..51efd0f6affc656e4f0a032c6c8ccb44fbde14be 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Raspberry Pi Model B Revision 2."""
 
 from adafruit_blinka.microcontroller.bcm283x import pin
index 91347e04a9548be453d281070be0ee494029d5d2..954147689bcbfe30d269392f15ed21b1f14e2b14 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for 40-pin Raspberry Pi models."""
 
 from adafruit_blinka.microcontroller.bcm283x import pin
index 9fbb6caef92272dc67b22240030b0d090f31204a..ffd497925f1d8fc9ae826f2c5c2246c1f0501aac 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Raspberry Pi 4 models using the BCM2711."""
 
 from adafruit_blinka.microcontroller.bcm2711 import pin
index 338017875acf1b6b0540975a4d6bdc18cbff9bb0..dbe7ccf5cc6abeabc4b4972cc8db54c2bc7500aa 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Raspberry Pi Compute Modules."""
 
 from adafruit_blinka.microcontroller.bcm283x import pin
index 00ba5b62a00c2ab28e9e6e85a5cf4931b01c3537..fbd5e5922a76e8cadc8678b73a93c698aedcb390 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the SoPine."""
 
 from adafruit_blinka.microcontroller.allwinner.a64 import pin
index d0e9d459519c5f641fa83fd4a29ee5f3b837fbff..b1036dc8e4c5363f00b7a215cd0f55efbebadf62 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Boards definition from STM32"""
index 3fa9e468f21b9b06a6e6ed834d9e2aae13638984..6687f18233cb0805153f5740bbd33bd800293214 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Octavo OSD32MP1 BRK board."""
 
 # See: https://octavosystems.com/octavosystems.com/wp-content/uploads/2020/05/Default-Pin-Mapping.pdf  # pylint: disable=line-too-long
index 67395f97f820610c08ac12d7a9deaa7381a74967..6879c624606a7f98e7113cd7010e24c79f67c154 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Octavo OSD32MP1 RED board."""
 
 from adafruit_blinka.microcontroller.stm32.stm32mp157 import pin
index 2f8cde177b4471393035f9612efc8f52243b1644..dd4278708b7cdd7c7c8de0a72caf2f279abbcd15 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the STM32MP157C Development Kit 2."""
 
 from adafruit_blinka.microcontroller.stm32.stm32mp157 import pin
index 516528ab1c2669ac335ccf0e0d9527b3591f3857..ce25dc98b690c27b6ff4143be7da969911e3a022 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for the Tritium H3."""
 
 from adafruit_blinka.microcontroller.allwinner.h3 import pin
index 744d7744912b042aa480cc0d9e05cd8d310407d3..a4bf1ce644ae18c71e40c38d285e65f187e492ec 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pin definitions for Udoo x86 Ultra
 (should work for Ultra and Ultra II)
 
index a086f8478aa4c6f0caf4778223fc5ab46acf6b44..b95dd934871b52dae12af4f0fbc714a3fa6e8b1e 100644 (file)
@@ -1 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition of all Allwinner chips"""
index b9e6b1f799c9345c3f3b551d1e2ad09639f4f029..79724d0fac9b432fd09fe015f6ab8afc58985768 100644 (file)
@@ -1,2 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition for the AllWinner A33 chip"""
-from .pin import *
index fc88401e66b168a099e53d678d47bd4e1627ad10..87200af46a8d688ec6965058ce79d3dbaac1c2c6 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Allwinner A33 pin names"""
 
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
index 3075e97478f50ad5415e698b15de03ec924c319e..3ee166a9bccff1eb29748eafc622ac2aac2ced60 100644 (file)
@@ -1,2 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition for the AllWinner A64 chip"""
-from .pin import *
index e362728b2e640a95ac35d40a4c2d892db8fd4bf5..77428111b640d34853859bceb262f7ba4745a93f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Allwinner A64 pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index 49d6c8adfb9e8e475017cefd06e19e184dbf2c80..d50b214f9b5be2f95b8d85cef278a1242dbaac48 100644 (file)
@@ -1,2 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition for the AllWinner H3 chip"""
-from .pin import *
index 0bed0510fc85bb4de8f7d9703cf324fa3a66c12e..b81c743499c1a65d39bafb838067c88cd19d3535 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Allwinner H3 pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index bde3093da0d9b8a54e615793d9344b5ec3ce7a15..09cd4918bf01dd00d82f518293e0bb98070f61bb 100644 (file)
@@ -1,2 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition for the AllWinner H5 chip"""
-from .pin import *
index 5ab66e8cc79f16e9dfca8d2e58de0c011223c864..16b035db422ec486781edb3816ef86d05f371b1d 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Allwinner H5 pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index 7ae56992bbd67a122578590b41414f4e5f5d0e59..e6b43a7f2e2d29ea1fbd38076332660fd2082d58 100644 (file)
@@ -1,2 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition for the AllWinner H6 chip"""
-from .pin import *
index 63759382a3c0ce30cf6e477aff4f8543479c4a4c..5e183a226121117a6478a1f9e499654e6c8c7978 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Allwinner H6 Pin Names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index affd8df5187fce9b60f1a8935a6a782955ecb9cd..1064977991c1115cc349af360a444c6361992135 100644 (file)
@@ -1,2 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition for the AllWinner H616 chip"""
-from .pin import *
index 5c046d1a0184485283032f1cf8e80462feb80e64..3ee5a9c9e9bc42de05eb39c5121aaca0c1ffd2fa 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Allwinner H616 Pin Names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 1553ff23fabb80174072941325a8148e5ec38a08..0986849545edb59b823227b216043f340b6542e2 100644 (file)
@@ -1,5 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """AM335x pin names"""
-import Adafruit_BBIO.GPIO as GPIO
+from Adafruit_BBIO import GPIO
 
 
 class Pin:
index b99e1cc8000ef88293ecb81146fd8e3b49bc6bbf..776f9bb479e269ae713af2144ae7f9c52984479c 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Much code from https://github.com/vsergeev/python-periphery/blob/master/periphery/pwm.py
 Copyright (c) 2015-2016 vsergeev / Ivan (Vanya) A. Sergeev
@@ -101,7 +104,7 @@ class PWMOut:
         if not os.path.isdir(pin_path):
             try:
                 with open(
-                    os.path.join(channel_path, self._export_path), "w"
+                    os.path.join(channel_path, self._export_path), "w", encoding="utf-8"
                 ) as f_export:
                     f_export.write("%d\n" % self._pwmpin)
             except IOError as e:
@@ -131,7 +134,9 @@ class PWMOut:
                 try:
                     # unexport_path = os.path.join(channel_path, self._unexport_path)
                     with open(
-                        os.path.join(channel_path, self._unexport_path), "w"
+                        os.path.join(channel_path, self._unexport_path),
+                        "w",
+                        encoding="utf-8",
                     ) as f_unexport:
                         f_unexport.write("%d\n" % self._pwmpin)
                 except IOError as e:
@@ -170,7 +175,7 @@ class PWMOut:
             attr,
         )
 
-        with open(path, "w") as f_attr:
+        with open(path, "w", encoding="utf-8") as f_attr:
             f_attr.write(value + "\n")
 
     def _read_pin_attr(self, attr):
@@ -184,7 +189,7 @@ class PWMOut:
             attr,
         )
 
-        with open(path, "r") as f_attr:
+        with open(path, "r", encoding="utf-8") as f_attr:
             return f_attr.read().strip()
 
     # Mutable properties
index 82fa6ea267b07072b1c629589cdea8b71c8a8ed0..d920b1f96ea4602495192a75b62b53e255105f12 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 G12A, G12B, and SM1 Common Definitions
 Ref:
@@ -110,7 +113,7 @@ uartPorts = ((1, UART1_TX, UART1_RX),)
 def get_dts_alias(device: str) -> str:
     """Get the Device Tree Alias"""
     uevent_path = "/sys/bus/platform/devices/" + device + "/uevent"
-    with open(uevent_path, "r") as fd:
+    with open(uevent_path, "r", encoding="utf-8") as fd:
         pattern = r"^OF_ALIAS_0=(.*)$"
         uevent = fd.read().split("\n")
         for line in uevent:
index 346a8086e031bab5885b09bc9e183479835c85d0..f82435d81a434d85d36254bc12385b7742a2ab82 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """AmLogic s905 pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index 378fa60e9ce1cd0fbc51113706daba7125c8fc17..861c72bd752198e708b9a89ebcafc1927de0b0aa 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """AmLogic s905x3 pin names"""
 # pylint: disable=wildcard-import,unused-wildcard-import
 from adafruit_blinka.microcontroller.amlogic.meson_g12_common.pin import *
index b9198aea650ee153ea17aca9d119b7e66f1ccfa4..5e2ac181064551278a1c6f7664b4b82f63459899 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """AmLogic s922x pin names"""
 # pylint: disable=wildcard-import,unused-wildcard-import
 from adafruit_blinka.microcontroller.amlogic.meson_g12_common.pin import *
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 9b563ff47aa4b155931a66214836db4e0e1416d6..1373c92d7f7f90a03825dd3ddf7ca41e933ba202 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Atheros AR9331 pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index f56d58539685e9dab4c1680b25616b6188a9eba9..91b40305b1432d4cb3a35baf2531ab33ce5f1cb8 100644 (file)
@@ -1,5 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Broadcom BCM2711 pin names"""
-import RPi.GPIO as GPIO
+from RPi import GPIO
 from adafruit_blinka.microcontroller.bcm283x.pin import Pin
 
 GPIO.setmode(GPIO.BCM)  # Use BCM pins D4 = GPIO #4
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 6c0726f8392910650a0f1103e6dc07fc5bf602c6..c743220d5a07affd28045dfb4baadbccb34ebf46 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """BCM283x NeoPixel Driver Class"""
 import time
 import atexit
index 5022366a7d4dd1b299b5b17301d5b73beb0d2178..a24ed220dfc72e6cf21fac3752407b5f1e3b5767 100644 (file)
@@ -1,5 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Broadcom BCM283x pin names"""
-import RPi.GPIO as GPIO
+from RPi import GPIO
 
 GPIO.setmode(GPIO.BCM)  # Use BCM pins D4 = GPIO #4
 GPIO.setwarnings(False)  # shh!
index 700d8de2e3659f81640ad501d3e3d4b319c0e65e..caf0d62b147d6468a8b98fa829d064936767ca3d 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Custom PulseIn Class to read PWM signals"""
 import time
 import subprocess
@@ -51,7 +54,7 @@ class PulseIn:
             ) from sysv_ipc.ExistentialError
 
         # Check if OS is 64-bit
-        if struct.calcsize("P") * 8 == 64:
+        if struct.calcsize("P") * 8 == 64:  # pylint: disable=no-member
             libgpiod_filename = "libgpiod_pulsein64"
         else:
             libgpiod_filename = "libgpiod_pulsein"
@@ -71,7 +74,7 @@ class PulseIn:
         if DEBUG:
             print(cmd)
 
-        self._process = subprocess.Popen(cmd)
+        self._process = subprocess.Popen(cmd)  # pylint: disable=consider-using-with
         procs.append(self._process)
 
         # wait for it to start up
diff --git a/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein.license b/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein.license
new file mode 100644 (file)
index 0000000..42cdc8a
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
diff --git a/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64.license b/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64.license
new file mode 100644 (file)
index 0000000..42cdc8a
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
index 65f269f5b0463755e937e031e4771d4e8f50e9d0..3b7b57f1c2b558c92edf605b348276c56d2bb505 100644 (file)
@@ -1,5 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Custom PWMOut Wrapper for Rpi.GPIO PWM Class"""
-import RPi.GPIO as GPIO
+from RPi import GPIO
 
 GPIO.setmode(GPIO.BCM)  # Use BCM pins D4 = GPIO #4
 GPIO.setwarnings(False)  # shh!
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 28738c1331ab94416e2850512c993ad7f339adc8..3894bb6b29f4250e39092cbc020673a76415a2e7 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """DRA74x pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index 5ba98840d611aded29a7fe8a4d7e973e45c2841b..dbc14c153c21d9b7b11260bd79dd09abbba9ce3d 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """ESP8266 pin names"""
 
 from microcontroller import Pin
index 4fa84401a41f376f126ea6628000ad95ae91aac1..d81caff40d3f505e148ab4e03901a31e18dbab04 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """FT2232H pin names"""
 
 from adafruit_blinka.microcontroller.ftdi_mpsse.mpsse.pin import Pin
index 178979e4b84fa4689b0dcee975bc14e49e37848e..2cc033708ad4412e730bbd821722c5aafbe17abf 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """FT232H pin names"""
 
 from adafruit_blinka.microcontroller.ftdi_mpsse.mpsse.pin import Pin
index f9539fb4a213c65623df731f3d02e89c8ec92c7d..b98c59ba649d9fcc829fde27bc37e95238087235 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """I2C Class for FTDI MPSSE"""
 from adafruit_blinka.microcontroller.ftdi_mpsse.mpsse.pin import Pin
 from adafruit_blinka.microcontroller.ftdi_mpsse.mpsse.url import (
index 1460bd5de59233b51148c56476de1f79d4040557..cf9316195cdffc6da0ca10f159c9f3b1fb776441 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """MPSSE pin names"""
 
 from adafruit_blinka.microcontroller.ftdi_mpsse.mpsse.url import (
index 0b76c081ebb8d3ce4c99f05a8eed0a10a2e91402..66bb8fd2e8bad86324bc7e715dd38f2c1446b0bd 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """SPI Class for FTDI MPSSE"""
 from adafruit_blinka.microcontroller.ftdi_mpsse.mpsse.pin import Pin
 from adafruit_blinka.microcontroller.ftdi_mpsse.mpsse.url import (
index a3923ca0feff9cd9b88be40052142eb35c62ae5a..e264b947f57ff425effe1cc82cd7d02cca34b5fe 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Support for getting the URL from the BLINKA_FT232H
 and BLINKA_FT2232H_{} environment variables.
index bb912a5b80210b72dc626663ff124dc24832d74b..f6bee20c8f878ab18fbbb08fb620594556dc2cd5 100644 (file)
@@ -1,5 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Generic Linux I2C class using PureIO's smbus class"""
-import Adafruit_PureIO.smbus as smbus
+from Adafruit_PureIO import smbus
 
 
 class I2C:
index db9007a6d55d479b4322ed2a67ba2b10804f43a7..4ed613593c2df29fbe4b0b7dd4349e54bd518dda 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """A Pin class for use with libgpiod."""
 try:
     import gpiod
index 0986d0135b11d3407321e24e539df89d44ae5644..2a5464dd3501357936d40b3328f8cd33c82ebe44 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """A Pin class for use with periphery."""
 try:
     from periphery import GPIO
index 454909210377ae7cdb8dd215f9dfa3518958a726..50ad8c154067fd669b972f40bf69ec473ef330cf 100755 (executable)
@@ -1,5 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Generic Linux SPI class using PureIO's SPI class"""
-import Adafruit_PureIO.spi as spi
+from Adafruit_PureIO import spi
 from adafruit_blinka.agnostic import detector
 
 
index e8a7376c615786a0ea759229a7886d01e947ec45..1b725b9aff739376d43f15ce566fee89ec25a1f2 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `analogio` - Analog input control
 =================================================
@@ -79,7 +82,7 @@ class AnalogIn(ContextManaged):
             self._channel_path.format(self._channel),
         )
 
-        with open(path, "r") as analog_in:
+        with open(path, "r", encoding="utf-8") as analog_in:
             return int(analog_in.read().strip())
 
     # pylint: disable=no-self-use
index 56263d39555a384178cef873328139438747af36..0b2d857ef5ea95cb23b03f9b6f7cb57959df06ed 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `analogio` - Analog output control
 =================================================
@@ -85,7 +88,7 @@ class AnalogOut(ContextManaged):
             self._channel_path.format(self._channel),
         )
 
-        with open(path, "w") as analog_out:
+        with open(path, "w", encoding="utf-8") as analog_out:
             return analog_out.write(value + "\n")
 
     def deinit(self):
index 50c27a7b6ca0a3d13bad10b0c413c89cbbc54ba1..8ce1a65c64cec926c3672a19c2ba933573f50a24 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Much code from https://github.com/vsergeev/python-periphery/blob/master/periphery/gpio.py
 Copyright (c) 2015-2019 vsergeev / Ivan (Vanya) A. Sergeev
@@ -132,7 +135,7 @@ class Pin:
         if not os.path.isdir(gpio_path):
             # Export the line
             try:
-                with open("/sys/class/gpio/export", "w") as f_export:
+                with open("/sys/class/gpio/export", "w", encoding="utf-8") as f_export:
                     f_export.write("{:d}\n".format(self.id))
             except IOError as e:
                 raise GPIOError(e.errno, "Exporting GPIO: " + e.strerror) from IOError
@@ -155,7 +158,9 @@ class Pin:
             # permission rule application after export
             for i in range(self.GPIO_OPEN_RETRIES):
                 try:
-                    with open(os.path.join(gpio_path, "direction"), "w") as f_direction:
+                    with open(
+                        os.path.join(gpio_path, "direction"), "w", encoding="utf-8"
+                    ) as f_direction:
                         f_direction.write(direction.lower() + "\n")
                     break
                 except IOError as e:
@@ -170,7 +175,9 @@ class Pin:
         else:
             # Write direction
             try:
-                with open(os.path.join(gpio_path, "direction"), "w") as f_direction:
+                with open(
+                    os.path.join(gpio_path, "direction"), "w", encoding="utf-8"
+                ) as f_direction:
                     f_direction.write(direction.lower() + "\n")
             except IOError as e:
                 raise GPIOError(
@@ -268,7 +275,7 @@ class Pin:
         gpio_path = "/sys/class/gpio/{:s}/label".format(self.chip_name)
 
         try:
-            with open(gpio_path, "r") as f_label:
+            with open(gpio_path, "r", encoding="utf-8") as f_label:
                 label = f_label.read()
         except (GPIOError, IOError) as e:
             if isinstance(e, IOError):
@@ -287,7 +294,9 @@ class Pin:
     def _get_direction(self):
         # Read direction
         try:
-            with open(os.path.join(self._path, "direction"), "r") as f_direction:
+            with open(
+                os.path.join(self._path, "direction"), "r", encoding="utf-8"
+            ) as f_direction:
                 direction = f_direction.read()
         except IOError as e:
             raise GPIOError(
@@ -304,7 +313,9 @@ class Pin:
 
         # Write direction
         try:
-            with open(os.path.join(self._path, "direction"), "w") as f_direction:
+            with open(
+                os.path.join(self._path, "direction"), "w", encoding="utf-8"
+            ) as f_direction:
                 f_direction.write(direction.lower() + "\n")
         except IOError as e:
             raise GPIOError(
index f751b71a4a017dc3870da1e1445820b6c521e1ce..4aca0a2785911a376aad30958b85e96f09458789 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Much code from https://github.com/vsergeev/python-periphery/blob/master/periphery/pwm.py
 Copyright (c) 2015-2016 vsergeev / Ivan (Vanya) A. Sergeev
@@ -105,13 +108,15 @@ class PWMOut:
 
         try:
             with open(
-                os.path.join(channel_path, self._unexport_path), "w"
+                os.path.join(channel_path, self._unexport_path), "w", encoding="utf-8"
             ) as f_unexport:
                 f_unexport.write("%d\n" % self._pwmpin)
-        except IOError as e:
+        except IOError:
             pass  # not unusual, it doesnt already exist
         try:
-            with open(os.path.join(channel_path, self._export_path), "w") as f_export:
+            with open(
+                os.path.join(channel_path, self._export_path), "w", encoding="utf-8"
+            ) as f_export:
                 f_export.write("%d\n" % self._pwmpin)
         except IOError as e:
             raise PWMError(e.errno, "Exporting PWM pin: " + e.strerror) from IOError
@@ -126,6 +131,7 @@ class PWMOut:
                         channel_path, self._pin_path.format(self._pwmpin), "period"
                     ),
                     "w",
+                    encoding="utf-8",
                 ):
                     break
             except IOError as e:
@@ -158,7 +164,9 @@ class PWMOut:
                     self._sysfs_path, self._channel_path.format(self._channel)
                 )
                 with open(
-                    os.path.join(channel_path, self._unexport_path), "w"
+                    os.path.join(channel_path, self._unexport_path),
+                    "w",
+                    encoding="utf-8",
                 ) as f_unexport:
                     f_unexport.write("%d\n" % self._pwmpin)
             except IOError as e:
@@ -187,7 +195,7 @@ class PWMOut:
             attr,
         )
 
-        with open(path, "w") as f_attr:
+        with open(path, "w", encoding="utf-8") as f_attr:
             # print(value, path)
             f_attr.write(value + "\n")
 
@@ -202,7 +210,7 @@ class PWMOut:
             attr,
         )
 
-        with open(path, "r") as f_attr:
+        with open(path, "r", encoding="utf-8") as f_attr:
             return f_attr.read().strip()
 
     # Mutable properties
index 20e5f9ea7b5097179a08f03186f8dd0299d8a585..20362337324eb4a5ed3961d79e901725adb782bf 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """I2C Class for Generic MicroPython"""
 from machine import I2C as _I2C
 
index 7842a192ab0a752e229f79853c8ba2d535365cdf..b89795151c53398dac78330a93edc3f0ac3b6f7a 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """SPI Class for Generic MicroPython"""
 from machine import SPI as _SPI
 
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 954b44ba574d17089dc8e425c283b4a12d6efdf6..63c85bd45d35f93c62c8e20659335c19a01f5e50 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Hifive Unleashed pin names"""
 
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 3025202f6c5251f3cb9e475e12f99ca9fcdb1ef2..03e7b661adb429b7534fc03ee364a87a4003755e 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `analogio` - Analog input and output control
 =================================================
index e320ac1f448a52e708914841979d0fd286d028b6..d8e40c225e8f3395bc39006756ea6ae6199dc880 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """I2C Class for MCP2221"""
 from .mcp2221 import mcp2221
 
index fb9edf3e9e788fbc8f139a8fd8ef421433b36a9a..7b62c3f5c4931a4c9e0eb47bd0714fa966f0f16f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Chip Definition for MCP2221"""
 
 import os
index f5e73bb60534eca7478c2e480ed4280097875763..bf4ba9705065829aa4794578145f20524bb2631f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """MCP2221 pin names"""
 from .mcp2221 import mcp2221
 
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 8181a0fd239d93e786adf39628a76b225a93b315..246aa0df2cd0d40a4b8bfffbe1cca0d410d725ca 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """MIPS 24kec pin names"""
 from adafruit_blinka.microcontroller.generic_linux.periphery_pin import Pin
 
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index ff5e0e579cfbc29ea33fd1b2ec079f9ba27d7ecb..91e1ba6bbf3c957c92a291c740c57624a164e04a 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """MediaTek MT8167 pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index 7ddbf639208f514edb80107aa6a3c9ecd968743f..484637075e1dd742ec1b5bad86967c52eb7bdbde 100644 (file)
@@ -1,5 +1,7 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Generic Connection class for Binho Nova to keep track of connection"""
-from .pin import *
 
 
 class Connection:
index e87c9429ab62cd184d024da8569b0be22fbbde3d..4bbde4aea8f41e1f35fcbe6bb7c498014e1b6bed 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """I2C Class for Binho Nova"""
 
 from adafruit_blinka.microcontroller.nova import Connection
index 590ebc6277b23b7c5accb0eb1ee39f925714b8cf..1fb4c9abe3fb5eb40e0a57e2cd7c764119bd6e02 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Binho Nova pin names"""
 
 
index 2ff0c2594e909c7af5c0e27b21ee90e3e0baf5ed..5c9083d9843c18588a5f7f1191ecdf28c7258a4e 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """PWMOut Class for Binho Nova"""
 
 try:
index e03853dfc217af8061f1efadddfa7b1b2faa1f85..7f46def09c4691aae5c3361e3164de2eb6dd9ace 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """SPI Class for Binho Nova"""
 from adafruit_blinka.microcontroller.nova import Connection
 
index 5d698f8eabc4b06a7a933abe9f8781422b351627..ff4dc6022fc52ded2e8af44d1966c036f4af1d6d 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """UART Class for Binho Nova"""
 
 from adafruit_blinka.microcontroller.nova import Connection
index 7ffa33163b2afbd535c3ac3e6fa3b117437f7d27..020d9afcf26661d7da05eb01fe65948cd0575d79 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """NXP IMX6ULL pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 0d364e471dee0f9fe746a70be24b8f55f954534a..0202042b526f31dfb55aa115812e39628c3401e9 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """NXP IMX8M pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index e45e8d2b9e2dd5cdb18b4d7547c9a8c1e1cd36c0..e9ef6e45dba590dc61ad1bbc6cd337604c1e8a59 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `analogio` - Analog input and output control
 =================================================
index 4c6311145c0e6a0bfbc263cb36b8c5b2efc1ecdc..53e18e8972883db67dc5821cc5d45256784550f7 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """I2C Class for NXP LPC4330"""
 from greatfet import GreatFET
 
index 24d542dd5770a3a8d11b67f106fbd8f9822b35f3..187a4d35aaa1d90ac7bc0a5d454409ba3fcd5c15 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """NXP LPC4330 pin names"""
 try:
     from greatfet import GreatFET
index 91c3ede1b12e8902d2c3cc2a8ac3523d1d6b278c..cab12589c92d420f26e35b7fb76da51016886840 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """PWMOut Class for NXP LPC4330"""
 
 from greatfet import GreatFET
index 28b4fd2a921a445af5789e7312e19d404f94614e..29f4734c7e7083c70a73a7ad5d14349476e8a133 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """SPI Class for NXP LPC4330"""
 from greatfet import GreatFET
 
@@ -69,8 +72,7 @@ class SPI:
         to the found value
         """
         closest_preset = None
-        for frequency in self._presets:
-            preset = self._presets[frequency]
+        for frequency, preset in self._presets.items():
             if self._frequency is None or abs(frequency - target_frequency) < abs(
                 self._frequency - target_frequency
             ):
index 3f077001ce8433a65f84b3a4e1afed563939e046..f2c1c558210f946c43e23274178d1f69cdcf932e 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """UART Class for NXP LPC4330"""
 from greatfet import GreatFET
 from greatfet.interfaces.uart import UART as _UART
diff --git a/src/adafruit_blinka/microcontroller/pentium/n3710/.gitignore b/src/adafruit_blinka/microcontroller/pentium/n3710/.gitignore
deleted file mode 100644 (file)
index 0e7f550..0000000
+++ /dev/null
@@ -1 +0,0 @@
-pins
index 3093a2021c790c211609498e64d1ecdb01699ff3..632e75af229015b75398a7ad4ac9f424d111ae3f 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pentium N3710 (Braswell core SOC) pin names
    i2c and GPIO can be accessed through Blinka.
    For i2c use IC20_SCL, IC20-SDA and IC21-SCL, IC21-SDA in the i2c(<sdl, sda>) calls.
index 09c4a8e2bb3ed62c7a607de28b51f8e8bdad1114..56dd2809e1bcb3ea11e9071439de830305287ffb 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 Much code from https://github.com/vsergeev/python-periphery/blob/master/periphery/pwm.py
 Copyright (c) 2015-2016 vsergeev / Ivan (Vanya) A. Sergeev
@@ -91,7 +94,9 @@ class PWMOut:
         if not os.path.isdir(self._channel_path):
             # Exporting the PWM.
             try:
-                with open(os.path.join(self._chip_path, "export"), "w") as f_export:
+                with open(
+                    os.path.join(self._chip_path, "export"), "w", encoding="utf-8"
+                ) as f_export:
                     f_export.write("{:d}\n".format(self._channel))
             except IOError as e:
                 raise PWMError(
@@ -122,6 +127,7 @@ class PWMOut:
                     with open(
                         os.path.join(self._channel_path, "period"),
                         "w",
+                        encoding="utf-8",
                     ):
                         break
                 except IOError as e:
@@ -157,11 +163,15 @@ class PWMOut:
         self._channel = None
 
     def _write_channel_attr(self, attr, value):
-        with open(os.path.join(self._channel_path, attr), "w") as f_attr:
+        with open(
+            os.path.join(self._channel_path, attr), "w", encoding="utf-8"
+        ) as f_attr:
             f_attr.write(value + "\n")
 
     def _read_channel_attr(self, attr):
-        with open(os.path.join(self._channel_path, attr), "r") as f_attr:
+        with open(
+            os.path.join(self._channel_path, attr), "r", encoding="utf-8"
+        ) as f_attr:
             return f_attr.read().strip()
 
     # Methods
index 818c9dd6c0dea99ac965c8135dfdcfeba4a3ff5a..24b0c40dd37ddf13f643ba7e125ed46d31701152 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """A Pin class for use with Rockchip RK3308."""
 
 from adafruit_blinka.microcontroller.generic_linux.sysfs_pin import Pin
index 9cf13e869e7738f3dc468d0bc9739d508a26e604..83bd2dbaefba5a267dd16c9292a599bf97ab6de6 100644 (file)
@@ -1,2 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition for the Rockchip RK3328 chip"""
-from .pin import *
index b9cc3d7c4991bcfb2f54ef860cea2085f1d6b652..e41ac2fa01a232fdde71b18d25626e479ad6fa68 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """A Pin class for use with Rockchip RK3328."""
 
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
index 44198610675b09a20bfef1922266c76407e3ac0f..9d6de08755a582fa7fa5b18b96f9f21305110a5a 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """A Pin class for use with Rockchip RK3399."""
 
 from adafruit_blinka.microcontroller.generic_linux.sysfs_pin import Pin
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 4635b3fb8d8d955d646febadde34dcd31d294837..8daf2490a9c53c934bfa6d2d37cc1f2fc90efd3b 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """I2C Class for RP2040"""
 from machine import I2C as _I2C
 from machine import Pin
index bc086c9aed5b5bb3b2ed4777fab262d57d20ed11..309008c8d384f704aea730cf048f9f818b2b72a0 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """RP2040 pins"""
 
 from microcontroller import Pin
index f3801a0304dabe9029842670981cbef486425965..4480a883f59acc16d88fbe3c3bc335e8b89b8a93 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """SPI Class for RP2040"""
 from machine import SPI as _SPI
 from machine import Pin
index a233b8e3916e031026e129db1855de9a199bd792..61c93ce3a44d19011bc02719c1be7d4c568d4298 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """UART Class for RP2040"""
 from machine import UART as _UART
 from machine import Pin
index e4db7468fe630b8600460ce693a4f4b09a8c3d96..08e36c328ff8161353c26ce6b46ea6486925a604 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `analogio` - Analog input and output control
 =================================================
index 19d155b8dde4e8e2ed452b68a3a300b79a879efa..f4a1a61fd697d5442ad4d82fed306da9656789da 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """I2C Classes for RP2040s with u2if firmware"""
 from .rp2040_u2if import rp2040_u2if
 
index f0177aeaa7692218f9b92281f923b550a221efc9..c87d2c77d9c6489d60b1e88c6dc29135a9f0f962 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """NeoPixel write for Pico u2if."""
 
 from .rp2040_u2if import rp2040_u2if
index 37a5ed50a8ff6df1af885899486165fdf746251d..c42f6238b6b4a7cdc3e7c1ec3c157fb9a718c25a 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Generic RP2040 pin names"""
 from .rp2040_u2if import rp2040_u2if
 
index 3cbf5e476003dae806095b8749483ee18c80516f..afcaf543818fa7f13be6fdf45ed32da0e08b5362 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """PWMOut Class for RP2040s with u2if"""
 from .rp2040_u2if import rp2040_u2if
 
index b7acaf0e15ca84429274f6520826eee44af85666..8dfda5b7f00cdeb3bf9ca44d3df01b80edd24764 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Helper class for use with RP2040 running u2if firmware"""
 # https://github.com/execuc/u2if
 
index 4cad9be660647ffec09ad7b8537e8a8dc4bca8f1..435baba2f6e2680df06afa601b3b093220e58051 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """SPI Classes for RP2040s with u2if firmware"""
 from .rp2040_u2if import rp2040_u2if
 
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index f3aa1a7c93a544d1cebe8d32645dc82faed22b6f..1fdee5be845f73b8f94979ca6ff8b1a1b6842949 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Atmel SAMA5 pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index c06eb31d5089d57bb78e2e0f810060ce7751fe8b..8e70ed2885f85399cac0e7d5d617803f972f2ecc 100644 (file)
@@ -1,5 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
-Samsum Exynos5422
+Samsung Exynos5422
 Ref:
     Linux kernel 4.14.y (hardkernel)
 """
index 7b3d1402fff3d6bb6e0b180a71e7961a9a9737e4..f482e5fec95a7d9fc49897148dfad44e3db0ad07 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """SnapDragon APQ8016 pin names"""
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
index 1b9ba3a36663b1d7815d29cb41801bd2c0d5afb1..c848edcf5ef782443843d7e76cd3835c43eb7ad0 100644 (file)
@@ -1,2 +1,4 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Definition for the StarFive JH71x0 chip"""
-from .pin import *
index af705b6749059ea8776b0c33e6af0ac536d00e10..dbd98a17f628398ea43b6efc3afbbbfc8071767d 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """A Pin class for use with StarFive JH71x0."""
 
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
index 605015d4d696c6b5934f15ada415a46d123f2b49..da57d0b3601a7250ac9fe8664e1592c099ea0b5d 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """STM32F405 pins"""
 
 from microcontroller import Pin
index c7ad7568fb1adf5841c522068963313671e36e3c..bc8cd5d758e73fc3d7e6a5372b9741e17c01ab91 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """STM32MP157 pins"""
 from adafruit_blinka.microcontroller.generic_linux.periphery_pin import Pin
 
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 2191c260178de15fe3fa6f40bb601db79c5aeb7f..91e87fd86b4a074f30361f95b86fbcfd828c529f 100644 (file)
@@ -1,7 +1,10 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Tegra T186 pin names"""
 
 import atexit
-import Jetson.GPIO as GPIO
+from Jetson import GPIO
 
 GPIO.setmode(GPIO.TEGRA_SOC)
 GPIO.setwarnings(False)  # shh!
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index 4bcfff9984064042dc49cb3a4976e0f188684a00..a63a79965ddda4c7fbe05a278c399986335e6b3f 100644 (file)
@@ -1,6 +1,9 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Tegra T194 pin names"""
 import atexit
-import Jetson.GPIO as GPIO
+from Jetson import GPIO
 
 GPIO.setmode(GPIO.TEGRA_SOC)
 GPIO.setwarnings(False)  # shh!
index a01e4aa643f2194af3efa0347719a999d23652e9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-from .pin import *
index e8c4c9ef55af55edc2e7d478b4b2971e121c4848..dafe81007196f645d132a44a83f61ce9364ebbe7 100644 (file)
@@ -1,7 +1,10 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Tegra T210 pin names"""
 
 import atexit
-import Jetson.GPIO as GPIO
+from Jetson import GPIO
 
 GPIO.setmode(GPIO.TEGRA_SOC)
 GPIO.setwarnings(False)  # shh!
index 0016505a21d54030f35e68ffa980dbbbd7446b51..23dfb0d5161bd9191b11755c714ffbfb50eb202d 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `analogio` - Analog input and output control
 ============================================
index d13b743a4a5f44c573be0ec9e1ad7db6b810a84b..fd0c8443eea7c5f65423221eeeb2a23d03452244 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `bitbangio` - Bitbanged bus protocols
 ==============================================================
index 69bd3a7d6232f8a92e8a47e4706310f77710bc05..b3150ed026a0f21c46637d44ccd64555539e4204 100755 (executable)
@@ -1,24 +1,6 @@
-# The MIT License (MIT)
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
 #
-# Copyright (c) 2017 cefn for adafruit industries
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
+# SPDX-License-Identifier: MIT
 """
 `board` - Define ids for available pins
 =================================================
index 1fd153254e16edbd32c57444423f59591b84226d..0605ee901d56f32adaa9b1879ec459aa11ae9b68 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `busio` - Bus protocol support like I2C and SPI
 =================================================
index f00b266f4ea36c75be13ad8ebfa8158bf2c7d243..99f0a0810f0b91cf77b19dfc336ae986ac68d1e0 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `digitalio` - Digital input and output control (GPIO)
 =====================================================
index df3154140b9c3d0bc7391869733c2d24b4b630f3..b379c20f137c7e18a74e7c8d6eb239fd52a1c659 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `keypad` - Support for scanning keys and key matrices
 ===========================================================
index da71099c908bbd33ddf7dc2a28a3b0036c88968e..cb38486681992da038bbe3b85761e2c30081c592 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `microcontroller` - Pin references and cpu functionality
 ========================================================
diff --git a/src/microcontroller/_pin.py b/src/microcontroller/_pin.py
new file mode 100644 (file)
index 0000000..0077cb0
--- /dev/null
@@ -0,0 +1,32 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+from adafruit_blinka import Enum
+import microcontroller.pin
+
+class Pin(Enum):
+    """
+    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"""
+        self.id = pin_id
+
+    def __repr__(self):
+        # pylint: disable=import-outside-toplevel, cyclic-import
+        import board
+
+        for key in dir(board):
+            if getattr(board, key) is self:
+                return "board.{}".format(key)
+        # pylint: enable=import-outside-toplevel, cyclic-import
+
+        for key in dir(microcontroller.pin):
+            if getattr(microcontroller.pin, key) is self:
+                return "microcontroller.pin.{}".format(key)
+        return repr(self)
+
index cfacf5ff6fd7d2d8361d359ccf590adf73d2a6c2..4ac685fdb01a060bc1f08a91fd12c2d8b63e7977 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Pins named after their chip name."""
 
 from adafruit_platformdetect.constants import chips as ap_chip
index 843d5a5704f0b517b5064dca524d011e7951b4ca..4f88543d5f52bfcc0d5badeee0fbd1c992c06766 100755 (executable)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `micropython` - MicroPython Specific Decorator Functions
 ========================================================
index 38feca55150d4b10cbb64c04805fe023a8d25240..2bc5f81790f31aab357a7bf031f35bfa0f464fea 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `neopixel_write` - NeoPixel precision timed writing support
 ===========================================================
index b8c209bb4d4ecb07ccffdf5e895337e175236f91..f80459e6eb113323e39e016c48adcc45c1081646 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `pulseio` - Pulse Width Modulation input and output control
 ===========================================================
index d5164bfb186791c73caeda4367cee394c269f159..f4d6a8c995a6b68d372065dc5de65b2fe22e022b 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `pwmio` - Support for PWM based protocols
 ===========================================================
index a411e3d10df1978c1d33ca07d89b1d9f7e76e0e8..5ed5a3a29df849654c9c092b266e5657713c9a3e 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `rainbowio` - Provides the `colorwheel()` function
 ===========================================================
index 7db2b8e39fc0fc717c12ebcf4baa7c09121e0d3d..8286b558e7dac500fe7a7a01732821759da680da 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """
 `usb_hid` - support for usb hid devices via usb_gadget driver
 ===========================================================
@@ -15,7 +18,7 @@ import atexit
 import sys
 
 for module in ["dwc2", "libcomposite"]:
-    if Path("/proc/modules").read_text().find(module) == -1:
+    if Path("/proc/modules").read_text(encoding="utf-8").find(module) == -1:
         raise Exception(
             "%s module not present in your kernel. did you insmod it?" % module
         )
@@ -57,7 +60,7 @@ class Device:
         """
         report_id = report_id or self.report_ids[0]
         device_path = self.get_device_path(report_id)
-        with open(device_path, "rb+") as fd:
+        with open(device_path, "rb+", encoding="utf-8") as fd:
             if report_id > 0:
                 report = bytearray(report_id.to_bytes(1, "big")) + report
             fd.write(report)
@@ -79,7 +82,7 @@ class Device:
         Return `None` if nothing received.
         """
         device_path = self.get_device_path(report_id or self.report_ids[0])
-        with open(device_path, "rb+") as fd:
+        with open(device_path, "rb+", encoding="utf-8") as fd:
             os.set_blocking(fd.fileno(), False)
             report = fd.read(self.out_report_lengths[0])
             if report is not None:
@@ -95,7 +98,7 @@ class Device:
                 "%s/functions/hid.usb%s/dev"
                 % (this.gadget_root, report_id or self.report_ids[0])
             )
-            .read_text()
+            .read_text(encoding="utf-8")
             .strip()
             .split(":")[1]
         )
@@ -462,7 +465,7 @@ def disable() -> None:
     as `usb_cdc` or `storage` to free up endpoints for use by `usb_hid`.
     """
     try:
-        Path("%s/UDC" % this.gadget_root).write_text("")
+        Path("%s/UDC" % this.gadget_root).write_text("", encoding="utf-8")
     except FileNotFoundError:
         pass
     for symlink in Path(this.gadget_root).glob("configs/**/hid.usb*"):
@@ -582,18 +585,30 @@ def enable(requested_devices: Sequence[Device], boot_device: int = 0) -> None:
     # """
     Path("%s/functions" % this.gadget_root).mkdir(parents=True, exist_ok=True)
     Path("%s/configs" % this.gadget_root).mkdir(parents=True, exist_ok=True)
-    Path("%s/bcdDevice" % this.gadget_root).write_text("%s" % 1)  # Version 1.0.0
-    Path("%s/bcdUSB" % this.gadget_root).write_text("%s" % 0x0200)  # USB 2.0
+    Path("%s/bcdDevice" % this.gadget_root).write_text(
+        "%s" % 1, encoding="utf-8"
+    )  # Version 1.0.0
+    Path("%s/bcdUSB" % this.gadget_root).write_text(
+        "%s" % 0x0200, encoding="utf-8"
+    )  # USB 2.0
     Path("%s/bDeviceClass" % this.gadget_root).write_text(
-        "%s" % 0x00
+        "%s" % 0x00, encoding="utf-8"
     )  # multipurpose i guess?
-    Path("%s/bDeviceProtocol" % this.gadget_root).write_text("%s" % 0x00)
-    Path("%s/bDeviceSubClass" % this.gadget_root).write_text("%s" % 0x00)
-    Path("%s/bMaxPacketSize0" % this.gadget_root).write_text("%s" % 0x08)
+    Path("%s/bDeviceProtocol" % this.gadget_root).write_text(
+        "%s" % 0x00, encoding="utf-8"
+    )
+    Path("%s/bDeviceSubClass" % this.gadget_root).write_text(
+        "%s" % 0x00, encoding="utf-8"
+    )
+    Path("%s/bMaxPacketSize0" % this.gadget_root).write_text(
+        "%s" % 0x08, encoding="utf-8"
+    )
     Path("%s/idProduct" % this.gadget_root).write_text(
-        "%s" % 0x0104
+        "%s" % 0x0104, encoding="utf-8"
     )  # Multifunction Composite Gadget
-    Path("%s/idVendor" % this.gadget_root).write_text("%s" % 0x1D6B)  # Linux Foundation
+    Path("%s/idVendor" % this.gadget_root).write_text(
+        "%s" % 0x1D6B, encoding="utf-8"
+    )  # Linux Foundation
     # """
     # 2. Creating the configurations
     # ------------------------------
@@ -631,10 +646,10 @@ def enable(requested_devices: Sequence[Device], boot_device: int = 0) -> None:
         Path("%s/" % config_root).mkdir(parents=True, exist_ok=True)
         Path("%s/strings/0x409" % config_root).mkdir(parents=True, exist_ok=True)
         Path("%s/strings/0x409/configuration" % config_root).write_text(
-            "my configuration"
+            "my configuration", encoding="utf-8"
         )
-        Path("%s/MaxPower" % config_root).write_text("150")
-        Path("%s/bmAttributes" % config_root).write_text("%s" % 0x080)
+        Path("%s/MaxPower" % config_root).write_text("150", encoding="utf-8")
+        Path("%s/bmAttributes" % config_root).write_text("%s" % 0x080, encoding="utf-8")
         this.devices.append(device)
         # """
         # 3. Creating the functions
@@ -664,11 +679,13 @@ def enable(requested_devices: Sequence[Device], boot_device: int = 0) -> None:
                 Path("%s/" % function_root).mkdir(parents=True)
             except FileExistsError:
                 continue
-            Path("%s/protocol" % function_root).write_text("%s" % report_id)
+            Path("%s/protocol" % function_root).write_text(
+                "%s" % report_id, encoding="utf-8"
+            )
             Path("%s/report_length" % function_root).write_text(
-                "%s" % device.in_report_lengths[report_index]
+                "%s" % device.in_report_lengths[report_index], encoding="utf-8"
             )
-            Path("%s/subclass" % function_root).write_text("%s" % 1)
+            Path("%s/subclass" % function_root).write_text("%s" % 1, encoding="utf-8")
             Path("%s/report_desc" % function_root).write_bytes(device.descriptor)
             # """
             # 4. Associating the functions with their configurations
@@ -700,4 +717,4 @@ def enable(requested_devices: Sequence[Device], boot_device: int = 0) -> None:
     #
     # $ echo s3c-hsotg > UDC  """
     udc = next(Path("/sys/class/udc/").glob("*"))
-    Path("%s/UDC" % this.gadget_root).write_text("%s" % udc.name)
+    Path("%s/UDC" % this.gadget_root).write_text("%s" % udc.name, encoding="utf-8")
index 146dfb96f0e530885c6ff1190f3ac0ccdc4f44ac..3f6f74c95d26a5484d474f0af33ff0d3b4faa408 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/sh
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 PORT=/dev/ttyUSB0
 
 export MPYCROSS=`realpath ../../../circuitpython_2.2.3/mpy-cross/mpy-cross`
index 74a5d8a66b75f42a270256345a2b986874276732..8bfb8ccb376fd880a7fe0112f01f83bdd5c90e45 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/sh
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 PORT=/dev/ttyUSB0
 
 export MPYCROSS=`realpath ../../../micropython/mpy-cross/mpy-cross`
index a565e6a0d37840311829a3d66e87106ce27a2469..aff082490485e47db03fd2ac5e7b1722423ed229 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/sh
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 
 export PORT="/dev/ttyUSB0"
 export MPYCROSS=`realpath ../../../micropython/mpy-cross/mpy-cross`
index e3173d1b19af1708f9f8a5eac6312352ce826772..fc941bbb7d95e62c3c93dc94e53776e3b057b638 100644 (file)
@@ -1,3 +1,7 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+
 # mitigate heap fragmentation issues by pre-loading major libraries
 import gc
 
index 3fcecc34c4f603e97ca8dd4bccb6e30f3c56e243..13f3873bffc03eadafa7a997f3d72550bb415835 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import unittest
 
 
index 73852cec8af75302b2b191c4e0e994d908ff0677..10dc6a861074c0a58e2f9839ece912bf1d221b97 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Configuration of testing fixtures depending on the board layout"""
 from adafruit_blinka import agnostic
 
index 8d824701c5b2ba32b437b500f4fddcf19db08445..e9d9702c55894bb4fb4f773f087e3e0519e6bcc3 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 from adafruit_blinka import agnostic
 
 if agnostic.board in ("feather_m0_express", "feather_huzzah"):
index deb21aa7f4dc89a42f82b07ab2b4d64dc4bcd3ca..e74132ee3c6e52116a970e31f0d0b840d9772346 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 from adafruit_blinka.agnostic import microcontroller
 
 if microcontroller == "esp8266":
index c6062fc761451bdee2eb963dc48419543178b6bc..36eff5b75522a5be088c5600acd7e036406bf3e6 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import unittest
 from testing import yes_no, await_true
 from testing.board import led_pin, default_pin, led_hardwired, led_inverted
index ba74044999b338f73303ac820b0b9bb4c8c5e118..5c2331a6a3d9f302c5475ed8f6f39dfb6eb948e8 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import gc
 from testing import yes_no
 
@@ -66,7 +69,7 @@ class TestMMA8451Interactive(TestCase):
         sensor = adafruit_mma8451.MMA8451(i2c)
 
         x, y, z = sensor.acceleration
-        absolute = math.sqrt(x**2 + y**2 + z**2)
+        absolute = math.sqrt(x ** 2 + y ** 2 + z ** 2)
         self.assertTrue(9 <= absolute <= 11, "Not earth gravity")
 
         orientation = sensor.orientation
index be9394dc185fc2f93efbe518b52562db1a1133d7..780f98947234fe2b2d8c3c622da662fab3e53f00 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import unittest
 
 
index acd9840ea3a2e447f7b6fdbc4e46bfc1b2de17cc..74a9b4593e6f70acfa8422269ab57b7001730f9d 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import gc
 from unittest import TestCase
 from testing import await_true
index 45f92ec36ff7ab4c9ef39857f2c7b20175dbe8a6..278101fd2afa5e689bf7313c07d379d01cc10548 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Based on https://raw.githubusercontent.com/micropython/micropython-lib/cfa1b9cce0c93a3115bbff3886c9bbcddd9e8047/unittest/unittest.py """
 import sys