Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
adc_observer.h
Go to the documentation of this file.
1
6#ifndef NEXUS_IO_ADC_OBSERVER_H
7#define NEXUS_IO_ADC_OBSERVER_H
8
9#include "nexus/core/time.h"
10#include "nexus/io/stream.h"
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#define NX_ADC_OBSERVATION_DISCONTINUITY 1U
16
24typedef struct {
25 uint64_t epoch;
27 uint64_t sequence;
28 uint32_t flags;
30
45
54 nx_adc_observation_t* records,
55 size_t count);
66 nx_stream_t* stream, const void* owner,
67 size_t owner_size);
76 const nx_stream_fill_t* fill,
77 nx_time_us_t observed_at);
86 const nx_stream_block_t* block,
87 nx_adc_observation_t* observation);
94#ifdef __cplusplus
95}
96#endif
97#endif
nx_result_t nx_adc_observer_unbind(nx_adc_observer_t *observer)
Provider-only unbind after all producer/consumer loans join.
nx_result_t nx_adc_observer_initialize(nx_adc_observer_t *observer, nx_adc_observation_t *records, size_t count)
Initialize fresh unborrowed optional observation storage.
nx_result_t nx_adc_observer_bind(nx_adc_observer_t *observer, nx_stream_t *stream, const void *owner, size_t owner_size)
Provider-only cold bind validates every metadata/payload span before the first DMA loan.
nx_result_t nx_adc_observer_record(nx_adc_observer_t *observer, const nx_stream_fill_t *fill, nx_time_us_t observed_at)
Provider-only record before matching release-publication.
nx_result_t nx_adc_observer_read(const nx_adc_observer_t *observer, const nx_stream_block_t *block, nx_adc_observation_t *observation)
Read only a currently acquired block's exact epoch record.
nx_result_t
Operation result; success at submission means admission only.
Definition status.h:21
Bounded caller-owned blocks with explicit producer/consumer loans.
One loan's software observation, never a sample aperture.
nx_time_us_t observed_at
Optional caller-owned observer control and exact records.
nx_stream_t * stream
nx_adc_observation_t * records
Immutable consumer loan, valid until matching release succeeds.
Definition stream.h:86
Mutable producer loan; hardware must stop before abort or publish.
Definition stream.h:65
Caller-owned stream control, initialized before publication.
Definition stream.h:53
Absolute monotonic microsecond deadlines and wrap extension.
uint64_t nx_time_us_t
Microseconds in one boot/clock domain; no wall-clock semantics.
Definition time.h:20