A major refactor of the GoodFET firmware build system and apps to give better
[goodfet] / firmware / include / platform.h
1 /*! \file platform.h
2   \author Travis Goodspeed
3   \brief Port and baud rate definitions.
4   
5   The functions specified here are defined in the platform
6   definition file, such as msp430x1612.c or msp430x2618.c.
7 */
8
9
10 #include "gfports.h"
11
12 #include <signal.h>
13 #include <io.h>
14 #include <iomacros.h>
15 #include <stdint.h>
16
17 #include "config.h"
18
19 #ifdef telosb
20 //TelosB uses second serial port.
21 #define serial_tx serial1_tx
22 #define serial_rx serial1_rx
23 #define setbaud setbaud1
24 #define msp430_init_uart msp430_init_uart1
25 #else
26 //Other targets use first.
27 #define serial_tx serial0_tx
28 #define serial_rx serial0_rx
29 #define setbaud setbaud0
30 #define msp430_init_uart msp430_init_uart0
31 #endif
32
33 unsigned char serial0_rx();
34 void serial0_tx(unsigned char);
35
36 unsigned char serial1_rx();
37 void serial1_tx(unsigned char);
38
39 void setbaud0(unsigned char);
40 void setbaud1(unsigned char);
41
42 //! Initialize the UART
43 void msp430_init_uart0();
44 //! Initialize the UART
45 void msp430_init_uart1();
46
47 //! Initialize the DCO Clock
48 void msp430_init_dco();
49 //! Called by monitor() when the DCO is correct and communication established.
50 void msp430_init_dco_done();
51