/*******************************************************************************
* TmsLib.h TMS Client library functions
* T.Barnaby, BEAM Ltd, 2007-03-14
* updated by D.Korchagin, CERN AB-BI-SW, 2007-08-31
*******************************************************************************
*/
#ifndef TmsLib_H
#define TmsLib_H 1
#include <TmsD.h>
#include <TmsC.h>
namespace Tms {
const unsigned int tmsNumPickups = 40; ///< The default number of pick ups
const unsigned int tmsPhaseTableSize = 512; ///< The size of the Phase Table
/// The timing signal bits
enum TimingSig {
TimingSigClock = 0x01, ///< 10MHz System Clock
TimingSigCycleStart = 0x02, ///< CYCLE_START event
TimingSigCycleStop = 0x04, ///< CYCLE_STOP event
TimingSigCalStart = 0x08, ///< CAL_START event
TimingSigCalStop = 0x10, ///< CAL_STOP event
TimingSigInjection = 0x20, ///< INJECTION event
TimingSigHChange = 0x40, ///< HCHANGE event
TimingSigFRef = 0x80 ///< FREF signal
};
/// The Diagnostics Capture Clock settings
enum CaptureClock {
ClkAdcDiv_1 = 0x00, ///< ADC Clock
ClkAdcDiv_2 = 0x01, ///< ADC Clock divided by 2
ClkAdcDiv_5 = 0x02, ///< ADC Clock divided by 5
ClkAdcDiv_10 = 0x03, ///< ADC Clock divided by 10
ClkAdcDiv_20 = 0x04, ///< ADC Clock divided by 20
ClkAdcDiv_50 = 0x05, ///< ADC Clock divided by 50
ClkAdcDiv_100 = 0x06, ///< ADC Clock divided by 100
ClkAdcDiv_200 = 0x07, ///< ADC Clock divided by 200
ClkAdcDiv_500 = 0x08, ///< ADC Clock divided by 500
ClkAdcDiv_1000 = 0x09, ///< ADC Clock divided by 1000
ClkAdcDiv_2000 = 0x0A, ///< ADC Clock divided by 2000
ClkAdcDiv_5000 = 0x0B, ///< ADC Clock divided by 5000
ClkAdcDiv_10000 = 0x0C, ///< ADC Clock divided by 10000
ClkAdcDiv_20000 = 0x0D, ///< ADC Clock divided by 20000
ClkAdcDiv_50000 = 0x0E, ///< ADC Clock divided by 50000
ClkAdcDiv_100000= 0x0F, ///< ADC Clock divided by 100000
ClkMs = 0x10, ///< Millisecond Clock
ClkFref = 0x11 ///< FREF
};
/// The Tms State entry
#ifndef __Lynx__
union TmsState {
struct {