/*+-----------------------------------------------------------------------+  */

/*| (C) ADDI-DATA GmbH Dieselstra�e 3 D-77833 Ottersweier                 |  */
/*+-----------------------------------------------------------------------+  */
/*| Tel : +49 (0) 7223/9493-0     | email : info@addi-data.com            |  */
/*| Fax : +49 (0) 7223/9493-92    | Internet : http:$/$/www.addi-data.com   |*/
/*+-------------------------------+---------------------------------------+  */
/*| Project : APCI-3600           | Compiler : Microsoft Visual C++       |  */
/*| Module name :Primary_Include.H|  Version : 6.0                        |  */
/*+-------------------------------+---------------------------------------+  */
/*| Author : Guinot Catherine       Date : 16/09/2004                     |  */
/*+-----------------------------------------------------------------------+  */
/*| Description : Header file of the primary function                     |  */
/*+-----------------------------------------------------------------------+  */
/*|                             UPDATES                                   |  */
/*+----------+-----------+------------------------------------------------+  */
/*| Date     | Author    | Description of updates                         |  */
/*+----------+-----------+------------------------------------------------+  */
/*|          |           |                                                |  */
/*+----------+-----------+------------------------------------------------+  */

/*****************************************************************************/
/*                               P_AN_INP.C                                  */
/*****************************************************************************/
int i_PCI3600_Primary_InitAnalogInModule (void __iomem * dw_Address,
		uint8_t b_Module,
		uint8_t* pb_SingleDiffMode,
		uint8_t* pb_Coupling,
		uint8_t*  pb_EnableCurrentSource,
		uint8_t* pb_GainSelection,
		uint8_t b_ClockSelection,
		uint8_t b_SpeedMode);

int i_PCI3600_Primary_TestIfAnalogInModuleInUse (void __iomem * dw_Address,
		uint8_t b_Module,
		uint8_t* pb_Status);

int i_PCI3600_Primary_StartAnalogInModuleSingleAcquisition (void __iomem * dw_GeneralAddress,
		void __iomem * dw_AnalogInAddress,
		uint8_t b_Module);

int i_PCI3600_Primary_TestAnalogInModuleFIFO (void __iomem *
		dw_AnalogInAddress,
		uint8_t b_Module,
		uint8_t* pb_FIFOStatus);

int i_PCI3600_Primary_ReadAnalogInModuleValueFromFIFO (void __iomem *
		dw_AnalogInAddress,
		uint8_t b_Module,
		uint32_t* 
		pdw_Values);
int i_PCI3600_Primary_EnableDisableAnalogInDigitalExternalTrigger (void __iomem * dw_Address,
		uint8_t b_Module,
		uint8_t b_ExternTriggerFlag);

int i_PCI3600_Primary_InitAnalogInModuleCyclicAcquisition (void __iomem * dw_AnalogInAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Module,
		uint8_t b_RunMode,
		uint32_t dw_OnBoardRAMBufferAddress,
		uint32_t dw_OnBoardRAMBufferSize,
		uint32_t dw_CompareValue);

int i_PCI3600_Primary_StartAnalogInModuleCyclicAcquisition (void __iomem * dw_GeneralAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Module);

int i_PCI3600_Primary_StartMoreAnalogInModuleCyclicAcquisition (void __iomem * dw_GeneralAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Module);

int i_PCI3600_Primary_StopAnalogInModuleCyclicAcquisition (void __iomem * dw_GeneralAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Module);

int i_PCI3600_Primary_GetAnalogInModuleCyclicAcquisitionStatus (void __iomem * dw_AnalogInAddress,
		void __iomem * dw_GeneralAddress,
		uint8_t b_DigExtTriggerFlag,
		uint8_t b_Module,
		uint8_t* pb_StartStatus);

int i_PCI3600_Primary_GetAnalogInModuleCalibrationStatus (void __iomem * dw_AnalogInAddress,
		uint8_t b_Module,
		uint8_t* pb_Status);

int i_PCI3600_Primary_EnableDisableAnalogInMasterTrigger (void __iomem * dw_Address,
		uint8_t b_Module,
		uint8_t b_MasterTriggerFlag);

/*****************************************************************************/
/*                               P_AN_OUT.C                                  */
/*****************************************************************************/
int i_PCI3600_Primary_InitAnalogOutChannel (void __iomem * dw_Address,
		uint8_t b_Channel,
		uint8_t b_ClockSelection,
		uint8_t b_SpeedMode);

int i_PCI3600_Primary_ReadAnalogOutReadyBit (void __iomem * dw_Address,
		uint8_t b_Channel,
		uint8_t* pb_ReadyBit);

int i_PCI3600_Primary_WriteAnalogOutValue (void __iomem *
		dw_AnalogOutAddress,
		void __iomem * dw_GeneralAddress,
		uint8_t b_Channel,
		uint16_t w_Value);
int i_PCI3600_Primary_EnableDisableAnalogOutDigitalExternalTrigger (void __iomem * dw_Address,
		uint8_t b_Channel,
		uint8_t b_ExternTriggerFlag);

int i_PCI3600_Primary_InitAnalogOutSignalGenerator (void __iomem * dw_AnalogOutAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Channel,
		uint8_t b_RunMode,
		uint32_t dw_OnBoardRAMBufferAddress,
		uint32_t dw_OnBoardRAMBufferSize,
		uint32_t dw_NbrOfValueTransfered,
		uint32_t dw_CompareValue);

int i_PCI3600_Primary_StartAnalogOutSignalGenerator (void __iomem * dw_AnalogOutAddress,
		void __iomem * dw_GeneralAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Channel);
int i_PCI3600_Primary_StopAnalogOutSignalGenerator (void __iomem * dw_AnalogOutAddress,
		void __iomem * dw_GeneralAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Channel);

int i_PCI3600_Primary_GetAnalogOutSignalGeneratorStatus (void __iomem * dw_AnalogOutAddress,
		void __iomem * dw_GeneralAddress,
		uint8_t b_DigExtTriggerFlag,
		uint8_t b_Channel,
		uint8_t* pb_StartStatus);

int i_PCI3600_Primary_EnableDisableAnalogOutMasterTrigger (void __iomem * dw_Address,
		uint8_t b_Channel,
		uint8_t b_MasterTriggerFlag);

/*****************************************************************************/
/*                               P_CHRONOM.C                                 */
/*****************************************************************************/
int i_PCI3600_Primary_InitChronometer (void __iomem * dw_Address,
		uint8_t b_ChronometerModule,
		uint8_t b_ClockDivisor);

int i_PCI3600_Primary_TestIfChronometerInUse (void __iomem * dw_Address,
		uint8_t b_Module,
		uint8_t* pb_Status);
		

int i_PCI3600_Primary_StartChronometerAcquisition (void __iomem * dw_GeneralAddress,
		void __iomem * dw_ChronometerAddress,
		uint8_t b_Module);
int i_PCI3600_Primary_StopChronometerAcquisition (void __iomem * dw_GeneralAddress,
		uint8_t b_Module);

int i_PCI3600_Primary_GetChronometerFIFOStatus (void __iomem * dw_Address,
		uint8_t b_Module,
		uint8_t* pb_FIFOStatus);
		
int i_PCI3600_Primary_ReadChronometerValueFromFIFO (void __iomem * dw_Address,
		uint8_t b_Module,
		uint32_t* pdw_Values);
int i_PCI3600_Primary_EnableDisableChronometerDigitalExternalTrigger (void __iomem * dw_Address,
		uint8_t b_ChronometerModule,
		uint8_t b_ExternTriggerFlag);

int i_PCI3600_Primary_InitChronometerCyclicAcquisition (void __iomem * dw_ChronometerAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Module,
		uint8_t b_RunMode,
		uint32_t dw_OnBoardRAMBufferAddress,
		uint32_t dw_OnBoardRAMBufferSize,
		uint32_t dw_CompareValue);

int i_PCI3600_Primary_StartChronometerCyclicAcquisition (void __iomem * dw_GeneralAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Module);

int i_PCI3600_Primary_GetChronometerCyclicAcquisitionStatus (void __iomem * dw_ChronometerAddress,
		void __iomem * dw_GeneralAddress,
		uint8_t b_DigExtTriggerFlag,
		uint8_t b_Module,
		uint8_t* pb_StartStatus);
int i_PCI3600_Primary_StopChronometerCyclicAcquisition (void __iomem * dw_GeneralAddress,
		void __iomem * dw_OnBoardLocalDMAControllerAddress,
		uint8_t b_Module);
int i_PCI3600_Primary_EnableDisableChronometerMasterTrigger (void __iomem * dw_Address,
		uint8_t b_ChronometerModule,
		uint8_t b_MasterTriggerFlag);

/*****************************************************************************/
/*                               P_EXT_TRIG.C                                */
/*****************************************************************************/
int i_PCI3600_Primary_InitDigitalExternalTrigger (void __iomem * dw_Address,
		uint8_t b_TriggerLevel,
		uint16_t w_TriggerCountValue);

int i_PCI3600_Primary_MasterTrigger (void __iomem * dw_Address);

/*****************************************************************************/
/*                                   P_DMA.C                                 */
/*****************************************************************************/
int i_PCI3600_Primary_PCI9054InitDMABlockTransfer (void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel, 
		uint32_t dw_SizeToTransfer,
		uint32_t dw_LocalAddress,
		uint32_t dw_PCIAddress,
		uint8_t b_TransferDirection,
		uint8_t b_InterruptFlag);

int i_PCI3600_Primary_PCI9054InitDMAScatterGatherTransfer (void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel,
		uint8_t b_InterruptFlag,
		uint32_t dw_FirstDescriptorPhysicalAddress);

int i_PCI3600_Primary_PCI9054StartDMATransfer (void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel);
		
int i_PCI3600_Primary_PCI9054StopDMATransfer (void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel);
		
int i_PCI3600_Primary_PCI9054AbortDMATransfer (void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel);

int i_PCI3600_Primary_PCI9054GetDMATransferStatus (void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel,
		uint8_t* pb_DMAStatus);
		
int i_PCI3600_Primary_PCI9054GetDMAInterruptStatus (void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel,
		uint8_t* pb_DMAIrqStatus);

int i_PCI3600_Primary_PCI9054ClearDMAInterrupt (void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel);


//BEGIN 22/05/06 FB
int i_PCI3600_Primary_PCI9054AbortDMATransfer_Maison (uint32_t dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel);


int i_PCI3600_Primary_PCI9054GetDMAEnableStatus(void __iomem * dw_PCI9054ControllerMemAddress,
		uint8_t b_DMAChannel,
		uint8_t* pb_DMAEnableStatus
		);
//END 22/05/06 FB
