 /* @file apci3701.h
  * 
  * @brief Define the public API for the apci3701 ADDI-DATA board. 
  * 
  *
  */

/** @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 __apci3701_H__
#define __apci3701_H__


#include "apci.h"

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

#define ADDIDATA_ENABLE									1
#define ADDIDATA_DISABLE								0
#define ADDIDATA_TRIGGER_START_A_SINGLE_CONVERSION		0
#define ADDIDATA_ONE_SHOT_TRIGGER						1
#define ADDIDATA_TRIGGER_START_A_SEQUENCE_SERIES		2
#define ADDIDATA_TRIGGER_START_A_SINGLE_SEQUENCE		3
#define ADDIDATA_TRIGGER_START_A_SCAN_SERIES	        6
#define ADDIDATA_TRIGGER_START_A_SINGLE_SCAN  			7
#define ADDIDATA_TRIGGER_START_A_AUTO_REFRESH_SERIES 	10
#define ADDIDATA_TRIGGER_START_A_SINGLE_AUTO_REFRESH 	11

#define ADDIDATA_LOW									1
#define ADDIDATA_HIGH 									2
#define ADDIDATA_LOW_HIGH								3

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

//GENERAL DEFINE

#define apci3701_BOARD_NAME                      "apci3701"
#define apci3701_BOARD_VENDOR_ID                 0x15B8
#define apci3701_BOARD_DEVICE_ID                 0x3005
#define apci3702_BOARD_DEVICE_ID                 0x302A				 	

/* value used for CMD_apci3701_CheckAndGetPCISlotNumber ! DEPRECATED ! */
#ifndef CONFIG_apci3701_MAX_BOARD_NBR
#define CONFIG_apci3701_MAX_BOARD_NBR                   (3)
#endif // CONFIG_apci3701_MAX_BOARD_NBR

// for compatibility with older driver (deprecated)
#define apci3701_MAX_BOARD_NBR CONFIG_apci3701_MAX_BOARD_NBR

// IOCTL define part
#define apci3701_MAGIC (char) 'A'

/**
 * @param (char*) area of size CONFIG_apci3701_MAX_BOARD_NBR+1
 * 
 * @deprecated
 * 
 */
#define CMD_apci3701_CheckAndGetPCISlotNumber   _IOR(apci3701_MAGIC, 1,char*)

#define CMD_apci3701_SetBoardInformation        _IOW(apci3701_MAGIC, 2,USHORT)

/**
 * @deprecated
 */
#define CMD_apci3701_GetHardwareInformation     _IOR(apci3701_MAGIC, 3,str_BaseInformations*)

#define CMD_apci3701_enable_disable_primary_short_circuit_interrupt	_IOW( apci3701_MAGIC, 4, BYTE)

#define CMD_apci3701_ream_primary_open_short_circuit_test	_IOW( apci3701_MAGIC, 5, BYTE)

#define CMD_apci3701_enable_disable_secondary_short_circuit_test	_IOW( apci3701_MAGIC, 6, BYTE)

#define CMD_apci3701_read_one_analog_input _IOWR( apci3701_MAGIC, 7, uint32_t *)

#define CMD_apci3701_enable_disable_secondary_open_circuit_test _IOW( apci3701_MAGIC, 8, BYTE)

#define CMD_apci3701_initialize_transducer _IOWR( apci3701_MAGIC, 9, uint32_t *)

#define CMD_apci3701_test_channel_secondary_line_open_circuit _IOWR( apci3701_MAGIC, 10, uint32_t *)

#define CMD_apci3701_test_channel_secondary_line_short_circuit _IOWR( apci3701_MAGIC, 11, uint32_t *)

#define CMD_apci3701_enable_disable_primary_open_circuit_test _IOW( apci3701_MAGIC, 12, BYTE )

#define CMD_apci3701_test_primary_line _IOWR ( apci3701_MAGIC, 13, uint32_t* )

#define CMD_apci3701_EventEmpty _IOWR ( apci3701_MAGIC, 14, uint32_t* )

#define CMD_apci3701_EventWait _IOWR ( apci3701_MAGIC, 15, uint32_t* )


/** Used internally. This is the ioctl CMD with the highest number.
 * @internal
 */
#define __apci3701_UPPER_IOCTL_CMD 15

#endif // __apci3701_H__
