]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Move (unimplemented) OneWire from busio to onewireio
authorDan Halbert <halbert@halwitz.org>
Fri, 3 Jun 2022 22:33:36 +0000 (18:33 -0400)
committerDan Halbert <halbert@halwitz.org>
Fri, 3 Jun 2022 22:33:36 +0000 (18:33 -0400)
docs/api.rst
setup.py
src/busio.py
src/onewireio.py [new file with mode: 0644]

index b28e684769b481a3ded654ab2443ba45b59b7c13..148032026b7102c5f89eb19a197e208bfac75892 100755 (executable)
@@ -40,6 +40,9 @@
 .. automodule:: neopixel_write
   :members:
 
 .. automodule:: neopixel_write
   :members:
 
+.. automodule:: onewireio
+  :members:
+
 .. automodule:: pulseio
   :members:
 
 .. automodule:: pulseio
   :members:
 
index 0141b68689d31ad40cd7803b21a7e0b19e12337f..67ef7ee4c7d30cf86fa36f2fabb0affb246ae53d 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -64,6 +64,7 @@ setup(
         "keypad",
         "micropython",
         "neopixel_write",
         "keypad",
         "micropython",
         "neopixel_write",
+        "onewireio",
         "pulseio",
         "pwmio",
         "rainbowio",
         "pulseio",
         "pwmio",
         "rainbowio",
index 0605ee901d56f32adaa9b1879ec459aa11ae9b68..dd748a596f0d51a798bb246e363c14f813a8bc23 100644 (file)
@@ -492,36 +492,3 @@ class UART(Lockable):
     def write(self, buf):
         """Write to the UART from a buffer"""
         return self._uart.write(buf)
     def write(self, buf):
         """Write to the UART from a buffer"""
         return self._uart.write(buf)
-
-
-class OneWire:
-    """
-    Stub class for OneWire, which is currently not implemented
-    """
-
-    def __init__(self, pin):
-        raise NotImplementedError("OneWire has not been implemented")
-
-    def deinit(self):
-        """
-        Deinitialize the OneWire bus and release any hardware resources for reuse.
-        """
-        raise NotImplementedError("OneWire has not been implemented")
-
-    def reset(self):
-        """
-        Reset the OneWire bus and read presence
-        """
-        raise NotImplementedError("OneWire has not been implemented")
-
-    def read_bit(self):
-        """
-        Read in a bit
-        """
-        raise NotImplementedError("OneWire has not been implemented")
-
-    def write_bit(self, value):
-        """
-        Write out a bit based on value.
-        """
-        raise NotImplementedError("OneWire has not been implemented")
diff --git a/src/onewireio.py b/src/onewireio.py
new file mode 100644 (file)
index 0000000..4e37463
--- /dev/null
@@ -0,0 +1,47 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+"""
+`onewireio` - 1-wire bus protocol
+=================================================
+
+See `CircuitPython:onewireio` in CircuitPython for more details.
+
+* Author(s): cefn
+"""
+
+# pylint: disable=import-outside-toplevel,too-many-branches,too-many-statements
+# pylint: disable=too-many-arguments,too-many-function-args,too-many-return-statements
+
+
+class OneWire:
+    """
+    Stub class for OneWire, which is currently not implemented
+    """
+
+    def __init__(self, pin):
+        raise NotImplementedError("OneWire has not been implemented")
+
+    def deinit(self):
+        """
+        Deinitialize the OneWire bus and release any hardware resources for reuse.
+        """
+        raise NotImplementedError("OneWire has not been implemented")
+
+    def reset(self):
+        """
+        Reset the OneWire bus and read presence
+        """
+        raise NotImplementedError("OneWire has not been implemented")
+
+    def read_bit(self):
+        """
+        Read in a bit
+        """
+        raise NotImplementedError("OneWire has not been implemented")
+
+    def write_bit(self, value):
+        """
+        Write out a bit based on value.
+        """
+        raise NotImplementedError("OneWire has not been implemented")