Source code for sensirion_shdlc_sfc5xxx.device_errors

# -*- 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.errors import ShdlcDeviceError

import logging
log = logging.getLogger(__name__)


[docs]class Sfc5xxxFunctionalityNotImplementedError(ShdlcDeviceError): """ The requested functionality is not implemented (yet) on the device. """
[docs] def __init__(self): super(Sfc5xxxFunctionalityNotImplementedError, self).__init__( 0x20, "The requested functionality is not implemented (yet) on the " "device." )
[docs]class Sfc5xxxNvmAddressOutOfRangeError(ShdlcDeviceError): """ Address of is outside of the non-volatile memory address space. """
[docs] def __init__(self): super(Sfc5xxxNvmAddressOutOfRangeError, self).__init__( 0x21, "Address of is outside of the non-volatile memory address space." )
[docs]class Sfc5xxxFrameChecksumError(ShdlcDeviceError): """ Frame checksum mismatch detected. If this error occurs, no MISO frame will be sent (internal error only). """
[docs] def __init__(self): super(Sfc5xxxFrameChecksumError, self).__init__( 0x22, "Frame checksum mismatch detected. If this error occurs, no MISO " "frame will be sent (internal error only)." )
[docs]class Sfc5xxxInvalidSpecialFrameIdentifierError(ShdlcDeviceError): """ Illegal special frame identifier. """
[docs] def __init__(self): super(Sfc5xxxInvalidSpecialFrameIdentifierError, self).__init__( 0x24, "Illegal special frame identifier." )
[docs]class Sfc5xxxFrameCompositionError(ShdlcDeviceError): """ Illegal frame composition. Probably wrong data size for given subcommand. """
[docs] def __init__(self): super(Sfc5xxxFrameCompositionError, self).__init__( 0x25, "Illegal frame composition. Probably wrong data size for given " "subcommand." )
[docs]class Sfc5xxxNoBroadcastResponseAvailableError(ShdlcDeviceError): """ Triggered a broadcast response, but no valid response is available at the moment. """
[docs] def __init__(self): super(Sfc5xxxNoBroadcastResponseAvailableError, self).__init__( 0x27, "Triggered a broadcast response, but no valid response is " "available at the moment." )
[docs]class Sfc5xxxInternalFunctionArgumentError(ShdlcDeviceError): """ Internal function argument out of range. """
[docs] def __init__(self): super(Sfc5xxxInternalFunctionArgumentError, self).__init__( 0x28, "Internal function argument out of range." )
[docs]class Sfc5xxxI2cNackError(ShdlcDeviceError): """ NACK received from I2C device. """
[docs] def __init__(self): super(Sfc5xxxI2cNackError, self).__init__( 0x29, "NACK received from I2C device." )
[docs]class Sfc5xxxI2cMasterHoldError(ShdlcDeviceError): """ Master hold not released in I2C. """
[docs] def __init__(self): super(Sfc5xxxI2cMasterHoldError, self).__init__( 0x2A, "Master hold not released in I2C." )
[docs]class Sfc5xxxI2cCrcError(ShdlcDeviceError): """ I2C CRC mismatch. """
[docs] def __init__(self): super(Sfc5xxxI2cCrcError, self).__init__( 0x2B, "I2C CRC mismatch." )
[docs]class Sfc5xxxSensorDataWriteError(ShdlcDeviceError): """ Sensor data read back differs from written value. """
[docs] def __init__(self): super(Sfc5xxxSensorDataWriteError, self).__init__( 0x2C, "Sensor data read back differs from written value." )
[docs]class Sfc5xxxSensorMeasureLoopNotRunningError(ShdlcDeviceError): """ Sensor measure loop is not running. """
[docs] def __init__(self): super(Sfc5xxxSensorMeasureLoopNotRunningError, self).__init__( 0x2D, "Sensor measure loop is not running." )
[docs]class Sfc5xxxStartSignalProcessorTimeoutError(ShdlcDeviceError): """ Timeout while starting signal processor. """
[docs] def __init__(self): super(Sfc5xxxStartSignalProcessorTimeoutError, self).__init__( 0x2E, "Timeout while starting signal processor." )
[docs]class Sfc5xxxStopSignalProcessorTimeoutError(ShdlcDeviceError): """ Timeout while stopping signal processor. """
[docs] def __init__(self): super(Sfc5xxxStopSignalProcessorTimeoutError, self).__init__( 0x2F, "Timeout while stopping signal processor." )
[docs]class Sfc5xxxModifySignalProcessorError(ShdlcDeviceError): """ Not possible to modify signal processor while startup or shut down. """
[docs] def __init__(self): super(Sfc5xxxModifySignalProcessorError, self).__init__( 0x31, "Not possible to modify signal processor while startup or shut " "down." )
[docs]class Sfc5xxxHardwareCommunicationError(ShdlcDeviceError): """ Hardware communication failed. """
[docs] def __init__(self): super(Sfc5xxxHardwareCommunicationError, self).__init__( 0x32, "Hardware communication failed." )
[docs]class Sfc5xxxInvalidCalibrationIndexError(ShdlcDeviceError): """ No valid gas calibration block at given index. """
[docs] def __init__(self): super(Sfc5xxxInvalidCalibrationIndexError, self).__init__( 0x33, "No valid gas calibration block at given index." )
[docs]class Sfc5xxxInalidSensorFieldError(ShdlcDeviceError): """ No valid calibration at given sensor field index. """
[docs] def __init__(self): super(Sfc5xxxInalidSensorFieldError, self).__init__( 0x34, "No valid calibration at given sensor field index." )
[docs]class Sfc5xxxI2cStartConditionError(ShdlcDeviceError): """ I2C lines (SCL or SDA) low before sending start condition. """
[docs] def __init__(self): super(Sfc5xxxI2cStartConditionError, self).__init__( 0x36, "I2C lines (SCL or SDA) low before sending start condition." )
[docs]class Sfc5xxxSupplyVoltageOutOfRangeError(ShdlcDeviceError): """ Supply voltage out of range. """
[docs] def __init__(self): super(Sfc5xxxSupplyVoltageOutOfRangeError, self).__init__( 0x37, "Supply voltage out of range." )
[docs]class Sfc5xxxUnknownHardwareTypeError(ShdlcDeviceError): """ Unknown hardware type. """
[docs] def __init__(self): super(Sfc5xxxUnknownHardwareTypeError, self).__init__( 0x38, "Unknown hardware type." )
[docs]class Sfc5xxxUnknownHardwareVersionError(ShdlcDeviceError): """ Unknown hardware version. """
[docs] def __init__(self): super(Sfc5xxxUnknownHardwareVersionError, self).__init__( 0x39, "Unknown hardware version." )
[docs]class Sfc5xxxFramWriteError(ShdlcDeviceError): """ FRAM write error (read back mismatch). """
[docs] def __init__(self): super(Sfc5xxxFramWriteError, self).__init__( 0x3B, "FRAM write error (read back mismatch)." )
[docs]class Sfc5xxxFlashWriteError(ShdlcDeviceError): """ Flash write error (read back mismatch). """
[docs] def __init__(self): super(Sfc5xxxFlashWriteError, self).__init__( 0x3C, "Flash write error (read back mismatch)." )
[docs]class Sfc5xxxSensorEepromWriteError(ShdlcDeviceError): """ Sensor EEPROM write error (read back mismatch). """
[docs] def __init__(self): super(Sfc5xxxSensorEepromWriteError, self).__init__( 0x3D, "Sensor EEPROM write error (read back mismatch)." )
[docs]class Sfc5xxxMissingGasPressureError(ShdlcDeviceError): """ Missing gas pressure, could not reach setpoint. """
[docs] def __init__(self): super(Sfc5xxxMissingGasPressureError, self).__init__( 0x3F, "Missing gas pressure, could not reach setpoint." )
[docs]class Sfc5xxxExternalOscillatorStartupError(ShdlcDeviceError): """ Could not startup external oscillator. System now runs with internal oscillator (+/- 1%). """
[docs] def __init__(self): super(Sfc5xxxExternalOscillatorStartupError, self).__init__( 0x40, "Could not startup external oscillator. System now runs with " "internal oscillator (+/- 1%)." )
[docs]class Sfc5xxxCommunicationAdapterNotAvailableError(ShdlcDeviceError): """ The requested type of communication adapter is not available. """
[docs] def __init__(self): super(Sfc5xxxCommunicationAdapterNotAvailableError, self).__init__( 0x41, "The requested type of communication adapter is not available." )
[docs]class Sfc5xxxSensorBusyError(ShdlcDeviceError): """ The sensor is busy at the moment. """
[docs] def __init__(self): super(Sfc5xxxSensorBusyError, self).__init__( 0x42, "The sensor is busy at the moment." )
[docs]class Sfc5xxxCommandNotAllowedInCurrentStateError(ShdlcDeviceError): """ This command is not allowed in the current state of the device. """
[docs] def __init__(self): super(Sfc5xxxCommandNotAllowedInCurrentStateError, self).__init__( 0x43, "This command is not allowed in the current state of the device." )
[docs]class Sfc5xxxFunctionalityNotSupportedError(ShdlcDeviceError): """ The device does not support this functionality. """
[docs] def __init__(self): super(Sfc5xxxFunctionalityNotSupportedError, self).__init__( 0x44, "The device does not support this functionality." )
[docs]class Sfc5xxxFatalError(ShdlcDeviceError): """ Unspecified or fatal system error. """
[docs] def __init__(self): super(Sfc5xxxFatalError, self).__init__( 0x7F, "Unspecified or fatal system error." )
""" List containing all device errors specified in this file. """ SFC5XXX_DEVICE_ERROR_LIST = [ Sfc5xxxFunctionalityNotImplementedError(), Sfc5xxxNvmAddressOutOfRangeError(), Sfc5xxxFrameChecksumError(), Sfc5xxxInvalidSpecialFrameIdentifierError(), Sfc5xxxFrameCompositionError(), Sfc5xxxNoBroadcastResponseAvailableError(), Sfc5xxxInternalFunctionArgumentError(), Sfc5xxxI2cNackError(), Sfc5xxxI2cMasterHoldError(), Sfc5xxxI2cCrcError(), Sfc5xxxSensorDataWriteError(), Sfc5xxxSensorMeasureLoopNotRunningError(), Sfc5xxxStartSignalProcessorTimeoutError(), Sfc5xxxStopSignalProcessorTimeoutError(), Sfc5xxxModifySignalProcessorError(), Sfc5xxxHardwareCommunicationError(), Sfc5xxxInvalidCalibrationIndexError(), Sfc5xxxInalidSensorFieldError(), Sfc5xxxI2cStartConditionError(), Sfc5xxxSupplyVoltageOutOfRangeError(), Sfc5xxxUnknownHardwareTypeError(), Sfc5xxxUnknownHardwareVersionError(), Sfc5xxxFramWriteError(), Sfc5xxxFlashWriteError(), Sfc5xxxSensorEepromWriteError(), Sfc5xxxMissingGasPressureError(), Sfc5xxxExternalOscillatorStartupError(), Sfc5xxxCommunicationAdapterNotAvailableError(), Sfc5xxxSensorBusyError(), Sfc5xxxCommandNotAllowedInCurrentStateError(), Sfc5xxxFunctionalityNotSupportedError(), Sfc5xxxFatalError(), ]