GPS LIB

Committer:
renanbmx123
Date:
Sun Oct 14 02:00:50 2018 +0000
Revision:
0:20506ffee09a
GPS

Who changed what in which revision?

UserRevisionLine numberNew contents of line
renanbmx123 0:20506ffee09a 1 #ifndef GPS_H
renanbmx123 0:20506ffee09a 2 #define GPS_H
renanbmx123 0:20506ffee09a 3
renanbmx123 0:20506ffee09a 4 #include "mbed.h"
renanbmx123 0:20506ffee09a 5
renanbmx123 0:20506ffee09a 6 #define gps_buffer 128 //GPS Buffer size
renanbmx123 0:20506ffee09a 7 // GPS MESSAGE ID'S
renanbmx123 0:20506ffee09a 8 #define GPMRC "$GPRMC" //Recommended minimum specific GNSS data: time, date, position, course, speed
renanbmx123 0:20506ffee09a 9 #define GPVTG "$GPVTG" //Course over ground and ground speed
renanbmx123 0:20506ffee09a 10 #define GPGGA "$GPGGA" //Global positioning system fixed data: time, position, fixed type
renanbmx123 0:20506ffee09a 11 #define GPGSA "$GPGSA"//GPS receiver operating mode,active satellites, and DOP values
renanbmx123 0:20506ffee09a 12 #define GPGSV "$GPGSV"//GNSS satellites in view: ID number, elevation, azimuth, and SNR values
renanbmx123 0:20506ffee09a 13 #define GPGLL "$GPGLL"//Geographic position:latitude, longitude, UTC time of position fix and status
renanbmx123 0:20506ffee09a 14
renanbmx123 0:20506ffee09a 15 //GPS class object
renanbmx123 0:20506ffee09a 16 class GPS
renanbmx123 0:20506ffee09a 17 {
renanbmx123 0:20506ffee09a 18 public:
renanbmx123 0:20506ffee09a 19 /** Class constructor
renanbmx123 0:20506ffee09a 20 * @param serial is an RawSerial object that will be used for UART communication
renanbmx123 0:20506ffee09a 21 * @param pwr_pin the pin to power on/off GPS module
renanbmx123 0:20506ffee09a 22 * @param baud the baudrate for the UART that will interface the GPS module
renanbmx123 0:20506ffee09a 23 * */
renanbmx123 0:20506ffee09a 24 GPS(Serial* serial, PinName pwr_pin, int pwr_crtl = 1, int baud = 9600);
renanbmx123 0:20506ffee09a 25 /** Class destructor */
renanbmx123 0:20506ffee09a 26 virtual ~GPS();
renanbmx123 0:20506ffee09a 27 void recvAttach (void);
renanbmx123 0:20506ffee09a 28 void set_gps_on(void);
renanbmx123 0:20506ffee09a 29 void set_gps_off(void);
renanbmx123 0:20506ffee09a 30 int data_availiable(float* _lat, float* _lon, float* _alt, float* _tFix, float* _speed, char* NS, char* EW, int* _date, char* Ualt);
renanbmx123 0:20506ffee09a 31 void int_mng(int value);
renanbmx123 0:20506ffee09a 32 private:
renanbmx123 0:20506ffee09a 33 Serial* _gps;
renanbmx123 0:20506ffee09a 34 DigitalOut *_pwr_pin;
renanbmx123 0:20506ffee09a 35 char gps_active;
renanbmx123 0:20506ffee09a 36 char data[90];
renanbmx123 0:20506ffee09a 37
renanbmx123 0:20506ffee09a 38
renanbmx123 0:20506ffee09a 39 float lat, lon, alt, tFix, speed, cog, hdop, vdop, pdop;
renanbmx123 0:20506ffee09a 40 char status, NorthSouth, EastWest,mode[2],sat[2],unit;
renanbmx123 0:20506ffee09a 41 int date,fq, nst;
renanbmx123 0:20506ffee09a 42 int int_ctrl;
renanbmx123 0:20506ffee09a 43
renanbmx123 0:20506ffee09a 44 };
renanbmx123 0:20506ffee09a 45 #endif