EDT PCD SDK Documentation 6.1.0
edt_ocx.h File Reference

(git 4f67afd4, 2023-10-18)

#include "edtinc.h"
Include dependency graph for edt_ocx.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  EdtOCXFrameErrors
 Structure used by edt_ocx_get_framing_errors() for returning various framing errors from the framer registers. More...
 
struct  edt_oc_config
 Structure used to pass configuration parameters to OCX routines. More...
 

Macros

#define EDT_OCX_BYTE_SWAP   0x1
 
#define EDT_OCX_SHORT_SWAP   0x2
 
#define EDT_OCX_LSB_FIRST   0x4
 
#define EDT_OCX_SWAP   (EDT_OCX_BYTE_SWAP | EDT_OCX_SHORT_SWAP)
 
#define EDT_OCX_ORDER_MASK   0x7
 
#define EDT_OCX_FRAMED   0x8
 
#define EDT_OCX_DESCRAMBLE   0x10
 
#define EDT_OCX_ENABLE_MEM   0x20
 
#define EDT_OCX_OVHD_ONLY   0x40
 
#define EDT_OCX_PRBS_EN   0x200
 
#define EDT_OCX_SKIP_LOAD   0x400
 
#define EDT_OCX_FULL_INIT   0x800
 
#define EDT_OCX_LOOPBACK   0x2000
 
#define EDT_OCX_REMOTE_LPBK   0x10000
 
#define EDT_OCX_SCRAMBLE   0x1000
 
#define EDT_OCX_INVERT   0x4000
 
#define EDT_OCX_SET_DEMUX   0x8000
 
#define EDT_OCX_TAGGED_DATA   0x80000
 
#define EDT_OCX_ENABLE_COUNT_DATA   0x100000
 
#define EDT_OCX_FREERUN_COUNT_DATA   0x200000
 
#define EDT_OCX_ETHERNET_ALL_DECODE   0x400000
 
#define EDT_OCX_FRAMED_BYTES   0x40000000
 

Typedefs

typedef enum EdtLineRate EdtLineRate
 
typedef struct EdtOCXFrameErrors EdtOCXFrameErrors
 Structure used by edt_ocx_get_framing_errors() for returning various framing errors from the framer registers.
 
typedef struct edt_oc_config EdtOCConfig
 Structure used to pass configuration parameters to OCX routines.
 

Enumerations

enum  EdtLineRate
 

Functions

int edt_reg_set_bitmask (EdtDev edt_p, u_int reg, u_int mask, int state)
 Set or clear mask bits in register reg . More...
 
int edt_wait_register_bits_low (EdtDev edt_p, u_int reg, u_int mask, int timeout)
 Wait until the mask bits in reg have cleared to zero. More...
 
int edt_wait_register_bits_low_timer (EdtDev edt_p, u_int reg, u_int mask, int timeout)
 Wait until the mask bits in reg have cleared to zero. More...
 
int edt_wait_register_bits_high (EdtDev edt_p, u_int reg, u_int mask, int timeout)
 Wait until the mask bits in reg have set to one. More...
 
int edt_wait_register_bits_high_timer (EdtDev edt_p, u_int reg, u_int mask, int timeout)
 Wait until the mask bits in reg have set to one. More...
 

Detailed Description

Macro Definition Documentation

◆ EDT_OCX_BYTE_SWAP

#define EDT_OCX_BYTE_SWAP   0x1

Swap data at 8-bit boundaries.

◆ EDT_OCX_SHORT_SWAP

#define EDT_OCX_SHORT_SWAP   0x2

Swap data at 16-bit boundaries.

◆ EDT_OCX_LSB_FIRST

#define EDT_OCX_LSB_FIRST   0x4

When set, the least significant bit of the 32-bit data word is the first bit, and the most significant bit is the last. When clear, the most significant bit of a 32-bit word is the first bit.

◆ EDT_OCX_SWAP

#define EDT_OCX_SWAP   (EDT_OCX_BYTE_SWAP | EDT_OCX_SHORT_SWAP)

Both EDT_OCX_BYTE_SWAP and EDT_OCX_SHORT_SWAP give network order on x86 architecture.

◆ EDT_OCX_ORDER_MASK

#define EDT_OCX_ORDER_MASK   0x7

Mask for lower three "order" bits.

◆ EDT_OCX_FRAMED

#define EDT_OCX_FRAMED   0x8

Turn on framing.

◆ EDT_OCX_DESCRAMBLE

#define EDT_OCX_DESCRAMBLE   0x10

Turn on descrambler.

◆ EDT_OCX_ENABLE_MEM

#define EDT_OCX_ENABLE_MEM   0x20

Turn on mezzanine memory.

◆ EDT_OCX_OVHD_ONLY

#define EDT_OCX_OVHD_ONLY   0x40

Filter out overhead only.

◆ EDT_OCX_PRBS_EN

#define EDT_OCX_PRBS_EN   0x200

Turn on PRBS pattern generator in LIU.

◆ EDT_OCX_SKIP_LOAD

#define EDT_OCX_SKIP_LOAD   0x400

Disable loading correct bitfile; fail instead.

◆ EDT_OCX_FULL_INIT

#define EDT_OCX_FULL_INIT   0x800

Initialize baseboard as well as mezzanine.

◆ EDT_OCX_LOOPBACK

#define EDT_OCX_LOOPBACK   0x2000

Enable loop back through LIU.

◆ EDT_OCX_REMOTE_LPBK

#define EDT_OCX_REMOTE_LPBK   0x10000

Enable remote loopback from LIU.

◆ EDT_OCX_SCRAMBLE

#define EDT_OCX_SCRAMBLE   0x1000

Enable TX scrambler.

◆ EDT_OCX_INVERT

#define EDT_OCX_INVERT   0x4000

Invert data when checking.

◆ EDT_OCX_SET_DEMUX

#define EDT_OCX_SET_DEMUX   0x8000

Set the demux array.

◆ EDT_OCX_TAGGED_DATA

#define EDT_OCX_TAGGED_DATA   0x80000

Turn on OC192 data tagging.

◆ EDT_OCX_ENABLE_COUNT_DATA

#define EDT_OCX_ENABLE_COUNT_DATA   0x100000

Enable a 32 bit counter data instead of input data, for debug.

◆ EDT_OCX_FREERUN_COUNT_DATA

#define EDT_OCX_FREERUN_COUNT_DATA   0x200000

Enable the 32 bit counter to free run to get latency and bandwidth info.

◆ EDT_OCX_ETHERNET_ALL_DECODE

#define EDT_OCX_ETHERNET_ALL_DECODE   0x400000

Enable the Ethernet FCS layer to output all bytes.

◆ EDT_OCX_FRAMED_BYTES

#define EDT_OCX_FRAMED_BYTES   0x40000000

Align on frames but capture on byte alignment.

Typedef Documentation

◆ EdtLineRate

typedef enum EdtLineRate EdtLineRate

Optical Ethernet line rate constants.

Enumeration Type Documentation

◆ EdtLineRate

Optical Ethernet line rate constants.

Function Documentation

◆ edt_reg_set_bitmask()

int edt_reg_set_bitmask ( EdtDev  edt_p,
u_int  reg,
u_int  mask,
int  state 
)

Set or clear mask bits in register reg .

Parameters
edt_pThe open EDT device handle.
regDescriptor of register to modify.
maskIf a bit is set to one in this mask, that bit will be modified. Bits set to zero will not be modified.
stateEnable (1) to set (OR with mask) mask bits in the register. Disable (0) to clear (AND with ~mask) the mask bits in the register.
Returns
The new value of the register.
Here is the call graph for this function:

◆ edt_wait_register_bits_low()

int edt_wait_register_bits_low ( EdtDev  edt_p,
u_int  reg,
u_int  mask,
int  timeout 
)

Wait until the mask bits in reg have cleared to zero.

Parameters
edt_pThe open EDT device handle.
regDescriptor of register to read with edt_reg_read().
maskBits set to one in this mask will be checked.
timeoutTimeout, in millseconds, to wait for all bits to clear to zero. Pass zero to wait indefinitely.
Returns
0 if all masked register bits were zero in under timeout ms. Non-zero if timeout occurred.
Here is the call graph for this function:

◆ edt_wait_register_bits_low_timer()

int edt_wait_register_bits_low_timer ( EdtDev  edt_p,
u_int  reg,
u_int  mask,
int  timeout 
)

Wait until the mask bits in reg have cleared to zero.

Parameters
edt_pThe open EDT device handle.
regDescriptor of register to read with edt_reg_read().
maskBits set to one in this mask will be checked.
timeoutTimeout, in millseconds, to wait for all bits to clear to zero. Pass zero to wait indefinitely.
Returns
Time, in millseconds, spent waiting for bits to clear.
Here is the call graph for this function:

◆ edt_wait_register_bits_high()

int edt_wait_register_bits_high ( EdtDev  edt_p,
u_int  reg,
u_int  mask,
int  timeout 
)

Wait until the mask bits in reg have set to one.

Parameters
edt_pThe open EDT device handle.
regDescriptor of register to read with edt_reg_read().
maskBits set to one in this mask will be checked.
timeoutTimeout, in millseconds, to wait for all bits to set to one. Pass zero to wait indefinitely.
Returns
0 if all masked register bits were zero in under timeout ms. Non-zero if timeout occurred.
Here is the call graph for this function:

◆ edt_wait_register_bits_high_timer()

int edt_wait_register_bits_high_timer ( EdtDev  edt_p,
u_int  reg,
u_int  mask,
int  timeout 
)

Wait until the mask bits in reg have set to one.

Parameters
edt_pThe open EDT device handle.
regDescriptor of register to read with edt_reg_read().
maskBits set to one in this mask will be checked.
timeoutTimeout, in millseconds, to wait for all bits to set to one. Pass zero to wait indefinitely.
Returns
Time, in millseconds, spent waiting for bits to set to one.
Here is the call graph for this function: