Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
Sensors/GPS/GPS.h@0:826c6171fc1b, 2012-06-20 (annotated)
- Committer:
- shimniok
- Date:
- Wed Jun 20 14:57:48 2012 +0000
- Revision:
- 0:826c6171fc1b
Updated documentation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimniok | 0:826c6171fc1b | 1 | // For SiRF III |
shimniok | 0:826c6171fc1b | 2 | |
shimniok | 0:826c6171fc1b | 3 | #ifndef __GPS_H |
shimniok | 0:826c6171fc1b | 4 | #define __GPS_H |
shimniok | 0:826c6171fc1b | 5 | |
shimniok | 0:826c6171fc1b | 6 | /** GPS interface abstraction library */ |
shimniok | 0:826c6171fc1b | 7 | |
shimniok | 0:826c6171fc1b | 8 | #include "mbed.h" |
shimniok | 0:826c6171fc1b | 9 | #include "TinyGPS.h" |
shimniok | 0:826c6171fc1b | 10 | #include "GeoPosition.h" |
shimniok | 0:826c6171fc1b | 11 | |
shimniok | 0:826c6171fc1b | 12 | #define SIRF 1 |
shimniok | 0:826c6171fc1b | 13 | #define MTK 2 |
shimniok | 0:826c6171fc1b | 14 | #define VENUS 3 |
shimniok | 0:826c6171fc1b | 15 | |
shimniok | 0:826c6171fc1b | 16 | class GPS { |
shimniok | 0:826c6171fc1b | 17 | public: |
shimniok | 0:826c6171fc1b | 18 | GPS(PinName tx, PinName rx, int type); |
shimniok | 0:826c6171fc1b | 19 | void setType(int type); |
shimniok | 0:826c6171fc1b | 20 | void setBaud(int baud); |
shimniok | 0:826c6171fc1b | 21 | void setUpdateRate(int rate); |
shimniok | 0:826c6171fc1b | 22 | void setNmeaMessages(bool gga, bool gsa, bool gsv, bool gll, bool rmc, bool vtg); |
shimniok | 0:826c6171fc1b | 23 | void gsvMessage(bool enable); |
shimniok | 0:826c6171fc1b | 24 | void gsaMessage(bool enable); |
shimniok | 0:826c6171fc1b | 25 | void process(GeoPosition &here, char *date, char *time); |
shimniok | 0:826c6171fc1b | 26 | void init(void); |
shimniok | 0:826c6171fc1b | 27 | void gpsStartCapture(void); |
shimniok | 0:826c6171fc1b | 28 | void gpsStopCapture(void); |
shimniok | 0:826c6171fc1b | 29 | void recv(void); |
shimniok | 0:826c6171fc1b | 30 | int year; // gps date variables |
shimniok | 0:826c6171fc1b | 31 | byte month; |
shimniok | 0:826c6171fc1b | 32 | byte day; |
shimniok | 0:826c6171fc1b | 33 | byte hour; |
shimniok | 0:826c6171fc1b | 34 | byte minute; |
shimniok | 0:826c6171fc1b | 35 | byte second; |
shimniok | 0:826c6171fc1b | 36 | byte hundredths; |
shimniok | 0:826c6171fc1b | 37 | float hdop; // gps horizontal dilution of precision |
shimniok | 0:826c6171fc1b | 38 | Serial serial; |
shimniok | 0:826c6171fc1b | 39 | TinyGPS nmea; |
shimniok | 0:826c6171fc1b | 40 | private: |
shimniok | 0:826c6171fc1b | 41 | PinName _rx; |
shimniok | 0:826c6171fc1b | 42 | int _type; // type of GPS device |
shimniok | 0:826c6171fc1b | 43 | }; |
shimniok | 0:826c6171fc1b | 44 | |
shimniok | 0:826c6171fc1b | 45 | #endif |