![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Interface for a platform driver. More...
#include <stk_common.h>
Classes | |
| class | IEventHandler |
| Interface for a back-end event handler. More... | |
| class | IEventOverrider |
| Interface for a platform event overrider. More... | |
Public Member Functions | |
| virtual void | Initialize (IEventHandler *event_handler, IKernelService *service, uint32_t resolution_us, Stack *exit_trap)=0 |
| Initialize scheduler's context. | |
| virtual void | Start ()=0 |
| Start scheduling. | |
| virtual void | Stop ()=0 |
| Stop scheduling. | |
| virtual bool | InitStack (EStackType stack_type, Stack *stack, IStackMemory *stack_memory, ITask *user_task)=0 |
| Initialize stack memory of the user task. | |
| virtual uint32_t | GetTickResolution () const =0 |
| Get resolution of the system tick timer in microseconds. Resolution means a number of microseconds between system tick timer ISRs. | |
| virtual void | SwitchToNext ()=0 |
| Switch to a next task. | |
| virtual void | Sleep (Timeout ticks)=0 |
| Put calling process into a sleep state. | |
| virtual void | SleepUntil (Ticks timestamp)=0 |
| Put calling process into a sleep state until the specified timestamp. | |
| virtual void | ProcessTick ()=0 |
| Process one tick. | |
| virtual void | ProcessHardFault ()=0 |
| Cause a hard fault of the system. | |
| virtual void | SetEventOverrider (IEventOverrider *overrider)=0 |
| Set platform event overrider. | |
| virtual Word | GetCallerSP () const =0 |
| Get caller's Stack Pointer (SP). | |
| virtual TId | GetTid () const =0 |
| Get thread Id. | |
Interface for a platform driver.
Platform driver represents an underlying hardware and implements the following logic:
All functions are called by the kernel implementation.
Definition at line 574 of file stk_common.h.
|
pure virtual |
Get caller's Stack Pointer (SP).
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Get resolution of the system tick timer in microseconds. Resolution means a number of microseconds between system tick timer ISRs.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Get thread Id.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Initialize scheduler's context.
| [in] | event_handler | Event handler. |
| [in] | service | Kernel service. |
| [in] | resolution_us | Tick resolution in microseconds (for example 1000 equals to 1 millisecond resolution). |
| [in] | exit_trap | Stack of the Exit trap (optional, provided if kernel is operating in KERNEL_DYNAMIC mode). |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Initialize stack memory of the user task.
| [in] | stack_type | Stack type. |
| [in] | stack | Stack descriptor. |
| [in] | stack_memory | Stack memory. |
| [in] | user_task | User task to which Stack belongs. |
true on success, false if the stack memory is too small, misaligned, or the stack type is unsupported. Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Cause a hard fault of the system.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtHardFailDeadline().
|
pure virtual |
Process one tick.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Set platform event overrider.
| [in] | overrider | Platform event overrider. |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Put calling process into a sleep state.
| [in] | ticks | Time to sleep (ticks). |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Put calling process into a sleep state until the specified timestamp.
| [in] | timestamp | Absolute timestamp (ticks). |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Start scheduling.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Stop scheduling.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.
|
pure virtual |
Switch to a next task.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, stk::PlatformX86Win32, and stk::test::PlatformTestMock.