OneWire
– Lowest-level of the Maxim OneWire protocol¶
OneWire
implements the timing-sensitive foundation of
the Maxim (formerly Dallas Semi) OneWire protocol.
Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126
-
class
bitbangio.
OneWire
(pin)¶ Create a OneWire object associated with the given pin. The object implements the lowest level timing-sensitive bits of the protocol.
Parameters: pin (Pin) – Pin to read pulses from. Read a short series of pulses:
import bitbangio import board onewire = bitbangio.OneWire(board.D7) onewire.reset() onewire.write_bit(True) onewire.write_bit(False) print(onewire.read_bit())
-
deinit
()¶ Deinitialize the OneWire bus and release any hardware resources for reuse.
-
__enter__
()¶ No-op used by Context Managers.
-
__exit__
()¶ Automatically deinitializes the hardware when exiting a context. See Lifetime and ContextManagers for more info.
-
reset
()¶ Reset the OneWire bus
-
write_bit
(value)¶ Write out a bit based on value.
-