![]() |
osal-FreeRTOS
0.2.2
osal-FreeRTOS
|
OS Abstraction Layer FreeRTOS implementation. More...
#include <stdint.h>
#include <string.h>
#include "osal.h"
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
Go to the source code of this file.
Functions | |
OSAL_status_t | OSAL_task_create (OSAL_task_entry_point_t entry_point, uint8_t *name, OSAL_task_stack_t stack, int32_t priority, void *parameters, OSAL_task_handle_t *handle) |
Create an OS task and start it. More... | |
OSAL_status_t | OSAL_task_delete (OSAL_task_handle_t *handle) |
Delete an OS task and start it. More... | |
OSAL_status_t | OSAL_queue_create (uint8_t *name, uint32_t size, OSAL_queue_handle_t *handle) |
Create an OS queue with a predefined queue size. More... | |
OSAL_status_t | OSAL_queue_delete (OSAL_queue_handle_t *handle) |
Delete an OS queue. More... | |
OSAL_status_t | OSAL_queue_post (OSAL_queue_handle_t *handle, void *msg) |
Post a message in an OS queue. More... | |
OSAL_status_t | OSAL_queue_fetch (OSAL_queue_handle_t *handle, void **msg, uint32_t timeout) |
Fetch a message from an OS queue. Blocks until a message arrived or a timeout occurred. More... | |
OSAL_status_t | OSAL_counter_semaphore_create (uint8_t *name, uint32_t initial_count, uint32_t max_count, OSAL_counter_semaphore_handle_t *handle) |
Create an OS counter semaphore with a semaphore count initial value. More... | |
OSAL_status_t | OSAL_counter_semaphore_delete (OSAL_counter_semaphore_handle_t *handle) |
Delete an OS counter semaphore. More... | |
OSAL_status_t | OSAL_counter_semaphore_take (OSAL_counter_semaphore_handle_t *handle, uint32_t timeout) |
Take operation on OS counter semaphore. Block the current task until counter semaphore become available or timeout occurred. Decrease the counter semaphore count value by 1 and block the current task if count value equals to 0. More... | |
OSAL_status_t | OSAL_counter_semaphore_give (OSAL_counter_semaphore_handle_t *handle) |
Give operation on OS counter semaphore. Increase the counter semaphore count value by 1 and unblock the current task if count value. equals to 0. More... | |
OSAL_status_t | OSAL_binary_semaphore_create (uint8_t *name, uint32_t initial_count, OSAL_binary_semaphore_handle_t *handle) |
Create an OS binary semaphore with a semaphore count initial value (0 or 1). More... | |
OSAL_status_t | OSAL_binary_semaphore_delete (OSAL_binary_semaphore_handle_t *handle) |
Delete an OS binary semaphore. More... | |
OSAL_status_t | OSAL_binary_semaphore_take (OSAL_binary_semaphore_handle_t *handle, uint32_t timeout) |
Take operation on OS binary semaphore. Block the current task until binary semaphore become available or timeout occurred. Decrease the binary semaphore count value by 1 and block the current task if count value equals to 0. More... | |
OSAL_status_t | OSAL_binary_semaphore_give (OSAL_binary_semaphore_handle_t *handle) |
Give operation on OS binary semaphore. Increase the binary semaphore count value by 1 and unblock the current task if count value. equals to 0. More... | |
OSAL_status_t | OSAL_mutex_create (uint8_t *name, OSAL_mutex_handle_t *handle) |
Create an OS mutex. More... | |
OSAL_status_t | OSAL_mutex_delete (OSAL_mutex_handle_t *handle) |
Delete an OS mutex. More... | |
OSAL_status_t | OSAL_mutex_take (OSAL_mutex_handle_t *handle, uint32_t timeout) |
Take operation on OS mutex. More... | |
OSAL_status_t | OSAL_mutex_give (OSAL_mutex_handle_t *handle) |
Give operation on OS mutex. More... | |
OSAL_status_t | OSAL_disable_context_switching (void) |
Disable the OS scheduler context switching. Prevent the OS from scheduling the current thread calling OSAL_disable_context_switching while the OS scheduling is already disable has an undefined behavior. This method may be called from an interrupt. More... | |
OSAL_status_t | OSAL_enable_context_switching (void) |
Reenable the OS scheduling that was disabled by OSAL_disable_context_switching. This method may be called from an interrupt. More... | |
OSAL_status_t | OSAL_sleep (uint32_t milliseconds) |
Asleep the current task during specified number of milliseconds. More... | |
OS Abstraction Layer FreeRTOS implementation.
Definition in file osal_FreeRTOS.c.
OSAL_status_t OSAL_binary_semaphore_create | ( | uint8_t * | name, |
uint32_t | initial_count, | ||
OSAL_binary_semaphore_handle_t * | handle | ||
) |
Create an OS binary semaphore with a semaphore count initial value (0 or 1).
[in] | name | counter semaphore name |
[in] | initial_count | counter semaphore initial count value |
[in,out] | handle | pointer on a binary semaphore handle |
Definition at line 262 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_binary_semaphore_delete | ( | OSAL_binary_semaphore_handle_t * | handle | ) |
Delete an OS binary semaphore.
[in] | handle | pointer on the binary semaphore handle |
Definition at line 284 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_binary_semaphore_give | ( | OSAL_binary_semaphore_handle_t * | handle | ) |
Give operation on OS binary semaphore. Increase the binary semaphore count value by 1 and unblock the current task if count value. equals to 0.
[in] | handle | pointer on the binary semaphore handle |
Definition at line 328 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_binary_semaphore_take | ( | OSAL_binary_semaphore_handle_t * | handle, |
uint32_t | timeout | ||
) |
Take operation on OS binary semaphore. Block the current task until binary semaphore become available or timeout occurred. Decrease the binary semaphore count value by 1 and block the current task if count value equals to 0.
[in] | handle | pointer on the binary semaphore handle |
[in] | timeout | maximum time to wait until the binary semaphore become available |
Definition at line 305 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_counter_semaphore_create | ( | uint8_t * | name, |
uint32_t | initial_count, | ||
uint32_t | max_count, | ||
OSAL_counter_semaphore_handle_t * | handle | ||
) |
Create an OS counter semaphore with a semaphore count initial value.
[in] | name | counter semaphore name |
[in] | initial_count | counter semaphore initial count value |
[in] | max_count | counter semaphore maximum count value |
[in,out] | handle | pointer on a counter semaphore handle |
Definition at line 173 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_counter_semaphore_delete | ( | OSAL_counter_semaphore_handle_t * | handle | ) |
Delete an OS counter semaphore.
[in] | handle | pointer on the counter semaphore handle |
Definition at line 195 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_counter_semaphore_give | ( | OSAL_counter_semaphore_handle_t * | handle | ) |
Give operation on OS counter semaphore. Increase the counter semaphore count value by 1 and unblock the current task if count value. equals to 0.
[in] | handle | pointer on the counter semaphore handle |
Definition at line 239 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_counter_semaphore_take | ( | OSAL_counter_semaphore_handle_t * | handle, |
uint32_t | timeout | ||
) |
Take operation on OS counter semaphore. Block the current task until counter semaphore become available or timeout occurred. Decrease the counter semaphore count value by 1 and block the current task if count value equals to 0.
[in] | handle | pointer on the counter semaphore handle |
[in] | timeout | maximum time to wait until the counter semaphore become available |
Definition at line 216 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_disable_context_switching | ( | void | ) |
Disable the OS scheduler context switching. Prevent the OS from scheduling the current thread calling OSAL_disable_context_switching while the OS scheduling is already disable has an undefined behavior. This method may be called from an interrupt.
Definition at line 435 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_enable_context_switching | ( | void | ) |
Reenable the OS scheduling that was disabled by OSAL_disable_context_switching. This method may be called from an interrupt.
Definition at line 447 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_mutex_create | ( | uint8_t * | name, |
OSAL_mutex_handle_t * | handle | ||
) |
Create an OS mutex.
[in] | name | mutex name |
[in,out] | handle | pointer on a mutex handle |
Definition at line 350 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_mutex_delete | ( | OSAL_mutex_handle_t * | handle | ) |
Delete an OS mutex.
[in] | handle | pointer on the mutex handle |
Definition at line 372 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_mutex_give | ( | OSAL_mutex_handle_t * | handle | ) |
Give operation on OS mutex.
[in] | handle | pointer on the mutex handle |
Definition at line 413 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_mutex_take | ( | OSAL_mutex_handle_t * | handle, |
uint32_t | timeout | ||
) |
Take operation on OS mutex.
[in] | handle | pointer on the mutex handle |
[in] | timeout | maximum time to wait until the mutex become available |
Definition at line 391 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_queue_create | ( | uint8_t * | name, |
uint32_t | size, | ||
OSAL_queue_handle_t * | handle | ||
) |
Create an OS queue with a predefined queue size.
[in,out] | handle | pointer on a queue handle |
Definition at line 86 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_queue_delete | ( | OSAL_queue_handle_t * | handle | ) |
Delete an OS queue.
[in] | handle | pointer on the queue handle |
Definition at line 110 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_queue_fetch | ( | OSAL_queue_handle_t * | handle, |
void ** | msg, | ||
uint32_t | timeout | ||
) |
Fetch a message from an OS queue. Blocks until a message arrived or a timeout occurred.
[in] | handle | pointer on the queue handle |
[in,out] | msg | message fetched in the OS queue |
[in] | timeout | maximum time to wait for message arrival |
Definition at line 148 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_queue_post | ( | OSAL_queue_handle_t * | handle, |
void * | msg | ||
) |
Post a message in an OS queue.
[in] | handle | pointer on the queue handle |
[in] | msg | message to post in the message queue |
Definition at line 129 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_sleep | ( | uint32_t | milliseconds | ) |
Asleep the current task during specified number of milliseconds.
[in] | milliseconds | number of milliseconds |
Definition at line 460 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_task_create | ( | OSAL_task_entry_point_t | entry_point, |
uint8_t * | name, | ||
OSAL_task_stack_t | stack, | ||
int32_t | priority, | ||
void * | parameters, | ||
OSAL_task_handle_t * | handle | ||
) |
Create an OS task and start it.
[in] | entry_point | function called at task startup |
[in] | name | the task name |
[in] | stack | task stack declared using OSAL_task_stack_declare() macro |
[in] | priority | task priority |
[in] | parameters | task entry parameters. NULL if no entry parameters |
[in,out] | handle | pointer on a task handle |
Definition at line 39 of file osal_FreeRTOS.c.
OSAL_status_t OSAL_task_delete | ( | OSAL_task_handle_t * | handle | ) |
Delete an OS task and start it.
[in] | handle | pointer on the task handle |
Definition at line 67 of file osal_FreeRTOS.c.