Source code for sensirion_i2c_sht3x.commands

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2023 Sensirion AG, Switzerland
#
#     THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator:     sensirion-driver-generator 0.33.0
# Product:       sht3x
# Model-Version: 1.0.0
#
"""
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 enum import Enum
from sensirion_driver_adapters.transfer import Transfer
from sensirion_driver_adapters.rx_tx_data import TxData, RxData
from sensirion_driver_support_types.bitfield import BitField, BitfieldContainer


[docs]class StatusRegisterT(BitfieldContainer): command_status = BitField(offset=1, width=1) system_reset_detected = BitField(offset=4, width=1) new_data_available = BitField(offset=6, width=4) heater_status = BitField(offset=13, width=1)
[docs]class MeasureSingleShotHighRepeatability(Transfer): """Single shot measurement with high repeatability""" CMD_ID = 0x2400
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.016, slave_address=None, ignore_ack=False) rx = RxData('>HH')
[docs]class MeasureSingleShotHighRepeatabilityClockStretching(Transfer): """Single shot measurement with high repeatability and clock stretching enabled""" CMD_ID = 0x2c06
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.016, slave_address=None, ignore_ack=False) rx = RxData('>HH')
[docs]class MeasureSingleShotMediumRepeatability(Transfer): """Single shot measurement with medium repeatability""" CMD_ID = 0x240b
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.007, slave_address=None, ignore_ack=False) rx = RxData('>HH')
[docs]class MeasureSingleShotMediumRepeatabilityClockStretching(Transfer): """Single shot measurement with medium repeatability and clock stretching enabled""" CMD_ID = 0x2c0d
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.007, slave_address=None, ignore_ack=False) rx = RxData('>HH')
[docs]class MeasureSingleShotLowRepeatability(Transfer): """Single shot measurement with low repeatability""" CMD_ID = 0x2416
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.005, slave_address=None, ignore_ack=False) rx = RxData('>HH')
[docs]class MeasureSingleShotLowRepeatabilityClockStretching(Transfer): """Single shot measurement with low repeatability and clock stretching enabled""" CMD_ID = 0x2c10
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.005, slave_address=None, ignore_ack=False) rx = RxData('>HH')
[docs]class StartMeasurement05MpsHighRepeatability(Transfer): """Start periodic measurement mode with 0.5 mps and high repeatability.""" CMD_ID = 0x2032
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.016, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement05MpsMediumRepeatability(Transfer): """Start periodic measurement mode with 0.5 mps and medium repeatability.""" CMD_ID = 0x2024
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.007, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement05MpsLowRepeatability(Transfer): """Start periodic measurement mode with 0.5 mps and low repeatability.""" CMD_ID = 0x202f
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.005, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement1MpsHighRepeatability(Transfer): """Start periodic measurement mode with 1 mps and high repeatability.""" CMD_ID = 0x2130
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.016, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement1MpsMediumRepeatability(Transfer): """Start periodic measurement mode with 1 mps and medium repeatability.""" CMD_ID = 0x2126
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.007, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement1MpsLowRepeatability(Transfer): """Start periodic measurement mode with 1 mps and low repeatability.""" CMD_ID = 0x212d
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.005, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement2MpsHighRepeatability(Transfer): """Start periodic measurement mode with 2 mps and high repeatability.""" CMD_ID = 0x2236
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.016, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement2MpsMediumRepeatability(Transfer): """Start periodic measurement mode with 2 mps and medium repeatability.""" CMD_ID = 0x2220
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.007, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement2MpsLowRepeatability(Transfer): """Start periodic measurement mode with 2 mps and low repeatability.""" CMD_ID = 0x222b
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.005, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement4MpsHighRepeatability(Transfer): """Start periodic measurement mode with 4 mps and high repeatability.""" CMD_ID = 0x2334
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.016, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement4MpsMediumRepeatability(Transfer): """Start periodic measurement mode with 4 mps and medium repeatability.""" CMD_ID = 0x2322
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.007, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement4MpsLowRepeatability(Transfer): """Start periodic measurement mode with 4 mps and low repeatability.""" CMD_ID = 0x2329
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.005, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement10MpsHighRepeatability(Transfer): """Start periodic measurement mode with 10 mps and high repeatability.""" CMD_ID = 0x2737
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.016, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement10MpsMediumRepeatability(Transfer): """Start periodic measurement mode with 10 mps and medium repeatability.""" CMD_ID = 0x2721
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.007, slave_address=None, ignore_ack=False)
[docs]class StartMeasurement10MpsLowRepeatability(Transfer): """Start periodic measurement mode with 10 mps and low repeatability.""" CMD_ID = 0x273a
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.005, slave_address=None, ignore_ack=False)
[docs]class StartArtMeasurement(Transfer): """Start ART (accelerated response time) measurement""" CMD_ID = 0x2b32
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H')
[docs]class ReadMeasurement(Transfer): """Read out data after a "start measurement" or "start art measurement" command has been issued.""" CMD_ID = 0xe000
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H') rx = RxData('>HH')
[docs]class StopMeasurement(Transfer): """Stop the periodic measurement mode.""" CMD_ID = 0x3093
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.001, slave_address=None, ignore_ack=False)
[docs]class EnableHeater(Transfer): """Enable the heater""" CMD_ID = 0x306d
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.01, slave_address=None, ignore_ack=False)
[docs]class DisableHeater(Transfer): """Disable the heater""" CMD_ID = 0x3066
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.01, slave_address=None, ignore_ack=False)
[docs]class ReadStatusRegister(Transfer): """Read out the status register""" CMD_ID = 0xf32d
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.01, slave_address=None, ignore_ack=False) rx = RxData('>H')
[docs]class ClearStatusRegister(Transfer): """Clear (set to zero) all flags (Bit 4) in the status register.""" CMD_ID = 0x3041
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.01, slave_address=None, ignore_ack=False)
[docs]class SoftReset(Transfer): """Perform a soft reset.""" CMD_ID = 0x30a2
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.002, slave_address=None, ignore_ack=False)
[docs]class Repeatability(Enum): LOW = 0 MEDIUM = 1 HIGH = 2 def __int__(self): return self.value
[docs]class Mps(Enum): EVERY_TWO_SECONDS = 0 ONE_PER_SECOND = 1 TWO_PER_SECOND = 2 FOUR_PER_SECOND = 4 TEN_PER_SECOND = 10 def __int__(self): return self.value