feat: 完成TCP2UART透传核心集成
集成CH390驱动、LwIP协议栈和FreeRTOS多任务透传框架,确保TCP Server/Client与UART链路按配置稳定联动。
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @file sys_arch.h
|
||||
* @brief LwIP system architecture for FreeRTOS
|
||||
*/
|
||||
|
||||
#ifndef __SYS_ARCH_H__
|
||||
#define __SYS_ARCH_H__
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
#include "lwip/arch.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Semaphore type */
|
||||
typedef SemaphoreHandle_t sys_sem_t;
|
||||
|
||||
/* Mutex type */
|
||||
typedef SemaphoreHandle_t sys_mutex_t;
|
||||
|
||||
/* Mailbox (message queue) type */
|
||||
typedef QueueHandle_t sys_mbox_t;
|
||||
|
||||
/* Thread type */
|
||||
typedef TaskHandle_t sys_thread_t;
|
||||
|
||||
/* Protection level type */
|
||||
typedef u32_t sys_prot_t;
|
||||
|
||||
/* Null values */
|
||||
#define SYS_SEM_NULL ((sys_sem_t)NULL)
|
||||
#define SYS_MBOX_NULL ((sys_mbox_t)NULL)
|
||||
#define SYS_MUTEX_NULL ((sys_mutex_t)NULL)
|
||||
|
||||
/* Check if semaphore/mbox is valid */
|
||||
#define sys_sem_valid(sem) ((sem) != NULL && (*(sem)) != SYS_SEM_NULL)
|
||||
#define sys_sem_set_invalid(sem) do { if ((sem) != NULL) { *(sem) = SYS_SEM_NULL; } } while(0)
|
||||
|
||||
#define sys_mbox_valid(mbox) ((mbox) != NULL && (*(mbox)) != SYS_MBOX_NULL)
|
||||
#define sys_mbox_set_invalid(mbox) do { if ((mbox) != NULL) { *(mbox) = SYS_MBOX_NULL; } } while(0)
|
||||
|
||||
#define sys_mutex_valid(mutex) ((mutex) != NULL && (*(mutex)) != SYS_MUTEX_NULL)
|
||||
#define sys_mutex_set_invalid(mutex) do { if ((mutex) != NULL) { *(mutex) = SYS_MUTEX_NULL; } } while(0)
|
||||
|
||||
/* System initialization */
|
||||
void sys_init(void);
|
||||
|
||||
/* Get current time in milliseconds */
|
||||
u32_t sys_now(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYS_ARCH_H__ */
|
||||
Reference in New Issue
Block a user