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

/** @par LICENCE
 * 
 *  @verbatim
  Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module.
  
         ADDI-DATA GmbH
         Dieselstrasse 3
         D-77833 Ottersweier
         Tel: +19(0)7223/9493-0
         Fax: +49(0)7223/9493-92
         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 __APCI3001_API_H_
#define __APCI3001_API_H_

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

//------------------------------------------------------------------------------
/* deprecated */
int do_CMD_APCI3001_CheckAndGetPCISlotNumber(struct pci_dev * pdev,unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_GetHardwareInformation(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

//------------------------------------------------------------------------------
int do_CMD_APCI3001_SetBoardInformation(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);

/* Simple analog input */
int do_CMD_APCI3001_Read1AnalogInput(struct pci_dev * pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_ReadMoreAnalogInputs (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

/* Eead more in several functions */
int do_CMD_APCI3001_InitReadMoreAnalogInput (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_StartReadMoreAnalogInput (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_TestEndOfReadMoreConversion (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_TestReadMoreAnalogInput (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_ReadMoreValues (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_ReadMoreAnalogInputsEx (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

/* Digital I/O */
int do_CMD_APCI3001_Read4DigitalInput (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_SetOutputMemoryOn (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_SetOutputMemoryOff (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_Set4DigitalOutputOn (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);
int do_CMD_APCI3001_Set4DigitalOutputOff (struct pci_dev *pdev, unsigned int cmd, unsigned long arg);

#endif // __APCI3001_API_H_
