Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
timer_capture.h
Go to the documentation of this file.
1
6#ifndef NEXUS_IO_TIMER_CAPTURE_H
7#define NEXUS_IO_TIMER_CAPTURE_H
8#include "nexus/core/time.h"
9#ifdef __cplusplus
10extern "C" {
11#endif
17
23
24typedef struct {
25 uint32_t tick_hz;
27 size_t pending;
28 uint8_t counter_bits;
29 bool running;
32
33typedef struct {
34 nx_result_t (*start)(void* context, nx_timer_capture_event_t* events,
35 size_t capacity);
36 nx_result_t (*stop)(void* context);
37 nx_result_t (*read)(void* context, nx_timer_capture_event_t* event);
40
41typedef struct {
43 void* context;
45
58 size_t capacity);
87#ifdef __cplusplus
88}
89#endif
90#endif
nx_result_t
Operation result; success at submission means admission only.
Definition status.h:21
Hardware modulo counter and the separate IRQ observation time.
Shared immutable methods; no per-call acquisition or allocation.
nx_result_t(* read)(void *context, nx_timer_capture_event_t *event)
nx_result_t(* stop)(void *context)
nx_result_t(* state)(const void *context, nx_timer_capture_state_t *state)
nx_result_t(* start)(void *context, nx_timer_capture_event_t *events, size_t capacity)
Fixed counter units and current software retention state.
Immutable identity; state and methods outlive calls and IRQs.
const nx_timer_capture_ops_t * ops
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
nx_result_t nx_timer_capture_read(const nx_timer_capture_t *port, nx_timer_capture_event_t *event)
Copy the oldest event in a short saved-mask metadata section.
nx_result_t nx_timer_capture_state(const nx_timer_capture_t *port, nx_timer_capture_state_t *state)
Query counter units and observable queue/loss facts.
nx_result_t nx_timer_capture_start(const nx_timer_capture_t *port, nx_timer_capture_event_t *events, size_t capacity)
Borrow an exact event ring and enable the fixed capture channel.
nx_result_t nx_timer_capture_stop(const nx_timer_capture_t *port)
Disable and read back channel/IRQ sources before returning storage.
nx_timer_capture_flags
Observable loss incidents, not an exact count of physical edges.
@ NX_TIMER_CAPTURE_OVERCAPTURE
@ NX_TIMER_CAPTURE_RING_LOSS