Skip to main content

Enums

Enumerations (enums) define named states for bit-fields. They are defined globally to allow reuse across multiple registers.

Enum Object Structure

FieldRequiredTypeDescription
symbolYesStringThe programmatic name for the Enum type. Must be PascalCase or UPPER_CASE.
valuesYesList[ValueObj]A list of named values belonging to this enum.

Enum Value Object

FieldRequiredTypeDescription
nameYesStringThe human-readable name of the state. Used to generate the enum member name.
valueYesIntegerThe raw integer value of the state. Supports 0x for hexadecimal, 0b for binary, or decimal.
descriptionRecommendedStringDocumentation for this specific state.

Example:

enums:
- symbol: Gain
values:
- name: Gain 1x
value: 0b00
description: "Standard gain setting."
- name: Gain 8x
value: 0b11
description: "High sensitivity mode."