 /* @file apci1032.h
  *
  * @brief Define the public API for the apci1032 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 __APCI1032_H__
#define __APCI1032_H__

/*
  +-----------------------------------------------------------------------+
  | (C) ADDI-DATA GmbH          Dieselstrasse 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   : API APCI1032      | Compiler : GCC                        |
  | Modulname : APCI1032.H        | Version  : 2.96 (SuSE 7.1 - 2.2.18)   |
  | Version   : 01.00.01          |                                       |
  +-------------------------------+---------------------------------------+
  | Author    : STOLZ, Eric       | Date     : 22.08.2001                 |
  +-----------------------------------------------------------------------+
  | Description : APCI1032 header	MAIN                              |
  +-----------------------------------------------------------------------+
  |                             UPDATE'S                                  |
  +-----------------------------------------------------------------------+
  |   Date   |   Author  |          Description of updates                |
  +----------+-----------+------------------------------------------------+
  |          |           |                                                |
  +-----------------------------------------------------------------------+
*/
#define APCI1032_DRIVER_VERSION_MAJOR 2026
#define APCI1032_DRIVER_VERSION_MINOR 06
#define APCI1032_DRIVER_VERSION_PATCH 1

#include <apci.h>

//GENERAL DEFINE

#define APCI1032_BOARD_NAME                      "APCI1032"
#define APCI1032_BOARD_VENDOR_ID                 0x15B8
#define APCI1032_BOARD_DEVICE_ID                 0x1003

/* value used for CMD_APCI1032_CheckAndGetPCISlotNumber ! DEPRECATED ! */
#ifndef CONFIG_APCI1032_MAX_BOARD_NBR
#define CONFIG_APCI1032_MAX_BOARD_NBR                   (3)
#endif // CONFIG_APCI1032_MAX_BOARD_NBR

// for compatibility with older driver (deprecated)
#define APCI1032_MAX_BOARD_NBR CONFIG_APCI1032_MAX_BOARD_NBR

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

/**
 * @param (char*) area of size CONFIG_APCI1032_MAX_BOARD_NBR+1
 *
 * @deprecated
 *
 */
#define CMD_APCI1032_CheckAndGetPCISlotNumber   _IOR(APCI1032_MAGIC, 1,char*)
#define CMD_APCI1032_SetBoardInformation        _IOW(APCI1032_MAGIC, 2,uint16_t)
/**
 * @deprecated
 *
 */
#define CMD_APCI1032_GetHardwareInformation     _IOR(APCI1032_MAGIC, 3,str_BaseInformations*)

/* returns the value of the channel.
*
* @param chan (unsigned int*) Channel to read from 1 to 32
* The call returns the actual value in chan (0 or 1).
* @return 0 is succeded, non 0 otherwise. errno is set accordingly
* ioctl (fd,CMD_APCI1032_Read1DigitalInput,&chan)
*
* example:
* @verbatim

		int i;
		unsigned int chan;
		for (i=1; i< 33; i++)
		{
			printf("%2d ",i);

		}
		printf ("\n");
		for (i=1; i< 33; i++)
		{
			chan = i;
			if ( ioctl (fd,CMD_APCI1032_Read1DigitalInput,&chan) == -1)
			{
				perror("ioctl");
				exit(1);
			}
			printf ("%2d ",chan);
		}
		printf("\n");

* @endverbatim
*
*/
#define CMD_APCI1032_Read1DigitalInput          _IOWR(APCI1032_MAGIC, 4, unsigned int*)
/**
 * @param Port (uint8_t*)  Must be between 1 and 4 included
 * The call returns the actual value in chan.
 *
 * @return 0 is succeded, non 0 otherwise. errno is set accordingly.
 *
 */
#define CMD_APCI1032_Read8DigitalInput          _IOWR(APCI1032_MAGIC, 5, uint8_t*)
/**
 * @param Port (uint16_t*)  Must be between 1 and 4 included
 *
 * @return 0 is succeded, non 0 otherwise. errno is set accordingly.
 *
 */
#define CMD_APCI1032_Read16DigitalInput         _IOWR(APCI1032_MAGIC, 6, uint16_t*)
/**
 * @param (uint32_t*) Pointer to the area to store inputs
 *
 * @return 0 is succeded, non 0 otherwise. errno is set accordingly.
 *
 */
#define CMD_APCI1032_Read32DigitalInput         _IOR(APCI1032_MAGIC, 7,uint32_t*)

#endif // __APCI1032_H__
