Receive GPS by interrupt processing
Dependents: Sample_GPS_INT_lib GPS-SD
GPS_INT.h
- Committer:
- j_rocket_boy
- Date:
- 2018-07-08
- Revision:
- 1:fbe835e114bb
- Parent:
- 0:4b6c377342d9
- Child:
- 2:0af5025cd632
File content as of revision 1:fbe835e114bb:
// -*- coding: utf-8 -*- /** @file GPS_INT.h @brief Recieve GPS using Interrupt @author D.Nakayama @version 1.0 @date 2018-07-08 D.Nakayama Written for C++/mbed. @see Copyright (C) 2017 T.Kawamura. Released under the MIT license. http://opensource.org/licenses/mit-license.php */ #ifndef INCLUDED_GPS_INT_h_ #define INCLUDED_GPS_INT_h_ #include "mbed.h" /** @class GPS_INT @brief "Recieve GPS class" using Interrupt */ class GPS_INT{ public: //コンストラクタ /** @brief Create a new gps(UART). @param txpin Tx pin name (Defined in PinName.h) @param rxpin Rx pin name (Defined in PinName.h) @param baudrate Baudrate (ex: 4800). Default value is 9600. */ GPS_INT(PinName tx, PinName rx, int baud = 9600); //デストラクタ /** @brief Disable the gps Port. @param No parameters. */ virtual ~GPS_INT(); bool location_is_update(void); //位置情報が更新されたか(緯度,経度,DOP) bool info_is_update(void); //それ以外の情報が更新されたか bool is_lock(void); //GPSがロックしたか //受信する情報 struct tm t; //時刻UTC time_t seconds; //時刻(UTC1900年1月1日からの経過時間) double lon; //緯度, 度(北緯が正) double lat; //経度, 度(東経が正) volatile int lock; //位置特定品質(0:位置特定できない, 1:SPS(標準測位サービス), 2:differencial GPS) int n_sat; //使用衛星数 float HDOP; //水平精度低下率 float VDOP; //垂直精度低下率 float PDOP; //位置精度低下率 float h_see; //アンテナ海抜高さ, m float h_geo; //ジオイド高さ, m private: Serial gps; bool location_update; bool info_update; int date_raw; //UTC 日付生データ float time_raw; //UTC 時刻生データ double lon_raw; //緯度生データ int lon_int; //緯度整数部 double lon_minute; //緯度分 char ns; //北緯or南緯 double lat_raw; //経度生データ int lat_int; //経度整数部 double lat_minute; //経度分 char ew; //東経or西経 void get_char(void); void gps_update(char* buffer); }; #endif