2023-07-13 11:27:03 +08:00
|
|
|
#ifndef _JESD_CSU_H_
|
|
|
|
#define _JESD_CSU_H_
|
|
|
|
|
|
|
|
#include "typedef.h"
|
|
|
|
|
|
|
|
#define JS_204B_CONVERTER_BITS 16 // 12
|
|
|
|
#define JS_204B_CS_BITS 0 // 2
|
|
|
|
#define JS_204B_CF_VAL 0
|
|
|
|
|
2023-10-13 17:11:53 +08:00
|
|
|
#define JESD_CSU_RX0_TAG 0
|
|
|
|
#define JESD_CSU_TX0_TAG 1
|
|
|
|
#define JESD_CSU_RX1_TAG 2
|
|
|
|
#define JESD_CSU_TX1_TAG 3
|
|
|
|
|
|
|
|
#define JESD_CH_NUM 2 // rx0/rx1, tx0/tx1
|
|
|
|
#define JESD_LIST_NUM 2 // double 2.5ms, 2 lists for every ch
|
|
|
|
|
2023-07-13 11:27:03 +08:00
|
|
|
typedef enum _tagJesdCsuCh
|
|
|
|
{
|
|
|
|
JESD_CSU_CH0 = 0,
|
|
|
|
JESD_CSU_CH1 = 1
|
|
|
|
}numJesdCsuCh;
|
|
|
|
|
|
|
|
typedef struct _tagJesdCsuPara
|
|
|
|
{
|
|
|
|
uint8_t antNum; // 天线数
|
|
|
|
uint8_t cf;
|
|
|
|
uint8_t cs; // 控制字, =2
|
|
|
|
uint8_t n; // iq数据精度, = 12
|
|
|
|
uint8_t m; // 天线数*2
|
|
|
|
uint8_t nTotal; // n+cs+padding
|
|
|
|
uint8_t seq;
|
|
|
|
uint8_t margin;
|
|
|
|
uint8_t reserved;
|
|
|
|
}stJesdCsuPara;
|
|
|
|
|
|
|
|
typedef struct _tagJesdCsuNodePara
|
|
|
|
{
|
|
|
|
uint32_t dataAddr;
|
|
|
|
uint32_t yStep;
|
|
|
|
uint32_t allNum;
|
|
|
|
}stJesdCsuNodePara;
|
|
|
|
|
|
|
|
int32_t jesd_csu_init(uint8_t antNum, uint8_t margin);
|
|
|
|
|
2023-10-30 14:23:55 +08:00
|
|
|
int32_t jesd_orx_csu_init(void);
|
|
|
|
|
2023-07-13 11:27:03 +08:00
|
|
|
int32_t jesd_csu_rx_inlatch_thres_cfg(uint8_t ch, uint32_t send_threshold, uint32_t almostfull_threshold);
|
|
|
|
|
2023-10-13 17:11:53 +08:00
|
|
|
/***********************************************************************************
|
|
|
|
ch list RegGroup CmdFIFO tagId = RegGroupId
|
|
|
|
rx0 0/1/2/3 0/4/8/12 0 0/4/8/12
|
|
|
|
tx0 0/1/2/3 1/5/9/13 1 1/5/9/13
|
|
|
|
rx1 0/1/2/3 2/6/10/14 2 2/6/10/14
|
|
|
|
tx1 0/1/2/3 3/7/11/15 3 3/7/11/15
|
|
|
|
************************************************************************************/
|
2023-07-13 11:27:03 +08:00
|
|
|
|
2023-10-13 17:11:53 +08:00
|
|
|
int32_t jesd_csu_rx_cfg(uint32_t listAddr, uint32_t nodeNum, stJesdCsuNodePara* pListNode, uint8_t nChId, uint8_t nListId);
|
2023-07-13 11:27:03 +08:00
|
|
|
|
2023-10-13 17:11:53 +08:00
|
|
|
int32_t jesd_csu_tx_cfg(uint32_t listAddr, uint32_t nodeNum, stJesdCsuNodePara* pListNode, uint8_t nChId, uint8_t nListId);
|
2023-07-13 11:27:03 +08:00
|
|
|
|
2023-10-30 14:23:55 +08:00
|
|
|
int32_t jesd_csu_orx_cfg(uint32_t listAddr, uint32_t nodeNum, stJesdCsuNodePara* pListNode, uint8_t nListId);
|
2023-07-13 11:27:03 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|