 /* @file api.h
  * 
  * @brief Mainly this header should contains definition of ioctl handler. 
  * 
  * 
  * 
  */

/** @par LICENCE
 * 
 *  @verbatim
 Copyright (C) 2009  ADDI-DATA GmbH for the source code of this module.
        
 ADDI-DATA GmbH
 Airpark Business Center
 Airport Boulevard B210
 77836 Rheinmuenster
 Germany
 Tel: +49(0)7229/1847-0
 Fax: +49(0)7229/1847-200
 http://www.addi-data-com
 info@addi-data.com
 
 This library is free software; you can redistribute it and/or modify it under 
 the terms of the GNU Lesser General Public License as published by the 
 Free Software Foundation; either version 2.1 of the License, 
 or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful, 
 but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 or FITNESS FOR A PARTICULAR PURPOSE. 
 See the GNU Lesser General Public License for more details.
 
 You should have received a copy of the GNU Lesser General Public License 
 along with this library; if not, write to the Free Software Foundation, 
 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 
 You also shoud find the complete LGPL in the LGPL.txt file accompanying 
 this source code.
 
 @endverbatim
**/

#ifndef __APCI3120_API_H_
#define __APCI3120_API_H_

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

/* deprecated */
int do_CMD_APCI3120_CheckAndGetPCISlotNumber(struct pci_dev * pdev,unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_GetHardwareInformation(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

//------------------------------------------------------------------------------

int do_CMD_APCI3120_SetBoardInformation(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

//------------------------------------------------------------------------------

/* Analog output */
int do_CMD_APCI3120_Write1AnalogOutput(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_WriteMoreAnalogOutput(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

//------------------------------------------------------------------------------

/* Analog input */
int do_CMD_APCI3120_Read1AnalogInput(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_ReadMoreAnalogInputs (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

/* Eead more in several functions */
int do_CMD_APCI3120_InitReadMoreAnalogInput (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_StartReadMoreAnalogInput (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_TestEndOfReadMoreConversion (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_TestReadMoreAnalogInput (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_ReadMoreValues (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_ReadMoreAnalogInputsEx (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

/* Digital I/O */
int do_CMD_APCI3120_Read4DigitalInput (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_SetOutputMemoryOn (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_SetOutputMemoryOff (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_Set4DigitalOutputOn (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_Set4DigitalOutputOff (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

/* Sequence */
int do_CMD_APCI3120_InitAnalogInputSequenceAcquisition (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_StartAnalogInputSequenceAcquisition (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_StopSequenceAcquisition (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

/* Interruption */
int do_CMD_APCI3120_SetBoardInterruptRoutine (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3120_ResetBoardInterruptRoutine (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

/* Event */
int do_CMD_apci3120_EventEmpty(struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_apci3120_EventWait(struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

//------------------------------------------------------------------------------

/** Execute a command.
*
* @param pdev Pointer to a device.
* @param cmd Command to execute
* @param arg Argument of the command.
*/
int apci3120_do_ioctl(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

#endif // __APCI3120_API_H_
