28 #ifndef OSDK_PLATFORM_H 29 #define OSDK_PLATFORM_H 33 #include <sys/socket.h> 34 #include <netinet/in.h> 35 #include <arpa/inet.h> 37 #include "osdk_typedef.h" 39 #define OSDK_TASK_STACK_SIZE_DEFAULT 1024 77 T_UsbBulkObj bulkObject;
87 E_OsdkStat (*UartInit)(
const char *port,
const int baudrate, T_HalObj *obj);
92 E_OsdkStat (*UartWriteData)(
const T_HalObj *obj,
const uint8_t *pBuf, uint32_t bufLen);
97 E_OsdkStat (*UartReadData)(
const T_HalObj *obj, uint8_t *pBuf, uint32_t *bufLen);
102 E_OsdkStat (*UartClose)(T_HalObj *obj);
103 } T_OsdkHalUartHandler;
110 E_OsdkStat (*USBBulkInit)(uint16_t pid, uint16_t vid, uint16_t num, uint16_t epIn, uint16_t epOut, T_HalObj *obj);
115 E_OsdkStat (*USBBulkWriteData)(
const T_HalObj *obj,
const uint8_t *pBuf, uint32_t bufLen);
120 E_OsdkStat (*USBBulkReadData)(
const T_HalObj *obj, uint8_t *pBuf, uint32_t *bufLen);
125 E_OsdkStat (*USBBulkClose)(T_HalObj *obj);
126 } T_OsdkHalUSBBulkHandler;
134 E_OsdkStat (*TaskCreate)(
T_OsdkTaskHandle *task,
void *(*taskFunc)(
void *), uint32_t stackSize,
void *arg);
146 E_OsdkStat (*TaskSleepMs)(uint32_t timeMs);
176 E_OsdkStat (*SemaphoreCreate)(
T_OsdkSemHandle *semaphore, uint32_t initValue);
194 E_OsdkStat (*SemaphoreTimedWait)(
T_OsdkSemHandle semaphore, uint32_t waitTimeMs);
206 E_OsdkStat (*GetTimeMs)(uint32_t *ms);
209 E_OsdkStat (*GetTimeUs)(uint64_t *us);
216 void *(*Malloc)(uint32_t size);
222 void (*Free)(
void *ptr);
249 E_OsdkStat OsdkPlatform_RegHalUSBBulkHandler(
const T_OsdkHalUSBBulkHandler *halUSBBulkHandler);
273 uint32_t stackSize,
void *arg);
366 E_OsdkStat OsdkOsal_GetTimeUs(uint64_t *us);
390 #endif // OSDK_PLATFORM_H