Analog - Comparator - nordic,nrf-comp
nRF5340 COMP (comparator)
Behavioral COMP model: `TASKS_START` fires `EVENTS_READY` (IRQ when enabled). `TASKS_SAMPLE` captures the comparator output. `TASKS_STOP` halts the comparator. SHORTS (READY_SAMPLE, READY_STOP, DOWN_STOP, UP_STOP, CROSS_STOP) and DPPI SUBSCRIBE/PUBLISH are supported. No real analog signal: RESULT always reads 0 (input below threshold); UP/DOWN/CROSS events never fire.
emits: signal_pulseemits: custom
Events emitted
nrf.comp.readyCOMP peripheral is ready and output is valid (EVENTS_READY fired).
Payload
| Field | Type | Description |
|---|---|---|
result | u32 | Comparator result at the time READY fired (0 = below threshold). |
nrf.comp.sampledComparator value was sampled by TASKS_SAMPLE.
Payload
| Field | Type | Description |
|---|---|---|
result | u32 | Comparator RESULT register value at sample time. |
Events accepted
No peripheral-specific input events. The peripheral is driven through MMIO register access.
Commands
This peripheral exposes no commands.
Snapshot fields
| Field | Type | Label |
|---|---|---|
| state_json | str | COMP State (JSON) |
| inten | u32 | INTEN |
| ev_ready | u32 | EVENTS_READY |
| ev_down | u32 | EVENTS_DOWN |
| ev_up | u32 | EVENTS_UP |
| ev_cross | u32 | EVENTS_CROSS |
| enable | u32 | ENABLE |
| running | bool | Running |
| shorts | u32 | SHORTS |
Read at runtime with emulator.peripheral_snapshot(name).