From 53acc1c3da4b577cd94d12e55f7da2a93ec51ad7 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 24 Jul 2002 00:59:53 +0000 Subject: [PATCH] Add 611x-specific changes for STC/board configuration --- comedi/drivers/ni_mio_common.c | 65 +++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 972765af..b2c98930 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -579,13 +579,13 @@ static void handle_b_interrupt(comedi_device *dev,unsigned short b_status) if(b_status==0xffff)return; if(b_status&AO_Overrun_St){ - rt_printk("ni-E: AO FIFO underrun status=0x%04x status2=0x%04x\n",b_status,win_in(AO_Status_2_Register)); + rt_printk("ni_mio_common: AO FIFO underrun status=0x%04x status2=0x%04x\n",b_status,win_in(AO_Status_2_Register)); ni_ao_reset(dev,s); s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA; } if(b_status&AO_BC_TC_St){ - rt_printk("ni-E: AO BC_TC status=0x%04x status2=0x%04x\n",b_status,win_in(AO_Status_2_Register)); + rt_printk("ni_mio_common: AO BC_TC status=0x%04x status2=0x%04x\n",b_status,win_in(AO_Status_2_Register)); s->async->events |= COMEDI_CB_EOA; } @@ -819,15 +819,26 @@ static int ni_ai_reset(comedi_device *dev,comedi_subdevice *s) /* generate FIFO interrupts on non-empty */ win_out((0<<6)|0x0000,AI_Mode_3_Register); #endif - win_out(AI_SHIFTIN_Pulse_Width | - AI_SOC_Polarity | - AI_CONVERT_Pulse_Width | - AI_LOCALMUX_CLK_Pulse_Width, AI_Personal_Register); - win_out(AI_SCAN_IN_PROG_Output_Select(3) | - AI_EXTMUX_CLK_Output_Select(0) | - AI_LOCALMUX_CLK_Output_Select(2) | - AI_SC_TC_Output_Select(3) | - AI_CONVERT_Output_Select(2),AI_Output_Control_Register); + if(!boardtype.reg_611x){ + win_out(AI_SHIFTIN_Pulse_Width | + AI_SOC_Polarity | + AI_CONVERT_Pulse_Width | + AI_LOCALMUX_CLK_Pulse_Width, AI_Personal_Register); + win_out(AI_SCAN_IN_PROG_Output_Select(3) | + AI_EXTMUX_CLK_Output_Select(0) | + AI_LOCALMUX_CLK_Output_Select(2) | + AI_SC_TC_Output_Select(3) | + AI_CONVERT_Output_Select(2),AI_Output_Control_Register); + }else{ + win_out(AI_SHIFTIN_Pulse_Width | + AI_SOC_Polarity | + AI_LOCALMUX_CLK_Pulse_Width, AI_Personal_Register); + win_out(AI_SCAN_IN_PROG_Output_Select(3) | + AI_EXTMUX_CLK_Output_Select(0) | + AI_LOCALMUX_CLK_Output_Select(2) | + AI_SC_TC_Output_Select(3) | + AI_CONVERT_Output_Select(3),AI_Output_Control_Register); + } /* this should be done in _ai_modeX() */ win_out(0x29e0,AI_START_STOP_Select_Register); @@ -891,6 +902,8 @@ static int ni_ai_insn_read(comedi_device *dev,comedi_subdevice *s,comedi_insn *i if(ni_readb(Status_611x)&0x80) break; } + rt_printk("ni_mio_common: timeout in ni_ai_insn_read (ignored)\n"); + i = 0; }else{ for(i=0;isubdevices+0); - win_out(Slow_Internal_Time_Divide_By_2 | - Slow_Internal_Timebase | - Clock_To_Board_Divide_By_2 | - Clock_To_Board | - AI_Output_Divide_By_2 | - AO_Output_Divide_By_2, Clock_and_FOUT_Register); + if(!boardtype.reg_611x){ + win_out(Slow_Internal_Time_Divide_By_2 | + Slow_Internal_Timebase | + Clock_To_Board_Divide_By_2 | + Clock_To_Board | + AI_Output_Divide_By_2 | + AO_Output_Divide_By_2, Clock_and_FOUT_Register); + }else{ + win_out(Slow_Internal_Time_Divide_By_2 | + Slow_Internal_Timebase | + Clock_To_Board_Divide_By_2 | + Clock_To_Board, Clock_and_FOUT_Register); + } /* analog output configuration */ ni_ao_reset(dev,dev->subdevices + 1); -- 2.26.2