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::Config Struct Reference

Optional configuration of the timer tasks, see Initialize(). More...

#include <stk_time_timer.h>

Collaboration diagram for stk::time::TimerHost::Config:

Public Member Functions

 Config ()
 Default constructor: default weights, internal stack buffers and ACCESS_USER tick task.

Public Attributes

Weight tick_weight
 Weight of the tick task (default: DEFAULT_WEIGHT).
Weight handler_weight
 Weight of every handler task (default: DEFAULT_WEIGHT).
Word * tick_stack
 Stack of the tick task, or nullptr to use the internal buffer (default).
size_t tick_stack_size
 Size of tick_stack in elements of Word (>= STK_STACK_SIZE_MIN), ignored if tick_stack is nullptr.
Word * handler_stack [1U]
 Stack of each handler task, a nullptr entry selects the internal buffer (default).
size_t handler_stack_size
 Size of every non-null handler_stack entry in elements of Word (>= STK_STACK_SIZE_MIN).
EAccessMode tick_mode
 Access mode of the tick task (default: ACCESS_USER). The tick task only touches host state, but a host used from privileged code (e.g. an RTOS compatibility layer) may need ACCESS_PRIVILEGED.

Detailed Description

Optional configuration of the timer tasks, see Initialize().

A default-constructed Config reproduces the fixed behavior of TimerHost: DEFAULT_WEIGHT for all tasks and the internal stack buffers.

Note
Weights are strategy-specific and forwarded to the kernel as is (see "Scheduling weights" in TimerHost). Only NO_WEIGHT is rejected here, all other validation is performed by the kernel and its task-switching strategy when the task is added.
Externally supplied stack buffers must outlive the host, be distinct from each other (the kernel rejects a duplicate stack with ADD_FAIL_DUPLICATE), and satisfy the stack alignment and memory protection requirements of the platform (the internal buffers, see StackMemoryDef, already do).

Definition at line 501 of file stk_time_timer.h.

Constructor & Destructor Documentation

◆ Config()

stk::time::TimerHost::Config::Config ( )
inlineexplicit

Default constructor: default weights, internal stack buffers and ACCESS_USER tick task.

Definition at line 513 of file stk_time_timer.h.

516 {}
@ ACCESS_USER
Unprivileged access mode (access to some hardware is restricted, see CPU manual for details)....
Definition stk_common.h:37
static constexpr Weight DEFAULT_WEIGHT
Weight value: default weight of value (1) (see SwitchStrategySmoothWeightedRoundRobin).
Definition stk_common.h:290
Weight handler_weight
Weight of every handler task (default: DEFAULT_WEIGHT).
size_t handler_stack_size
Size of every non-null handler_stack entry in elements of Word (>= STK_STACK_SIZE_MIN).
EAccessMode tick_mode
Access mode of the tick task (default: ACCESS_USER). The tick task only touches host state,...
size_t tick_stack_size
Size of tick_stack in elements of Word (>= STK_STACK_SIZE_MIN), ignored if tick_stack is nullptr.
Word * tick_stack
Stack of the tick task, or nullptr to use the internal buffer (default).
Weight tick_weight
Weight of the tick task (default: DEFAULT_WEIGHT).
Word * handler_stack[1U]
Stack of each handler task, a nullptr entry selects the internal buffer (default).

References stk::ACCESS_USER, stk::DEFAULT_WEIGHT, handler_stack, handler_stack_size, handler_weight, tick_mode, tick_stack, tick_stack_size, and tick_weight.

Member Data Documentation

◆ handler_stack

Word* stk::time::TimerHost::Config::handler_stack[1U]

Stack of each handler task, a nullptr entry selects the internal buffer (default).

Definition at line 507 of file stk_time_timer.h.

Referenced by Config(), stk::time::TimerHost::Initialize(), and stk_timerhost_init_ex().

◆ handler_stack_size

size_t stk::time::TimerHost::Config::handler_stack_size

Size of every non-null handler_stack entry in elements of Word (>= STK_STACK_SIZE_MIN).

Definition at line 508 of file stk_time_timer.h.

Referenced by Config(), stk::time::TimerHost::Initialize(), and stk_timerhost_init_ex().

◆ handler_weight

Weight stk::time::TimerHost::Config::handler_weight

Weight of every handler task (default: DEFAULT_WEIGHT).

Definition at line 504 of file stk_time_timer.h.

Referenced by Config(), cy_rtos_stk_kernel_init(), stk::time::TimerHost::Initialize(), and stk_timerhost_init_ex().

◆ tick_mode

EAccessMode stk::time::TimerHost::Config::tick_mode

Access mode of the tick task (default: ACCESS_USER). The tick task only touches host state, but a host used from privileged code (e.g. an RTOS compatibility layer) may need ACCESS_PRIVILEGED.

Definition at line 509 of file stk_time_timer.h.

Referenced by Config(), cy_rtos_stk_kernel_init(), and stk::time::TimerHost::Initialize().

◆ tick_stack

Word* stk::time::TimerHost::Config::tick_stack

Stack of the tick task, or nullptr to use the internal buffer (default).

Definition at line 505 of file stk_time_timer.h.

Referenced by Config(), stk::time::TimerHost::Initialize(), and stk_timerhost_init_ex().

◆ tick_stack_size

size_t stk::time::TimerHost::Config::tick_stack_size

Size of tick_stack in elements of Word (>= STK_STACK_SIZE_MIN), ignored if tick_stack is nullptr.

Definition at line 506 of file stk_time_timer.h.

Referenced by Config(), stk::time::TimerHost::Initialize(), and stk_timerhost_init_ex().

◆ tick_weight

Weight stk::time::TimerHost::Config::tick_weight

Weight of the tick task (default: DEFAULT_WEIGHT).

Definition at line 503 of file stk_time_timer.h.

Referenced by Config(), cy_rtos_stk_kernel_init(), stk::time::TimerHost::Initialize(), and stk_timerhost_init_ex().


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