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

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 109 lines · 65 code · 17 blank · 27 comment · 0 complexity · cc3f0bdf6766312db16a04bde57c757c 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. /* Card Specific information */
  18. #define APCI035_BOARD_VENDOR_ID 0x15B8
  19. #define APCI035_ADDRESS_RANGE 255
  20. /* ANALOG INPUT RANGE */
  21. static struct comedi_lrange range_apci035_ai = { 8, {
  22. BIP_RANGE(10),
  23. BIP_RANGE(5),
  24. BIP_RANGE(2),
  25. BIP_RANGE(1),
  26. UNI_RANGE(10),
  27. UNI_RANGE(5),
  28. UNI_RANGE(2),
  29. UNI_RANGE(1)
  30. }
  31. };
  32. /* Timer / Watchdog Related Defines */
  33. #define APCI035_TCW_SYNC_ENABLEDISABLE 0
  34. #define APCI035_TCW_RELOAD_VALUE 4
  35. #define APCI035_TCW_TIMEBASE 8
  36. #define APCI035_TCW_PROG 12
  37. #define APCI035_TCW_TRIG_STATUS 16
  38. #define APCI035_TCW_IRQ 20
  39. #define APCI035_TCW_WARN_TIMEVAL 24
  40. #define APCI035_TCW_WARN_TIMEBASE 28
  41. #define ADDIDATA_TIMER 0
  42. /* #define ADDIDATA_WATCHDOG 1 */
  43. #define APCI035_TW1 0
  44. #define APCI035_TW2 32
  45. #define APCI035_TW3 64
  46. #define APCI035_TW4 96
  47. #define APCI035_AI_OFFSET 0
  48. #define APCI035_TEMP 128
  49. #define APCI035_ALR_SEQ 4
  50. #define APCI035_START_STOP_INDEX 8
  51. #define APCI035_ALR_START_STOP 12
  52. #define APCI035_ALR_IRQ 16
  53. #define APCI035_EOS 20
  54. #define APCI035_CHAN_NO 24
  55. #define APCI035_CHAN_VAL 28
  56. #define APCI035_CONV_TIME_TIME_BASE 36
  57. #define APCI035_RELOAD_CONV_TIME_VAL 32
  58. #define APCI035_DELAY_TIME_TIME_BASE 44
  59. #define APCI035_RELOAD_DELAY_TIME_VAL 40
  60. #define ENABLE_EXT_TRIG 1
  61. #define ENABLE_EXT_GATE 2
  62. #define ENABLE_EXT_TRIG_GATE 3
  63. #define ANALOG_INPUT 0
  64. #define TEMPERATURE 1
  65. #define RESISTANCE 2
  66. #define ADDIDATA_GREATER_THAN_TEST 0
  67. #define ADDIDATA_LESS_THAN_TEST 1
  68. #define APCI035_MAXVOLT 2.5
  69. #define ADDIDATA_UNIPOLAR 1
  70. #define ADDIDATA_BIPOLAR 2
  71. /* ADDIDATA Enable Disable */
  72. #define ADDIDATA_ENABLE 1
  73. #define ADDIDATA_DISABLE 0
  74. /* Hardware Layer functions for Apci035 */
  75. /* TIMER */
  76. /* timer value is passed as u seconds */
  77. int i_APCI035_ConfigTimerWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
  78. struct comedi_insn *insn, unsigned int *data);
  79. int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device *dev,
  80. struct comedi_subdevice *s,
  81. struct comedi_insn *insn, unsigned int *data);
  82. int i_APCI035_ReadTimerWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
  83. struct comedi_insn *insn, unsigned int *data);
  84. /* Temperature Related Defines (Analog Input Subdevice) */
  85. int i_APCI035_ConfigAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s,
  86. struct comedi_insn *insn, unsigned int *data);
  87. int i_APCI035_ReadAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s,
  88. struct comedi_insn *insn, unsigned int *data);
  89. /* Interrupt */
  90. static void v_APCI035_Interrupt(int irq, void *d);
  91. /* Reset functions */
  92. int i_APCI035_Reset(struct comedi_device *dev);