![]() |
NTURT Zephyr v0.0.1
NTURT common library for Zephyr RTOS
|
Basic system support. More...
Topics | |
Utility | |
Utility macros and functions. | |
Data Structures | |
struct | sys_shutdown_callback |
Shutdown callback. More... | |
Macros | |
#define | SYS_SHUTDOWN_CALLBACK_DEFINE_NAMED(_name, _handler, _user_data, _priority) |
Same as SYS_SHUTDOWN_CALLBACK_DEFINE, but with a custom name for the callback. | |
#define | SYS_SHUTDOWN_CALLBACK_DEFINE(handler, user_data, priority) |
Define a shutdown callback. | |
Typedefs | |
typedef void(* | sys_shutdown_handler_t) (void *user_data) |
Shutdown handler type. | |
Functions | |
int | sys_work_submit (struct k_work *work) |
Submit a work item to the system work queue. | |
int | sys_work_schedule (struct k_work_delayable *dwork, k_timeout_t delay) |
Submit an idle work item to the system work queue after a delay. | |
int | sys_work_reschedule (struct k_work_delayable *dwork, k_timeout_t delay) |
Reschedule a work item to the system work queue after a delay. | |
void | sys_shutdown () |
Shutdown the system. | |
void | sys_reset () |
Reset the system. | |
int | sys_set_time (time_t time) |
Set system time. | |
Basic system support.
#define SYS_SHUTDOWN_CALLBACK_DEFINE | ( | handler, | |
user_data, | |||
priority ) |
#include <nturt/sys/sys.h>
Define a shutdown callback.
[in] | handler | Handler for shutting down. |
[in] | user_data | Pointer to custom data for the callback. |
[in] | _priority | Priority of the callback. |
handler
, if the same handler is used for multiple callbacks, SYS_SHUTDOWN_CALLBACK_DEFINE_NAMED can be used instead to prevent linker errors. #define SYS_SHUTDOWN_CALLBACK_DEFINE_NAMED | ( | _name, | |
_handler, | |||
_user_data, | |||
_priority ) |
#include <nturt/sys/sys.h>
Same as SYS_SHUTDOWN_CALLBACK_DEFINE, but with a custom name for the callback.
typedef void(* sys_shutdown_handler_t) (void *user_data) |
#include <nturt/sys/sys.h>
Shutdown handler type.
[in,out] | user_data | Pointer to custom user data for the callback provided by SYS_SHUTDOWN_CALLBACK_DEFINE. |
void sys_reset | ( | ) |
#include <nturt/sys/sys.h>
Reset the system.
int sys_set_time | ( | time_t | time | ) |
#include <nturt/sys/sys.h>
Set system time.
[in] | time | Time to set. |
0 | For success. |
others | Negative error number. |
void sys_shutdown | ( | ) |
#include <nturt/sys/sys.h>
Shutdown the system.
int sys_work_reschedule | ( | struct k_work_delayable * | dwork, |
k_timeout_t | delay ) |
#include <nturt/sys/sys.h>
Reschedule a work item to the system work queue after a delay.
Different from the system work queue provided by Zephyr running in high priority designed for bottom halves of interrupts, this work queue runs in lower priority for less critical application level works.
dwork | Pointer to the delayable work item. |
delay | The time to wait before submitting the work item. |
k_work_reschedule_for_queue
. int sys_work_schedule | ( | struct k_work_delayable * | dwork, |
k_timeout_t | delay ) |
#include <nturt/sys/sys.h>
Submit an idle work item to the system work queue after a delay.
Different from the system work queue provided by Zephyr running in high priority designed for bottom halves of interrupts, this work queue runs in lower priority for less critical application level works.
dwork | Pointer to the delayable work item. |
delay | The time to wait before submitting the work item. If K_NO_WAIT this is equivalent to sys_work_submit. |
k_work_schedule_for_queue
. int sys_work_submit | ( | struct k_work * | work | ) |
#include <nturt/sys/sys.h>
Submit a work item to the system work queue.
Different from the system work queue provided by Zephyr running in high priority designed for bottom halves of interrupts, this work queue runs in lower priority for less critical application level works.
work | Pointer to the queue item. |
k_work_submit_to_queue
.