From 48a594e252a1fc3d085918dea4cc10cc6caa5755 Mon Sep 17 00:00:00 2001 From: kristinwright Date: Fri, 4 Nov 2005 18:20:16 +0000 Subject: [PATCH] Initial revision --- .../tests/eyesIFX/Radio/TestBasicMac/Makefile | 4 + .../Radio/TestBasicMac/TestBasicMacC.nc | 79 +++++++ .../Radio/TestBasicMac/TestBasicMacM.nc | 83 ++++++++ .../Radio/TestHAL/TestTDA5250Control/Makefile | 4 + .../TestTDA5250Control/TestTDA5250ControlC.nc | 57 +++++ .../TestTDA5250Control/TestTDA5250ControlM.nc | 140 +++++++++++++ apps/tests/eyesIFX/Radio/TestHPL/Makefile | 4 + .../eyesIFX/Radio/TestHPL/TestHPLTDA5250C.nc | 58 ++++++ .../eyesIFX/Radio/TestHPL/TestHPLTDA5250M.nc | 119 +++++++++++ .../Radio/TestPacketSerializer/Makefile | 4 + .../TestPacketSerializerC.nc | 80 ++++++++ .../TestPacketSerializerM.nc | 186 +++++++++++++++++ apps/tests/eyesIFX/Radio/TestUARTPhy/Makefile | 4 + .../eyesIFX/Radio/TestUARTPhy/TestUARTPhyC.nc | 64 ++++++ .../eyesIFX/Radio/TestUARTPhy/TestUARTPhyM.nc | 116 +++++++++++ .../Radio/TestUARTPhyWithModes/Makefile | 4 + .../TestUARTPhyWithModes/TestUARTPhyC.nc | 74 +++++++ .../TestUARTPhyWithModes/TestUARTPhyM.nc | 194 ++++++++++++++++++ apps/tests/eyesIFX/Timer/Makefile | 4 + apps/tests/eyesIFX/Timer/TestTimerC.nc | 63 ++++++ apps/tests/eyesIFX/Timer/TestTimerM.nc | 89 ++++++++ 21 files changed, 1430 insertions(+) create mode 100644 apps/tests/eyesIFX/Radio/TestBasicMac/Makefile create mode 100644 apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacC.nc create mode 100644 apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacM.nc create mode 100644 apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/Makefile create mode 100644 apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlC.nc create mode 100644 apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlM.nc create mode 100644 apps/tests/eyesIFX/Radio/TestHPL/Makefile create mode 100644 apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250C.nc create mode 100644 apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250M.nc create mode 100644 apps/tests/eyesIFX/Radio/TestPacketSerializer/Makefile create mode 100644 apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerC.nc create mode 100644 apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerM.nc create mode 100644 apps/tests/eyesIFX/Radio/TestUARTPhy/Makefile create mode 100644 apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyC.nc create mode 100644 apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyM.nc create mode 100644 apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/Makefile create mode 100644 apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyC.nc create mode 100644 apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyM.nc create mode 100644 apps/tests/eyesIFX/Timer/Makefile create mode 100644 apps/tests/eyesIFX/Timer/TestTimerC.nc create mode 100644 apps/tests/eyesIFX/Timer/TestTimerM.nc diff --git a/apps/tests/eyesIFX/Radio/TestBasicMac/Makefile b/apps/tests/eyesIFX/Radio/TestBasicMac/Makefile new file mode 100644 index 00000000..f27412bc --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestBasicMac/Makefile @@ -0,0 +1,4 @@ +COMPONENT=TestBasicMacC +CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls +include $(MAKERULES) + diff --git a/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacC.nc b/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacC.nc new file mode 100644 index 00000000..dcc451d7 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacC.nc @@ -0,0 +1,79 @@ +/* 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. + */ +/** + * + **/ + +includes Timer; +includes TOSMsg; +configuration TestBasicMacC { +} +implementation { + components Main, TestBasicMacM + , new AlarmMilliC() as SendTimer + , new OSKITimerMsC() as RxTimeoutTimer + , LedsC + , TDA5250RadioC + , RandomLfsrC + , UARTPhyM + , PacketSerializerM + , BasicMacM + ; + + Main.SoftwareInit -> TDA5250RadioC.Init; + Main.SoftwareInit -> RandomLfsrC.Init; + Main.SoftwareInit -> LedsC.Init; + Main.SoftwareInit -> UARTPhyM.Init; + Main.SoftwareInit -> PacketSerializerM.Init; + Main.SoftwareInit -> BasicMacM.Init; + TestBasicMacM -> Main.Boot; + + TestBasicMacM.Random -> RandomLfsrC.Random; + TestBasicMacM.SendTimer -> SendTimer; + TestBasicMacM.Leds -> LedsC; + TestBasicMacM.Send -> PacketSerializerM.Send; + TestBasicMacM.Receive -> PacketSerializerM.Receive; + TestBasicMacM.MacSplitControl -> BasicMacM.SplitControl; + + PacketSerializerM.RadioByteComm -> BasicMacM.RadioByteComm; + PacketSerializerM.PhyPacketTx -> BasicMacM.PhyPacketTx; + PacketSerializerM.PhyPacketRx -> BasicMacM.PhyPacketRx; + + BasicMacM.TDA5250Control -> TDA5250RadioC.TDA5250Control; + BasicMacM.TDA5250RadioByteComm -> UARTPhyM.SerializerRadioByteComm; + BasicMacM.TDA5250PhyPacketTx -> UARTPhyM.PhyPacketTx; + BasicMacM.TDA5250PhyPacketRx -> UARTPhyM.PhyPacketRx; + BasicMacM.RxTimeoutTimer -> RxTimeoutTimer; + BasicMacM.RadioSplitControl -> TDA5250RadioC.SplitControl; + + UARTPhyM.RadioByteComm -> TDA5250RadioC.RadioByteComm; +} + + + diff --git a/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacM.nc b/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacM.nc new file mode 100644 index 00000000..10e58003 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacM.nc @@ -0,0 +1,83 @@ +// $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. + */ + +module TestBasicMacM { + uses { + interface Boot; + interface SplitControl as MacSplitControl; + interface Alarm as SendTimer; + interface Leds; + interface Random; + interface Send; + interface Receive; + } +} + +implementation { + + #define TIMER_RATE 500 + #define NUM_BYTES TOSH_DATA_LENGTH + + message_t sendMsg; + + event void Boot.booted() { + uint8_t i; + for(i=0; i TDA5250RadioC.Init; + Main.SoftwareInit -> RandomLfsrC.Init; + Main.SoftwareInit -> LedsC.Init; + TestTDA5250ControlM -> Main.Boot; + + TestTDA5250ControlM.Random -> RandomLfsrC.Random; + TestTDA5250ControlM.ModeTimer -> ModeTimer; + TestTDA5250ControlM.Leds -> LedsC; + TestTDA5250ControlM.TDA5250Control -> TDA5250RadioC.TDA5250Control; + TestTDA5250ControlM.RadioSplitControl -> TDA5250RadioC.SplitControl; +} + + + diff --git a/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlM.nc b/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlM.nc new file mode 100644 index 00000000..67193a5d --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlM.nc @@ -0,0 +1,140 @@ +// $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. + */ + +module TestTDA5250ControlM { + uses { + interface Boot; + interface Alarm as ModeTimer; + interface Leds; + interface TDA5250Control; + interface Random; + interface SplitControl as RadioSplitControl; + } +} + +implementation { + + #define MODE_TIMER_RATE 500 + + uint8_t mode; + + event void Boot.booted() { + atomic mode = 0; + call RadioSplitControl.start(); + } + + event void RadioSplitControl.startDone(error_t error) { + call ModeTimer.start(MODE_TIMER_RATE); + } + + event void RadioSplitControl.stopDone(error_t error) { + call ModeTimer.stop(); + } + + /*********************************************************************** + * Commands and events + ***********************************************************************/ + + async event void ModeTimer.fired() { + switch(mode) { + case 0: + call TDA5250Control.TimerMode(call Random.rand16() % MODE_TIMER_RATE/20, + call Random.rand16() % MODE_TIMER_RATE/20); + break; + case 1: + call TDA5250Control.SelfPollingMode(call Random.rand16() % MODE_TIMER_RATE/20, + call Random.rand16() % MODE_TIMER_RATE/20); + break; + case 2: + call TDA5250Control.RxMode(); + break; + case 3: + call TDA5250Control.TxMode(); + break; + case 4: + call TDA5250Control.SleepMode(); + break; + case 5: + call TDA5250Control.CCAMode(); + break; + } + } + + async event void TDA5250Control.PWDDDInterrupt() { + //call TDA5250Control.RxMode(); + } + + async event void TDA5250Control.TimerModeDone(){ + atomic mode = call Random.rand16() % 6; + call Leds.led0On(); + call Leds.led1On(); + call Leds.led2On(); + call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE); + } + async event void TDA5250Control.SelfPollingModeDone(){ + atomic mode = call Random.rand16() % 6; + call Leds.led0On(); + call Leds.led1On(); + call Leds.led2Off(); + call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE); + } + async event void TDA5250Control.RxModeDone(){ + atomic mode = call Random.rand16() % 6; + call Leds.led0On(); + call Leds.led1Off(); + call Leds.led2On(); + call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE); + } + async event void TDA5250Control.TxModeDone(){ + atomic mode = call Random.rand16() % 6; + call Leds.led0Off(); + call Leds.led1On(); + call Leds.led2On(); + call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE); + } + async event void TDA5250Control.SleepModeDone(){ + atomic mode = call Random.rand16() % 6; + call Leds.led0Off(); + call Leds.led1Off(); + call Leds.led2On(); + call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE); + } + async event void TDA5250Control.CCAModeDone(){ + atomic mode = call Random.rand16() % 6; + call Leds.led0On(); + call Leds.led1Off(); + call Leds.led2Off(); + call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE); + } + +} + + diff --git a/apps/tests/eyesIFX/Radio/TestHPL/Makefile b/apps/tests/eyesIFX/Radio/TestHPL/Makefile new file mode 100644 index 00000000..1fb5dde6 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestHPL/Makefile @@ -0,0 +1,4 @@ +COMPONENT=TestHPLTDA5250C +CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls +include $(MAKERULES) + diff --git a/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250C.nc b/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250C.nc new file mode 100644 index 00000000..7aa95ce3 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250C.nc @@ -0,0 +1,58 @@ +// $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. + */ +/** + * + **/ + +includes Timer; +configuration TestHPLTDA5250C { +} +implementation { + components Main + , TestHPLTDA5250M + , new AlarmMilliC() as ModeTimer + , LedsC + , TDA5250ConfigC + ; + + TestHPLTDA5250M -> Main.Boot; + + Main.SoftwareInit -> LedsC; + Main.SoftwareInit -> TDA5250ConfigC; + + TestHPLTDA5250M.Resource -> TDA5250ConfigC.Resource; + TestHPLTDA5250M.ModeTimer -> ModeTimer; + TestHPLTDA5250M.Leds -> LedsC; + TestHPLTDA5250M.TDA5250Config -> TDA5250ConfigC; +} + + + diff --git a/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250M.nc b/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250M.nc new file mode 100644 index 00000000..676de52d --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250M.nc @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2004, Technische Universitat Berlin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the name of the Technische Universitat Berlin nor the names + * of its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) 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. + * - Revision ------------------------------------------------------------- + * $Revision$ + * $Date$ + * ======================================================================== + */ + + /** + * TestTDA5250M Application + * Test Application for the HPL layer of the TDA5250 radio + * + * @author Kevin Klues (klues@tkn.tu-berlin.de) + */ + +module TestHPLTDA5250M { + uses { + interface Boot; + interface Leds; + interface Alarm as ModeTimer; + interface TDA5250Config; + interface Resource; + } +} + +implementation { + + uint8_t mode; + + event void Boot.booted() { + mode = 0; + call Resource.request(); + } + + event void Resource.granted() { + call TDA5250Config.reset(); + call ModeTimer.start(50); + } + + event void Resource.requested() { + call ModeTimer.stop(); + call Resource.release(); + call Resource.request(); + } + + /*********************************************************************** + * Commands and events + ***********************************************************************/ + async event void ModeTimer.fired() { + if(mode == 0) { + call TDA5250Config.SetRxMode(); + mode = 1; + call Leds.led0Off(); + call Leds.led1Off(); + call Leds.led2Off(); + } + else if(mode == 1) { + call TDA5250Config.SetTxMode(); + mode = 2; + call Leds.led0Off(); + call Leds.led1Off(); + call Leds.led2On(); + } + else if(mode == 2) { + call TDA5250Config.SetTimerMode(5, 5); + mode = 3; + call Leds.led0Off(); + call Leds.led1On(); + call Leds.led2Off(); + } + else if(mode == 3) { + call TDA5250Config.SetSelfPollingMode(5, 5); + mode = 4; + call Leds.led0Off(); + call Leds.led1On(); + call Leds.led2On(); + } + else { + call TDA5250Config.SetSlaveMode(); + call TDA5250Config.SetSleepMode(); + mode = 0; + call Leds.led0On(); + call Leds.led1Off(); + call Leds.led2Off(); + } + call ModeTimer.start(50); + } + + async event void TDA5250Config.PWDDDInterrupt() { + TOSH_TOGGLE_LED3_PIN(); + } +} + + diff --git a/apps/tests/eyesIFX/Radio/TestPacketSerializer/Makefile b/apps/tests/eyesIFX/Radio/TestPacketSerializer/Makefile new file mode 100644 index 00000000..89a0995a --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestPacketSerializer/Makefile @@ -0,0 +1,4 @@ +COMPONENT=TestPacketSerializerC +CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls +include $(MAKERULES) + diff --git a/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerC.nc b/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerC.nc new file mode 100644 index 00000000..d56341a7 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerC.nc @@ -0,0 +1,80 @@ +/* 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. + */ +/** + * + **/ + +includes Timer; +includes TOSMsg; +configuration TestPacketSerializerC { +} +implementation { + components Main, TestPacketSerializerM + , new AlarmMilliC() as TxTimer + , new AlarmMilliC() as RxTimer + , new AlarmMilliC() as CCATimer +// , new AlarmMilliC() as TimerTimer + , new AlarmMilliC() as SelfPollingTimer +// , new AlarmMilliC() as SleepTimer + , LedsC + , TDA5250RadioC + , RandomLfsrC + , UARTPhyM + , PacketSerializerM + ; + + Main.SoftwareInit -> TDA5250RadioC.Init; + Main.SoftwareInit -> RandomLfsrC.Init; + Main.SoftwareInit -> LedsC.Init; + Main.SoftwareInit -> UARTPhyM.Init; + Main.SoftwareInit -> PacketSerializerM.Init; + TestPacketSerializerM -> Main.Boot; + + TestPacketSerializerM.Random -> RandomLfsrC.Random; + TestPacketSerializerM.TxTimer -> TxTimer; + TestPacketSerializerM.RxTimer -> RxTimer; + TestPacketSerializerM.CCATimer -> CCATimer; +// TestPacketSerializerM.TimerTimer -> TimerTimer; + TestPacketSerializerM.SelfPollingTimer -> SelfPollingTimer; +// TestPacketSerializerM.SleepTimer -> SleepTimer; + TestPacketSerializerM.Leds -> LedsC; + TestPacketSerializerM.TDA5250Control -> TDA5250RadioC.TDA5250Control; + TestPacketSerializerM.RadioSplitControl -> TDA5250RadioC.SplitControl; + TestPacketSerializerM.Send -> PacketSerializerM.Send; + TestPacketSerializerM.Receive -> PacketSerializerM.Receive; + + UARTPhyM.RadioByteComm -> TDA5250RadioC.RadioByteComm; + + PacketSerializerM.RadioByteComm -> UARTPhyM.SerializerRadioByteComm; + PacketSerializerM.PhyPacketTx -> UARTPhyM.PhyPacketTx; + PacketSerializerM.PhyPacketRx -> UARTPhyM.PhyPacketRx; +} + + + diff --git a/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerM.nc b/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerM.nc new file mode 100644 index 00000000..3354e4c2 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerM.nc @@ -0,0 +1,186 @@ +// $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. + */ + +module TestPacketSerializerM { + uses { + interface Boot; + interface Alarm as TxTimer; + interface Alarm as RxTimer; +// interface Alarm as TimerTimer; + interface Alarm as CCATimer; + interface Alarm as SelfPollingTimer; +// interface Alarm as SleepTimer; + interface Leds; + interface TDA5250Control; + interface Random; + interface SplitControl as RadioSplitControl; + interface Send; + interface Receive; + } +} + +implementation { + + #define TIMER_RATE 500 + #define NUM_BYTES TOSH_DATA_LENGTH + + uint8_t bytes_sent; + bool sending; + message_t sendMsg; + + event void Boot.booted() { + uint8_t i; + bytes_sent = 0; + sending = FALSE; + for(i=0; i TDA5250RadioC.Init; + Main.SoftwareInit -> RandomLfsrC.Init; + Main.SoftwareInit -> LedsC.Init; + Main.SoftwareInit -> UARTPhyM.Init; + TestUARTPhyM -> Main.Boot; + + TestUARTPhyM.Random -> RandomLfsrC.Random; + TestUARTPhyM.TxTimer -> TxTimer; + TestUARTPhyM.Leds -> LedsC; + TestUARTPhyM.TDA5250Control -> TDA5250RadioC.TDA5250Control; + TestUARTPhyM.RadioSplitControl -> TDA5250RadioC.SplitControl; + TestUARTPhyM.RadioByteComm -> UARTPhyM.SerializerRadioByteComm; + TestUARTPhyM.PhyPacketTx -> UARTPhyM.PhyPacketTx; + TestUARTPhyM.PhyPacketRx -> UARTPhyM.PhyPacketRx; + + UARTPhyM.RadioByteComm -> TDA5250RadioC.RadioByteComm; +} + + + diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyM.nc b/apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyM.nc new file mode 100644 index 00000000..a40459c2 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyM.nc @@ -0,0 +1,116 @@ +// $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. + */ + +module TestUARTPhyM { + uses { + interface Boot; + interface Alarm as TxTimer; + interface Leds; + interface TDA5250Control; + interface Random; + interface SplitControl as RadioSplitControl; + interface PhyPacketTx; + interface PhyPacketRx; + interface RadioByteComm; + } +} + +implementation { + + #define TX_TIMER_RATE 500 + #define NUM_BYTES 36 + + uint8_t bytes_sent; + + event void Boot.booted() { + bytes_sent = 0; + call RadioSplitControl.start(); + } + + event void RadioSplitControl.startDone(error_t error) { + call TDA5250Control.TxMode(); + } + + event void RadioSplitControl.stopDone(error_t error) { + call TxTimer.stop(); + } + + /*********************************************************************** + * Commands and events + ***********************************************************************/ + + async event void TxTimer.fired() { + call TDA5250Control.TxMode(); + } + + async event void TDA5250Control.TxModeDone(){ + call PhyPacketTx.sendHeader(NUM_BYTES); + } + + async event void PhyPacketTx.sendHeaderDone(error_t error) { + call RadioByteComm.txByte(call Random.rand16() / 2); + } + + async event void RadioByteComm.txByteReady(error_t error) { + if(++bytes_sent < NUM_BYTES) + call RadioByteComm.txByte(call Random.rand16() / 2); + else { + bytes_sent = 0; + call PhyPacketTx.sendFooter(); + } + } + + async event void PhyPacketTx.sendFooterDone(error_t error) { + call TDA5250Control.SleepMode(); + call TxTimer.start(call Random.rand16() % TX_TIMER_RATE); + call Leds.led0Toggle(); + } + + async event void PhyPacketRx.recvHeaderDone(uint8_t length_value) {} + async event void PhyPacketRx.recvFooterDone(bool error) {} + async event void RadioByteComm.rxByteReady(uint8_t data) {} + + async event void TDA5250Control.PWDDDInterrupt() { + } + async event void TDA5250Control.TimerModeDone(){ + } + async event void TDA5250Control.SelfPollingModeDone(){ + } + async event void TDA5250Control.RxModeDone(){ + } + async event void TDA5250Control.SleepModeDone(){ + } + async event void TDA5250Control.CCAModeDone(){ + } + +} + + diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/Makefile b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/Makefile new file mode 100644 index 00000000..a74e012d --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/Makefile @@ -0,0 +1,4 @@ +COMPONENT=TestUARTPhyC +CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls +include $(MAKERULES) + diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyC.nc b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyC.nc new file mode 100644 index 00000000..0685b532 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyC.nc @@ -0,0 +1,74 @@ +/* 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. + */ +/** + * + **/ + +includes Timer; +configuration TestUARTPhyC { +} +implementation { + components Main, TestUARTPhyM + , new AlarmMilliC() as TxTimer + , new AlarmMilliC() as RxTimer + , new AlarmMilliC() as CCATimer + , new AlarmMilliC() as TimerTimer +// , new AlarmMilliC() as SelfPollingTimer +// , new AlarmMilliC() as SleepTimer + , LedsC + , TDA5250RadioC + , RandomLfsrC + , UARTPhyM + ; + + Main.SoftwareInit -> TDA5250RadioC.Init; + Main.SoftwareInit -> RandomLfsrC.Init; + Main.SoftwareInit -> LedsC.Init; + Main.SoftwareInit -> UARTPhyM.Init; + TestUARTPhyM -> Main.Boot; + + TestUARTPhyM.Random -> RandomLfsrC.Random; + TestUARTPhyM.TxTimer -> TxTimer; + TestUARTPhyM.RxTimer -> RxTimer; + TestUARTPhyM.CCATimer -> CCATimer; + TestUARTPhyM.TimerTimer -> TimerTimer; +// TestUARTPhyM.SelfPollingTimer -> SelfPollingTimer; +// TestUARTPhyM.SleepTimer -> SleepTimer; + TestUARTPhyM.Leds -> LedsC; + TestUARTPhyM.TDA5250Control -> TDA5250RadioC.TDA5250Control; + TestUARTPhyM.RadioSplitControl -> TDA5250RadioC.SplitControl; + TestUARTPhyM.RadioByteComm -> UARTPhyM.SerializerRadioByteComm; + TestUARTPhyM.PhyPacketTx -> UARTPhyM.PhyPacketTx; + TestUARTPhyM.PhyPacketRx -> UARTPhyM.PhyPacketRx; + + UARTPhyM.RadioByteComm -> TDA5250RadioC.RadioByteComm; +} + + + diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyM.nc b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyM.nc new file mode 100644 index 00000000..12f17e14 --- /dev/null +++ b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyM.nc @@ -0,0 +1,194 @@ +// $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. + */ + +module TestUARTPhyM { + uses { + interface Boot; + interface Alarm as TxTimer; + interface Alarm as RxTimer; + interface Alarm as TimerTimer; + interface Alarm as CCATimer; +// interface Alarm as SelfPollingTimer; +// interface Alarm as SleepTimer; + interface Leds; + interface TDA5250Control; + interface Random; + interface SplitControl as RadioSplitControl; + interface PhyPacketTx; + interface PhyPacketRx; + interface RadioByteComm; + } +} + +implementation { + + #define TIMER_RATE 500 + #define NUM_BYTES 36 + + uint8_t bytes_sent; + bool sending; + + event void Boot.booted() { + bytes_sent = 0; + sending = FALSE; + call RadioSplitControl.start(); + } + + event void RadioSplitControl.startDone(error_t error) { + call TxTimer.start(call Random.rand16() % TIMER_RATE); + call TimerTimer.start(call Random.rand16() % TIMER_RATE); + call RxTimer.start(call Random.rand16() % TIMER_RATE); + call CCATimer.start(call Random.rand16() % TIMER_RATE); + } + + event void RadioSplitControl.stopDone(error_t error) { + call TxTimer.stop(); + } + + /*********************************************************************** + * Commands and events + ***********************************************************************/ + + async event void TxTimer.fired() { + atomic { + if(call TDA5250Control.TxMode() != FAIL) { + bytes_sent = 0; + sending = TRUE; + call Leds.led0On(); + call Leds.led1On(); + call Leds.led2On(); + return; + } + } + call TxTimer.start(call Random.rand16() % TIMER_RATE); + } + + async event void RxTimer.fired() { + if(sending == FALSE) + if(call TDA5250Control.RxMode() != FAIL) + return; + call RxTimer.start(call Random.rand16() % TIMER_RATE); + } + + async event void CCATimer.fired() { + if(sending == FALSE) + if(call TDA5250Control.CCAMode() != FAIL) + return; + call CCATimer.start(call Random.rand16() % TIMER_RATE); + } + + async event void TimerTimer.fired() { + if(sending == FALSE) + if(call TDA5250Control.TimerMode(call Random.rand16() % TIMER_RATE/20, + call Random.rand16() % TIMER_RATE/20) != FAIL) + return; + call TimerTimer.start(call Random.rand16() % TIMER_RATE); + } + +// async event void SelfPollingTimer.fired() { +// if(sending == FALSE) +// if(call TDA5250Control.SelfPollingMode(call Random.rand16() % TIMER_RATE/20, +// call Random.rand16() % TIMER_RATE/20) != FAIL) +// return; +// call SelfPollingTimer.start(call Random.rand16() % TIMER_RATE); +// } + +// async event void SleepTimer.fired() { +// if(sending == FALSE) +// if(call TDA5250Control.SleepMode() != FAIL) +// return; +// call SleepTimer.start(call Random.rand16() % TIMER_RATE); +// } + + + async event void TDA5250Control.TxModeDone(){ + call PhyPacketTx.sendHeader(NUM_BYTES); + } + + async event void PhyPacketTx.sendHeaderDone(error_t error) { + call RadioByteComm.txByte(call Random.rand16() / 2); + } + + async event void RadioByteComm.txByteReady(error_t error) { + if(++bytes_sent < NUM_BYTES) + call RadioByteComm.txByte(call Random.rand16() / 2); + else { + bytes_sent = 0; + call PhyPacketTx.sendFooter(); + } + } + + async event void PhyPacketTx.sendFooterDone(error_t error) { + call TDA5250Control.SleepMode(); + sending = FALSE; + call TxTimer.start(call Random.rand16() % TIMER_RATE); + } + + async event void TDA5250Control.TimerModeDone(){ + call TimerTimer.start(call Random.rand16() % TIMER_RATE); + call Leds.led0On(); + call Leds.led1On(); + call Leds.led2Off(); + } + async event void TDA5250Control.SelfPollingModeDone(){ +// call SelfPollingTimer.start(call Random.rand16() % TIMER_RATE); +// call Leds.led0On(); +// call Leds.led1Off(); +// call Leds.led2On(); + } + async event void TDA5250Control.RxModeDone(){ + call RxTimer.start(call Random.rand16() % TIMER_RATE); + call Leds.led0Off(); + call Leds.led1On(); + call Leds.led2On(); + } + async event void TDA5250Control.SleepModeDone(){ +// call SleepTimer.start(call Random.rand16() % TIMER_RATE); + call Leds.led0Off(); + call Leds.led1Off(); + call Leds.led2On(); + } + async event void TDA5250Control.CCAModeDone(){ + call CCATimer.start(call Random.rand16() % TIMER_RATE); + call Leds.led0On(); + call Leds.led1Off(); + call Leds.led2Off(); + } + + async event void TDA5250Control.PWDDDInterrupt() { + } + async event void PhyPacketRx.recvHeaderDone(uint8_t length_value) {} + async event void PhyPacketRx.recvFooterDone(bool error) {} + async event void RadioByteComm.rxByteReady(uint8_t data) {} + +} + + diff --git a/apps/tests/eyesIFX/Timer/Makefile b/apps/tests/eyesIFX/Timer/Makefile new file mode 100644 index 00000000..53544a07 --- /dev/null +++ b/apps/tests/eyesIFX/Timer/Makefile @@ -0,0 +1,4 @@ +COMPONENT=TestTimerC +CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls +include $(MAKERULES) + diff --git a/apps/tests/eyesIFX/Timer/TestTimerC.nc b/apps/tests/eyesIFX/Timer/TestTimerC.nc new file mode 100644 index 00000000..2678d243 --- /dev/null +++ b/apps/tests/eyesIFX/Timer/TestTimerC.nc @@ -0,0 +1,63 @@ +/* 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. + */ +/** + * + **/ + +includes Timer; +configuration TestTimerC { +} +implementation { + components Main, TestTimerM + , new AlarmMilliC() as Timer0 + , new AlarmMilliC() as Timer1 + , new AlarmMilliC() as Timer2 + , new AlarmMilliC() as Timer3 + , new AlarmMilliC() as Timer4 + , new AlarmMilliC() as Timer5 + , new AlarmMilliC() as Timer6 + , new AlarmMilliC() as Timer7 + , new AlarmMilliC() as Timer8 + ; + + TestTimerM -> Main.Boot; + + TestTimerM.Timer0 -> Timer0; + TestTimerM.Timer1 -> Timer1; + TestTimerM.Timer2 -> Timer2; + TestTimerM.Timer3 -> Timer3; + TestTimerM.Timer4 -> Timer4; + TestTimerM.Timer5 -> Timer5; + TestTimerM.Timer6 -> Timer6; + TestTimerM.Timer7 -> Timer7; + TestTimerM.Timer8 -> Timer8; +} + + + diff --git a/apps/tests/eyesIFX/Timer/TestTimerM.nc b/apps/tests/eyesIFX/Timer/TestTimerM.nc new file mode 100644 index 00000000..b205375c --- /dev/null +++ b/apps/tests/eyesIFX/Timer/TestTimerM.nc @@ -0,0 +1,89 @@ +// $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. + */ + +module TestTimerM { + uses { + interface Boot; + interface Alarm as Timer0; + interface Alarm as Timer1; + interface Alarm as Timer2; + interface Alarm as Timer3; + interface Alarm as Timer4; + interface Alarm as Timer5; + interface Alarm as Timer6; + interface Alarm as Timer7; + interface Alarm as Timer8; + } +} + +implementation { + + #define DELAY 20 + + event void Boot.booted() { + call Timer0.start(DELAY); + } + + /*********************************************************************** + * Commands and events + ***********************************************************************/ + + async event void Timer0.fired() { + call Timer1.start(DELAY); + } + async event void Timer1.fired() { + call Timer2.start(DELAY); + } + async event void Timer2.fired() { + call Timer3.start(DELAY); + } + async event void Timer3.fired() { + call Timer4.start(DELAY); + } + async event void Timer4.fired() { + call Timer5.start(DELAY); + } + async event void Timer5.fired() { + call Timer6.start(DELAY); + } + async event void Timer6.fired() { + call Timer7.start(DELAY); + } + async event void Timer7.fired() { + call Timer8.start(DELAY); + } + async event void Timer8.fired() { + call Timer0.start(DELAY); + } + +} + + -- 2.39.2