int main(void) { uint8_t i; /* Initialize system */ SystemInit(); /* Delay init */ TM_DELAY_Init(); /* Initialize GPS on 115200 baudrate */ TM_GPS_Init(&GPS_Data, 115200); /* Initialize USART2 for debug */ /* TX = PA2 */ TM_USART_Init(USART2, TM_USART_PinsPack_1, 115200); /* Register custom GPGxx statements */ /* $GPRMC statement, term number 7 = Speed over ground in knots */ GPRMC = TM_GPS_AddCustom(&GPS_Data, "$GPRMC", 7); /* $GPGLL statement, term number 1 = Current latitude */ GPGLL = TM_GPS_AddCustom(&GPS_Data, "$GPGLL", 1); /* $GPGSA statement, term number 1 = M = Manual, forced to operate in 2D or 3D A=Automatic, 3D/2D */ GPGSA = TM_GPS_AddCustom(&GPS_Data, "$GPGSA", 1); /* Add here more custom tags you want */ /* ... */ /* Reset counter */ TM_DELAY_SetTime(0); while (1) { /* Update GPR data */ /* Call this as faster as possible */ result = TM_GPS_Update(&GPS_Data); /* If we have any unread data */ if (result == TM_GPS_Result_NewData) { /* We received new packet of useful data from GPS */ current = TM_GPS_Result_NewData; /* Is GPS signal valid? */ if (GPS_Data.Validity) { /* If you want to make a GPS tracker, now is the time to save your data on SD card */ /* We have valid GPS signal */ printf("New received data have valid GPS signal\n"); printf("---------------------------------------\n"); /* We have all data from GPS_Data structure valid, you can do here what you want */ /* We will in this example show only custom data to user */ /* Print custom statements */ printf("Custom statements defined by user:\n"); /* Go through all custom statements */ for (i = 0; i < GPS_Data.CustomStatementsCount; i++) { printf(" - Statement: %s; TermNumber: %d; Value: %s\n", GPS_Data.CustomStatements[i]->Statement, /*!< Statement value */ GPS_Data.CustomStatements[i]->TermNumber, /*!< Term number */ GPS_Data.CustomStatements[i]->Value /*!< Value from GPS receiver */ ); } /* You can do it this way too for all your custom statements separatelly */ printf(" - Statement2: %s; TermNumber: %d; Value: %s\n", GPRMC->Statement, GPRMC->TermNumber, GPRMC->Value ); printf("---------------------------------------\n"); } else { /* GPS signal is not valid */ printf("New received data haven't valid GPS signal!\n"); } } else if (result == TM_GPS_Result_FirstDataWaiting && current != TM_GPS_Result_FirstDataWaiting) { current = TM_GPS_Result_FirstDataWaiting; printf("Waiting first data from GPS!\n"); } else if (result == TM_GPS_Result_OldData && current != TM_GPS_Result_OldData) { current = TM_GPS_Result_OldData; /* We already read data, nothing new was received from GPS */ } } }
int main(void) { /* Variables used */ TM_GPS_Data_t GPS_Data; TM_GPS_Result_t result, current; TM_GPS_Float_t GPS_Float; TM_GPS_Distance_t GPS_Distance; char buffer[40]; uint8_t i; float temp; /* Initialize system */ SystemInit(); /* Delay init */ TM_DELAY_Init(); /* Initialize GPS on 115200 baudrate */ TM_GPS_Init(&GPS_Data, 115200); /* Initialize USART3 for debug */ /* TX = PB10 */ TM_USART_Init(USART3, TM_USART_PinsPack_1, 115200); /* Version 1.1 added */ /* Set two test coordinates */ GPS_Distance.Latitude1 = 48.300215; GPS_Distance.Longitude1 = -122.285903; GPS_Distance.Latitude2 = 45.907813; GPS_Distance.Longitude2 = 56.659407; /* Calculate distance and bearing between 2 pointes */ TM_GPS_DistanceBetween(&GPS_Distance); /* Convert float number */ TM_GPS_ConvertFloat(GPS_Distance.Distance, &GPS_Float, 6); sprintf(buffer, "Distance is: %d.%06d meters\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); TM_GPS_ConvertFloat(GPS_Distance.Bearing, &GPS_Float, 6); sprintf(buffer, "Bearing is: %d.%06d degrees\n\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); /* Reset counter */ TM_DELAY_SetTime(0); while (1) { /* Update GPR data */ /* Call this as faster as possible */ result = TM_GPS_Update(&GPS_Data); /* If we didn't receive any useful data in the start */ if (result == TM_GPS_Result_FirstDataWaiting && TM_DELAY_Time() > 3000000) { /* If we didn't receive nothing within 3 seconds */ TM_DELAY_SetTime(0); /* Display data on USART */ TM_USART_Puts(USART3, "\nNothing received after 3 seconds. Is your GPS connected and baudrate set correct?\n"); TM_USART_Puts(USART3, "Most GPS receivers has by default 9600 baudrate and 1Hz refresh rate. Check your settings!\n\n"); } /* If we have any unread data */ if (result == TM_GPS_Result_NewData) { /* We received new packet of useful data from GPS */ current = TM_GPS_Result_NewData; /* Is GPS signal valid? */ if (GPS_Data.Validity) { /* If you want to make a GPS tracker, not is the time to save your data on SD card */ /* We have valid GPS signal */ TM_USART_Puts(USART3, "New received data have valid GPS signal\n"); TM_USART_Puts(USART3, "---------------------------------------\n"); #ifndef GPS_DISABLE_GPGGA /* GPGGA data */ TM_USART_Puts(USART3, "GPGGA statement:\n"); /* Latitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Latitude, &GPS_Float, 6); sprintf(buffer, " - Latitude: %d.%d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); /* Longitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Longitude, &GPS_Float, 6); sprintf(buffer, " - Longitude: %d.%d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); /* Satellites in use */ sprintf(buffer, " - Sats in use: %02d\n", GPS_Data.Satellites); TM_USART_Puts(USART3, buffer); /* Current time */ sprintf(buffer, " - UTC Time: %02d.%02d.%02d:%02d\n", GPS_Data.Time.Hours, GPS_Data.Time.Minutes, GPS_Data.Time.Seconds, GPS_Data.Time.Hundredths); TM_USART_Puts(USART3, buffer); /* Fix: 0 = invalid, 1 = GPS, 2 = DGPS */ sprintf(buffer, " - Fix: %d\n", GPS_Data.Fix); TM_USART_Puts(USART3, buffer); /* Altitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Altitude, &GPS_Float, 6); sprintf(buffer, " - Altitude: %3d.%06d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); #endif #ifndef GPS_DISABLE_GPRMC /* GPRMC data */ TM_USART_Puts(USART3, "GPRMC statement:\n"); /* Current date */ sprintf(buffer, " - Date: %02d.%02d.%04d\n", GPS_Data.Date.Date, GPS_Data.Date.Month, GPS_Data.Date.Year + 2000); TM_USART_Puts(USART3, buffer); /* Current speed in knots */ TM_GPS_ConvertFloat(GPS_Data.Speed, &GPS_Float, 6); sprintf(buffer, " - Speed in knots: %d.%06d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); /* Current speed in km/h */ temp = TM_GPS_ConvertSpeed(GPS_Data.Speed, TM_GPS_Speed_KilometerPerHour); TM_GPS_ConvertFloat(temp, &GPS_Float, 6); sprintf(buffer, " - Speed in km/h: %d.%06d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); TM_GPS_ConvertFloat(GPS_Data.Direction, &GPS_Float, 3); sprintf(buffer, " - Direction: %3d.%03d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); #endif #ifndef GPS_DISABLE_GPGSA /* GPGSA data */ TM_USART_Puts(USART3, "GPGSA statement:\n"); /* Horizontal dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.HDOP, &GPS_Float, 2); sprintf(buffer, " - HDOP: %2d.%02d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); /* Vertical dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.VDOP, &GPS_Float, 2); sprintf(buffer, " - VDOP: %2d.%02d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); /* Position dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.PDOP, &GPS_Float, 2); sprintf(buffer, " - PDOP: %2d.%02d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_USART_Puts(USART3, buffer); /* Current fix mode in use */ sprintf(buffer, " - Fix mode: %d\n", GPS_Data.FixMode); TM_USART_Puts(USART3, buffer); /* Display IDs of satellites in use */ TM_USART_Puts(USART3, "- ID's of used satellites: "); for (i = 0; i < GPS_Data.Satellites; i++) { if (i < (GPS_Data.Satellites - 1)) { sprintf(buffer, "%d,", GPS_Data.SatelliteIDs[i]); } else { sprintf(buffer, "%d\n", GPS_Data.SatelliteIDs[i]); } TM_USART_Puts(USART3, buffer); } #endif #ifndef GPS_DISABLE_GPGSV /* GPGSV data */ TM_USART_Puts(USART3, "GPGSV statement:\n"); /* Satellites in view */ sprintf(buffer, " - Satellites in view: %d\n", GPS_Data.SatellitesInView); TM_USART_Puts(USART3, buffer); #endif TM_USART_Puts(USART3, "---------------------------------------\n"); } else { /* GPS signal is not valid */ TM_USART_Puts(USART3, "New received data haven't valid GPS signal!\n"); } } else if (result == TM_GPS_Result_FirstDataWaiting && current != TM_GPS_Result_FirstDataWaiting) { current = TM_GPS_Result_FirstDataWaiting; TM_USART_Puts(USART3, "Waiting first data from GPS!\n"); } else if (result == TM_GPS_Result_OldData && current != TM_GPS_Result_OldData) { current = TM_GPS_Result_OldData; /* We already read data, nothing new was received from GPS */ } } }
int main(void) { uint8_t i; float temp; /* Initialize system */ SystemInit(); /* Delay init */ TM_DELAY_Init(); /* Initialize GPS on 115200 baudrate */ TM_GPS_Init(&GPS_Data, 115200); /* Initialize USART2 for debug */ /* TX = PA2 */ TM_USART_Init(USART2, TM_USART_PinsPack_1, 115200); /* Version 1.1 added */ /* Set two test coordinates */ GPS_Distance.Latitude1 = 48.300215; GPS_Distance.Longitude1 = -122.285903; GPS_Distance.Latitude2 = 45.907813; GPS_Distance.Longitude2 = 56.659407; /* Calculate distance and bearing between 2 points */ TM_GPS_DistanceBetween(&GPS_Distance); /* Convert float number */ TM_GPS_ConvertFloat(GPS_Distance.Distance, &GPS_Float, 6); printf("Distance is: %d.%06d meters\n", GPS_Float.Integer, GPS_Float.Decimal); TM_GPS_ConvertFloat(GPS_Distance.Bearing, &GPS_Float, 6); printf("Bearing is: %d.%06d degrees\n\n", GPS_Float.Integer, GPS_Float.Decimal); /* Reset counter */ TM_DELAY_SetTime(0); while (1) { /* Update GPR data */ /* Call this as faster as possible */ result = TM_GPS_Update(&GPS_Data); /* If we have any unread data */ if (result == TM_GPS_Result_NewData) { /* We received new packet of useful data from GPS */ current = TM_GPS_Result_NewData; /* Is GPS signal valid? */ if (GPS_Data.Validity) { /* If you want to make a GPS tracker, now is the time to save your data on SD card */ /* We have valid GPS signal */ printf("New received data have valid GPS signal\n"); printf("---------------------------------------\n"); #ifndef GPS_DISABLE_GPGGA /* GPGGA data */ printf("GPGGA statement:\n"); /* Latitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Latitude, &GPS_Float, 6); printf(" - Latitude: %d.%d\n", GPS_Float.Integer, GPS_Float.Decimal); /* Longitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Longitude, &GPS_Float, 6); printf(" - Longitude: %d.%d\n", GPS_Float.Integer, GPS_Float.Decimal); /* Satellites in use */ printf(" - Sats in use: %02d\n", GPS_Data.Satellites); /* Current time */ printf(" - UTC Time: %02d.%02d.%02d:%02d\n", GPS_Data.Time.Hours, GPS_Data.Time.Minutes, GPS_Data.Time.Seconds, GPS_Data.Time.Hundredths); /* Fix: 0 = invalid, 1 = GPS, 2 = DGPS */ printf(" - Fix: %d\n", GPS_Data.Fix); /* Altitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Altitude, &GPS_Float, 6); printf(" - Altitude: %3d.%06d\n", GPS_Float.Integer, GPS_Float.Decimal); #endif #ifndef GPS_DISABLE_GPRMC /* GPRMC data */ printf("GPRMC statement:\n"); /* Current date */ printf(" - Date: %02d.%02d.%04d\n", GPS_Data.Date.Date, GPS_Data.Date.Month, GPS_Data.Date.Year + 2000); /* Current speed in knots */ TM_GPS_ConvertFloat(GPS_Data.Speed, &GPS_Float, 6); printf(" - Speed in knots: %d.%06d\n", GPS_Float.Integer, GPS_Float.Decimal); /* Current speed in km/h */ temp = TM_GPS_ConvertSpeed(GPS_Data.Speed, TM_GPS_Speed_KilometerPerHour); TM_GPS_ConvertFloat(temp, &GPS_Float, 6); printf(" - Speed in km/h: %d.%06d\n", GPS_Float.Integer, GPS_Float.Decimal); TM_GPS_ConvertFloat(GPS_Data.Direction, &GPS_Float, 3); printf(" - Direction: %3d.%03d\n", GPS_Float.Integer, GPS_Float.Decimal); #endif #ifndef GPS_DISABLE_GPGSA /* GPGSA data */ printf("GPGSA statement:\n"); /* Horizontal dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.HDOP, &GPS_Float, 2); printf(" - HDOP: %2d.%02d\n", GPS_Float.Integer, GPS_Float.Decimal); /* Vertical dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.VDOP, &GPS_Float, 2); printf(" - VDOP: %2d.%02d\n", GPS_Float.Integer, GPS_Float.Decimal); /* Position dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.PDOP, &GPS_Float, 2); printf(" - PDOP: %2d.%02d\n", GPS_Float.Integer, GPS_Float.Decimal); /* Current fix mode in use */ printf(" - Fix mode: %d\n", GPS_Data.FixMode); /* Display IDs of satellites in use */ printf(" - ID's of used satellites: "); for (i = 0; i < GPS_Data.Satellites; i++) { printf("%d,", GPS_Data.SatelliteIDs[i]); } printf("\n"); #endif #ifndef GPS_DISABLE_GPGSV /* GPGSV data */ printf("GPGSV statement:\n"); /* Satellites in view */ printf(" - Satellites in view: %d\n", GPS_Data.SatellitesInView); /* Print satellites description */ for (i = 0; i < GPS_Data.SatellitesInView; i++) { printf(" - S: %02d, A: %03d, E: %02d, SNR: %02d\n", GPS_Data.SatDesc[i].ID, GPS_Data.SatDesc[i].Azimuth, GPS_Data.SatDesc[i].Elevation, GPS_Data.SatDesc[i].SNR ); } #endif printf("---------------------------------------\n"); } else { /* GPS signal is not valid */ printf("New received data haven't valid GPS signal!\n"); } } else if (result == TM_GPS_Result_FirstDataWaiting && current != TM_GPS_Result_FirstDataWaiting) { current = TM_GPS_Result_FirstDataWaiting; printf("Waiting first data from GPS!\n"); } else if (result == TM_GPS_Result_OldData && current != TM_GPS_Result_OldData) { current = TM_GPS_Result_OldData; /* We already read data, nothing new was received from GPS */ } } }
int main(void) { /* Variables used */ TM_GPS_Data_t GPS_Data; TM_GPS_Result_t result, current; TM_GPS_Float_t GPS_Float; TM_GPS_Distance_t GPS_Distance; char buffer[40]; uint8_t i; float temp; uint8_t iOff; /* Initialize system */ SystemInit(); /* Delay init */ TM_DELAY_Init(); /* Initialize leds */ TM_DISCO_LedInit(); /* Initialize GPS on 115200 baudrate */ TM_GPS_Init(&GPS_Data, 115200); /* Initialize ili9341 LCD on STM32F429-Discovery board */ TM_ILI9341_Init(); /* Rotate LCD */ TM_ILI9341_Rotate(TM_ILI9341_Orientation_Portrait_2); /* Go to the begginning of LCD */ iOff = 0; /* Version 1.1 added */ /* Set two test coordinates */ /* from Ljubljana */ GPS_Distance.Latitude1 = 46.050513; GPS_Distance.Longitude1 = 14.512873; /* to New York */ GPS_Distance.Latitude2 = 40.711096; GPS_Distance.Longitude2 = -74.007529; /* Display location */ TM_ILI9341_Puts(10, START_Y + 11 * iOff++, "Ljubljana -> New York", &TM_Font_7x10, 0x0000, 0xFFFF); /* Calculate distance and bearing between 2 pointes */ TM_GPS_DistanceBetween(&GPS_Distance); /* Convert float number */ TM_GPS_ConvertFloat(GPS_Distance.Distance, &GPS_Float, 1); sprintf(buffer, " - Distance: %d.%1d meters", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); TM_GPS_ConvertFloat(GPS_Distance.Bearing, &GPS_Float, 3); sprintf(buffer, " - Bearing: %d.%03d degrees", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Delay 5s */ Delayms(5000); /* Clear screen */ TM_ILI9341_Fill(0xFFFF); /* Go to the begginning of LCD */ iOff = 0; /* Reset counter */ TM_DELAY_SetTime(0); while (1) { /* Update GPR data */ /* Call this as faster as possible */ result = TM_GPS_Update(&GPS_Data); /* If we didn't receive any useful data in the start */ if (result == TM_GPS_Result_FirstDataWaiting && TM_DELAY_Time() > 3000) { /* If we didn't receive nothing within 3 seconds */ TM_DELAY_SetTime(0); /* Display data on LCD */ TM_ILI9341_Puts(10, START_Y + 11 * iOff++, "Check your GPS receiver!", &TM_Font_7x10, 0x0000, 0xFFFF); } /* If we have any unread data */ if (result == TM_GPS_Result_NewData) { /* We received new packet of useful data from GPS */ current = TM_GPS_Result_NewData; /* Go to the begginning of LCD */ iOff = 0; /* Is GPS signal valid? */ if (GPS_Data.Validity) { /* If you want to make a GPS tracker, now is the time to save your data on SD card */ /* Toggle GREEN LED */ TM_DISCO_LedToggle(LED_GREEN); /* We have valid GPS signal */ #ifndef GPS_DISABLE_GPGGA /* Latitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Latitude, &GPS_Float, 6); sprintf(buffer, " - Latitude: %d.%d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Longitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Longitude, &GPS_Float, 6); sprintf(buffer, " - Longitude: %d.%d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Satellites in use */ sprintf(buffer, " - Sats in use: %02d", GPS_Data.Satellites); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Current time */ sprintf(buffer, " - UTC Time: %02d.%02d.%02d:%02d", GPS_Data.Time.Hours, GPS_Data.Time.Minutes, GPS_Data.Time.Seconds, GPS_Data.Time.Hundredths); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Fix: 0 = invalid, 1 = GPS, 2 = DGPS */ sprintf(buffer, " - Fix: %d", GPS_Data.Fix); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Altitude */ /* Convert float to integer and decimal part, with 6 decimal places */ TM_GPS_ConvertFloat(GPS_Data.Altitude, &GPS_Float, 6); sprintf(buffer, " - Altitude: %3d.%06d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); #endif #ifndef GPS_DISABLE_GPRMC /* Current date */ sprintf(buffer, " - Date: %02d.%02d.%04d", GPS_Data.Date.Date, GPS_Data.Date.Month, GPS_Data.Date.Year + 2000); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Current speed in knots */ TM_GPS_ConvertFloat(GPS_Data.Speed, &GPS_Float, 6); sprintf(buffer, " - Speed in knots: %2d.%06d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Current speed in km/h */ temp = TM_GPS_ConvertSpeed(GPS_Data.Speed, TM_GPS_Speed_KilometerPerHour); TM_GPS_ConvertFloat(temp, &GPS_Float, 6); sprintf(buffer, " - Speed in km/h: %2d.%06d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); TM_GPS_ConvertFloat(GPS_Data.Direction, &GPS_Float, 3); sprintf(buffer, " - Direction: %3d.%03d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); #endif #ifndef GPS_DISABLE_GPGSA /* Horizontal dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.HDOP, &GPS_Float, 2); sprintf(buffer, " - HDOP: %2d.%02d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Vertical dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.VDOP, &GPS_Float, 2); sprintf(buffer, " - VDOP: %2d.%02d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Position dilution of precision */ TM_GPS_ConvertFloat(GPS_Data.PDOP, &GPS_Float, 2); sprintf(buffer, " - PDOP: %2d.%02d", GPS_Float.Integer, GPS_Float.Decimal); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Current fix mode in use */ sprintf(buffer, " - Fix mode: %d", GPS_Data.FixMode); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); /* Display IDs of satellites in use */ sprintf(buffer, "Sats ids: "); for (i = 0; i < GPS_Data.Satellites; i++) { if (i < (GPS_Data.Satellites - 1)) { sprintf(buffer, "%s%d,", buffer, GPS_Data.SatelliteIDs[i]); } else { sprintf(buffer, "%s%d", buffer, GPS_Data.SatelliteIDs[i]); } } TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); #endif #ifndef GPS_DISABLE_GPGSV /* Satellites in view */ sprintf(buffer, " - Satellites in view: %02d", GPS_Data.SatellitesInView); TM_ILI9341_Puts(10, START_Y + 11 * iOff++, buffer, &TM_Font_7x10, 0x0000, 0xFFFF); #endif } else { /* Clear screen */ if (iOff > 0) { iOff = 0; TM_ILI9341_Fill(0xFFFF); } /* Go to the beginning of LCD */ iOff = 0; /* Toggle RED LED */ TM_DISCO_LedToggle(LED_RED); /* GPS signal is not valid */ TM_ILI9341_Puts(10, START_Y + 11 * iOff, "New received data haven't valid GPS signal!", &TM_Font_7x10, 0x0000, 0xFFFF); } } else if (result == TM_GPS_Result_FirstDataWaiting && current != TM_GPS_Result_FirstDataWaiting) { current = TM_GPS_Result_FirstDataWaiting; TM_ILI9341_Puts(10, START_Y + 11 * iOff++, "Waiting first data from GPS!", &TM_Font_7x10, 0x0000, 0xFFFF); } else if (result == TM_GPS_Result_OldData && current != TM_GPS_Result_OldData) { current = TM_GPS_Result_OldData; /* We already read data, nothing new was received from GPS */ } } }