From e226c5243f89709f8a95e6ec6c378c85973ef387 Mon Sep 17 00:00:00 2001 From: pipeng Date: Wed, 14 Mar 2007 05:38:37 +0000 Subject: [PATCH] Change to follow TEP 109 . --- tos/sensorboards/mts300/MagReadP.nc | 62 ++++++++++++++++++++++ tos/sensorboards/mts300/MagReadStreamP.nc | 63 +++++++++++++++++++++++ tos/sensorboards/mts300/MagXC.nc | 34 ++++++++++++ tos/sensorboards/mts300/MagXStreamC.nc | 32 ++++++++++++ tos/sensorboards/mts300/MagYC.nc | 34 ++++++++++++ tos/sensorboards/mts300/MagYStreamC.nc | 31 +++++++++++ 6 files changed, 256 insertions(+) create mode 100644 tos/sensorboards/mts300/MagReadP.nc create mode 100644 tos/sensorboards/mts300/MagReadStreamP.nc create mode 100644 tos/sensorboards/mts300/MagXC.nc create mode 100644 tos/sensorboards/mts300/MagXStreamC.nc create mode 100644 tos/sensorboards/mts300/MagYC.nc create mode 100644 tos/sensorboards/mts300/MagYStreamC.nc diff --git a/tos/sensorboards/mts300/MagReadP.nc b/tos/sensorboards/mts300/MagReadP.nc new file mode 100644 index 00000000..fd9fed71 --- /dev/null +++ b/tos/sensorboards/mts300/MagReadP.nc @@ -0,0 +1,62 @@ +// $Id$ + +/* tab:4 + * "Copyright (c) 2000-2003 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice, the following + * two paragraphs and the author appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." + * + * Copyright (c) 2002-2003 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +#include "mts300.h" + +configuration MagReadP +{ + provides + { + interface Mag; + interface Read as MagX[uint8_t client]; + interface Read as MagY[uint8_t client]; + } + uses + { + interface Read as ActualX[uint8_t client]; + interface Read as ActualY[uint8_t client]; + } +} +implementation +{ + components MagConfigP, + new ArbitratedReadC(uint16_t) as AdcX, + new ArbitratedReadC(uint16_t) as AdcY; + + Mag = MagConfigP; + + MagX = AdcX; + AdcX.Resource -> MagConfigP; + AdcX.Service = ActualX; + + MagY = AdcY; + AdcY.Resource -> MagConfigP; + AdcY.Service = ActualY; +} diff --git a/tos/sensorboards/mts300/MagReadStreamP.nc b/tos/sensorboards/mts300/MagReadStreamP.nc new file mode 100644 index 00000000..facb83aa --- /dev/null +++ b/tos/sensorboards/mts300/MagReadStreamP.nc @@ -0,0 +1,63 @@ +// $Id$ + +/* tab:4 + * "Copyright (c) 2000-2003 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice, the following + * two paragraphs and the author appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." + * + * Copyright (c) 2002-2003 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +#include "mts300.h" + +configuration MagReadStreamP +{ + provides { + interface Mag; + interface ReadStream as ReadStreamX[uint8_t client]; + interface ReadStream as ReadStreamY[uint8_t client]; + } + uses { + interface ReadStream as ActualX[uint8_t client]; + interface ReadStream as ActualY[uint8_t client]; + } +} +implementation +{ + enum { + NMAG_CLIENTS = uniqueCount(UQ_MAG_RESOURCE) + }; + components MagConfigP, + new ArbitratedReadStreamC(NMAG_CLIENTS, uint16_t) as MultiplexX, + new ArbitratedReadStreamC(NMAG_CLIENTS, uint16_t) as MultiplexY; + + Mag = MagConfigP; + + ReadStreamX = MultiplexX; + MultiplexX.Resource -> MagConfigP; + MultiplexX.Service = ActualX; + + ReadStreamY = MultiplexY; + MultiplexY.Resource -> MagConfigP; + MultiplexY.Service = ActualY; +} \ No newline at end of file diff --git a/tos/sensorboards/mts300/MagXC.nc b/tos/sensorboards/mts300/MagXC.nc new file mode 100644 index 00000000..38fd03bd --- /dev/null +++ b/tos/sensorboards/mts300/MagXC.nc @@ -0,0 +1,34 @@ +/* $Id$ + * Copyright (c) 2006 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +/** + * @author Alif Chen + */ + +#include "mts300.h" + +generic configuration MagXC() +{ + provides interface Mag; + provides interface Read; +} +implementation { + enum { + ID = unique(UQ_MAG_RESOURCE) + }; + + components MagReadP,MagConfigP, new AdcReadClientC() as AdcX; + + Mag = MagReadP; + + Read = MagReadP.MagX[ID]; + MagReadP.ActualX[ID] -> AdcX; + AdcX.Atm128AdcConfig -> MagConfigP.ConfigX; +} + diff --git a/tos/sensorboards/mts300/MagXStreamC.nc b/tos/sensorboards/mts300/MagXStreamC.nc new file mode 100644 index 00000000..37928ea5 --- /dev/null +++ b/tos/sensorboards/mts300/MagXStreamC.nc @@ -0,0 +1,32 @@ +/* $Id$ + * Copyright (c) 2006 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +/** + * + * @author Alif Chen + */ + +#include "mts300.h" + +generic configuration MagXStreamC() { + provides interface ReadStream; + provides interface Mag; +} +implementation { + enum { + ID = unique(UQ_ACCEL_RESOURCE) + }; + components MagReadStreamP, MagConfigP, new AdcReadStreamClientC(); + + Mag = MagReadStreamP; + + ReadStream = MagReadStreamP.ReadStreamX[ID]; + MagReadStreamP.ActualX[ID] -> AdcReadStreamClientC; + AdcReadStreamClientC.Atm128AdcConfig -> MagConfigP.ConfigX; +} diff --git a/tos/sensorboards/mts300/MagYC.nc b/tos/sensorboards/mts300/MagYC.nc new file mode 100644 index 00000000..72c8bd46 --- /dev/null +++ b/tos/sensorboards/mts300/MagYC.nc @@ -0,0 +1,34 @@ +/* $Id$ + * Copyright (c) 2006 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +/** + * @author Alif Chen + */ + +#include "mts300.h" + +generic configuration MagYC() +{ + provides interface Mag; + provides interface Read; +} +implementation { + enum { + ID = unique(UQ_MAG_RESOURCE) + }; + + components MagReadP,MagConfigP, new AdcReadClientC() as AdcY; + + Mag = MagReadP; + + Read = MagReadP.MagY[ID]; + MagReadP.ActualY[ID] -> AdcY; + AdcY.Atm128AdcConfig -> MagConfigP.ConfigY; +} + diff --git a/tos/sensorboards/mts300/MagYStreamC.nc b/tos/sensorboards/mts300/MagYStreamC.nc new file mode 100644 index 00000000..adfd842f --- /dev/null +++ b/tos/sensorboards/mts300/MagYStreamC.nc @@ -0,0 +1,31 @@ +/* $Id$ + * Copyright (c) 2006 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +/** + * @author Alif Chen + */ + +#include "mts300.h" + +generic configuration MagYStreamC() { + provides interface ReadStream; + provides interface Mag; +} +implementation { + enum { + ID = unique(UQ_ACCEL_RESOURCE) + }; + components MagReadStreamP, MagConfigP, new AdcReadStreamClientC(); + + Mag = MagReadStreamP; + + ReadStream = MagReadStreamP.ReadStreamY[ID]; + MagReadStreamP.ActualY[ID] -> AdcReadStreamClientC; + AdcReadStreamClientC.Atm128AdcConfig -> MagConfigP.ConfigY; +} -- 2.39.2