/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.h

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 121 lines · 65 code · 19 blank · 37 comment · 0 complexity · 4ca212e2e9af7fd1a3464eb26321beaa MD5 · raw file

  1. /*
  2. * Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module.
  3. *
  4. * ADDI-DATA GmbH
  5. * Dieselstrasse 3
  6. * D-77833 Ottersweier
  7. * Tel: +19(0)7223/9493-0
  8. * Fax: +49(0)7223/9493-92
  9. * http://www.addi-data.com
  10. * info@addi-data.com
  11. *
  12. * This program is free software; you can redistribute it and/or modify it
  13. * under the terms of the GNU General Public License as published by the Free
  14. * Software Foundation; either version 2 of the License, or (at your option)
  15. * any later version.
  16. */
  17. /********* Definitions for APCI-1564 card *****/
  18. #define APCI1564_BOARD_VENDOR_ID 0x15B8
  19. #define APCI1564_ADDRESS_RANGE 128
  20. /* DIGITAL INPUT-OUTPUT DEFINE */
  21. /* Input defines */
  22. #define APCI1564_DIGITAL_IP 0x04
  23. #define APCI1564_DIGITAL_IP_INTERRUPT_MODE1 4
  24. #define APCI1564_DIGITAL_IP_INTERRUPT_MODE2 8
  25. #define APCI1564_DIGITAL_IP_IRQ 16
  26. /* Output defines */
  27. #define APCI1564_DIGITAL_OP 0x18
  28. #define APCI1564_DIGITAL_OP_RW 0
  29. #define APCI1564_DIGITAL_OP_INTERRUPT 4
  30. #define APCI1564_DIGITAL_OP_IRQ 12
  31. /* Digital Input IRQ Function Selection */
  32. #define ADDIDATA_OR 0
  33. #define ADDIDATA_AND 1
  34. /* Digital Input Interrupt Status */
  35. #define APCI1564_DIGITAL_IP_INTERRUPT_STATUS 12
  36. /* Digital Output Interrupt Status */
  37. #define APCI1564_DIGITAL_OP_INTERRUPT_STATUS 8
  38. /* Digital Input Interrupt Enable Disable. */
  39. #define APCI1564_DIGITAL_IP_INTERRUPT_ENABLE 0x4
  40. #define APCI1564_DIGITAL_IP_INTERRUPT_DISABLE 0xFFFFFFFB
  41. /* Digital Output Interrupt Enable Disable. */
  42. #define APCI1564_DIGITAL_OP_VCC_INTERRUPT_ENABLE 0x1
  43. #define APCI1564_DIGITAL_OP_VCC_INTERRUPT_DISABLE 0xFFFFFFFE
  44. #define APCI1564_DIGITAL_OP_CC_INTERRUPT_ENABLE 0x2
  45. #define APCI1564_DIGITAL_OP_CC_INTERRUPT_DISABLE 0xFFFFFFFD
  46. /* ADDIDATA Enable Disable */
  47. #define ADDIDATA_ENABLE 1
  48. #define ADDIDATA_DISABLE 0
  49. /* TIMER COUNTER WATCHDOG DEFINES */
  50. #define ADDIDATA_TIMER 0
  51. #define ADDIDATA_COUNTER 1
  52. #define ADDIDATA_WATCHDOG 2
  53. #define APCI1564_DIGITAL_OP_WATCHDOG 0x28
  54. #define APCI1564_TIMER 0x48
  55. #define APCI1564_COUNTER1 0x0
  56. #define APCI1564_COUNTER2 0x20
  57. #define APCI1564_COUNTER3 0x40
  58. #define APCI1564_COUNTER4 0x60
  59. #define APCI1564_TCW_SYNC_ENABLEDISABLE 0
  60. #define APCI1564_TCW_RELOAD_VALUE 4
  61. #define APCI1564_TCW_TIMEBASE 8
  62. #define APCI1564_TCW_PROG 12
  63. #define APCI1564_TCW_TRIG_STATUS 16
  64. #define APCI1564_TCW_IRQ 20
  65. #define APCI1564_TCW_WARN_TIMEVAL 24
  66. #define APCI1564_TCW_WARN_TIMEBASE 28
  67. /* Hardware Layer functions for Apci1564 */
  68. /*
  69. * DI for di read
  70. */
  71. int i_APCI1564_ConfigDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
  72. struct comedi_insn *insn, unsigned int *data);
  73. int i_APCI1564_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
  74. struct comedi_insn *insn, unsigned int *data);
  75. int i_APCI1564_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
  76. struct comedi_insn *insn, unsigned int *data);
  77. /* DO */
  78. int i_APCI1564_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
  79. struct comedi_insn *insn, unsigned int *data);
  80. int i_APCI1564_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
  81. struct comedi_insn *insn, unsigned int *data);
  82. int i_APCI1564_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
  83. struct comedi_insn *insn, unsigned int *data);
  84. int i_APCI1564_ReadInterruptStatus(struct comedi_device *dev, struct comedi_subdevice *s,
  85. struct comedi_insn *insn, unsigned int *data);
  86. /*
  87. * TIMER timer value is passed as u seconds
  88. */
  89. int i_APCI1564_ConfigTimerCounterWatchdog(struct comedi_device *dev,
  90. struct comedi_subdevice *s,
  91. struct comedi_insn *insn, unsigned int *data);
  92. int i_APCI1564_StartStopWriteTimerCounterWatchdog(struct comedi_device *dev,
  93. struct comedi_subdevice *s,
  94. struct comedi_insn *insn,
  95. unsigned int *data);
  96. int i_APCI1564_ReadTimerCounterWatchdog(struct comedi_device *dev,
  97. struct comedi_subdevice *s,
  98. struct comedi_insn *insn, unsigned int *data);
  99. /* intERRUPT */
  100. static void v_APCI1564_Interrupt(int irq, void *d);
  101. /* RESET */
  102. int i_APCI1564_Reset(struct comedi_device *dev);