From 942c3654b580df27af84d4bf2d0c8040a9a3898b Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 26 Jan 2002 23:52:08 +0000 Subject: [PATCH] Fix AI chanlist configuration on 611x --- comedi/drivers/ni_mio_common.c | 9 +++++++-- comedi/drivers/ni_pcimio.c | 4 ++-- comedi/drivers/ni_stc.h | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 7e2aa1ab..3233f4fa 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -86,14 +86,19 @@ static short ni_modebits1[4]={ 0x3000, 0x2000, 0x1000, 0 }; static short ni_modebits2[4]={ 0x3f, 0x3f, 0x37, 0x37 }; +/* Note: this table must match the ai_gain_* definitions */ static short ni_gainlkup[][16]={ + /* ai_gain_16 */ { 0, 1, 2, 3, 4, 5, 6, 7, 0x100, 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107 }, + /* ai_gain_8 */ { 1, 2, 4, 7, 0x101, 0x102, 0x104, 0x107 }, + /* ai_gain_14 */ { 1, 2, 3, 4, 5, 6, 7, 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, - 0x107, 0,0 }, - //{ 0, 1, 4, 7, 0x100, 0x101, 0x104, 0x107 }, + 0x107 }, + /* ai_gain_4 */ { 0, 1, 4, 7 }, + /* ai_gain_611x */ { 9, 10, 11, 1, 2, 3, 4, 5, 6 }, }; diff --git a/comedi/drivers/ni_pcimio.c b/comedi/drivers/ni_pcimio.c index 0da8d382..619759e6 100644 --- a/comedi/drivers/ni_pcimio.c +++ b/comedi/drivers/ni_pcimio.c @@ -413,7 +413,7 @@ static ni_board ni_boards[]={ adbits: 12, ai_fifo_depth: 512, alwaysdither: 0, - gainlkup: ai_gain_14, /* wrong */ + gainlkup: ai_gain_611x, ai_speed: 200, aobits: 16, ao_unipolar: 0, @@ -426,7 +426,7 @@ static ni_board ni_boards[]={ adbits: 12, ai_fifo_depth: 512, alwaysdither: 0, - gainlkup: ai_gain_14, + gainlkup: ai_gain_611x, ai_speed: 200, n_aochan: 2, aobits: 12, diff --git a/comedi/drivers/ni_stc.h b/comedi/drivers/ni_stc.h index af423baa..8615711f 100644 --- a/comedi/drivers/ni_stc.h +++ b/comedi/drivers/ni_stc.h @@ -567,7 +567,7 @@ but I thought I'd put it here anyway. */ -enum{ ai_gain_16=0, ai_gain_8, ai_gain_14, ai_gain_4 }; +enum{ ai_gain_16=0, ai_gain_8, ai_gain_14, ai_gain_4, ai_gain_611x }; extern struct caldac_struct caldac_mb88341, caldac_dac8800, caldac_dac8043, -- 2.26.2