no-OS
|
Contains macro definitions and global structure declarations for mykonos_dbgjesd.c. More...
#include "mykonos.h"
#include "t_mykonos_gpio.h"
#include "t_mykonos_dbgjesd.h"
#include "mykonos_user.h"
Go to the source code of this file.
Functions | |
mykonosDbgErr_t | MYKONOS_deframerRd2Stat (mykonosDevice_t *device, uint8_t *defStat2) |
Performs reads to JESD Deframer secondary status register. More... | |
mykonosDbgErr_t | MYKONOS_deframerSetErrThrs (mykonosDevice_t *device, uint8_t errThrs) |
Performs set JESD Deframer error thresholds. More... | |
mykonosDbgErr_t | MYKONOS_deframerGetErrThrs (mykonosDevice_t *device, uint8_t *errThrs) |
Performs read JESD Deframer error thresholds. More... | |
mykonosDbgErr_t | MYKONOS_deframerSetIrqMask (mykonosDevice_t *device, uint8_t errIrqMsk) |
Performs set JESD Deframer IRQ mask that will be used to generates interrupts. More... | |
mykonosDbgErr_t | MYKONOS_deframerGetIrq (mykonosDevice_t *device, uint8_t *errIrq) |
Performs a read of the JESD IRQ vector for the deframer. More... | |
mykonosDbgErr_t | MYKONOS_deframerSetSyncMask (mykonosDevice_t *device, uint8_t errSyncMask) |
Performs set JESD Deframer Sync mask. More... | |
mykonosDbgErr_t | MYKONOS_deframerGetSyncMask (mykonosDevice_t *device, uint8_t *errSyncMask) |
Performs get JESD Deframer SyncMask. More... | |
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. More... | |
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. More... | |
mykonosDbgErr_t | MYKONOS_deframerRstErrCntr (mykonosDevice_t *device, mykonosErrType_t errType, mykonosLaneSel_t lane) |
Performs reset of the selected error type for the selected lane. More... | |
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. More... | |
mykonosDbgErr_t | MYKONOS_deframerGetEnLanes (mykonosDevice_t *device, uint8_t *lane) |
Performs read of enabled JESD Deframer lanes. More... | |
mykonosDbgErr_t | MYKONOS_deframerForceSyncReq (mykonosDevice_t *device, uint8_t syncReq) |
Performs Deframer Force SYNC requests. More... | |
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. More... | |
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. More... | |
mykonosDbgErr_t | MYKONOS_framerSetZeroData (mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, mykonosLaneSel_t lane) |
Performs set JESD framer Zero data samples per lane. More... | |
mykonosDbgErr_t | MYKONOS_framerGetZeroData (mykonosDevice_t *device, mykonos_jesdcore_t jesdCore, mykonosLaneSel_t *lane) |
Performs get JESD framer Zero data samples. More... | |
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. More... | |
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. More... | |
mykonosDbgErr_t | MYKONOS_framerCoreSel (mykonos_jesdcore_t jesdCore, uint16_t rxFramerAdd, uint16_t *baseAddr) |
Helper function to perform JESD framer core selection. More... | |
const char * | getDbgJesdMykonosErrorMessage (mykonosDbgErr_t errorCode) |
Helper function for return of character string based on 32-bit mykonosDbgErr_t enum value. More... | |
Contains macro definitions and global structure declarations for mykonos_dbgjesd.c.
Mykonos API version: 1.5.2.3566
const char* getDbgJesdMykonosErrorMessage | ( | mykonosDbgErr_t | errorCode | ) |
Helper function for return of character string based on 32-bit mykonosDbgErr_t enum value.
Legal Disclaimer Copyright 2015-2017 Analog Devices Inc. Released under the AD9371 API license, for more information see the "LICENSE.txt" file in this zip file. To save codespace, these error strings are ifdef'd out unless the user adds a define MYKONOS_VERBOSE to their workspace. This function can be useful for debug. Each function also returns unique error codes to make it easier to determine where the code broke.
errorCode | is enumerated error code value |
mykonosDbgErr_t MYKONOS_deframerForceSyncReq | ( | mykonosDevice_t * | device, |
uint8_t | syncReq | ||
) |
Performs Deframer Force SYNC requests.
Using this feature, the user can force SYNC request on the Deframer
Dependencies
device | Pointer to Mykonos device data structure containing settings |
syncReq | sync Request parameter Setting the syncReq causes the deframer to assert the SYNC~. Clearing syncReq causes the deframer to de-assert the SYNC~. |
MYKONOS_ERR_DBG_OK | Function completed successfully |
mykonosDbgErr_t MYKONOS_deframerGetEnLanes | ( | mykonosDevice_t * | device, |
uint8_t * | lane | ||
) |
Performs read of enabled JESD Deframer lanes.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
lane | Pointer to store the current enabled lanes |
Value | Description of Lane |
---|---|
8 | Lane 3 is enabled |
4 | Lane 2 is enabled |
2 | Lane 1 is enabled |
1 | Lane 0 is enabled |
0 | No lanes are enabled |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER | Data pointer passed lane is NULL |
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.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errType | which error counter to read back |
lane | Pointer to store which lane has reached the error threshold. Every bit shows per lane which error count has reached the threshold count. A value of 0x0F will represent that all the lanes has reached the error threshold. |
Value | Description of Lane |
---|---|
8 | Lane 3 has reached the error threshold |
4 | Lane 2 has reached the error threshold |
2 | Lane 1 has reached the error threshold |
1 | Lane 0 has reached the error threshold |
0 | No errors in lanes |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER | Data pointer passed lane is NULL |
MYKONOS_ERR_DBG_ILLEGAL_ERROR_SELECTED | Illegal errType passed, valid errType are BADDISP, NIT and UEKC |
mykonosDbgErr_t MYKONOS_deframerGetErrThrs | ( | mykonosDevice_t * | device, |
uint8_t * | errThrs | ||
) |
Performs read JESD Deframer error thresholds.
The value for the error threshold is common to all the error counters.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errThrs | Pointer to store the error threshold value read back |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER | Data pointer passed errThrs is NULL |
mykonosDbgErr_t MYKONOS_deframerGetIrq | ( | mykonosDevice_t * | device, |
uint8_t * | errIrq | ||
) |
Performs a read of the JESD IRQ vector for the deframer.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errIrq | Pointer to store the deframer IRQ status, the different bits mask are: |
IRQ | Bit mask | Description of errIrq |
---|---|---|
CMM | 3 | Configuration mismatch 0 if is CMM ok, 1 if CMM is detected |
BADDISP | 2 | Incorrect disparity 0 if is BADDISP ok, 1 if BADDISP character is detected |
NIT | 1 | Not in table 0 if is NIT ok, 1 if NIT character is detected |
UEKC | 0 | Unexpected K character 0 if is UEKC ok, 1 if UEKC character is detected |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER | Data pointer passed errIrqMask is NULL |
mykonosDbgErr_t MYKONOS_deframerGetSyncMask | ( | mykonosDevice_t * | device, |
uint8_t * | errSyncMask | ||
) |
Performs get JESD Deframer SyncMask.
This function read the SyncMask that is programmed into Mykonos.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errSyncMask | Pointer to store the sync mask currently being used: |
Sync | Bit mask | Description of errSyncMask |
---|---|---|
SYNC_BADDISP | 2 | Bad disparity mask |
SYNC_NIT | 1 | Not in table |
SYNC_UEKC | 0 | Unexpected K character |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER | Data pointer passed errSyncMask is NULL |
mykonosDbgErr_t MYKONOS_deframerRd2Stat | ( | mykonosDevice_t * | device, |
uint8_t * | defStat2 | ||
) |
Performs reads to JESD Deframer secondary status register.
Legal Disclaimer Copyright 2015-2017 Analog Devices Inc. Released under the AD9371 API license, for more information see the "LICENSE.txt" file in this zip file.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
defStat2 | Pointer to store the deframer secondary status |
Bit mask | Description of defStat2 |
---|---|
2 | DeframerSYSREF Phase Error, when set, this bit reports that an incoming SYSREF is not aligned to the current LMFC boundary. |
1 | Deframer Det Lat FIFO RD, this bit is the status of rd_enable for deterministic sample FIFO. If set deterministic latency is achieved. |
0 | Deframer Lane FIFO PTR Delta Changed. If set this bit reports that the offset between the read and write FIFO pointers has changed. |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER | Data pointer passed defStat2 is NULL |
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.
This function reads the counters per the given lane for the bad disparity, not in table and unexpected K character errors and stores them in the structure laneErr. The structure laneErr must be initialised in the calling function as it will contain the values of the counters per error type for the given lane.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
laneSel | which JESD lane error counter to be read |
laneErr | Pointer to a mykonosLaneErr_t structure type to store counter values for different errors |
MYKONOS_ERR_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER | Data pointer passed laneErr is NULL |
MYKONOS_ERR_DBG_ILLEGAL_LANE_NUMBER | Illegal laneSel parameter passed, valid laneSel are given in mykonosLaneSel_t |
mykonosDbgErr_t MYKONOS_deframerRstErrCntr | ( | mykonosDevice_t * | device, |
mykonosErrType_t | errType, | ||
mykonosLaneSel_t | lane | ||
) |
Performs reset of the selected error type for the selected lane.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errType | Which error counter to be reset |
lane | Which lane error counter to be reset |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_LANE_NUMBER | Illegal lane passed, valid lanes are given in mykonosLaneSel_t |
MYKONOS_ERR_DBG_ILLEGAL_ERROR_SELECTED | Illegal errType passed, valid errType are BADDISP, NIT and UEKC |
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.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errType | Which error counter to be reset, for the full list |
lane | Which lane error counter to be reset |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_LANE_NUMBER | Illegal lane passed, valid lanes are given in mykonosLaneSel_t |
MYKONOS_ERR_DBG_ILLEGAL_ERROR_TYPE | Illegal errType passed, valid errType are given in mykonosErrType_t |
mykonosDbgErr_t MYKONOS_deframerSetErrThrs | ( | mykonosDevice_t * | device, |
uint8_t | errThrs | ||
) |
Performs set JESD Deframer error thresholds.
The value for the error threshold will be applied to all the error counters for all the enabled lanes. Bad disparity, NIT disparity and Unexpected K char. Errors are counted and compared to the errThrs value. When the count is equal, then the user has the ability of raising an IRQ, see MYKONOS_deframerSetIrqMask, or asserted the SYNC signal per the mask register settings, see MYKONOS_deframerSetSyncMask, or do nothing upon threshold reach.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errThrs | is the value that will be written to the error threshold, valid error threshold is in the range 0x00 to 0xFF. |
MYKONOS_ERR_DBG_OK | Function completed successfully |
mykonosDbgErr_t MYKONOS_deframerSetIrqMask | ( | mykonosDevice_t * | device, |
uint8_t | errIrqMsk | ||
) |
Performs set JESD Deframer IRQ mask that will be used to generates interrupts.
Bad disparity, NIT disparity and Unexpected K char. Errors are counted and compared to the errThrs value. When the count is equal, either an IRQ is generated if the mask for the particular error is set. Configuration mismatch flag does not have a counter. Function is performed in all lanes.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errIrqMsk | the value of the mask applied to the IRQ generation, possible combinations are: |
IRQ | Bit mask | Description of errIrq |
---|---|---|
CMM | 3 | Configuration mismatch flag 0 if is CMM ok, 1 if CMM is detected |
BADDISP | 2 | Incorrect disparity flag 0 if is BADDISP ok, 1 if BADDISP is detected |
NIT | 1 | Not in table flag 0 if is NIT ok, 1 if NIT character is detected |
UEKC | 0 | Unexpected K character flag 0 if is UEKC ok, 1 if UEKC is detected |
MYKONOS_ERR_DBG_OK | Function completed successfully |
MYKONOS_ERR_DBG_ERROR_IRQ_MASK | Illegal parameter passed for errIrqMsk, valid parameter is in the range of 0x00 to 0x1FF |
mykonosDbgErr_t MYKONOS_deframerSetSyncMask | ( | mykonosDevice_t * | device, |
uint8_t | errSyncMask | ||
) |
Performs set JESD Deframer Sync mask.
This function sets the syncMask that will be programmed in to Mykonos. When the error counter reaches the error threshold value programmed by MYKONOS_deframerSetErrThrs function, if the syncMask is set for the particular errors type then the SYNC~ is asserted. The syncMask is applied to all the enabled lanes.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
errSyncMask | is the mask that will be used in order to assert SYNC~ Setting the syncMask bits causes the deframer to assert the SYNC~ when the count of the corresponding error reaches the errThrs value. |
Sync | Bit mask | Description of sync |
---|---|---|
SYNC_BADDISP | 2 | Bad disparity mask |
SYNC_NIT | 1 | Not in table |
SYNC_UEKC | 0 | Unexpected K character |
MYKONOS_ERR_DBG_OK | Function completed successfully. |
MYKONOS_ERR_DBG_ERROR_SYNC_MASK | Passed errSyncMask parameter is outside its boundaries, valid sync mask are in the range 0x00 to 0x07. |
mykonosDbgErr_t MYKONOS_framerCoreSel | ( | mykonos_jesdcore_t | jesdCore, |
uint16_t | rxFramerAdd, | ||
uint16_t * | baseAddr | ||
) |
Helper function to perform JESD framer core selection.
Dependencies
jesdCore | selection for FRAMER and OBS_FRAMER |
rxFramerAdd | base address for Framer selection |
baseAddr | Pointer to store the selected address base |
MYKONOS_ERR_DBG_FRAMER_SEL_BASE_ADD_NULL | base address is null |
MYKONOS_ERR_DBG_FRAMER_ILLEGAL_JESD_CORE | Only valid JESD cores are FRAMER and OBS_FRAMER |
MYKONOS_ERR_DBG_OK | Function completed successfully |
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.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
jesdCore | selection for FRAMER and OBS_FRAMER |
pattern | Pointer to store the programmed pattern |
enable | Pointer to store the programmed enable |
toggle | Pointer to store the programmed toggle |
MYKONOS_ERR_DBG_PATTERN_GEN_NULL_PATTERN | Function parameter pattern is a NULL pointer |
MYKONOS_ERR_DBG_PATTERN_GEN_NULL_ENABLE | Function parameter enable is a NULL pointer |
MYKONOS_ERR_DBG_PATTERN_GEN_NULL_TOGGLE | Function parameter toggle is a NULL pointer |
MYKONOS_ERR_DBG_OK | Function completed successfully |
mykonosDbgErr_t MYKONOS_framerGetZeroData | ( | mykonosDevice_t * | device, |
mykonos_jesdcore_t | jesdCore, | ||
mykonosLaneSel_t * | lane | ||
) |
Performs get JESD framer Zero data samples.
This functions will get the settings for zero the Framer data samples.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
jesdCore | selection for MYK_FRAMER and MYK_OBS_FRAMER |
lane | Pointer to store the programmed pattern |
MYKONOS_ERR_DBG_ZERO_DATA_LANE_NULL | Function parameter lane is a NULL pointer |
MYKONOS_ERR_DBG_OK | Function completed successfully |
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.
The Pattern Generator is a function for JESD testing. The JESD framer will be transmitting the "pattern" once the enabled.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
jesdCore | selection for FRAMER and OBS_FRAMER |
pattern | pattern to be transmitted by the Framer, is a 20 bit field having a range from 0x00000 to 0xFFFFF |
enable | Bit used to enable the Pattern Generator facility |
toggle | if 0 the transfer data will be not modified, if 1 the transfered data will be toggling |
MYKONOS_ERR_DBG_ILLEGAL_TOGGLE | Toggle is not valid, valid values are 0 and 1. |
MYKONOS_ERR_DBG_ILLEGAL_FRAMER_PATTERN | Pattern passed is outside the range valid range from 0x00000 to 0xFFFFF |
MYKONOS_ERR_DBG_ILLEGAL_ENABLE | Enable not valid, valid values are 0 and 1. |
MYKONOS_ERR_DBG_PATTERN_GEN_ILLEGAL_JESD_CORE | |
MYKONOS_ERR_DBG_OK | Function completed successfully |
mykonosDbgErr_t MYKONOS_framerSetZeroData | ( | mykonosDevice_t * | device, |
mykonos_jesdcore_t | jesdCore, | ||
mykonosLaneSel_t | lane | ||
) |
Performs set JESD framer Zero data samples per lane.
This functions will zero the Framer data samples for the specify lane or lanes. For the specified Framer or ObsFramer.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
jesdCore | selection for FRAMER and OBS_FRAMER |
lane | lanes to zero the Framer data samples |
MYKONOS_ERR_DBG_ZERO_DATA_INV_LANE | the lane selection is out of range |
MYKONOS_ERR_DBG_OK | Function completed successfully |
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.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
jesdCore | JESD core selection |
intAddr | Internal address to access in JESD core |
data | Pointer to store data |
MYKONOS_ERR_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_DATA_POINTER | Data pointer passed is a NULL pointer |
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.
Dependencies
device | Pointer to Mykonos device data structure containing settings |
jesdCore | JESD core selection |
intAddr | Internal address to access in JESD core |
data | Data to write into internal address |
MYKONOS_ERR_OK | Function completed successfully |
MYKONOS_ERR_DBG_ILLEGAL_JESD_CORE | An illegal JESD core passed, valid cores are given in mykonos_jesdcore_t |