#ifndef INITIALISATION_H_
#define INITIALISATION_H_

#include <apci3600.h>
#include "apci3600-def.h"

/*interactively initialise a board*/
int i_Board_Initialisation(struct apci3600_card_t * pboard);

void get_Board_Initialisation(str_InitBoardArg_t * InitBoardArg);

/*Interactively Initialise an Analog input of the board
 * 
 * @param[in] fd file descriptor of the board
 * @param[out] Module module selected by user
 * 
 * @retval 0: success
 * @retval -1: i_PCI3600_InitAnalogInputModule() failed
 * @retval -2: i_PCI3600_GetAnalogInputModuleCalibrationStatus failed
 */
int i_Analog_Input_Initialisation(struct apci3600_card_t * pboard, uint8_t * pb_Module);

/* Interactively initialise the external trigger of the board */
int i_External_Trigger_Initialisation(struct apci3600_card_t * pboard);

/* Interactively initialise a cyclic acquisition */
int i_Init_And_Start_Cyclic_Acquisition(struct apci3600_card_t * pboard, uint8_t b_Module);

/* enable/disable master trigger  
 * 
 * @param flag 0: disable 1: enable
 * */
int apci3600_EnableDisableMasterTrigger(struct apci3600_card_t * pboard, uint8_t b_Module, unsigned long flag );

/* enable/disable master trigger on module b_Module
 * 
 * @param flag 0: disable 1: enable
 * */
int apci3600_EnableDisableDigitalInputExternalTrigger(struct apci3600_card_t * pboard, uint8_t b_Module, unsigned long flag );

int apci3600_ReleaseAnalogInputModule(struct apci3600_card_t * pboard, uint8_t b_Module);

int apci3600_StopAnalogInputModuleCyclicAcquisition(struct apci3600_card_t * pboard, uint8_t b_Module);

int apci3600_ReleaseAnalogInputModuleCyclicAcquisition(struct apci3600_card_t * pboard, uint8_t b_Module);

int apci3600_ResetAcquisitionBuffer(struct apci3600_card_t * pboard);

int apci3600_QueryAnalogInputCyclicAcquisitionNumberOfData(struct apci3600_card_t * pboard, unsigned long* val);

#endif /*INITIALISATION_H_*/
