xinxin.li 61a8435a6d > 1. 增加cpri模式,帧头提前2ms的功能,UCP4008-SL-EVB New Feature #926;
> 2. 系统平台lib库更新;
> 3. 增加单模模式下,双小区的删建功能;
> 4. 回归测试case:case21/case22(NR15K)/case34/case37/case68(LTE)
2023-08-18 20:30:52 +08:00

280 lines
6.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __SMARTOS_H__
#define __SMARTOS_H__
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
typedef void (*start_hook_func)(int);
typedef void (*irq_handler)();
typedef enum
{
smart_all_irq,
smart_fun_s,
smart_fun_e,
smart_clear_cnt_error,
smart_irq_check_error
}smart_irq_cnt_type_t;
/*
函数名称smart_kernel_init
输入参数: usr_startup
输入参数: cpuid
返回类型void
函数功能smart系统初始化接口
*/
extern void smart_kernel_init(start_hook_func *usr_startup,int cpuid);
/*
函数名称smart_irq_enable
输入参数: vector
返回类型int
返回值 小于0 注册
返回值等于0 成功
函数功能: 使能对应中断号的intmask
*/
int smart_irq_enable(uint32_t vector);
/*
函数名称smart_irq_disable
输入参数: vector
返回类型int
返回值 小于0 注册
返回值等于0 成功
函数功能: 屏蔽对应中断号对应的intmask
*/
int smart_irq_disable(uint32_t vector);
/*
函数名称smart_irq_request
输入参数: vector
输入参数: func 函数指针
返回类型int
返回值 小于0 注册失败
返回值等于0 注册成功
函数功能: 中断注册接口
*/
extern int smart_irq_request(uint32_t vector,irq_handler func);
/*
函数名称smart_irq_free
参数vector
返回值0:成功 非0失败
函数功能:中断注销
*/
extern int smart_irq_free(uint32_t vector);
/*
函数名称smart_int_disable
参数:无
返回值:无
函数功能:关中断
*/
extern void smart_int_disable();
/*
函数名称smart_int_enable
参数:无
返回值:无
函数功能:开中断
*/
extern void smart_int_enable();
/*
函数名称smart_get_curprio
输入参数: 无
返回类型int
返回值 小于0获取失败
返回值大于0获取成功
*/
extern int smart_get_curprio();
/*
函数名称smart_get_cpuid
输入参数: 无
返回类型int
返回值 小于0获取失败
返回值大于0获取成功
*/
extern int smart_get_cpuid();
/*
函数名称smart_task_create
输入参数: void (*task)(void *p_arg)
输入参数:*p_arg
输入参数:*ptos; 栈顶
输入参数prio 优先级
输入参数id 任务id 号
输入参数:*pbos 栈底
输入参数stk_size; 堆栈大小
返回类型int
返回值0任务注册成功
函数功能:注册任务
*/
extern uint8_t smart_task_create (void (*task)(void *p_arg),
void *p_arg,
uint32_t *ptos,
uint8_t prio,
uint16_t id,
uint32_t *pbos,
uint32_t stk_size);
/*
函数名称smart_tick_sleep
输入参数: cycle
参数类型: int
返回值:无
函数功能休眠tick 时间
*/
extern void smart_tick_sleep(int cycle);
/*
函数名称smart_task_del
输入参数: prio
参数类型: int
返回值:无
函数功能:删除任务
*/
extern void smart_task_del(int prio);
/*****************************************************************
sem relation
****************************************************************/
/******************************************
函数名称smart_sem_create
输入参数: cnt
参数类型: int
返回值void *
函数功能:创建计数信号量,返回信号量句柄
*****************************************/
extern void *smart_sem_create(int cnt);
/******************************************
函数名称smart_sem_pend
输入参数: void *sem 信号量句柄
参数类型: void *
返回值:无
函数功能:获取信号量,失败休眠
*****************************************/
extern void smart_sem_pend(void *sem);
/******************************************
函数名称smart_sem_post
输入参数: void *sem 信号量句柄
参数类型: void *
返回值: 0 成功小于0 失败
函数功能:释放信号量
*****************************************/
extern int smart_sem_post(void *sem);
/*******************************************
函数名称smart_sem_del
输入参数: void *sem 信号量句柄
参数类型: void *
返回值: 0 成功小于0 失败
函数功能:释放信号量
******************************************/
extern int smart_sem_del(void *sem);
/*
函数名称smart_irq_debug_init
输入参数debug_base_addr 调试buf 首地址
输入参数len_bytes 调试buf 长度
返回类型int
返回值 小于0 返回失败
返回值: 等于0 返回成功
函数功能:中断调试初始化接口
*/
extern int smart_get_reg_prio(int *buf);
extern int smart_irq_debug_init(uint32_t debug_base_addr, uint32_t len_bytes);
/*
函数名称smart_irq_get_type_cnt
输入参数num_type
输入参数:参数类型 irq_cnt_type_t
typedef enum
{
all_irq,
fun_s,
fun_e,
clear_cnt_error,
irq_check_error
}irq_cnt_type_t;
返回类型uint32_t
返回值 小于0 返回失败
返回值: 等于0 返回成功
函数功能:获取各类型中断计数
*/
extern uint32_t smart_irq_get_type_cnt(smart_irq_cnt_type_t num_type);
/*
函数名称smart_irq_get_run_cnt
输入参数irqnum
返回类型int
返回值 小于0 返回失败
返回值: 大于0 返回成功
函数功能:获取中断入口统计计数
*/
extern int smart_irq_get_run_cnt(uint32_t irqnum);
/*
函数名称smart_os_debug_init
输入参数debug_base_addr 调试buf 首地址
输入参数len_bytes 调试buf 长度
返回类型int
返回值 小于0 返回失败
返回值: 等于0 返回成功
函数功能:中断调试初始化接口
*/
extern int smart_os_debug_init( uint32_t debug_base_addr, uint32_t len_bytes);
#endif