]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc2420/CC2420.h
Fixing T32khz to TMilli conversion - coeficient 32 needs to be changed to 28.1.
[tinyos-2.x.git] / tos / chips / cc2420 / CC2420.h
index 6a9d4f3a14dec1409c597d7b101f431e46a26d17..1d607b921763c87608ea2e6e4266c17359c25901 100644 (file)
 
 typedef uint8_t cc2420_status_t;
 
+#ifndef TFRAMES_ENABLED
+#define CC2420_IFRAME_TYPE
+#endif
+
 /**
  * CC2420 header.  An I-frame (interoperability frame) header has an 
  * extra network byte specified by 6LowPAN
@@ -55,7 +59,10 @@ typedef nx_struct cc2420_header_t {
   nxle_uint8_t network;
 #endif
 
+#ifndef TINYOS_IP
   nxle_uint8_t type;
+#endif
+
 } cc2420_header_t;
   
 /**
@@ -77,7 +84,8 @@ typedef nx_struct cc2420_metadata_t {
   nx_uint8_t tx_power;
   nx_bool crc;
   nx_bool ack;
-  nx_uint16_t time;
+  nx_bool timesync;
+  nx_uint32_t timestamp;
   nx_uint16_t rxInterval;
 
   /** Packet Link Metadata */
@@ -116,10 +124,10 @@ typedef nx_struct cc2420_packet_t {
 #endif
 
 /** 
- * The 6LowPAN ID has yet to be defined for a TinyOS network.
+ * The 6LowPAN NALP ID for a TinyOS network is 63 (TEP 125).
  */
 #ifndef TINYOS_6LOWPAN_NETWORK_ID
-#define TINYOS_6LOWPAN_NETWORK_ID 0x0
+#define TINYOS_6LOWPAN_NETWORK_ID 0x3f
 #endif
 
 
@@ -130,6 +138,8 @@ enum {
   MAC_FOOTER_SIZE = sizeof( uint16_t ),
   // MDU
   MAC_PACKET_SIZE = MAC_HEADER_SIZE + TOSH_DATA_LENGTH + MAC_FOOTER_SIZE,
+
+  CC2420_SIZE = MAC_HEADER_SIZE + MAC_FOOTER_SIZE,
 };
 
 enum cc2420_enums {
@@ -362,4 +372,9 @@ enum cc2420_sfdmux_enums {
   CC2420_SFDMUX_XOSC16M_STABLE = 24,
 };
 
+enum
+{
+  CC2420_INVALID_TIMESTAMP  = 0x80000000L,
+};
+
 #endif