Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Nucleo_SerialGPS_to_PC by
Revision 0:e0a6c18ea0fb, committed 2015-01-05
- Comitter:
- veyselka
- Date:
- Mon Jan 05 15:34:58 2015 +0000
- Commit message:
- SerialGPS library test Nucleo STM32F401RE; Read GPS from USART 1; Send GPS information USART PC
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SerialGPS.lib Mon Jan 05 15:34:58 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/shintamainjp/code/SerialGPS/#a5b887e09aa4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Jan 05 15:34:58 2015 +0000
@@ -0,0 +1,96 @@
+#include "mbed.h"
+#include "SerialGPS.h"
+
+
+Serial pc(USBTX, USBRX); // tx, rx
+SerialGPS gps(PA_9,PA_10); // tx, rx
+
+
+
+
+/**
+ * A callback function for logging data.
+ */
+void cbfunc_log(char *s) {
+
+}
+
+/**
+ * A callback function for GGA.
+ *
+ * GGA - Global Positioning System Fixed Data.
+ */
+void cbfunc_gga(SerialGPS::gps_gga_t *p) {
+
+ pc.printf("%02d:%02d:%02d(P%d,S%d)\r\n", p->hour, p->min, p->sec, p->position_fix, p->satellites_used);
+
+ pc.printf("%c=%10.4f\r\n", p->ns, p->latitude);
+
+ pc.printf("%c=%10.4f\r\n", p->ew, p->longitude);
+
+}
+
+/**
+ * A callback function for GSA.
+ *
+ * GSA - GNSS DOP and Active Satellites.
+ */
+void cbfunc_gsa(SerialGPS::gps_gsa_t *p) {
+
+ pc.printf("SEL:%c FIX:%d\r\n", p->selmode, p->fix);
+
+}
+
+/**
+ * A callback function for GSV.
+ *
+ * GSV - GNSS Satellites in View.
+ */
+void cbfunc_gsv(SerialGPS::gps_gsv_t *p) {
+
+ pc.printf("Satellites:%2d\r\n", p->satcnt);
+
+}
+
+/**
+ * A callback function for RMC.
+ *
+ * RMC - Recommended Minimum Specific GNSS Data.
+ */
+void cbfunc_rmc(SerialGPS::gps_rmc_t *p) {
+
+ pc.printf("%02d:%02d:%02d(%c)\r\n", p->hour, p->min, p->sec, p->status);
+
+}
+
+/**
+ * Entry point.
+ */
+
+
+
+
+int main() {
+
+ pc.baud(9600);
+
+
+ pc.printf("TEST\r\n");
+ wait(0.5);
+
+ SerialGPS::gps_callback_t cb;
+ cb.cbfunc_log = cbfunc_log;
+ cb.cbfunc_gga = cbfunc_gga;
+ cb.cbfunc_gsa = cbfunc_gsa;
+ cb.cbfunc_gsv = cbfunc_gsv;
+ cb.cbfunc_rmc = cbfunc_rmc;
+ gps.attach(&cb);
+
+ while(1) {
+
+
+ gps.processing();
+
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jan 05 15:34:58 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file
