Python 3.2 for the rewritten Facedancer clients.
[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 <msp430.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  #if defined telosb || defined apimote
32   void led2_on();
33   void led2_off();
34   void led3_on();
35   void led3_off();
36  #endif
37 #endif
38
39 #include "config.h"
40
41 #ifdef useuart1
42 //TelosB and the ApiMote use the second serial port.
43 #define serial_tx serial1_tx
44 #define serial_rx serial1_rx
45 #define setbaud setbaud1
46 #define msp430_init_uart msp430_init_uart1
47 #else
48 //Other targets use first uart.
49 #define serial_tx serial0_tx
50 #define serial_rx serial0_rx
51 #define setbaud setbaud0
52 #define msp430_init_uart msp430_init_uart0
53 #endif
54
55 unsigned char serial0_rx();
56 void serial0_tx(unsigned char);
57
58 unsigned char serial1_rx();
59 void serial1_tx(unsigned char);
60
61 void setbaud0(unsigned char);
62 void setbaud1(unsigned char);
63
64 //! Initialize the UART
65 void msp430_init_uart0();
66 //! Initialize the UART
67 void msp430_init_uart1();
68
69 //! Initialize the DCO Clock
70 void msp430_init_dco();
71 //! Called by monitor() when the DCO is correct and communication established.
72 void msp430_init_dco_done();
73
74
75 #endif
76