/******************************************************************
 * @file  task_define.h
 * @brief:    task common define
 * @author: guicheng.liu
 * @Date 2021年1月21日
 * COPYRIGHT NOTICE: (c) smartlogictech. All rights reserved. 
 * Change_date         Owner         Change_content
 * 2021年1月21日        guicheng.liu       create file

*****************************************************************/

#ifndef     TASK_DEFINE_H
#define     TASK_DEFINE_H
#include <type_define.h>
#include "osp_ape.h"

typedef enum
{
    //1-31
    PHY_TASK_PRI_BASE=1,
    PHY_TASK_PRI_CONFIG,
    PHY_TASK_PRI_SLOT_IND,
    PHY_TASK_PRI_TRANSMITTER,
    PHY_TASK_PRI_RECEIVER_SYNC,
    PHY_TASK_PRI_RECEIVER_SYMB,
    PHY_TASK_PRI_RECEIVER_BIT,    
    PHY_TASK_PRI_TEST,
    PHY_TASK_PRI_RECEIVER_FIRST_SYNC,
    PCIE_TASK_PRI_RECEIVER,
    PHY_TASK_PRI_EQUAL_PRI, //不需要优先级抢占的任务，设置为该优先级
}task_pri_e;


typedef enum
{
    //1-31
    PHY_TASK_BASE=1,
    PHY_TASK_CONFIG,
    PHY_TASK_SLOT_IND,
    PHY_TASK_TRANSIMITTER,
    PHY_TASK_RECIEVER_SYNC,
    PHY_TASK_RECIEVER_SYMB,
    PHY_TASK_RECIEVER_BIT,
    PHY_TASK_TEST,
    PHY_TASK_RECIEVER_FIRST_SYNC,
    PCIE_TASK_RECEIVER,
    PHY_TASK_PHY_MGR,
    PHY_TASK_MAX=32
}task_id_e;

typedef struct
{
    task_id_e task_id;
    char* task_name;
    OSP_TASKINIT_FUNC  task_init;  /* 任务初始化 */
    OSP_TASKENTRY_FUNC task_entry; /* 任务循环体 */
}task_fun_t;

typedef struct
{
    uint32_t num_task;
    task_fun_t fun[PHY_TASK_MAX];
}task_table_t;

#endif
