[Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/iris/chips/rf230 RadioAlarm.h, NONE, 1.1 HplRF230.h, 1.6, 1.7 HplRF230C.nc, 1.7, 1.8 HplRF230P.nc, 1.2, 1.3

Miklos Maroti mmaroti at users.sourceforge.net
Sun Mar 8 15:03:18 PDT 2009


Update of /cvsroot/tinyos/tinyos-2.x/tos/platforms/iris/chips/rf230
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9247

Modified Files:
	HplRF230.h HplRF230C.nc HplRF230P.nc 
Added Files:
	RadioAlarm.h 
Log Message:
Prepare to support the RF212 chip (reorganization of timer and HPL constants)

--- NEW FILE: RadioAlarm.h ---
/*
 * Copyright (c) 2007, Vanderbilt University
 * 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 VANDERBILT UNIVERSITY 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 VANDERBILT
 * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE VANDERBILT UNIVERSITY 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 VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Author: Miklos Maroti
 */

#ifndef __RADIOALARM_H__
#define __RADIOALARM_H__

#include <MicaTimer.h>

/**
 * This is the timer type of the radio alarm interface
 */
typedef TOne TRadio;

/**
 * The number of radio alarm ticks per one microsecond (0.9216). We use integers 
 * and no  parentheses just to make deputy happy.
 */
#define RADIO_ALARM_MICROSEC	(7372800UL / MHZ / 32) * (1 << MICA_DIVIDE_ONE_FOR_32KHZ_LOG2) / 1000000UL

#endif//__RADIOALARM_H__

Index: HplRF230.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/iris/chips/rf230/HplRF230.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** HplRF230.h	22 Jan 2009 20:05:03 -0000	1.6
--- HplRF230.h	8 Mar 2009 22:03:15 -0000	1.7
***************
*** 26,29 ****
--- 26,30 ----
  
  #include <RF230.h>
+ #include <util/crc16.h>
  
  enum
***************
*** 48,67 ****
  };
  
- /**
-  * This is the timer type of the RF230 alarm interface
-  */
- typedef TOne TRadio;
- 
- 
- /**
-  * The number of alarm ticks per one second (921600)
-  */
- #define RF230_ALARM_SEC	((7372800UL / MHZ / 32) * (1 << MICA_DIVIDE_ONE_FOR_32KHZ_LOG2))
- 
- /**
-  * The number of alarm ticks per one microsecond (0.9216)
-  */
- #define RF230_ALARM_MICROSEC	(RF230_ALARM_SEC / 1000000.0)
- 
  /* This is the default value of the TX_PWR field of the PHY_TX_PWR register. */
  #ifndef RF230_DEF_RFPOWER
--- 49,52 ----
***************
*** 74,76 ****
--- 59,67 ----
  #endif
  
+ // TODO: Check why the default crcByte implementation is in a different endianness
+ inline uint16_t RF230_CRCBYTE_COMMAND(uint16_t crc, uint8_t data)
+ {
+ 	return _crc_ccitt_update(crc, data);
+ }
+ 
  #endif//__HPLRF230_H__

Index: HplRF230C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/iris/chips/rf230/HplRF230C.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** HplRF230C.nc	6 Mar 2009 13:11:37 -0000	1.7
--- HplRF230C.nc	8 Mar 2009 22:03:15 -0000	1.8
***************
*** 37,42 ****
  		interface GpioCapture as IRQ;
  		interface Alarm<TRadio, uint16_t> as Alarm;
- 
- 		interface HplRF230;
  	}
  }
--- 37,40 ----
***************
*** 53,57 ****
  	SpiResource = SpiC.Resource[unique("Atm128SpiC.Resource")];
  
- 	HplRF230 = HplRF230P;
  	FastSpiByte = HplRF230P;
  
--- 51,54 ----

Index: HplRF230P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/iris/chips/rf230/HplRF230P.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HplRF230P.nc	6 Mar 2009 13:11:37 -0000	1.2
--- HplRF230P.nc	8 Mar 2009 22:03:15 -0000	1.3
***************
*** 33,37 ****
  
  		interface FastSpiByte;
- 		interface HplRF230;
  	}
  
--- 33,36 ----
***************
*** 87,96 ****
  	}
  
- 	// TODO: Check why the default crcByte implementation is in a different endianness
- 	inline async command uint16_t HplRF230.crcByte(uint16_t crc, uint8_t data)
- 	{
- 		return _crc_ccitt_update(crc, data);
- 	}
- 
  	inline async command void FastSpiByte.splitWrite(uint8_t data)
  	{
--- 86,89 ----



More information about the Tinyos-2-commits mailing list