From 52527dece34f63f6a608d18dc3385f6b6a0bdbf4 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 8 Mar 2002 23:07:54 +0000 Subject: [PATCH] Added ad8842 caldac --- comedi/drivers/ni_mio_common.c | 7 +++++++ comedi/drivers/ni_stc.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 878b2a87..652b628e 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -2164,6 +2164,7 @@ static int pack_dac8800(int addr,int val,int *bitstring); static int pack_dac8043(int addr,int val,int *bitstring); static int pack_ad8522(int addr,int val,int *bitstring); static int pack_ad8804(int addr,int val,int *bitstring); +static int pack_ad8842(int addr,int val,int *bitstring); struct caldac_struct{ int n_chans; @@ -2177,6 +2178,7 @@ static struct caldac_struct caldacs[] = { [dac8043] = { 1, 12, pack_dac8043 }, [ad8522] = { 2, 12, pack_ad8522 }, [ad8804] = { 12, 8, pack_ad8804 }, + [ad8842] = { 8, 8, pack_ad8842 }, [ad8804_debug] = { 16, 8, pack_ad8804 }, }; @@ -2300,6 +2302,11 @@ static int pack_ad8804(int addr,int val,int *bitstring) return 12; } +static int pack_ad8842(int addr,int val,int *bitstring) +{ + *bitstring=((addr+1)<<8) | (val&0xff); + return 12; +} /* diff --git a/comedi/drivers/ni_stc.h b/comedi/drivers/ni_stc.h index de4d41c0..be5a304c 100644 --- a/comedi/drivers/ni_stc.h +++ b/comedi/drivers/ni_stc.h @@ -598,7 +598,8 @@ */ enum{ ai_gain_16=0, ai_gain_8, ai_gain_14, ai_gain_4, ai_gain_611x }; -enum caldac_enum { caldac_none=0, mb88341, dac8800, dac8043, ad8522, ad8804, ad8804_debug }; +enum caldac_enum { caldac_none=0, mb88341, dac8800, dac8043, ad8522, + ad8804, ad8842, ad8804_debug }; typedef struct ni_board_struct{ int device_id; -- 2.26.2