pub type StaticStoppedTimer = StaticKernelObject<k_timer>;
Expand description
A statically allocated k_timer
(StoppedTimer).
This is intended to be used from within the kobj_define!
macro. It declares a static
k_timer
that will be properly registered with the Zephyr object system (and can be used from
userspace). Call [init_once
] to get the StoppedTimer
that it represents.
Aliased Type§
struct StaticStoppedTimer {
pub value: UnsafeCell<k_timer>,
pub init: AtomicUsize,
}
Fields§
§value: UnsafeCell<k_timer>
The underlying zephyr kernel object.
init: AtomicUsize
Initialization status of this object. Most objects will start uninitialized and be initialized manually.
Implementations
Source§impl<T> StaticKernelObject<T>where
StaticKernelObject<T>: Wrapped,
impl<T> StaticKernelObject<T>where
StaticKernelObject<T>: Wrapped,
Sourcepub const unsafe fn new() -> StaticKernelObject<T>
pub const unsafe fn new() -> StaticKernelObject<T>
Construct an empty of these objects, with the zephyr data zero-filled.
§Safety
This is safe in the sense that Zephyr we track the initialization, they start in the uninitialized state, and the zero value of the initialize atomic indicates that it is uninitialized.
Sourcepub fn init_once(
&self,
args: <Self as Wrapped>::I,
) -> Option<<Self as Wrapped>::T>
pub fn init_once( &self, args: <Self as Wrapped>::I, ) -> Option<<Self as Wrapped>::T>
Get the instance of the kernel object.
Will return a single wrapped instance of this object. This will invoke the initialization,
and return Some<Wrapped>
for the wrapped containment type.
If it is called an additional time, it will return None.
Trait Implementations
Source§impl Wrapped for StaticKernelObject<k_timer>
impl Wrapped for StaticKernelObject<k_timer>
Source§type T = StoppedTimer
type T = StoppedTimer
init_once()
on the StaticKernelObject will return after
initialization.