/*
  TinyGPS - a small GPS library for Arduino providing basic NMEA parsing
  Based on work by and "distance_to" courtesy of Maarten Lamers.
  Copyright (C) 2008-2011 Mikal Hart
  All rights reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
#include "stm32f10x.h"
#include "STM32vldiscovery.h"

#ifndef GPS_H
#define GPS_H


//#include "WProgram.h"

#define _GPS_VERSION 10 // software version of this library
#define _GPS_MPH_PER_KNOT 1.15077945
#define _GPS_MPS_PER_KNOT 0.51444444
#define _GPS_KMPH_PER_KNOT 1.852
#define _GPS_MILES_PER_METER 0.00062137112
#define _GPS_KM_PER_METER 0.001
//#define _GPS_NO_STATS

#define false 0
#define true 1
#define bool uint8_t
#define byte uint8_t

    uint8_t parse(char c); // process one character received from GPS

 
 enum {_GPS_SENTENCE_GPGGA, _GPS_SENTENCE_GPRMC,_GPS_SENTENCE_GPVTG, _GPS_SENTENCE_OTHER};

     bool term_complete(void);






	    int from_hex(char a);
    unsigned long parse_decimal(void);
    unsigned long parse_degrees(void);

    bool gpsisdigit(char c);
    long gpsatol(const char *str);
    int gpsstrcmp(const char *str1, const char *str2);

   // lat/long in hundred thousandths of a degree and age of fix in milliseconds
  //    void get_position(long *latitude, long *longitude);
	 void get_position(void);
    // date as ddmmyy, time as hhmmsscc, and age in milliseconds
 //    void get_datetime(unsigned long *date, unsigned long *time);
   void get_date(void);
    void get_time(void);
    // signed altitude in centimeters (from GPGGA sentence)
     long altitude(void);

    // course in last full GPRMC sentence in 100th of a degree
     unsigned long course(void);
    
    // speed in last full GPRMC sentence in 100ths of a knot
    unsigned long speed(void);

	 byte numsats(void);

#endif
 
