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