Skip to main content

Enumerations

All enumerations are defined in Inc/npz.h unless noted. HAL status codes are defined in Inc/npz_hal.h.


HAL Status

npz_status_e

File: npz_hal.h

Return type for all HAL and register-access functions.

EnumeratorValueDescription
OK0x00Operation completed successfully.
ERR0x01I2C transaction or peripheral error.
INVALID_PARAM0x02A parameter was invalid or out of range.

System / Device

npz_resetsource_e

Source of the last device reset, read from npz_register_sta1_s.reset_source.

EnumeratorValueDescription
RESETSOURCE_NONE0x00No reset.
RESETSOURCE_PWR_RESET0x01Power-on reset.
RESETSOURCE_EXT_RESET0x02External reset via RST pin.
RESETSOURCE_SOFT_RESET0x04Software reset via I²C command (0xA5).

npz_host_power_mode_e

Behavior of the SW_HP host power switch pin.

EnumeratorValueDescription
HOST_POWER_MODE_SWITCH0x01Power switch: outputs VBAT when host is enabled, open otherwise.
HOST_POWER_MODE_LOGIC_OUTPUT0x02Logic output: high when host is enabled.
HOST_POWER_MODE_LOGIC_OUTPUT_INV0x03Logic output inverted: low when host is enabled.

npz_psw_e

Selects a peripheral slot (low-power switch). Used in all peripheral register functions.

EnumeratorValueDescription
PSW_LP10x01Peripheral 1.
PSW_LP20x02Peripheral 2.
PSW_LP30x03Peripheral 3.
PSW_LP40x04Peripheral 4.

npz_wakeup_e

Controls whether any single trigger or all triggers must fire to wake the host.

EnumeratorValueDescription
WAKEUP_ANY0x00Wake on any enabled trigger.
WAKEUP_ALL0x01Require all enabled triggers to fire before waking.

npz_states_e

Generic enabled/disabled state.

EnumeratorValue
DISABLED0x00
ENABLED0x01

Clock

npz_sclk_sel_e

System clock source.

EnumeratorValueDescription
SYS_CLOCK_10HZ0x00Internal slow oscillator (~10 Hz).
SYS_CLOCK_32KHZ0x01Crystal oscillator (~16 Hz generated from 32.768 kHz source).

npz_sclk_div_e

System clock divider.

EnumeratorValueDescription
SCLK_DIV_DISABLE0x00No division.
SCLK_DIV_20x01Divide by 2.
SCLK_DIV_40x03Divide by 4.
SCLK_DIV_80x05Divide by 8.
SCLK_DIV_160x07Divide by 16.

npz_adc_clk_e

ADC sampling frequency.

EnumeratorValueDescription
ADC_CLK_SC0x00System clock (default).
ADC_CLK_640x01XO ÷ 512 = 64 Hz.
ADC_CLK_2560x02XO ÷ 128 = 256 Hz.
ADC_CLK_10240x03XO ÷ 32 = 1024 Hz.
note

XO-derived ADC clocks (ADC_CLK_64, ADC_CLK_256, ADC_CLK_1024) require system_clock_source = SYS_CLOCK_32KHZ.


npz_xo_clkout_div_e

CLK_OUT pin frequency (crystal oscillator output).

EnumeratorValueFrequency
XO_CLK_OFF0x00Disabled.
XO_CLK_32K0x0132 kHz (÷1).
XO_CLK_16K0x0216 kHz (÷2).
XO_CLK_8K0x038 kHz (÷4).
XO_CLK_4K0x044 kHz (÷8).
XO_CLK_2K0x052 kHz (÷16).
XO_CLK_1K0x061 kHz (÷32).

Peripheral Configuration

npz_power_mode_e

Peripheral power supply mode.

EnumeratorValueDescription
POWER_MODE_DISABLED0x00Peripheral power off; slot unused.
POWER_MODE_PERIODIC0x01Power on periodically for each poll cycle.
POWER_MODE_ALWAYS_ON0x03Power permanently on.

npz_polling_mode_e

How the nPZero interacts with the peripheral each cycle.

EnumeratorValueDescription
POLLING_MODE_PERIODIC_READ_COMPARE_THRESHOLD0x00Init → read → compare against threshold.
POLLING_MODE_PERIODIC_WAIT_INTERRUPT_COMPARE_THRESHOLD0x01Init → wait for INT → read → compare.
POLLING_MODE_PERIODIC_WAIT_INTERRUPT0x02Init → wait for INT (no data read or compare).
POLLING_MODE_ASYNC_WAIT_INTERRUPT0x03Wait for asynchronous interrupt only.

npz_power_switch_mode_e

Behavior of the SW_LP peripheral power switch pin.

EnumeratorValueDescription
POWER_SWITCH_MODE_STANDARD0x01Standard power switch.
POWER_SWITCH_MODE_LOGIC_OUTPUT_HIGH0x02Logic output: high when peripheral enabled.
POWER_SWITCH_MODE_LOGIC_OUTPUT_LOW0x03Logic output inverted: low when peripheral enabled.

npz_interrupt_pin_mode_e

Mode of the INT interrupt pin for the peripheral.

EnumeratorValueDescription
INTERRUPT_PIN_MODE_INPUT_ACTIVE_HIGH0x00Input — asserted high by the peripheral.
INTERRUPT_PIN_MODE_INPUT_ACTIVE_LOW0x01Input — asserted low by the peripheral.
INTERRUPT_PIN_MODE_TRIGGER_OUTPUT_HIGH0x02Output — Active high trigger.
INTERRUPT_PIN_MODE_TRIGGER_OUTPUT_LOW0x03Output — Active low trigger.

npz_comparison_mode_e

How over/under thresholds define the trigger condition.

EnumeratorValueDescription
COMPARISON_MODE_INSIDE_THRESHOLD0x00Triggers when value ≥ over threshold OR ≤ under threshold.
COMPARISON_MODE_OUTSIDE_THRESHOLD0x01Triggers when value < over threshold AND > under threshold.

npz_data_type_e

Data type of the value read from the peripheral.

EnumeratorValueDescription
DATA_TYPE_UINT160x0016-bit unsigned integer.
DATA_TYPE_INT160x0116-bit signed integer.
DATA_TYPE_UINT80x028-bit unsigned integer.

npz_com_protocol_e

Communication protocol for the peripheral.

EnumeratorValueDescription
COM_I2C0x00I2C — use i2c_cfg union member.
COM_SPI0x01SPI — use spi_cfg union member.

npz_endianess_e

Byte order of the 16-bit value read from the peripheral.

EnumeratorValueDescription
ENDIAN_LITTLE0x00Low byte at RREGP, high byte at RREGP+1.
ENDIAN_BIG0x01High byte at RREGP, low byte at RREGP+1.

npz_multibyte_e

Multi-byte I2C transfer mode.

EnumeratorValueDescription
MULTIBYTE_TRANSFER_DISABLE0x00Each init command sent as separate I2C transaction.
MULTIBYTE_TRANSFER_ENABLE0x01Sequential register addresses sent as a single multi-byte write.

npz_spimod_e

SPI clock polarity and phase.

EnumeratorValueCPOLCPHA
SPIMOD_SPI_MODE_00x0000
SPIMOD_SPI_MODE_10x0101
SPIMOD_SPI_MODE_20x0210
SPIMOD_SPI_MODE_30x0311

Wait Time

npz_pre_wait_time_e

Wait time inserted before peripheral initialization sequence.

EnumeratorValueDuration
PRE_WAIT_TIME_DISABLED0x00No pre-init wait.
PRE_WAIT_TIME_EXTEND_2560x01TWTP x 256 periods of internal 400 kHz clock.
PRE_WAIT_TIME_EXTEND_40960x03TWTP x 4096 periods of internal 400 kHz clock.

npz_post_wait_time_e

Wait time inserted after peripheral initialization sequence.

EnumeratorValueDuration
POST_WAIT_TIME_DISABLED0x00No post-init wait.
POST_WAIT_TIME_EXTEND_2560x01TWTP x 256 periods of internal 400 kHz clock.
POST_WAIT_TIME_EXTEND_40960x03TWTP x 4096 periods of internal 400 kHz clock.

I/O Pin Configuration

npz_io_str_e

I/O output strength.

EnumeratorValueDescription
IO_STR_NORMAL0x00Normal push/pull strength.
IO_STR_HIGH0x01High push/pull strength.

npz_i2c_pull_sel_e

Internal I2C pull-up resistor (~40 kΩ) control.

EnumeratorValueDescription
I2C_PULL_DISABLE0x00Pull-ups always disabled.
I2C_PULL_ALWAYS_ON0x01Pull-ups always enabled.
I2C_PULL_AUTO0x03Pull-ups enabled in active mode, disabled in idle.

npz_spi_auto_e

SPI pin state when the interface is idle.

EnumeratorValueDescription
SPI_PINS_ALWAYS_ON0x00SPI pins always driven.
SPI_PINS_AUTO_DISABLE0x01SPI pins high-Z when interface is not in use (idle).

npz_int_pin_pull_e

Internal pull-up configuration for INT interrupt input pins.

EnumeratorValueDescription
INT_PIN_PULL_DISABLED0x00No internal pull-up.
INT_PIN_PULL_LOW0x01Low-strength pull-up enabled.
INT_PIN_PULL_HIGH0x03High-strength pull-up enabled.