updated command line 802.15.4 checksum calculator and added serClose to GoodFET to...
[goodfet] / firmware / include / platform.h
index 16b3e84..a9f9ebc 100644 (file)
@@ -1,46 +1,51 @@
-//! \file platform.h
+/*! \file platform.h
+  \author Travis Goodspeed
+  \brief Port and baud rate definitions.
+  
+  The functions specified here are defined in the platform
+  definition file, such as msp430x1612.c or msp430x2618.c.
+*/
+
+
+#include "gfports.h"
 
 #include <signal.h>
 #include <io.h>
 #include <iomacros.h>
-
-
-//Use P3 instead of P5 for target I/O on chips without P5.
-#ifndef __MSP430_HAS_PORT5__
-#ifndef __MSP430_HAS_PORT5_R__
-#warning "No P5, using P3 instead.  Will break 2618 and 1612 support."
-#define P5OUT P3OUT
-#define P5DIR P3DIR
-#define P5REN P3REN
-#define P5IN P3IN
-
-#endif
+#include <stdint.h>
+
+#include "config.h"
+
+#ifdef telosb
+//TelosB uses second serial port.
+#define serial_tx serial1_tx
+#define serial_rx serial1_rx
+#define setbaud setbaud1
+#define msp430_init_uart msp430_init_uart1
+#else
+//Other targets use first.
+#define serial_tx serial0_tx
+#define serial_rx serial0_rx
+#define setbaud setbaud0
+#define msp430_init_uart msp430_init_uart0
 #endif
 
-//Use false P5REN for 1612.
-#ifdef __MSP430_HAS_PORT5__
-#ifndef __MSP430_HAS_PORT5_R__
-#warning "1xx, using fake P5REN for external pulling resistors."
-#define P5REN P5OUT
-#endif
-#endif
-
-unsigned char serial_rx();
-void serial_tx(unsigned char);
+unsigned char serial0_rx();
+void serial0_tx(unsigned char);
 
 unsigned char serial1_rx();
 void serial1_tx(unsigned char);
 
-void setbaud(unsigned char);
+void setbaud0(unsigned char);
 void setbaud1(unsigned char);
 
 //! Initialize the UART
-void msp430_init_uart();
+void msp430_init_uart0();
+//! Initialize the UART
+void msp430_init_uart1();
+
 //! Initialize the DCO Clock
 void msp430_init_dco();
-
-//LED on P1.0
-#define PLEDOUT P1OUT
-#define PLEDDIR P1DIR
-#define PLEDPIN 0x1
+//! Called by monitor() when the DCO is correct and communication established.
+void msp430_init_dco_done();