#ifndef __APCI2016_API_H__
#define __APCI2016_API_H__

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)
#define __user 
#endif

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


/* output functions */
int do_CMD_APCI2016_Set1DigitalOutputOn(struct pci_dev * pdev, unsigned long arg );
int do_CMD_APCI2016_Set1DigitalOutputOff(struct pci_dev * pdev, unsigned long arg );
int do_CMD_APCI2016_Set16DigitalOutputsOn(struct pci_dev * pdev, uint16_t arg );
int do_CMD_APCI2016_Set16DigitalOutputsOff(struct pci_dev * pdev, uint16_t arg );
int do_CMD_APCI2016_Get16DigitalOutputStatus(struct pci_dev * pdev, uint16_t __user * arg );
int do_CMD_APCI2016_Get1DigitalOutputStatus(struct pci_dev * pdev, unsigned int __user * arg);

/* watchdog */
int do_CMD_APCI2016_InitWatchdog(struct pci_dev * pdev, uint32_t arg);
int do_CMD_APCI2016_StartWatchdog(struct pci_dev * pdev);
int do_CMD_APCI2016_TriggerWatchdog(struct pci_dev * pdev);
int do_CMD_APCI2016_ReadWatchdogStatus(struct pci_dev * pdev,unsigned int __user * arg);

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)
#undef __user 
#endif

#endif // __APCI2016_API_H__
