#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2026 Sensirion AG, Switzerland
#
# THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator: sensirion-driver-generator 1.6.0
# Product: sgp43
# Model-Version: 3.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 sensirion_driver_adapters.transfer import Transfer
from sensirion_driver_adapters.rx_tx_data import TxData, RxData
[docs]
class MeasureAndSetTemperatures(Transfer):
"""
This command measures raw signals of pixel 1-4,
then sets the temperatures, and returns the
measured raw signals of pixel 1-4.
"""
CMD_ID = 0x264a
def __init__(self, temperature_px1, temperature_px2, temperature_px3, temperature_px4):
self._temperature_px1 = temperature_px1
self._temperature_px2 = temperature_px2
self._temperature_px3 = temperature_px3
self._temperature_px4 = temperature_px4
[docs]
def pack(self):
return self.tx_data.pack([self._temperature_px1, self._temperature_px2, self._temperature_px3,
self._temperature_px4])
tx = TxData(CMD_ID, '>HHHHH', device_busy_delay=0.09, slave_address=None, ignore_ack=False)
rx = RxData('>HHHH')
[docs]
class ExecuteSelfTest(Transfer):
"""
This command triggers the built-in self-test checking for integrity of both
hotplate and MOX material and returns the result of this test as 2 bytes
"""
CMD_ID = 0x280e
[docs]
def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H', device_busy_delay=0.32, slave_address=None, ignore_ack=False)
rx = RxData('>H')
[docs]
class GetSerialNumber(Transfer):
"""
This command provides the decimal serial number of the SGP41 chip by returning
3x2 bytes.
"""
CMD_ID = 0x3682
[docs]
def pack(self):
return self.tx_data.pack([])
tx = TxData(CMD_ID, '>H')
rx = RxData(descriptor='>6B', convert_to_int=True)
[docs]
class TurnHeaterOff(Transfer):
"""
This command turns off all hotplates (pixels) immediately,
without performing a measurement first. Subsequently, the
sensor enters the idle mode. Note that this command can only
be sent when the sensor is not executing any other command,
it cannot be used to abort a running measurement or self-test.
"""
CMD_ID = 0x36e0
[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)