|
VSF Documented
|
#include "kernel/vsf_kernel_cfg.h"#include "./vsf_kernel_common.h"#include "./vsf_eda.h"#include "./vsf_evtq.h"#include "./vsf_os.h"#include "./vsf_timq.h"#include "./__eda/vsf_eda_sync.c"#include "./__eda/vsf_eda_bmpevt.c"#include "./__eda/vsf_eda_queue.c"#include "./__eda/vsf_eda_timer.c"Data Structures | |
| struct | vsf_local_t |
Macros | |
| #define | __VSF_EDA_CLASS_IMPLEMENT |
| #define | __VSF_KERNEL_TASK |
| #define | __EDA_GADGET__ |
Typedefs | |
| typedef struct vsf_local_t | vsf_local_t |
Functions | |
| vsf_evtq_t * | __vsf_os_evtq_get (vsf_prio_t priority) |
| vsf_err_t | __vsf_os_evtq_set_priority (vsf_evtq_t *pthis, vsf_prio_t priority) |
| vsf_err_t | __vsf_os_evtq_activate (vsf_evtq_t *pthis) |
| vsf_err_t | __vsf_os_evtq_init (vsf_evtq_t *pthis) |
| vsf_prio_t | __vsf_os_evtq_get_priority (vsf_evtq_t *pthis) |
| void | __vsf_eda_task_evthandler_process_return_value (vsf_eda_t *eda, vsf_evt_t evt) |
| __vsf_eda_frame_t * | vsf_eda_new_frame (size_t local_size) |
| should be provided by user | |
| void | vsf_eda_free_frame (__vsf_eda_frame_t *frame) |
| void | vsf_kernel_err_report (enum vsf_kernel_error_t err) |
| Report a kernel error. | |
| uintptr_t | vsf_irq_enter (void) |
| Notify the kernel of entering interrupt context. | |
| void | vsf_irq_leave (uintptr_t ctx) |
| Notify the kernel of leaving interrupt context. | |
| void | __vsf_eda_on_terminate (vsf_eda_t *pthis) |
| void | vsf_kernel_init (const vsf_kernel_cfg_t *cfg_ptr) |
| void | __vsf_dispatch_evt (vsf_eda_t *pthis, vsf_evt_t evt) |
| vsf_evtq_t * | __vsf_get_cur_evtq (void) |
| vsf_evtq_t * | __vsf_set_cur_evtq (vsf_evtq_t *evtq) |
| vsf_eda_t * | vsf_eda_get_cur (void) |
| Get the eda task currently being dispatched. | |
| bool | vsf_eda_polling_state_get (vsf_eda_t *pthis) |
| void | vsf_eda_polling_state_set (vsf_eda_t *pthis, bool state) |
| bool | vsf_eda_is_stack_owner (vsf_eda_t *pthis) |
| Check whether an eda owns a dedicated stack. | |
| vsf_evt_t | vsf_eda_get_cur_evt (void) |
| Get the event currently being processed by the current task. | |
| void * | vsf_eda_get_cur_msg (void) |
| Get the pointer message carried by the current event (e.g. VSF_EVT_MESSAGE) | |
| uintptr_t | vsf_eda_get_return_value (void) |
| Get the return value passed back by the sub-called task. | |
| bool | __vsf_eda_return (uintptr_t return_value) |
| Return from the current (sub-called) eda with the given return value. | |
| void | __vsf_eda_yield (void) |
| Yield the current task by posting VSF_EVT_YIELD to itself, so that it is dispatched again later. | |
| void | vsf_eda_set_user_value (uint8_t value) |
| Set the user-defined bits in the feature of the current eda. | |
| uint8_t | vsf_eda_get_user_value (void) |
| Get the user-defined bits in the feature of the current eda. | |
| uintptr_t | __vsf_eda_get_local (vsf_eda_t *pthis) |
| Get the local variable storage of a frame-based eda. | |
| vsf_err_t | vsf_eda_target_set (uintptr_t param) |
| Set the target parameter of the current frame of the current task. | |
| uintptr_t | vsf_eda_target_get (void) |
| Get the target parameter of the current frame of the current task. | |
| vsf_err_t | __vsf_eda_call_eda_ex_prepare (uintptr_t func, uintptr_t param, __vsf_eda_frame_state_t state, bool is_sub_call) |
| Prepare an extended sub-call frame without dispatching VSF_EVT_INIT. | |
| vsf_err_t | __vsf_eda_call_eda_prepare (uintptr_t evthandler, uintptr_t param, size_t local_size) |
| Prepare a sub-call frame without dispatching VSF_EVT_INIT. | |
| vsf_err_t | __vsf_eda_call_eda_ex (uintptr_t func, uintptr_t param, __vsf_eda_frame_state_t state, bool is_sub_call) |
| Extended sub-call: prepare a frame and dispatch VSF_EVT_INIT. | |
| vsf_err_t | __vsf_eda_go_to_ex (uintptr_t evthandler, uintptr_t param) |
| Switch the current frame to a new event handler with a target parameter and dispatch VSF_EVT_INIT. | |
| vsf_err_t | __vsf_eda_call_eda (uintptr_t evthandler, uintptr_t param, size_t local_size) |
| Sub-call an event handler: prepare a frame and dispatch VSF_EVT_INIT. | |
| vsf_err_t | vsf_eda_set_evthandler (vsf_eda_t *pthis, vsf_eda_evthandler_t evthandler) |
| vsf_err_t | vsf_eda_go_to (uintptr_t evthandler) |
| Switch the current task to a new event handler and post VSF_EVT_INIT to it. | |
| vsf_err_t | __vsf_eda_init (vsf_eda_t *pthis, vsf_prio_t priority, vsf_eda_feature_t feature) |
| vsf_err_t | vsf_eda_start (vsf_eda_t *pthis, vsf_eda_cfg_t *cfg_ptr) |
| Start an eda task with the given configuration and post VSF_EVT_INIT to it. | |
| vsf_err_t | vsf_eda_fini (vsf_eda_t *pthis) |
| vsf_err_t | vsf_eda_post_evt (vsf_eda_t *pthis, vsf_evt_t evt) |
| Post an event to an eda task. | |
| vsf_err_t | __vsf_eda_post_evt_ex (vsf_eda_t *pthis, vsf_evt_t evt, bool force) |
| vsf_err_t | vsf_eda_post_msg (vsf_eda_t *pthis, void *msg) |
| Post a pointer message to an eda task; the task receives VSF_EVT_MESSAGE and retrieves the pointer with vsf_eda_get_cur_msg() | |
| vsf_err_t | vsf_eda_post_evt_msg (vsf_eda_t *pthis, vsf_evt_t evt, void *msg) |
| Post an event carrying a pointer message to an eda task; the pointer is retrieved with vsf_eda_get_cur_msg() | |
| void | vsf_eda_cpu_usage_start (vsf_eda_t *pthis, vsf_cpu_usage_ctx_t *ctx) |
| Start measuring the CPU usage of an eda task. | |
| void | vsf_eda_cpu_usage_stop (vsf_eda_t *pthis) |
| Stop measuring the CPU usage of an eda task. | |
| vsf_err_t | vsf_kernel_start (void) |
| #define __VSF_EDA_CLASS_IMPLEMENT |
| #define __VSF_KERNEL_TASK |
| #define __EDA_GADGET__ |
| typedef struct vsf_local_t vsf_local_t |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
< no param
< no local
< it is a pure eda
return fsm_rt_err
call sub fsm later
delay, wait_for, mutex_pend, sem_pend and etc...
|
extern |
should be provided by user
make sure local_size is aligned with sizeof(uintalu_t);
this is important, don't remove it.
add watermark for local buffer overflow detection, please never remove this!!! as local size could be zero
|
extern |
|
extern |
Report a kernel error.
| [in] | err | the kernel error of type vsf_kernel_error_t |
| uintptr_t vsf_irq_enter | ( | void | ) |
Notify the kernel of entering interrupt context.
| void vsf_irq_leave | ( | uintptr_t | ctx | ) |
Notify the kernel of leaving interrupt context.
| [in] | ctx | the context value returned by vsf_irq_enter() |
| void __vsf_eda_on_terminate | ( | vsf_eda_t * | pthis | ) |
| void vsf_kernel_init | ( | const vsf_kernel_cfg_t * | cfg_ptr | ) |
< no param
< no local
< this is a pure eda
| vsf_evtq_t * __vsf_get_cur_evtq | ( | void | ) |
| vsf_evtq_t * __vsf_set_cur_evtq | ( | vsf_evtq_t * | evtq | ) |
| vsf_eda_t * vsf_eda_get_cur | ( | void | ) |
Check whether an eda owns a dedicated stack.
| [in] | pthis | a pointer to structure vsf_eda_t |
| vsf_evt_t vsf_eda_get_cur_evt | ( | void | ) |
Get the event currently being processed by the current task.
| void * vsf_eda_get_cur_msg | ( | void | ) |
Get the pointer message carried by the current event (e.g. VSF_EVT_MESSAGE)
| uintptr_t vsf_eda_get_return_value | ( | void | ) |
Get the return value passed back by the sub-called task.
Return from the current (sub-called) eda with the given return value.
| [in] | return_value | return value passed back to the caller |
< top frame
< not force frame
| void __vsf_eda_yield | ( | void | ) |
Yield the current task by posting VSF_EVT_YIELD to itself, so that it is dispatched again later.
| void vsf_eda_set_user_value | ( | uint8_t | value | ) |
Set the user-defined bits in the feature of the current eda.
| [in] | value | the user value to set, up to VSF_KERNEL_CFG_EDA_USER_BITLEN bits |
| uint8_t vsf_eda_get_user_value | ( | void | ) |
Get the user-defined bits in the feature of the current eda.
Get the local variable storage of a frame-based eda.
| [in] | pthis | a pointer to structure vsf_eda_t |
Set the target parameter of the current frame of the current task.
| [in] | param | the target parameter to set |
| uintptr_t vsf_eda_target_get | ( | void | ) |
Get the target parameter of the current frame of the current task.
| vsf_err_t __vsf_eda_call_eda_ex_prepare | ( | uintptr_t | func, |
| uintptr_t | param, | ||
| __vsf_eda_frame_state_t | state, | ||
| bool | is_sub_call ) |
Prepare an extended sub-call frame without dispatching VSF_EVT_INIT.
| [in] | func | address of the handler function to call |
| [in] | param | target parameter of the new frame |
| [in] | state | frame state __vsf_eda_frame_state_t (feature and local size) |
| [in] | is_sub_call | true for a sub-call (new frame), false to reuse the current frame |
if (NULL == param) { frame->param = pthis; //!< point to the current eda } else { frame->param = param; }
Prepare a sub-call frame without dispatching VSF_EVT_INIT.
| [in] | evthandler | address of the event handler to call |
| [in] | param | target parameter of the new frame |
| [in] | local_size | size of the local variable storage |
| vsf_err_t __vsf_eda_call_eda_ex | ( | uintptr_t | func, |
| uintptr_t | param, | ||
| __vsf_eda_frame_state_t | state, | ||
| bool | is_sub_call ) |
Extended sub-call: prepare a frame and dispatch VSF_EVT_INIT.
| [in] | func | address of the handler function to call |
| [in] | param | target parameter of the new frame |
| [in] | state | frame state __vsf_eda_frame_state_t (feature and local size) |
| [in] | is_sub_call | true for a sub-call (new frame), false to reuse the current frame |
Switch the current frame to a new event handler with a target parameter and dispatch VSF_EVT_INIT.
| [in] | evthandler | address of the new event handler |
| [in] | param | target parameter |
Sub-call an event handler: prepare a frame and dispatch VSF_EVT_INIT.
| [in] | evthandler | address of the event handler to call |
| [in] | param | target parameter of the new frame |
| [in] | local_size | size of the local variable storage |
| vsf_err_t vsf_eda_set_evthandler | ( | vsf_eda_t * | pthis, |
| vsf_eda_evthandler_t | evthandler ) |
Switch the current task to a new event handler and post VSF_EVT_INIT to it.
| [in] | evthandler | address of the new event handler vsf_eda_evthandler_t |
| vsf_err_t __vsf_eda_init | ( | vsf_eda_t * | pthis, |
| vsf_prio_t | priority, | ||
| vsf_eda_feature_t | feature ) |
| vsf_err_t vsf_eda_start | ( | vsf_eda_t * | pthis, |
| vsf_eda_cfg_t * | cfg ) |
Start an eda task with the given configuration and post VSF_EVT_INIT to it.
| [in] | pthis | a pointer to structure vsf_eda_t |
| [in] | cfg | a pointer to structure vsf_eda_cfg_t holding the task configuration |
override the is_use_frame flag
Post an event to an eda task.
| [in] | pthis | a pointer to structure vsf_eda_t |
| [in] | evt | the event to post |
Post a pointer message to an eda task; the task receives VSF_EVT_MESSAGE and retrieves the pointer with vsf_eda_get_cur_msg()
| [in] | pthis | a pointer to structure vsf_eda_t |
| [in] | msg | the message pointer to post, must be aligned (LSB must be 0) |
Post an event carrying a pointer message to an eda task; the pointer is retrieved with vsf_eda_get_cur_msg()
| [in] | pthis | a pointer to structure vsf_eda_t |
| [in] | evt | the event to post |
| [in] | msg | the message pointer carried with the event |
| void vsf_eda_cpu_usage_start | ( | vsf_eda_t * | pthis, |
| vsf_cpu_usage_ctx_t * | ctx ) |
Start measuring the CPU usage of an eda task.
| [in] | pthis | a pointer to structure vsf_eda_t |
| [in] | ctx | a pointer to user-provided structure vsf_cpu_usage_ctx_t, which must be kept valid until vsf_eda_cpu_usage_stop() is called |
| void vsf_eda_cpu_usage_stop | ( | vsf_eda_t * | pthis | ) |
Stop measuring the CPU usage of an eda task.
| [in] | pthis | a pointer to structure vsf_eda_t |
| vsf_err_t vsf_kernel_start | ( | void | ) |