# -*- coding: utf-8 -*-
# (c) Copyright 2020 Sensirion AG, Switzerland
##############################################################################
##############################################################################
# _____ _ _ _______ _____ ____ _ _
# / ____| /\ | | | |__ __|_ _/ __ \| \ | |
# | | / \ | | | | | | | || | | | \| |
# | | / /\ \| | | | | | | || | | | . ` |
# | |____ / ____ \ |__| | | | _| || |__| | |\ |
# \_____/_/ \_\____/ |_| |_____\____/|_| \_|
#
# THIS FILE IS AUTOMATICALLY GENERATED AND MUST NOT BE EDITED MANUALLY!
#
# Generator: sensirion-shdlc-interface-generator 0.8.2
# Product: SFC5xxx
# Version: 0.1.0
#
##############################################################################
##############################################################################
# flake8: noqa
from __future__ import absolute_import, division, print_function
from sensirion_shdlc_driver.command import ShdlcCommand
from struct import pack, unpack
import logging
log = logging.getLogger(__name__)
[docs]class Sfc5xxxCmdActivateCalibrationBase(ShdlcCommand):
"""
SHDLC command 0x45: "Activate Calibration".
"""
[docs] def __init__(self, *args, **kwargs):
"""
Constructor.
"""
super(Sfc5xxxCmdActivateCalibrationBase, self).__init__(
0x45, *args, **kwargs)
[docs]class Sfc5xxxCmdActivateCalibration(Sfc5xxxCmdActivateCalibrationBase):
"""
Activate Calibration Command
This command loads a calibration from calibration memory and runs the flow
controller. If the specified calibration is already active, this command
does nothing. The active calibration is stored in non-volatile memory and
will automatically be re-activated after a device reset.
.. note:: Caution: This command will cause a write operation in an EEPROM.
Because of the limited write cycles of the EEPROM, this command
should not be called periodical (max 50'000 times with a new
calibration). Loading the same calibration again is not a problem
and will not cause a write operation.
"""
[docs] def __init__(self, index):
"""
Constructor.
:param int index:
The index of the calibration to activate.
"""
super(Sfc5xxxCmdActivateCalibration, self).__init__(
data=b"".join([pack(">I", index)]),
max_response_time=1.6,
post_processing_time=0.0,
min_response_length=0,
max_response_length=0
)