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 <cstdint>
12
13namespace lampda {
14namespace hal {
16namespace threads {
17
18extern "C" {
19#endif
20
21 typedef void (*taskfunc_t)(void);
22 typedef void* TaskHandle_t;
23
34 uint32_t HAL_create_thread(TaskHandle_t* const handle,
35 taskfunc_t task,
36 char const* const name,
37 const int priority,
38 const int stackSize,
39 const int startSuspended);
40
42 void HAL_yield();
43
45 void HAL_suspend();
46
53 int HAL_wait_notification(const int timeout_ms);
54
56 void HAL_notify_thread(TaskHandle_t handle, int wakeUpEvent);
57
59 void HAL_suspend_thread(TaskHandle_t handle);
60
62 int HAL_is_suspended(TaskHandle_t handle);
63
65 void HAL_resume_thread(TaskHandle_t handle);
66
68 uint32_t HAL_get_task_high_water_mark_byte(TaskHandle_t handle);
69
71 void HAL_get_debug_thread_text(char* textBuff);
72
74 void HAL_shutdown();
75
76#ifdef __cplusplus
77}
78
79} // namespace: threads
80} // namespace: hal
81} // namespace: lampda
82#endif
83
84#endif
void HAL_shutdown()
Shutdown the thread HAL.
Definition: threads.cpp:142
int HAL_wait_notification(const int timeout_ms)
Put this thread in suspended mode, waiting for a notification. This function wil block execution unti...
Definition: threads.cpp:72
void HAL_suspend_thread(TaskHandle_t handle)
Suspend the target thread.
Definition: threads.cpp:112
uint32_t HAL_create_thread(TaskHandle_t *const handle, taskfunc_t task, char const *const name, const int priority, const int stackSize, const int startSuspended)
Create a thread from the given function and return the associated handle.
Definition: threads.cpp:41
void HAL_get_debug_thread_text(char *textBuff)
Given a buffer, return a buffer debug text.
Definition: threads.cpp:140
void HAL_yield()
Yield this thread.
Definition: threads.cpp:68
void HAL_resume_thread(TaskHandle_t handle)
Resume a suspended thread.
Definition: threads.cpp:122
uint32_t HAL_get_task_high_water_mark_byte(TaskHandle_t handle)
Return a task stack high water mark in bytes.
Definition: threads.cpp:134
void HAL_suspend()
Suspend this thread.
Definition: threads.cpp:70
void HAL_notify_thread(TaskHandle_t handle, int wakeUpEvent)
Notify a thread with a value.
Definition: threads.cpp:99
int HAL_is_suspended(TaskHandle_t handle)
Return 0 if thread is suspended.
Definition: threads.cpp:114
Program scope.
Definition: control_fixed_modes.hpp:12