Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Precision Timing Shell APIs. More...

Data Structures

struct  precision_timing_shell_entry
 Immutable shell registration for a lifetime-static precision clock. More...

Macros

#define PRECISION_TIMING_SHELL_REGISTER(_name, clock_ptr)
 Statically register a precision clock with the precision timing shell.

Detailed Description

Precision Timing Shell APIs.

Since
4.6
Version
0.1.0

Macro Definition Documentation

◆ PRECISION_TIMING_SHELL_REGISTER

#define PRECISION_TIMING_SHELL_REGISTER ( _name,
clock_ptr )

#include <zephyr/precision_timing/precision_timing_shell.h>

Value:
_precision_timing_shell_##_name) = { \
.name = STRINGIFY(_name), \
.clock = (clock_ptr), \
}
#define STRUCT_SECTION_ITERABLE(struct_type, varname)
Defines a new element for an iterable section.
Definition iterable_sections.h:244
Immutable shell registration for a lifetime-static precision clock.
Definition precision_timing_shell.h:33

Statically register a precision clock with the precision timing shell.

Defines an immutable, linker-collected registry entry that exposes clock_ptr under the name _name in the precision_clock shell command. The _name identifier is converted to a string literal and must be a valid C identifier composed of ASCII letters, digits, and underscores. Duplicate names are not detected at compile time; avoid them, because the shell reports the first matching entry.

The clock object referenced by clock_ptr must have static storage duration (for example, a file-scope or static object). Its precision_clock::api pointer may be NULL until the owning adapter initializes it. The name is still listed, but commands that use the clock return -ENODEV. Initialize the adapter before allowing concurrent shell access; do not reinitialize it afterwards.

Place this macro at file scope, not inside a function. It emits no registry entry when CONFIG_PRECISION_TIMING_SHELL is disabled.

Parameters
_nameUnique shell instance name (C identifier). Converted to a string.
clock_ptrPointer to a lifetime-static Precision Clock.