Xenomai API
2.5.6.1
|
00001 00021 #ifndef __ANALOGY_NI_MIO_H__ 00022 #define __ANALOGY_NI_MIO_H__ 00023 00024 /* Debug stuff */ 00025 00026 #ifdef CONFIG_DEBUG_MIO 00027 #define MDPRINTK(fmt, args...) rtdm_printk(format, ##args) 00028 #else /* !CONFIG_DEBUG_MIO */ 00029 #define MDPRINTK(fmt, args...) 00030 #endif /* CONFIG_DEBUG_MIO */ 00031 00032 /* Subdevice related defines */ 00033 00034 #define AIMODE_NONE 0 00035 #define AIMODE_HALF_FULL 1 00036 #define AIMODE_SCAN 2 00037 #define AIMODE_SAMPLE 3 00038 00039 #define NI_AI_SUBDEV 0 00040 #define NI_AO_SUBDEV 1 00041 #define NI_DIO_SUBDEV 2 00042 #define NI_8255_DIO_SUBDEV 3 00043 #define NI_UNUSED_SUBDEV 4 00044 #define NI_CALIBRATION_SUBDEV 5 00045 #define NI_EEPROM_SUBDEV 6 00046 #define NI_PFI_DIO_SUBDEV 7 00047 #define NI_CS5529_CALIBRATION_SUBDEV 8 00048 #define NI_SERIAL_SUBDEV 9 00049 #define NI_RTSI_SUBDEV 10 00050 #define NI_GPCT0_SUBDEV 11 00051 #define NI_GPCT1_SUBDEV 12 00052 #define NI_FREQ_OUT_SUBDEV 13 00053 #define NI_NUM_SUBDEVICES 14 00054 00055 #define NI_GPCT_SUBDEV(x) ((x == 1) ? NI_GPCT1_SUBDEV : NI_GPCT0_SUBDEV) 00056 00057 #define TIMEBASE_1_NS 50 00058 #define TIMEBASE_2_NS 10000 00059 00060 #define SERIAL_DISABLED 0 00061 #define SERIAL_600NS 600 00062 #define SERIAL_1_2US 1200 00063 #define SERIAL_10US 10000 00064 00065 /* PFI digital filtering options for ni m-series for use with 00066 INSN_CONFIG_FILTER. */ 00067 #define NI_PFI_FILTER_OFF 0x0 00068 #define NI_PFI_FILTER_125ns 0x1 00069 #define NI_PFI_FILTER_6425ns 0x2 00070 #define NI_PFI_FILTER_2550us 0x3 00071 00072 /* Signals which can be routed to an NI PFI pin on an m-series board 00073 with INSN_CONFIG_SET_ROUTING. These numbers are also returned by 00074 INSN_CONFIG_GET_ROUTING on pre-m-series boards, even though their 00075 routing cannot be changed. The numbers assigned are not arbitrary, 00076 they correspond to the bits required to program the board. */ 00077 #define NI_PFI_OUTPUT_PFI_DEFAULT 0 00078 #define NI_PFI_OUTPUT_AI_START1 1 00079 #define NI_PFI_OUTPUT_AI_START2 2 00080 #define NI_PFI_OUTPUT_AI_CONVERT 3 00081 #define NI_PFI_OUTPUT_G_SRC1 4 00082 #define NI_PFI_OUTPUT_G_GATE1 5 00083 #define NI_PFI_OUTPUT_AO_UPDATE_N 6 00084 #define NI_PFI_OUTPUT_AO_START1 7 00085 #define NI_PFI_OUTPUT_AI_START_PULSE 8 00086 #define NI_PFI_OUTPUT_G_SRC0 9 00087 #define NI_PFI_OUTPUT_G_GATE0 10 00088 #define NI_PFI_OUTPUT_EXT_STROBE 11 00089 #define NI_PFI_OUTPUT_AI_EXT_MUX_CLK 12 00090 #define NI_PFI_OUTPUT_GOUT0 13 00091 #define NI_PFI_OUTPUT_GOUT1 14 00092 #define NI_PFI_OUTPUT_FREQ_OUT 15 00093 #define NI_PFI_OUTPUT_PFI_DO 16 00094 #define NI_PFI_OUTPUT_I_ATRIG 17 00095 #define NI_PFI_OUTPUT_RTSI0 18 00096 #define NI_PFI_OUTPUT_PXI_STAR_TRIGGER_IN 26 00097 #define NI_PFI_OUTPUT_SCXI_TRIG1 27 00098 #define NI_PFI_OUTPUT_DIO_CHANGE_DETECT_RTSI 28 00099 #define NI_PFI_OUTPUT_CDI_SAMPLE 29 00100 #define NI_PFI_OUTPUT_CDO_UPDATE 30 00101 00102 static inline unsigned int NI_PFI_OUTPUT_RTSI(unsigned rtsi_channel) { 00103 return NI_PFI_OUTPUT_RTSI0 + rtsi_channel; 00104 } 00105 00106 /* Ranges declarations */ 00107 00108 extern a4l_rngdesc_t range_ni_E_ai; 00109 extern a4l_rngdesc_t range_ni_E_ai_limited; 00110 extern a4l_rngdesc_t range_ni_E_ai_limited14; 00111 extern a4l_rngdesc_t range_ni_E_ai_bipolar4; 00112 extern a4l_rngdesc_t range_ni_E_ai_611x; 00113 extern a4l_rngdesc_t range_ni_E_ai_622x; 00114 extern a4l_rngdesc_t range_ni_E_ai_628x; 00115 extern a4l_rngdesc_t range_ni_S_ai_6143; 00116 extern a4l_rngdesc_t range_ni_E_ao_ext; 00117 00118 /* Misc functions declarations */ 00119 00120 int ni_E_interrupt(unsigned int irq, void *d); 00121 int ni_E_init(a4l_dev_t *dev); 00122 00123 00124 #endif /* !__ANALOGY_NI_MIO_H__ */