Source code for sensirion_i2c_sf06_lf.commands

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2023 Sensirion AG, Switzerland
#
#     THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator:     sensirion-driver-generator 0.32.0
# Product:       sf06_lf
# Model-Version: 1.1.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 InvFlowScaleFactors(Enum): SLF3C_1300F = 500 SLF3S_1300F = 500 SLF3S_4000B = 32 SLF3S_0600F = 10 LD20_0600L = 1200 LD20_2600B = 20 def __int__(self): return self.value
[docs]class SignalingFlagsT(BitfieldContainer): air_in_line_flag = BitField(offset=0, width=1) high_flow_flag = BitField(offset=1, width=1) exp_smoothing_active = BitField(offset=5, width=1)
[docs]class StartH2oContinuousMeasurement(Transfer): """ Starts continuous measurement mode using calibration values for Hâ‚‚O. The sensor measures both the flow rate and the temperature. After the command has been sent, the chip continuously measures and updates the measurement results which can be read with *read_measurement_data_raw*. """ CMD_ID = 0x3608
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.012, slave_address=None, ignore_ack=False)
[docs]class StartIpaContinuousMeasurement(Transfer): """ Starts continuous measurement mode using calibration values for Isopropyl alcohol. The sensor measures both the flow rate and the temperature. After the command has been sent, the chip continuously measures and updates the measurement results which can be read with *read_measurement_data_raw*. Supported by products: SLF3C-1300F, SLF3S-1300F, SLF3S-0600F, SLF3S-4000B """ CMD_ID = 0x3615
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.012, slave_address=None, ignore_ack=False)
[docs]class ReadMeasurementDataRaw(Transfer): """ After the command *start_xx_continuous_measurement* has been sent, the chip continuously measures and updates the measurement results. New results (flow, temperature, and signaling flags) can be read continuously with this command. """
[docs] def pack(self): return None
rx = RxData('>hhH')
[docs]class StopContinuousMeasurement(Transfer): """ This command stops the continuous measurement and puts the sensor in idle mode. After it receives the stop command, the sensor needs up to 0.5ms to power down the heater, enter idle mode and be receptive for a new command. """ CMD_ID = 0x3ff9
[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 StartSingleThermalConductivityMeasurementSync(Transfer): """ This command starts one thermal conductivity measurement and blocks for 2.3 seconds until the measurement results are ready. After completion of the measurement, the heater is switched off and the sensor enters idle mode and the results can be read anytime with *read_thermal_conductivity_measurement_data*. The sensor measures the thermal conductivity, the sensor temperature, and the delta-temperature (a measure for the temperature difference between the liquid and the sensor). Supported by products: SLF3C-1300F, SLF3S-4000B """ CMD_ID = 0x3646
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=2.3, slave_address=None, ignore_ack=False)
[docs]class StartSingleThermalConductivityMeasurementAsync(Transfer): """ This command starts one thermal conductivity measurement and returns immediately. Note that the sensor does not accept any other commands while the measurement is running, which takes approximately 2.3 seconds. After completion of the measurement, the heater is switched off and the sensor enters idle mode and the results can be read anytime with *read_thermal_conductivity_measurement_data*. The sensor measures the thermal conductivity, the sensor temperature, and the delta-temperature (a measure for the temperature difference between the liquid and the sensor). Supported by products: SLF3C-1300F, SLF3S-4000B """ CMD_ID = 0x3646
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H')
[docs]class ReadThermalConductivityMeasurementData(Transfer): """ Reads single thermal conductivity measurement after a measurement has been started with *start_single_thermal_conductivity_measurement_sync* or *start_single_thermal_conductivity_measurement_async*. Supported by products: SLF3C-1300F, SLF3S-4000B """
[docs] def pack(self): return None
rx = RxData('>hhh')
[docs]class EnterSleep(Transfer): """ In sleep mode the sensor uses a minimum amount of power. The mode can only be entered from idle mode, i.e. when the sensor is not measuring. This mode is particularly useful for battery operated devices. To minimize the current in this mode, the complexity of the sleep mode circuit has been reduced as much as possible, which is mainly reflected by the way the sensor exits the sleep mode. In sleep mode the sensor cannot be soft reset. Supported by products: LD20-0600L, LD20-2600B """ CMD_ID = 0x3677
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.0, slave_address=None, ignore_ack=True)
[docs]class ExitSleep(Transfer): """ The sensor exits the sleep mode and enters the idle mode when it receives the valid I2C address and a write bit (‘0’). Note that the I2C address is not acknowledged. It is necessary to poll the sensor to see whether the sensor has received the address and has woken up. This should take typically 25ms. Supported by products: LD20-0600L, LD20-2600B """ CMD_ID = 0x0
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>B', device_busy_delay=0.025, slave_address=None, ignore_ack=True)
[docs]class ReadProductIdentifierPrepare(Transfer): """ Prepare to read the product identifier and the serial number. The command can only be executed from the idle mode, i.e. when the sensor is not performing measurements. """ CMD_ID = 0x367c
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H')
[docs]class ReadProductIdentifier(Transfer): """ This command allows to read product identifier and the serial number. The command can only be executed from the idle mode, i.e. when the sensor is not performing measurements and *read_product_identifier_prepare* is called before. """ CMD_ID = 0xe102
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H') rx = RxData('>I8B')