My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::antenna::control::Tfp Class Reference

Public Types

enum  CtlRegOffset {
  CTL_OFF_TIMEREQ = 0x0, CTL_OFF_EVENTREQ = 0x4, CTL_OFF_UNLOCK = 0x8, CTL_OFF_RESERVED1 = 0xC,
  CTL_OFF_CONTROL = 0x10, CTL_OFF_ACK = 0x14, CTL_OFF_MASK = 0x18, CTL_OFF_INTSTAT = 0x1C,
  CTL_OFF_MINSTRB = 0x20, CTL_OFF_MAJSTRB = 0x24, CTL_OFF_RESERVED2 = 0x28, CTL_OFF_RESERVED3 = 0x2C,
  CTL_OFF_TIME0 = 0x30, CTL_OFF_TIME1 = 0x34, CTL_OFF_EVENT0 = 0x38, CTL_OFF_EVENT1 = 0x3C
}
 
enum  {
  CTL_LOCKEN_BIT = 0, CTL_EVSOURCE_BIT = 1, CTL_RESERVED_BIT = 2, CTL_EVENTEN_BIT = 3,
  CTL_STREN_BIT = 4, CTL_STRMODE_BIT = 5, CTL_FREQSEL0_BIT = 6, CTL_FREQSEL1_BIT = 7
}
 
enum  { ACK_CMD_BIT = 0, ACK_GPS_BIT = 2, ACK_READ_BIT = 7 }
 
enum  { READ_CMD = 0x81 }
 
enum  {
  MASK_EVENT_BIT = 0, MASK_PERIODIC_BIT = 1, MASK_TIME_BIT = 2, MASK_1PPS_BIT = 3,
  MASK_GPS_BIT = 4
}
 
enum  DpramCmdId {
  DP_CMD_TIME_MODE = 0x10, DP_CMD_TIME_FORMAT = 0x11, DP_CMD_SET_MAJOR = 0x12, DP_CMD_SET_YEAR = 0x13,
  DP_CMD_SET_PERIODIC_OUTPUT = 0x14, DP_CMD_SET_INP_FORMAT = 0x15, DP_CMD_SET_INP_MOD = 0x16, DP_CMD_SET_PROP_DELAY = 0x17,
  DP_CMD_REQ_DATA = 0x19, DP_CMD_SOFT_RESET = 0x1A, DP_CMD_SET_OUT_FORMAT = 0x1B, DP_CMD_GEN_OFFSET = 0x1C,
  DP_CMD_LCL_OFFSET = 0x1D, DP_CMD_SET_CLK_SRC = 0x20, DP_CMD_GPS_FMT = 0x33, DP_CMD_SET_GPS_MODE_FLAG = 0x34,
  DP_CMD_YEAR_AUTO_INC = 0x42, DP_CMD_REQ_ASSY = 0xf4, DP_CMD_REQ_MODEL = 0xf6
}
 
enum  GpsFormat { FORMAT_UTC = 0x0, FORMAT_GPS = 0x1 }
 
enum  TimeFormat { FORMAT_BCD = 0x00, FORMAT_UNIX = 0x01 }
 
enum  TimeCodeFormat { FORMAT_IRIGA = 0x41, FORMAT_IRIGB = 0x42, FORMAT_IEEE = 0x49, FORMAT_NASA36 = 0x4E }
 
enum  InputTimeCodeModType { INP_MOD_AMP = 'M', INP_MOD_PULSE = 'D' }
 
enum  ClockSource { CLK_INTERNAL = 'I', CLK_EXTERNAL = 'E' }
 
enum  OutputFreq { FREQ_10MHZ = 0x0, FREQ_5MHZ = 0x1, FREQ_1MHZ = 0x2 }
 
enum  TimeMode {
  MODE_TIMECODE = 0x00, MODE_FREERUN = 0x01, MODE_1PPS = 0x02, MODE_REAL_CLOCK = 0x03,
  MODE_GPS = 0x06
}
 
enum  {
  NONE = 0x00, INT_EVENT = 0x01, INT_PERIODIC = 0x02, INT_TIME = 0x04,
  INT_1PPS = 0x08, INT_GPS = 0x10, ALL = INT_EVENT | INT_PERIODIC | INT_TIME | INT_1PPS | INT_GPS
}
 

Public Member Functions

 Tfp (bool simulate=false)
 
virtual ~Tfp ()
 
void open ()
 
void close ()
 
void readBcdTime (gcp::util::TimeVal &tVal)
 
void readUnixTime (gcp::util::TimeVal &tVal)
 
void setYear (unsigned short year)
 
void setMajorTime (unsigned int seconds)
 
void setMajorTime (unsigned short year, unsigned short dayNo, unsigned char hours, unsigned char minutes, unsigned char seconds)
 
void setTimeMode (TimeMode mode)
 
void setTimeFormat (TimeFormat format)
 
void setInputTimeCodeFormat (TimeCodeFormat format)
 
void setOutputTimeCodeFormat (TimeCodeFormat format)
 
void setInputTimeCodeModType (InputTimeCodeModType mod)
 
void setFrequencyOutput (bool syncToPps, double dutyCyclePerc, double freqInHz)
 
void setPeriodicOutput (bool syncToPps, unsigned short n1, unsigned short n2)
 
void setOutputClockFreq (OutputFreq freq)
 
unsigned short readYear ()
 
void requestModelId ()
 
void requestAssemblyPartNo ()
 
void softReset ()
 
void setGeneratorTimeOffset (short offset, bool halfHour=false)
 
void setLocalTimeOffset (short offset, bool halfHour=false)
 
void setPropagationDelay (int delayIn100ns)
 
void setClockSource (ClockSource src)
 
void setGpsFormat (GpsFormat format)
 
void enableGpsModeFlag (bool enable)
 
void enableYearAutoIncrement (bool enable)
 
void defaultSetUp ()
 
void specificSetUp ()
 
void enableInterrupt (unsigned mask, bool enable)
 
void getDate (gcp::util::RegDate &date)
 
void getDate (gcp::util::TimeVal &timeVal)
 

Static Public Member Functions

static void testBits (unsigned int iVal)
 
static void printBits (unsigned char c)
 
static void printBits (unsigned short s)
 
static void printBits (unsigned int i)
 
static unsigned short constructShort (unsigned char msb, unsigned char lsb)
 
static unsigned constructInt (unsigned char msb, unsigned char smsb, unsigned tmsb, unsigned char lsb)
 

Static Public Attributes

static const std::string devName_
 
static const unsigned ctlSizeInBytes_ = 0x1000
 
static const unsigned ctlOffsetInBytes_ = 0x0
 
static const unsigned dpramSizeInBytes_ = 0x1000
 
static const unsigned dpramOffsetInBytes_ = 0x1000
 

Constructor & Destructor Documentation

Tfp::Tfp ( bool  simulate = false)

....................................................................... Constructor.

Tfp::~Tfp ( )
virtual

....................................................................... Destructor.

Member Function Documentation

void Tfp::close ( )

....................................................................... Close the device

unsigned Tfp::constructInt ( unsigned char  msb,
unsigned char  smsb,
unsigned  tmsb,
unsigned char  lsb 
)
static

....................................................................... Method to construct an unsigned int from the 1-byte wide addressing space of the DPRAM

unsigned short Tfp::constructShort ( unsigned char  msb,
unsigned char  lsb 
)
static

....................................................................... Method to construct a short from the 1-byte wide addressing space of the DPRAM

void Tfp::enableInterrupt ( unsigned  intMask,
bool  enable 
)

....................................................................... Enable interrupts

void Tfp::open ( )

....................................................................... Open the device

void Tfp::readBcdTime ( gcp::util::TimeVal tVal)

....................................................................... Read the time, in decimal BCD format

void Tfp::readUnixTime ( gcp::util::TimeVal tVal)

....................................................................... Read the time, in binary UNIX format

unsigned short Tfp::readYear ( )

....................................................................... Read the year

void Tfp::requestAssemblyPartNo ( )

....................................................................... Request the assembly part number.

I don't understand yet how data commands are supposed to work. The manual says, "use this command in conjunction with 0x19" which is the request data command, but it is not clear if the command for which we want data is the data body of the 0x19 command, or if we need to separately issue the data command before requesting the data. I would think the former, but I have failed to get anything sensible back from the card when any of these commands are issued.

void Tfp::requestModelId ( )

....................................................................... Request the model ID number

void Tfp::setFrequencyOutput ( bool  syncToPps,
double  dutyCyclePerc,
double  freqInHz 
)

....................................................................... Set periodic output.

Frequency output is:

1,000,000/(n1 * n2) Hz, for 2 <= n1, n2 <= 65535

Duty cycle is given by:

(1 - (1 / n2)) * 100%
void Tfp::setInputTimeCodeFormat ( TimeCodeFormat  format)

....................................................................... Set the format of the input timecode signal

void Tfp::setInputTimeCodeModType ( InputTimeCodeModType  mod)

....................................................................... Set the modulation type of the input timecode signal

void Tfp::setMajorTime ( unsigned int  seconds)

....................................................................... Set the major component of the time, in UNIX format

void Tfp::setMajorTime ( unsigned short  year,
unsigned short  dayNo,
unsigned char  hours,
unsigned char  minutes,
unsigned char  seconds 
)

....................................................................... Set the major component of the time, in BCD format

void Tfp::setOutputClockFreq ( OutputFreq  freq)

....................................................................... Set the output clock frequency

void Tfp::setOutputTimeCodeFormat ( TimeCodeFormat  format)

....................................................................... Set the format of the timecode signal output on the J1 connector

void Tfp::setTimeFormat ( TimeFormat  format)

....................................................................... Set the time register format

void Tfp::setYear ( unsigned short  year)

....................................................................... Set the year

void Tfp::softReset ( )

....................................................................... Software reset


The documentation for this class was generated from the following files: