/******************************************************************************
 *
 *	NDT Solutions RapiDAQ Software Development Kit v1.0beta
 *
 ******************************************************************************
 *
 *  File:        RQ.h.
 *
 *  Description: Primary header file for RapiDAQ SDK.
 *
 *	Revision:    07/09/05 - Mark Eastlick (mark.eastlick@ndtsolutions.com).
 *
 ******************************************************************************/



#ifndef RQ_H
#define RQ_H


/*
 *	 __cplusplus, __declspec(...), and __stdcall are Microsoft specific.
 */

#ifdef __cplusplus
extern "C" {
#endif

#include "NDTSEnums.h"
#include "RQEnums.h"
#include "RQStructs.h"
#include "RawScanOffline.h"
#include "RQError.h"
/*
 *	Functions 
 */


// Administration

RQ_API NDTS_Boolean CALL_CONV RQ_PCIEnumerate(unsigned long *pNumberOfCards);

RQ_API NDTS_Boolean CALL_CONV RQ_Initialise(unsigned long cardIndex) ; // Remove after IW integration
RQ_API NDTS_Boolean CALL_CONV RQ_InitialiseNonSequenced(unsigned long cardIndex);
RQ_API NDTS_Boolean CALL_CONV RQ_Uninitialise(unsigned long cardIndex) ;

RQ_API NDTS_Boolean CALL_CONV RQ_GetIsInitialised(unsigned long cardIndex) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetIsDiagnosticMode(unsigned long cardIndex, NDTS_Boolean flag, const char *pFilename) ;

RQ_API NDTS_Boolean CALL_CONV RQ_SetSamplingFrequency(unsigned long cardIndex, unsigned long frequency) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSamplingFrequency(unsigned long cardIndex, unsigned long *pFrequency) ;

RQ_API NDTS_Boolean CALL_CONV RQ_InitRawScan(NDTS_RawScan *pRawScan) ;
RQ_API NDTS_Boolean CALL_CONV RQ_UninitRawScan(NDTS_RawScan *pRawScan) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetRawScan(unsigned long cardIndex, NDTS_RawScan *pRawScan) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetAScan(unsigned long cardIndex, short *pData, unsigned long aScanBufferBytes, unsigned long aScanIndex, unsigned long bScanIndex) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetBScan(unsigned long cardIndex, short **ppData) ;

RQ_API NDTS_Boolean CALL_CONV RQ_LoadState(unsigned long cardIndex, const char *pFileName, RQ_StoreValues values) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SaveState(unsigned long cardIndex, const char *pFileName, RQ_StoreValues values) ;

RQ_API NDTS_Boolean CALL_CONV RQ_SetValue(unsigned long cardIndex, const char *pPropertyName, unsigned long value) ;

// System subsystem

RQ_API NDTS_Boolean CALL_CONV RQ_SetSystemIOBank0(unsigned long cardIndex, unsigned long iOBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSystemIOBank0(unsigned long cardIndex, unsigned long *pIOBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetSystemDDR0(unsigned long cardIndex, unsigned long directionBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSystemDDR0(unsigned long cardIndex, unsigned long *pDirectionBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetSystemIOBank1(unsigned long cardIndex, unsigned long pIOBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSystemIOBank1(unsigned long cardIndex, unsigned long *pIOBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetSystemDDR1(unsigned long cardIndex, unsigned long directionBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSystemDDR1(unsigned long cardIndex, unsigned long *pDirectionBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSamplingSystemIRQFlag(unsigned long cardIndex, unsigned long samplingSystemIndex, NDTS_Boolean *pFlag) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSystemFirmwareVersion(unsigned long cardIndex, unsigned long *pVersionNumber) ;

// Sampling subsystem

RQ_API NDTS_Boolean CALL_CONV RQ_SetCurvedGateData(unsigned long cardIndex, const unsigned short *pGateData) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetCurvedGateData(unsigned long cardIndex, const unsigned short **ppGateData) ;
RQ_API NDTS_Boolean CALL_CONV RQ_ReadRawADCData(unsigned long cardIndex, short *pValue) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetNumberOfBScansInSRAM(unsigned long cardIndex, unsigned long *pNumberOfScans) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetRectifierMode(unsigned long cardIndex, RQ_Rectification mode) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetRectifierMode(unsigned long cardIndex, RQ_Rectification *pMode) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetStartDelay(unsigned long cardIndex, unsigned long startDelay) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetStartDelay(unsigned long cardIndex, unsigned long *pStartDelay) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetNumberOfSamples(unsigned long cardIndex, unsigned long numberOfSamples) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetNumberOfSamples(unsigned long cardIndex, unsigned long *pNumberOfSamples) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetDropNumberOfSamples(unsigned long cardIndex, unsigned long numberOfSamples) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetDropNumberOfSamples(unsigned long cardIndex, unsigned long *pNumberOfSamples) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetSampleStorageMode(unsigned long cardIndex, NDTS_SampleSize storageMode) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSampleStorageMode(unsigned long cardIndex, NDTS_SampleSize *pStorageMode) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetForceAScanTrigger(unsigned long cardIndex) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetTCGTriggerEvent(unsigned long cardIndex, RQ_TCGTriggerEvent event) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetTCGTriggerEvent(unsigned long cardIndex, RQ_TCGTriggerEvent *pEvent) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetTCGEnable(unsigned long cardIndex, NDTS_Boolean isEnabled) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetTCGEnable(unsigned long cardIndex, NDTS_Boolean *pIsEnabled) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetHasSampleClockStabilised(unsigned long cardIndex, NDTS_Boolean *pHasStabilised) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetCScanBaseSRAMAddress(unsigned long cardIndex, unsigned long address) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetCScanBaseSRAMAddress(unsigned long cardIndex, unsigned long *pAddress) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetAScanBaseSRAMAddress(unsigned long cardIndex, unsigned long *pAddress) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetScanStorageOptions(unsigned long cardIndex, NDTS_ScanStorage storageOptions) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetScanStorageOptions(unsigned long cardIndex, NDTS_ScanStorage *pStorageOptions) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetNumberOfBScansPerBank(unsigned long cardIndex, unsigned long numberOfScans) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetNumberOfBScansPerBank(unsigned long cardIndex, unsigned long *pNumberOfScans) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetNumberOfAScansPerBScan(unsigned long cardIndex, unsigned long numberOfScans) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetNumberOfAScansPerBScan(unsigned long cardIndex, unsigned long *pNumberOfScans) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetNumberOfBScansPerBankIsAutomatic(unsigned long cardIndex, NDTS_Boolean isAutomatic) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetTCGValues(unsigned long cardIndex, const unsigned short *pTCGCurve, unsigned long numberOfValues) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetTCGValues(unsigned long cardIndex, const unsigned short **ppTCGCurve, unsigned long *pNumberOfValues) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSamplingFirmwareVersion(unsigned long cardIndex, unsigned long *pVersionNumber) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSamplingFirmwareRevision(unsigned long cardIndex, unsigned long *pRevisionNumber) ;

RQ_API NDTS_Boolean CALL_CONV RQ_SetTCGNormalisedStart(unsigned long cardIndex, unsigned long tCGModeMask, unsigned long tCGPointRatio);
RQ_API NDTS_Boolean CALL_CONV RQ_SetTCGValuesNormalised(unsigned long cardIndex, 
														const unsigned short *pTCGCurve, 
														unsigned long numberOfValues);
RQ_API NDTS_Boolean CALL_CONV RQ_SetTCGNormalisedFinish(unsigned long cardIndex);
RQ_API NDTS_Boolean CALL_CONV RQ_ResetFirmware(unsigned long cardIndex);
RQ_API NDTS_Boolean CALL_CONV RQ_DataFullRecovery(unsigned long cardIndex);
RQ_API NDTS_Boolean CALL_CONV RQ_SetSyncPulseMode(unsigned long cardIndex, unsigned long mode) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSyncPulseMode(unsigned long cardIndex, unsigned long *pMode) ;


// Peripheral subsystem

RQ_API NDTS_Boolean CALL_CONV RQ_SetInputCoupling(unsigned long cardIndex, RQ_InputCoupling inputCoupling) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetInputCoupling(unsigned long cardIndex, RQ_InputCoupling *pInputCoupling) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetInputImpedance(unsigned long cardIndex, RQ_InputImpedance inputImpedance) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetInputImpedance(unsigned long cardIndex, RQ_InputImpedance *pInputImpedance) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetAnalogueInput(unsigned long cardIndex, RQ_AnalogueInput analogueInput) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetAnalogueInput(unsigned long cardIndex, RQ_AnalogueInput *pAnalogueInput) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetAnalogueInputRange(unsigned long cardIndex, RQ_AnalogueInputRange analogueRange) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetAnalogueInputRange(unsigned long cardIndex, RQ_AnalogueInputRange *pAnalogueRange) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetAuxInput(unsigned long cardIndex, RQ_AuxInput auxInput) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetAuxInput(unsigned long cardIndex, RQ_AuxInput *pAuxInput) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetTriggerSelect(unsigned long cardIndex, RQ_Trigger triggerSelect) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetTriggerSelect(unsigned long cardIndex, RQ_Trigger *pTriggerSelect) ;

// The pulseLength is in sampleClockPeriod / 2 steps.
// The RapiDAQ will generate a negative going pulse of the specified length.
// Applications normally specify the centre frequency of the probe.  
// (1) The application converts frequency to pulseLength using length = (1 / f) * sampleClockRate.
// (2) The probe seems to see the negative going pulse of one half of a waveform.
// (1) and (2) cancel each other out and the probe gets the frequency it expects.
// However, the negative going pulse on the scope appears half as wide as if the pulseLength were expressed in the sampleClockRate
RQ_API NDTS_Boolean CALL_CONV RQ_SetTransducerPulseWidth(unsigned long cardIndex, unsigned long pulseWidthInSamples) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetTransducerPulseWidth(unsigned long cardIndex, unsigned long *pulseWidthInSamples) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetRepetitionRate(unsigned long cardIndex, unsigned long repetitionRateHz) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetRepetitionRate(unsigned long cardIndex, unsigned long *repetitionRateHz) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetBScanRepetitionRate(unsigned long cardIndex, unsigned long repetitionRateHz);
RQ_API NDTS_Boolean CALL_CONV RQ_GetBScanRepetitionRate(unsigned long cardIndex, unsigned long *repetitionRateHz);
RQ_API NDTS_Boolean CALL_CONV RQ_AutoSetBScanRepetitionRate(unsigned long cardIndex);
RQ_API NDTS_Boolean CALL_CONV RQ_SetSensorArrayApertureSize(unsigned long cardIndex, RQ_ApertureSize apertureSize) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSensorArrayApertureSize(unsigned long cardIndex, RQ_ApertureSize *pApertureSize) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetSensorArrayDisableAperturePositionWrites(unsigned long cardIndex, NDTS_Boolean isDisabled) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSensorArrayDisableAperturePositionWrites(unsigned long cardIndex, NDTS_Boolean *pIsDisabled) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetSensorArrayDisableApertureDelayWrites(unsigned long cardIndex, NDTS_Boolean isDisabled) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSensorArrayDisableApertureDelayWrites(unsigned long cardIndex, NDTS_Boolean *pIsDisabled) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetIsBScanModeEnabled(unsigned long cardIndex, NDTS_Boolean isEnabled) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetIsBScanModeEnabled(unsigned long cardIndex, NDTS_Boolean *pIsEnabled) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSensorArrayIsProbeAttached(unsigned long cardIndex, NDTS_Boolean *pIsAttached) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetPingPongSequenceElement(unsigned long cardIndex, unsigned long elementNumber, unsigned long sequencePosition, unsigned long effectiveElement) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetPingPongSequence(unsigned long cardIndex, unsigned short *pSequence, unsigned short *pReverseSequence) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetPingPongSequence(unsigned long cardIndex, const unsigned short **ppSequence, const unsigned short **ppReverseSequence) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetNumberOfEncoderClicksPerBScan(unsigned long cardIndex, unsigned long numberOfClicks) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetNumberOfEncoderClicksPerBScan(unsigned long cardIndex, unsigned long *pNumberOfClicks) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetFractionalNumberOfEncoderClicksPerBScan(unsigned long cardIndex, unsigned long numerator, unsigned long unityShift) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetFractionalNumberOfEncoderClicksPerBScan(unsigned long cardIndex, unsigned long *pNumerator, unsigned long *pUnityShift) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetEncoderSelect(unsigned long cardIndex, unsigned long encoderIndex) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetEncoderSelect(unsigned long cardIndex, unsigned long *pEncoderIndex) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetForceBScanTrigger(unsigned long cardIndex) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetEncoderOutput(unsigned long cardIndex, unsigned long encoderIndex, long *pPosition) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetResetEncoderOutput(unsigned long cardIndex, unsigned long encoderIndex) ;
RQ_API NDTS_Boolean CALL_CONV RQ_AddGate(unsigned long cardIndex, const RQ_Gate *pGate) ;
RQ_API NDTS_Boolean CALL_CONV RQ_RemoveGate(unsigned long cardIndex, RQ_GateIndex index) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetNumberOfEnabledGates(unsigned long cardIndex, unsigned long *pNumberOfGates) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetNumberOfEnabledGatesThisChannel(unsigned long cardIndex, unsigned long channel, unsigned long *pNumberOfGates) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetGate(unsigned long cardIndex, RQ_GateIndex index, const RQ_Gate **ppGate) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetGate2(unsigned long cardIndex, unsigned long stepIndex, RQ_GateIndex index, RQ_Gate *pGate) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetPeripheralIOBank0(unsigned long cardIndex, unsigned long data) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetPeripheralIOBank0(unsigned long cardIndex, unsigned long *pData) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetPeripheralDDR0(unsigned long cardIndex, unsigned long directionBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetPeripheralDDR0(unsigned long cardIndex, unsigned long *pDirectionBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetPeripheralIOBank1(unsigned long cardIndex, unsigned long data) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetPeripheralIOBank1(unsigned long cardIndex, unsigned long *pData) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetPeripheralDDR1(unsigned long cardIndex, unsigned long directionBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetPeripheralDDR1(unsigned long cardIndex, unsigned long *pDirectionBits) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetFocusingUnitControl(unsigned long cardIndex, unsigned long controlBus, unsigned long data) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetPeripheralFirmwareVersion(unsigned long cardIndex, unsigned long *pVersionNumber) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetPeripheralFirmwareRevision(unsigned long cardIndex, unsigned long *pRevisionNumber) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetDIInterfaceBitsLow(unsigned long cardIndex) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetDIBoardState(unsigned long cardIndex, NDTS_Boolean isOn) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetWaterPumpState(unsigned long cardIndex, NDTS_Boolean isOn) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetSerialNumber(unsigned long cardIndex, unsigned long *pSerialNumber) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetZeroOffset(unsigned long cardIndex, int offset);
RQ_API NDTS_Boolean CALL_CONV RQ_GetZeroOffset(unsigned long cardIndex, int *pOffset);
RQ_API NDTS_Boolean CALL_CONV RQ_SetTrailingFlankHoldoff(unsigned long cardIndex, unsigned long holdoff);
// Flip the array values - call with numberOfElements zero to turn off flipping
RQ_API NDTS_Boolean CALL_CONV RQ_SetFlipArray(unsigned long cardIndex, unsigned short numberOfElementsForFlipping) ;
RQ_API NDTS_Boolean CALL_CONV RQ_GetDiagnosticsString(unsigned long cardIndex, char **ppString, unsigned long diagIndex);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Sequence step specific functions for use with version 2 Peripheral and DSP FPGAs
// Notes on the use of the functions below:
// As part of the initialisation process (before the TCG curves are written) RQ_SetGainTweaks should be
// called to set the gain adjustment levels.  If the tweak values are re-written subsequently, the TCG
// curves must be rewritten before they will take effect.
//
// The gain and TCG curves are set as follows:
// 1. call RQ_ClearTCGCurve (after the ranges have been set up)
// 2. call RQ_SubmitTCGCurve for each channel.  The curve should have as many elements as the number of
// samples in the channel's AScan.  Each element contains a gain value in 0.1dB increments, in the range
// -300 (30dB attenuation) to +1100 (110dB gain)
// 3. call RQ_SetEnhancedTCG to commit the TCG curves to the card.

RQ_API void CALL_CONV RQ_SetGainTweaks(unsigned long cardIndex, short plus20, short minus20, short minus40);


// bit should be 28 to 31
// 28 is normally reserved for power control to the DI unit
RQ_API NDTS_Boolean CALL_CONV RQ_SetDigitalOutput(unsigned long cardIndex, unsigned long bit, NDTS_Boolean isOn);
RQ_API NDTS_Boolean CALL_CONV RQ_SetSequenceStep(unsigned long cardIndex, unsigned long step);
RQ_API NDTS_Boolean CALL_CONV RQ_GetSequenceStep(unsigned long cardIndex, unsigned long *pStep);
RQ_API NDTS_Boolean CALL_CONV RQ_SetStepsInSequence(unsigned long cardIndex, unsigned long steps);
RQ_API NDTS_Boolean CALL_CONV RQ_GetStepsInSequence(unsigned long cardIndex, unsigned long *pSteps);
RQ_API NDTS_Boolean CALL_CONV RQ_StartSequence(unsigned long cardIndex);
RQ_API NDTS_Boolean CALL_CONV RQ_StopSequence(unsigned long cardIndex);
RQ_API void CALL_CONV RQ_SetSampleNoiseFilter(unsigned long cardIndex, 	unsigned long numberToCheckEitherSide, float proportionToTriggerOff) ;
RQ_API NDTS_Boolean CALL_CONV RQ_SetNumberOfOversamples(unsigned long cardIndex, unsigned long numberOfOversamples);
RQ_API NDTS_Boolean CALL_CONV RQ_GetNumberOfOversamples(unsigned long cardIndex, unsigned long *pNumberOfOversamples);
RQ_API NDTS_Boolean CALL_CONV RQ_RewriteGates(unsigned long cardIndex, 	
											  unsigned long oldNumberOfOversamples, 	
											  unsigned long newNumberOfOversamples);
RQ_API RQ_ReturnCode  RQ_GetLastError();
//RQ_API const char * CALL_CONV RQ_GetCodeString(int errorCode);
RQ_API unsigned long RQ_ReturnNumberOfErrorLogLines();
RQ_API NDTS_Boolean RQ_GetErrorLogLine(unsigned long  lineNumber, char *pMessageBuffer, unsigned long  numberOfBytesInMessageBuffer);
RQ_API NDTS_Boolean RQ_ClearErrorLog() ;

RQ_API NDTS_Boolean CALL_CONV RQ_GetHLPRXFirmwareRevisions(unsigned long *dsp, unsigned long *per);
RQ_API NDTS_Boolean CALL_CONV RQ_GetRS2AFirmwareRevisions(unsigned long *dsp, unsigned long *per);
RQ_API unsigned long RQ_ReturnMaximumNumberOfGates(NDTS_Boolean isSequence);

// - not used anywhere but should be moved to memory factory if it is ever used
//RQ_API NDTS_Boolean CALL_CONV RQ_GetMemoryBlockSize(void *pData, int *pSize);


// False, use normal encoder 4 and 5 inputs.
// True encoder 4 counts positive edge triggered pulses on Digital IO 6 (pin 24) and encoder 5 on DIO 7 (pin 23)
RQ_API NDTS_Boolean CALL_CONV RQ_ConnectEncoderCounters4And5ToIO(unsigned long cardIndex, NDTS_Boolean useDIO);

RQ_API NDTS_Boolean CALL_CONV RQ_SetInitialisationStatusCallback(void (*pfnInitStatusCallback)(RQ_InitialisationStep step, RQ_InitialisationStepStatus status)) ;

// Out of range access counter - used for debugging the freezing problem which may be caused by an out of range access
RQ_API NDTS_Boolean CALL_CONV RQ_GetOutOfRangeAccessCount(unsigned long cardIndex, unsigned long *pAccessCount);
RQ_API NDTS_Boolean CALL_CONV RQ_ClearOutOfRangeAccessCount(unsigned long cardIndex);


// Sept 07 - DSP_V124.BIN A Scan test pattern to test the PCMCIA extender on a laptop
// by writing a constantly changing 32 bit 000..  fff... pattern to the A Scan data
RQ_API NDTS_Boolean CALL_CONV RQ_SetTestPatternMode(unsigned long cardIndex, NDTS_Boolean isTestPatternEnabled) ;
// Bug 786 - DSP_124 has the option for A Scan data to be stored as sign and magnitude to reduce errors over PCMCIA extender.
RQ_API NDTS_Boolean CALL_CONV RQ_SetSignAndMagnitudeMode(unsigned long cardIndex, NDTS_Boolean isSignMagEnabled) ;

RQ_API unsigned long CALL_CONV RQ_ReturnNumberOfRapiDAQBoards() ;


#ifdef __cplusplus
}
#endif


#endif
