NHS31xx UCode-I2C EPC coding
Enumerations
UCODE_EVENT

Detailed Description

Enumerations

enum  UCODE_EVENT_T {
  UCODE_EVENT_PRISTINE = 1 << 0,
  UCODE_EVENT_CONFIGURED = 1 << 1,
  UCODE_EVENT_STARTING = 1 << 2,
  UCODE_EVENT_LOGGING = 1 << 3,
  UCODE_EVENT_STOPPED = 1 << 4,
  UCODE_EVENT_TEMPERATURE_TOO_HIGH = 1 << 5,
  UCODE_EVENT_TEMPERATURE_TOO_LOW = 1 << 6,
  UCODE_EVENT_BOD = 1 << 7,
  UCODE_EVENT_FULL = 1 << 8,
  UCODE_EVENT_EXPIRED = 1 << 9,
  UCODE_EVENT_I2C_ERROR = 1 << 10,
  UCODE_EVENT_SPI_ERROR = 1 << 11,
  UCODE_EVENT_SHOCK = 1 << 12,
  UCODE_EVENT_SHAKE = 1 << 13,
  UCODE_EVENT_VIBRATION = 1 << 14,
  UCODE_EVENT_TILT = 1 << 15,
  UCODE_EVENT_SHOCK_CONFIGURED = 1 << 16,
  UCODE_EVENT_SHAKE_CONFIGURED = 1 << 17,
  UCODE_EVENT_VIBRATION_CONFIGURED = 1 << 18,
  UCODE_EVENT_TILT_CONFIGURED = 1 << 19,
  EVENT_TAG_HUMIDITY_CONFIGURED = 1 << 20,
  EVENT_TAG_HUMIDITY_TOO_HIGH = 1 << 21,
  EVENT_TAG_HUMIDITY_TOO_LOW = 1 << 22,
  UCODE_EVENT_COUNT = 23
}
 

Enumeration Type Documentation

◆ UCODE_EVENT_T

The different events that can occur and are tracked.

  • All events that indicate a failure or achievement provide information can co-exist.
  • All events that indicate a state change remain set even when they are superseded with a new state change: e.g. UCODE_EVENT_PRISTINE will remain set after being configured, indicated by bit UCODE_EVENT_CONFIGURED.
Note
This enumeration is shared across multiple demo firmware applications; not all events listed here may be applicable.
Enumerator
UCODE_EVENT_PRISTINE 

0x0000 0001
State change: the IC does not have or no longer has a configuration and contains no data.

UCODE_EVENT_CONFIGURED 

0x0000 0002
State change: the IC is configured, but requires a start trigger to start.

UCODE_EVENT_STARTING 

0x0000 0004
State change: the IC is configured and will make a first measurement after a delay.

UCODE_EVENT_LOGGING 

0x0000 0008
State change: the IC is configured and is logging. At least one sample is available.

UCODE_EVENT_STOPPED 

0x0000 0010
State change: the IC is configured and has been logging. Now it has stopped logging.

UCODE_EVENT_TEMPERATURE_TOO_HIGH 

0x0000 0020
Failure: at least one temperature was strictly higher than the valid maximum value.

UCODE_EVENT_TEMPERATURE_TOO_LOW 

0x0000 0040
Failure: at least one temperature was strictly lower than the valid minimum value.

UCODE_EVENT_BOD 

0x0000 0080
Failure: a brown-out is about to occur or has occurred. Battery is (nearly) depleted.

UCODE_EVENT_FULL 

0x0000 0100
Failure: logging has stopped because no more free space is available to store samples.

UCODE_EVENT_EXPIRED 

0x0000 0200
Achievement: logging has stopped. The logging time was restricted and has been reached: the time spent logging has exceeded the non-zero value, set as part of the configuration.

UCODE_EVENT_I2C_ERROR 

0x0000 0400
Temporary error: The application could not successfully communicate using I2C with an external sensor. Possible causes are

  • a bad connection: this may indicate problems in the layout and manufacturing of the product.
  • a power failure: this may indicate problems in the power supply of the external sensor / IC.
  • a concurrency problem: this may indicate synchronization problems, as the external sensor / IC could not reply.

Depending on environmental conditions this problem is likely to be temporary. When I2C communication is successful next time, this bit is cleared again.

UCODE_EVENT_SPI_ERROR 

0x0000 0800
Temporary error: The application could not successfully communicate using SPI with an external sensor. Possible causes are

  • a bad connection: this may indicate problems in the layout and manufacturing of the product.
  • a power failure: this may indicate problems in the power supply of the external sensor / IC.
  • a concurrency problem: this may indicate synchronization problems, as the external sensor / IC could not reply.

Depending on environmental conditions this problem is likely to be temporary. When SPI communication is successful next time, this bit is cleared again.

UCODE_EVENT_SHOCK 

0x0000 1000
Storage condition notification: the product has received a shock.

UCODE_EVENT_SHAKE 

0x0000 2000
Storage condition notification: the product has been shaken with.

UCODE_EVENT_VIBRATION 

0x0000 4000
Storage condition notification: the product has detected a vibration.

UCODE_EVENT_TILT 

0x0000 8000
Storage condition notification: the product has detected a tilt.

UCODE_EVENT_SHOCK_CONFIGURED 

0x0001 0000
Storage condition notification: the product is configured to detect shocks.

UCODE_EVENT_SHAKE_CONFIGURED 

0x0002 0000
Storage condition notification: the product is configured to detect shaking.

UCODE_EVENT_VIBRATION_CONFIGURED 

0x0004 0000
Storage condition notification: the product is configured to detect vibrations.

UCODE_EVENT_TILT_CONFIGURED 

0x0008 0000
Storage condition notification: the product is configured to detect tilts.

EVENT_TAG_HUMIDITY_CONFIGURED 

0x0010 0000
Storage condition notification: the product is configured to detect humidity.

EVENT_TAG_HUMIDITY_TOO_HIGH 

0x0020 0000
Failure: at least one humidity measurement was strictly higher than the valid maximum value.

EVENT_TAG_HUMIDITY_TOO_LOW 

0x0040 0000
Failure: at least one humidity measurement was strictly lower than the valid minimum value.

UCODE_EVENT_COUNT 

23
Number of possible events. Not to be used as a possible event. Use this in for loops or to define array sizes.