[Tinyos-2-commits] CVS: tinyos-2.x/tos/sensorboards/mts300
AccelConfigP.nc, 1.2, 1.3 AccelP.nc, 1.2, 1.3 MagConfigP.nc,
1.1, 1.2 MagP.nc, 1.1, 1.2 MicC.nc, 1.1, 1.2 MicDeviceP.nc,
1.1, 1.2 MicP.nc, 1.1, 1.2 PhotoC.nc, 1.2, 1.3 PhotoTempP.nc,
1.2, 1.3 SensorMts300C.nc, 1.5, 1.6 SounderC.nc, 1.2,
1.3 SounderP.nc, 1.2, 1.3 TempC.nc, 1.1, 1.2 mts300.h, 1.2, 1.3
Pi Peng
pipeng at users.sourceforge.net
Tue Mar 13 20:25:11 PDT 2007
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/mica2/mts300
TestMts300C.nc, 1.5, 1.6 TestMts300P.nc, 1.5, 1.6
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/sensorboards/mts300
MagConfigP.nc, 1.2, 1.3 MicC.nc, 1.2, 1.3 MicDeviceP.nc, 1.2,
1.3 MicP.nc, 1.2, 1.3 PhotoC.nc, 1.3, 1.4 PhotoTempP.nc, 1.3,
1.4 SensorMts300C.nc, 1.6, 1.7 TempC.nc, 1.2, 1.3 mts300.h, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29233
Modified Files:
AccelConfigP.nc AccelP.nc MagConfigP.nc MagP.nc MicC.nc
MicDeviceP.nc MicP.nc PhotoC.nc PhotoTempP.nc SensorMts300C.nc
SounderC.nc SounderP.nc TempC.nc mts300.h
Log Message:
Change to follow TEP 109 .
Index: AccelConfigP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/AccelConfigP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AccelConfigP.nc 15 Feb 2007 10:28:46 -0000 1.2
--- AccelConfigP.nc 14 Mar 2007 03:25:05 -0000 1.3
***************
*** 1,44 ****
! /* $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.
! */
! /**
! * Internal component for basicsb photodiode. Arbitrates access to the photo
! * diode and automatically turns it on or off based on user requests.
! *
! * @author David Gay
! */
!
! #include "mts300.h"
!
! configuration AccelConfigP {
! provides {
! interface Init;
! interface StdControl;
!
! interface Atm128AdcConfig as ConfigX;
! interface Atm128AdcConfig as ConfigY;
! interface ResourceConfigure as ResourceX;
! interface ResourceConfigure as ResourceY;
! }
! }
! implementation {
! components AccelP, MicaBusC;
!
! Init = AccelP;
! StdControl = AccelP;
!
! ConfigX = AccelP.ConfigX;
! ConfigY = AccelP.ConfigY;
! ResourceX = AccelP.ResourceX;
! ResourceY = AccelP.ResourceY;
!
! AccelP.AccelPower -> MicaBusC.PW4;
! AccelP.AccelAdcX -> MicaBusC.Adc3;
! AccelP.AccelAdcY -> MicaBusC.Adc4;
! }
--- 1,41 ----
! /* $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.
! */
! /**
! * Internal component for basicsb photodiode. Arbitrates access to the photo
! * diode and automatically turns it on or off based on user requests.
! *
! * @author David Gay
! */
!
! configuration AccelConfigP {
! provides {
! interface Resource[uint8_t client];
! interface Atm128AdcConfig as ConfigX;
! interface Atm128AdcConfig as ConfigY;
! }
! }
! implementation {
! components AccelP, MicaBusC, new TimerMilliC() as WarmupTimer,
! new RoundRobinArbiterC(UQ_ACCEL_RESOURCE) as Arbiter,
! new SplitControlPowerManagerC() as PowerManager;
!
! Resource = Arbiter;
! ConfigX = AccelP.ConfigX;
! ConfigY = AccelP.ConfigY;
!
! PowerManager.ResourceDefaultOwner -> Arbiter;
! PowerManager.ArbiterInfo -> Arbiter;
! PowerManager.SplitControl -> AccelP;
!
! AccelP.Timer -> WarmupTimer;
! AccelP.AccelPin -> MicaBusC.PW4;
! AccelP.AccelAdcX -> MicaBusC.Adc3;
! AccelP.AccelAdcY -> MicaBusC.Adc4;
! }
Index: AccelP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/AccelP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AccelP.nc 15 Feb 2007 10:28:46 -0000 1.2
--- AccelP.nc 14 Mar 2007 03:25:05 -0000 1.3
***************
*** 1,71 ****
! #include "mts300.h"
! #include "Timer.h"
!
! module AccelP
! {
! provides interface Init;
! provides interface StdControl;
!
! provides interface Atm128AdcConfig as ConfigX;
! provides interface Atm128AdcConfig as ConfigY;
! provides interface ResourceConfigure as ResourceX;
! provides interface ResourceConfigure as ResourceY;
!
! uses interface GeneralIO as AccelPower;
! uses interface MicaBusAdc as AccelAdcX;
! uses interface MicaBusAdc as AccelAdcY;
! }
!
! implementation
! {
! command error_t Init.init()
! {
! call AccelPower.makeOutput();
! call AccelPower.clr();
!
! return SUCCESS;
! }
!
! command error_t StdControl.start()
! {
! call AccelPower.set();
! return SUCCESS;
! }
!
! command error_t StdControl.stop()
! {
! call AccelPower.clr();
! call AccelPower.makeInput();
!
! return SUCCESS;
! }
!
! async command uint8_t ConfigX.getChannel() {
! return call AccelAdcX.getChannel();
! }
!
! async command uint8_t ConfigX.getRefVoltage() {
! return ATM128_ADC_VREF_OFF;
! }
!
! async command uint8_t ConfigX.getPrescaler() {
! return ATM128_ADC_PRESCALE;
! }
!
! async command uint8_t ConfigY.getChannel() {
! return call AccelAdcY.getChannel();
! }
!
! async command uint8_t ConfigY.getRefVoltage() {
! return ATM128_ADC_VREF_OFF;
! }
!
! async command uint8_t ConfigY.getPrescaler() {
! return ATM128_ADC_PRESCALE;
! }
!
! async command void ResourceX.configure() { }
! async command void ResourceX.unconfigure() { }
! async command void ResourceY.configure() { }
! async command void ResourceY.unconfigure() {}
! }
\ No newline at end of file
--- 1,76 ----
! /* $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.
! */
! /**
! * ADXL202JE accelerometer ADC configuration and power management.
! * @author David Gay <david.e.gay at intel.com>
! */
! module AccelP
! {
! provides {
! interface SplitControl;
! interface Atm128AdcConfig as ConfigX;
! interface Atm128AdcConfig as ConfigY;
! }
! uses {
! interface Timer<TMilli>;
! interface GeneralIO as AccelPin;
! interface MicaBusAdc as AccelAdcX;
! interface MicaBusAdc as AccelAdcY;
! }
! }
! implementation
! {
! async command uint8_t ConfigX.getChannel() {
! return call AccelAdcX.getChannel();
! }
!
! async command uint8_t ConfigX.getRefVoltage() {
! return ATM128_ADC_VREF_OFF;
! }
!
! async command uint8_t ConfigX.getPrescaler() {
! return ATM128_ADC_PRESCALE;
! }
!
! async command uint8_t ConfigY.getChannel() {
! return call AccelAdcY.getChannel();
! }
!
! async command uint8_t ConfigY.getRefVoltage() {
! return ATM128_ADC_VREF_OFF;
! }
!
! async command uint8_t ConfigY.getPrescaler() {
! return ATM128_ADC_PRESCALE;
! }
!
! command error_t SplitControl.start() {
! call AccelPin.makeOutput();
! call AccelPin.set();
! /* Startup time is 16.3ms for 0.1uF capacitors,
! according to the ADXL202E data sheet */
! call Timer.startOneShot(17);
! return SUCCESS;
! }
!
! event void Timer.fired() {
! signal SplitControl.startDone(SUCCESS);
! }
!
! task void stopDone() {
! call AccelPin.clr();
! signal SplitControl.stopDone(SUCCESS);
! }
!
! command error_t SplitControl.stop() {
! post stopDone();
! return SUCCESS;
! }
! }
Index: MagConfigP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/MagConfigP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MagConfigP.nc 15 Feb 2007 10:33:37 -0000 1.1
--- MagConfigP.nc 14 Mar 2007 03:25:05 -0000 1.2
***************
*** 12,16 ****
* diode and automatically turns it on or off based on user requests.
*
! * @author David Gay
*/
--- 12,16 ----
* diode and automatically turns it on or off based on user requests.
*
! * @author Alif Chen
*/
***************
*** 20,48 ****
configuration MagConfigP {
provides {
- interface Init;
- interface StdControl;
interface Mag;
!
interface Atm128AdcConfig as ConfigX;
interface Atm128AdcConfig as ConfigY;
- interface ResourceConfigure as ResourceX;
- interface ResourceConfigure as ResourceY;
}
}
implementation {
! components MagP, MicaBusC, new Atm128I2CMasterC() as I2CPot;
- Init = MagP;
- StdControl = MagP;
Mag = MagP;
ConfigX = MagP.ConfigX;
ConfigY = MagP.ConfigY;
! ResourceX = MagP.ResourceX;
! ResourceY = MagP.ResourceY;
MagP.I2CPacket -> I2CPot;
! MagP.Resource -> I2CPot;
MagP.MagPower -> MicaBusC.PW5;
MagP.MagAdcX -> MicaBusC.Adc6;
--- 20,49 ----
configuration MagConfigP {
provides {
interface Mag;
! interface Resource[uint8_t client];
interface Atm128AdcConfig as ConfigX;
interface Atm128AdcConfig as ConfigY;
}
}
implementation {
! components MagP, MicaBusC, new Atm128I2CMasterC() as I2CPot,
! new TimerMilliC() as WarmupTimer,
! new RoundRobinArbiterC(UQ_MAG_RESOURCE) as Arbiter,
! new SplitControlPowerManagerC() as PowerManager;
Mag = MagP;
+ Resource = Arbiter;
ConfigX = MagP.ConfigX;
ConfigY = MagP.ConfigY;
!
! PowerManager.ResourceDefaultOwner -> Arbiter;
! PowerManager.ArbiterInfo -> Arbiter;
! PowerManager.SplitControl -> MagP;
MagP.I2CPacket -> I2CPot;
! MagP.I2CResource -> I2CPot;
+ MagP.Timer -> WarmupTimer;
MagP.MagPower -> MicaBusC.PW5;
MagP.MagAdcX -> MicaBusC.Adc6;
Index: MagP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/MagP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MagP.nc 15 Feb 2007 10:33:37 -0000 1.1
--- MagP.nc 14 Mar 2007 03:25:05 -0000 1.2
***************
*** 5,21 ****
module MagP
{
! provides interface Init;
! provides interface StdControl;
provides interface Mag;
provides interface Atm128AdcConfig as ConfigX;
provides interface Atm128AdcConfig as ConfigY;
- provides interface ResourceConfigure as ResourceX;
- provides interface ResourceConfigure as ResourceY;
uses interface GeneralIO as MagPower;
uses interface MicaBusAdc as MagAdcX;
uses interface MicaBusAdc as MagAdcY;
uses interface I2CPacket<TI2CBasicAddr>;
! uses interface Resource;
}
--- 5,19 ----
module MagP
{
! provides interface SplitControl;
provides interface Mag;
provides interface Atm128AdcConfig as ConfigX;
provides interface Atm128AdcConfig as ConfigY;
+ uses interface Timer<TMilli>;
uses interface GeneralIO as MagPower;
uses interface MicaBusAdc as MagAdcX;
uses interface MicaBusAdc as MagAdcY;
uses interface I2CPacket<TI2CBasicAddr>;
! uses interface Resource as I2CResource;
}
***************
*** 24,46 ****
uint8_t gainData[2];
! command error_t Init.init()
{
call MagPower.makeOutput();
! call MagPower.clr();
return SUCCESS;
! }
! command error_t StdControl.start()
! {
! call MagPower.set();
! return SUCCESS;
}
! command error_t StdControl.stop()
{
call MagPower.clr();
call MagPower.makeInput();
return SUCCESS;
}
--- 22,44 ----
uint8_t gainData[2];
! command error_t SplitControl.start()
{
call MagPower.makeOutput();
! call MagPower.set();
+ call Timer.startOneShot(100);
return SUCCESS;
! }
! event void Timer.fired() {
! signal SplitControl.startDone(SUCCESS);
}
! command error_t SplitControl.stop()
{
call MagPower.clr();
call MagPower.makeInput();
+ signal SplitControl.stopDone(SUCCESS);
return SUCCESS;
}
***************
*** 50,54 ****
gainData[0] = 1; // pot subaddr
gainData[1] = val; // value to write
! return call Resource.request();
}
command error_t Mag.gainAdjustY(uint8_t val)
--- 48,52 ----
gainData[0] = 1; // pot subaddr
gainData[1] = val; // value to write
! return call I2CResource.request();
}
command error_t Mag.gainAdjustY(uint8_t val)
***************
*** 56,60 ****
gainData[0] = 0; // pot subaddr
gainData[1] = val; // value to write
! return call Resource.request();
}
/**
--- 54,58 ----
gainData[0] = 0; // pot subaddr
gainData[1] = val; // value to write
! return call I2CResource.request();
}
/**
***************
*** 62,66 ****
*
*/
! event void Resource.granted()
{
if ( call I2CPacket.write(0x3,TOS_MAG_POT_ADDR, 2, gainData) == SUCCESS)
--- 60,64 ----
*
*/
! event void I2CResource.granted()
{
if ( call I2CPacket.write(0x3,TOS_MAG_POT_ADDR, 2, gainData) == SUCCESS)
***************
*** 80,84 ****
async event void I2CPacket.writeDone(error_t error, uint16_t addr, uint8_t length, uint8_t* data)
{
! call Resource.release();
if (gainData[0] ==1)
{
--- 78,82 ----
async event void I2CPacket.writeDone(error_t error, uint16_t addr, uint8_t length, uint8_t* data)
{
! call I2CResource.release();
if (gainData[0] ==1)
{
***************
*** 116,122 ****
}
! async command void ResourceX.configure() { }
! async command void ResourceX.unconfigure() { }
! async command void ResourceY.configure() { }
! async command void ResourceY.unconfigure() {}
}
\ No newline at end of file
--- 114,124 ----
}
! default event error_t Mag.gainAdjustXDone(bool result)
! {
! return result;
! }
! default event error_t Mag.gainAdjustYDone(bool result)
! {
! return result;
! }
}
\ No newline at end of file
Index: MicC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/MicC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MicC.nc 15 Feb 2007 10:33:38 -0000 1.1
--- MicC.nc 14 Mar 2007 03:25:05 -0000 1.2
***************
*** 32,50 ****
generic configuration MicC() {
- provides interface Init;
- provides interface StdControl;
provides interface Read<uint16_t>;
! provides interface Mic;
! provides interface MicInterrupt;
}
implementation {
! components new AdcReadClientC(), MicDeviceP;
! Init = MicDeviceP;
! StdControl = MicDeviceP;
! Read = AdcReadClientC;
! Mic = MicDeviceP;
! MicInterrupt = MicDeviceP;
! AdcReadClientC.Atm128AdcConfig -> MicDeviceP;
! AdcReadClientC.ResourceConfigure -> MicDeviceP;
}
--- 32,47 ----
generic configuration MicC() {
provides interface Read<uint16_t>;
! provides interface MicSetting;
}
implementation {
! enum {
! ID = unique(UQ_MIC_RESOURCE)
! };
! components MicReadP, MicDeviceP, new AdcReadClientC();
! Read = MicReadP.Read[ID];
! MicReadP.ActualRead[ID] -> AdcReadClientC;
! AdcReadClientC.Atm128AdcConfig -> MicDeviceP.Atm128AdcConfig;
! MicSetting = MicDeviceP;
}
Index: MicDeviceP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/MicDeviceP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MicDeviceP.nc 15 Feb 2007 10:33:38 -0000 1.1
--- MicDeviceP.nc 14 Mar 2007 03:25:05 -0000 1.2
***************
*** 32,61 ****
configuration MicDeviceP {
provides {
! interface Init;
! interface StdControl;
! interface Mic;
! interface MicInterrupt;
! interface ResourceConfigure;
interface Atm128AdcConfig;
}
}
implementation {
components MicP, MicaBusC, HplAtm128GeneralIOC as Pins,
! HplAtm128InterruptC as IntPins, LedsC, NoLedsC,
! new Atm128I2CMasterC() as I2CPot;
! Init = MicP;
! StdControl = MicP;
! ResourceConfigure = MicP;
Atm128AdcConfig = MicP;
! Mic = MicP;
! MicInterrupt = MicP;
MicP.MicPower -> MicaBusC.PW3;
MicP.MicMuxSel -> MicaBusC.PW6;
MicP.MicAdc -> MicaBusC.Adc2;
MicP.I2CPacket -> I2CPot;
! MicP.Resource -> I2CPot;
MicP.AlertInterrupt -> IntPins.Int7;
- MicP.DebugLeds -> NoLedsC;
}
--- 32,62 ----
configuration MicDeviceP {
provides {
! interface Resource[uint8_t client];
interface Atm128AdcConfig;
+ interface MicSetting;
}
}
implementation {
components MicP, MicaBusC, HplAtm128GeneralIOC as Pins,
! HplAtm128InterruptC as IntPins,
! new Atm128I2CMasterC() as I2CPot,
! new TimerMilliC() as WarmupTimer,
! new RoundRobinArbiterC(UQ_MIC_RESOURCE) as Arbiter,
! new SplitControlPowerManagerC() as PowerManager;
! Resource = Arbiter;
Atm128AdcConfig = MicP;
! MicSetting = MicP;
!
! PowerManager.ResourceDefaultOwner -> Arbiter;
! PowerManager.ArbiterInfo -> Arbiter;
! PowerManager.SplitControl -> MicP;
+ MicP.Timer -> WarmupTimer;
MicP.MicPower -> MicaBusC.PW3;
MicP.MicMuxSel -> MicaBusC.PW6;
MicP.MicAdc -> MicaBusC.Adc2;
MicP.I2CPacket -> I2CPot;
! MicP.I2CResource -> I2CPot;
MicP.AlertInterrupt -> IntPins.Int7;
}
Index: MicP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/MicP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MicP.nc 15 Feb 2007 10:33:38 -0000 1.1
--- MicP.nc 14 Mar 2007 03:25:05 -0000 1.2
***************
*** 33,49 ****
module MicP
{
! provides interface Init;
! provides interface StdControl;
! provides interface Mic;
! provides interface MicInterrupt;
! provides interface ResourceConfigure as MicResourceConfigure;
provides interface Atm128AdcConfig as MicAtm128AdcConfig;
! uses interface Leds as DebugLeds;
uses interface GeneralIO as MicPower;
uses interface GeneralIO as MicMuxSel;
uses interface MicaBusAdc as MicAdc;
uses interface I2CPacket<TI2CBasicAddr>;
! uses interface Resource;
uses interface HplAtm128Interrupt as AlertInterrupt;
}
--- 33,46 ----
module MicP
{
! provides interface SplitControl;
! provides interface MicSetting;
provides interface Atm128AdcConfig as MicAtm128AdcConfig;
! uses interface Timer<TMilli>;
uses interface GeneralIO as MicPower;
uses interface GeneralIO as MicMuxSel;
uses interface MicaBusAdc as MicAdc;
uses interface I2CPacket<TI2CBasicAddr>;
! uses interface Resource as I2CResource;
uses interface HplAtm128Interrupt as AlertInterrupt;
}
***************
*** 52,73 ****
uint8_t gainData[2];
! command error_t Init.init()
{
call MicPower.makeOutput();
! call MicPower.clr();
call MicMuxSel.makeOutput();
call MicMuxSel.clr();
!
! call AlertInterrupt.disable();
! return SUCCESS;
! }
! command error_t StdControl.start()
! {
! call MicPower.set();
return SUCCESS;
}
! command error_t StdControl.stop()
{
call AlertInterrupt.disable();
--- 49,73 ----
uint8_t gainData[2];
! command error_t SplitControl.start()
{
+ call AlertInterrupt.disable();
call MicPower.makeOutput();
! call MicPower.set();
call MicMuxSel.makeOutput();
call MicMuxSel.clr();
!
! call MicSetting.muxSel(1); // Set the mux so that raw microhpone output is selected
! call MicSetting.gainAdjust(64); // Set the gain of the microphone.
! call Timer.startOneShot(1200);
! // signal SplitControl.startDone(SUCCESS);
return SUCCESS;
}
+
+ event void Timer.fired() {
+ signal SplitControl.startDone(SUCCESS);
+ }
! command error_t SplitControl.stop()
{
call AlertInterrupt.disable();
***************
*** 75,78 ****
--- 75,79 ----
call MicPower.makeInput();
+ signal SplitControl.stopDone(SUCCESS);
return SUCCESS;
}
***************
*** 82,91 ****
*
*/
! event void Resource.granted()
{
- call DebugLeds.led0Off();
if ( call I2CPacket.write(0x3,TOS_MIC_POT_ADDR, 2, gainData) == SUCCESS)
{
! call DebugLeds.led1On();
};
}
--- 83,91 ----
*
*/
! event void I2CResource.granted()
{
if ( call I2CPacket.write(0x3,TOS_MIC_POT_ADDR, 2, gainData) == SUCCESS)
{
! return;
};
}
***************
*** 95,99 ****
*
*/
! command error_t Mic.muxSel(uint8_t sel)
{
if (sel == 0)
--- 95,99 ----
*
*/
! command error_t MicSetting.muxSel(uint8_t sel)
{
if (sel == 0)
***************
*** 110,122 ****
}
! command error_t Mic.gainAdjust(uint8_t val)
{
- call DebugLeds.led0On();
gainData[0] = 0; // pot subaddr
gainData[1] = val; // value to write
! return call Resource.request();
}
! command uint8_t Mic.readToneDetector()
{
bool bVal = call AlertInterrupt.getValue();
--- 110,121 ----
}
! command error_t MicSetting.gainAdjust(uint8_t val)
{
gainData[0] = 0; // pot subaddr
gainData[1] = val; // value to write
! return call I2CResource.request();
}
! command uint8_t MicSetting.readToneDetector()
{
bool bVal = call AlertInterrupt.getValue();
***************
*** 128,132 ****
*
*/
! async command error_t MicInterrupt.enable()
{
call AlertInterrupt.enable();
--- 127,131 ----
*
*/
! async command error_t MicSetting.enable()
{
call AlertInterrupt.enable();
***************
*** 134,138 ****
}
! async command error_t MicInterrupt.disable()
{
call AlertInterrupt.disable();
--- 133,137 ----
}
! async command error_t MicSetting.disable()
{
call AlertInterrupt.disable();
***************
*** 140,144 ****
}
! default async event error_t MicInterrupt.toneDetected()
{
return SUCCESS;
--- 139,143 ----
}
! default async event error_t MicSetting.toneDetected()
{
return SUCCESS;
***************
*** 147,151 ****
async event void AlertInterrupt.fired()
{
! signal MicInterrupt.toneDetected();
}
--- 146,150 ----
async event void AlertInterrupt.fired()
{
! signal MicSetting.toneDetected();
}
***************
*** 170,182 ****
}
- async command void MicResourceConfigure.configure()
- {
- call MicPower.set();
- }
-
- async command void MicResourceConfigure.unconfigure()
- {
- // call MicPower.clr();
- }
/**
* I2CPot2
--- 169,172 ----
***************
*** 190,195 ****
async event void I2CPacket.writeDone(error_t error, uint16_t addr, uint8_t length, uint8_t* data)
{
! call DebugLeds.led1Off();
! call Resource.release();
return ;
}
--- 180,184 ----
async event void I2CPacket.writeDone(error_t error, uint16_t addr, uint8_t length, uint8_t* data)
{
! call I2CResource.release();
return ;
}
Index: PhotoC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/PhotoC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PhotoC.nc 15 Feb 2007 10:28:46 -0000 1.2
--- PhotoC.nc 14 Mar 2007 03:25:05 -0000 1.3
***************
*** 1,49 ****
! /**
! * Copyright (c) 2005-2006 Crossbow Technology, Inc.
! * 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 (updated) modification history and the author appear in
! * all copies of this source code.
! *
! * Permission is also granted to distribute this software under the
! * standard BSD license as contained in the TinyOS distribution.
*
! * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
! * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
! * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA,
! * OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
! * THE POSSIBILITY OF SUCH DAMAGE.
*/
! /*
! * @author Hu Siquan <husq at xbow.com>
! *
! * $Id$
*/
#include "mts300.h"
! generic configuration PhotoC()
! {
provides interface Read<uint16_t>;
- provides interface StdControl;
- provides interface Init;
}
! implementation
! {
! components new AdcReadClientC(), PhotoTempDeviceP;
!
! Init = PhotoTempDeviceP;
! StdControl = PhotoTempDeviceP;
! Read = AdcReadClientC;
! AdcReadClientC.Atm128AdcConfig -> PhotoTempDeviceP.PhotoAtm128AdcConfig;
! AdcReadClientC.ResourceConfigure -> PhotoTempDeviceP.PhotoResourceConfigure;
}
--- 1,25 ----
! /* $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.
*/
! /**
! * Photodiode of the mts300 sensor board.
! *
! * @author David Gay
*/
#include "mts300.h"
! generic configuration PhotoC() {
provides interface Read<uint16_t>;
}
! implementation {
! components ArbitratedPhotoDeviceP;
! Read = ArbitratedPhotoDeviceP.Read[unique(UQ_PHOTO_RESOURCE)];
}
Index: PhotoTempP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/PhotoTempP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PhotoTempP.nc 15 Feb 2007 10:28:46 -0000 1.2
--- PhotoTempP.nc 14 Mar 2007 03:25:05 -0000 1.3
***************
*** 1,194 ****
! /**
! * Copyright (c) 2005-2006 Crossbow Technology, Inc.
! * 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 (updated) modification history and the author appear in
! * all copies of this source code.
! *
! * Permission is also granted to distribute this software under the
! * standard BSD license as contained in the TinyOS distribution.
! *
! * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
! * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
! * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA,
! * OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
! * THE POSSIBILITY OF SUCH DAMAGE.
! *
! * @author Martin Turon <mturon at xbow.com>
! * @author Hu Siquan <husq at xbow.com>
! *
! * $Id$
! */
!
! #include "Timer.h"
!
! module PhotoTempP
! {
! provides
! {
! interface Init; //!< Standard Initialization
! interface StdControl; //!< Start/Stop for Temp Sensor's Power Management
! interface ResourceConfigure as TempResourceConfigure;
! interface ResourceConfigure as PhotoResourceConfigure;
! interface Atm128AdcConfig as TempAtm128AdcConfig;
! interface Atm128AdcConfig as PhotoAtm128AdcConfig;
! }
! uses
! {
! interface GeneralIO as TempPower;
! interface GeneralIO as LightPower;
! interface MicaBusAdc as SensorAdc;
! interface Leds as DebugLeds;
! }
! }
! implementation
! {
! /*
! enum
! {
! STATE_IDLE = 0,
! STATE_LIGHT_WARMING, //!< Powering on sensor
! STATE_LIGHT_READY, //!< Power up of sensor complete
! STATE_LIGHT_SAMPLING, //!< Sampling sensor
! STATE_TEMP_WARMING, //!< Powering on sensor
! STATE_TEMP_READY, //!< Power up of sensor complete
! STATE_TEMP_SAMPLING, //!< Sampling sensor
! };
!
! /// Yes, this could be a simple uint8_t. There used to be more bits here,
! /// but they were optimized out and removed.
! union
! {
! uint8_t flat;
! struct
! {
! uint8_t state : 4; //!< sensorboard state
! } bits;
! } g_flags;
! */
!
! void inline TOSH_uwait(int u_sec)
! {
! /* In most cases (constant arg), the test is elided at compile-time */
! if (u_sec)
! /* loop takes 4 cycles, aka 1us */
! asm volatile (
! "1: sbiw %0,1\n"
! " brne 1b" : "+w" (u_sec));
! }
! /**
! * Initialize this component. Initialization should not assume that
! * any component is running: init() cannot call any commands besides
! * those that initialize other components.
! *
! */
! command error_t Init.init()
! {
! return SUCCESS;
! }
!
!
! /**
! * Start the component and its subcomponents.
! *
! * @return SUCCESS if the component was successfully started.
! */
! command error_t StdControl.start()
! {
! call TempPower.makeOutput();
! call TempPower.clr();
! call LightPower.makeOutput();
! call LightPower.clr();
!
! return SUCCESS;
! }
!
! /**
! * Stop the component and pertinent subcomponents (not all
! * subcomponents may be turned off due to wakeup timers, etc.).
! *
! * @return SUCCESS if the component was successfully stopped.
! */
! command error_t StdControl.stop()
! {
! call TempPower.clr();
! call LightPower.clr();
! call TempPower.makeInput();
! call LightPower.makeInput();
!
! return SUCCESS;
! }
!
! async command uint8_t TempAtm128AdcConfig.getChannel()
! {
! return call SensorAdc.getChannel();
! }
!
! async command uint8_t TempAtm128AdcConfig.getRefVoltage()
! {
! return ATM128_ADC_VREF_OFF;
! }
!
! async command uint8_t TempAtm128AdcConfig.getPrescaler()
! {
! return ATM128_ADC_PRESCALE;
! }
!
! async command uint8_t PhotoAtm128AdcConfig.getChannel()
! {
! return call SensorAdc.getChannel();
! }
!
! async command uint8_t PhotoAtm128AdcConfig.getRefVoltage()
! {
! return ATM128_ADC_VREF_OFF;
! }
!
! async command uint8_t PhotoAtm128AdcConfig.getPrescaler()
! {
! return ATM128_ADC_PRESCALE;
! }
!
! async command void TempResourceConfigure.configure()
! {
! call DebugLeds.led0On();
! call LightPower.clr();
! call LightPower.makeInput();
! call TempPower.makeOutput();
! call TempPower.set();
! TOSH_uwait(1000);
! }
!
! async command void TempResourceConfigure.unconfigure()
! {
! call DebugLeds.led0Off();
! call TempPower.clr();
! call TempPower.makeInput();
! }
!
! /** Turns on the light sensor and turns the thermistor off. */
! async command void PhotoResourceConfigure.configure()
! {
! call DebugLeds.led1On();
! call TempPower.clr();
! call TempPower.makeInput();
! call LightPower.makeOutput();
! call LightPower.set();
! TOSH_uwait(1000);
! }
!
! async command void PhotoResourceConfigure.unconfigure()
! {
! call DebugLeds.led1Off();
! call LightPower.clr();
! call LightPower.makeInput();
! }
! }
--- 1,32 ----
! /* $Id$
! * Copyright (c) 2007 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.
! */
! /**
! * MTS300 photo and temp sensor ADC configuration.
! * @author David Gay <david.e.gay at intel.com>
! */
! module PhotoTempP
! {
! provides interface Atm128AdcConfig;
! uses interface MicaBusAdc as PhotoTempAdc;
! }
! implementation
! {
! async command uint8_t Atm128AdcConfig.getChannel() {
! return call PhotoTempAdc.getChannel();
! }
!
! async command uint8_t Atm128AdcConfig.getRefVoltage() {
! return ATM128_ADC_VREF_OFF;
! }
!
! async command uint8_t Atm128AdcConfig.getPrescaler() {
! return ATM128_ADC_PRESCALE;
! }
! }
Index: SensorMts300C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/SensorMts300C.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SensorMts300C.nc 15 Feb 2007 10:28:46 -0000 1.5
--- SensorMts300C.nc 14 Mar 2007 03:25:05 -0000 1.6
***************
*** 34,44 ****
provides
{
! interface Init; //!< Standard Initialization
! interface StdControl; //!< Start/Stop for Power Management
interface Read<uint16_t> as Vref; //!< voltage
interface Read<uint16_t> as Temp; //!< Thermister
interface Read<uint16_t> as Light; //!< Photo sensor
interface Read<uint16_t> as Microphone; //!< Mic sensor
! interface Read<uint16_t> as AccelX; //!< Accelerometer sensor
interface Read<uint16_t> as AccelY; //!< Accelerometer sensor
interface Read<uint16_t> as MagX; //!< magnetometer sensor
--- 34,43 ----
provides
{
! interface Mts300Sounder as Sounder; //!< sounder
interface Read<uint16_t> as Vref; //!< voltage
interface Read<uint16_t> as Temp; //!< Thermister
interface Read<uint16_t> as Light; //!< Photo sensor
interface Read<uint16_t> as Microphone; //!< Mic sensor
! interface Read<uint16_t> as AccelX; //!< Accelerometer sensor
interface Read<uint16_t> as AccelY; //!< Accelerometer sensor
interface Read<uint16_t> as MagX; //!< magnetometer sensor
***************
*** 48,94 ****
implementation
{
! components SensorMts300P, HplAtm128GeneralIOC as IO,
new VoltageC(),
new PhotoC(),
new TempC(),
new MicC(),
! new MagC(),
! new AccelC(),
! new TimerMilliC() as WarmUpTimer;
!
! Init = SensorMts300P.Init;
! Init = PhotoC.Init;
! Init = MicC.Init;
! StdControl = SensorMts300P.StdControl;
! Vref = SensorMts300P.Vref;
! Temp = SensorMts300P.Temp;
! Light = SensorMts300P.Light;
! Microphone = SensorMts300P.Microphone;
! AccelX = SensorMts300P.AccelX;
! AccelY = SensorMts300P.AccelY;
! MagX = SensorMts300P.MagX;
! MagY = SensorMts300P.MagY;
!
! SensorMts300P.WarmUpTimer -> WarmUpTimer;
!
! SensorMts300P.VrefRead -> VoltageC.Read;
! SensorMts300P.PhotoControl -> PhotoC.StdControl;
! SensorMts300P.TempRead -> TempC.Read;
! SensorMts300P.LightRead -> PhotoC.Read;
! SensorMts300P.LightPower -> IO.PortE5;
! SensorMts300P.TempPower -> IO.PortE6;
!
! SensorMts300P.MicControl -> MicC.StdControl;
! SensorMts300P.Mic -> MicC.Mic;
! SensorMts300P.MicRead -> MicC.Read;
!
! SensorMts300P.MagControl -> MagC.StdControl;
! SensorMts300P.Mag -> MagC.Mag;
! SensorMts300P.MagXRead -> MagC.MagX;
! SensorMts300P.MagYRead -> MagC.MagY;
! SensorMts300P.AccelControl -> AccelC.StdControl;
! SensorMts300P.AccelXRead -> AccelC.AccelX;
! SensorMts300P.AccelYRead -> AccelC.AccelY;
!
}
--- 47,68 ----
implementation
{
! components SounderC,
new VoltageC(),
+ new AccelXC(),
+ new AccelYC(),
new PhotoC(),
new TempC(),
new MicC(),
! new MagXC(),
! new MagYC();
! Sounder = SounderC;
! Vref = VoltageC;
! Temp = TempC;
! Light = PhotoC;
! Microphone = MicC;
! AccelX = AccelXC;
! AccelY = AccelYC;
! MagX = MagXC;
! MagY = MagYC;
}
Index: SounderC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/SounderC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SounderC.nc 15 Feb 2007 10:28:46 -0000 1.2
--- SounderC.nc 14 Mar 2007 03:25:05 -0000 1.3
***************
*** 1,45 ****
- /**
- * Copyright (c) 2005-2006 Crossbow Technology, Inc.
- * 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 (updated) modification history and the author appear in
- * all copies of this source code.
- *
- * Permission is also granted to distribute this software under the
- * standard BSD license as contained in the TinyOS distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA,
- * OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
- /*
- * @author Hu Siquan <husq at xbow.com>
- *
- * $Id$
- */
-
- #include "mts300.h"
-
configuration SounderC
{
! provides interface Init;
! provides interface StdControl;
}
implementation
{
! components SounderP, MicaBusC;
! Init = SounderP;
! StdControl = SounderP;
SounderP.SounderPin -> MicaBusC.PW2;
}
--- 1,12 ----
configuration SounderC
{
! provides interface Mts300Sounder;
}
implementation
{
! components SounderP, new TimerMilliC(), MicaBusC;
! Mts300Sounder = SounderP;
! SounderP.Timer -> TimerMilliC;
SounderP.SounderPin -> MicaBusC.PW2;
}
Index: SounderP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/SounderP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SounderP.nc 15 Feb 2007 10:28:46 -0000 1.2
--- SounderP.nc 14 Mar 2007 03:25:05 -0000 1.3
***************
*** 1,65 ****
! /**
! * Copyright (c) 2005-2006 Crossbow Technology, Inc.
! * 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 (updated) modification history and the author appear in
! * all copies of this source code.
! *
! * Permission is also granted to distribute this software under the
! * standard BSD license as contained in the TinyOS distribution.
! *
! * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
! * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
! * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA,
! * OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
! * THE POSSIBILITY OF SUCH DAMAGE.
! *
! * @author Hu Siquan <husq at xbow.com>
! *
! * $Id$
! */
!
! #include "mts300.h"
!
! module SounderP
{
! provides interface Init;
! provides interface StdControl;
! uses interface GeneralIO as SounderPin;
}
!
! implementation
{
! command error_t Init.init()
! {
! #if SOUNDER
! call SounderPin.makeOutput();
! call SounderPin.clr();
! #endif
! return SUCCESS;
! }
! command error_t StdControl.start()
! {
! #if SOUNDER
call SounderPin.set();
- #endif
- return SUCCESS;
}
! command error_t StdControl.stop()
! {
! #if SOUNDER
call SounderPin.clr();
- #endif
- return SUCCESS;
}
}
--- 1,31 ----
! module SounderP
{
! provides interface Mts300Sounder;
! uses {
! interface Timer<TMilli>;
! interface GeneralIO as SounderPin;
! }
}
! implementation
{
! command void Mts300Sounder.beep(uint16_t length) {
! if (call Timer.isRunning())
! {
! uint32_t remaining = call Timer.getdt(),
! elapsed = call Timer.getNow() - call Timer.gett0();
! /* If more time left than we are requesting, just exit */
! if (remaining > elapsed && (remaining - elapsed) > length)
! return;
!
! /* Override timer with new duration */
! }
! call Timer.startOneShot(length);
! call SounderPin.makeOutput();
call SounderPin.set();
}
! event void Timer.fired() {
call SounderPin.clr();
}
}
Index: TempC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/TempC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TempC.nc 15 Feb 2007 10:33:38 -0000 1.1
--- TempC.nc 14 Mar 2007 03:25:05 -0000 1.2
***************
*** 1,42 ****
! /**
! * Copyright (c) 2005-2006 Crossbow Technology, Inc.
! * 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 (updated) modification history and the author appear in
! * all copies of this source code.
! *
! * Permission is also granted to distribute this software under the
! * standard BSD license as contained in the TinyOS distribution.
! *
! * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
! * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
! * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA,
! * OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
! * THE POSSIBILITY OF SUCH DAMAGE.
! */
! /*
! * @author Hu Siquan <husq at xbow.com>
! *
! * $Id$
! */
!
! #include "mts300.h"
!
! generic configuration TempC() {
! provides interface Read<uint16_t>;
! }
! implementation {
! components new AdcReadClientC(), PhotoTempDeviceP;
!
! Read = AdcReadClientC;
! AdcReadClientC.Atm128AdcConfig -> PhotoTempDeviceP.TempAtm128AdcConfig;
! AdcReadClientC.ResourceConfigure -> PhotoTempDeviceP.TempResourceConfigure;
! }
--- 1,25 ----
! /* $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.
! */
! /**
! * Photodiode of the mts300 sensor board.
! *
! * @author David Gay
! */
!
! #include "mts300.h"
!
! generic configuration TempC() {
! provides interface Read<uint16_t>;
! }
! implementation {
! components ArbitratedTempDeviceP;
!
! Read = ArbitratedTempDeviceP.Read[unique(UQ_TEMP_RESOURCE)];
! }
Index: mts300.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/sensorboards/mts300/mts300.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mts300.h 15 Feb 2007 10:28:46 -0000 1.2
--- mts300.h 14 Mar 2007 03:25:06 -0000 1.3
***************
*** 36,41 ****
#endif
! #define MTS3X0_PHOTO_TEMP "mts300.photo.temp"
! #define MTS3X0_MAG_RESOURCE "mts300.mag"
enum
--- 36,45 ----
#endif
! #define UQ_ACCEL_RESOURCE "mts300.accel"
! #define UQ_PHOTO_RESOURCE "mts300.photo"
! #define UQ_TEMP_RESOURCE "mts300.temp"
! #define UQ_PHOTOTEMP_RESOURCE "mts300.phototemp"
! #define UQ_MIC_RESOURCE "mts300.microphone"
! #define UQ_MAG_RESOURCE "mts300.mag"
enum
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/mica2/mts300
TestMts300C.nc, 1.5, 1.6 TestMts300P.nc, 1.5, 1.6
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/sensorboards/mts300
MagConfigP.nc, 1.2, 1.3 MicC.nc, 1.2, 1.3 MicDeviceP.nc, 1.2,
1.3 MicP.nc, 1.2, 1.3 PhotoC.nc, 1.3, 1.4 PhotoTempP.nc, 1.3,
1.4 SensorMts300C.nc, 1.6, 1.7 TempC.nc, 1.2, 1.3 mts300.h, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list