KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wrx.h File Reference

WhiteRabbit exchange exchanges information between the 2nd LM32 and WhiteRabbit though a small client in the whiteRabbit code-base. More...

#include "wrx_proto.h"
#include <stdbool.h>
#include <stdint.h>
#include <errorcode.h>

Go to the source code of this file.

Macros

#define E_WRX_EP_VER   ( E_WRX + 1 )
 
#define E_WRX_EP_VER_DESCR   "Remote WRX version does not match"
 

Functions

bool wrxInit ()
 Initializes the whiteRabbit eXchange. More...
 
bool wrxUp ()
 Returns whether or not the WhiteRabbit interface is up and running. More...
 
volatile WrxInfo * wrxInfo ()
 Returns the whiteRabbit information structure if available, else NULL. More...
 
bool wrxCmdPending ()
 Returns whether or not there is a command still pending to be executed. More...
 
uint64_t wrxUtcTime ()
 Returns the UTC time, or 0 if not available.
 
bool wrxSetAutoNeg (bool on)
 Returns autonegotation on or off. More...
 
bool wrxSetTuneWord (int32_t tuneWord)
 Sets the tune-word. More...
 
bool wrxGetTuneInfo (WrxTuneInfo *info)
 Sets the fields of the WrxTuneInfo structure. More...
 
bool wrxGetSFPSerialNo (char sn[17])
 Gets the sfp serial number. More...
 
bool wrxModI2cRead (uint8_t addr, uint8_t reg, uint8_t len, uint8_t *buf)
 Read SFP I2C bus (raw) More...
 
bool wrxModI2cWrite (uint8_t addr, uint8_t reg, uint8_t len, uint8_t *buf)
 Write SFP I2C bus (raw) More...
 
bool wrxSetSFPThreshold (int index, uint16_t value)
 

Detailed Description

WhiteRabbit exchange exchanges information between the 2nd LM32 and WhiteRabbit though a small client in the whiteRabbit code-base.

Commands can be send between the 2nd LM32 and WhiteRabbit.

Definition in file wrx.h.

Function Documentation

bool wrxCmdPending ( )

Returns whether or not there is a command still pending to be executed.

Return values
trueYes
falseNo

Definition at line 70 of file wrx.c.

bool wrxGetSFPSerialNo ( char  sn[17])

Gets the sfp serial number.

Makes string zero terminated by setting sn[16]='\0'

Return values
falseCommand failed, check error module for more information
trueCommand successful

Definition at line 144 of file wrx.c.

bool wrxGetTuneInfo ( WrxTuneInfo *  info)

Sets the fields of the WrxTuneInfo structure.

Return values
falseCommand failed, check error module for more information
trueCommand successful

Definition at line 130 of file wrx.c.

volatile WrxInfo* wrxInfo ( )

Returns the whiteRabbit information structure if available, else NULL.

Returns
WhiteRabbit information, or NULL is not available.

Definition at line 63 of file wrx.c.

bool wrxInit ( )

Initializes the whiteRabbit eXchange.

Return values
trueInitialization succesful.
falseInitialization failed, check errCode() for more info.

Definition at line 34 of file wrx.c.

bool wrxModI2cRead ( uint8_t  addr,
uint8_t  reg,
uint8_t  len,
uint8_t *  buf 
)

Read SFP I2C bus (raw)

Len = max 4 bytes

Definition at line 169 of file wrx.c.

bool wrxModI2cWrite ( uint8_t  addr,
uint8_t  reg,
uint8_t  len,
uint8_t *  buf 
)

Write SFP I2C bus (raw)

Len = max 4 bytes

Definition at line 185 of file wrx.c.

bool wrxSetAutoNeg ( bool  on)

Returns autonegotation on or off.

Parameters
onTurn it on.
Return values
falseCommand failed, check error module for more information
trueCommand successful

Definition at line 97 of file wrx.c.

bool wrxSetTuneWord ( int32_t  tuneWord)

Sets the tune-word.

Depends on the tuning procedure.

Return values
falseCommand failed, check error module for more information
trueCommand successful

Definition at line 119 of file wrx.c.

bool wrxUp ( )

Returns whether or not the WhiteRabbit interface is up and running.

Return values
trueIts up and running
falseIts not up and running.

Definition at line 58 of file wrx.c.