Source code for sensirion_i2c_sfm3505.commands

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2025 Sensirion AG, Switzerland
#
#     THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator:     sensirion-driver-generator 1.3.4
# Product:       sfm3505
# Model-Version: 1.2.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


[docs]class FilterOptions(Enum): T63_1MS = 33601 T63_3MS = 50961 T63_5MS = 56105 T63_10MS = 60527 def __int__(self): return self.value
[docs]class StartContinuousMeasurement(Transfer): """Start continuous measurement""" CMD_ID = 0x3603
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.004, slave_address=None, ignore_ack=False)
[docs]class StartContinuousMeasurementWithFilter(Transfer): """Start continuous measurement with custom filter""" CMD_ID = 0x3603 def __init__(self, a_filter): self._a_filter = a_filter
[docs] def pack(self): return self.tx_data.pack([self._a_filter])
tx = TxData(CMD_ID, '>HH', device_busy_delay=0.004, slave_address=None, ignore_ack=False)
[docs]class ReadAllMeasurementDataRaw(Transfer): """Read out the full data from the sensor."""
[docs] def pack(self): return None
rx = RxData('>6B')
[docs]class ReadAirMeasurementDataRaw(Transfer): """Read out the air flow from the sensor."""
[docs] def pack(self): return None
rx = RxData('>4B')
[docs]class StopContinuousMeasurement(Transfer): """This transfer stops the continuous measurement and puts the sensor in idle mode.""" CMD_ID = 0x3ff9
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H')
[docs]class ConfigureAveraging(Transfer): """Configures the sensor's averaging mode.""" CMD_ID = 0x364d def __init__(self, average_window): self._average_window = average_window
[docs] def pack(self): return self.tx_data.pack([self._average_window])
tx = TxData(CMD_ID, '>HH')
[docs]class ReadProductIdentifier(Transfer): """Reads the product identifier and serial number""" CMD_ID = 0x365b
[docs] def pack(self): return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H') rx = RxData(descriptor='>I8B', convert_to_int=True)