LibJuno 1.0.4
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno_sch_api.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
17
33#ifndef JUNO_SCH_API_H
34#define JUNO_SCH_API_H
35#include "juno/app/app_api.h"
36#include "juno/status.h"
37#include "juno/module.h"
38#include "juno/time/time_api.h"
39#include "juno/types.h"
40#ifdef __cplusplus
41extern "C"
42{
43#endif
44
46
47typedef struct JUNO_SCH_ROOT_TAG JUNO_SCH_ROOT_T;
48
56// @{"req": ["REQ-SCH-003"]}
57#define JUNO_SCH_TABLE_NEW(ptArrName, zAppsPerMinorFrame, zNumMinorFrames, ...) \
58JUNO_APP_ROOT_T *ptArrName[zNumMinorFrames * zAppsPerMinorFrame] = {__VA_ARGS__}
59
61// @{"req": ["REQ-SCH-001", "REQ-SCH-007"]}
62struct JUNO_SCH_ROOT_TAG JUNO_MODULE_ROOT(JUNO_SCH_API_T,
63 JUNO_TIME_ROOT_T *ptTime;
64 JUNO_APP_ROOT_T **ptArrSchTable;
65 size_t zAppsPerMinorFrame;
66 size_t zNumMinorFrames;
67 JUNO_TIMESTAMP_T tMinorFramePeriod;
68);
69
70// @{"req": ["REQ-SCH-002"]}
72{
74 // @{"req": ["REQ-SCH-004"]}
77 // @{"req": ["REQ-SCH-005"]}
78 JUNO_TIMESTAMP_RESULT_T (*GetMinorFramePeriod)(JUNO_SCH_ROOT_T *ptJunoSch);
80 // @{"req": ["REQ-SCH-006"]}
81 JUNO_TIMESTAMP_RESULT_T (*GetMajorFramePeriod)(JUNO_SCH_ROOT_T *ptJunoSch);
82};
83
84#ifdef __cplusplus
85}
86#endif
87#endif // JUNO_SCH_API_H
Application module API (start/process/exit lifecycle).
struct JUNO_APP_ROOT_TAG JUNO_APP_ROOT_T
The application module.
Definition app_api.h:50
#define JUNO_MODULE_ROOT(API_T,...)
Implement a module root struct containing ptApi and failure fields.
Definition module.h:129
int32_t JUNO_STATUS_T
Canonical status type for LibJuno functions.
Definition status.h:51
struct JUNO_TIME_ROOT_TAG JUNO_TIME_ROOT_T
Definition time_api.h:69
struct JUNO_SCH_ROOT_TAG JUNO_SCH_ROOT_T
Definition juno_sch_api.h:47
Module system and dependency injection primitives for LibJuno.
Status codes and failure-handling helpers for LibJuno.
Definition juno_sch_api.h:72
JUNO_TIMESTAMP_RESULT_T(* GetMajorFramePeriod)(JUNO_SCH_ROOT_T *ptJunoSch)
Compute the major frame period (minor * count).
Definition juno_sch_api.h:81
JUNO_TIMESTAMP_RESULT_T(* GetMinorFramePeriod)(JUNO_SCH_ROOT_T *ptJunoSch)
Get the configured minor frame period.
Definition juno_sch_api.h:78
JUNO_STATUS_T(* Execute)(JUNO_SCH_ROOT_T *ptJunoSch)
Run the scheduler for one major frame.
Definition juno_sch_api.h:75
Timestamp consisting of whole seconds and fixed-point subseconds.
Definition time_api.h:106
Juno Time module API and common time math helpers.
Common module result type aliases used throughout LibJuno.