MSPM0_ValvanoWare  1.0
ECE445L starter code
UART.h
Go to the documentation of this file.
1 
32 #ifndef __UART_H__
33 #define __UART_H__
34 // standard ASCII symbols
38 #define CR 0x0D
42 #define LF 0x0A
46 #define BS 0x08
50 #define ESC 0x1B
54 #define SP 0x20
58 #define DEL 0x7F
59 /*
60  * Derived from uart_rw_multibyte_fifo_poll_LP_MSPM0G3507_nortos_ticlang
61  */
62 
63 
77 void UART_Init(void);
78 
85 char UART_InChar(void);
86 
87 
95 
102 void UART_OutChar(char data);
103 
104 
111 void UART_OutString(char *pt);
112 
113 
124 uint32_t UART_InUDec(void);
125 
133 void UART_OutUDec(uint32_t n);
134 
142 void UART_OutSDec(int32_t n);
143 
156 uint32_t UART_InUHex(void);
157 
165 void UART_OutUHex(uint32_t number);
166 
182  void UART_InString(char *bufPt, uint16_t max);
183 
184 
197 void UART_Fix2(long number);
198 //--------------------------UART_Fix3----------------------------
199 // Output a 32-bit number in 0.001 fixed-point format, exactly 5 characters
200 // Input: unsigned 32-bit integer part of fixed point number
201 // >9999 means invalid fixed-point number
202 // Output: none
203 // Fixed format
204 // 1234 to "1.234"
205 // 102 to "0.102"
206 // 31 to "0.031"
207 // 10000 to "*.**"
208 void UART_Fix3(uint32_t number);
209 //********UART_OutUFix1*****************
210 // Output a 16-bit number in unsigned 4-digit fixed point, 0.1 resolution
211 // numbers 0 to 9999 printed as " 0.0" to "999.9"
212 // Inputs: n 16-bit unsigned number
213 // Outputs: none
214 void UART_OutUFix1(uint16_t n);
223 void UART_InitPrintf(void);
224 
225 
226 // initialize UART1 for 115200 baud rate
227 void UART1_Init(void);
228 
229 //------------UART1_InChar------------
230 // Wait for new serial port input
231 // Input: none
232 // Output: ASCII code for key typed
233 char UART1_InChar(void);
234 //------------UART1_OutChar------------
235 // Output 8-bit to serial port
236 // Input: letter is an 8-bit ASCII character to be transferred
237 // Output: none
238 void UART1_OutChar(char data);
239 
240 #endif // __UART_H__
char UART_InChar(void)
input from UART0
uint32_t UART_InUDec(void)
input a number from UART0
void UART_OutUHex(uint32_t number)
output a hex number to UART0
void UART_OutString(char *pt)
output string to UART0
void UART_InString(char *bufPt, uint16_t max)
input a string from UART0
char UART_InCharNonBlock(void)
non blocking input from UART0
void UART_OutChar(char data)
output character to UART0
uint32_t UART_InUHex(void)
input a hex number from UART0
void UART_InitPrintf(void)
Initialize UART0 to use printf.
void UART_OutUDec(uint32_t n)
output a number to UART0
void UART_Init(void)
Initialize UART0.
void UART_Fix2(long number)
Fixed-point output.
void UART_OutSDec(int32_t n)
output a signed number to UART0