/**********************************************************************************************************************
*  Copyright (C), 2022-2026, SMARTLOGIC TECHNOLOGY LTD.
*  File Name: ecpri_csu.h
*  Create Date: 23/07/31
*  Description: eCPRI CSU Module Header File
*  Change History:
*      <author>      <time>      <version>   <desc>
*    1. LiX         23/07/31        1.0       Build this module
**********************************************************************************************************************/

#ifndef _ECPRI_CSU_H_
#define _ECPRI_CSU_H_

#include "typedef.h"
#include "ucp_csu.h"
#include "ucp_utility.h"
#include "ape_csu.h"
#include "ecpri_queue_proc.h"


#ifndef NULL
#define NULL                                                ((void *)0)
#endif

#define ECPRI_CSU_REG_NUM                                   32
#define ECPRI_CSU_RFM_REG_START                             0
#define ECPRI_CSU_RFM_REG_END                               11

#define ECPRI_CSU_DATA_BUF_ADDR                             (ECPRI_DATA_BUF_ADDR + ECPRI_DATA_BUF_SIZE) // (ECPRI_DATA_BUF_ADDR + ECPRI_DATA_BUF_SIZE)

#define ECPRI_CSU_DBG_BUF_ADDR                              (ECPRI_DBG_BUF_ADDR + 0x00080000ul) // (ECPRI_DATA_BUF_ADDR + ECPRI_DATA_BUF_SIZE)

//#define SERDES_INIT_FLAG_ADDR	(0x0A4D7240) // cpri or jesd clk init finished

typedef enum _tagEcpriChId
{
    ECPRI_U_PLANE = 0,
    ECPRI_C_PLANE
} EcpriChId;


int32_t ecpri_csu_init(void);

uint32_t ecpri_csu_get_free_channel(void);

uint32_t ecpri_csu_send(uint64_t dataAddr, uint32_t dataLen, uint8_t isWait);

int32_t ecpri_csu_task_lookup(uint8_t task_tag, uint8_t isWait);

void ecpri_csu_send_test(void);
#endif



