Lazuli
Loading...
Searching...
No Matches
lazuli.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-only
3 * This file is part of Lazuli.
4 */
5
16#ifndef LAZULI_LAZULI_H
17#define LAZULI_LAZULI_H
18
19#include <stdint.h>
20
21#include <Lazuli/common.h>
22#include <Lazuli/config.h>
23
25
31
37
42
43/*
44 * TODO: See if we should rename the policies macro constants as LZ_POLICY_XXX
45 * or LZ_SCHEDULING_POLICY_XXX.
46 */
47
51#define CYCLIC_RT ((lz_scheduling_policy_t)0U)
52
58#define PRIORITY_RT ((lz_scheduling_policy_t)1U)
59
63#define LZ_SCHEDULING_POLICY_MAX PRIORITY_RT
64
107
125bool
126Lz_RegisterTask(void (* const taskEntryPoint)(void),
127 Lz_TaskConfiguration * taskConfiguration);
128
139void
140Lz_TaskConfiguration_Init(Lz_TaskConfiguration * const taskConfiguration);
141
147void
148Lz_Run(void);
149
159void
160Lz_Task_WaitInterrupt(uint8_t interruptCode);
161
168char const *
169Lz_Task_GetName(void);
170
180void
182
191void
193
211void
213
215
216#endif /* LAZULI_LAZULI_H */
unsigned int uint16_t
Represents a unsigned integer type with width of exactly 16 bits.
Definition stdint.h:94
unsigned char uint8_t
Represents a unsigned integer type with width of exactly 8 bits.
Definition stdint.h:89
char int8_t
Represents a signed integer type with width of exactly 8 bits.
Definition stdint.h:27
Basic type definitions and useful macros.
#define _EXTERN_C_DECL_BEGIN
Open C++ header file declarations.
Definition common.h:39
#define _EXTERN_C_DECL_END
Close C++ header file declarations.
Definition common.h:44
Include appropriate config file.
void Lz_TaskConfiguration_Init(Lz_TaskConfiguration *const taskConfiguration)
Initialize an Lz_TaskConfiguration with default values for all parameters.
Definition scheduler.c:752
void Lz_WaitTimer(lz_u_resolution_unit_t units)
Set the calling task to wait for the specified number of time resolution units (time slices),...
Definition scheduler.c:810
void Lz_Task_WaitInterrupt(uint8_t interruptCode)
Wait for a specific interrupt to occur.
Definition scheduler.c:799
void Lz_Task_WaitActivation(void)
Set the calling task to wait for its next activation.
Definition scheduler.c:791
uint8_t lz_scheduling_policy_t
Represents the type used for scheduling policies of a Lazuli user task.
Definition lazuli.h:41
void Lz_Task_Terminate(void)
Terminate the calling task.
Definition scheduler.c:821
void Lz_Run(void)
Run the scheduler.
Definition scheduler.c:771
int8_t lz_task_priority_t
Represents the priority of a task, as a signed integer.
Definition lazuli.h:30
bool Lz_RegisterTask(void(*const taskEntryPoint)(void), Lz_TaskConfiguration *taskConfiguration)
Register a new task.
Definition scheduler.c:764
char const * Lz_Task_GetName(void)
Get the name of the calling task.
Definition scheduler.c:785
uint16_t lz_u_resolution_unit_t
Represents the type used for the system clock resolution unit, as an unsigned integer.
Definition lazuli.h:36
Represents the configuration of a task.
Definition lazuli.h:68
lz_scheduling_policy_t schedulingPolicy
The scheduling policy of the task.
Definition lazuli.h:84
char const * name
A pointer to an allocated const string containing the name to give to the task.
Definition lazuli.h:74
lz_u_resolution_unit_t completion
The completion time (C) of the task (worst case execution time).
Definition lazuli.h:105
lz_task_priority_t priority
The priority of task.
Definition lazuli.h:90
size_t stackSize
The size of the stack needed by the task.
Definition lazuli.h:79
lz_u_resolution_unit_t period
The period (T) of the task.
Definition lazuli.h:97