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