#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2024 Sensirion AG, Switzerland
#
# THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator: sensirion-driver-generator 0.40.0
# Product: sht4x
# Model-Version: 2.1.1
#
"""
The transfer classes specify the data that is transferred between host and sensor. The generated transfer classes
are used by the driver class and not intended for direct use.
"""
from sensirion_driver_adapters.transfer import Transfer
from sensirion_driver_adapters.rx_tx_data import TxData, RxData
[docs]class MeasureHighPrecisionTicks(Transfer):
"""SHT4x command for a single shot measurement with high repeatability."""
CMD_ID = 0xfd
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.01, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class MeasureMediumPrecisionTicks(Transfer):
"""SHT4x command for a single shot measurement with medium repeatability."""
CMD_ID = 0xf6
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.005, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class MeasureLowestPrecisionTicks(Transfer):
"""SHT4x command for a single shot measurement with lowest repeatability."""
CMD_ID = 0xe0
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.002, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class ActivateHighestHeaterPowerLongTicks(Transfer):
"""
SHT4x command to activate highest heater power and perform a single shot high
precision measurement for 1s.
"""
CMD_ID = 0x39
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=1.1, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class ActivateHighestHeaterPowerShortTicks(Transfer):
"""
SHT4x command to activate highest heater power and perform a single shot high
precision measurement for 0.1s.
"""
CMD_ID = 0x32
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.11, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class ActivateMediumHeaterPowerLongTicks(Transfer):
"""
SHT4x command to activate medium heater power and perform a single shot high
precision measurement for 1s.
"""
CMD_ID = 0x2f
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=1.1, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class ActivateMediumHeaterPowerShortTicks(Transfer):
"""
SHT4x command to activate medium heater power and perform a single shot high
precision measurement for 0.1s.
"""
CMD_ID = 0x24
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.11, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class ActivateLowestHeaterPowerLongTicks(Transfer):
"""
SHT4x command to activate lowest heater power and perform a single shot high
precision measurement for 1s.
"""
CMD_ID = 0x1e
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=1.1, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class ActivateLowestHeaterPowerShortTicks(Transfer):
"""
SHT4x command to activate lowest heater power and perform a single shot high
precision measurement for 0.1s.
"""
CMD_ID = 0x15
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.11, slave_address=None, ignore_ack=False)
rx = RxData('>HH')
[docs]class SerialNumber(Transfer):
"""Read out the serial number"""
CMD_ID = 0x89
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.01, slave_address=None, ignore_ack=False)
rx = RxData('>I')
[docs]class SoftReset(Transfer):
"""Perform a soft reset."""
CMD_ID = 0x94
[docs] def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.01, slave_address=None, ignore_ack=False)