forked from yousifsamir0/GPS_CSE312_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGPS.h
49 lines (40 loc) · 755 Bytes
/
GPS.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
#ifndef GPS_H
#define GPS_H
// header body...
#include "_TM4C123GH6PM.h"
void UART0_Send(char *string);
void UART1_Send(char *string);
void UART1_readline(char *string);
void GPS_Raw(char *string);
void UART0_Send(char *string){
while (*string)
{
while ((UART0_FR_R & 0x0020) !=0){}
UART0_DR_R= *(string++);
}
}
void UART1_Send(char *string){
while (*string)
{
while ((UART0_FR_R & 0x0020) !=0){}
UART1_DR_R= *(string++);
}
}
void UART1_readline(char *string){
char x;//int i=0;
do {
while(UART1_FR_R&0x010){}
x = (UART1_DR_R & 0xFF);
*(string++)= x;
//if (x=='\n') i++;
}
while(x!='\n');
*(string)='\0';
}
void GPS_Raw(char *string){
do{
UART1_readline(string);
}
while(string[3]!=string[4]);
}
#endif