More reliably chipcon.
[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 #include <signal.h>
10 #include <io.h>
11 #include <iomacros.h>
12
13
14 //Use P3 instead of P5 for target I/O on chips without P5.
15 #ifndef __MSP430_HAS_PORT5__
16 #ifndef __MSP430_HAS_PORT5_R__
17 #warning "No P5, using P3 instead.  Will break 2618 and 1612 support."
18 #define P5OUT P3OUT
19 #define P5DIR P3DIR
20 #define P5REN P3REN
21 #define P5IN P3IN
22
23 #endif
24 #endif
25
26 //Use false P5REN for 1612.
27 #ifdef __MSP430_HAS_PORT5__
28 #ifndef __MSP430_HAS_PORT5_R__
29 #warning "1xx, using fake P5REN for external pulling resistors."
30 #define P5REN P5OUT
31 #endif
32 #endif
33
34 unsigned char serial_rx();
35 void serial_tx(unsigned char);
36
37 unsigned char serial1_rx();
38 void serial1_tx(unsigned char);
39
40 void setbaud(unsigned char);
41 void setbaud1(unsigned char);
42
43 //! Initialize the UART
44 void msp430_init_uart();
45 //! Initialize the DCO Clock
46 void msp430_init_dco();
47
48 //LED on P1.0
49 #define PLEDOUT P1OUT
50 #define PLEDDIR P1DIR
51 #define PLEDPIN 0x1
52