RadioRxCapture class final
#include <npr/phy/radio_rx_capture.hpp>
SI4463 RX capture helper that translates IRQ/FIFO state into packet callbacks.
Core idea:
- Keep ISR minimal: IRQ edge timestamp is captured by ISR and consumed later.
- Actual SPI/FIFO work stays in worker context (
capture()), never in ISR. - Capture path is resilient to missed edges by combining IRQ-edge hint with periodic polling fallback.
- Packet timestamp can be derived either from
now_usor from sync-top reference (now_us - rx_sync_to_top_us), therefore consecutive packet timestamps are not guaranteed to be strictly monotonic.
Public types
- enum class CaptureStatus: uint8_t { NoData = 0u, Captured, RadioError }
- Capture operation status.
- using PacketCallback = void(*)(void*user_data, const uint8_t*packet, size_t packet_size, uint64_t packet_time_us, bool rssi_valid, uint8_t rssi)
- Callback invoked for each fully captured packet.
Public functions
- auto capture(Si4463Device& radio, const RadioProfile& profile, NprDiagnostics& diagnostics, uint64_t now_us, PacketCallback callback, void* user_data) -> CaptureStatus
- Polls radio IRQ/FIFO and emits zero or more packets through callback.
- void notify_irq_edge(uint32_t edge_time_us32)
- ISR hook: stores first pending NIRQ falling-edge timestamp for precise RX timing reference.
- void reset(uint64_t now_us, bool irq_pin_present)
- Resets capture state at runtime startup/recovery.
Function documentation
CaptureStatus npr:: rf:: RadioRxCapture:: capture(Si4463Device& radio,
const RadioProfile& profile,
NprDiagnostics& diagnostics,
uint64_t now_us,
PacketCallback callback,
void* user_data)
Polls radio IRQ/FIFO and emits zero or more packets through callback.
| Returns | Capture status for current poll iteration. |
|---|
void npr:: rf:: RadioRxCapture:: notify_irq_edge(uint32_t edge_time_us32)
ISR hook: stores first pending NIRQ falling-edge timestamp for precise RX timing reference.
Additional edges are coalesced until worker consumes the pending one.