Add UART1 read function to get GNSS data
This commit is contained in:
		
							parent
							
								
									e52ff2bad3
								
							
						
					
					
						commit
						e5b64e746e
					
				
							
								
								
									
										6
									
								
								main.c
								
								
								
								
							
							
						
						
									
										6
									
								
								main.c
								
								
								
								
							| 
						 | 
					@ -39,3 +39,9 @@ void GPIO_PORT_B_init(void)
 | 
				
			||||||
    UART1_CTL_R |= 0x301;                     // Enable UART1, RX, and TX
 | 
					    UART1_CTL_R |= 0x301;                     // Enable UART1, RX, and TX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					char UART1_READ(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    while (UART1_FR_R & 0x10);                // Wait until RX FIFO is not empty
 | 
				
			||||||
 | 
					    return (char)UART1_DR_R;                  // Return received data
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue