[Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192
mc13192ControlM.nc, 1.2, 1.3 mc13192HardwareM.nc, 1.1,
1.2 mc13192Const.h, 1.2, 1.3 mc13192TOSRadioC.nc, 1.2,
1.3 mc13192TOSRadioM.nc, 1.2, 1.3 mc13192InterruptM.nc, 1.3,
1.4 mc13192DataM.nc, 1.7, 1.8 mc13192StateM.nc, 1.1,
1.2 mc13192Ieee802154M.nc, 1.10, 1.11 mc13192RawRadioC.nc, 1.2,
1.3 mc13192TimerM.nc, 1.1, 1.2 mc13192TimerCounterM.nc, 1.1,
1.2 mc13192Ieee802154RadioC.nc, 1.4, 1.5
Jan Flora
janflora at users.sourceforge.net
Wed Aug 23 02:34:05 PDT 2006
- Previous message: [Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/ieee802154/phy
mc13192PhyInterrupt.nc, NONE, 1.1 mc13192PhyInterruptM.nc,
NONE, 1.1 PhyAttributes.h, NONE, 1.1 mc13192PhyTimer.nc, NONE,
1.1 mc13192PhyInitM.nc, NONE, 1.1 mc13192Filters.h, NONE,
1.1 mc13192PhyDriverC.nc, NONE, 1.1 mc13192Registers.h, NONE,
1.1 mc13192PhyDriverConst.h, NONE, 1.1 mc13192PhyTimerM.nc,
NONE, 1.1 mc13192PhyDriverM.nc, NONE, 1.1
- Next message: [Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/diku/evb13192/tools/make
dig528.target, 1.6, 1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9134/tos/chips/mc13192
Modified Files:
mc13192ControlM.nc mc13192HardwareM.nc mc13192Const.h
mc13192TOSRadioC.nc mc13192TOSRadioM.nc mc13192InterruptM.nc
mc13192DataM.nc mc13192StateM.nc mc13192Ieee802154M.nc
mc13192RawRadioC.nc mc13192TimerM.nc mc13192TimerCounterM.nc
mc13192Ieee802154RadioC.nc
Log Message:
MC13192 driver updates
Index: mc13192ControlM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192ControlM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mc13192ControlM.nc 3 Mar 2006 18:07:17 -0000 1.2
--- mc13192ControlM.nc 23 Aug 2006 09:34:03 -0000 1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
+
#include "mc13192Const.h"
***************
*** 13,22 ****
interface mc13192Timer as Timer2;
interface mc13192TimerCounter as Time;
! interface Leds;
! interface ConsoleOutput as ConsoleOut;
}
}
implementation
{
// Globals
bool timedDoze = FALSE;
--- 43,54 ----
interface mc13192Timer as Timer2;
interface mc13192TimerCounter as Time;
! interface Debug;
}
}
implementation
{
+ #define DBG_LEVEL 1
+ #include "Debug.h"
+
// Globals
bool timedDoze = FALSE;
***************
*** 32,36 ****
command result_t StdControl.init()
{
! call State.setRXTXStateMirror(INIT_MODE);
// Initialize GPIO pins.
--- 64,68 ----
command result_t StdControl.init()
{
! //call State.setRXTXStateMirror(INIT_MODE);
// Initialize GPIO pins.
***************
*** 71,78 ****
--- 103,115 ----
ENABLE_IRQ; // Enable interrupts.
+ // TEST
+ //call Regs.write(0x1A, 0x1111);
+ //call Regs.write(0x23, 0xFFFF);
+
// Time to setup the radio.
// Please refer to document MC13192RM for hidden register initialization
// Register 0x11 is hidden. bit 8-9 should be initialized to 00.
call Regs.write(0x11,0xA0FF);
+
call Regs.write(GPIO_DIR, 0x3F80);
call Regs.write(CCA_THRESH,0x9674); // WAS: 0xA08D
***************
*** 80,85 ****
--- 117,124 ----
// Preferred injection
call Regs.write(0x08,0xFFF7);
+
// ATTN masks, LO1
call Regs.write(IRQ_MASK,0x8240);
+ //call Regs.write(IRQ_MASK,0xFFFF);
// Register 0x06 has some hidden bits. bit 14 should be initialized to 1.
call Regs.write(CONTROL_A,0x4010);
***************
*** 100,104 ****
// Read the status register to clear any undesired IRQs.
call Regs.read(IRQ_STATUS);
! call State.setRXTXStateMirror(IDLE_MODE);
// Use external clock.
--- 139,143 ----
// Read the status register to clear any undesired IRQs.
call Regs.read(IRQ_STATUS);
! //call State.setRXTXStateMirror(IDLE_MODE);
// Use external clock.
***************
*** 188,191 ****
--- 227,263 ----
command result_t RadioControl.setChannel(uint8_t channel)
{
+ // Print the value of interesting registers!
+ /* uint16_t reg;
+ reg = call Regs.read(0x06);
+ DBG_STRINT("Register 0x06:",reg,1);
+ reg = call Regs.read(0x07);
+ DBG_STRINT("Register 0x07:",reg,1);
+ reg = call Regs.read(0x08);
+ DBG_STRINT("Register 0x08:",reg,1);
+ reg = call Regs.read(0x09);
+ DBG_STRINT("Register 0x09:",reg,1);
+ reg = call Regs.read(0x0D);
+ DBG_STRINT("Register 0x0D:",reg,1);
+ reg = call Regs.read(0x0E);
+ DBG_STRINT("Register 0x0E:",reg,1);
+ reg = call Regs.read(0x11);
+ DBG_STRINT("Register 0x11:",reg,1);
+ reg = call Regs.read(0x13);
+ DBG_STRINT("Register 0x13:",reg,1);
+ reg = call Regs.read(0x14);
+ DBG_STRINT("Register 0x14:",reg,1);
+ reg = call Regs.read(0x15);
+ DBG_STRINT("Register 0x15:",reg,1);
+ reg = call Regs.read(0x16);
+ DBG_STRINT("Register 0x16:",reg,1);
+ reg = call Regs.read(0x17);
+ DBG_STRINT("Register 0x17:",reg,1);
+ reg = call Regs.read(0x18);
+ DBG_STRINT("Register 0x18:",reg,1);
+ reg = call Regs.read(0x19);
+ DBG_STRINT("Register 0x19:",reg,1);
+ reg = call Regs.read(0x1A);
+ DBG_STRINT("Register 0x1A:",reg,1);*/
+
if (channel <= 0x0F) {
uint16_t num = ((channel + 1)*5 & 0x000F)<<12;
***************
*** 417,421 ****
ICGS1 |= 0x01; /* Clear lost clock interrupt */
clockLost = TRUE;
- //call Leds.redToggle();
}
}
--- 489,492 ----
Index: mc13192HardwareM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192HardwareM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mc13192HardwareM.nc 16 Jan 2006 18:43:17 -0000 1.1
--- mc13192HardwareM.nc 23 Aug 2006 09:34:03 -0000 1.2
***************
*** 1,2 ****
--- 1,31 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
module mc13192HardwareM {
***************
*** 5,10 ****
}
uses interface FastSPI as SPI;
- uses interface Leds;
- uses interface ConsoleOutput as ConsoleOut;
}
implementation
--- 34,37 ----
***************
*** 42,48 ****
// Do write if SPI is free.
//if (!MC13192_CE) {
! if (!TOSH_READ_RADIO_CE_PIN()) {
call ConsoleOut.print("SPI Busy while trying to write!\n");
! }
disable_MC13192_interrupts(); // Necessary to prevent double SPI access
TOSH_CLR_RADIO_CE_PIN();
--- 69,75 ----
// Do write if SPI is free.
//if (!MC13192_CE) {
! /* if (!TOSH_READ_RADIO_CE_PIN()) {
call ConsoleOut.print("SPI Busy while trying to write!\n");
! }*/
disable_MC13192_interrupts(); // Necessary to prevent double SPI access
TOSH_CLR_RADIO_CE_PIN();
Index: mc13192Const.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192Const.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mc13192Const.h 1 Mar 2006 12:59:10 -0000 1.2
--- mc13192Const.h 23 Aug 2006 09:34:03 -0000 1.3
***************
*** 1,2 ****
--- 1,34 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
+
+ #ifndef _MC13192CONST_H_
+ #define _MC13192CONST_H_
/**************************************************************
***************
*** 29,33 ****
#define DOZE_IRQ_MASK 0x0200
#define ATTN_IRQ_MASK 0x0400
! #define HG_IRQ_MASK 0x8000
#define STRM_DATA_ERR_IRQ_MASK 0x1000
#define STRM_RX_DONE_IRQ_MASK 0x2000
--- 61,65 ----
#define DOZE_IRQ_MASK 0x0200
#define ATTN_IRQ_MASK 0x0400
! #define HG_IRQ_MASK 0x0800
#define STRM_DATA_ERR_IRQ_MASK 0x1000
#define STRM_RX_DONE_IRQ_MASK 0x2000
***************
*** 116,124 ****
#define CCA_MODE 0x4411
#define ED_MODE 0x4421
! #define RX_MODE 0x4102
! #define TX_MODE 0x4203
! #define TX_STRM_MODE 0x5200 // Was: 0x5200 (1xx3
! #define RX_STRM_MODE 0x4922 // Bit 7 is auto_ack
#define INIT_MODE 0x80
--- 148,156 ----
#define CCA_MODE 0x4411
#define ED_MODE 0x4421
! #define RX_MODE 0x4122 // Was: 0x4102
! #define TX_MODE 0x4203 // Was: 0x4203
! #define TX_STRM_MODE 0x5200
! #define RX_STRM_MODE 0x4922
#define INIT_MODE 0x80
***************
*** 149,150 ****
--- 181,194 ----
// The MAC address
uint8_t *radioMACAddr;
+
+ #define RX_QUEUE_SIZE 3
+ #define RX_BUFFER_QUEUE_SIZE 3
+ // Receive queue variables
+ typedef struct {
+ uint8_t *buffer;
+ uint8_t length;
+ bool crc;
+ uint8_t lqi;
+ } receiveItem_t;
+
+ #endif
Index: mc13192TOSRadioC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192TOSRadioC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mc13192TOSRadioC.nc 19 Jan 2006 16:18:32 -0000 1.2
--- mc13192TOSRadioC.nc 23 Aug 2006 09:34:03 -0000 1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
+
includes mc13192Const;
***************
*** 10,13 ****
--- 40,45 ----
uses {
interface FastSPI as SPI;
+ interface Debug;
+ interface ConsoleOutput as ConsoleOut;
}
}
***************
*** 22,35 ****
mc13192TimerCounterM as TimerCounter,
mc13192StateM as State,
! ConsoleDebugM,
! //HPLTimer2M,
! //InitHCS08TimerC,
! LedsC, ConsoleC;
- //Control = ConsoleC.StdControl;
Control = RadioControl.StdControl;
Control = Timer.StdControl;
- Control = Radio.StdControl;
Control = Data.StdControl;
Send = Radio.Send;
Receive = Radio.Recv;
--- 54,63 ----
mc13192TimerCounterM as TimerCounter,
mc13192StateM as State,
! LedsC;
Control = RadioControl.StdControl;
Control = Timer.StdControl;
Control = Data.StdControl;
+ Control = Radio.StdControl;
Send = Radio.Send;
Receive = Radio.Recv;
***************
*** 38,43 ****
SPI = Interrupt.SPI;
! // Wire debug module.
! ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut;
RadioControl.Interrupt -> Interrupt.Control;
--- 66,70 ----
SPI = Interrupt.SPI;
!
RadioControl.Interrupt -> Interrupt.Control;
***************
*** 46,84 ****
RadioControl.Time -> TimerCounter.Time;
RadioControl.State -> State.State;
! RadioControl.Leds -> LedsC;
! RadioControl.ConsoleOut -> ConsoleC.ConsoleOut;
!
! Data.Timer2 -> Timer.Timer[1];
! Data.Timer3 -> Timer.Timer[2];
Data.Time -> TimerCounter.Time;
Data.Regs -> Hardware.Regs;
Data.Interrupt -> Interrupt.Data;
Data.State -> State.State;
! Data.Debug -> ConsoleDebugM.Debug;
Radio.RadioSend -> Data.Send;
Radio.RadioRecv -> Data.Recv;
Radio.StreamOp -> Data.StreamOp;
! Radio.Debug -> ConsoleDebugM.Debug;
! Radio.ConsoleIn -> ConsoleC.ConsoleIn;
! Radio.Leds -> LedsC;
Timer.Regs -> Hardware.Regs;
Timer.Interrupt -> Interrupt.Timer;
! Timer.Leds -> LedsC;
! Timer.ConsoleOut -> ConsoleC.ConsoleOut;
Interrupt.State -> State.State;
! Interrupt.Debug -> ConsoleDebugM.Debug;
State.Regs -> Hardware.Regs;
! State.ConsoleOut -> ConsoleC.ConsoleOut;
Hardware.Leds -> LedsC;
! Hardware.ConsoleOut -> ConsoleC.ConsoleOut;
TimerCounter.Regs -> Hardware.Regs;
TimerCounter.Leds -> LedsC;
! TimerCounter.ConsoleOut -> ConsoleC.ConsoleOut;
// Timing tests.
--- 73,109 ----
RadioControl.Time -> TimerCounter.Time;
RadioControl.State -> State.State;
! RadioControl.Debug = Debug;
!
Data.Time -> TimerCounter.Time;
Data.Regs -> Hardware.Regs;
Data.Interrupt -> Interrupt.Data;
Data.State -> State.State;
! Data.EventTimer -> Timer.EventTimer;
! Data.Timer1 -> Timer.Timer[0];
! Data.Debug = Debug;
Radio.RadioSend -> Data.Send;
Radio.RadioRecv -> Data.Recv;
Radio.StreamOp -> Data.StreamOp;
! Radio.Time -> TimerCounter.Time;
! Radio.Debug = Debug;
Timer.Regs -> Hardware.Regs;
Timer.Interrupt -> Interrupt.Timer;
! Timer.Debug = Debug;
Interrupt.State -> State.State;
! Interrupt.Debug = Debug;
State.Regs -> Hardware.Regs;
! State.EventTimer -> Timer.EventTimer;
! State.Debug = Debug;
Hardware.Leds -> LedsC;
! Hardware.ConsoleOut = ConsoleOut;
TimerCounter.Regs -> Hardware.Regs;
TimerCounter.Leds -> LedsC;
! TimerCounter.ConsoleOut = ConsoleOut;
// Timing tests.
Index: mc13192TOSRadioM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192TOSRadioM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mc13192TOSRadioM.nc 19 Jan 2006 16:18:32 -0000 1.2
--- mc13192TOSRadioM.nc 23 Aug 2006 09:34:03 -0000 1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
+
includes crc;
***************
*** 11,26 ****
interface mc13192Receive as RadioRecv;
interface mc13192StreamEvents as StreamOp;
! interface Leds;
interface Debug;
- interface ConsoleInput as ConsoleIn;
}
}
implementation
{
! #define DBG_LEVEL 3
#include "Debug.h"
TOS_MsgPtr rxBufPtr;
TOS_MsgPtr txBufPtr;
uint8_t rxBuf[3][126]; // Initial receive buffer.
--- 41,58 ----
interface mc13192Receive as RadioRecv;
interface mc13192StreamEvents as StreamOp;
! interface mc13192TimerCounter as Time;
interface Debug;
}
}
implementation
{
! #define DBG_LEVEL 4
#include "Debug.h"
TOS_MsgPtr rxBufPtr;
TOS_MsgPtr txBufPtr;
+ // 0x23, 0xC8, 0xFE
+ uint8_t myTestFrame[19] = {0x23, 0xC8, 0x12, 0xDE, 0xFE, 0x1F, 0x00, 0xFF, 0xFF, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x01, 0x80};
+ uint8_t myTestFrameLength = 125;//19;
uint8_t rxBuf[3][126]; // Initial receive buffer.
***************
*** 38,46 ****
uint32_t errorLastCount = 0;
uint32_t recvCount = 0;
- char console_data;
- task void handleGet();
#endif
// Forward declarations
task void receiveDoneTask();
uint16_t crc16(uint8_t* buf, uint8_t len);
--- 70,77 ----
uint32_t errorLastCount = 0;
uint32_t recvCount = 0;
#endif
// Forward declarations
+ task void rxOnTask();
task void receiveDoneTask();
uint16_t crc16(uint8_t* buf, uint8_t len);
***************
*** 72,76 ****
call RadioRecv.initRxQueue(rxBuf[1]);
call RadioRecv.initRxQueue(rxBuf[2]);
! call RadioRecv.enableReceiver(0);
return SUCCESS;
}
--- 103,107 ----
call RadioRecv.initRxQueue(rxBuf[1]);
call RadioRecv.initRxQueue(rxBuf[2]);
! //post rxOnTask();
return SUCCESS;
}
***************
*** 83,86 ****
--- 114,118 ----
command result_t Send.send(TOS_MsgPtr msg)
{
+ uint32_t startTime, diffTime;
uint8_t txLength;
if (isReceiving) {
***************
*** 95,99 ****
// calculate payload size. We don't send the crc field.
txLength = msg->length + (MSG_DATA_SIZE - DATA_LENGTH - 2);
! return call RadioSend.send((uint8_t*)msg, txLength, 0, FALSE);
}
}
--- 127,140 ----
// calculate payload size. We don't send the crc field.
txLength = msg->length + (MSG_DATA_SIZE - DATA_LENGTH - 2);
! //return call RadioSend.send((uint8_t*)msg, txLength, 0, FALSE);
!
! call RadioSend.prepareData(myTestFrame, myTestFrameLength, TRUE, STREAM_MODE);
!
! //call RadioSend.ccaSend(2);
! startTime = call Time.getTimerCounter();
! call RadioSend.send();
! diffTime = call Time.getTimerCounter()-startTime;
! DBG_STRINT("Operation time:",diffTime,4);
! return SUCCESS;
}
}
***************
*** 103,106 ****
--- 144,148 ----
signal Send.sendDone((TOS_MsgPtr)packet, status);
// Enable receiver.
+
/*if (FAIL == call RadioRecv.enableReceiver(0)) {
DBG_STR("Failed to enable receiver",2);
***************
*** 122,130 ****
uint8_t valid;
isReceiving = FALSE;
!
#if DBG_LEVEL > 0
if (crc) {
! bool errorHandled = FALSE;
// Adjust packet length in correct packet.
if (!TEST_MODE) {
--- 164,174 ----
uint8_t valid;
isReceiving = FALSE;
! DBG_STR("Packet received!",1);
! DBG_DUMP(packet, length, 4);
#if DBG_LEVEL > 0
if (crc) {
! DBG_STR("CRC Good!",1);
! /* bool errorHandled = FALSE;
// Adjust packet length in correct packet.
if (!TEST_MODE) {
***************
*** 134,138 ****
//uint8_t tstPacket[3] = {0x02,0x00,0x6A};
if (length & 1) {
! uint16_t newCrc = crc16(correct, length);
/* if (((uint8_t*)&(newCrc))[0] != packet[length]) {
DBG_STR("Error in first CRC byte!",3);
--- 178,182 ----
//uint8_t tstPacket[3] = {0x02,0x00,0x6A};
if (length & 1) {
! uint16_t newCrc = crc16(correct, length);*/
/* if (((uint8_t*)&(newCrc))[0] != packet[length]) {
DBG_STR("Error in first CRC byte!",3);
***************
*** 142,146 ****
DBG_INT(packet[length],3);
}*/
! if (correct[length-1] != packet[length-1]) {
errorLastCount++;
DBG_STR("Error in last byte!",3);
--- 186,190 ----
DBG_INT(packet[length],3);
}*/
! /*if (correct[length-1] != packet[length-1]) {
errorLastCount++;
DBG_STR("Error in last byte!",3);
***************
*** 168,179 ****
DBG_INT(packet[i],3);
}*/
! DBG_STR("Bytes:",3);
DBG_INT(packet[errPos],3);
DBG_INT(correct[errPos],3);
! } /*else {
DBG_STR("Packet received correctly!",3);
DBG_INT(length,3);
}*/
! if (recvCount%500 == 0) {
DBG_STR("Number of packets received:",3);
DBG_INT(recvCount,3);
--- 212,223 ----
DBG_INT(packet[i],3);
}*/
! /*DBG_STR("Bytes:",3);
DBG_INT(packet[errPos],3);
DBG_INT(correct[errPos],3);
! }*/ /*else {
DBG_STR("Packet received correctly!",3);
DBG_INT(length,3);
}*/
! /*if (recvCount%500 == 0) {
DBG_STR("Number of packets received:",3);
DBG_INT(recvCount,3);
***************
*** 182,186 ****
DBG_STR("Number of odd length packets with error in last byte:",3);
DBG_INT(errorLastCount,3);
! }
}/* else {
DBG_STR("CRC error!",3);
--- 226,230 ----
DBG_STR("Number of odd length packets with error in last byte:",3);
DBG_INT(errorLastCount,3);
! }*/
}/* else {
DBG_STR("CRC error!",3);
***************
*** 196,213 ****
}
! event void RadioRecv.timeout(uint8_t *packet)
! {
! DBG_STR("Receive was aborted due to timeout!",2);
! // Receive was timed out.
! }
!
! async event result_t ConsoleIn.get(uint8_t uartData)
{
! #if DBG_LEVEL > 0
! atomic console_data = (char)uartData;
! post handleGet();
! #endif
! return SUCCESS;
!
}
--- 240,246 ----
}
! task void rxOnTask()
{
! call RadioRecv.enableReceiver();
}
***************
*** 221,244 ****
txLength = txBufPtr->length + (MSG_DATA_SIZE - DATA_LENGTH - 2);
call RadioRecv.disableReceiver();
! call RadioSend.send((uint8_t*)txBufPtr, txLength, 0, FALSE);
}
}
- #if DBG_LEVEL > 0
- task void handleGet()
- {
- char console_transmit;
- atomic console_transmit = console_data;
- if (console_transmit == 's') {
- DBG_STR("Number of packets received:",3);
- DBG_INT(recvCount,3);
- DBG_STR("Number of packets with errors:",3);
- DBG_INT(errorCount,3);
- DBG_STR("Number of odd length packets with error in last byte:",3);
- DBG_INT(errorLastCount,3);
- }
- }
- #endif
-
uint16_t crc16(uint8_t* buf, uint8_t len)
{
--- 254,261 ----
txLength = txBufPtr->length + (MSG_DATA_SIZE - DATA_LENGTH - 2);
call RadioRecv.disableReceiver();
! // call RadioSend.send((uint8_t*)txBufPtr, txLength);
}
}
uint16_t crc16(uint8_t* buf, uint8_t len)
{
Index: mc13192InterruptM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192InterruptM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mc13192InterruptM.nc 3 Mar 2006 18:07:17 -0000 1.3
--- mc13192InterruptM.nc 23 Aug 2006 09:34:03 -0000 1.4
***************
*** 1,12 ****
module mc13192InterruptM {
! provides {
interface mc13192DataInterrupt as Data;
interface mc13192ControlInterrupt as Control;
interface mc13192TimerInterrupt as Timer;
}
! uses {
interface FastSPI as SPI;
- interface mc13192State as State;
interface Debug;
}
--- 1,42 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
module mc13192InterruptM {
! provides
! {
interface mc13192DataInterrupt as Data;
interface mc13192ControlInterrupt as Control;
interface mc13192TimerInterrupt as Timer;
}
! uses
! {
interface FastSPI as SPI;
interface Debug;
}
***************
*** 14,18 ****
implementation
{
! #define DBG_LEVEL 0
#include "Debug.h"
--- 44,48 ----
implementation
{
! #define DBG_LEVEL 1
#include "Debug.h"
***************
*** 33,37 ****
async command void Data.enableStreamMode() {
! streamMode = TRUE;
}
--- 63,72 ----
async command void Data.enableStreamMode() {
! atomic streamMode = TRUE;
! }
!
! async command void Data.disableStreamMode()
! {
! atomic streamMode = FALSE;
}
***************
*** 49,53 ****
if (fastAction) {
-
// The fastAction event disables fastaction
// when done receiving/transmitting.
--- 84,87 ----
***************
*** 118,122 ****
//DEASSERT_CE;
TOSH_SET_RADIO_CE_PIN();
!
// If packet RX is done
// In stream mode this is time critical.. This needs to be first.
--- 152,156 ----
//DEASSERT_CE;
TOSH_SET_RADIO_CE_PIN();
! //DBG_STRINT("Status was:",status_content,1);
// If packet RX is done
// In stream mode this is time critical.. This needs to be first.
***************
*** 137,141 ****
// Stream TX takes 17 + 133 + 50 + 173 = 373 bus cycles = 46,6 micro seconds.
if (status_content & TX_IRQ_MASK) {
! if (streamMode) {
// This takes 173 bus cycles to complete.
fastAction = signal Data.fastAction();
--- 171,175 ----
// Stream TX takes 17 + 133 + 50 + 173 = 373 bus cycles = 46,6 micro seconds.
if (status_content & TX_IRQ_MASK) {
! if (streamMode) {
// This takes 173 bus cycles to complete.
fastAction = signal Data.fastAction();
***************
*** 202,205 ****
--- 236,248 ----
// Dunno what this IRQ is. Snatched from Freescale code.
if (status_content & HG_IRQ_MASK) {
+ uint16_t reg,i;
+ //for (i=0x00;i<0x40;i++) {
+ TOSH_CLR_RADIO_CE_PIN();
+ call SPI.fastWriteByte(0x2A|0x80);
+ call SPI.fastReadWord((uint8_t*)®);
+ TOSH_SET_RADIO_CE_PIN();
+ DBG_STRINT("Register 0x2A:",reg,1);
+ //}
+ DBG_STR("Got HG irq!",1);
}
***************
*** 246,250 ****
#endif
! default async event bool Data.fastAction(){return FALSE;}
default async event void Data.dataIndication(bool crc){}
default async event bool Data.streamRead(){return FALSE;}
--- 289,300 ----
#endif
!
! // Default events.
! default async event void Control.resetIndication() {}
! default async event void Control.wakeUpIndication() {}
! default async event void Control.dozeIndication() {}
!
!
! /* default async event bool Data.fastAction(){return FALSE;}
default async event void Data.dataIndication(bool crc){}
default async event bool Data.streamRead(){return FALSE;}
***************
*** 253,257 ****
default async event void Data.strmTxDone(){}
default async event void Data.lockLost(){}
! default async event void Data.ccaDone(bool isClear){}
!
}
--- 303,307 ----
default async event void Data.strmTxDone(){}
default async event void Data.lockLost(){}
! default async event void Data.ccaDone(bool isClear){}*/
!
}
Index: mc13192DataM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192DataM.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mc13192DataM.nc 1 Mar 2006 12:59:10 -0000 1.7
--- mc13192DataM.nc 23 Aug 2006 09:34:03 -0000 1.8
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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,
[...1279 lines suppressed...]
! } else {
! DBG_STR("Invalid destination address2!",4);
! return FALSE;
! }
! }
! }
!
! bool srcPanFilter(uint8_t *data)
! {
! // Read PANId for short address.
! uint8_t *myPan = data-1;
! if ((myPan[0] == filterValue[0] && myPan[1] == filterValue[1])) {
! filterWord = dummyFilter;
! return TRUE;
! }
! DBG_STR("Invalid source PAN Id!",4);
! return FALSE;
}
+
}
Index: mc13192StateM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192StateM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mc13192StateM.nc 16 Jan 2006 18:43:17 -0000 1.1
--- mc13192StateM.nc 23 Aug 2006 09:34:03 -0000 1.2
***************
*** 1,19 ****
module mc13192StateM {
! provides {
interface mc13192State as State;
}
! uses {
interface mc13192Regs as Regs;
! interface Leds;
! interface ConsoleOutput as ConsoleOut;
}
}
implementation
{
// Global transceiver mode mirror
uint16_t rxtxMode;
uint16_t irqMask = 0;
- bool eventTrigOp = FALSE;
// Forward declarations
--- 1,52 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
module mc13192StateM {
! provides
! {
interface mc13192State as State;
}
! uses
! {
interface mc13192Regs as Regs;
! interface mc13192EventTimer as EventTimer;
! interface Debug;
}
}
implementation
{
+ #define DBG_LEVEL 1
+ #include "Debug.h"
+
// Global transceiver mode mirror
uint16_t rxtxMode;
uint16_t irqMask = 0;
// Forward declarations
***************
*** 21,37 ****
void enableLowerIRQs();
void disableLowerIRQs();
!
! command result_t State.setEventTrigger()
! {
! atomic eventTrigOp = TRUE;
! return SUCCESS;
! }
!
! command result_t State.clearEventTrigger()
! {
! atomic eventTrigOp = FALSE;
! return SUCCESS;
! }
!
async command uint16_t State.getRXTXStateMirror()
{
--- 54,58 ----
void enableLowerIRQs();
void disableLowerIRQs();
!
async command uint16_t State.getRXTXStateMirror()
{
***************
*** 68,72 ****
//DISABLE_PA_CTRL;
// Clear timer trigger.
! eventTrigOp = FALSE;
setRXTXMode(IDLE_MODE);
return SUCCESS;
--- 89,93 ----
//DISABLE_PA_CTRL;
// Clear timer trigger.
! call EventTimer.clear();
setRXTXMode(IDLE_MODE);
return SUCCESS;
***************
*** 135,139 ****
TOSH_SET_RADIO_ANT_CTRL_PIN();
//ENABLE_TX_ANTENNA;
! setRXTXMode(TX_STRM_MODE);
//ASSERT_RXTXEN;
TOSH_SET_RADIO_RXTXEN_PIN();
--- 156,160 ----
TOSH_SET_RADIO_ANT_CTRL_PIN();
//ENABLE_TX_ANTENNA;
! setRXTXMode(TX_MODE);
//ASSERT_RXTXEN;
TOSH_SET_RADIO_RXTXEN_PIN();
***************
*** 182,186 ****
atomic {
rxtxMode = mode;
! if (eventTrigOp) mode |= 0x0080;
call Regs.write(CONTROL_A, mode);
}
--- 203,207 ----
atomic {
rxtxMode = mode;
! if (call EventTimer.isSet()) mode |= 0x0080;
call Regs.write(CONTROL_A, mode);
}
Index: mc13192Ieee802154M.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192Ieee802154M.nc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** mc13192Ieee802154M.nc 3 Mar 2006 18:07:17 -0000 1.10
--- mc13192Ieee802154M.nc 23 Aug 2006 09:34:03 -0000 1.11
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
+
#define MAC_ADDR_LOCATION 0xFDB6
#include "mc13192Const.h"
Index: mc13192RawRadioC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192RawRadioC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mc13192RawRadioC.nc 19 Jan 2006 16:18:32 -0000 1.2
--- mc13192RawRadioC.nc 23 Aug 2006 09:34:03 -0000 1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
+
includes mc13192Const;
Index: mc13192TimerM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192TimerM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mc13192TimerM.nc 16 Jan 2006 18:43:17 -0000 1.1
--- mc13192TimerM.nc 23 Aug 2006 09:34:03 -0000 1.2
***************
*** 1,2 ****
--- 1,31 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
module mc13192TimerM
***************
*** 4,7 ****
--- 33,37 ----
provides {
interface mc13192Timer as Timer[uint8_t timer];
+ interface mc13192EventTimer as EventTimer;
interface StdControl;
}
***************
*** 9,20 ****
interface mc13192TimerInterrupt as Interrupt;
interface mc13192Regs as Regs;
! interface Leds;
! interface ConsoleOutput as ConsoleOut;
}
}
implementation
{
// Global variables.
bool timerFree[NUMTIMERS];
// Forward declarations
--- 39,53 ----
interface mc13192TimerInterrupt as Interrupt;
interface mc13192Regs as Regs;
! interface Debug;
}
}
implementation
{
+ #define DBG_LEVEL 1
+ #include "Debug.h"
+
// Global variables.
bool timerFree[NUMTIMERS];
+ bool eventTimerSet = FALSE;
// Forward declarations
***************
*** 47,50 ****
--- 80,137 ----
}
+ /******************************/
+ /* Event triggering functions */
+ /******************************/
+
+ command bool EventTimer.isSet()
+ {
+ return eventTimerSet;
+ }
+
+ command void EventTimer.clear()
+ {
+ if (eventTimerSet) {
+ disableTimerIRQ(TIMER2);
+ timerFree[TIMER2] = TRUE;
+ eventTimerSet = FALSE;
+ }
+ }
+
+ command result_t EventTimer.programEventTimer(uint32_t commenceTime, uint8_t mode)
+ {
+ uint16_t reg;
+ bool wasFree;
+ // Reserve timer2
+ atomic {
+ wasFree = timerFree[TIMER2];
+ timerFree[TIMER2] = FALSE;
+ }
+ if (!wasFree) {
+ // Fail if timer2 is already in use.
+ DBG_STR("Timer2 was already reserved",2);
+ return FAIL;
+ }
+
+ // Enable timer event trigger.
+ enableTimerIRQ(TIMER2);
+ eventTimerSet = TRUE;
+
+ // Program the right register with the timeout.
+ if (mode == STREAM_MODE) {
+ // Write timeout to tc2_prime
+ call Regs.write(TC2_PRIME, (uint16_t)commenceTime);
+ // Write to tmr_cmp2_dis
+ reg = call Regs.read(TMR_CMP2_A);
+ call Regs.write(TMR_CMP2_A, (reg & 0x7FFF));
+ } else {
+ // Assume packet mode.
+ // Write timeout to tmr_cmp2
+ reg = call Regs.read(TMR_CMP2_A);
+ call Regs.write(TMR_CMP2_A, (reg & 0x7F00) | ((uint16_t)(commenceTime >> 16) & 0x00FF));
+ call Regs.write(TMR_CMP2_B, (uint16_t)commenceTime);
+ }
+ return SUCCESS;
+ }
+
async command result_t Timer.start[uint8_t timer](uint32_t interval)
{
***************
*** 74,78 ****
getTimerAddr(timer, &hiAddr, &loAddr);
call Regs.write(hiAddr, 0x8000);
! call Regs.write(loAddr, 0x0000);
return SUCCESS;
}
--- 161,166 ----
getTimerAddr(timer, &hiAddr, &loAddr);
call Regs.write(hiAddr, 0x8000);
! //call Regs.write(loAddr, 0x0000);
!
return SUCCESS;
}
***************
*** 103,107 ****
if (free) {
// enable timer interrupt.
! //enableTimerIRQ(timer);
return SUCCESS;
}
--- 191,195 ----
if (free) {
// enable timer interrupt.
! enableTimerIRQ(timer);
return SUCCESS;
}
***************
*** 114,118 ****
if (timer < NUMTIMERS) {
atomic timerFree[timer] = TRUE;
! //disableTimerIRQ(timer);
}
}
--- 202,206 ----
if (timer < NUMTIMERS) {
atomic timerFree[timer] = TRUE;
! disableTimerIRQ(timer);
}
}
***************
*** 126,131 ****
{
if (timer < NUMTIMERS) {
! signal Timer.fired[timer]();
! call Timer.stop[timer]();
return SUCCESS;
}
--- 214,226 ----
{
if (timer < NUMTIMERS) {
! if (timer == TIMER2 && eventTimerSet) {
! // Operation about to commence.
! // We don't need our timer any more.
! disableTimerIRQ(TIMER2);
! timerFree[TIMER2] = TRUE;
! } else {
! call Timer.stop[timer]();
! signal Timer.fired[timer]();
! }
return SUCCESS;
}
Index: mc13192TimerCounterM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192TimerCounterM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mc13192TimerCounterM.nc 16 Jan 2006 18:43:17 -0000 1.1
--- mc13192TimerCounterM.nc 23 Aug 2006 09:34:03 -0000 1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
+
module mc13192TimerCounterM {
provides {
Index: mc13192Ieee802154RadioC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/mc13192Ieee802154RadioC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** mc13192Ieee802154RadioC.nc 1 Mar 2006 12:59:11 -0000 1.4
--- mc13192Ieee802154RadioC.nc 23 Aug 2006 09:34:03 -0000 1.5
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+ * 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 University of Copenhagen 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.
+ */
+
+ /*
+ @author Jan Flora <janflora at diku.dk>
+ */
+
includes mc13192Const;
includes endianconv;
- Previous message: [Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/diku/evb13192/tos/chips/mc13192/ieee802154/phy
mc13192PhyInterrupt.nc, NONE, 1.1 mc13192PhyInterruptM.nc,
NONE, 1.1 PhyAttributes.h, NONE, 1.1 mc13192PhyTimer.nc, NONE,
1.1 mc13192PhyInitM.nc, NONE, 1.1 mc13192Filters.h, NONE,
1.1 mc13192PhyDriverC.nc, NONE, 1.1 mc13192Registers.h, NONE,
1.1 mc13192PhyDriverConst.h, NONE, 1.1 mc13192PhyTimerM.nc,
NONE, 1.1 mc13192PhyDriverM.nc, NONE, 1.1
- Next message: [Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/diku/evb13192/tools/make
dig528.target, 1.6, 1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-contrib-commits
mailing list