30 #ifndef OSDK_DJI_PLATFORM_H_ 31 #define OSDK_DJI_PLATFORM_H_ 37 #define DJI_REG_UART_HANDLER(handlerPtr) \ 38 DJI::OSDK::Platform::instance() \ 39 .registerHalUartHandler(handlerPtr) 42 #define DJI_REG_USB_BULK_HANDLER(handlerPtr) \ 43 DJI::OSDK::Platform::instance() \ 44 .registerHalUSBBulkHandler(handlerPtr) 47 #define DJI_REG_OSAL_HANDLER(handlerPtr) \ 48 DJI::OSDK::Platform::instance() \ 49 .registerOsalHandler(handlerPtr) 51 #define DJI_REG_LOGGER_CONSOLE(consolePtr) \ 52 DJI::OSDK::Platform::instance() \ 53 .registerLoggerConsole(consolePtr) 55 #define DJI_TASK_CREATE(taskPtr, taskFunc, stackSize, arg) \ 56 DJI::OSDK::Platform::instance() \ 57 .taskCreate(taskPtr, taskFunc, stackSize, arg) 59 #define DJI_TASK_DESTROY(task) \ 60 DJI::OSDK::Platform::instance() \ 63 #define DJI_TASK_SLEEP_MS(timeMs) \ 64 DJI::OSDK::Platform::instance() \ 67 #define DJI_MUTEX_CREATE(mutexPtr) \ 68 DJI::OSDK::Platform::instance() \ 69 .mutexCreate(mutexPtr) 71 #define DJI_MUTEX_DESTROY(mutex) \ 72 DJI::OSDK::Platform::instance() \ 75 #define DJI_MUTEX_LOCK(mutex) \ 76 DJI::OSDK::Platform::instance() \ 79 #define DJI_MUTEX_UNLOCK(mutex) \ 80 DJI::OSDK::Platform::instance() \ 83 #define DJI_SEM_CREATE(semPtr, initValue) \ 84 DJI::OSDK::Platform::instance() \ 85 .semaphoreCreate(mutexPtr, initValue) 87 #define DJI_SEM_DESTROY(sem) \ 88 DJI::OSDK::Platform::instance() \ 89 .semaphoreDestroy(sem) 91 #define DJI_SEM_POST(sem) \ 92 DJI::OSDK::Platform::instance() \ 95 #define DJI_SEM_WAIT(sem) \ 96 DJI::OSDK::Platform::instance() \ 99 #define DJI_SEM_TIMED_WAIT(sem, waitTime) \ 100 DJI::OSDK::Platform::instance() \ 101 .semaphoreTimedWait(sem, waitTime) 103 #define DJI_MEM_MALLOC(size) \ 104 DJI::OSDK::Platform::instance() \ 107 #define DJI_MEM_FREE(ptr) \ 108 DJI::OSDK::Platform::instance() \ 111 #define DJI_GET_TIME_MS(msPtr) \ 112 DJI::OSDK::Platform::instance() \ 116 #define DJI_GET_TIME_US(usPtr) \ 117 DJI::OSDK::Platform::instance() \ 126 class Platform :
public Singleton<Platform>
134 bool isHalUartReady();
136 bool isLoggerReady();
138 bool registerHalUartHandler(
const T_OsdkHalUartHandler *halUartHandler);
141 bool registerHalUSBBulkHandler(
const T_OsdkHalUSBBulkHandler *halUSBBulkHandler);
144 bool registerOsalHandler(
const T_OsdkOsalHandler *osalHandler);
146 bool registerLoggerConsole(T_OsdkLoggerConsole *console);
148 bool taskCreate(
T_OsdkTaskHandle *task,
void *(*taskFunc)(
void *), uint32_t stackSize,
void *arg);
152 bool taskSleepMs(uint32_t timeMs);
172 bool getTimeMs(uint32_t *ms);
175 bool getTimeUs(uint64_t *us);
178 void* malloc(uint32_t size);
180 void free(
void *ptr);
185 bool loggerConsoleRegFlag;
This is the header file for "osdk_logger.c", defining the structure and (exported) function prototype...
Singleton Template Class implementation for use with the DJI OSDK.
handle array of characters
Definition: commondatarangehandler.h:14