YB_TX_RX_APE_PRJ/Inc/osp_interface.h

193 lines
6.7 KiB
C
Raw Normal View History

2025-03-01 22:48:00 -08:00
//#ifdef IDE_TEST
#ifndef __OSP_INTERFACE_H__
#define __OSP_INTERFACE_H__
#if 0
/****************************UCP2.0 Platform start***********************************/
/************************************************************************************/
/* 任务相关接口定义 */
/************************************************************************************/
/* 任务类型 */
typedef enum OSP_TASK_TYPE
{
OSP_NORMAL_TYPE, /* 周期性任务(普通任务) */
OSP_TIMER_TYPE, /* 定时点触发任务 */
OSP_EVENT_TYPE, /* 事件触发任务 */
OSP_DRIVER_TYPE, /* 驱动任务 */
OSP_OSP_TYPE, /* 平台任务 */
}task_type;
/* 函数类型*/
typedef void(*OSP_TASKENTRY_FUNC)();
typedef void(*OSP_TASKINIT_FUNC)(void);
/* 任务信息结构体 */
typedef struct OSP_TASK_INFO_EX
{
uint32_t task_id; /* 任务Id物理层用1-55 */
char *task_name; /* 任务名称(要求长度不能增加31字节) */
uint32_t task_prio; /* 任务优先级物理层用1-55数字越小优先级越高 */
uint32_t stack_size; /* 堆栈大小 */
uint32_t task_type; /* 任务类型 当OSP_TIMER_TYPE时s_bitmap和t_off才有效 */
uint32_t delay_value; /* 是否需要延时 0不延时 ; n: 延时n个tick */
uint32_t s_bitmap; /* slot bit map : 最多支持10个时隙每个时隙最多50个点 */
uint32_t t_off; /* 偏移时间 */
OSP_TASKINIT_FUNC task_init; /* 任务初始化 */
OSP_TASKENTRY_FUNC task_entry; /* 任务循环体 */
}osp_task_info_ex;
/*
osp_task_create
task_st_info *
*/
extern int osp_task_create(osp_task_info_ex *);
/*
osp_del_task
prio :
*/
extern void osp_del_task(int prio);
/*
ucp_enter_critical
*/
extern void smart_int_disable(void);
/*
ucp_exit_critical
*/
extern void smart_int_enable(void);
/*
osp_del_task
prio :
*/
extern int osp_strlen(const char * str);
/************************************************************************************/
/* 消息通信相关接口 */
/************************************************************************************/
/* 消息类型 */
typedef enum OSP_MSG_TYPE
{
UCP4008_KERNEL_INTER = 0, /* 核间通信 */
UCP4008_OSP_HANDSHAKE = 7, /* 握手消息 */
UCP4008_OSP_CFG_FILE, /* 微码配置文件消息 */
UCP4008_OSP_DDR_INIT, /* DDR初始化配置消息 */
UCP4008_OSP_DUMP, /* DUMP消息 */
UCP4008_OSP_LOG, /* LOG消息 */
UCP4008_OSP_SHELL, /* Shell消息 */
UCP4008_OSP_SHELL_ECHO, /* Shell回显消息 */
UCP4008_KERNEL_INNER = 0xFF,/* 核内通信 */
}osp_msg_type;
#define OSP_MSG_HEAD_LEN (12) /* OSP消息头的长度消息头的具体定义在osp_msg.h中 */
/*
osp_alloc_msg
DDR上
size
0
-NULLPTR
*/
extern char *osp_alloc_msg(int size);
/*
osp_send_msg
msg_addr
msg_len
msg_type
src_core_idID
dst_core_idID
src_task_idID
dst_task_idID
0
-2
-1
*/
extern int osp_send_msg(uint32_t msg_addr,
uint32_t msg_len,
uint8_t msg_type,
uint8_t src_core_id,
uint8_t dst_core_id,
uint8_t src_task_id,
uint8_t dst_task_id);
/************************************************************************************/
/* 配置文件相关接口 */
/************************************************************************************/
/*
osp_get_cfgfile
DDR地址及长度
name64
pbufDDR中的地址
psizeDDR中配置文件的长度
0
-1
-2
*/
extern int osp_get_cfgfile(char* name, uint32_t *pbuf, int* psize);
/************************************************************************************/
/* 定时点相关接口 */
/************************************************************************************/
/*
osp_timer_sync
使
int scsId:ID号
typedef enum _tagScsID
{
LTE_SCS_ID = 0,
NR_SCS_30K,
NR_SCS_60K,
NR_SCS_120K,
SCS_NULL = 0xFFFF
}numScsID;
*/
extern void osp_timer_sync(int scsId); /* 使能任务定时点 */
/************************************************************************************/
/* 其他相关接口 */
/************************************************************************************/
/*
osp_get_ddr_mem
DDR的首地址
DDR的首地址
*/
extern uint32_t osp_get_ddr_mem(void);
/*
osp_heap_malloc
DDR里分配内存
size
DDR内存地址
*/
extern char *osp_heap_malloc(uint32_t size);
/*
osp_heap_free
DDR里分配内存
*/
extern void osp_heap_free(char *p);
#endif
//#endif
#endif