#ifndef HLPRXENUMS_H
#define HLPRXENUMS_H

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

#ifdef __cplusplus
extern "C" {
#endif

#ifdef HLPRX_EXPORTS
	#define HLPRX_API __declspec(dllexport)
#else
	#define HLPRX_API __declspec(dllimport)
#endif

#ifdef STDCALL
	#define CALL_CONV __stdcall
#else
	#define CALL_CONV
#endif

// In the XXX_ReturnCode types we use the following convention:
// low 8 bits = specific error value from this function
// next 8 bits = function returning error
// next 8 bits = SDK number
// top 8 bits reserved, currently always zero
// SDK values are:
// 00 = RQ
// 01 = pulser/receiver low level API
// 02 = pulser/receiver high level API

// NB The intention for the high-level API is that it does not provide a copy of each low-level error code,
// but just adds its own high-level codes.  The error handler should parse the error codes and get the
// error messages from the appropriate source.

typedef enum
{
	// general error codes that don't apply to a particular function
	HLPRX_OK												= 0x00000000,

	HLPRX_ErrorInvalidCardNumber							= 0x00020001,
	HLPRX_ErrorHLPRXNotInitialised							= 0x00020002,

	HLPRX_ErrorHLPRX_SetUserUnits_unknownUnit				= 0x00020101,

	HLPRX_Initialise_AlreadyInitialised						= 0x00020201,
	HLPRX_Initialise_PRXEnumberateFailed					= 0x00020202,
	HLPRX_Initialise_RQEnumberateFailed						= 0x00020203,

	HLPRXgetSerialisedSettingsSize_InternalPointerError		= 0x00020301,
	
	HLPRXgetSerialisedSettings_InternalPointerError			= 0x00020401,

	HLPRX_LastError
} HLPRX_ReturnCode ;

typedef enum
{
	HLPRX_RBipolar,
	HLPRX_RFullwave,
	HLPRX_RPosHalfwave,
	HLPRX_RNegHalfwave
} HLPRX_Rectification;

typedef enum
{
	HLPRX_SS12Bit,
	HLPRX_SS8Bit
} HLPRX_SampleSize;

typedef enum
{
	HLPRX_TCGTEInterfaceGate,
	HLPRX_TCGTEAbsolute
} HLPRX_TCGTriggerEvent;

typedef enum
{
	HLPRX_SSMultipleAScanNoCScan,
	HLPRX_SSOneAScanOneCScan,
	HLPRX_SSMultipleAScanOneCScan,
} HLPRX_ScanStorageOptions;

typedef enum
{
	HLPRX_ICDC,
	HLPRX_ICAC
} HLPRX_InputCoupling;

typedef enum
{
	HLPRX_II50Ohm,
	HLPRX_II1MOhm
} HLPRX_InputImpedance;

typedef enum
{
	HLPRX_AIInput1,
	HLPRX_AIInput0,
	HLPRX_AIInputCalibration,
	HLPRX_AIInputGND
} HLPRX_AnalogueInput;

typedef enum
{
	HLPRX_AG100mV,
	HLPRX_AG200mV,
	HLPRX_AG500mV,
	HLPRX_AG1V,
	HLPRX_AG2V,
	HLPRX_AG5V
} HLPRX_AnalogueInputRange;

typedef enum
{
	HLPRX_AxIInputNone,
	HLPRX_AxIInput0,
	HLPRX_AxIInput1,
	HLPRX_AxIInputBoth
} HLPRX_AuxInput;

typedef enum
{
	HLPRX_TExternal,
	HLPRX_TInternal,
	HLPRX_TEncoder
} HLPRX_TriggerSelect;

typedef enum
{
	HLPRX_GIGate0,
	HLPRX_GIGate1,
	HLPRX_GIGate2,
	HLPRX_GIGate3,
	HLPRX_GIGate4,
	HLPRX_GIGate5,
	HLPRX_GIGate6,
	HLPRX_GIGate7,
	HLPRX_GIGate8,
	HLPRX_GIGate9,
	HLPRX_GIGateCurved = 7
} HLPRX_GateIndex ;

typedef enum
{
	HLPRX_GTGate0,
	HLPRX_GTGate1,
	HLPRX_GTGate2,
	HLPRX_GTGate3,
	HLPRX_GTGate4,
	HLPRX_GTGate5,
	HLPRX_GTGate6,
	HLPRX_GTGate7,
	HLPRX_GTGate8,
	HLPRX_GTGate9,
	HLPRX_GTGateCurved = 7,
	HLPRX_GTAbsolute = 15
} HLPRX_GateTrigger;

typedef enum
{
	HLPRX_GTPBipolar,
	HLPRX_GTPPositive,
	HLPRX_GTPNegative
} HLPRX_GateThresholdPolarity;

typedef enum
{
	HLPRX_GTMLevel,
	HLPRX_GTMEdge
} HLPRX_GateTriggerMode;

typedef enum
{
	HLPRX_GDMLeadingFlank,
	HLPRX_GDMTrailingFlank,
	HLPRX_GDMPeak
} HLPRX_GateDistanceMetric;

typedef enum
{
	HLPRX_GAPSPeak0,
	HLPRX_GAPSPeak1,
	HLPRX_GAPSPeak2,
	HLPRX_GAPSPeak3,
	HLPRX_GAPSPeak4,
	HLPRX_GAPSPeak5,
	HLPRX_GAPSPeak6,
	HLPRX_GAPSPeak7,
	HLPRX_GAPSPeak8,
	HLPRX_GAPSPeak9,
	HLPRX_GAPSPeak10,
	HLPRX_GAPSPeak11,
	HLPRX_GAPSPeak12,
	HLPRX_GAPSPeak13,
	HLPRX_GAPSLastPeak,
	HLPRX_GAPSLargestPeak
} HLPRX_GateAmplitudePeakSelect;

typedef enum
{
	HLPRX_GDPSPeak0,
	HLPRX_GDPSPeak1,
	HLPRX_GDPSPeak2,
	HLPRX_GDPSPeak3,
	HLPRX_GDPSPeak4,
	HLPRX_GDPSPeak5,
	HLPRX_GDPSPeak6,
	HLPRX_GDPSPeak7,
	HLPRX_GDPSPeak8,
	HLPRX_GDPSPeak9,
	HLPRX_GDPSPeak10,
	HLPRX_GDPSPeak11,
	HLPRX_GDPSPeak12,
	HLPRX_GDPSPeak13,
	HLPRX_GDPSLastPeak,
	HLPRX_GDPSLargestPeak
} HLPRX_GateDistancePeakSelect;

// The user can express depths in any units that they like
// The API handles the conversion
typedef enum
{
	HLPRX_UUFirst,
	HLPRX_UUMetres = HLPRX_UUFirst,
	HLPRX_UUMillimetres,
	HLPRX_UUMicrons,
	HLPRX_UUInches,
	HLPRX_UUSeconds,
	HLPRX_UUMilliseconds,
	HLPRX_UUMicroseconds,
	HLPRX_UULast = HLPRX_UUMicroseconds
} HLPRX_UserUnits;

#endif