SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk::time::TimerHost::TimerCommand Struct Reference

POD command record passed from the public API methods to the tick task via the command queue. More...

Collaboration diagram for stk::time::TimerHost::TimerCommand:

Public Types

enum  EId : uint8_t {
  CMD_SHUTDOWN = 0 ,
  CMD_START ,
  CMD_STOP ,
  CMD_RESET ,
  CMD_RESTART ,
  CMD_START_OR_RESET ,
  CMD_SET_PERIOD ,
  CMD_ACTIVATE ,
  CMD_CHANGE ,
  CMD_QUERY
}
 Identifies the operation to perform on the target timer. More...

Public Attributes

EId cmd
 command id
Timer * timer
 timer instance
Ticks timestamp
 hw tick count captured at call site
uint32_t delay
 initial delay ticks (CMD_START / CMD_RESTART / CMD_START_OR_RESET / CMD_CHANGE)
uint32_t period
 reload period ticks (CMD_START / CMD_RESTART / CMD_START_OR_RESET / CMD_SET_PERIOD / CMD_CHANGE)
Completion * completion
 completion point of the synchronous caller, nullptr for an asynchronous command

Detailed Description

POD command record passed from the public API methods to the tick task via the command queue.

Each command encodes a single operation together with the timer pointer, a call-site timestamp, and optional delay/period arguments. Commands are produced by the public API (Start, Stop, Reset, …) and consumed exclusively by the tick task inside ProcessCommands(). A command issued by a synchronous API function also carries the completion point of the waiting caller.

Definition at line 866 of file stk_time_timer.h.

Member Enumeration Documentation

◆ EId

Identifies the operation to perform on the target timer.

Enumerator
CMD_SHUTDOWN 

shutdown timer host

CMD_START 

start timer

CMD_STOP 

stop timer

CMD_RESET 

reset timer

CMD_RESTART 

atomic stop + re-start

CMD_START_OR_RESET 

start if inactive, reset deadline if active and periodic

CMD_SET_PERIOD 

change period of a running periodic timer

CMD_ACTIVATE 

start with the delay and period stored in the timer

CMD_CHANGE 

store delay and period of an inactive timer (does not start it)

CMD_QUERY 

fill TimerInfo of the timer (synchronous only)

Definition at line 871 of file stk_time_timer.h.

872 {
873 CMD_SHUTDOWN = 0,
874 CMD_START,
875 CMD_STOP,
876 CMD_RESET,
881 CMD_CHANGE,
882 CMD_QUERY
883 };
@ CMD_QUERY
fill TimerInfo of the timer (synchronous only)
@ CMD_SET_PERIOD
change period of a running periodic timer
@ CMD_CHANGE
store delay and period of an inactive timer (does not start it)
@ CMD_ACTIVATE
start with the delay and period stored in the timer
@ CMD_START_OR_RESET
start if inactive, reset deadline if active and periodic
@ CMD_RESTART
atomic stop + re-start

Member Data Documentation

◆ cmd

EId stk::time::TimerHost::TimerCommand::cmd

command id

Definition at line 885 of file stk_time_timer.h.

Referenced by stk::time::TimerHost::ProcessCommands(), and stk::time::TimerHost::PushCommand().

◆ completion

Completion* stk::time::TimerHost::TimerCommand::completion

completion point of the synchronous caller, nullptr for an asynchronous command

Definition at line 890 of file stk_time_timer.h.

Referenced by stk::time::TimerHost::ProcessCommands(), and stk::time::TimerHost::PushCommand().

◆ delay

uint32_t stk::time::TimerHost::TimerCommand::delay

initial delay ticks (CMD_START / CMD_RESTART / CMD_START_OR_RESET / CMD_CHANGE)

Definition at line 888 of file stk_time_timer.h.

Referenced by stk::time::TimerHost::ProcessCommands().

◆ period

uint32_t stk::time::TimerHost::TimerCommand::period

reload period ticks (CMD_START / CMD_RESTART / CMD_START_OR_RESET / CMD_SET_PERIOD / CMD_CHANGE)

Definition at line 889 of file stk_time_timer.h.

Referenced by stk::time::TimerHost::ProcessCommands().

◆ timer

Timer* stk::time::TimerHost::TimerCommand::timer

timer instance

Definition at line 886 of file stk_time_timer.h.

Referenced by stk::time::TimerHost::ProcessCommands(), and stk::time::TimerHost::PushCommand().

◆ timestamp

Ticks stk::time::TimerHost::TimerCommand::timestamp

hw tick count captured at call site

Definition at line 887 of file stk_time_timer.h.

Referenced by stk::time::TimerHost::ProcessCommands().


The documentation for this struct was generated from the following file: