X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/a6b34f76661afd2f5d00ed72aa096bd01f1f8706..fa80f7d2ef51b0aea92196e96c3584512d30e64d:/src/busio.py diff --git a/src/busio.py b/src/busio.py index 279bd46..1cad051 100755 --- a/src/busio.py +++ b/src/busio.py @@ -127,7 +127,7 @@ class I2C(Lockable): in_end=None, stop=False ): - """"Write to a device at specified address from a buffer then read + """ "Write to a device at specified address from a buffer then read from a device at specified address into a buffer """ return self._i2c.writeto_then_readfrom( @@ -293,7 +293,7 @@ class SPI(Lockable): except AttributeError: raise NotImplementedError( "Frequency attribute not implemented for this platform" - ) + ) from AttributeError def write(self, buf, start=0, end=None): """Write to the SPI device""" @@ -412,3 +412,36 @@ class UART(Lockable): 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")