RTOS APIs#
This section describes the RTOS APIs
Functions#
Enter critical section.
Exit critical section by restoring interrupts.
Create and initialize the mutex.
Lock the mutex.
Lock the mutex from ISR context.
Unlock the mutex.
Unlock the mutex from ISR context.
Destroy the mutex.
Create and initialize the semaphore instance.
Destroy the semaphore instance.
Checks whether the semaphore is created and destroys the semaphore instance, if its created.
Wait for semaphore.
Release semaphore, which is acquired.
Release semaphore, which is acquired from ISR context.
Create OS task/thread.
Destroy the task created.
Induce required delay in milli seconds.
Schedule the tasks created.
Setup the systick timer to generate the tick interrupts at the required frequency.
Sets the OS error .
Allow a task to wait with optional timeout.
Notify a task.
Notify a task from ISR context.
Allow a task in wait in blocked state for its notification value.
Notify to a task.
Get WLAN status.
Allocate memory from the buffer which is maintained by freeRTOS.
Free the memory pointed by 'ptr'.
Enter into critical section.
Enter exit section.
Exit critical section.
Function Documentation#
rsi_critical_section_entry#
rsi_reg_flags_t rsi_critical_section_entry (void )
Enter critical section.
[in] |
Returns
Interrupt status before entering critical section
47
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_critical_section_exit#
void rsi_critical_section_exit (rsi_reg_flags_t xflags)
Exit critical section by restoring interrupts.
[in] | xflags | - Interrupt status to restore interrupt on exit from critical section |
Returns
Void
75
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_mutex_create#
rsi_error_t rsi_mutex_create (rsi_mutex_handle_t * mutex)
Create and initialize the mutex.
[in] | mutex | - Mutex handle pointer |
Returns
0 - Success
Negative Value - Failure
97
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_mutex_lock#
rsi_error_t rsi_mutex_lock (volatile rsi_mutex_handle_t * mutex)
Lock the mutex.
[in] | mutex | - Mutex handle pointer |
Returns
0 - Success
Negative Value - Failure
123
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_mutex_lock_from_isr#
void rsi_mutex_lock_from_isr (volatile rsi_mutex_handle_t * mutex)
Lock the mutex from ISR context.
[in] | mutex | - Mutex handle pointer |
Returns
0 - Success
Negative Value - Failure
150
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_mutex_unlock#
rsi_error_t rsi_mutex_unlock (volatile rsi_mutex_handle_t * mutex)
Unlock the mutex.
[in] | mutex | - Mutex handle pointer |
Returns
0 - Success
Negative Value - Failure
165
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_mutex_unlock_from_isr#
void rsi_mutex_unlock_from_isr (volatile rsi_mutex_handle_t * mutex)
Unlock the mutex from ISR context.
[in] | mutex | - Mutex handle pointer |
Returns
None
185
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_mutex_destroy#
rsi_error_t rsi_mutex_destroy (rsi_mutex_handle_t * mutex)
Destroy the mutex.
[in] | mutex | - Mutex handle pointer |
Returns
0 - Success
Negative Value - Failure
200
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_semaphore_create#
rsi_error_t rsi_semaphore_create (rsi_semaphore_handle_t * semaphore, uint32_t count)
Create and initialize the semaphore instance.
[in] | semaphore | - Semaphore handle pointer |
[in] | count | - Resource count |
Returns
0 - Success
Negative Value - Failure
222
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_semaphore_destroy#
rsi_error_t rsi_semaphore_destroy (rsi_semaphore_handle_t * semaphore)
Destroy the semaphore instance.
[in] | semaphore | - Semaphore handle pointer |
Returns
0 - Success
Negative Value - Failure
247
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_semaphore_check_and_destroy#
rsi_error_t rsi_semaphore_check_and_destroy (rsi_semaphore_handle_t * semaphore)
Checks whether the semaphore is created and destroys the semaphore instance, if its created.
[in] | semaphore | - Semaphore handle pointer |
Check whether the semaphore is created and destroy, if created.
Returns
0 - Success
Negative Value - Failure
Returns
0 - Success
Negative Value - Failure
271
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_semaphore_wait#
rsi_error_t rsi_semaphore_wait (rsi_semaphore_handle_t * semaphore, uint32_t timeout_ms)
Wait for semaphore.
[in] | semaphore | - Semaphore handle pointer |
[in] | timeout_ms | - Maximum time to wait to acquire semaphore. If timeout_ms is 0 then wait till semaphore is acquired. |
Returns
0 - Success
Negative Value - Failure
296
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_semaphore_post#
rsi_error_t rsi_semaphore_post (rsi_semaphore_handle_t * semaphore)
Release semaphore, which is acquired.
[in] | semaphore | - Semaphore handle pointer |
Returns
0 - Success
Negative Value - Failure
324
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_semaphore_post_from_isr#
rsi_error_t rsi_semaphore_post_from_isr (rsi_semaphore_handle_t * semaphore)
Release semaphore, which is acquired from ISR context.
[in] | semaphore | - Semaphore handle pointer |
Returns
0 - Success
Negative Value - Failure
349
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_semaphore_reset#
rsi_error_t rsi_semaphore_reset (rsi_semaphore_handle_t * semaphore)
N/A | semaphore |
374
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_task_create#
rsi_error_t rsi_task_create (rsi_task_function_t task_function, uint8_t * task_name, uint32_t stack_size, void * parameters, uint32_t task_priority, rsi_task_handle_t * task_handle)
Create OS task/thread.
[in] | task_function | - Pointer to function to be executed by created thread. |
[in] | task_name | - Name of the created task |
[in] | stack_size | - Stack size given to the created task |
[in] | parameters | - Pointer to the parameters to be passed to task function |
[in] | task_priority | - Task priority |
[in] | task_handle | - Task handle/instance created |
Returns
0 - Success
Negative Value - Failure
405
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_task_destroy#
void rsi_task_destroy (rsi_task_handle_t * task_handle)
Destroy the task created.
[in] | task_handle | - Task handle/instance to be deleted |
Returns
Void
437
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_os_task_delay#
void rsi_os_task_delay (uint32_t timeout_ms)
Induce required delay in milli seconds.
[in] | timeout_ms | - Expected delay in milli seconds |
Returns
Void
449
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_start_os_scheduler#
void rsi_start_os_scheduler (void )
Schedule the tasks created.
[in] |
Returns
Void
461
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_setup_timer_os_interrupt#
void rsi_setup_timer_os_interrupt ( None)
Setup the systick timer to generate the tick interrupts at the required frequency.
[in] | None |
Returns
void
472
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_set_os_errno#
void rsi_set_os_errno (int32_t error)
Sets the OS error .
[in] | error | - Error |
Returns
Void
483
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_task_notify_wait#
rsi_base_type_t rsi_task_notify_wait (uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t * pulNotificationValue, uint32_t timeout)
Allow a task to wait with optional timeout.
[in] | ulBitsToClearOnEntry | - Bits set here will be cleared in the task’s notification value on entry to the function. |
[in] | ulBitsToClearOnExit | - Bits to clear on exit |
[in] | pulNotificationValue | - Used to pass out the task notification value. Optional parameter |
[in] | timeout | - Maximum amount of time the calling task should remain in blocked state |
Returns
0 - Success
Negative Value - Failure
499
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_task_notify#
rsi_base_type_t rsi_task_notify (rsi_task_handle_t xTaskToNotify, uint32_t ulValue)
Notify a task.
[in] | xTaskToNotify | - The handle of the task to which the notification is being sent |
[in] | ulValue | - How ulValue is used is dependent on the eNotifyAction value |
Returns
0 - Success
Non-Zero Value - Failure
525
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_task_notify_from_isr#
rsi_base_type_t rsi_task_notify_from_isr (rsi_task_handle_t xTaskToNotify, uint32_t ulValue, rsi_base_type_t * pxHigherPriorityTaskWoken)
Notify a task from ISR context.
[in] | xTaskToNotify | - The handle of the task to which the notification is being sent |
[in] | ulValue | - How ulValue is used is dependent on the eNotifyAction value |
[in] | pxHigherPriorityTaskWoken | - Sets,if sending the notification caused a task to unblock, and the unblocked task has a priority higher than the currently running task. |
Returns
0 - Success
Non-Zero Value - Failure
546
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_os_task_notify_take#
uint32_t rsi_os_task_notify_take (BaseType_t xClearCountOnExit, TickType_t xTicksToWait)
Allow a task in wait in blocked state for its notification value.
[in] | xClearCountOnExit | - Based on this value calling task notification value will be decremented/zero |
[in] | xTicksToWait | - Maximum amount of time calling task should remain in blocked state |
Returns
0 - Success
Non-Zero Value - Failure
569
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_os_task_notify_give#
BaseType_t rsi_os_task_notify_give (rsi_task_handle_t xTaskToNotify)
Notify to a task.
[in] | xTaskToNotify | - Task handle to notify |
Returns
Task notification value - Success
-1 - Failure
582
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_get_error#
int32_t rsi_get_error (int32_t sockID)
Get WLAN status.
[in] | sockID | - Socket ID |
Returns
WLAN status
601
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_malloc#
void* rsi_malloc (uint32_t size)
Allocate memory from the buffer which is maintained by freeRTOS.
[in] | size | - Required bytes in size |
Returns
Void
664
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_free#
void rsi_free (void * ptr)
Free the memory pointed by 'ptr'.
[in] | ptr | - starting address of the memory to be freed |
Returns
Void
680
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_vport_enter_critical#
void rsi_vport_enter_critical (void )
Enter into critical section.
[in] |
Returns
Void
695
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_vport_exit_critical#
void rsi_vport_exit_critical (void )
Enter exit section.
[in] |
Returns
Void
708
of file rtos/freertos_wrapper/rsi_os_wrapper.c
rsi_task_suspend#
void rsi_task_suspend (rsi_task_handle_t * task_handle)
Exit critical section.
[in] | task_handle | - Task handle to be suspended |
Returns
Void
720
of file rtos/freertos_wrapper/rsi_os_wrapper.c