Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
threads.h
Go to the documentation of this file.
1
5// do not use pragma once here, has this can be mocked
6#ifndef HAL_THREADS_H
7#define HAL_THREADS_H
8
9#ifdef __cplusplus
10
11#include <cstddef>
12#include <cstdint>
13
14namespace lampda {
15namespace hal {
17namespace threads {
18
19static constexpr size_t MaxStaticTasks = 32;
20
21extern "C" {
22#endif
23
24 typedef uint32_t TaskBuffer_t;
25
26 typedef void (*taskfunc_t)(void);
27 typedef void* TaskHandle_t;
28
39 uint32_t HAL_create_thread(TaskHandle_t* handle,
40 taskfunc_t task,
41 char const* const name,
42 const int priority,
43 const int stackSize,
44 TaskBuffer_t* buffer,
45 const int startSuspended);
46
48 void HAL_yield();
49
52
59 int HAL_wait_notification(const int timeout_ms);
60
62 void HAL_notify_thread(TaskHandle_t handle, int wakeUpEvent);
63
65 void HAL_suspend_thread(TaskHandle_t handle);
66
68 int HAL_is_suspended(TaskHandle_t handle);
69
71 void HAL_resume_thread(TaskHandle_t handle);
72
74 uint32_t HAL_get_task_high_water_mark_byte(TaskHandle_t handle);
75
77 void HAL_get_debug_thread_text(char* textBuff);
78
81
82#ifdef __cplusplus
83}
84
85} // namespace: threads
86} // namespace: hal
87} // namespace: lampda
88#endif
89
90#endif
void HAL_shutdown()
Shutdown the thread HAL.
int HAL_wait_notification(const int timeout_ms)
Put this thread in suspended mode, waiting for a notification. This function wil block execution unti...
void HAL_suspend_thread(TaskHandle_t handle)
Suspend the target thread.
void HAL_get_debug_thread_text(char *textBuff)
Given a buffer, return a buffer debug text.
void HAL_yield()
Yield this thread.
void HAL_resume_thread(TaskHandle_t handle)
Resume a suspended thread.
uint32_t HAL_create_thread(TaskHandle_t *handle, taskfunc_t task, char const *const name, const int priority, const int stackSize, TaskBuffer_t *buffer, const int startSuspended)
Create a thread from the given function and return the associated handle.
uint32_t HAL_get_task_high_water_mark_byte(TaskHandle_t handle)
Return a task stack high water mark in bytes.
void HAL_suspend()
Suspend this thread.
void HAL_notify_thread(TaskHandle_t handle, int wakeUpEvent)
Notify a thread with a value.
int HAL_is_suspended(TaskHandle_t handle)
Return 0 if thread is suspended.
Program scope.
Definition: control_fixed_modes.hpp:12