MSP430™CapTIvateSoftwareLibraryAPIGuide  1_70_00_03
UART.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // UART.h
3 //
5 //
10 //
13 //
14 //*****************************************************************************
15 //*****************************************************************************
18 //*****************************************************************************
19 
20 #ifndef UARTDRIVER_H_
21 #define UARTDRIVER_H_
22 
23 #include "UART_Definitions.h"
24 
25 #if (UART__ENABLE==true)
26 
27 //*****************************************************************************
28 //
31 //
34 //
35 //*****************************************************************************
36 #if (UART__EUSCI_A_PERIPHERAL == EUSCI_A0_BASE)
37 #define UART__EUSCI_VECTOR (USCI_A0_VECTOR)
38 #define UART__EUSCI_IV (UCA0IV)
39 #elif (UART__EUSCI_A_PERIPHERAL == EUSCI_A1_BASE)
40 #define UART__EUSCI_VECTOR (USCI_A1_VECTOR)
41 #define UART__EUSCI_IV (UCA1IV)
42 #else
43 #error INVALID_EUSCI_A_SELECTION
44 #endif
45 
46 //*****************************************************************************
47 //
51 //
52 //*****************************************************************************
53 #define UART__ERROR_MASK (0x60)
54 
55 //*****************************************************************************
56 //
61 //
62 //*****************************************************************************
63 typedef struct
64 {
65  //
70  //
71  bool (*pbReceiveCallback)(uint8_t);
72 
73  //
77  //
78  bool (*pbErrorCallback)(uint8_t);
79 
80  //
83  //
84  EUSCI_A_UART_initParam peripheralParameters;
85 
86 } tUARTPort;
87 
88 //*****************************************************************************
89 //
91 //
92 //*****************************************************************************
97 };
98 
99 //*****************************************************************************
100 //
103 //
104 //*****************************************************************************
108 };
109 
110 //*****************************************************************************
111 //
114 //
120 //
121 //*****************************************************************************
122 extern void UART_openPort(const tUARTPort *pPort);
123 
124 //*****************************************************************************
125 //
127 //
132 //
133 //*****************************************************************************
134 extern void UART_closePort(void);
135 
136 //*****************************************************************************
137 //
140 //
144 //
145 //*****************************************************************************
146 extern uint8_t UART_getPortStatus(void);
147 
148 //*****************************************************************************
149 //
155 //
160 //
161 //*****************************************************************************
162 extern void UART_transmitBuffer(const uint8_t *pBuffer, uint16_t ui16Length);
163 
164 //*****************************************************************************
165 //
169 //
173 //
174 //*****************************************************************************
175 extern void UART_transmitByteImmediately(uint8_t ui8Data);
176 
177 #endif /* UART__ENABLE==true */
178 
179 #endif /* UARTDRIVER_H_ */
180 //*****************************************************************************
183 //*****************************************************************************
Definition: UART.h:94
tUARTErrors
Definition: UART.h:105
Definition: UART.h:95
Definition: UART.h:107
void UART_openPort(const tUARTPort *pPort)
Definition: UART.c:48
uint8_t UART_getPortStatus(void)
Definition: UART.c:76
tUARTStates
enumerates the possible UART driver states.
Definition: UART.h:93
void UART_closePort(void)
This API closes the UART port on the specified HW eUSCI_A peripheral.
Definition: UART.c:70
Definition: UART.h:106
void UART_transmitBuffer(const uint8_t *pBuffer, uint16_t ui16Length)
Definition: UART.c:81
Definition: UART.h:63
EUSCI_A_UART_initParam peripheralParameters
Definition: UART.h:84
Definition: UART.h:96
void UART_transmitByteImmediately(uint8_t ui8Data)
Definition: UART.c:119
© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale