FreeRTOS port on GAP8/RISC-V
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pmsis_task.h File Reference

Functions

pi_task_t__pi_task_block (pi_task_t *task)
 Prepare a blocking event task. More...
 
pi_task_t__pi_task_callback (pi_task_t *callback_task, void(*func)(void *), void *arg)
 Prepare an event task with callback. More...
 
void __pi_task_wait_on (pi_task_t *task)
 Wait on an event task. More...
 
void __pi_task_push (pi_task_t *task)
 Push an event task. More...
 
void __pi_task_destroy (pi_task_t *task)
 Delete an event task. More...
 
void pi_task_delayed_fifo_enqueue (struct pi_task *task, uint32_t delay_us)
 Enqueue a delayed task. More...
 
static pi_task_tpi_task_block (pi_task_t *task)
 
static pi_task_tpi_task_callback (pi_task_t *task, void(*callback)(void *), void *arg)
 
static void pi_task_wait_on (pi_task_t *task)
 
static void pi_task_push (pi_task_t *task)
 
static void pi_task_destroy (pi_task_t *task)
 
static void pi_task_timeout_set (pi_task_t *task, uint32_t timeout_us)
 
static int32_t pi_task_transfer_end_result_get (pi_task_t *task)
 
static void pi_task_timeout_callback_set (pi_task_t *task, pi_callback_func_t func, void *arg)
 

Function Documentation

pi_task_t* __pi_task_block ( pi_task_t task)

This function initializes an instance of event task. A semaphore will be initialized.

Parameters
taskPointer to event task.
Returns
task This function returns the event task initialized.

References pi_task_t::core_id, pi_task_t::done, pi_task_t::id, pi_task_t::next, pi_sem_init(), pi_task_t::timeout, and pi_task_t::wait_on.

Referenced by pi_task_block().

pi_task_t* __pi_task_callback ( pi_task_t callback_task,
void(*)(void *)  func,
void *  arg 
)

This function initializes an instance of event task. This event task executes the callback given in argument.

Parameters
callback_taskPointer to event task.
funcCallback function.
argCallback function argument.
Returns
task This function returns the event task initialized.

Referenced by pi_task_callback().

void __pi_task_destroy ( pi_task_t task)

This function removes an event task. It will delete the semaphore if it has been allocated.

Parameters
taskPointer to event task.

References hal_compiler_barrier(), pi_sem_deinit(), and pi_task_t::wait_on.

Referenced by __pi_task_wait_on(), and pi_task_destroy().

void __pi_task_push ( pi_task_t task)

This function is used to push an event task to the event kernel.

Parameters
taskPointer to event task.

References disable_irq(), pmsis_event_get_default_scheduler(), pmsis_event_push(), and restore_irq().

Referenced by pi_task_push().

void __pi_task_wait_on ( pi_task_t task)

This function allows to wait on an event task until the event occurs.

Parameters
taskPointer to event task.

References __pi_task_destroy(), DEBUG_PRINTF, pi_task_t::done, hal_compiler_barrier(), pi_sem_take(), and pi_task_t::wait_on.

Referenced by pi_task_wait_on().

static pi_task_t* pi_task_callback ( pi_task_t task,
void(*)(void *)  callback,
void *  arg 
)
inlinestatic
void pi_task_delayed_fifo_enqueue ( struct pi_task *  task,
uint32_t  delay_us 
)

This function is used to pushed a delayed event task to event kernel.

Parameters
taskPointer to event task.
delay_usDelay to wait for execution of the event task.
Note
This function is OS dependant.

References pi_task_delayed_s::fifo_head, pi_task_delayed_s::fifo_tail, and portTICK_PERIOD_MS.

Referenced by pi_task_push_delayed_us().

static void pi_task_timeout_callback_set ( pi_task_t task,
pi_callback_func_t  func,
void *  arg 
)
inlinestatic
static void pi_task_timeout_set ( pi_task_t task,
uint32_t  timeout_us 
)
inlinestatic
static int32_t pi_task_transfer_end_result_get ( pi_task_t task)
inlinestatic