DJI Onboard SDK
4.0
|
This is the header file for define OSDK platform interfaces. More...
#include "osdk_typedef.h"
Go to the source code of this file.
Macros | |
#define | OSDK_TASK_STACK_SIZE_DEFAULT 1024 |
Typedefs | |
typedef void * | T_OsdkTaskHandle |
Platform handle of thread task operation. | |
typedef void * | T_OsdkMutexHandle |
Platform handle of mutex operation. | |
typedef void * | T_OsdkSemHandle |
Platform handle of semaphore operation. | |
Functions | |
E_OsdkStat | OsdkPlatform_RegHalUartHandler (const T_OsdkHalUartHandler *halUartHandler) |
Register the handler for hal uart interfaces by your platform. More... | |
E_OsdkStat | OsdkPlatform_RegOsalHandler (const T_OsdkOsalHandler *osalHandler) |
Register the handler for osal interfaces by your platform. More... | |
E_OsdkStat | OsdkOsal_TaskCreate (T_OsdkTaskHandle *task, void *(*taskFunc)(void *), uint32_t stackSize, void *arg) |
Declare the task container, initialize the task, and create task ID. More... | |
E_OsdkStat | OsdkOsal_TaskDestroy (T_OsdkTaskHandle task) |
Destroy the created task. More... | |
E_OsdkStat | OsdkOsal_TaskSleepMs (uint32_t timeMs) |
Let task into a sleep state in a set time, uint:ms. More... | |
E_OsdkStat | OsdkOsal_MutexCreate (T_OsdkMutexHandle *mutex) |
Declare the mutex container, initialize the mutex, and create mutex ID. More... | |
E_OsdkStat | OsdkOsal_MutexDestroy (T_OsdkMutexHandle mutex) |
Destroy the created mutex. More... | |
E_OsdkStat | OsdkOsal_MutexLock (T_OsdkMutexHandle mutex) |
Acquire and lock the mutex when peripheral access is required. More... | |
E_OsdkStat | OsdkOsal_MutexUnlock (T_OsdkMutexHandle mutex) |
Unlock and release the mutex, when done with the peripheral access. More... | |
E_OsdkStat | OsdkOsal_SemaphoreCreate (T_OsdkSemHandle *semaphore, uint32_t initValue) |
Declare the semaphore container, initialize the semaphore, and create semaphore ID. More... | |
E_OsdkStat | OsdkOsal_SemaphoreDestroy (T_OsdkSemHandle semaphore) |
Destroy the created semaphore. More... | |
E_OsdkStat | OsdkOsal_SemaphoreWait (T_OsdkSemHandle semaphore) |
Wait the created semaphore forever. More... | |
E_OsdkStat | OsdkOsal_SemaphoreTimedWait (T_OsdkSemHandle semaphore, uint32_t waitTimeMs) |
Wait the created semaphore and set the value of timeout. More... | |
E_OsdkStat | OsdkOsal_SemaphorePost (T_OsdkSemHandle semaphore) |
Post the created semaphore. More... | |
E_OsdkStat | OsdkOsal_GetTimeMs (uint32_t *ms) |
Get the system millisecond time, uint:ms. More... | |
void * | OsdkOsal_Malloc (uint32_t size) |
Get the system time, uint:us. More... | |
void | OsdkOsal_Free (void *ptr) |
Release allocated memory. More... | |
This is the header file for define OSDK platform interfaces.
All information contained herein is, and remains, the property of DJI. The intellectual and technical concepts contained herein are proprietary to DJI and may be covered by U.S. and foreign patents, patents in process, and protected by trade secret or copyright law. Dissemination of this information, including but not limited to data and other proprietary material(s) incorporated within the information, in any form, is strictly prohibited without the express written consent of DJI.
If you receive this source code without DJI’s authorization, you may not further disseminate the information, and you must immediately remove the source code and notify DJI of its removal. DJI reserves the right to pursue legal actions against you for any loss(es) or damage(s) caused by your failure to do so.
void OsdkOsal_Free | ( | void * | ptr | ) |
Release allocated memory.
ptr | pointer to the need allocated memory. |
E_OsdkStat OsdkOsal_GetTimeMs | ( | uint32_t * | ms | ) |
Get the system millisecond time, uint:ms.
ms | pointer to the got time ms. |
void* OsdkOsal_Malloc | ( | uint32_t | size | ) |
Get the system time, uint:us.
us | pointer to the got time us. |
size | uint32_t size that need allocate. |
E_OsdkStat OsdkOsal_MutexCreate | ( | T_OsdkMutexHandle * | mutex | ) |
Declare the mutex container, initialize the mutex, and create mutex ID.
mutex | pointer to the created mutex ID. |
E_OsdkStat OsdkOsal_MutexDestroy | ( | T_OsdkMutexHandle | mutex | ) |
Destroy the created mutex.
mutex | pointer to the created mutex ID. |
E_OsdkStat OsdkOsal_MutexLock | ( | T_OsdkMutexHandle | mutex | ) |
Acquire and lock the mutex when peripheral access is required.
mutex | pointer to the created mutex ID. |
E_OsdkStat OsdkOsal_MutexUnlock | ( | T_OsdkMutexHandle | mutex | ) |
Unlock and release the mutex, when done with the peripheral access.
mutex | pointer to the created mutex ID. |
E_OsdkStat OsdkOsal_SemaphoreCreate | ( | T_OsdkSemHandle * | semaphore, |
uint32_t | initValue | ||
) |
Declare the semaphore container, initialize the semaphore, and create semaphore ID.
semaphore | pointer to the created semaphore ID. |
E_OsdkStat OsdkOsal_SemaphoreDestroy | ( | T_OsdkSemHandle | semaphore | ) |
Destroy the created semaphore.
semaphore | pointer to the created semaphore ID. |
E_OsdkStat OsdkOsal_SemaphorePost | ( | T_OsdkSemHandle | semaphore | ) |
Post the created semaphore.
semaphore | pointer to the created semaphore ID. |
E_OsdkStat OsdkOsal_SemaphoreTimedWait | ( | T_OsdkSemHandle | semaphore, |
uint32_t | waitTimeMs | ||
) |
Wait the created semaphore and set the value of timeout.
semaphore | pointer to the created semaphore ID. |
waitTimeMs | value of timeout for waiting created semaphore. |
E_OsdkStat OsdkOsal_SemaphoreWait | ( | T_OsdkSemHandle | semaphore | ) |
Wait the created semaphore forever.
semaphore | pointer to the created semaphore ID. |
E_OsdkStat OsdkOsal_TaskCreate | ( | T_OsdkTaskHandle * | task, |
void *(*)(void *) | taskFunc, | ||
uint32_t | stackSize, | ||
void * | arg | ||
) |
Declare the task container, initialize the task, and create task ID.
pthread_t | pointer to the created task ID. |
taskFunc | pointer to the created task function. |
stackSize | value of task stack size. |
arg | pointer to the user defined data. |
E_OsdkStat OsdkOsal_TaskDestroy | ( | T_OsdkTaskHandle | task | ) |
Destroy the created task.
pthread_t | pointer to the created task ID. |
E_OsdkStat OsdkOsal_TaskSleepMs | ( | uint32_t | timeMs | ) |
Let task into a sleep state in a set time, uint:ms.
timeMs | value of time ms for task sleeping. |
E_OsdkStat OsdkPlatform_RegHalUartHandler | ( | const T_OsdkHalUartHandler * | halUartHandler | ) |
Register the handler for hal uart interfaces by your platform.
halUartHandler | pointer to the handler for hal uart interfaces by your platform. |
E_OsdkStat OsdkPlatform_RegOsalHandler | ( | const T_OsdkOsalHandler * | osalHandler | ) |
Register the handler for osal interfaces by your platform.
osalHandler | pointer to the handler for osal interfaces by your platform. |