no-OS
mykonos_dbgjesd.h
Go to the documentation of this file.
1 
16 #ifndef MYKONOS_DBGJESD_H_
17 #define MYKONOS_DBGJESD_H_
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include "mykonos.h"
24 #include "t_mykonos_gpio.h"
25 #include "t_mykonos_dbgjesd.h"
26 #include "mykonos_user.h"
27 
28 /*
29  *****************************************************************************
30  * JESD debug functions
31  *****************************************************************************
32  */
34 
37 
40 
43 
45 
47 
50 
52 
54 
55 mykonosDbgErr_t MYKONOS_framerSetPatternGen(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint32_t pattern, uint8_t enable, uint8_t toggle);
56 mykonosDbgErr_t MYKONOS_framerGetPatternGen(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint32_t *pattern, uint8_t *enable, uint8_t *toggle);
57 
60 
61 /* Helper functions for indirect access to internal register */
62 mykonosDbgErr_t MYKONOS_jesdIndWrReg(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint8_t intAddr, uint8_t data);
63 mykonosDbgErr_t MYKONOS_jesdIndRdReg(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint8_t intAddr, uint8_t *data);
64 
65 mykonosDbgErr_t MYKONOS_framerCoreSel(mykonos_jesdcore_t jesdCore, uint16_t rxFramerAdd, uint16_t *baseAddr);
66 
67 
68 const char* getDbgJesdMykonosErrorMessage(mykonosDbgErr_t errorCode);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* MYKONOS_DBGJESD_H_ */
MYK_LANE_2
@ MYK_LANE_2
Definition: t_mykonos_dbgjesd.h:78
MYK_NIT
@ MYK_NIT
Definition: t_mykonos_dbgjesd.h:130
MYKONOS_ADDR_FRAMER_PATTERN_GEN_EN
#define MYKONOS_ADDR_FRAMER_PATTERN_GEN_EN
Definition: mykonos_macros.h:67
MYKONOS_ERR_DBG_ZERO_DATA_LANE_NULL
@ MYKONOS_ERR_DBG_ZERO_DATA_LANE_NULL
Definition: t_mykonos_dbgjesd.h:53
MYKONOS_ERR_DBG_PATTERN_GEN_NULL_PATTERN
@ MYKONOS_ERR_DBG_PATTERN_GEN_NULL_PATTERN
Definition: t_mykonos_dbgjesd.h:48
MYKONOS_deframerSetSyncMask
mykonosDbgErr_t MYKONOS_deframerSetSyncMask(mykonosDevice_t *device, uint8_t errSyncMask)
Performs set JESD Deframer Sync mask.
Definition: mykonos_dbgjesd.c:685
MYKONOS_deframerSetIrqMask
mykonosDbgErr_t MYKONOS_deframerSetIrqMask(mykonosDevice_t *device, uint8_t errIrqMsk)
Performs set JESD Deframer IRQ mask that will be used to generates interrupts.
Definition: mykonos_dbgjesd.c:897
MYKONOS_ADDR_DEFRAMER_ADDR
#define MYKONOS_ADDR_DEFRAMER_ADDR
Definition: mykonos_macros.h:82
MYKONOS_deframerGetErrThrs
mykonosDbgErr_t MYKONOS_deframerGetErrThrs(mykonosDevice_t *device, uint8_t *errThrs)
Performs read JESD Deframer error thresholds.
Definition: mykonos_dbgjesd.c:630
MYKONOS_deframerGetSyncMask
mykonosDbgErr_t MYKONOS_deframerGetSyncMask(mykonosDevice_t *device, uint8_t *errSyncMask)
Performs get JESD Deframer SyncMask.
Definition: mykonos_dbgjesd.c:749
MYKONOS_jesdIndRdReg
mykonosDbgErr_t MYKONOS_jesdIndRdReg(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint8_t intAddr, uint8_t *data)
Performs indirect read access to internal JESD register.
Definition: mykonos_dbgjesd.c:173
MYK_OBS_FRAMER
@ MYK_OBS_FRAMER
Definition: t_mykonos_dbgjesd.h:68
CMB_writeToLog
commonErr_t CMB_writeToLog(ADI_LOGLEVEL level, uint8_t deviceIndex, uint32_t errorCode, const char *comment)
Definition: common.c:250
MYKONOS_ERR_DBG_FRAMER_ILLEGAL_JESD_CORE
@ MYKONOS_ERR_DBG_FRAMER_ILLEGAL_JESD_CORE
Definition: t_mykonos_dbgjesd.h:56
MYKONOS_framerSetZeroData
mykonosDbgErr_t MYKONOS_framerSetZeroData(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, mykonosLaneSel_t lane)
Performs set JESD framer Zero data samples per lane.
Definition: mykonos_dbgjesd.c:1206
MYKONOS_jesdIndWrReg
mykonosDbgErr_t MYKONOS_jesdIndWrReg(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint8_t intAddr, uint8_t data)
Performs indirect write access to internal JESD register.
Definition: mykonos_dbgjesd.c:122
MYKONOS_deframerGetEnLanes
mykonosDbgErr_t MYKONOS_deframerGetEnLanes(mykonosDevice_t *device, uint8_t *lane)
Performs read of enabled JESD Deframer lanes.
Definition: mykonos_dbgjesd.c:806
MYKONOS_deframerSetErrThrs
mykonosDbgErr_t MYKONOS_deframerSetErrThrs(mykonosDevice_t *device, uint8_t errThrs)
Performs set JESD Deframer error thresholds.
Definition: mykonos_dbgjesd.c:594
mykonosDbgErr_t
mykonosDbgErr_t
Enum of unique error codes from the Mykonos DBG API functions. Each error condition in the library sh...
Definition: t_mykonos_dbgjesd.h:30
ADIHAL_LOG_ERROR
@ ADIHAL_LOG_ERROR
Definition: common.h:51
MYKONOS_ERR_DBG_PATTERN_GEN_NULL_ENABLE
@ MYKONOS_ERR_DBG_PATTERN_GEN_NULL_ENABLE
Definition: t_mykonos_dbgjesd.h:49
toggle
void toggle(struct no_os_gpio_desc *led)
Definition: blinky_example.c:26
mykonosLaneErr_t::uekcCntr
uint8_t uekcCntr
Definition: t_mykonos_dbgjesd.h:141
mykonosLaneSel_t
mykonosLaneSel_t
Enum to set the Lane.
Definition: t_mykonos_dbgjesd.h:74
MYKONOS_framerGetPatternGen
mykonosDbgErr_t MYKONOS_framerGetPatternGen(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint32_t *pattern, uint8_t *enable, uint8_t *toggle)
Gets JESD framer Pattern generator.
Definition: mykonos_dbgjesd.c:1119
getDbgJesdMykonosErrorMessage
const char * getDbgJesdMykonosErrorMessage(mykonosDbgErr_t errorCode)
Helper function for return of character string based on 32-bit mykonosDbgErr_t enum value.
Definition: mykonos_dbgjesd.c:35
MYKONOS_deframerRstErrCntr
mykonosDbgErr_t MYKONOS_deframerRstErrCntr(mykonosDevice_t *device, mykonosErrType_t errType, mykonosLaneSel_t lane)
Performs reset of the selected error type for the selected lane.
Definition: mykonos_dbgjesd.c:341
MYK_FRAMER
@ MYK_FRAMER
Definition: t_mykonos_dbgjesd.h:66
MYKONOS_framerGetZeroData
mykonosDbgErr_t MYKONOS_framerGetZeroData(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, mykonosLaneSel_t *lane)
Performs get JESD framer Zero data samples.
Definition: mykonos_dbgjesd.c:1255
MYKONOS_framerCoreSel
mykonosDbgErr_t MYKONOS_framerCoreSel(mykonos_jesdcore_t jesdCore, uint16_t rxFramerAdd, uint16_t *baseAddr)
Helper function to perform JESD framer core selection.
Definition: mykonos_dbgjesd.c:1309
device
Definition: ad9361_util.h:69
MYKONOS_deframerRstErrIrq
mykonosDbgErr_t MYKONOS_deframerRstErrIrq(mykonosDevice_t *device, mykonosErrType_t errType, mykonosLaneSel_t lane)
Performs reset of the selected error type IRQ for the given lane.
Definition: mykonos_dbgjesd.c:401
MYKONOS_ERR_DBG_ILLEGAL_LANE_NUMBER
@ MYKONOS_ERR_DBG_ILLEGAL_LANE_NUMBER
Definition: t_mykonos_dbgjesd.h:34
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER
@ MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER
Definition: t_mykonos_dbgjesd.h:38
MYKONOS_ADDR_FRAMER_DATA_SAMPLE_CTL
#define MYKONOS_ADDR_FRAMER_DATA_SAMPLE_CTL
Definition: mykonos_macros.h:73
ADIHAL_LOG_MESSAGE
@ ADIHAL_LOG_MESSAGE
Definition: common.h:49
MYKONOS_deframerRdErrCntr
mykonosDbgErr_t MYKONOS_deframerRdErrCntr(mykonosDevice_t *device, mykonosLaneSel_t laneSel, mykonosLaneErr_t *laneErr)
Performs read back of the error counters for selected lane of the JESD Deframer.
Definition: mykonos_dbgjesd.c:496
t_mykonos_gpio.h
Mykonos GPIO error handling and type defines.
mykonos_user.h
Contains macro definitions and global structure declarations for mykonos_user.c.
MYKONOS_deframerGetErrLane
mykonosDbgErr_t MYKONOS_deframerGetErrLane(mykonosDevice_t *device, mykonosErrType_t errType, uint8_t *lane)
Performs read back lanes in error for the given errType of the JESD Deframer.
Definition: mykonos_dbgjesd.c:290
CMB_SPIWriteByte
commonErr_t CMB_SPIWriteByte(spiSettings_t *spiSettings, uint16_t addr, uint8_t data)
Definition: common.c:173
MYKONOS_framerSetZeroData
mykonosDbgErr_t MYKONOS_framerSetZeroData(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, mykonosLaneSel_t lane)
Performs set JESD framer Zero data samples per lane.
Definition: mykonos_dbgjesd.c:1206
MYKONOS_framerSetPatternGen
mykonosDbgErr_t MYKONOS_framerSetPatternGen(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint32_t pattern, uint8_t enable, uint8_t toggle)
Performs set JESD framer Pattern Generator.
Definition: mykonos_dbgjesd.c:1034
MYK_DEFRAMER
@ MYK_DEFRAMER
Definition: t_mykonos_dbgjesd.h:67
MYKONOS_deframerGetEnLanes
mykonosDbgErr_t MYKONOS_deframerGetEnLanes(mykonosDevice_t *device, uint8_t *lane)
Performs read of enabled JESD Deframer lanes.
Definition: mykonos_dbgjesd.c:806
mykonosErrType_t
mykonosErrType_t
Enum for the error type.
Definition: t_mykonos_dbgjesd.h:126
MYKONOS_ADDR_DEFRAMER_TEST
#define MYKONOS_ADDR_DEFRAMER_TEST
Definition: mykonos_macros.h:94
MYKONOS_deframerRd2Stat
mykonosDbgErr_t MYKONOS_deframerRd2Stat(mykonosDevice_t *device, uint8_t *defStat2)
Performs reads to JESD Deframer secondary status register.
Definition: mykonos_dbgjesd.c:236
MYKONOS_deframerForceSyncReq
mykonosDbgErr_t MYKONOS_deframerForceSyncReq(mykonosDevice_t *device, uint8_t syncReq)
Performs Deframer Force SYNC requests.
Definition: mykonos_dbgjesd.c:856
MYKONOS_ERR_DBG_FRAMER_SEL_BASE_ADD_NULL
@ MYKONOS_ERR_DBG_FRAMER_SEL_BASE_ADD_NULL
Definition: t_mykonos_dbgjesd.h:55
mykonosLaneErr_t::nitCntr
uint8_t nitCntr
Definition: t_mykonos_dbgjesd.h:140
MYKONOS_ADDR_FRAMER_ADDR
#define MYKONOS_ADDR_FRAMER_ADDR
Definition: mykonos_macros.h:43
MYKONOS_ERR_DBG_ILLEGAL_ERROR_SELECTED
@ MYKONOS_ERR_DBG_ILLEGAL_ERROR_SELECTED
Definition: t_mykonos_dbgjesd.h:36
MYKONOS_ERR_DBG_ILLEGAL_FRAMER_PATTERN
@ MYKONOS_ERR_DBG_ILLEGAL_FRAMER_PATTERN
Definition: t_mykonos_dbgjesd.h:44
MYKONOS_ERR_DBG_ERROR_SYNC_MASK
@ MYKONOS_ERR_DBG_ERROR_SYNC_MASK
Definition: t_mykonos_dbgjesd.h:40
CMB_SPIWriteField
commonErr_t CMB_SPIWriteField(spiSettings_t *spiSettings, uint16_t addr, uint8_t field_val, uint8_t mask, uint8_t start_bit)
Definition: common.c:219
mykonos_jesdcore_t
mykonos_jesdcore_t
Enum to select Jesd core.
Definition: t_mykonos_dbgjesd.h:64
MYKONOS_deframerRdErrCntr
mykonosDbgErr_t MYKONOS_deframerRdErrCntr(mykonosDevice_t *device, mykonosLaneSel_t laneSel, mykonosLaneErr_t *laneErr)
Performs read back of the error counters for selected lane of the JESD Deframer.
Definition: mykonos_dbgjesd.c:496
MYK_LANE_3
@ MYK_LANE_3
Definition: t_mykonos_dbgjesd.h:79
MYKONOS_deframerSetErrThrs
mykonosDbgErr_t MYKONOS_deframerSetErrThrs(mykonosDevice_t *device, uint8_t errThrs)
Performs set JESD Deframer error thresholds.
Definition: mykonos_dbgjesd.c:594
MYKONOS_ERR_DBG_ILLEGAL_ERROR_TYPE
@ MYKONOS_ERR_DBG_ILLEGAL_ERROR_TYPE
Definition: t_mykonos_dbgjesd.h:35
mykonosLaneErr_t
Data structure to hold the error counters per a given lane.
Definition: t_mykonos_dbgjesd.h:137
MYKONOS_ERR_DBG_ILLEGAL_JESD_CORE
@ MYKONOS_ERR_DBG_ILLEGAL_JESD_CORE
Definition: t_mykonos_dbgjesd.h:37
getDbgJesdMykonosErrorMessage
const char * getDbgJesdMykonosErrorMessage(mykonosDbgErr_t errorCode)
Helper function for return of character string based on 32-bit mykonosDbgErr_t enum value.
Definition: mykonos_dbgjesd.c:35
MYK_BADDISP
@ MYK_BADDISP
Definition: t_mykonos_dbgjesd.h:129
MYKONOS_ERR_DBG_FAIL
@ MYKONOS_ERR_DBG_FAIL
Definition: t_mykonos_dbgjesd.h:33
MYKONOS_deframerForceSyncReq
mykonosDbgErr_t MYKONOS_deframerForceSyncReq(mykonosDevice_t *device, uint8_t syncReq)
Performs Deframer Force SYNC requests.
Definition: mykonos_dbgjesd.c:856
MYKONOS_framerCoreSel
mykonosDbgErr_t MYKONOS_framerCoreSel(mykonos_jesdcore_t jesdCore, uint16_t rxFramerAdd, uint16_t *baseAddr)
Helper function to perform JESD framer core selection.
Definition: mykonos_dbgjesd.c:1309
MYKONOS_ERR_DBG_ILLEGAL_ENABLE
@ MYKONOS_ERR_DBG_ILLEGAL_ENABLE
Definition: t_mykonos_dbgjesd.h:45
mykonos_macros.h
Contains address and miscellaneous macro definitions for Mykonos API.
MYKONOS_deframerGetIrq
mykonosDbgErr_t MYKONOS_deframerGetIrq(mykonosDevice_t *device, uint8_t *errIrq)
Performs a read of the JESD IRQ vector for the deframer.
Definition: mykonos_dbgjesd.c:967
mykonosDevice_t
Data structure to hold Mykonos device settings.
Definition: t_mykonos.h:1695
MYKONOS_deframerSetSyncMask
mykonosDbgErr_t MYKONOS_deframerSetSyncMask(mykonosDevice_t *device, uint8_t errSyncMask)
Performs set JESD Deframer Sync mask.
Definition: mykonos_dbgjesd.c:685
MYK_UEKC
@ MYK_UEKC
Definition: t_mykonos_dbgjesd.h:131
MYKONOS_jesdIndRdReg
mykonosDbgErr_t MYKONOS_jesdIndRdReg(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint8_t intAddr, uint8_t *data)
Performs indirect read access to internal JESD register.
Definition: mykonos_dbgjesd.c:173
MYKONOS_ERR_DBG_ERROR_IRQ_MASK
@ MYKONOS_ERR_DBG_ERROR_IRQ_MASK
Definition: t_mykonos_dbgjesd.h:41
MYKONOS_jesdIndWrReg
mykonosDbgErr_t MYKONOS_jesdIndWrReg(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint8_t intAddr, uint8_t data)
Performs indirect write access to internal JESD register.
Definition: mykonos_dbgjesd.c:122
MYKONOS_ERR_DBG_ERROR_THRESHOLD
@ MYKONOS_ERR_DBG_ERROR_THRESHOLD
Definition: t_mykonos_dbgjesd.h:42
CMB_SPIReadByte
commonErr_t CMB_SPIReadByte(spiSettings_t *spiSettings, uint16_t addr, uint8_t *readdata)
Definition: common.c:202
NULL
#define NULL
Definition: wrapper.h:64
MYKONOS_ERR_DBG_ZERO_DATA_INV_LANE
@ MYKONOS_ERR_DBG_ZERO_DATA_INV_LANE
Definition: t_mykonos_dbgjesd.h:52
t_mykonos_dbgjesd.h
Contains definitions and structure declarations for mykonos_dbgjesd.c.
MYKONOS_deframerGetErrLane
mykonosDbgErr_t MYKONOS_deframerGetErrLane(mykonosDevice_t *device, mykonosErrType_t errType, uint8_t *lane)
Performs read back lanes in error for the given errType of the JESD Deframer.
Definition: mykonos_dbgjesd.c:290
MYK_LANE_1
@ MYK_LANE_1
Definition: t_mykonos_dbgjesd.h:77
MYKONOS_deframerRd2Stat
mykonosDbgErr_t MYKONOS_deframerRd2Stat(mykonosDevice_t *device, uint8_t *defStat2)
Performs reads to JESD Deframer secondary status register.
Definition: mykonos_dbgjesd.c:236
MYKONOS_deframerRstErrCntr
mykonosDbgErr_t MYKONOS_deframerRstErrCntr(mykonosDevice_t *device, mykonosErrType_t errType, mykonosLaneSel_t lane)
Performs reset of the selected error type for the selected lane.
Definition: mykonos_dbgjesd.c:341
MYKONOS_framerGetZeroData
mykonosDbgErr_t MYKONOS_framerGetZeroData(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, mykonosLaneSel_t *lane)
Performs get JESD framer Zero data samples.
Definition: mykonos_dbgjesd.c:1255
MYKONOS_ADDR_DEFRAMER_STATUS_2
#define MYKONOS_ADDR_DEFRAMER_STATUS_2
Definition: mykonos_macros.h:129
mykonos.h
Contains macro definitions and function prototypes for mykonos.c.
MYKONOS_deframerRstErrIrq
mykonosDbgErr_t MYKONOS_deframerRstErrIrq(mykonosDevice_t *device, mykonosErrType_t errType, mykonosLaneSel_t lane)
Performs reset of the selected error type IRQ for the given lane.
Definition: mykonos_dbgjesd.c:401
MYKONOS_deframerSetIrqMask
mykonosDbgErr_t MYKONOS_deframerSetIrqMask(mykonosDevice_t *device, uint8_t errIrqMsk)
Performs set JESD Deframer IRQ mask that will be used to generates interrupts.
Definition: mykonos_dbgjesd.c:897
MYKONOS_ADDR_DEFRAMER_STAT_STRB
#define MYKONOS_ADDR_DEFRAMER_STAT_STRB
Definition: mykonos_macros.h:96
MYKONOS_deframerGetErrThrs
mykonosDbgErr_t MYKONOS_deframerGetErrThrs(mykonosDevice_t *device, uint8_t *errThrs)
Performs read JESD Deframer error thresholds.
Definition: mykonos_dbgjesd.c:630
MYKONOS_deframerGetSyncMask
mykonosDbgErr_t MYKONOS_deframerGetSyncMask(mykonosDevice_t *device, uint8_t *errSyncMask)
Performs get JESD Deframer SyncMask.
Definition: mykonos_dbgjesd.c:749
MYKONOS_deframerGetIrq
mykonosDbgErr_t MYKONOS_deframerGetIrq(mykonosDevice_t *device, uint8_t *errIrq)
Performs a read of the JESD IRQ vector for the deframer.
Definition: mykonos_dbgjesd.c:967
MYKONOS_ERR_DBG_ILLEGAL_TOGGLE
@ MYKONOS_ERR_DBG_ILLEGAL_TOGGLE
Definition: t_mykonos_dbgjesd.h:47
MYKONOS_ERR_DBG_OK
@ MYKONOS_ERR_DBG_OK
Definition: t_mykonos_dbgjesd.h:32
MYKONOS_ADDR_OBS_FRAMER_ADDR
#define MYKONOS_ADDR_OBS_FRAMER_ADDR
Definition: mykonos_macros.h:606
MYK_LANE_0
@ MYK_LANE_0
Definition: t_mykonos_dbgjesd.h:76
MYKONOS_framerSetPatternGen
mykonosDbgErr_t MYKONOS_framerSetPatternGen(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint32_t pattern, uint8_t enable, uint8_t toggle)
Performs set JESD framer Pattern Generator.
Definition: mykonos_dbgjesd.c:1034
MYK_CMM
@ MYK_CMM
Definition: t_mykonos_dbgjesd.h:128
MYKONOS_framerGetPatternGen
mykonosDbgErr_t MYKONOS_framerGetPatternGen(mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, uint32_t *pattern, uint8_t *enable, uint8_t *toggle)
Gets JESD framer Pattern generator.
Definition: mykonos_dbgjesd.c:1119
mykonos_dbgjesd.h
Contains macro definitions and global structure declarations for mykonos_dbgjesd.c.
mykonosLaneErr_t::badDispCntr
uint8_t badDispCntr
Definition: t_mykonos_dbgjesd.h:139
MYKONOS_ERR_DBG_PATTERN_GEN_NULL_TOGGLE
@ MYKONOS_ERR_DBG_PATTERN_GEN_NULL_TOGGLE
Definition: t_mykonos_dbgjesd.h:50