-
Notifications
You must be signed in to change notification settings - Fork 6
/
serial_conf.h
83 lines (68 loc) · 2.98 KB
/
serial_conf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/******************************************************************************
* "serial_conf.h" used in the embedded version of "printf" function
*
* author: Haroldo Amaral - agaelema@globo.com
* v0.4 - 2017/08/26
******************************************************************************
* log: . Modify initial version
* + more defines to facilitate the configuration between devices
* + change function "sendbyte" to "serial_sendbyte"
* + add function to configure UART
* + add exp430fr6989 uart back-channel (USCI_UCA1) - P3.4/P3.5
* . change some "#ifdef" to "#if defined ( )"
* + add 9600bps and 115200 at 8MHZ
*
******************************************************************************/
#ifndef _SERIAL_CONF_
#define _SERIAL_CONF_
/******************************************************************************
* list of suported Microcontrollers and their serial USCI
* - uncomment desired device/serial
******************************************************************************/
//#define MSP430G2553_USCI_A0 // P1.1 and P1.2
//#define MSP430FR6989_USCI_A0 // P2.0 and P2.1
#define MSP430FR6989_USCI_A1 // onboard serial - P3.4 and P3.5
/******************************************************************************
* UART source of clock
* - uncomment desired device/serial
******************************************************************************/
//#define LFXT32K
//#define SMCLK_DCO_1MHZ
#define SMCLK_DCO_8MHZ
/******************************************************************************
* list of supported baudrates
* - uncomment desired baudrate
******************************************************************************/
//#define BAUD_9600
#define BAUD_115200 // not working
/******************************************************************************
* Register version or Driverlib version
* - select just one
******************************************************************************/
#define REGISTER_VERSION
//#define DRIVERLIB_VERSION
/******************************************************************************
* Supported microcontrollers
* If you add a new device, do a pull request and help other users
******************************************************************************/
#if defined (MSP430G2553_USCI_A0)
#define MSP430
#define G2553
#define USCI_UCA0
#elif defined (MSP430FR6989_USCI_A0)
#define MSP430
#define FR6989
#define USCI_UCA0
#elif defined (MSP430FR6989_USCI_A1)
#define MSP430
#define FR6989
#define USCI_UCA1
#else
#error "Incorrect or invalid combination"
#endif
/******************************************************************************
* Prototype of functions
******************************************************************************/
void serial_configure(void);
void serial_sendbyte(char byte);
#endif // end of _SERIAL_CONF_