d1efb89559cacc8710de53778278638dfd7935c5
[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 <stdint.h>
13
14 #ifdef MSP430
15 #include <io.h>
16 #include <signal.h>
17 #include <iomacros.h>
18
19 #endif
20
21 #include "config.h"
22
23 #ifdef telosb
24 //TelosB uses second serial port.
25 #define serial_tx serial1_tx
26 #define serial_rx serial1_rx
27 #define setbaud setbaud1
28 #define msp430_init_uart msp430_init_uart1
29 #else
30 //Other targets use first.
31 #define serial_tx serial0_tx
32 #define serial_rx serial0_rx
33 #define setbaud setbaud0
34 #define msp430_init_uart msp430_init_uart0
35 #endif
36
37 unsigned char serial0_rx();
38 void serial0_tx(unsigned char);
39
40 unsigned char serial1_rx();
41 void serial1_tx(unsigned char);
42
43 void setbaud0(unsigned char);
44 void setbaud1(unsigned char);
45
46 //! Initialize the UART
47 void msp430_init_uart0();
48 //! Initialize the UART
49 void msp430_init_uart1();
50
51 //! Initialize the DCO Clock
52 void msp430_init_dco();
53 //! Called by monitor() when the DCO is correct and communication established.
54 void msp430_init_dco_done();
55