adafruit_ds248x

CircuitPython driver for the DS2484 I2C to 1-Wire Bus Adapter

  • Author(s): Liz Clark

Implementation Notes

Hardware:

Software and Dependencies:

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

property onewire_byte: int

Byte to the 1-Wire bus.

Returns:

The byte read from the 1-Wire bus

onewire_reset() bool

Perform a 1-Wire reset.

Returns:

True if the reset was successful, False otherwise

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

onewire_search_reset() None

Reset the 1-Wire search state.

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

reset() bool

Reset the DS248x device.

Returns:

True if the reset was successful, 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

property single_bit_result: bool

Get the result of the last single bit operation on the 1-Wire bus.

Returns:

True if the result bit is 1, False if it is 0

property status: int

Status of the DS248x device.

Returns:

The status byte of the DS248x device

property triplet_second_bit: bool

Get the second bit of the last triplet operation on the 1-Wire bus.

Returns:

True if the second bit is 1, False if it is 0