adafruit_ds248x
CircuitPython driver for the DS2484 I2C to 1-Wire Bus Adapter
Author(s): Liz Clark
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_ds248x.Adafruit_DS248x(i2c: I2C, address: int = 0x18)
Driver for the DS248x 1-Wire to I2C Bus Adapter.
Initialize the DS248x driver.
- Parameters:
i2c – The I2C bus object
address – The I2C address of the DS248x device
- property branch_dir_taken: bool
Check if the branch direction was taken during the last triplet operation on the 1-Wire bus.
- Returns:
True if the branch direction was taken, False otherwise
- property channel: int
Gets the current selected channel on the DS2482-800 by querying the device.
- Returns:
The currenctly selected channel.
- property config: int
The configuration of the DS248x device.
- Returns:
The configuration byte of the DS248x device
- ds18b20_temperature(rom: bytearray = None) float
Reads the temperature from a DS18B20 sensor. If no ROM address is provided, then a channel is read (0-7) from the DS2482S-800.
- Parameters:
rom – The ROM address of the DS18B20 sensor (optional)
- Returns:
The temperature in Celsius
- property logic_level: bool
Check the logic level of the 1-Wire bus.
- Returns:
True if the logic level is high, False if it is low
- property onewire_bit: bool
Bit to the 1-Wire bus.
- Parameters:
bit – The bit to write to the 1-Wire bus
- property onewire_busy: bool
Check if the 1-Wire bus is busy.
- Returns:
True if the 1-Wire bus is busy, False otherwise
- onewire_reset() bool
Perform a 1-Wire reset.
- Returns:
True if the reset was successful, False otherwise
- onewire_search(new_addr: List[int]) bool
Perform a 1-Wire search to find devices on the bus.
- Parameters:
new_addr – The list to store the address of the found device
- Returns:
True if a device was found, False otherwise
- property presence_pulse_detected: bool
Check if a presence pulse is detected on the 1-Wire bus.
- Returns:
True if a presence pulse is detected, False otherwise
- property short_detected: bool
Check if a short circuit is detected on the 1-Wire bus.
- Returns:
True if a short circuit is detected, False otherwise